unify-external-plugin-platform 0.0.3-40 → 0.0.3-42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/external-plugin.common.js +324 -209
- package/dist/external-plugin.css +1 -1
- package/dist/external-plugin.umd.js +324 -209
- package/dist/external-plugin.umd.min.js +1 -1
- package/package.json +1 -1
@@ -83194,8 +83194,8 @@ var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function re
|
|
83194
83194
|
};
|
83195
83195
|
var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
|
83196
83196
|
|
83197
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=
|
83198
|
-
var
|
83197
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=template&id=16946b5e&scoped=true&
|
83198
|
+
var scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_render = function render() {
|
83199
83199
|
var _vm = this,
|
83200
83200
|
_c = _vm._self._c;
|
83201
83201
|
return _c('div', {
|
@@ -83261,7 +83261,7 @@ var scanner_camera_componentvue_type_template_id_16a059c9_scoped_true_render = f
|
|
83261
83261
|
}, [_vm._v(_vm._s(item.label))]) : _vm._e()];
|
83262
83262
|
}), _vm._t("action")]], 2)])]);
|
83263
83263
|
};
|
83264
|
-
var
|
83264
|
+
var scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_staticRenderFns = [];
|
83265
83265
|
|
83266
83266
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
83267
83267
|
function _typeof(obj) {
|
@@ -84783,6 +84783,304 @@ _defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
|
|
84783
84783
|
_defineProperty(WeiRongPluginService, "ws", void 0);
|
84784
84784
|
_defineProperty(WeiRongPluginService, "requestStore", []);
|
84785
84785
|
_defineProperty(WeiRongPluginService, "timer", null);
|
84786
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/han-wang-plugin.service.ts
|
84787
|
+
|
84788
|
+
|
84789
|
+
/**
|
84790
|
+
* @author: lvcy
|
84791
|
+
* @date: 2025-04-24 10:55
|
84792
|
+
* @description:汉王签字板
|
84793
|
+
*/
|
84794
|
+
|
84795
|
+
|
84796
|
+
var HanWangMethodCode;
|
84797
|
+
(function (HanWangMethodCode) {
|
84798
|
+
// 初始化
|
84799
|
+
HanWangMethodCode["Init"] = "init";
|
84800
|
+
// 打开设备(开始签名)
|
84801
|
+
HanWangMethodCode["StartSignName"] = "startSignName";
|
84802
|
+
// 关闭设备
|
84803
|
+
HanWangMethodCode["Close"] = "close";
|
84804
|
+
// 重新签名
|
84805
|
+
HanWangMethodCode["SignNameAgain"] = "signNameAgain";
|
84806
|
+
// 获取签名图片
|
84807
|
+
HanWangMethodCode["GetSign"] = "GetSign";
|
84808
|
+
/** 扫描-主摄像头 */
|
84809
|
+
HanWangMethodCode["ScannerMainCamera_Base64"] = "main";
|
84810
|
+
/** 扫描-副摄像头 */
|
84811
|
+
HanWangMethodCode["ScannerSecondaryCamera_Base64"] = "vice";
|
84812
|
+
/** 拍照 */
|
84813
|
+
HanWangMethodCode["TakePhoto_Base64"] = "takePhoto";
|
84814
|
+
/** 高拍仪读卡 */
|
84815
|
+
HanWangMethodCode["ScannerReadCard"] = "ScannerReadCard";
|
84816
|
+
})(HanWangMethodCode || (HanWangMethodCode = {}));
|
84817
|
+
class HanWangPluginService {
|
84818
|
+
// 高拍仪
|
84819
|
+
|
84820
|
+
static startConnect(url) {
|
84821
|
+
// 如果已经连接(OPEN状态),直接返回已解决的Promise
|
84822
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
84823
|
+
return Promise.resolve(true);
|
84824
|
+
}
|
84825
|
+
// 如果正在连接中,返回当前Promise
|
84826
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84827
|
+
return this.connectingPromise;
|
84828
|
+
}
|
84829
|
+
const ws = new WebSocket(url);
|
84830
|
+
let resolved;
|
84831
|
+
this.connectingPromise = new Promise(resolve => {
|
84832
|
+
resolved = resolve;
|
84833
|
+
});
|
84834
|
+
ws.onopen = () => {
|
84835
|
+
resolved(true);
|
84836
|
+
};
|
84837
|
+
ws.onmessage = event => {
|
84838
|
+
this.handleMessage(event);
|
84839
|
+
};
|
84840
|
+
ws.onclose = () => this.handleClose();
|
84841
|
+
ws.onerror = e => this.handleError(e);
|
84842
|
+
this.ws = ws;
|
84843
|
+
return this.connectingPromise;
|
84844
|
+
}
|
84845
|
+
static handleMessage(msg) {
|
84846
|
+
let data = {};
|
84847
|
+
try {
|
84848
|
+
data = JSON.parse(msg.data);
|
84849
|
+
} catch (e) {
|
84850
|
+
data = {};
|
84851
|
+
}
|
84852
|
+
if (data.HWPenSign === 'HWGetSign' && data.msgID == '0') {
|
84853
|
+
// 汉王签字板
|
84854
|
+
const event = new SignResultEvent(data.message.replace('data:image/png;base64,', ''));
|
84855
|
+
return window.dispatchEvent(event);
|
84856
|
+
}
|
84857
|
+
if (data.FuncName === 'VideoStream') {
|
84858
|
+
// 汉王高拍仪
|
84859
|
+
//显示视频流不做输出
|
84860
|
+
const event = new ScannerCameraRefreshPhotoEvent(data.ImageBase64);
|
84861
|
+
return window.dispatchEvent(event);
|
84862
|
+
}
|
84863
|
+
this.requestStore.forEach(({
|
84864
|
+
resolve
|
84865
|
+
}) => {
|
84866
|
+
resolve(data);
|
84867
|
+
});
|
84868
|
+
this.requestStore = [];
|
84869
|
+
// this.ws.close();
|
84870
|
+
}
|
84871
|
+
|
84872
|
+
static handleError(e) {
|
84873
|
+
for (const type in this.requestStore) {
|
84874
|
+
this.requestStore.forEach(({
|
84875
|
+
reject
|
84876
|
+
}) => {
|
84877
|
+
reject('handleError');
|
84878
|
+
});
|
84879
|
+
}
|
84880
|
+
}
|
84881
|
+
static handleClose() {
|
84882
|
+
for (const type in this.requestStore) {
|
84883
|
+
this.requestStore.forEach(({
|
84884
|
+
reject
|
84885
|
+
}) => {
|
84886
|
+
reject('close');
|
84887
|
+
});
|
84888
|
+
}
|
84889
|
+
}
|
84890
|
+
static async read(method) {
|
84891
|
+
let url = '',
|
84892
|
+
data = {};
|
84893
|
+
switch (method) {
|
84894
|
+
case HanWangMethodCode.Init:
|
84895
|
+
data = {};
|
84896
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetDeviceStatus';
|
84897
|
+
break;
|
84898
|
+
case HanWangMethodCode.StartSignName:
|
84899
|
+
data = {
|
84900
|
+
nLogo: "? ",
|
84901
|
+
nPenwidth: "2",
|
84902
|
+
nOrgX: "100",
|
84903
|
+
nOrgY: "200",
|
84904
|
+
width: "500",
|
84905
|
+
height: "300",
|
84906
|
+
fingerFap: "2",
|
84907
|
+
key: "4A05564228DF2C64AF2E137B71A4E7A3"
|
84908
|
+
};
|
84909
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWInitialize';
|
84910
|
+
break;
|
84911
|
+
case HanWangMethodCode.GetSign:
|
84912
|
+
data = {
|
84913
|
+
nImageType: "3",
|
84914
|
+
nImageWidth: "500",
|
84915
|
+
nImageHeight: "300"
|
84916
|
+
};
|
84917
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetSign';
|
84918
|
+
break;
|
84919
|
+
}
|
84920
|
+
let res = await CustomAxios.get(url, data);
|
84921
|
+
return res;
|
84922
|
+
}
|
84923
|
+
static async readInLinux(methodCode) {
|
84924
|
+
await this.startConnect(this.linuxWebServiceUrl);
|
84925
|
+
if (this.ws.readyState === 1) {
|
84926
|
+
let param = '';
|
84927
|
+
switch (methodCode) {
|
84928
|
+
case HanWangMethodCode.Init:
|
84929
|
+
param = JSON.stringify({
|
84930
|
+
HWPenSign: 'HWGetDeviceStatus'
|
84931
|
+
});
|
84932
|
+
break;
|
84933
|
+
case HanWangMethodCode.StartSignName:
|
84934
|
+
param = JSON.stringify({
|
84935
|
+
HWPenSign: 'HWInitialize',
|
84936
|
+
key: "D9063E7FE567E09E84B00B5ECDE9B3F2",
|
84937
|
+
title: "请在签字板上签名",
|
84938
|
+
nOrgX: 400,
|
84939
|
+
nOrgY: 350,
|
84940
|
+
nWidth: 600,
|
84941
|
+
nHeight: 400,
|
84942
|
+
showDialog: 1,
|
84943
|
+
nImageWidth: 250,
|
84944
|
+
nImageHeight: 150,
|
84945
|
+
nConfirmTimeout: 30,
|
84946
|
+
fingerCap: 1,
|
84947
|
+
nFingerCap: 0
|
84948
|
+
});
|
84949
|
+
break;
|
84950
|
+
}
|
84951
|
+
this.ws.send(param);
|
84952
|
+
return new Promise((resolve, reject) => {
|
84953
|
+
if (!this.requestStore) {
|
84954
|
+
this.requestStore = [];
|
84955
|
+
}
|
84956
|
+
this.requestStore.push({
|
84957
|
+
resolve,
|
84958
|
+
reject
|
84959
|
+
});
|
84960
|
+
});
|
84961
|
+
}
|
84962
|
+
}
|
84963
|
+
static async signNameRead() {
|
84964
|
+
return new Promise(async resolve => {
|
84965
|
+
if (this._isLinux) {
|
84966
|
+
// 国产环境
|
84967
|
+
let res = await HanWangPluginService.readInLinux(HanWangMethodCode.Init);
|
84968
|
+
console.log('初始化=>', res);
|
84969
|
+
if (res.msgID == 0) {
|
84970
|
+
let signRes = await HanWangPluginService.readInLinux(HanWangMethodCode.StartSignName);
|
84971
|
+
console.log('签字=>', signRes);
|
84972
|
+
if (signRes.msgID == 0) {
|
84973
|
+
resolve('');
|
84974
|
+
}
|
84975
|
+
} else {
|
84976
|
+
throw Error('统一插件平台设备未准备完成');
|
84977
|
+
}
|
84978
|
+
} else {
|
84979
|
+
// windows
|
84980
|
+
// 链接
|
84981
|
+
let status = await HanWangPluginService.read(HanWangMethodCode.Init);
|
84982
|
+
if (status.msgID !== '0') {
|
84983
|
+
throw Error('统一插件平台设备未准备完成');
|
84984
|
+
}
|
84985
|
+
// 签字
|
84986
|
+
let res = await HanWangPluginService.read(HanWangMethodCode.StartSignName);
|
84987
|
+
if (res.msgID !== '0') {
|
84988
|
+
throw Error('统一插件平台设备未准备完成');
|
84989
|
+
}
|
84990
|
+
// 获取签字照片
|
84991
|
+
let timer = setInterval(async () => {
|
84992
|
+
let signRes = await HanWangPluginService.read(HanWangMethodCode.GetSign);
|
84993
|
+
if (signRes.msgID === '0') {
|
84994
|
+
clearInterval(timer);
|
84995
|
+
resolve(signRes.message.replace('data:image/png;base64,', ''));
|
84996
|
+
}
|
84997
|
+
}, 2000);
|
84998
|
+
}
|
84999
|
+
});
|
85000
|
+
}
|
85001
|
+
static async readScan(method) {
|
85002
|
+
await this.startConnect(this.windowsWebScanServiceUrl);
|
85003
|
+
if (this.ws.readyState === 1) {
|
85004
|
+
let method = '';
|
85005
|
+
switch (method) {
|
85006
|
+
case HanWangMethodCode.ScannerMainCamera_Base64:
|
85007
|
+
// 主摄像头
|
85008
|
+
this.ws.send(JSON.stringify({
|
85009
|
+
'FuncName': 'CloseCamera'
|
85010
|
+
})); // 关闭已经打开的摄像头
|
85011
|
+
this.ws.send(JSON.stringify({
|
85012
|
+
'FuncName': 'SetCropMode',
|
85013
|
+
'CropMode': 1
|
85014
|
+
})); // 开启纠偏
|
85015
|
+
method = JSON.stringify({
|
85016
|
+
'FuncName': 'OpenCamera',
|
85017
|
+
'CamIndex': 0
|
85018
|
+
});
|
85019
|
+
break;
|
85020
|
+
case HanWangMethodCode.ScannerSecondaryCamera_Base64:
|
85021
|
+
// 副摄像头
|
85022
|
+
this.ws.send(JSON.stringify({
|
85023
|
+
'FuncName': 'CloseCamera'
|
85024
|
+
})); // 关闭已经打开的摄像头
|
85025
|
+
this.ws.send(JSON.stringify({
|
85026
|
+
'FuncName': 'SetCropMode',
|
85027
|
+
'CropMode': 0
|
85028
|
+
})); // 关闭纠偏
|
85029
|
+
method = JSON.stringify({
|
85030
|
+
'FuncName': 'OpenCamera',
|
85031
|
+
'CamIndex': 1
|
85032
|
+
});
|
85033
|
+
break;
|
85034
|
+
case HanWangMethodCode.TakePhoto_Base64:
|
85035
|
+
// 主摄像头
|
85036
|
+
method = JSON.stringify({
|
85037
|
+
'FuncName': 'SaveToImage',
|
85038
|
+
'FilePath': 'ToBase64'
|
85039
|
+
});
|
85040
|
+
break;
|
85041
|
+
case HanWangMethodCode.ScannerReadCard:
|
85042
|
+
// 读卡
|
85043
|
+
method = JSON.stringify({
|
85044
|
+
'FuncName': 'ReadIDCard'
|
85045
|
+
});
|
85046
|
+
break;
|
85047
|
+
}
|
85048
|
+
this.ws.send(method);
|
85049
|
+
return new Promise((resolve, reject) => {
|
85050
|
+
if (!this.requestStore) {
|
85051
|
+
this.requestStore = [];
|
85052
|
+
}
|
85053
|
+
this.requestStore.push({
|
85054
|
+
resolve,
|
85055
|
+
reject
|
85056
|
+
});
|
85057
|
+
});
|
85058
|
+
}
|
85059
|
+
}
|
85060
|
+
static async turnOnTheCamera(type) {
|
85061
|
+
if (this.ws) this.ws.close();
|
85062
|
+
switch (type) {
|
85063
|
+
case 'main':
|
85064
|
+
await HanWangPluginService.readScan(HanWangMethodCode.ScannerMainCamera_Base64);
|
85065
|
+
break;
|
85066
|
+
case 'vice':
|
85067
|
+
await HanWangPluginService.readScan(HanWangMethodCode.ScannerSecondaryCamera_Base64);
|
85068
|
+
break;
|
85069
|
+
}
|
85070
|
+
}
|
85071
|
+
// 高拍仪拍照
|
85072
|
+
static async scanByCamera() {
|
85073
|
+
let res = await HanWangPluginService.readScan(HanWangMethodCode.TakePhoto_Base64);
|
85074
|
+
return res.RetInfo;
|
85075
|
+
}
|
85076
|
+
}
|
85077
|
+
_defineProperty(HanWangPluginService, "windowsWebServiceUrl", 'http://127.0.0.1:29999');
|
85078
|
+
_defineProperty(HanWangPluginService, "linuxWebServiceUrl", 'ws://127.0.0.1:29999');
|
85079
|
+
_defineProperty(HanWangPluginService, "windowsWebScanServiceUrl", 'ws://127.0.0.1:27896');
|
85080
|
+
_defineProperty(HanWangPluginService, "ws", void 0);
|
85081
|
+
_defineProperty(HanWangPluginService, "connectingPromise", new Promise((resolve, reject) => {}));
|
85082
|
+
_defineProperty(HanWangPluginService, "requestStore", []);
|
85083
|
+
_defineProperty(HanWangPluginService, "_isLinux", String(navigator.platform).indexOf("Linux") > -1);
|
84786
85084
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
84787
85085
|
|
84788
85086
|
|
@@ -84792,12 +85090,13 @@ _defineProperty(WeiRongPluginService, "timer", null);
|
|
84792
85090
|
|
84793
85091
|
|
84794
85092
|
|
85093
|
+
|
84795
85094
|
const BEGIN_DATA = 'data:image/jpg;base64,';
|
84796
85095
|
/* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
|
84797
85096
|
name: "scanner-camera-component",
|
84798
85097
|
props: {
|
84799
85098
|
/**
|
84800
|
-
* 高拍仪型号 0-捷宇;3:方正高影仪;4:紫图速拍仪;5
|
85099
|
+
* 高拍仪型号 0-捷宇;3:方正高影仪;4:紫图速拍仪;5-良田;6-国产一体机;7-赞采;8-汉王高拍仪
|
84801
85100
|
*/
|
84802
85101
|
machineType: {
|
84803
85102
|
//
|
@@ -84851,7 +85150,7 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84851
85150
|
if (newVal && newVal.startsWith("http")) {
|
84852
85151
|
CustomAxios.get(newVal).then(res => {
|
84853
85152
|
if (this.machineType === 5 && res.code !== '0') {
|
84854
|
-
this.loadSuccess =
|
85153
|
+
this.loadSuccess = true;
|
84855
85154
|
}
|
84856
85155
|
}).catch(err => {
|
84857
85156
|
this.loadSuccess = false;
|
@@ -84943,6 +85242,13 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84943
85242
|
this.$emit('send-scanner-result', `${BEGIN_DATA}${res}`);
|
84944
85243
|
break;
|
84945
85244
|
}
|
85245
|
+
case 8:
|
85246
|
+
{
|
85247
|
+
// 汉王高拍仪 拍照
|
85248
|
+
let res = await HanWangPluginService.scanByCamera();
|
85249
|
+
this.$emit('send-scanner-result', `${BEGIN_DATA}${res}`);
|
85250
|
+
break;
|
85251
|
+
}
|
84946
85252
|
}
|
84947
85253
|
},
|
84948
85254
|
/**
|
@@ -84978,6 +85284,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84978
85284
|
// 国产客户端一体机
|
84979
85285
|
await WeiRongPluginService.turnOnTheCamera();
|
84980
85286
|
break;
|
85287
|
+
case 8:
|
85288
|
+
// 汉王高拍仪(主)
|
85289
|
+
await HanWangPluginService.turnOnTheCamera('main');
|
85290
|
+
break;
|
84981
85291
|
}
|
84982
85292
|
},
|
84983
85293
|
async getEloamFrame() {
|
@@ -85020,6 +85330,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85020
85330
|
// 国产客户端一体机
|
85021
85331
|
await WeiRongPluginService.turnOnTheCamera();
|
85022
85332
|
break;
|
85333
|
+
case 8:
|
85334
|
+
// 汉王高拍仪 副
|
85335
|
+
await HanWangPluginService.turnOnTheCamera('vice');
|
85336
|
+
break;
|
85023
85337
|
}
|
85024
85338
|
},
|
85025
85339
|
async takePictureMerge(type) {
|
@@ -85096,10 +85410,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85096
85410
|
});
|
85097
85411
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
85098
85412
|
/* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
|
85099
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
85413
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=16946b5e&prod&scoped=true&lang=scss&
|
85100
85414
|
// extracted by mini-css-extract-plugin
|
85101
85415
|
|
85102
|
-
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
85416
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=16946b5e&prod&scoped=true&lang=scss&
|
85103
85417
|
|
85104
85418
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
|
85105
85419
|
|
@@ -85112,11 +85426,11 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85112
85426
|
|
85113
85427
|
var scanner_camera_component_component = normalizeComponent(
|
85114
85428
|
component_scanner_camera_componentvue_type_script_lang_js_,
|
85115
|
-
|
85116
|
-
|
85429
|
+
scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_render,
|
85430
|
+
scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_staticRenderFns,
|
85117
85431
|
false,
|
85118
85432
|
null,
|
85119
|
-
"
|
85433
|
+
"16946b5e",
|
85120
85434
|
null
|
85121
85435
|
|
85122
85436
|
)
|
@@ -88315,205 +88629,6 @@ class JingLunPluginService {
|
|
88315
88629
|
}
|
88316
88630
|
}
|
88317
88631
|
_defineProperty(JingLunPluginService, "idCardWebSocketUrl", 'http://127.0.0.1:18889');
|
88318
|
-
;// CONCATENATED MODULE: ./packages/service/external-plugins/han-wang-plugin.service.ts
|
88319
|
-
|
88320
|
-
|
88321
|
-
/**
|
88322
|
-
* @author: lvcy
|
88323
|
-
* @date: 2025-04-24 10:55
|
88324
|
-
* @description:汉王签字板
|
88325
|
-
*/
|
88326
|
-
|
88327
|
-
|
88328
|
-
var HanWangMethodCode;
|
88329
|
-
(function (HanWangMethodCode) {
|
88330
|
-
// 初始化
|
88331
|
-
HanWangMethodCode["Init"] = "init";
|
88332
|
-
// 打开设备(开始签名)
|
88333
|
-
HanWangMethodCode["StartSignName"] = "startSignName";
|
88334
|
-
// 关闭设备
|
88335
|
-
HanWangMethodCode["Close"] = "close";
|
88336
|
-
// 重新签名
|
88337
|
-
HanWangMethodCode["SignNameAgain"] = "signNameAgain";
|
88338
|
-
// 获取签名图片
|
88339
|
-
HanWangMethodCode["GetSign"] = "GetSign";
|
88340
|
-
})(HanWangMethodCode || (HanWangMethodCode = {}));
|
88341
|
-
class HanWangPluginService {
|
88342
|
-
static startConnect() {
|
88343
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
88344
|
-
return this;
|
88345
|
-
}
|
88346
|
-
const ws = new WebSocket(this.linuxWebServiceUrl);
|
88347
|
-
let resolved;
|
88348
|
-
const onConnect = new Promise(resolve => {
|
88349
|
-
resolved = resolve;
|
88350
|
-
});
|
88351
|
-
ws.onopen = () => {
|
88352
|
-
resolved(true);
|
88353
|
-
};
|
88354
|
-
ws.onmessage = event => {
|
88355
|
-
this.handleMessage(event);
|
88356
|
-
};
|
88357
|
-
ws.onclose = () => this.handleClose();
|
88358
|
-
ws.onerror = e => this.handleError(e);
|
88359
|
-
this.ws = ws;
|
88360
|
-
return onConnect;
|
88361
|
-
}
|
88362
|
-
static handleMessage(msg) {
|
88363
|
-
let data = {};
|
88364
|
-
try {
|
88365
|
-
data = JSON.parse(msg.data);
|
88366
|
-
} catch (e) {
|
88367
|
-
data = {};
|
88368
|
-
}
|
88369
|
-
if (data.HWPenSign === 'HWGetSign' && data.msgID == '0') {
|
88370
|
-
const event = new SignResultEvent(data.message.replace('data:image/png;base64,', ''));
|
88371
|
-
return window.dispatchEvent(event);
|
88372
|
-
}
|
88373
|
-
this.requestStore.forEach(({
|
88374
|
-
resolve
|
88375
|
-
}) => {
|
88376
|
-
resolve(data);
|
88377
|
-
});
|
88378
|
-
this.requestStore = [];
|
88379
|
-
// this.ws.close();
|
88380
|
-
}
|
88381
|
-
|
88382
|
-
static handleError(e) {
|
88383
|
-
for (const type in this.requestStore) {
|
88384
|
-
this.requestStore.forEach(({
|
88385
|
-
reject
|
88386
|
-
}) => {
|
88387
|
-
reject('handleError');
|
88388
|
-
});
|
88389
|
-
}
|
88390
|
-
}
|
88391
|
-
static handleClose() {
|
88392
|
-
for (const type in this.requestStore) {
|
88393
|
-
this.requestStore.forEach(({
|
88394
|
-
reject
|
88395
|
-
}) => {
|
88396
|
-
reject('close');
|
88397
|
-
});
|
88398
|
-
}
|
88399
|
-
}
|
88400
|
-
static async read(method) {
|
88401
|
-
let url = '',
|
88402
|
-
data = {};
|
88403
|
-
switch (method) {
|
88404
|
-
case HanWangMethodCode.Init:
|
88405
|
-
data = {};
|
88406
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetDeviceStatus';
|
88407
|
-
break;
|
88408
|
-
case HanWangMethodCode.StartSignName:
|
88409
|
-
data = {
|
88410
|
-
nLogo: "? ",
|
88411
|
-
nPenwidth: "2",
|
88412
|
-
nOrgX: "100",
|
88413
|
-
nOrgY: "200",
|
88414
|
-
width: "500",
|
88415
|
-
height: "300",
|
88416
|
-
fingerFap: "2",
|
88417
|
-
key: "4A05564228DF2C64AF2E137B71A4E7A3"
|
88418
|
-
};
|
88419
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWInitialize';
|
88420
|
-
break;
|
88421
|
-
case HanWangMethodCode.GetSign:
|
88422
|
-
data = {
|
88423
|
-
nImageType: "3",
|
88424
|
-
nImageWidth: "500",
|
88425
|
-
nImageHeight: "300"
|
88426
|
-
};
|
88427
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetSign';
|
88428
|
-
break;
|
88429
|
-
}
|
88430
|
-
let res = await CustomAxios.get(url, data);
|
88431
|
-
return res;
|
88432
|
-
}
|
88433
|
-
static async readInLinux(methodCode) {
|
88434
|
-
await this.startConnect();
|
88435
|
-
if (this.ws.readyState === 1) {
|
88436
|
-
let param = '';
|
88437
|
-
switch (methodCode) {
|
88438
|
-
case HanWangMethodCode.Init:
|
88439
|
-
param = JSON.stringify({
|
88440
|
-
HWPenSign: 'HWGetDeviceStatus'
|
88441
|
-
});
|
88442
|
-
break;
|
88443
|
-
case HanWangMethodCode.StartSignName:
|
88444
|
-
param = JSON.stringify({
|
88445
|
-
HWPenSign: 'HWInitialize',
|
88446
|
-
key: "D9063E7FE567E09E84B00B5ECDE9B3F2",
|
88447
|
-
title: "请在签字板上签名",
|
88448
|
-
nOrgX: 400,
|
88449
|
-
nOrgY: 350,
|
88450
|
-
nWidth: 600,
|
88451
|
-
nHeight: 400,
|
88452
|
-
showDialog: 1,
|
88453
|
-
nImageWidth: 250,
|
88454
|
-
nImageHeight: 150,
|
88455
|
-
nConfirmTimeout: 30,
|
88456
|
-
fingerCap: 1,
|
88457
|
-
nFingerCap: 0
|
88458
|
-
});
|
88459
|
-
break;
|
88460
|
-
}
|
88461
|
-
this.ws.send(param);
|
88462
|
-
return new Promise((resolve, reject) => {
|
88463
|
-
if (!this.requestStore) {
|
88464
|
-
this.requestStore = [];
|
88465
|
-
}
|
88466
|
-
this.requestStore.push({
|
88467
|
-
resolve,
|
88468
|
-
reject
|
88469
|
-
});
|
88470
|
-
});
|
88471
|
-
}
|
88472
|
-
}
|
88473
|
-
static async signNameRead() {
|
88474
|
-
return new Promise(async resolve => {
|
88475
|
-
if (this._isLinux) {
|
88476
|
-
// 国产环境
|
88477
|
-
let res = await HanWangPluginService.readInLinux(HanWangMethodCode.Init);
|
88478
|
-
console.log('初始化=>', res);
|
88479
|
-
if (res.msgID == 0) {
|
88480
|
-
let signRes = await HanWangPluginService.readInLinux(HanWangMethodCode.StartSignName);
|
88481
|
-
console.log('签字=>', signRes);
|
88482
|
-
if (signRes.msgID == 0) {
|
88483
|
-
resolve('');
|
88484
|
-
}
|
88485
|
-
} else {
|
88486
|
-
throw Error('统一插件平台设备未准备完成');
|
88487
|
-
}
|
88488
|
-
} else {
|
88489
|
-
// windows
|
88490
|
-
// 链接
|
88491
|
-
let status = await HanWangPluginService.read(HanWangMethodCode.Init);
|
88492
|
-
if (status.msgID !== '0') {
|
88493
|
-
throw Error('统一插件平台设备未准备完成');
|
88494
|
-
}
|
88495
|
-
// 签字
|
88496
|
-
let res = await HanWangPluginService.read(HanWangMethodCode.StartSignName);
|
88497
|
-
if (res.msgID !== '0') {
|
88498
|
-
throw Error('统一插件平台设备未准备完成');
|
88499
|
-
}
|
88500
|
-
// 获取签字照片
|
88501
|
-
let timer = setInterval(async () => {
|
88502
|
-
let signRes = await HanWangPluginService.read(HanWangMethodCode.GetSign);
|
88503
|
-
if (signRes.msgID === '0') {
|
88504
|
-
clearInterval(timer);
|
88505
|
-
resolve(signRes.message.replace('data:image/png;base64,', ''));
|
88506
|
-
}
|
88507
|
-
}, 2000);
|
88508
|
-
}
|
88509
|
-
});
|
88510
|
-
}
|
88511
|
-
}
|
88512
|
-
_defineProperty(HanWangPluginService, "windowsWebServiceUrl", 'http://127.0.0.1:29999');
|
88513
|
-
_defineProperty(HanWangPluginService, "linuxWebServiceUrl", 'ws://127.0.0.1:29999');
|
88514
|
-
_defineProperty(HanWangPluginService, "ws", void 0);
|
88515
|
-
_defineProperty(HanWangPluginService, "requestStore", []);
|
88516
|
-
_defineProperty(HanWangPluginService, "_isLinux", String(navigator.platform).indexOf("Linux") > -1);
|
88517
88632
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/id-card-reader/id-card-reader-button/src/id-card-reader-button.vue?vue&type=script&lang=js&
|
88518
88633
|
|
88519
88634
|
|