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
@@ -83204,8 +83204,8 @@ var scanner_cameravue_type_template_id_00e9072f_scoped_true_render = function re
|
|
83204
83204
|
};
|
83205
83205
|
var scanner_cameravue_type_template_id_00e9072f_scoped_true_staticRenderFns = [];
|
83206
83206
|
|
83207
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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=
|
83208
|
-
var
|
83207
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
83208
|
+
var scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_render = function render() {
|
83209
83209
|
var _vm = this,
|
83210
83210
|
_c = _vm._self._c;
|
83211
83211
|
return _c('div', {
|
@@ -83271,7 +83271,7 @@ var scanner_camera_componentvue_type_template_id_16a059c9_scoped_true_render = f
|
|
83271
83271
|
}, [_vm._v(_vm._s(item.label))]) : _vm._e()];
|
83272
83272
|
}), _vm._t("action")]], 2)])]);
|
83273
83273
|
};
|
83274
|
-
var
|
83274
|
+
var scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_staticRenderFns = [];
|
83275
83275
|
|
83276
83276
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
83277
83277
|
function _typeof(obj) {
|
@@ -84793,6 +84793,304 @@ _defineProperty(WeiRongPluginService, "webSocketUrl", 'ws://127.0.0.1:5847');
|
|
84793
84793
|
_defineProperty(WeiRongPluginService, "ws", void 0);
|
84794
84794
|
_defineProperty(WeiRongPluginService, "requestStore", []);
|
84795
84795
|
_defineProperty(WeiRongPluginService, "timer", null);
|
84796
|
+
;// CONCATENATED MODULE: ./packages/service/external-plugins/han-wang-plugin.service.ts
|
84797
|
+
|
84798
|
+
|
84799
|
+
/**
|
84800
|
+
* @author: lvcy
|
84801
|
+
* @date: 2025-04-24 10:55
|
84802
|
+
* @description:汉王签字板
|
84803
|
+
*/
|
84804
|
+
|
84805
|
+
|
84806
|
+
var HanWangMethodCode;
|
84807
|
+
(function (HanWangMethodCode) {
|
84808
|
+
// 初始化
|
84809
|
+
HanWangMethodCode["Init"] = "init";
|
84810
|
+
// 打开设备(开始签名)
|
84811
|
+
HanWangMethodCode["StartSignName"] = "startSignName";
|
84812
|
+
// 关闭设备
|
84813
|
+
HanWangMethodCode["Close"] = "close";
|
84814
|
+
// 重新签名
|
84815
|
+
HanWangMethodCode["SignNameAgain"] = "signNameAgain";
|
84816
|
+
// 获取签名图片
|
84817
|
+
HanWangMethodCode["GetSign"] = "GetSign";
|
84818
|
+
/** 扫描-主摄像头 */
|
84819
|
+
HanWangMethodCode["ScannerMainCamera_Base64"] = "main";
|
84820
|
+
/** 扫描-副摄像头 */
|
84821
|
+
HanWangMethodCode["ScannerSecondaryCamera_Base64"] = "vice";
|
84822
|
+
/** 拍照 */
|
84823
|
+
HanWangMethodCode["TakePhoto_Base64"] = "takePhoto";
|
84824
|
+
/** 高拍仪读卡 */
|
84825
|
+
HanWangMethodCode["ScannerReadCard"] = "ScannerReadCard";
|
84826
|
+
})(HanWangMethodCode || (HanWangMethodCode = {}));
|
84827
|
+
class HanWangPluginService {
|
84828
|
+
// 高拍仪
|
84829
|
+
|
84830
|
+
static startConnect(url) {
|
84831
|
+
// 如果已经连接(OPEN状态),直接返回已解决的Promise
|
84832
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
84833
|
+
return Promise.resolve(true);
|
84834
|
+
}
|
84835
|
+
// 如果正在连接中,返回当前Promise
|
84836
|
+
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
84837
|
+
return this.connectingPromise;
|
84838
|
+
}
|
84839
|
+
const ws = new WebSocket(url);
|
84840
|
+
let resolved;
|
84841
|
+
this.connectingPromise = new Promise(resolve => {
|
84842
|
+
resolved = resolve;
|
84843
|
+
});
|
84844
|
+
ws.onopen = () => {
|
84845
|
+
resolved(true);
|
84846
|
+
};
|
84847
|
+
ws.onmessage = event => {
|
84848
|
+
this.handleMessage(event);
|
84849
|
+
};
|
84850
|
+
ws.onclose = () => this.handleClose();
|
84851
|
+
ws.onerror = e => this.handleError(e);
|
84852
|
+
this.ws = ws;
|
84853
|
+
return this.connectingPromise;
|
84854
|
+
}
|
84855
|
+
static handleMessage(msg) {
|
84856
|
+
let data = {};
|
84857
|
+
try {
|
84858
|
+
data = JSON.parse(msg.data);
|
84859
|
+
} catch (e) {
|
84860
|
+
data = {};
|
84861
|
+
}
|
84862
|
+
if (data.HWPenSign === 'HWGetSign' && data.msgID == '0') {
|
84863
|
+
// 汉王签字板
|
84864
|
+
const event = new SignResultEvent(data.message.replace('data:image/png;base64,', ''));
|
84865
|
+
return window.dispatchEvent(event);
|
84866
|
+
}
|
84867
|
+
if (data.FuncName === 'VideoStream') {
|
84868
|
+
// 汉王高拍仪
|
84869
|
+
//显示视频流不做输出
|
84870
|
+
const event = new ScannerCameraRefreshPhotoEvent(data.ImageBase64);
|
84871
|
+
return window.dispatchEvent(event);
|
84872
|
+
}
|
84873
|
+
this.requestStore.forEach(({
|
84874
|
+
resolve
|
84875
|
+
}) => {
|
84876
|
+
resolve(data);
|
84877
|
+
});
|
84878
|
+
this.requestStore = [];
|
84879
|
+
// this.ws.close();
|
84880
|
+
}
|
84881
|
+
|
84882
|
+
static handleError(e) {
|
84883
|
+
for (const type in this.requestStore) {
|
84884
|
+
this.requestStore.forEach(({
|
84885
|
+
reject
|
84886
|
+
}) => {
|
84887
|
+
reject('handleError');
|
84888
|
+
});
|
84889
|
+
}
|
84890
|
+
}
|
84891
|
+
static handleClose() {
|
84892
|
+
for (const type in this.requestStore) {
|
84893
|
+
this.requestStore.forEach(({
|
84894
|
+
reject
|
84895
|
+
}) => {
|
84896
|
+
reject('close');
|
84897
|
+
});
|
84898
|
+
}
|
84899
|
+
}
|
84900
|
+
static async read(method) {
|
84901
|
+
let url = '',
|
84902
|
+
data = {};
|
84903
|
+
switch (method) {
|
84904
|
+
case HanWangMethodCode.Init:
|
84905
|
+
data = {};
|
84906
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetDeviceStatus';
|
84907
|
+
break;
|
84908
|
+
case HanWangMethodCode.StartSignName:
|
84909
|
+
data = {
|
84910
|
+
nLogo: "? ",
|
84911
|
+
nPenwidth: "2",
|
84912
|
+
nOrgX: "100",
|
84913
|
+
nOrgY: "200",
|
84914
|
+
width: "500",
|
84915
|
+
height: "300",
|
84916
|
+
fingerFap: "2",
|
84917
|
+
key: "4A05564228DF2C64AF2E137B71A4E7A3"
|
84918
|
+
};
|
84919
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWInitialize';
|
84920
|
+
break;
|
84921
|
+
case HanWangMethodCode.GetSign:
|
84922
|
+
data = {
|
84923
|
+
nImageType: "3",
|
84924
|
+
nImageWidth: "500",
|
84925
|
+
nImageHeight: "300"
|
84926
|
+
};
|
84927
|
+
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetSign';
|
84928
|
+
break;
|
84929
|
+
}
|
84930
|
+
let res = await CustomAxios.get(url, data);
|
84931
|
+
return res;
|
84932
|
+
}
|
84933
|
+
static async readInLinux(methodCode) {
|
84934
|
+
await this.startConnect(this.linuxWebServiceUrl);
|
84935
|
+
if (this.ws.readyState === 1) {
|
84936
|
+
let param = '';
|
84937
|
+
switch (methodCode) {
|
84938
|
+
case HanWangMethodCode.Init:
|
84939
|
+
param = JSON.stringify({
|
84940
|
+
HWPenSign: 'HWGetDeviceStatus'
|
84941
|
+
});
|
84942
|
+
break;
|
84943
|
+
case HanWangMethodCode.StartSignName:
|
84944
|
+
param = JSON.stringify({
|
84945
|
+
HWPenSign: 'HWInitialize',
|
84946
|
+
key: "D9063E7FE567E09E84B00B5ECDE9B3F2",
|
84947
|
+
title: "请在签字板上签名",
|
84948
|
+
nOrgX: 400,
|
84949
|
+
nOrgY: 350,
|
84950
|
+
nWidth: 600,
|
84951
|
+
nHeight: 400,
|
84952
|
+
showDialog: 1,
|
84953
|
+
nImageWidth: 250,
|
84954
|
+
nImageHeight: 150,
|
84955
|
+
nConfirmTimeout: 30,
|
84956
|
+
fingerCap: 1,
|
84957
|
+
nFingerCap: 0
|
84958
|
+
});
|
84959
|
+
break;
|
84960
|
+
}
|
84961
|
+
this.ws.send(param);
|
84962
|
+
return new Promise((resolve, reject) => {
|
84963
|
+
if (!this.requestStore) {
|
84964
|
+
this.requestStore = [];
|
84965
|
+
}
|
84966
|
+
this.requestStore.push({
|
84967
|
+
resolve,
|
84968
|
+
reject
|
84969
|
+
});
|
84970
|
+
});
|
84971
|
+
}
|
84972
|
+
}
|
84973
|
+
static async signNameRead() {
|
84974
|
+
return new Promise(async resolve => {
|
84975
|
+
if (this._isLinux) {
|
84976
|
+
// 国产环境
|
84977
|
+
let res = await HanWangPluginService.readInLinux(HanWangMethodCode.Init);
|
84978
|
+
console.log('初始化=>', res);
|
84979
|
+
if (res.msgID == 0) {
|
84980
|
+
let signRes = await HanWangPluginService.readInLinux(HanWangMethodCode.StartSignName);
|
84981
|
+
console.log('签字=>', signRes);
|
84982
|
+
if (signRes.msgID == 0) {
|
84983
|
+
resolve('');
|
84984
|
+
}
|
84985
|
+
} else {
|
84986
|
+
throw Error('统一插件平台设备未准备完成');
|
84987
|
+
}
|
84988
|
+
} else {
|
84989
|
+
// windows
|
84990
|
+
// 链接
|
84991
|
+
let status = await HanWangPluginService.read(HanWangMethodCode.Init);
|
84992
|
+
if (status.msgID !== '0') {
|
84993
|
+
throw Error('统一插件平台设备未准备完成');
|
84994
|
+
}
|
84995
|
+
// 签字
|
84996
|
+
let res = await HanWangPluginService.read(HanWangMethodCode.StartSignName);
|
84997
|
+
if (res.msgID !== '0') {
|
84998
|
+
throw Error('统一插件平台设备未准备完成');
|
84999
|
+
}
|
85000
|
+
// 获取签字照片
|
85001
|
+
let timer = setInterval(async () => {
|
85002
|
+
let signRes = await HanWangPluginService.read(HanWangMethodCode.GetSign);
|
85003
|
+
if (signRes.msgID === '0') {
|
85004
|
+
clearInterval(timer);
|
85005
|
+
resolve(signRes.message.replace('data:image/png;base64,', ''));
|
85006
|
+
}
|
85007
|
+
}, 2000);
|
85008
|
+
}
|
85009
|
+
});
|
85010
|
+
}
|
85011
|
+
static async readScan(method) {
|
85012
|
+
await this.startConnect(this.windowsWebScanServiceUrl);
|
85013
|
+
if (this.ws.readyState === 1) {
|
85014
|
+
let method = '';
|
85015
|
+
switch (method) {
|
85016
|
+
case HanWangMethodCode.ScannerMainCamera_Base64:
|
85017
|
+
// 主摄像头
|
85018
|
+
this.ws.send(JSON.stringify({
|
85019
|
+
'FuncName': 'CloseCamera'
|
85020
|
+
})); // 关闭已经打开的摄像头
|
85021
|
+
this.ws.send(JSON.stringify({
|
85022
|
+
'FuncName': 'SetCropMode',
|
85023
|
+
'CropMode': 1
|
85024
|
+
})); // 开启纠偏
|
85025
|
+
method = JSON.stringify({
|
85026
|
+
'FuncName': 'OpenCamera',
|
85027
|
+
'CamIndex': 0
|
85028
|
+
});
|
85029
|
+
break;
|
85030
|
+
case HanWangMethodCode.ScannerSecondaryCamera_Base64:
|
85031
|
+
// 副摄像头
|
85032
|
+
this.ws.send(JSON.stringify({
|
85033
|
+
'FuncName': 'CloseCamera'
|
85034
|
+
})); // 关闭已经打开的摄像头
|
85035
|
+
this.ws.send(JSON.stringify({
|
85036
|
+
'FuncName': 'SetCropMode',
|
85037
|
+
'CropMode': 0
|
85038
|
+
})); // 关闭纠偏
|
85039
|
+
method = JSON.stringify({
|
85040
|
+
'FuncName': 'OpenCamera',
|
85041
|
+
'CamIndex': 1
|
85042
|
+
});
|
85043
|
+
break;
|
85044
|
+
case HanWangMethodCode.TakePhoto_Base64:
|
85045
|
+
// 主摄像头
|
85046
|
+
method = JSON.stringify({
|
85047
|
+
'FuncName': 'SaveToImage',
|
85048
|
+
'FilePath': 'ToBase64'
|
85049
|
+
});
|
85050
|
+
break;
|
85051
|
+
case HanWangMethodCode.ScannerReadCard:
|
85052
|
+
// 读卡
|
85053
|
+
method = JSON.stringify({
|
85054
|
+
'FuncName': 'ReadIDCard'
|
85055
|
+
});
|
85056
|
+
break;
|
85057
|
+
}
|
85058
|
+
this.ws.send(method);
|
85059
|
+
return new Promise((resolve, reject) => {
|
85060
|
+
if (!this.requestStore) {
|
85061
|
+
this.requestStore = [];
|
85062
|
+
}
|
85063
|
+
this.requestStore.push({
|
85064
|
+
resolve,
|
85065
|
+
reject
|
85066
|
+
});
|
85067
|
+
});
|
85068
|
+
}
|
85069
|
+
}
|
85070
|
+
static async turnOnTheCamera(type) {
|
85071
|
+
if (this.ws) this.ws.close();
|
85072
|
+
switch (type) {
|
85073
|
+
case 'main':
|
85074
|
+
await HanWangPluginService.readScan(HanWangMethodCode.ScannerMainCamera_Base64);
|
85075
|
+
break;
|
85076
|
+
case 'vice':
|
85077
|
+
await HanWangPluginService.readScan(HanWangMethodCode.ScannerSecondaryCamera_Base64);
|
85078
|
+
break;
|
85079
|
+
}
|
85080
|
+
}
|
85081
|
+
// 高拍仪拍照
|
85082
|
+
static async scanByCamera() {
|
85083
|
+
let res = await HanWangPluginService.readScan(HanWangMethodCode.TakePhoto_Base64);
|
85084
|
+
return res.RetInfo;
|
85085
|
+
}
|
85086
|
+
}
|
85087
|
+
_defineProperty(HanWangPluginService, "windowsWebServiceUrl", 'http://127.0.0.1:29999');
|
85088
|
+
_defineProperty(HanWangPluginService, "linuxWebServiceUrl", 'ws://127.0.0.1:29999');
|
85089
|
+
_defineProperty(HanWangPluginService, "windowsWebScanServiceUrl", 'ws://127.0.0.1:27896');
|
85090
|
+
_defineProperty(HanWangPluginService, "ws", void 0);
|
85091
|
+
_defineProperty(HanWangPluginService, "connectingPromise", new Promise((resolve, reject) => {}));
|
85092
|
+
_defineProperty(HanWangPluginService, "requestStore", []);
|
85093
|
+
_defineProperty(HanWangPluginService, "_isLinux", String(navigator.platform).indexOf("Linux") > -1);
|
84796
85094
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
84797
85095
|
|
84798
85096
|
|
@@ -84802,12 +85100,13 @@ _defineProperty(WeiRongPluginService, "timer", null);
|
|
84802
85100
|
|
84803
85101
|
|
84804
85102
|
|
85103
|
+
|
84805
85104
|
const BEGIN_DATA = 'data:image/jpg;base64,';
|
84806
85105
|
/* harmony default export */ var scanner_camera_componentvue_type_script_lang_js_ = ({
|
84807
85106
|
name: "scanner-camera-component",
|
84808
85107
|
props: {
|
84809
85108
|
/**
|
84810
|
-
* 高拍仪型号 0-捷宇;3:方正高影仪;4:紫图速拍仪;5
|
85109
|
+
* 高拍仪型号 0-捷宇;3:方正高影仪;4:紫图速拍仪;5-良田;6-国产一体机;7-赞采;8-汉王高拍仪
|
84811
85110
|
*/
|
84812
85111
|
machineType: {
|
84813
85112
|
//
|
@@ -84861,7 +85160,7 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84861
85160
|
if (newVal && newVal.startsWith("http")) {
|
84862
85161
|
CustomAxios.get(newVal).then(res => {
|
84863
85162
|
if (this.machineType === 5 && res.code !== '0') {
|
84864
|
-
this.loadSuccess =
|
85163
|
+
this.loadSuccess = true;
|
84865
85164
|
}
|
84866
85165
|
}).catch(err => {
|
84867
85166
|
this.loadSuccess = false;
|
@@ -84953,6 +85252,13 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84953
85252
|
this.$emit('send-scanner-result', `${BEGIN_DATA}${res}`);
|
84954
85253
|
break;
|
84955
85254
|
}
|
85255
|
+
case 8:
|
85256
|
+
{
|
85257
|
+
// 汉王高拍仪 拍照
|
85258
|
+
let res = await HanWangPluginService.scanByCamera();
|
85259
|
+
this.$emit('send-scanner-result', `${BEGIN_DATA}${res}`);
|
85260
|
+
break;
|
85261
|
+
}
|
84956
85262
|
}
|
84957
85263
|
},
|
84958
85264
|
/**
|
@@ -84988,6 +85294,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
84988
85294
|
// 国产客户端一体机
|
84989
85295
|
await WeiRongPluginService.turnOnTheCamera();
|
84990
85296
|
break;
|
85297
|
+
case 8:
|
85298
|
+
// 汉王高拍仪(主)
|
85299
|
+
await HanWangPluginService.turnOnTheCamera('main');
|
85300
|
+
break;
|
84991
85301
|
}
|
84992
85302
|
},
|
84993
85303
|
async getEloamFrame() {
|
@@ -85030,6 +85340,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85030
85340
|
// 国产客户端一体机
|
85031
85341
|
await WeiRongPluginService.turnOnTheCamera();
|
85032
85342
|
break;
|
85343
|
+
case 8:
|
85344
|
+
// 汉王高拍仪 副
|
85345
|
+
await HanWangPluginService.turnOnTheCamera('vice');
|
85346
|
+
break;
|
85033
85347
|
}
|
85034
85348
|
},
|
85035
85349
|
async takePictureMerge(type) {
|
@@ -85106,10 +85420,10 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85106
85420
|
});
|
85107
85421
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=script&lang=js&
|
85108
85422
|
/* harmony default export */ var component_scanner_camera_componentvue_type_script_lang_js_ = (scanner_camera_componentvue_type_script_lang_js_);
|
85109
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.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-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.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=
|
85423
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.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-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.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&
|
85110
85424
|
// extracted by mini-css-extract-plugin
|
85111
85425
|
|
85112
|
-
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=
|
85426
|
+
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue?vue&type=style&index=0&id=16946b5e&prod&scoped=true&lang=scss&
|
85113
85427
|
|
85114
85428
|
;// CONCATENATED MODULE: ./packages/scanner/scanner-camera/src/component/scanner-camera-component.vue
|
85115
85429
|
|
@@ -85122,11 +85436,11 @@ const BEGIN_DATA = 'data:image/jpg;base64,';
|
|
85122
85436
|
|
85123
85437
|
var scanner_camera_component_component = normalizeComponent(
|
85124
85438
|
component_scanner_camera_componentvue_type_script_lang_js_,
|
85125
|
-
|
85126
|
-
|
85439
|
+
scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_render,
|
85440
|
+
scanner_camera_componentvue_type_template_id_16946b5e_scoped_true_staticRenderFns,
|
85127
85441
|
false,
|
85128
85442
|
null,
|
85129
|
-
"
|
85443
|
+
"16946b5e",
|
85130
85444
|
null
|
85131
85445
|
|
85132
85446
|
)
|
@@ -88325,205 +88639,6 @@ class JingLunPluginService {
|
|
88325
88639
|
}
|
88326
88640
|
}
|
88327
88641
|
_defineProperty(JingLunPluginService, "idCardWebSocketUrl", 'http://127.0.0.1:18889');
|
88328
|
-
;// CONCATENATED MODULE: ./packages/service/external-plugins/han-wang-plugin.service.ts
|
88329
|
-
|
88330
|
-
|
88331
|
-
/**
|
88332
|
-
* @author: lvcy
|
88333
|
-
* @date: 2025-04-24 10:55
|
88334
|
-
* @description:汉王签字板
|
88335
|
-
*/
|
88336
|
-
|
88337
|
-
|
88338
|
-
var HanWangMethodCode;
|
88339
|
-
(function (HanWangMethodCode) {
|
88340
|
-
// 初始化
|
88341
|
-
HanWangMethodCode["Init"] = "init";
|
88342
|
-
// 打开设备(开始签名)
|
88343
|
-
HanWangMethodCode["StartSignName"] = "startSignName";
|
88344
|
-
// 关闭设备
|
88345
|
-
HanWangMethodCode["Close"] = "close";
|
88346
|
-
// 重新签名
|
88347
|
-
HanWangMethodCode["SignNameAgain"] = "signNameAgain";
|
88348
|
-
// 获取签名图片
|
88349
|
-
HanWangMethodCode["GetSign"] = "GetSign";
|
88350
|
-
})(HanWangMethodCode || (HanWangMethodCode = {}));
|
88351
|
-
class HanWangPluginService {
|
88352
|
-
static startConnect() {
|
88353
|
-
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) {
|
88354
|
-
return this;
|
88355
|
-
}
|
88356
|
-
const ws = new WebSocket(this.linuxWebServiceUrl);
|
88357
|
-
let resolved;
|
88358
|
-
const onConnect = new Promise(resolve => {
|
88359
|
-
resolved = resolve;
|
88360
|
-
});
|
88361
|
-
ws.onopen = () => {
|
88362
|
-
resolved(true);
|
88363
|
-
};
|
88364
|
-
ws.onmessage = event => {
|
88365
|
-
this.handleMessage(event);
|
88366
|
-
};
|
88367
|
-
ws.onclose = () => this.handleClose();
|
88368
|
-
ws.onerror = e => this.handleError(e);
|
88369
|
-
this.ws = ws;
|
88370
|
-
return onConnect;
|
88371
|
-
}
|
88372
|
-
static handleMessage(msg) {
|
88373
|
-
let data = {};
|
88374
|
-
try {
|
88375
|
-
data = JSON.parse(msg.data);
|
88376
|
-
} catch (e) {
|
88377
|
-
data = {};
|
88378
|
-
}
|
88379
|
-
if (data.HWPenSign === 'HWGetSign' && data.msgID == '0') {
|
88380
|
-
const event = new SignResultEvent(data.message.replace('data:image/png;base64,', ''));
|
88381
|
-
return window.dispatchEvent(event);
|
88382
|
-
}
|
88383
|
-
this.requestStore.forEach(({
|
88384
|
-
resolve
|
88385
|
-
}) => {
|
88386
|
-
resolve(data);
|
88387
|
-
});
|
88388
|
-
this.requestStore = [];
|
88389
|
-
// this.ws.close();
|
88390
|
-
}
|
88391
|
-
|
88392
|
-
static handleError(e) {
|
88393
|
-
for (const type in this.requestStore) {
|
88394
|
-
this.requestStore.forEach(({
|
88395
|
-
reject
|
88396
|
-
}) => {
|
88397
|
-
reject('handleError');
|
88398
|
-
});
|
88399
|
-
}
|
88400
|
-
}
|
88401
|
-
static handleClose() {
|
88402
|
-
for (const type in this.requestStore) {
|
88403
|
-
this.requestStore.forEach(({
|
88404
|
-
reject
|
88405
|
-
}) => {
|
88406
|
-
reject('close');
|
88407
|
-
});
|
88408
|
-
}
|
88409
|
-
}
|
88410
|
-
static async read(method) {
|
88411
|
-
let url = '',
|
88412
|
-
data = {};
|
88413
|
-
switch (method) {
|
88414
|
-
case HanWangMethodCode.Init:
|
88415
|
-
data = {};
|
88416
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetDeviceStatus';
|
88417
|
-
break;
|
88418
|
-
case HanWangMethodCode.StartSignName:
|
88419
|
-
data = {
|
88420
|
-
nLogo: "? ",
|
88421
|
-
nPenwidth: "2",
|
88422
|
-
nOrgX: "100",
|
88423
|
-
nOrgY: "200",
|
88424
|
-
width: "500",
|
88425
|
-
height: "300",
|
88426
|
-
fingerFap: "2",
|
88427
|
-
key: "4A05564228DF2C64AF2E137B71A4E7A3"
|
88428
|
-
};
|
88429
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWInitialize';
|
88430
|
-
break;
|
88431
|
-
case HanWangMethodCode.GetSign:
|
88432
|
-
data = {
|
88433
|
-
nImageType: "3",
|
88434
|
-
nImageWidth: "500",
|
88435
|
-
nImageHeight: "300"
|
88436
|
-
};
|
88437
|
-
url = this.windowsWebServiceUrl + '/HWPenSign/HWGetSign';
|
88438
|
-
break;
|
88439
|
-
}
|
88440
|
-
let res = await CustomAxios.get(url, data);
|
88441
|
-
return res;
|
88442
|
-
}
|
88443
|
-
static async readInLinux(methodCode) {
|
88444
|
-
await this.startConnect();
|
88445
|
-
if (this.ws.readyState === 1) {
|
88446
|
-
let param = '';
|
88447
|
-
switch (methodCode) {
|
88448
|
-
case HanWangMethodCode.Init:
|
88449
|
-
param = JSON.stringify({
|
88450
|
-
HWPenSign: 'HWGetDeviceStatus'
|
88451
|
-
});
|
88452
|
-
break;
|
88453
|
-
case HanWangMethodCode.StartSignName:
|
88454
|
-
param = JSON.stringify({
|
88455
|
-
HWPenSign: 'HWInitialize',
|
88456
|
-
key: "D9063E7FE567E09E84B00B5ECDE9B3F2",
|
88457
|
-
title: "请在签字板上签名",
|
88458
|
-
nOrgX: 400,
|
88459
|
-
nOrgY: 350,
|
88460
|
-
nWidth: 600,
|
88461
|
-
nHeight: 400,
|
88462
|
-
showDialog: 1,
|
88463
|
-
nImageWidth: 250,
|
88464
|
-
nImageHeight: 150,
|
88465
|
-
nConfirmTimeout: 30,
|
88466
|
-
fingerCap: 1,
|
88467
|
-
nFingerCap: 0
|
88468
|
-
});
|
88469
|
-
break;
|
88470
|
-
}
|
88471
|
-
this.ws.send(param);
|
88472
|
-
return new Promise((resolve, reject) => {
|
88473
|
-
if (!this.requestStore) {
|
88474
|
-
this.requestStore = [];
|
88475
|
-
}
|
88476
|
-
this.requestStore.push({
|
88477
|
-
resolve,
|
88478
|
-
reject
|
88479
|
-
});
|
88480
|
-
});
|
88481
|
-
}
|
88482
|
-
}
|
88483
|
-
static async signNameRead() {
|
88484
|
-
return new Promise(async resolve => {
|
88485
|
-
if (this._isLinux) {
|
88486
|
-
// 国产环境
|
88487
|
-
let res = await HanWangPluginService.readInLinux(HanWangMethodCode.Init);
|
88488
|
-
console.log('初始化=>', res);
|
88489
|
-
if (res.msgID == 0) {
|
88490
|
-
let signRes = await HanWangPluginService.readInLinux(HanWangMethodCode.StartSignName);
|
88491
|
-
console.log('签字=>', signRes);
|
88492
|
-
if (signRes.msgID == 0) {
|
88493
|
-
resolve('');
|
88494
|
-
}
|
88495
|
-
} else {
|
88496
|
-
throw Error('统一插件平台设备未准备完成');
|
88497
|
-
}
|
88498
|
-
} else {
|
88499
|
-
// windows
|
88500
|
-
// 链接
|
88501
|
-
let status = await HanWangPluginService.read(HanWangMethodCode.Init);
|
88502
|
-
if (status.msgID !== '0') {
|
88503
|
-
throw Error('统一插件平台设备未准备完成');
|
88504
|
-
}
|
88505
|
-
// 签字
|
88506
|
-
let res = await HanWangPluginService.read(HanWangMethodCode.StartSignName);
|
88507
|
-
if (res.msgID !== '0') {
|
88508
|
-
throw Error('统一插件平台设备未准备完成');
|
88509
|
-
}
|
88510
|
-
// 获取签字照片
|
88511
|
-
let timer = setInterval(async () => {
|
88512
|
-
let signRes = await HanWangPluginService.read(HanWangMethodCode.GetSign);
|
88513
|
-
if (signRes.msgID === '0') {
|
88514
|
-
clearInterval(timer);
|
88515
|
-
resolve(signRes.message.replace('data:image/png;base64,', ''));
|
88516
|
-
}
|
88517
|
-
}, 2000);
|
88518
|
-
}
|
88519
|
-
});
|
88520
|
-
}
|
88521
|
-
}
|
88522
|
-
_defineProperty(HanWangPluginService, "windowsWebServiceUrl", 'http://127.0.0.1:29999');
|
88523
|
-
_defineProperty(HanWangPluginService, "linuxWebServiceUrl", 'ws://127.0.0.1:29999');
|
88524
|
-
_defineProperty(HanWangPluginService, "ws", void 0);
|
88525
|
-
_defineProperty(HanWangPluginService, "requestStore", []);
|
88526
|
-
_defineProperty(HanWangPluginService, "_isLinux", String(navigator.platform).indexOf("Linux") > -1);
|
88527
88642
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-85.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&
|
88528
88643
|
|
88529
88644
|
|