From 73fe012110a5c65f03720d3b7164308101e2d850 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 10 Nov 2021 16:37:57 +0800
Subject: [PATCH] +指纹采集
---
public/img/zhiwen/zhiwenWu.png | 0
src/views/securityGuard/securityGuard指纹自动识别(集成VUE报错)-9.vue | 2226 +++++++++++
public/zhiwenDemo/language.js | 39
src/api/system/user.js | 15
public/zhiwenDemo/app.css | 80
public/zhiwenDemo/debug.log | 1
src/views/securityGuard/securityGuard.vue | 3996 +++++++++++---------
src/views/securityGuard/Client.js | 1327 ++++++
public/zhiwenDemo/Client.js | 1300 ++++++
src/views/licenseApproval/securityGuard.vue | 28
public/zhiwenDemo/CID.html | 81
public/zhiwenDemo/app.js | 2376 ++++++++++++
12 files changed, 9,655 insertions(+), 1,814 deletions(-)
diff --git a/public/img/zhiwen/zhiwenWu.png b/public/img/zhiwen/zhiwenWu.png
new file mode 100644
index 0000000..6259f0a
--- /dev/null
+++ b/public/img/zhiwen/zhiwenWu.png
Binary files differ
diff --git a/public/zhiwenDemo/CID.html b/public/zhiwenDemo/CID.html
new file mode 100644
index 0000000..3f0f597
--- /dev/null
+++ b/public/zhiwenDemo/CID.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+
+<html lang="en">
+
+<head>
+ <meta charset="utf-8" />
+ <title>TypeScript HTML App</title>
+ <link rel="stylesheet" href="app.css" type="text/css" />
+ <script src="language.js"></script>
+ <script src="Client.js"></script>
+ <script src="app.js"></script>
+</head>
+
+<body>
+ <!-- <button id="change_language" onclick="changelanguage_CID()">Change to English</button>
+ <h3 id="title">亚略特设备管理助手Demo(CID)</h3>
+ <a id="link" href="AratekDMA://4397and7934">打开设备管理助手</a>
+ <button id="connect_server" onclick="connect()">连接助手程序</button>
+ <br />
+
+ <br />
+ <select id="device_select">
+ <option value="cid4000">CID4000</option>
+ <option value="cid5000">CID5000</option>
+ <option value="cid7000">CID7000</option>
+ <option value="cid3000tc">CID3000TC</option>
+ <option value="cid3000">CID3000</option>
+ <option value="cid7000r">CID7000R</option>
+ </select> -->
+ <div id="zhiwenOur">
+
+ <img id="img" border="0" width="256" height="360" />
+ <div id="butDiv">
+
+ <button id="connect_server" onclick="connect()">开始采集</button>
+ <button id="closeG" onclick="closeG()">取消采集</button>
+ <button id="onceGgin" onclick="onceGgin()">重新采集</button>
+ </div>
+ </div>
+ <div id="zhiwentip">请按下食指开始采集指纹!</div>
+ <div id="zhiwentipok">指纹采集成功!</div>
+ <div id="zhiwentipno">未采集指纹!</div>
+ <!--<button id="open_device" onclick="LIVESCAN_Init()">设备初始化</button>
+ <button id="close_device" onclick="LIVESCAN_Close()">关闭设备</button>
+ <button id="device_count" onclick="LIVESCAN_GetChannelCount()">获取设备数量</button>
+ <button id="device_desc" onclick="LIVESCAN_GetDesc()">获取设备信息</button>
+ <br />
+
+ <br />
+ <p1 id="score_thresh_desc">分数阈值:</p1>
+ <input type="text" id="score_thresh" value="60" oninput="value=value.replace(/[^\d]/g,'')" />
+ <br />
+
+ <br />
+ <button id="start" onclick="LIVESCAN_BeginCapture()">开始预览</button>
+ <button id="end" onclick="LIVESCAN_EndCapture()">结束预览</button>
+ <p1 id="score_desc">当前分数:</p1>
+ <p2 id="score"></p2>
+ <br />
+
+ <br />
+ <button id="cap1" onclick="CID_Cap1()">采集图像1</button>
+ <button id="ext1" onclick="CID_Ext1()">提取图像1特征</button>
+ <button id="cap2" onclick="CID_Cap2()">采集图像2</button>
+ <button id="ext2" onclick="CID_Ext2()">提取图像2特征</button>
+ <br />
+ <br />
+ <button id="feaverify" onclick="FP_FeatureMatch()">特征1与特征2比对</button>
+ <button id="imgverify" onclick="FP_ImageMatch()">图像1与特征2比对</button>
+ <br />
+ <br />
+ <img id="img1" border="0" width="256" height="360" />
+ <img id="img2" border="0" width="256" height="360" />
+ <br />
+
+ <textarea name="FeaData" id="Fea1" cols="54" rows="20" style="height:300px"></textarea>
+ <textarea name="FeaData" id="Fea2" cols="54" rows="20" style="height:300px"></textarea>
+ <div id="content"></div> -->
+</body>
+
+</html>
\ No newline at end of file
diff --git a/public/zhiwenDemo/Client.js b/public/zhiwenDemo/Client.js
new file mode 100644
index 0000000..02a5e3d
--- /dev/null
+++ b/public/zhiwenDemo/Client.js
@@ -0,0 +1,1300 @@
+var CommandType;
+(function (CommandType) {
+ CommandType[CommandType["OpenDevice_Type"] = 1] = "OpenDevice_Type";
+ CommandType[CommandType["CloseDevice_Type"] = 2] = "CloseDevice_Type";
+ CommandType[CommandType["GetDeviceCount_Type"] = 3] = "GetDeviceCount_Type";
+ CommandType[CommandType["GetDeviceDescription_Type"] = 4] = "GetDeviceDescription_Type";
+ CommandType[CommandType["CaptureFingerData_Type"] = 5] = "CaptureFingerData_Type";
+ CommandType[CommandType["StartCapture_Type"] = 6] = "StartCapture_Type";
+ CommandType[CommandType["StopCapture_Type"] = 7] = "StopCapture_Type";
+ CommandType[CommandType["GeneralizeTemplate_Type"] = 8] = "GeneralizeTemplate_Type";
+ CommandType[CommandType["Verify_Type"] = 9] = "Verify_Type";
+ CommandType[CommandType["SetOption_Type"] = 10] = "SetOption_Type";
+ CommandType[CommandType["BmpToRaw_Type"] = 11] = "BmpToRaw_Type";
+ CommandType[CommandType["BmpToWSQ_Type"] = 12] = "BmpToWSQ_Type";
+ CommandType[CommandType["BmpToISO_Type"] = 13] = "BmpToISO_Type";
+ CommandType[CommandType["BmpToANSI_Type"] = 14] = "BmpToANSI_Type";
+ CommandType[CommandType["CID_Init_Type"] = 15] = "CID_Init_Type";
+ CommandType[CommandType["CID_Close_Type"] = 16] = "CID_Close_Type";
+ CommandType[CommandType["CID_GetChannelCount_Type"] = 17] = "CID_GetChannelCount_Type";
+ CommandType[CommandType["CID_BeginCapture_Type"] = 18] = "CID_BeginCapture_Type";
+ CommandType[CommandType["CID_GetFPRawData_Type"] = 19] = "CID_GetFPRawData_Type";
+ CommandType[CommandType["CID_GetFPBmpData_Type"] = 20] = "CID_GetFPBmpData_Type";
+ CommandType[CommandType["CID_EndCapture_Type"] = 21] = "CID_EndCapture_Type";
+ CommandType[CommandType["CID_GetVersion_Type"] = 22] = "CID_GetVersion_Type";
+ CommandType[CommandType["CID_GetDesc_Type"] = 23] = "CID_GetDesc_Type";
+ CommandType[CommandType["CID_Alg_GetVersion_Type"] = 25] = "CID_Alg_GetVersion_Type";
+ CommandType[CommandType["CID_Alg_Begin_Type"] = 26] = "CID_Alg_Begin_Type";
+ CommandType[CommandType["CID_Alg_FeatureExtract_Type"] = 27] = "CID_Alg_FeatureExtract_Type";
+ CommandType[CommandType["CID_Alg_FeatureMatch_Type"] = 28] = "CID_Alg_FeatureMatch_Type";
+ CommandType[CommandType["CID_Alg_ImageMatch_Type"] = 29] = "CID_Alg_ImageMatch_Type";
+ CommandType[CommandType["CID_Alg_GetQualityScore_Type"] = 32] = "CID_Alg_GetQualityScore_Type";
+ CommandType[CommandType["CID_Alg_End_Type"] = 35] = "CID_Alg_End_Type";
+ CommandType[CommandType["TrustLink_GetDeviceInfo_Type"] = 49] = "TrustLink_GetDeviceInfo_Type";
+ CommandType[CommandType["ARA_ReadIDCard_Type"] = 50] = "ARA_ReadIDCard_Type";
+ CommandType[CommandType["ARA_FeaConv_Type"] = 51] = "ARA_FeaConv_Type";
+ CommandType[CommandType["ARA_GetCurrentDeviceList_Type"] = 53] = "ARA_GetCurrentDeviceList_Type";
+ CommandType[CommandType["FRO900_OpenDevice_Type"] = 64] = "FRO900_OpenDevice_Type";
+ CommandType[CommandType["FRO900_CloseDevice_Type"] = 65] = "FRO900_CloseDevice_Type";
+ CommandType[CommandType["FRO900_GetDeviceCount_Type"] = 66] = "FRO900_GetDeviceCount_Type";
+ CommandType[CommandType["FRO900_CaptureFingerPrintData_Type"] = 67] = "FRO900_CaptureFingerPrintData_Type";
+ CommandType[CommandType["FRO900_GeneralizeTemplate_Type"] = 68] = "FRO900_GeneralizeTemplate_Type";
+ CommandType[CommandType["FRO900_Verify_Type"] = 69] = "FRO900_Verify_Type";
+ CommandType[CommandType["Iris_InitDevice_Type"] = 80] = "Iris_InitDevice_Type";
+ CommandType[CommandType["Iris_ReleaseDevice_type"] = 81] = "Iris_ReleaseDevice_type";
+ CommandType[CommandType["Iris_StartCapture_Type"] = 82] = "Iris_StartCapture_Type";
+ CommandType[CommandType["Iris_StartCapture2_Type"] = 83] = "Iris_StartCapture2_Type";
+ CommandType[CommandType["Iris_StopCapture_Type"] = 84] = "Iris_StopCapture_Type";
+ CommandType[CommandType["Iris_SetOptions_Type"] = 86] = "Iris_SetOptions_Type";
+ CommandType[CommandType["Iris_StartVerify_Type"] = 87] = "Iris_StartVerify_Type";
+ CommandType[CommandType["Iris_StartVerify2_Type"] = 88] = "Iris_StartVerify2_Type";
+ CommandType[CommandType["Iris_StopVerify_Type"] = 89] = "Iris_StopVerify_Type";
+ CommandType[CommandType["Iris_StartFastCapture_Type"] = 90] = "Iris_StartFastCapture_Type";
+ CommandType[CommandType["Iris_StartFastCapture2_Type"] = 91] = "Iris_StartFastCapture2_Type";
+ CommandType[CommandType["FingerKey_OpenDevice_Type"] = 96] = "FingerKey_OpenDevice_Type";
+ CommandType[CommandType["FingerKey_CloseDevice_Type"] = 97] = "FingerKey_CloseDevice_Type";
+ CommandType[CommandType["FingerKey_GetDeviceInformation_Type"] = 99] = "FingerKey_GetDeviceInformation_Type";
+ CommandType[CommandType["FingerKey_CaptureFingerData_Type"] = 100] = "FingerKey_CaptureFingerData_Type";
+ CommandType[CommandType["FingerKey_ImportFingerPrint_Type"] = 101] = "FingerKey_ImportFingerPrint_Type";
+ CommandType[CommandType["Camera_InitDevice_Type"] = 112] = "Camera_InitDevice_Type";
+ CommandType[CommandType["Camera_ReleaseDevice_Type"] = 113] = "Camera_ReleaseDevice_Type";
+ CommandType[CommandType["Camera_StartCapture_Type"] = 114] = "Camera_StartCapture_Type";
+ CommandType[CommandType["Camera_StopCapture_Type"] = 115] = "Camera_StopCapture_Type";
+ CommandType[CommandType["Camera_SetOption_Type"] = 116] = "Camera_SetOption_Type";
+})(CommandType || (CommandType = {}));
+var FingerPosition;
+(function (FingerPosition) {
+ FingerPosition[FingerPosition["UNKNOWN"] = 0] = "UNKNOWN";
+ FingerPosition[FingerPosition["RIGHT_THUMB"] = 1] = "RIGHT_THUMB";
+ FingerPosition[FingerPosition["RIGHT_INDEX"] = 2] = "RIGHT_INDEX";
+ FingerPosition[FingerPosition["RIGHT_MIDDLE"] = 3] = "RIGHT_MIDDLE";
+ FingerPosition[FingerPosition["RIGHT_RING"] = 4] = "RIGHT_RING";
+ FingerPosition[FingerPosition["RIGHT_LITTLE"] = 5] = "RIGHT_LITTLE";
+ FingerPosition[FingerPosition["LEFT_THUMB"] = 6] = "LEFT_THUMB";
+ FingerPosition[FingerPosition["LEFT_INDEX"] = 7] = "LEFT_INDEX";
+ FingerPosition[FingerPosition["LEFT_MIDDLE"] = 8] = "LEFT_MIDDLE";
+ FingerPosition[FingerPosition["LEFT_RING"] = 9] = "LEFT_RING";
+ FingerPosition[FingerPosition["LEFT_LITTLE"] = 10] = "LEFT_LITTLE";
+ FingerPosition[FingerPosition["THUMB_TWO"] = 21] = "THUMB_TWO";
+ FingerPosition[FingerPosition["LEFT_FOUR"] = 22] = "LEFT_FOUR";
+ FingerPosition[FingerPosition["RIGHT_FOUR"] = 23] = "RIGHT_FOUR";
+})(FingerPosition || (FingerPosition = {}));
+var FRO900_MissFinger;
+(function (FRO900_MissFinger) {
+ FRO900_MissFinger[FRO900_MissFinger["NO_FINGER_MISS"] = 0] = "NO_FINGER_MISS";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_INDEX"] = 1] = "MISS_FINGER_INDEX";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_MIDDLE"] = 2] = "MISS_FINGER_MIDDLE";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_RING"] = 4] = "MISS_FINGER_RING";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_LITTLE"] = 8] = "MISS_FINGER_LITTLE";
+})(FRO900_MissFinger || (FRO900_MissFinger = {}));
+var ID_FingerPosition;
+(function (ID_FingerPosition) {
+ ID_FingerPosition[ID_FingerPosition["UNKNOWN"] = 99] = "UNKNOWN";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_THUMB"] = 11] = "RIGHT_THUMB";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_INDEX"] = 12] = "RIGHT_INDEX";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_MIDDLE"] = 13] = "RIGHT_MIDDLE";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_RING"] = 14] = "RIGHT_RING";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_LITTLE"] = 15] = "RIGHT_LITTLE";
+ ID_FingerPosition[ID_FingerPosition["LEFT_THUMB"] = 16] = "LEFT_THUMB";
+ ID_FingerPosition[ID_FingerPosition["LEFT_INDEX"] = 17] = "LEFT_INDEX";
+ ID_FingerPosition[ID_FingerPosition["LEFT_MIDDLE"] = 18] = "LEFT_MIDDLE";
+ ID_FingerPosition[ID_FingerPosition["LEFT_RING"] = 19] = "LEFT_RING";
+ ID_FingerPosition[ID_FingerPosition["LEFT_LITTLE"] = 20] = "LEFT_LITTLE";
+})(ID_FingerPosition || (ID_FingerPosition = {}));
+var CompressionType;
+(function (CompressionType) {
+ CompressionType[CompressionType["UnCompressed"] = 0] = "UnCompressed";
+ CompressionType[CompressionType["BitPacked"] = 1] = "BitPacked";
+ CompressionType[CompressionType["WSQ"] = 2] = "WSQ";
+ CompressionType[CompressionType["JPEG"] = 3] = "JPEG";
+ CompressionType[CompressionType["JPEG2000"] = 4] = "JPEG2000";
+ CompressionType[CompressionType["PNG"] = 5] = "PNG";
+})(CompressionType || (CompressionType = {}));
+var SecurityLevel;
+(function (SecurityLevel) {
+ SecurityLevel[SecurityLevel["Level_1"] = 1] = "Level_1";
+ SecurityLevel[SecurityLevel["Level_2"] = 2] = "Level_2";
+ SecurityLevel[SecurityLevel["Level_3"] = 3] = "Level_3";
+ SecurityLevel[SecurityLevel["Level_4"] = 4] = "Level_4";
+ SecurityLevel[SecurityLevel["Level_5"] = 5] = "Level_5";
+})(SecurityLevel || (SecurityLevel = {}));
+var ImageFormatType;
+(function (ImageFormatType) {
+ ImageFormatType[ImageFormatType["IRaw"] = 1] = "IRaw";
+ ImageFormatType[ImageFormatType["IBmp"] = 2] = "IBmp";
+ ImageFormatType[ImageFormatType["IISO"] = 3] = "IISO";
+ ImageFormatType[ImageFormatType["IANSI"] = 4] = "IANSI";
+})(ImageFormatType || (ImageFormatType = {}));
+var FeatureFormatType;
+(function (FeatureFormatType) {
+ FeatureFormatType[FeatureFormatType["FBione"] = 1] = "FBione";
+ FeatureFormatType[FeatureFormatType["FISO"] = 2] = "FISO";
+ FeatureFormatType[FeatureFormatType["FANSI"] = 3] = "FANSI";
+ FeatureFormatType[FeatureFormatType["FIDCard"] = 4] = "FIDCard";
+})(FeatureFormatType || (FeatureFormatType = {}));
+var CIDDeviceType;
+(function (CIDDeviceType) {
+ CIDDeviceType[CIDDeviceType["CID3000TC"] = 0] = "CID3000TC";
+ CIDDeviceType[CIDDeviceType["CID4000"] = 1] = "CID4000";
+ CIDDeviceType[CIDDeviceType["CID5000"] = 2] = "CID5000";
+ CIDDeviceType[CIDDeviceType["CID7000"] = 3] = "CID7000";
+ CIDDeviceType[CIDDeviceType["CID3000"] = 4] = "CID3000";
+ CIDDeviceType[CIDDeviceType["CID7000R"] = 5] = "CID7000R";
+})(CIDDeviceType || (CIDDeviceType = {}));
+var IrisDeviceType;
+(function (IrisDeviceType) {
+ IrisDeviceType[IrisDeviceType["IR100"] = 1] = "IR100";
+ IrisDeviceType[IrisDeviceType["IR200"] = 2] = "IR200";
+})(IrisDeviceType || (IrisDeviceType = {}));
+var IrisCaptureMode;
+(function (IrisCaptureMode) {
+ IrisCaptureMode[IrisCaptureMode["Two_Eyes"] = 1] = "Two_Eyes";
+ IrisCaptureMode[IrisCaptureMode["Left_Eye"] = 2] = "Left_Eye";
+ IrisCaptureMode[IrisCaptureMode["Right_Eye"] = 3] = "Right_Eye";
+})(IrisCaptureMode || (IrisCaptureMode = {}));
+var IDCardType;
+(function (IDCardType) {
+ IDCardType[IDCardType["IDCard_People"] = 1] = "IDCard_People";
+ IDCardType[IDCardType["IDCard_GAT"] = 2] = "IDCard_GAT";
+ IDCardType[IDCardType["IDCard_Foreign"] = 3] = "IDCard_Foreign";
+})(IDCardType || (IDCardType = {}));
+var Camera_Device_List;
+(function (Camera_Device_List) {
+ Camera_Device_List[Camera_Device_List["FC200V"] = 1] = "FC200V";
+ Camera_Device_List[Camera_Device_List["FC200H"] = 2] = "FC200H";
+ Camera_Device_List[Camera_Device_List["FC205"] = 3] = "FC205";
+ Camera_Device_List[Camera_Device_List["CID7000"] = 11] = "CID7000";
+})(Camera_Device_List || (Camera_Device_List = {}));
+;
+var NOT_CONNECT = -1;
+var Client = (function () {
+ function Client() {
+ this.url = 'ws://127.0.0.1:4397/aratek';
+ this.ws = null;
+ this.isConnect = false;
+ }
+ Client.prototype.SendMessage = function (msg) {
+ if (this.isConnect) {
+ this.ws.send(msg);
+ }
+ };
+ Client.prototype.OpenDevice = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.OpenDevice_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GetDeviceCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GetDeviceCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GetDeviceDescription = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GetDeviceDescription_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CaptureFingerData = function (image_format, feature_format, timeout, fingerposition, compression_type, device_id, factor) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CaptureFingerData_Type,
+ "Image_Format": image_format,
+ "Feature_Format": feature_format,
+ "TimeOut": timeout,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": device_id,
+ "Factor": factor
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.StartCapture = function (feature_format, fingerposition) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.StartCapture_Type,
+ "Feature_Format": feature_format,
+ "Finger_Position": fingerposition
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GeneralizeTemplate = function (fea1, fea2, fea3) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GeneralizeTemplate_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Feature_3": fea3
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Verify = function (fea1, fea2, security_level) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Verify_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Security_Level": security_level
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.SetOption = function (LED_index, LED_status) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.SetOption_Type,
+ "LED_Index": LED_index,
+ "LED_Status": LED_status
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToRaw = function (bmp_imagedata, image_width, image_height) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToRaw_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToWSQ = function (bmp_imagedata, image_width, image_height, dpi, bitrate) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToWSQ_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "DPI": dpi,
+ "Bitrate": bitrate
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToISO = function (bmp_imagedata, image_width, image_height, fingerposition, compression_type, deviceid) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToISO_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": deviceid
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToANSI = function (bmp_imagedata, image_width, image_height, fingerposition, compression_type, deviceid) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToANSI_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": deviceid
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Init = function (devicetype, my) {
+ if (my.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Init_Type,
+ "DeviceType": devicetype
+ };
+ let butBegin = document.getElementById("connect_server");
+ butBegin.style.display = "none";
+ let closeG = document.getElementById("closeG");
+ closeG.style.display = "block";
+ let onceGgin = document.getElementById("onceGgin");
+ onceGgin.style.display = "none";
+ let zhiwentip = document.getElementById("zhiwentip");
+ zhiwentip.style.display = "block";
+ let zhiwentipok = document.getElementById("zhiwentipok");
+ zhiwentipok.style.display = "none";
+ let zhiwentipno = document.getElementById("zhiwentipno");
+ zhiwentipno.style.display = "none";
+ // console.log(butBegin)
+ // butBegin.innerText = "点击结束";
+ // butBegin.style.backgroundColor = "#E6A23C";
+ my.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Close = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Close_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetChannelCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetChannelCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_BeginCapture = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_BeginCapture_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetFPRawData = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetFPRawData_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetFPBmpData = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetFPBmpData_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_EndCapture = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_EndCapture_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetVersion = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetVersion_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetDesc = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetDesc_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_GetVersion = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_GetVersion_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_Begin = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_Begin_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_FeatureExtract = function (fingerposition, image_rawdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_FeatureExtract_Type,
+ "FingerPosition": fingerposition,
+ "Image_RawData": image_rawdata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_FeatureMatch = function (featuredata1, featuredata2) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_FeatureMatch_Type,
+ "FeatureData1": featuredata1,
+ "FeatureData2": featuredata2
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_ImageMatch = function (image_rawdata, featuredata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_ImageMatch_Type,
+ "RawImageData": image_rawdata,
+ "FeatureData": featuredata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_GetQualityScore = function (image_rawdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_GetQualityScore_Type,
+ "RawImageData": image_rawdata
+ };
+ // console.log(cmd_json)
+ // return
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_End = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_End_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_ReadIDCard = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_ReadIDCard_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.TrustLink_GetDeviceInfo = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.TrustLink_GetDeviceInfo_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_FeaConv = function (feasrc, feasrc_fm, feadst_fm) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_FeaConv_Type,
+ "Fea_Src_Data": feasrc,
+ "Fea_Src_Format": feasrc_fm,
+ "Fea_Dst_Format": feadst_fm
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_GetCurrentDeviceList = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_GetCurrentDeviceList_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_OpenDevice = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_OpenDevice_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_GetDeviceCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_GetDeviceCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_CaptureFingerPrintData = function (fingerposition, imageformat, featureformat, compressiontype, factor, missfinger) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_CaptureFingerPrintData_Type,
+ "Finger_Position": fingerposition,
+ "Image_Format": imageformat,
+ "Feature_Format": featureformat,
+ "Compression_Type": compressiontype,
+ "Factor": factor,
+ "Miss_Finger_Position": missfinger
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_GeneralizeTemplate = function (fea1, fea2, fea3) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_GeneralizeTemplate_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Feature_3": fea3
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_Verify = function (fea1, fea2, security_level) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_Verify_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Security_Level": security_level
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_InitDevice = function (devicetype) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_InitDevice_Type,
+ "DeviceType": devicetype
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartFastCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartFastCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartVerify = function (timeout, leftdata, rightdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartVerify_Type,
+ "Timeout": timeout,
+ "LeftEye_FeaData": leftdata,
+ "RightEye_FeaData": rightdata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StopVerify = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StopVerify_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_ReleaseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_ReleaseDevice_type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_SetOptions = function (enrothresh) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_SetOptions_Type,
+ "EnrollThresh": enrothresh
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_OpenDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_OpenDevice_Type,
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_GetDeviceInformation = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_GetDeviceInformation_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_CaptureFingerData = function (fingerposition, imageformat, featureformat, timeout) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_CaptureFingerData_Type,
+ "Image_Format": imageformat,
+ "Feature_Format": featureformat,
+ "TimeOut": timeout,
+ "Finger_Position": fingerposition
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_ImportFingerPrint = function (fingerposition, allfeature) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_ImportFingerPrint_Type,
+ "Finger_Position": fingerposition,
+ "AllFeatureData": allfeature
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_InitDevice = function (devicetype) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_InitDevice_Type,
+ "DeviceType": devicetype
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_ReleaseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_ReleaseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_StartCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_StartCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_SetOption = function (livedetectvalue) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_SetOption_Type,
+ "LiveDetectSetting": livedetectvalue
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.beginFn; // 添加异步设备初始化,因为websocket需要时间来启动
+ Client.prototype.Connect_Server = function () {
+ var thisws = this;
+ this.ws = new WebSocket(this.url);
+ this.ws.onopen = function () {
+ // console.log("Connect Success");
+ // alert("Connect Success");
+ thisws.isConnect = true;
+
+ let data = thisws.beginFn, my = thisws;//循环连接设备
+ let openequipment = function (beginFn, that) {
+ if (beginFn.fn(beginFn.CID5000, that) == -1) {
+ setTimeout(() => {
+ openequipment(data, my);
+ }, 2000);
+ }
+ }
+ openequipment(data, my);
+ };
+ this.ws.onmessage = function (ev) {
+ var data = JSON.parse(ev.data);
+ var responsetype = data.ResponseType;
+ // console.log(responsetype, " :::")
+ switch (responsetype) {
+ case CommandType.OpenDevice_Type:
+ if (thisws.OnOpenDevice) {
+ thisws.OnOpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CloseDevice_Type:
+ if (thisws.OnCloseDevice) {
+ thisws.OnCloseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.GetDeviceCount_Type:
+ if (thisws.OnGetDeviceCount) {
+ thisws.OnGetDeviceCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.GetDeviceDescription_Type:
+ var deviceinfo = {
+ sn: data.SN,
+ manufacturer: data.Manufacturer,
+ productname: data.ProductName,
+ productmodel: data.ProductModel,
+ fw_version: data.FW_Version,
+ hw_version: data.HW_Version,
+ image_width: data.Image_Width,
+ iamge_height: data.Image_Height,
+ dpi: data.DPI,
+ device_id: data.Device_ID
+ };
+ if (thisws.OnGetDeviceDescription) {
+ thisws.OnGetDeviceDescription(data.ErrorCode, data.ErrorMessage, deviceinfo);
+ }
+ break;
+ case CommandType.CaptureFingerData_Type:
+ var capimage = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data,
+ quality: data.Image_Quality,
+ NFIQ: data.Image_NFIQ
+ };
+ if (thisws.OnCaptureFingerData) {
+ thisws.OnCaptureFingerData(data.ErrorCode, data.ErrorMessage, capimage);
+ }
+ break;
+ case CommandType.StartCapture_Type:
+ var startimage = {
+ image_format: ImageFormatType.IBmp,
+ image_data: data.Image_Data,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data,
+ quality: data.Image_Quality,
+ NFIQ: data.Image_NFIQ
+ };
+ if (thisws.OnStartCapture) {
+ thisws.OnStartCapture(data.ErrorCode, data.ErrorMessage, startimage);
+ }
+ break;
+ case CommandType.StopCapture_Type:
+ if (thisws.OnStopCapture) {
+ thisws.OnStopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.GeneralizeTemplate_Type:
+ if (thisws.OnGeneralizeTemplate) {
+ thisws.OnGeneralizeTemplate(data.ErrorCode, data.ErrorMessage, data.Template_Data);
+ }
+ break;
+ case CommandType.Verify_Type:
+ if (thisws.OnVerify) {
+ thisws.OnVerify(data.ErrorCode, data.ErrorMessage, data.Verify_Score, data.Verify_Result);
+ }
+ break;
+ case CommandType.SetOption_Type:
+ if (thisws.OnSetOption) {
+ thisws.OnSetOption(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.BmpToRaw_Type:
+ if (thisws.OnBmpToRaw) {
+ thisws.OnBmpToRaw(data.ErrorCode, data.ErrorMessage, data.Raw_ImageData);
+ }
+ break;
+ case CommandType.BmpToWSQ_Type:
+ if (thisws.OnBmpToWSQ) {
+ thisws.OnBmpToWSQ(data.ErrorCode, data.ErrorMessage, data.WSQ_ImageData);
+ }
+ break;
+ case CommandType.BmpToISO_Type:
+ if (thisws.OnBmpToISO) {
+ thisws.OnBmpToISO(data.ErrorCode, data.ErrorMessage, data.ISO_ImageData);
+ }
+ break;
+ case CommandType.BmpToANSI_Type:
+ if (thisws.OnBmpToANSI) {
+ thisws.OnBmpToANSI(data.ErrorCode, data.ErrorMessage, data.ANSI_ImageData);
+ }
+ break;
+ case CommandType.CID_Init_Type:
+ if (thisws.OnCID_Init) {
+ thisws.OnCID_Init(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_Close_Type:
+ if (thisws.OnCID_Close) {
+ thisws.OnCID_Close(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetChannelCount_Type:
+ if (thisws.OnCID_GetCount) {
+ thisws.OnCID_GetCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.CID_BeginCapture_Type:
+ if (thisws.OnCID_BeginCapture) {
+ thisws.OnCID_BeginCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetFPRawData_Type:
+ if (thisws.OnCID_GetRawData) {
+ thisws.OnCID_GetRawData(data.ErrorCode, data.ErrorMessage, data.RawData, data.FeaData);
+ }
+ break;
+ case CommandType.CID_GetFPBmpData_Type:
+ if (thisws.OnCID_GetBmpData) {
+ thisws.OnCID_GetBmpData(data.ErrorCode, data.ErrorMessage, data.BmpData, data.FeaData);
+ }
+ break;
+ case CommandType.CID_EndCapture_Type:
+ if (thisws.OnCID_EndCapture) {
+ thisws.OnCID_EndCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetVersion_Type:
+ if (thisws.OnCID_GetVersion) {
+ thisws.OnCID_GetVersion(data.ErrorCode, data.ErrorMessage, data.Version);
+ }
+ break;
+ case CommandType.CID_GetDesc_Type:
+ if (thisws.OnCID_GetDesc) {
+ thisws.OnCID_GetDesc(data.ErrorCode, data.ErrorMessage, data.Description);
+ }
+ break;
+ case CommandType.CID_Alg_GetVersion_Type:
+ if (thisws.OnCID_Alg_GetVersion) {
+ thisws.OnCID_Alg_GetVersion(data.ErrorCode, data.ErrorMessage, data.Version);
+ }
+ break;
+ case CommandType.CID_Alg_Begin_Type:
+ if (thisws.OnCID_Alg_Begin) {
+ thisws.OnCID_Alg_Begin(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_Alg_FeatureExtract_Type:
+ if (thisws.OnCID_Alg_FeatureExtract) {
+ thisws.OnCID_Alg_FeatureExtract(data.ErrorCode, data.ErrorMessage, data.FeatureData);
+ }
+ break;
+ case CommandType.CID_Alg_FeatureMatch_Type:
+ if (thisws.OnCID_Alg_FeatureMatch) {
+ thisws.OnCID_Alg_FeatureMatch(data.ErrorCode, data.ErrorMessage, data.Similarity);
+ }
+ break;
+ case CommandType.CID_Alg_ImageMatch_Type:
+ if (thisws.OnCID_Alg_ImageMatch) {
+ thisws.OnCID_Alg_ImageMatch(data.ErrorCode, data.ErrorMessage, data.Similarity);
+ }
+ break;
+ case CommandType.CID_Alg_GetQualityScore_Type:
+ if (thisws.OnCID_Alg_GetQualityScore) {
+ thisws.OnCID_Alg_GetQualityScore(data.ErrorCode, data.ErrorMessage, data.Score);
+ }
+ break;
+ case CommandType.CID_Alg_End_Type:
+ if (thisws.OnCID_Alg_End) {
+ thisws.OnCID_Alg_End(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.TrustLink_GetDeviceInfo_Type:
+ if (thisws.OnTrustLink_GetDeviceInfo) {
+ thisws.OnTrustLink_GetDeviceInfo(data.ErrorCode, data.ErrorMessage, data.MACAdress, data.IPAdress, data.HostName);
+ }
+ break;
+ case CommandType.ARA_FeaConv_Type:
+ if (thisws.OnARA_FeaConv) {
+ thisws.OnARA_FeaConv(data.ErrorCode, data.ErrorMessage, data.Fea_Dst_Data);
+ }
+ break;
+ case CommandType.ARA_GetCurrentDeviceList_Type:
+ if (thisws.OnARA_GetCurrentDeviceList) {
+ thisws.OnARA_GetCurrentDeviceList(data.ErrorCode, data.ErrorMessage, data.List);
+ }
+ break;
+ case CommandType.FRO900_OpenDevice_Type:
+ if (thisws.OnFRO900_OpenDevice) {
+ thisws.OnFRO900_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FRO900_GetDeviceCount_Type:
+ if (thisws.OnFRO900_GetDeviceCount) {
+ thisws.OnFRO900_GetDeviceCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.FRO900_CaptureFingerPrintData_Type:
+ if (data.PreviewImg != null) {
+ if (thisws.OnFRO900_CaptureFingerPrintData) {
+ thisws.OnFRO900_CaptureFingerPrintData(data.ErrorCode, data.ErrorMessage, null, null, null, null, data.PreviewImg);
+ }
+ }
+ else {
+ var FRO900_Capture_image_1 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_1,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_1,
+ quality: data.Image_Quality_1,
+ NFIQ: data.Image_NFIQ_1
+ };
+ var FRO900_Capture_image_2 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_2,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_2,
+ quality: data.Image_Quality_2,
+ NFIQ: data.Image_NFIQ_2
+ };
+ var FRO900_Capture_image_3 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_3,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_3,
+ quality: data.Image_Quality_3,
+ NFIQ: data.Image_NFIQ_3
+ };
+ var FRO900_Capture_image_4 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_4,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_4,
+ quality: data.Image_Quality_4,
+ NFIQ: data.Image_NFIQ_4
+ };
+ if (thisws.OnFRO900_CaptureFingerPrintData) {
+ thisws.OnFRO900_CaptureFingerPrintData(data.ErrorCode, data.ErrorMessage, FRO900_Capture_image_1, FRO900_Capture_image_2, FRO900_Capture_image_3, FRO900_Capture_image_4, null);
+ }
+ }
+ break;
+ case CommandType.FRO900_CloseDevice_Type:
+ if (thisws.OnFRO900_OpenDevice) {
+ thisws.OnFRO900_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FRO900_GeneralizeTemplate_Type:
+ if (thisws.OnGeneralizeTemplate) {
+ thisws.OnFRO900_GeneralizeTemplate(data.ErrorCode, data.ErrorMessage, data.Template_Data);
+ }
+ break;
+ case CommandType.FRO900_Verify_Type:
+ if (thisws.OnVerify) {
+ thisws.OnFRO900_Verify(data.ErrorCode, data.ErrorMessage, data.Verify_Score, data.Verify_Result);
+ }
+ break;
+ case CommandType.Iris_InitDevice_Type:
+ if (thisws.OnIris_InitDevice) {
+ thisws.OnIris_InitDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_StartCapture_Type:
+ if (thisws.OnIris_StartCapture) {
+ thisws.OnIris_StartCapture(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartCapture2_Type:
+ if (thisws.OnIris_StartCapture2) {
+ thisws.OnIris_StartCapture2(data.ErrorCode, data.ErrorMessage, data.Left_Eye_Image, data.Left_Eye_Data, data.Right_Eye_Image, data.Right_Eye_Data);
+ }
+ break;
+ case CommandType.Iris_StartFastCapture_Type:
+ if (thisws.OnIris_StartCapture) {
+ thisws.OnIris_StartCapture(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartFastCapture2_Type:
+ if (thisws.OnIris_StartCapture2) {
+ thisws.OnIris_StartCapture2(data.ErrorCode, data.ErrorMessage, data.Left_Eye_Image, data.Left_Eye_Data, data.Right_Eye_Image, data.Right_Eye_Data);
+ }
+ break;
+ case CommandType.Iris_StopCapture_Type:
+ if (thisws.OnIris_StopCapture) {
+ thisws.OnIris_StopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_StartVerify_Type:
+ if (thisws.OnIris_StartVerify) {
+ thisws.OnIris_StartVerify(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartVerify2_Type:
+ if (thisws.OnIris_StartVerify2) {
+ thisws.OnIris_StartVerify2(data.ErrorCode, data.ErrorMessage, data.Verify_Result);
+ }
+ break;
+ case CommandType.Iris_StopVerify_Type:
+ if (thisws.OnIris_StopVerify) {
+ thisws.OnIris_StopVerify(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_ReleaseDevice_type:
+ if (thisws.OnIris_ReleaseDevice) {
+ thisws.OnIris_ReleaseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_SetOptions_Type:
+ if (thisws.OnIris_SetOptions) {
+ thisws.OnIris_SetOptions(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.ARA_ReadIDCard_Type:
+ var infodata = {
+ chinese_name: data.CNName,
+ sex: data.Sex,
+ birth: data.Birth,
+ idnum: data.IDNum,
+ expdatebegin: data.ExpDateBegin,
+ expdateend: data.ExpDateEnd,
+ authority: data.Authority,
+ english_name: data.ENName,
+ country: data.Country,
+ version: data.Version,
+ address: data.Address,
+ passnum: data.PassNum,
+ issuecount: data.IssueCount,
+ nation: data.Nation,
+ newaddress: data.NewAddress,
+ feature1: data.Feature1,
+ feature2: data.Feature2,
+ photodata: data.PhotoData,
+ };
+ if (thisws.OnARA_ReadIDCard) {
+ thisws.OnARA_ReadIDCard(data.ErrorCode, data.ErrorMessage, data.CardType, infodata);
+ }
+ break;
+ case CommandType.FingerKey_OpenDevice_Type:
+ if (thisws.OnFingerKey_OpenDevice) {
+ thisws.OnFingerKey_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FingerKey_CloseDevice_Type:
+ if (thisws.OnFingerKey_CloseDevice) {
+ thisws.OnFingerKey_CloseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FingerKey_GetDeviceInformation_Type:
+ var keyinfo = {
+ manufacturer: data.Manufacturer,
+ issuer: data.Issuer,
+ label: data.Label,
+ sn: data.SN,
+ hwver: data.HWVer,
+ fwver: data.FWVer,
+ };
+ if (thisws.OnFingerKey_GetDeviceInformation) {
+ thisws.OnFingerKey_GetDeviceInformation(data.ErrorCode, data.ErrorMessage, keyinfo);
+ }
+ break;
+ case CommandType.FingerKey_CaptureFingerData_Type:
+ if (thisws.OnFingerKey_CaptureFingerData) {
+ thisws.OnFingerKey_CaptureFingerData(data.ErrorCode, data.ErrorMessage, data.Image_Data, data.Feature_Data, data.Image_Quality);
+ }
+ break;
+ case CommandType.FingerKey_ImportFingerPrint_Type:
+ if (thisws.OnFingerKey_ImportFingerPrint) {
+ thisws.OnFingerKey_ImportFingerPrint(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_InitDevice_Type:
+ if (thisws.OnCamera_InitDevice) {
+ thisws.OnCamera_InitDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_ReleaseDevice_Type:
+ if (thisws.OnCamera_ReleaseDevice) {
+ thisws.OnCamera_ReleaseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_StartCapture_Type:
+ if (thisws.OnCamera_StartCapture) {
+ thisws.OnCamera_StartCapture(data.ErrorCode, data.ErrorMessage, data.ImageData, data.LiveDetect, data.FaceDetect, data.FaceQuality);
+ }
+ break;
+ case CommandType.Camera_StopCapture_Type:
+ if (thisws.OnCamera_StopCapture) {
+ thisws.OnCamera_StopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_SetOption_Type:
+ if (thisws.OnCamera_SetOption) {
+ thisws.OnCamera_SetOption(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ default:
+ if (thisws.OnOtherError) {
+ thisws.OnOtherError(data.ResponseType, data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ }
+ };
+ this.ws.onclose = function () {
+ thisws.isConnect = false;
+ alert("未连接设备,请检查指纹驱动是否开启(或重启驱动再次尝试)")
+ console.log("Disconnect");
+ };
+ };
+ Client.prototype.Disconnect_Server = function () {
+ var thisws = this;
+ this.ws.close();
+ };
+ return Client;
+}());
diff --git a/public/zhiwenDemo/app.css b/public/zhiwenDemo/app.css
new file mode 100644
index 0000000..39a1417
--- /dev/null
+++ b/public/zhiwenDemo/app.css
@@ -0,0 +1,80 @@
+body {
+ width: 100%;
+ height: 174px;
+ font-family: 'Segoe UI', sans-serif;
+ padding: 0 !important;
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+ margin-bottom: 0 !important;
+}
+
+span {
+ font-style: italic;
+}
+#zhiwenOur{
+ width: 100%;
+ height: 174px;
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+
+}
+#img{
+ width: 180px;
+ height: 180px;
+}
+#butDiv{
+ width:calc(100% - 180px);
+ height: 180px;
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+}
+#zhiwentip{
+ font-size: 12px;
+ position: relative;
+ top: 20px;
+ display: none;
+}
+#zhiwentipok{
+ font-size: 12px;
+ position: relative;
+ top: 20px;
+ display: none;
+}
+#zhiwentipno{
+ font-size: 12px;
+ position: relative;
+ top: 20px;
+ display: none;
+}
+#connect_server{
+ height: 40px;
+ border: none;
+ background-color: #409EFF;
+ border-radius: 5px;
+ color: #fff;
+ position: relative;
+ left: 13px;
+ display: none;
+}
+#closeG{
+ height: 40px;
+ border: none;
+ background-color: #E6A23C;
+ border-radius: 5px;
+ color: #fff;
+ display: none;
+ position: relative;
+ left: 13px;
+}
+#onceGgin{
+ height: 40px;
+ border: none;
+ background-color: #409EFF;
+ border-radius: 5px;
+ color: #fff;
+ display: none;
+ position: relative;
+ left: 13px;
+}
diff --git a/public/zhiwenDemo/app.js b/public/zhiwenDemo/app.js
new file mode 100644
index 0000000..c19bbd7
--- /dev/null
+++ b/public/zhiwenDemo/app.js
@@ -0,0 +1,2376 @@
+var operate_model;
+var client = new Client();
+var device_id;
+var dpi;
+var feature1;
+var feature2;
+var feature3;
+var flag = 0;
+var bmpdata;
+var imagewidth = 0;
+var imageheight = 0;
+var LED = 0;
+var Status = 0;
+var begin_cap = false;
+var show_img_index = 0;
+var CID_img_1;
+var CID_img_2;
+var CID_fea_1;
+var CID_fea_2;
+var ImageMatch = false;
+var CID_score_thresh;
+var language = 1;
+var MultiFinger = 0;
+var Iris_capture_mode = 1;
+var Fkey_fea1;
+var Fkey_fea2;
+var Fkey_fea3;
+var Fkey_fea4;
+var Fkey_fea5;
+var Fkey_fea6;
+var Fkey_capcount = 0;
+var butERRoR = 0;
+var butTime;
+var imgSRC;//图片指纹信息
+var imgBMP;//BMP格式指纹信息
+var CID_img_raw;//RAW格式指纹信息
+var featuredatas;//特征值
+var isoks = false;//控制是否完成本次指纹采集
+function changelanguage_trustfinger() {
+ language = language ^ 1;
+ document.getElementById("change_language").innerHTML = change_description[language];
+ document.getElementById("title").innerHTML = title_trustfinger_description[language];
+ document.getElementById("link").innerHTML = link_description[language];
+ document.getElementById("connect_server").innerHTML = connect_description[language];
+ document.getElementById("open_device").innerHTML = open_description[language];
+ document.getElementById("close_device").innerHTML = close_description[language];
+ document.getElementById("device_count").innerHTML = device_count_description[language];
+ document.getElementById("device_desc").innerHTML = device_desc_description[language];
+ document.getElementById("capture1").innerHTML = cap1_description[language];
+ document.getElementById("capture2").innerHTML = cap2_description[language];
+ document.getElementById("capture3").innerHTML = cap3_description[language];
+ document.getElementById("generalize").innerHTML = gen_description[language];
+ document.getElementById("verify").innerHTML = verify_description[language];
+ document.getElementById("start").innerHTML = startcap_description[language];
+ document.getElementById("end").innerHTML = endcap_description[language];
+ if (Status == 1) {
+ if (LED == 1) {
+ document.getElementById("red").innerHTML = close_red_description[language];
+ document.getElementById("green").innerHTML = open_green_description[language];
+ }
+ else {
+ document.getElementById("red").innerHTML = open_red_description[language];
+ document.getElementById("green").innerHTML = close_green_description[language];
+ }
+ }
+ else {
+ document.getElementById("red").innerHTML = open_red_description[language];
+ document.getElementById("green").innerHTML = open_green_description[language];
+ }
+ document.getElementById("b2r").innerHTML = b2r_description[language];
+ document.getElementById("b2wsq").innerHTML = b2w_description[language];
+ document.getElementById("b2iso").innerHTML = b2i_description[language];
+ document.getElementById("b2ansi").innerHTML = b2a_description[language];
+}
+function changelanguage_CID() {
+ language = language ^ 1;
+ document.getElementById("change_language").innerHTML = change_description[language];
+ document.getElementById("title").innerHTML = title_CID_description[language];
+ document.getElementById("link").innerHTML = link_description[language];
+ document.getElementById("connect_server").innerHTML = connect_description[language];
+ document.getElementById("open_device").innerHTML = init_description[language];
+ document.getElementById("close_device").innerHTML = close_description[language];
+ document.getElementById("device_count").innerHTML = device_count_description[language];
+ document.getElementById("device_desc").innerHTML = device_desc_description[language];
+ document.getElementById("cap1").innerHTML = cap1_description[language];
+ document.getElementById("cap2").innerHTML = cap2_description[language];
+ document.getElementById("ext1").innerHTML = extract1_description[language];
+ document.getElementById("ext2").innerHTML = extract2_description[language];
+ document.getElementById("feaverify").innerHTML = feature_verify_description[language];
+ document.getElementById("imgverify").innerHTML = image_verify_description[language];
+ document.getElementById("start").innerHTML = startcap_description[language];
+ document.getElementById("end").innerHTML = endcap_description[language];
+}
+function changelanguage_FRO900() {
+ language = language ^ 1;
+ document.getElementById("change_language").innerHTML = change_description[language];
+ document.getElementById("title").innerHTML = title_FRO900_description[language];
+ document.getElementById("link").innerHTML = link_description[language];
+ document.getElementById("connect_server").innerHTML = connect_description[language];
+ document.getElementById("open_device").innerHTML = open_description[language];
+ document.getElementById("close_device").innerHTML = close_description[language];
+ document.getElementById("device_count").innerHTML = device_count_description[language];
+ document.getElementById("capture1").innerHTML = cap1_description[language];
+ document.getElementById("capture2").innerHTML = cap2_description[language];
+ document.getElementById("capture3").innerHTML = cap3_description[language];
+ document.getElementById("generalize").innerHTML = gen_description[language];
+ document.getElementById("verify").innerHTML = verify_description[language];
+ document.getElementById("capture_left").innerHTML = FRO900_capture_left_4[language];
+ document.getElementById("capture_right").innerHTML = FRO900_capture_right_4[language];
+ document.getElementById("capture_thumb").innerHTML = FRO900_capture_thumb_2[language];
+}
+function changelanguage_Iris() {
+ language = language ^ 1;
+ document.getElementById("change_language").innerHTML = change_description[language];
+ document.getElementById("title").innerHTML = title_FRO900_description[language];
+ document.getElementById("link").innerHTML = link_description[language];
+ document.getElementById("connect_server").innerHTML = connect_description[language];
+ document.getElementById("open_device").innerHTML = init_description[language];
+ document.getElementById("release_device").innerHTML = Iris_release_device[language];
+ document.getElementById("startcap").innerHTML = Iris_start_cap[language];
+ document.getElementById("stopcap").innerHTML = Iris_stop_cap[language];
+ document.getElementById("startver").innerHTML = Iris_start_ver[language];
+ document.getElementById("stopver").innerHTML = Iris_stop_ver[language];
+ document.getElementById("distance_desc").innerHTML = Iris_distance_desc[language];
+}
+window.onload = function () {
+ client.OnOpenDevice = function (code, msg) {
+ if (code == 0) {
+ if (language) {
+ alert("打开设备成功");
+ }
+ else {
+ alert("Open Success");
+ }
+ }
+ else {
+ if (language) {
+ alert("打开设备失败," + code + " " + msg);
+ }
+ else {
+ alert("Open Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnCloseDevice = function (code, msg) {
+ if (code == 0) {
+ if (language) {
+ console.log("关闭设备成功OnCloseDevice");
+ }
+ else {
+ alert("Close Success");
+ }
+ }
+ else {
+ if (language) {
+ alert("关闭设备失败," + code + " " + msg);
+ }
+ else {
+ alert("Close Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnGetDeviceCount = function (code, msg, count) {
+ if (code == 0) {
+ if (language) {
+ alert("设备数量为:" + count);
+ }
+ else {
+ alert("Device count:" + count);
+ }
+ }
+ else {
+ if (language) {
+ alert("获取设备数量失败," + code + " " + msg);
+ }
+ else {
+ alert("Get Device Count Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnGetDeviceDescription = function (code, msg, info) {
+ if (code == 0) {
+ alert("Serial Number:" + info.sn + "\r\n" + "Manufacturer Name:" + info.manufacturer + "\r\n" + "Product Name:" + info.productname);
+ device_id = info.device_id;
+ imagewidth = info.image_width;
+ imageheight = info.iamge_height;
+ dpi = info.dpi;
+ }
+ else {
+ if (language) {
+ alert("获取设备信息失败," + code + " " + msg);
+ }
+ else {
+ alert("Get Device Description Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnCaptureFingerData = function (code, msg, image) {
+ if (code == 0) {
+ if (image.image_format == ImageFormatType.IBmp) {
+ if (flag % 3 == 0) {
+ var image_area = document.getElementById("img3");
+ image_area.src = "data:image/bmp;base64," + image.image_data;
+ }
+ else if (flag % 3 == 1) {
+ var image_area = document.getElementById("img1");
+ image_area.src = "data:image/bmp;base64," + image.image_data;
+ }
+ else {
+ var image_area = document.getElementById("img2");
+ image_area.src = "data:image/bmp;base64," + image.image_data;
+ }
+ bmpdata = image.image_data;
+ }
+ if (flag % 3 == 0) {
+ feature3 = image.feature_data;
+ }
+ else if (flag % 3 == 1) {
+ feature1 = image.feature_data;
+ }
+ else {
+ feature2 = image.feature_data;
+ }
+ }
+ else {
+ if (language) {
+ alert("采集失败," + code + " " + msg);
+ }
+ else {
+ alert("Capture Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnStartCapture = function (code, msg, image) {
+ if (code == 0 || code == -211) {
+ var image_area = document.getElementById("img1");
+ image_area.src = "data:image/bmp;base64," + image.image_data;
+ }
+ else {
+ if (language) {
+ alert("开始预览失败," + code + " " + msg);
+ }
+ else {
+ alert("Start Preview Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnStopCapture = function (code, msg) {
+ if (code == 0) {
+ console.log("Stop Success");
+ }
+ else {
+ if (language) {
+ alert("停止预览失败," + code + " " + msg);
+ }
+ else {
+ alert("Stop Preview Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnGeneralizeTemplate = function (code, msg, template) {
+ if (code == 0) {
+ if (language) {
+ alert("合成模板成功");
+ }
+ else {
+ alert("Generalize Success");
+ }
+ var img_text = document.getElementById("imgdata");
+ img_text.value = template;
+ }
+ else {
+ if (language) {
+ alert("合成模板失败," + code + " " + msg);
+ }
+ else {
+ alert("Generalize Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnVerify = function (code, msg, score, result) {
+ if (code == 0) {
+ if (result == 0) {
+ if (language) {
+ alert("比对结果为不匹配");
+ }
+ else {
+ alert("Mismatch");
+ }
+ }
+ else {
+ if (language) {
+ alert("比对成功,分数为" + score);
+ }
+ else {
+ alert("Matching Success,Score is" + " " + score);
+ }
+ }
+ }
+ else {
+ if (language) {
+ alert("比对失败," + code + " " + msg);
+ }
+ else {
+ alert("Match Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnSetOption = function (code, msg) {
+ if (code == 0) {
+ console.log("Set LED Success");
+ var red_button = document.getElementById("red");
+ var green_button = document.getElementById("green");
+ if (LED == 1) {
+ if (Status == 1) {
+ green_button.disabled = true;
+ red_button.innerHTML = close_red_description[language];
+ }
+ else {
+ green_button.disabled = false;
+ red_button.innerHTML = open_red_description[language];
+ }
+ }
+ else if (LED == 0) {
+ if (Status == 1) {
+ red_button.disabled = true;
+ green_button.innerHTML = close_green_description[language];
+ }
+ else {
+ red_button.disabled = false;
+ green_button.innerHTML = open_green_description[language];
+ }
+ }
+ }
+ else {
+ if (language) {
+ alert("LED灯操作失败," + code + " " + msg);
+ }
+ else {
+ alert("Set LED Failed," + code + " " + msg);
+ }
+ var red_button = document.getElementById("red");
+ var green_button = document.getElementById("green");
+ red_button.disabled = false;
+ green_button.disabled = false;
+ red_button.innerHTML = open_red_description[language];
+ green_button.innerHTML = open_green_description[language];
+ LED = 0;
+ Status = 0;
+ }
+ };
+ client.OnBmpToRaw = function (code, msg, imagedata) {
+ // console.log(code, msg, "BMP格式转换成RAW");
+ if (code == 0) {
+ client.CID_Alg_GetQualityScore(imagedata);
+ CID_img_raw = imagedata;
+ }
+ else {
+ client.CID_EndCapture(0);
+ begin_cap = false;
+ alert("格式转换失败," + code + " " + msg);
+ }
+ };
+ // client.OnBmpToRaw = function (code, msg, imagedata) {
+ // // console.log(code)
+ // console.log(code, msg, "BMP格式转换成RAW");
+ // if (code == 0) {
+ // if (operate_model == 1) {
+ // if (ImageMatch) {
+ // client.CID_Alg_ImageMatch(imagedata, CID_fea_2);
+ // ImageMatch = false;
+ // }
+ // else {
+ // client.CID_Alg_FeatureExtract(ID_FingerPosition.UNKNOWN, imagedata);
+ // }
+ // }
+ // else if (operate_model == 2) {
+ // client.CID_Alg_GetQualityScore(imagedata);
+ // // console.log(imagedata)
+ // CID_img_raw = imagedata;
+ // }
+ // else {
+ // if (language) {
+ // alert("格式转换成功");
+ // var img_text = document.getElementById("imgdata");
+ // img_text.value = imagedata;
+ // }
+ // else {
+ // alert("Format conversion Success");
+ // var img_text = document.getElementById("imgdata");
+ // img_text.value = imagedata;
+ // }
+ // }
+ // }
+ // else {
+ // if (operate_model == 2) {
+ // client.CID_EndCapture(0);
+ // begin_cap = false;
+ // }
+ // if (language) {
+ // alert("格式转换失败," + code + " " + msg);
+ // }
+ // else {
+ // alert("Format conversion Failed," + code + " " + msg);
+ // }
+ // }
+ // };
+ client.OnBmpToWSQ = function (code, msg, imagedata) {
+ if (code == 0) {
+ if (language) {
+ alert("格式转换成功");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ else {
+ alert("Format conversion Success");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ }
+ else {
+ if (language) {
+ alert("格式转换失败," + code + " " + msg);
+ }
+ else {
+ alert("Format conversion Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnBmpToISO = function (code, msg, imagedata) {
+ if (code == 0) {
+ if (language) {
+ alert("格式转换成功");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ else {
+ alert("Format conversion Success");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ }
+ else {
+ if (language) {
+ alert("格式转换失败," + code + " " + msg);
+ }
+ else {
+ alert("Format conversion Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnBmpToANSI = function (code, msg, imagedata) {
+ if (code == 0) {
+ if (language) {
+ alert("格式转换成功");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ else {
+ alert("Format conversion Success");
+ var img_text = document.getElementById("imgdata");
+ img_text.value = imagedata;
+ }
+ }
+ else {
+ if (language) {
+ alert("格式转换失败," + code + " " + msg);
+ }
+ else {
+ alert("Format conversion Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnCID_Init = function (code, msg) {
+ if (code == 1) {
+ client.CID_Alg_Begin();
+ }
+ else {
+ if (language) {
+ // alert("设备初始化发生错误 错误码:" + code);
+ }
+ else {
+ alert("Init Device Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Close = function (code, msg) {
+ if (code == 1) {
+ if (language) {
+ // console.log("关闭设备成功OnCID_Close");
+ }
+ else {
+ alert(msg);
+ }
+ }
+ else {
+ if (language) {
+ alert("关闭设备发生错误 错误码:" + code);
+ }
+ else {
+ alert("Close Device Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_GetCount = function (code, msg, count) {
+ if (code == 1) {
+ if (language) {
+ alert("设备数量:" + count);
+ }
+ else {
+ alert("Device Count:" + count);
+ }
+ }
+ else {
+ if (language) {
+ alert("获取设备数量发生错误 错误码:" + code);
+ }
+ else {
+ alert("Get Device Count Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_GetDesc = function (code, msg, desc) {
+ if (code == 1) {
+ if (language) {
+ alert("设备信息:" + desc);
+ }
+ else {
+ alert("Device Description:" + desc);
+ }
+ }
+ else {
+ if (language) {
+ alert("获取设备信息发生错误 错误码:" + code);
+ }
+ else {
+ alert("Get Device Description Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_BeginCapture = function (code, msg) {
+ if (code == 1) {
+ client.CID_GetFPBmpData(0);
+ }
+ else {
+ if (language) {
+ alert("开始采集发生错误 错误码:" + code);
+ }
+ else {
+ alert("Begin Capture Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_GetBmpData = function (code, msg, imagedata, feadata) {
+ // console.log(feadata)
+ if (code == 1) {
+ switch (show_img_index) {
+ case 0:
+ var image_area = document.getElementById("img");
+ image_area.src = "data:image/bmp;base64," + imagedata;
+ imgSRC = "data:image/bmp;base64," + imagedata;
+ imgBMP = imagedata;
+ break;
+ case 1:
+ var image_area1 = document.getElementById("img1");
+ image_area1.src = "data:image/bmp;base64," + imagedata;
+ CID_img_1 = imagedata;
+ break;
+ case 2:
+ var image_area2 = document.getElementById("img2");
+ image_area2.src = "data:image/bmp;base64," + imagedata;
+ CID_img_2 = imagedata;
+ break;
+ }
+ if (begin_cap) {
+ client.BmpToRaw(imagedata, 256, 360);
+ }
+ }
+ else {
+ client.CID_EndCapture(0);
+ begin_cap = false;
+ if (language) {
+ // console.log("采集发生错误 错误码:" + code);
+ }
+ else {
+ alert("GetBmpData Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_EndCapture = function (code, msg) {
+ if (code == 1) {
+ if (begin_cap) {
+ client.CID_BeginCapture(0);
+ }
+ }
+ else {
+ begin_cap = false;
+ if (language) {
+ // console.log("手动关闭 错误码:" + code);
+ }
+ else {
+ alert("End Capture Error ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Alg_FeatureExtract = function (code, msg, featuredata) {
+ if (code == 1) {
+ // console.log(show_img_index, "show_img_indexshow_img_indexshow_img_index")
+ switch (show_img_index) {
+ case 0:
+ // var fea0_text = document.getElementById("Fea1");
+ // fea0_text.value = featuredata;
+ // 输出特征值
+ featuredatas = featuredata;
+ closeG();
+ // console.log(featuredatas)
+ break;
+ case 1:
+ CID_fea_1 = featuredata;
+ var fea1_text = document.getElementById("Fea1");
+ fea1_text.value = featuredata;
+ break;
+ case 2:
+ CID_fea_2 = featuredata;
+ var fea2_text = document.getElementById("Fea2");
+ fea2_text.value = featuredata;
+ break;
+ }
+ if (language) {
+ // console.log("特征提取成功");
+ // let butBegin = document.getElementById("connect_server");
+ // butBegin.innerText = "重新录制";
+ // butBegin.style.backgroundColor = "#409EFF";
+ isoks = true;
+ let butBegin = document.getElementById("connect_server");
+ butBegin.style.display = "none"
+ let closeG = document.getElementById("closeG");
+ closeG.style.display = "none"
+ let zhiwentip = document.getElementById("zhiwentip");
+ zhiwentip.style.display = "none";
+ let zhiwentipok = document.getElementById("zhiwentipok");
+ zhiwentipok.style.display = "block";
+ let zhiwentipno = document.getElementById("zhiwentipno");
+ zhiwentipno.style.display = "none";
+ let onceGgin = document.getElementById("onceGgin");
+ onceGgin.style.display = "block"
+ }
+ else {
+ alert("Extract Feature Successfully");
+ }
+ }
+ else {
+ if (language) {
+ alert("特征提取发生错误 错误码:" + code);
+ }
+ else {
+ alert("Extract Feature Failed ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Alg_Begin = function (code, msg) {
+ if (code == 1) {
+ if (language) {
+ // console.log("初始化成功");
+ show_img_index = 0;
+ begin_cap = true;
+ operate_model = 2;
+ client.CID_BeginCapture(0);
+ }
+ else {
+ alert("Init Successfully");
+ }
+ }
+ else {
+ if (language) {
+ // console.log("算法初始化发生错误 错误码:" + code);
+ }
+ else {
+ alert("Init Algorithm Failed ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Alg_FeatureMatch = function (code, msg, similarity) {
+ if (code == 1) {
+ if (language) {
+ alert("比对成功 相似度:" + similarity);
+ }
+ else {
+ alert("Matching Success Match Similarity:" + similarity);
+ }
+ }
+ else {
+ if (language) {
+ alert("比对发生错误 错误码:" + code);
+ }
+ else {
+ alert("Matching Failed ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Alg_ImageMatch = function (code, msg, similarity) {
+ if (code == 1) {
+ if (language) {
+ alert("比对成功 相似度:" + similarity);
+ }
+ else {
+ alert("Matching Success Match Similarity:" + similarity);
+ }
+ }
+ else {
+ if (language) {
+ alert("比对发生错误 错误码:" + code);
+ }
+ else {
+ alert("Matching Failed ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnCID_Alg_GetQualityScore = function (code, msg, score) {
+ //停止获取
+ // console.log(code, score, "停止?");
+ if (code == 1) {
+ if (operate_model == 2) {
+ // var s = document.getElementById("score");
+ // s.innerText = score.toString();
+ if (score >= 70) {
+ begin_cap = false;
+ client.CID_EndCapture(0);
+ // console.log(ID_FingerPosition.UNKNOWN, 'ID_FingerPosition.UNKNOWN')
+ client.CID_Alg_FeatureExtract(ID_FingerPosition.UNKNOWN, CID_img_raw);
+ }
+ else {
+ client.CID_EndCapture(0);
+ }
+ }
+ }
+ else if (code == -9 && operate_model == 2) {
+ client.CID_EndCapture(0);
+ }
+ else {
+ if (operate_model == 2) {
+ client.CID_EndCapture(0);
+ begin_cap = false;
+ }
+ if (language) {
+ // alert("获取质量分数发生错误 错误码:" + code);
+ }
+ else {
+ alert("Get quality score failed ErrorCode:" + code);
+ }
+ }
+ };
+ client.OnTrustLink_GetDeviceInfo = function (code, msg, macadress, ipadress, hostname) {
+ if (code != 0) {
+ alert(msg);
+ }
+ else {
+ alert("MACAdress:" + macadress + "\r\n" + "IPAdress:" + ipadress + "\r\n" + "HostName:" + hostname);
+ }
+ };
+ client.OnARA_FeaConv = function (code, msg, feadata) {
+ if (code != 0) {
+ alert(msg);
+ }
+ else {
+ var fea1_text = document.getElementById("Fea1");
+ fea1_text.value = feadata;
+ // 输出特征值
+ // console.log(feadata)
+ }
+ };
+ client.OnARA_GetCurrentDeviceList = function (code, msg, list) {
+ if (code != 0) {
+ alert(msg);
+ }
+ else {
+ if (list != null) {
+ var size = list.length;
+ var dev_list = "";
+ for (var i = 0; i < size; i++) {
+ dev_list += "Device Name:";
+ dev_list += list[i].DeviceName;
+ dev_list += "\r\n";
+ dev_list += "Device Information:";
+ dev_list += list[i].DeviceInfo;
+ dev_list += "\r\n";
+ dev_list += "Device Number:";
+ dev_list += list[i].ConnectNum;
+ dev_list += "\r\n";
+ }
+ alert(dev_list);
+ }
+ }
+ };
+ client.OnARA_ReadIDCard = function (code, msg, cardtype, info) {
+ if (code == 0) {
+ switch (cardtype) {
+ case IDCardType.IDCard_People:
+ document.all['CardType'].value = "中华人民共和国居民身份证";
+ document.all['Name'].value = info.chinese_name;
+ document.all['Sex'].value = info.sex;
+ document.all['Nation'].value = info.nation;
+ document.all['Born'].value = info.birth;
+ document.all['Address'].value = info.address;
+ document.all['NewAddress'].value = info.newaddress;
+ document.all['CardNo'].value = info.idnum;
+ document.all['Police'].value = info.authority;
+ document.all['ActivityLFrom'].value = info.expdatebegin;
+ document.all['ActivityLTo'].value = info.expdateend;
+ if (info.feature1 != undefined || info.feature2 != undefined) {
+ document.all['FPInfo1'].value = info.feature1;
+ document.all['FPInfo2'].value = info.feature2;
+ }
+ var img1 = document.getElementById("imgPre");
+ img1.src = "data:image/bmp;base64," + info.photodata;
+
+ break;
+ case IDCardType.IDCard_GAT:
+ document.all['CardType'].value = "中华人民共和国港澳台居民居住证";
+ document.all['Name'].value = info.chinese_name;
+ document.all['Sex'].value = info.sex;
+ document.all['Born'].value = info.birth;
+ document.all['CardNo'].value = info.idnum;
+ document.all['ActivityLFrom'].value = info.expdatebegin;
+ document.all['ActivityLTo'].value = info.expdateend;
+ document.all['Police'].value = info.authority;
+ document.all['Address'].value = info.address;
+ document.all['PassNo'].value = info.passnum;
+ document.all['IssueCount'].value = info.issuecount;
+ if (info.feature1 != undefined || info.feature2 != undefined) {
+ document.all['FPInfo1'].value = info.feature1;
+ document.all['FPInfo2'].value = info.feature2;
+ }
+ var img2 = document.getElementById("imgPre");
+ img2.src = "data:image/bmp;base64," + info.photodata;
+ break;
+ case IDCardType.IDCard_Foreign:
+ document.all['CardType'].value = "中华人民共和国外国人永久居留身份证";
+ document.all['Name'].value = info.chinese_name;
+ document.all['Sex'].value = info.sex;
+ document.all['Born'].value = info.birth;
+ document.all['CardNo'].value = info.idnum;
+ document.all['ActivityLFrom'].value = info.expdatebegin;
+ document.all['ActivityLTo'].value = info.expdateend;
+ document.all['Police'].value = info.authority;
+ document.all['EnglishName'].value = info.english_name;
+ document.all['Country'].value = info.country;
+ document.all['Version'].value = info.version;
+ if (info.feature1 != undefined || info.feature2 != undefined) {
+ document.all['FPInfo1'].value = info.feature1;
+ document.all['FPInfo2'].value = info.feature2;
+ }
+ var img3 = document.getElementById("imgPre");
+ img3.src = "data:image/bmp;base64," + info.photodata;
+ break;
+ }
+ }
+ else {
+ if (code == 232) {
+ client.ARA_ReadIDCard();
+ }
+ else {
+ if (language) {
+ alert("读卡失败," + code + " " + msg);
+ }
+ else {
+ alert("Read card failed," + code + " " + msg);
+ }
+ }
+ }
+ };
+ client.OnFRO900_OpenDevice = function (code, msg) {
+ if (code == 0) {
+ if (language) {
+ alert("打开设备成功");
+ }
+ else {
+ alert("Open Success");
+ }
+ }
+ else {
+ if (language) {
+ alert("打开设备失败," + code + " " + msg);
+ }
+ else {
+ alert("Open Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnFRO900_GetDeviceCount = function (code, msg, count) {
+ if (code == 0) {
+ if (language) {
+ alert("设备数量为:" + count);
+ }
+ else {
+ alert("Device count:" + count);
+ }
+ }
+ else {
+ if (language) {
+ alert("获取设备数量失败," + code + " " + msg);
+ }
+ else {
+ alert("Get Device Count Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnFRO900_CaptureFingerPrintData = function (code, msg, image1, image2, image3, image4, previewimg) {
+ if (code != 0) {
+ if (language) {
+ alert("采集失败," + code + " " + msg);
+ }
+ else {
+ alert("Capture Failed," + code + " " + msg);
+ }
+ }
+ else {
+ if (previewimg != null) {
+ var preimage_area = document.getElementById("preimg");
+ preimage_area.src = "data:image/bmp;base64," + previewimg;
+ }
+ else {
+ if (MultiFinger == 0) {
+ if (image1.image_format == ImageFormatType.IBmp) {
+ if (flag % 3 == 0) {
+ var image_area = document.getElementById("img3");
+ image_area.src = "data:image/bmp;base64," + image1.image_data;
+ }
+ else if (flag % 3 == 1) {
+ var image_area = document.getElementById("img1");
+ image_area.src = "data:image/bmp;base64," + image1.image_data;
+ }
+ else {
+ var image_area = document.getElementById("img2");
+ image_area.src = "data:image/bmp;base64," + image1.image_data;
+ }
+ }
+ if (flag % 3 == 0) {
+ feature3 = image1.feature_data;
+ }
+ else if (flag % 3 == 1) {
+ feature1 = image1.feature_data;
+ }
+ else {
+ feature2 = image1.feature_data;
+ }
+ var fea1_text = document.getElementById("imgdata");
+ fea1_text.value = image1.feature_data;
+ }
+ else if (MultiFinger == 1) {
+ if (image1.image_format == ImageFormatType.IBmp) {
+ if (image1.image_data != undefined) {
+ var image_area1 = document.getElementById("img4");
+ image_area1.src = "data:image/bmp;base64," + image1.image_data;
+ }
+ if (image2.image_data != undefined) {
+ var image_area2 = document.getElementById("img3");
+ image_area2.src = "data:image/bmp;base64," + image2.image_data;
+ }
+ if (image3.image_data != undefined) {
+ var image_area3 = document.getElementById("img2");
+ image_area3.src = "data:image/bmp;base64," + image3.image_data;
+ }
+ if (image4.image_data != undefined) {
+ var image_area4 = document.getElementById("img1");
+ image_area4.src = "data:image/bmp;base64," + image4.image_data;
+ }
+ }
+ }
+ else if (MultiFinger == 2) {
+ if (image1.image_format == ImageFormatType.IBmp) {
+ if (image1.image_data != undefined) {
+ var image_area1 = document.getElementById("img1");
+ image_area1.src = "data:image/bmp;base64," + image1.image_data;
+ }
+ if (image2.image_data != undefined) {
+ var image_area2 = document.getElementById("img2");
+ image_area2.src = "data:image/bmp;base64," + image2.image_data;
+ }
+ if (image3.image_data != undefined) {
+ var image_area3 = document.getElementById("img3");
+ image_area3.src = "data:image/bmp;base64," + image3.image_data;
+ }
+ if (image4.image_data != undefined) {
+ var image_area4 = document.getElementById("img4");
+ image_area4.src = "data:image/bmp;base64," + image4.image_data;
+ }
+ }
+ }
+ else if (MultiFinger == 3) {
+ if (image1.image_format == ImageFormatType.IBmp) {
+ var image_area1 = document.getElementById("img1");
+ image_area1.src = "data:image/bmp;base64," + image1.image_data;
+ var image_area2 = document.getElementById("img2");
+ image_area2.src = "data:image/bmp;base64," + image2.image_data;
+ }
+ }
+ }
+ }
+ };
+ client.OnFRO900_CloseDevice = function (code, msg) {
+ if (code == 0) {
+ if (language) {
+ console.log("关闭设备成功OnFRO900_CloseDevice");
+ }
+ else {
+ alert("Close Success");
+ }
+ }
+ else {
+ if (language) {
+ alert("关闭设备失败," + code + " " + msg);
+ }
+ else {
+ alert("Close Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnFRO900_GeneralizeTemplate = function (code, msg, template) {
+ if (code == 0) {
+ if (language) {
+ alert("合成模板成功");
+ }
+ else {
+ alert("Generalize Success");
+ }
+ var fea1_text = document.getElementById("imgdata");
+ fea1_text.value = template;
+ }
+ else {
+ if (language) {
+ alert("合成模板失败," + code + " " + msg);
+ }
+ else {
+ alert("Generalize Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnFRO900_Verify = function (code, msg, score, result) {
+ if (code == 0) {
+ if (result == 0) {
+ if (language) {
+ alert("比对结果为不匹配");
+ }
+ else {
+ alert("Mismatch");
+ }
+ }
+ else {
+ if (language) {
+ alert("比对成功,分数为" + score);
+ }
+ else {
+ alert("Matching Success,Score is" + " " + score);
+ }
+ }
+ }
+ else {
+ if (language) {
+ alert("比对失败," + code + " " + msg);
+ }
+ else {
+ alert("Match Failed," + code + " " + msg);
+ }
+ }
+ };
+ client.OnIris_InitDevice = function (code, msg) {
+ if (code == 0) {
+ alert("Init Success");
+ }
+ else {
+ alert("Init fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_ReleaseDevice = function (code, msg) {
+ if (code == 0) {
+ alert("Release Success");
+ }
+ else {
+ alert("Release fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StartCapture = function (code, msg, faceimg, distance) {
+ if (code == 0) {
+ var image_area = document.getElementById("img_face");
+ image_area.src = "data:image/jpg;base64," + faceimg;
+ var d = document.getElementById("distance");
+ d.innerText = distance.toString();
+ }
+ else {
+ alert("Capture fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StartCapture2 = function (code, msg, left_eye_img, left_eye_data, right_eye_img, right_eye_data) {
+ if (code == 0) {
+ var image_area_l = document.getElementById("img_left");
+ image_area_l.src = "data:image/jpg;base64," + left_eye_img;
+ var image_area_r = document.getElementById("img_right");
+ image_area_r.src = "data:image/jpg;base64," + right_eye_img;
+ var left_text = document.getElementById("LeftData");
+ left_text.value = left_eye_data;
+ var right_text = document.getElementById("RightData");
+ right_text.value = right_eye_data;
+ alert("Capture Success");
+ }
+ else {
+ alert("Capture fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StopCapture = function (code, msg) {
+ if (code == 0) {
+ alert("Stop Success");
+ }
+ else {
+ alert("Stop fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_SetOptions = function (code, msg) {
+ if (code == 0) {
+ alert("Set Success");
+ }
+ else {
+ alert("Set fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StartVerify = function (code, msg, faceimg, distance) {
+ if (code == 0) {
+ var image_area = document.getElementById("face_img");
+ image_area.src = "data:image/jpg;base64," + faceimg;
+ var d = document.getElementById("distance");
+ d.innerText = distance.toString();
+ }
+ else {
+ alert("Verify fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StartVerify2 = function (code, msg, result) {
+ if (code == 0) {
+ if (result) {
+ alert("Verify Success");
+ }
+ }
+ else {
+ alert("Verify fail," + code + " " + msg);
+ }
+ };
+ client.OnIris_StopVerify = function (code, msg) {
+ if (code == 0) {
+ alert("Stop Success");
+ }
+ else {
+ alert("Stop fail," + code + " " + msg);
+ }
+ };
+ client.OnFingerKey_OpenDevice = function (code, msg) {
+ alert(msg);
+ };
+ client.OnFingerKey_CloseDevice = function (code, msg) {
+ alert(msg);
+ };
+ client.OnFingerKey_GetDeviceInformation = function (code, msg, info) {
+ if (code == 0) {
+ alert("Serial Number:" + info.sn + "\r\n" + "Manufacturer Name:" + info.manufacturer + "\r\n" + "Issuer Name:" + info.issuer
+ + "\r\n" + "Label:" + info.label + "\r\n" + "Hardware Version:" + info.hwver + "\r\n" + "Firmware Version:" + info.fwver);
+ }
+ else {
+ alert(msg);
+ }
+ };
+ client.OnFingerKey_CaptureFingerData = function (code, msg, imagedata, feadata, quality) {
+ if (code == 0) {
+ switch (Fkey_capcount % 6) {
+ case 1:
+ var image_area1 = document.getElementById("img1");
+ image_area1.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea1 = feadata;
+ break;
+ case 2:
+ var image_area2 = document.getElementById("img2");
+ image_area2.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea2 = feadata;
+ break;
+ case 3:
+ var image_area3 = document.getElementById("img3");
+ image_area3.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea3 = feadata;
+ break;
+ case 4:
+ var image_area4 = document.getElementById("img4");
+ image_area4.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea4 = feadata;
+ break;
+ case 5:
+ var image_area5 = document.getElementById("img5");
+ image_area5.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea5 = feadata;
+ break;
+ case 0:
+ var image_area6 = document.getElementById("img6");
+ image_area6.src = "data:image/bmp;base64," + imagedata;
+ Fkey_fea6 = feadata;
+ break;
+ }
+ }
+ else {
+ alert(msg);
+ }
+ };
+ client.OnFingerKey_ImportFingerPrint = function (code, msg) {
+ if (code == 0) {
+ alert("Import Success");
+ }
+ else {
+ alert("Import fail," + code + " " + msg);
+ }
+ };
+ client.OnCamera_InitDevice = function (code, msg) {
+ if (code == 0) {
+ alert("Init Success");
+ }
+ else {
+ alert("Init fail," + code + " " + msg);
+ }
+ };
+ client.OnCamera_ReleaseDevice = function (code, msg) {
+ if (code == 0) {
+ alert("Release Success");
+ }
+ else {
+ alert("Release fail," + code + " " + msg);
+ }
+ };
+ client.OnCamera_StartCapture = function (code, msg, imagedata, livedetect, facedetect, facequality) {
+ if (code == 0) {
+ var image_area = document.getElementById("camera_face");
+ image_area.src = "data:image/jpg;base64," + imagedata;
+ var p1 = document.getElementById("livedetect");
+ p1.innerText = livedetect.toString();
+ var p2 = document.getElementById("facedetect");
+ p2.innerText = facedetect.toString();
+ var p3 = document.getElementById("facequality");
+ p3.innerText = facequality.toString();
+ }
+ else {
+ alert("Capture fail," + code + " " + msg);
+ }
+ };
+ client.OnCamera_StopCapture = function (code, msg) {
+ if (code == 0) {
+ alert("Stop Success");
+ }
+ else {
+ alert("Stop fail," + code + " " + msg);
+ }
+ };
+ client.OnOtherError = function (type, code, msg) {
+ if (language) {
+ alert("其他错误!\r\n" + "错误类型:" + type + "\r\n" + "错误代码:" + code + "\r\n" + "错误信息:" + msg);
+ }
+ else {
+ alert("Other error!\r\n" + "Error type:" + type + "\r\n" + "Error code:" + code + "\r\n" + "Error Message:" + msg);
+ }
+ };
+};
+function settiems() {
+ butERRoR = 1;
+ if (butTime) {
+
+ } else {
+ butTime = setTimeout(res => {
+ butERRoR = 0;
+ butTime = undefined;
+ }, 800)
+ }
+}
+function connect() {//开始录制
+ if (butERRoR == 0) {
+
+ client.Connect_Server();
+ // setTimeout(res => {
+
+ // LIVESCAN_Init();
+ // }, 1000)
+ } else {
+ console.log("不可点击开始录制")
+ }
+ settiems();
+}
+function onceGgin() {//重新录制
+ if (butERRoR == 0) {
+ // console.log('agin')
+ client.Connect_Server();
+ } else {
+ console.log("不可点击重新录制")
+ }
+ settiems();
+}
+function closeG() {//取消录制
+ if (butERRoR == 0) {
+ // console.log('closeG')
+ client.CID_Close();
+ isoks = false;
+ let butBegin = document.getElementById("connect_server");
+ butBegin.style.display = "block"
+ let closeG = document.getElementById("closeG");
+ closeG.style.display = "none"
+ let zhiwentip = document.getElementById("zhiwentip");
+ zhiwentip.style.display = "none";
+ let zhiwentipok = document.getElementById("zhiwentipok");
+ zhiwentipok.style.display = "none";
+ let zhiwentipno = document.getElementById("zhiwentipno");
+ zhiwentipno.style.display = "block";
+ let onceGgin = document.getElementById("onceGgin");
+ onceGgin.style.display = "none"
+ } else {
+ console.log("不可点击取消录制")
+ }
+ settiems();
+}
+function open_device() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.OpenDevice(0);
+}
+function close_device() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.CloseDevice();
+}
+function get_device_count() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.GetDeviceCount();
+}
+function get_device_desc() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.GetDeviceDescription(0);
+}
+function capturefinger1() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (device_id == null) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ flag = 1;
+ client.CaptureFingerData(ImageFormatType.IBmp, FeatureFormatType.FBione, 3, FingerPosition.UNKNOWN, CompressionType.UnCompressed, device_id, 5);
+}
+function capturefinger2() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (device_id == null) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ flag = 2;
+ client.CaptureFingerData(ImageFormatType.IBmp, FeatureFormatType.FBione, 3, FingerPosition.UNKNOWN, CompressionType.UnCompressed, device_id, 5);
+}
+function capturefinger3() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (device_id == null) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ flag = 3;
+ client.CaptureFingerData(ImageFormatType.IBmp, FeatureFormatType.FBione, 3, FingerPosition.UNKNOWN, CompressionType.UnCompressed, device_id, 5);
+}
+function generalizetemp() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (feature1 == null || feature2 == null || feature3 == null) {
+ if (language) {
+ alert("请先采集三张图像");
+ }
+ else {
+ alert("Please capture fingerprint three times first");
+ }
+ return;
+ }
+ client.GeneralizeTemplate(feature1, feature2, feature3);
+}
+function verify() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (feature2 == null || feature3 == null) {
+ if (language) {
+ alert("请先采集图像2和3");
+ }
+ else {
+ alert("Please capture fingerprint 2 and 3 first");
+ }
+ return;
+ }
+ client.Verify(feature2, feature3, SecurityLevel.Level_4);
+}
+function start() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.StartCapture(FeatureFormatType.FBione, FingerPosition.UNKNOWN);
+}
+function end() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.StopCapture();
+}
+function bmp2raw() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (bmpdata == null) {
+ if (language) {
+ alert("请先点击\"采集图像1\"按钮");
+ }
+ else {
+ alert("Please click \"Capture Fingerprint 1\" button first");
+ }
+ return;
+ }
+ if (imagewidth == 0) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ client.BmpToRaw(bmpdata, imagewidth, imageheight);
+}
+function bmp2wsq() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (bmpdata == null) {
+ if (language) {
+ alert("请先点击\"采集图像1\"按钮");
+ }
+ else {
+ alert("Please click \"Capture Fingerprint 1\" button first");
+ }
+ return;
+ }
+ var bitrate = 0.75;
+ if (imagewidth == 0) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ client.BmpToWSQ(bmpdata, imagewidth, imageheight, dpi, bitrate);
+}
+function bmp2iso() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (bmpdata == null) {
+ if (language) {
+ alert("请先点击\"采集图像1\"按钮");
+ }
+ else {
+ alert("Please click \"Capture Fingerprint 1\" button first");
+ }
+ return;
+ }
+ if (device_id == null) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ client.BmpToISO(bmpdata, imagewidth, imageheight, FingerPosition.UNKNOWN, CompressionType.UnCompressed, device_id);
+}
+function bmp2ansi() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (bmpdata == null) {
+ if (language) {
+ alert("请先点击\"采集图像1\"按钮");
+ }
+ else {
+ alert("Please click \"Capture Fingerprint 1\" button first");
+ }
+ return;
+ }
+ if (device_id == null) {
+ if (language) {
+ alert("请先点击\"获取设备信息\"按钮");
+ }
+ else {
+ alert("Please click \"Get Device Description\" button first");
+ }
+ return;
+ }
+ client.BmpToANSI(bmpdata, imagewidth, imageheight, FingerPosition.UNKNOWN, CompressionType.UnCompressed, device_id);
+}
+function operate_red() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ LED = 1;
+ Status = Status ^ 1;
+ client.SetOption(LED, Status);
+}
+function operate_green() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ LED = 0;
+ Status = Status ^ 1;
+ client.SetOption(LED, Status);
+}
+
+client.beginFn = {//添加异步设备初始化,因为websocket需要时间来启动
+ fn: client.CID_Init,
+ CID5000: CIDDeviceType.CID5000,
+};
+function LIVESCAN_Init() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var obj = document.getElementById("device_select");
+ var device;
+ // if (obj.selectedIndex == 0) {
+ // device = CIDDeviceType.CID4000;
+ // }
+ // else if (obj.selectedIndex == 1) {
+ // device = CIDDeviceType.CID5000;
+ // }
+ // else if (obj.selectedIndex == 2) {
+ // device = CIDDeviceType.CID7000;
+ // }
+ // else if (obj.selectedIndex == 3) {
+ // device = CIDDeviceType.CID3000TC;
+ // }
+ // else if (obj.selectedIndex == 4) {
+ // device = CIDDeviceType.CID3000;
+ // }
+ // else if (obj.selectedIndex == 5) {
+ // device = CIDDeviceType.CID7000R;
+ // }
+ device = CIDDeviceType.CID5000;
+ client.CID_Init(device);
+}
+function LIVESCAN_Close() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.CID_Close();
+}
+function LIVESCAN_GetChannelCount() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.CID_GetChannelCount();
+}
+function LIVESCAN_GetDesc() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.CID_GetDesc();
+}
+function LIVESCAN_BeginCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var s = document.getElementById("score_thresh");
+ CID_score_thresh = s.value;
+ if (parseInt(CID_score_thresh) > 100 || parseInt(CID_score_thresh) < 1) {
+ if (language) {
+ alert("分数阈值范围为1到100");
+ }
+ else {
+ alert("Score thresholds range from 1 to 100");
+ }
+ return;
+ }
+ else {
+ show_img_index = 0;
+ begin_cap = true;
+ operate_model = 2;
+ client.CID_BeginCapture(0);
+ }
+}
+function LIVESCAN_EndCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ begin_cap = false;
+}
+function CID_Cap1() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ begin_cap = false;
+ show_img_index = 1;
+ client.CID_BeginCapture(0);
+}
+function CID_Ext1() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (CID_img_1 == null) {
+ alert("请先采集图像");
+ }
+ show_img_index = 1;
+ operate_model = 1;
+ client.BmpToRaw(CID_img_1, 256, 360);
+}
+function CID_Cap2() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ begin_cap = false;
+ show_img_index = 2;
+ client.CID_BeginCapture(0);
+}
+function CID_Ext2() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (CID_img_2 == null) {
+ alert("请先采集图像");
+ }
+ show_img_index = 2;
+ operate_model = 1;
+ client.BmpToRaw(CID_img_2, 256, 360);
+}
+function FP_FeatureMatch() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (CID_fea_1 == null || CID_fea_2 == null) {
+ alert("请先提取特征");
+ }
+ else {
+ client.CID_Alg_FeatureMatch(CID_fea_1, CID_fea_2);
+ }
+}
+function FP_ImageMatch() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (CID_img_1 == null) {
+ alert("请先采集图像");
+ }
+ if (CID_fea_2 == null) {
+ alert("请先提取特征");
+ }
+ operate_model = 1;
+ ImageMatch = true;
+ client.BmpToRaw(CID_img_1, 256, 360);
+}
+function TrustLink_GetDeviceInfo() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.TrustLink_GetDeviceInfo();
+}
+function FRO900_opendevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FRO900_OpenDevice(0);
+}
+function FRO900_get_device_count() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FRO900_GetDeviceCount();
+}
+function FRO900_capturefinger1() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ flag = 1;
+ MultiFinger = 0;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.LEFT_INDEX, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.JPEG, 5, FRO900_MissFinger.NO_FINGER_MISS);
+}
+function FRO900_closedevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FRO900_CloseDevice();
+}
+function FRO900_capturefinger2() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ flag = 2;
+ MultiFinger = 0;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.LEFT_INDEX, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.UnCompressed, 5, 0);
+}
+function FRO900_capturefinger3() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ flag = 3;
+ MultiFinger = 0;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.LEFT_INDEX, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.UnCompressed, 5, 0);
+}
+function FRO900_capture_left4() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var img = document.getElementById("img1");
+ img.src = null;
+ img = document.getElementById("img2");
+ img.src = null;
+ img = document.getElementById("img3");
+ img.src = null;
+ img = document.getElementById("img4");
+ img.src = null;
+ MultiFinger = 1;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.LEFT_FOUR, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.UnCompressed, 0, FRO900_MissFinger.NO_FINGER_MISS);
+}
+function FRO900_capture_right4() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var img = document.getElementById("img1");
+ img.src = null;
+ img = document.getElementById("img2");
+ img.src = null;
+ img = document.getElementById("img3");
+ img.src = null;
+ img = document.getElementById("img4");
+ img.src = null;
+ MultiFinger = 2;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.RIGHT_FOUR, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.UnCompressed, 0, FRO900_MissFinger.NO_FINGER_MISS);
+}
+function FRO900_capture_thumb2() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var img = document.getElementById("img1");
+ img.src = null;
+ img = document.getElementById("img2");
+ img.src = null;
+ img = document.getElementById("img3");
+ img.src = null;
+ img = document.getElementById("img4");
+ img.src = null;
+ MultiFinger = 3;
+ client.FRO900_CaptureFingerPrintData(FingerPosition.THUMB_TWO, ImageFormatType.IBmp, FeatureFormatType.FBione, CompressionType.UnCompressed, 0, FRO900_MissFinger.NO_FINGER_MISS);
+}
+function FRO900_generalizetemp() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (feature1 == null || feature2 == null || feature3 == null) {
+ if (language) {
+ alert("请先采集三张图像");
+ }
+ else {
+ alert("Please capture fingerprint three times first");
+ }
+ return;
+ }
+ client.FRO900_GeneralizeTemplate(feature1, feature2, feature3);
+}
+function FRO900_verify() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (feature2 == null || feature3 == null) {
+ if (language) {
+ alert("请先采集图像2和3");
+ }
+ else {
+ alert("Please capture fingerprint 2 and 3 first");
+ }
+ return;
+ }
+ client.FRO900_Verify(feature2, feature3, SecurityLevel.Level_3);
+}
+function Iris_Initdevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var obj = document.getElementById("device_select");
+ var device;
+ if (obj.selectedIndex == 0) {
+ device = IrisDeviceType.IR100;
+ }
+ else if (obj.selectedIndex == 1) {
+ device = IrisDeviceType.IR200;
+ }
+ client.Iris_InitDevice(device);
+}
+function Iris_StartCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Iris_StartCapture();
+ Iris_capture_mode = 1;
+}
+function Iris_StartFastCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Iris_StartFastCapture();
+ Iris_capture_mode = 1;
+}
+function Iris_Releasedevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Iris_ReleaseDevice();
+}
+function Iris_StopCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Iris_StopCapture();
+}
+function Iris_SetOptions() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var thresh = document.getElementById("enthresh");
+ var t = thresh.value;
+ client.Iris_SetOptions(parseInt(t));
+}
+function Iris_StartVerify() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var leftdata = "beKQlZX/f3KShsxITQ2Tk5c1fO7OXFh587e37Vl57+6vhlBR97q6HQ1i8jod/fqATVUXOqjd3yIABP/+smlVGQWFkfrurzUCiM1d1bMqYu7/EwD/7kwUEevu3HhwAYOuCE1FFyD83f8CAATGpqLGTRkxAqK601AA7u/MEBEz+WnqihQxY+eXh2xJecqvNDTvywME/PibA0VctLj7byyYklH/7gl5+o4NfXlISNXWpoWVsT4OSuu9FBHlppIRVf56TV9GZPSUnNbSsrt7anld1dNzfUUBAHk9heZiYiJdxYcyEiIIBAUV1f/+7qqqSF1dXVEyIqK2l5WVVUUFBcrqap4OVnY2Pj58acnFRmZ03NSSFOyOhrowMDnFwrZ+XETlhn/xgIKPXUljt7wIEPP/fEiSh8VdOTnuhhNT6u4RFc15YxdW19PZ2dmZiQmJqeHh4cOKisZFbyYVeXnw4sZdfG15TT+TkiVtfOrGETnjp5enzFl77q40tetDBhT4+CslMzcxITMz+ysDl5VdeTg7e7OT0P6/kJWVONLQmZG6+pJoqoaHFVlZ/T0VEWrqIBWHxaCAlZe/fzqipuZAQUUTMsaGSElNEZKShXVu7t54eHrXt/fdeWvvLTX96+MHhry6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADNv8=";
+ var rightdata = "ldSiAUzqsoKUXEBAePqm91fd/rqXlzhor1dZeP7760/kSF39uIiXh0Bof7rGxZMaSIWVmftvavrbnoUlAJKQe5V4eq+HhDE6ov/daCqX120pElLP7YQcf5G0ZGvqWFhqAAAEEZE5a3p7+v7vbQQAALPv7n/7+u7/twVi+v8RUd+yFd1oaO+XWWi2t4NNHTTy8hBL76cLyOhxFQ0MFvLKCXi96mg51e2uOwhIVf//91UQAggQIOrqv//vABDVf1KSszM3Nazuzs7uXE1Nbm1Fxc3u7u5qOXz4eBkFre/va2kqqu7/3d09MxOXhYCC6mpq7u6nh5cREBBAxMXVlZX3/8rq8+P63NTQ+NPR0trb60teHF5OTIyMmv7+/NjQ3ppSkpYsBGOztW3L2XklJDbCwBA1Ne3uU9Wtanq3hwAYfecsSMjIxsaG1NxMDS0uJianoeDq28rN2djY6Px4+vr6ykBhe76mR1Xc6rIV3Chpp9dZqPbjg00cpPLyEU+vpUPKXXg4OyqCx809NTF/c399OTqml9UFeX+3EEzuGFhqp9UiEBn96//f/Wn7/7aCSH2dlZemAUBoqqKGRAAAWHq+t51IQGh6trfXXf26tpedaG23WUj++vvrXR18/rIzv7e3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADNv8=";
+ client.Iris_StartVerify(5, leftdata, rightdata);
+}
+function Iris_StopVerify() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Iris_StopVerify();
+}
+function clearForm() {
+ document.all['Name'].value = '';
+ document.all['Sex'].value = '';
+ document.all['Nation'].value = '';
+ document.all['Born'].value = '';
+ document.all['Address'].value = '';
+ document.all['NewAddress'].value = '';
+ document.all['CardNo'].value = '';
+ document.all['Police'].value = '';
+ document.all['ActivityLFrom'].value = '';
+ document.all['ActivityLTo'].value = '';
+ var img = document.getElementById("imgPre");
+ img.src = "";
+ document.all['CardType'].value = '';
+ document.all['PassNo'].value = '';
+ document.all["IssueCount"].value = '';
+ document.all["EnglishName"].value = '';
+ document.all['Country'].value = '';
+ document.all['Version'].value = '';
+ document.all['FPInfo1'].value = '';
+ document.all['FPInfo2'].value = '';
+}
+function ReadCard() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ clearForm();
+ client.ARA_ReadIDCard();
+}
+function FingerKey_opendevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FingerKey_OpenDevice();
+}
+function FingerKey_closedevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FingerKey_CloseDevice();
+}
+function FingerKey_get_device_info() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.FingerKey_GetDeviceInformation();
+}
+function FingerKey_capturefinger() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ Fkey_capcount++;
+ client.FingerKey_CaptureFingerData(FingerPosition.UNKNOWN, ImageFormatType.IBmp, FeatureFormatType.FBione, 3);
+}
+function FingerKey_importfingerprint() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ if (Fkey_capcount < 6) {
+ alert("请采集六次以上");
+ }
+ var allfea = Fkey_fea1 + "\r\n" + Fkey_fea2 + "\r\n" + Fkey_fea3 + "\r\n" + Fkey_fea4 + "\r\n" + Fkey_fea5 + "\r\n" + Fkey_fea6;
+ client.FingerKey_ImportFingerPrint(FingerPosition.LEFT_THUMB, allfea);
+}
+function Camera_Initdevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ var obj = document.getElementById("Camera_select");
+ if (obj.selectedIndex == 3) {
+ client.Camera_InitDevice(Camera_Device_List.CID7000);
+ }
+ else {
+ client.Camera_InitDevice(obj.selectedIndex + 1);
+ }
+}
+function Camera_Releasedevice() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Camera_ReleaseDevice();
+}
+function Camera_StartCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Camera_StartCapture();
+}
+function Camera_StopCapture() {
+ if (!client.isConnect) {
+ if (language) {
+ alert("助手程序未连接");
+ }
+ else {
+ alert("Assistant Program is not connected");
+ }
+ return;
+ }
+ client.Camera_StopCapture();
+}
+
+
+function outZhiwenData() {//输出 iframe
+ let d = {
+ imgSRC: imgSRC,//图片指纹信息
+ imgBMP: imgBMP,//BMP格式指纹信息
+ CID_img_raw: CID_img_raw,//RAW格式指纹信息
+ featuredata: featuredatas,//特征值
+ isoks: isoks//是否完成采集指纹
+ }
+ return d;
+}
+
+function setZhiwenData(val) {//输入 iframe
+ isoks = val.isoks//是否完成采集指纹
+ if (isoks) {
+ imgSRC = "data:image/bmp;base64," + val.imgBMP;//图片指纹信息
+ imgBMP = val.imgBMP;//BMP格式指纹信息
+ // CID_img_raw = val.CID_img_raw;//RAW格式指纹信息
+ featuredatas = val.featuredatas;//特征值
+
+
+ let zhiwentip = document.getElementById("zhiwentip");
+ zhiwentip.style.display = "none";
+ let zhiwentipok = document.getElementById("zhiwentipok");
+ zhiwentipok.style.display = "block";
+ let zhiwentipno = document.getElementById("zhiwentipno");
+ zhiwentipno.style.display = "none";
+
+ var image_area = document.getElementById("img");
+ image_area.src = imgSRC;
+
+ let butBegin = document.getElementById("connect_server");
+ butBegin.style.display = "none";
+ let closeG = document.getElementById("closeG");
+ closeG.style.display = "none";
+ let onceGgin = document.getElementById("onceGgin");
+ onceGgin.style.display = "block";
+ } else {
+ let zhiwentip = document.getElementById("zhiwentip");
+ zhiwentip.style.display = "none";
+ let zhiwentipok = document.getElementById("zhiwentipok");
+ zhiwentipok.style.display = "none";
+ let zhiwentipno = document.getElementById("zhiwentipno");
+ zhiwentipno.style.display = "block";
+
+ let butBegin = document.getElementById("connect_server");
+ butBegin.style.display = "block";
+ let closeG = document.getElementById("closeG");
+ closeG.style.display = "none";
+ let onceGgin = document.getElementById("onceGgin");
+ onceGgin.style.display = "none";
+
+ }
+
+}
diff --git a/public/zhiwenDemo/debug.log b/public/zhiwenDemo/debug.log
new file mode 100644
index 0000000..f21f149
--- /dev/null
+++ b/public/zhiwenDemo/debug.log
@@ -0,0 +1 @@
+[1027/165052.032:ERROR:exit_code_watcher_win.cc(87)] Failed to wait for process exit or stop event
diff --git a/public/zhiwenDemo/language.js b/public/zhiwenDemo/language.js
new file mode 100644
index 0000000..05b2469
--- /dev/null
+++ b/public/zhiwenDemo/language.js
@@ -0,0 +1,39 @@
+var change_description = ["切换为中文", "Change to English"];
+var link_description = ["Open Assistant Program", "打开设备管理助手"];
+var connect_description = ["Connect Assistant Program", "连接助手程序"];
+var open_description = ["Open Device", "打开设备"];
+var close_description = ["Close Device", "关闭设备"];
+var device_count_description = ["Get Device Count", "获取设备数量"];
+var device_desc_description = ["Get Device Description", "获取设备信息"];
+var cap1_description = ["Capture Fingerprint 1", "采集图像1"];
+var cap2_description = ["Capture Fingerprint 2", "采集图像2"];
+var cap3_description = ["Capture Fingerprint 3", "采集图像3"];
+var gen_description = ["Generalize a Template", "合成模板"];
+var verify_description = ["Match Fingerprint 2 and Fingerprint 3", "图像2、3比对"];
+var startcap_description = ["Start Preview", "开始预览"];
+var endcap_description = ["End Preview", "结束预览"];
+var open_red_description = ["Open Red LED", "打开红灯"];
+var close_red_description = ["Close Red LED", "关闭红灯"];
+var open_green_description = ["Open Green LED", "打开绿灯"];
+var close_green_description = ["Close Green LED", "关闭绿灯"];
+var b2r_description = ["BMP To RAW", "BMP格式转RAW格式"];
+var b2w_description = ["BMP To WSQ", "BMP格式转WSQ格式"];
+var b2i_description = ["BMP To ISO", "BMP格式转ISO格式"];
+var b2a_description = ["BMP To ANSI", "BMP格式转ANSI格式"];
+var title_trustfinger_description = ["The Demo of Aratek Device Management Assistant(TrustFinger)", "亚略特设备管理助手Demo(TrustFinger)"];
+var init_description = ["Init Device", "设备初始化"];
+var extract1_description = ["Extract Fingerprint 1 Features", "提取图像1特征"];
+var extract2_description = ["Extract Fingerprint 2 Features", "提取图像2特征"];
+var feature_verify_description = ["Match Feature 1 and Feature 2", "特征1与特征2比对"];
+var image_verify_description = ["Match Fingerprint 1 and Feature 2", "图像1与特征2比对"];
+var title_CID_description = ["The Demo of Aratek Device Management Assistant(CID)", "亚略特设备管理助手Demo(CID)"];
+var FRO900_capture_left_4 = ["Collect left-hand", "采集左手四指"];
+var FRO900_capture_right_4 = ["Collect right-hand", "采集右手四指"];
+var FRO900_capture_thumb_2 = ["Collect two thumbs", "采集双手拇指"];
+var title_FRO900_description = ["The Demo of Aratek Device Management Assistant(FRO900)", "亚略特设备管理助手Demo(FRO900)"];
+var Iris_release_device = ["Release Device", "设备释放"];
+var Iris_start_cap = ["Start Capture", "开始采集"];
+var Iris_stop_cap = ["Stop Capture", "结束采集"];
+var Iris_distance_desc = ["Distance:", "距离:"];
+var Iris_start_ver = ["Start Verify", "开始比对"];
+var Iris_stop_ver = ["Stop Verify", "结束比对"];
diff --git a/src/api/system/user.js b/src/api/system/user.js
index 2df0fdc..38f6eca 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -1,5 +1,20 @@
import request from '@/router/axios';
+
+export const getzhiwen = (id) => {//获取指纹的代码
+ return request({
+ url: '/api/blade-user/details',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+}
+
+
+
+
+
export const getJurisdiction = (params) => {
return request({
url: '/api/jurisdiction/selJur',
diff --git a/src/views/licenseApproval/securityGuard.vue b/src/views/licenseApproval/securityGuard.vue
index ffb288f..4ac5b13 100644
--- a/src/views/licenseApproval/securityGuard.vue
+++ b/src/views/licenseApproval/securityGuard.vue
@@ -2,7 +2,7 @@
* @Author: liu
* @Date: 2021-08-26 16:57:58
* @Last Modified by: liu
- * @Last Modified time: 2021-11-05 14:45:01
+ * @Last Modified time: 2021-11-09 11:16:14
*/
@@ -409,24 +409,33 @@
this.upsData("2", "1"); //不通过
},
upsData(state, type) {
+ let date = new Date(+new Date() + 8 * 3600 * 1000)
+ .toJSON()
+ .substr(0, 19)
+ .replace("T", " ");
+ // console.log(date);
+ // return;
this.dialogVisiblecc = false;
if (this.user_name == "派") {
// 派出所审批
+ this.xukezData.ptime = date;
this.xukezData.papprove = state;
this.xukezData.popinion = this.textareaShenpi;
this.xukezData.type = type == "0" ? "2" : "1"; // 为了保持审核系统识别
} else if (this.user_name == "县") {
// 分局审批
+ this.xukezData.xtime = date;
this.xukezData.xapprove = state;
this.xukezData.xopinion = this.textareaShenpi;
this.xukezData.type = type == "0" ? "2" : "1"; // 为了保持审核系统识别
} else if (this.user_name == "市") {
// 市局审批
+ this.xukezData.stime = date;
this.xukezData.sapprove = state;
this.xukezData.sopinion = this.textareaShenpi;
this.xukezData.type = type == "0" ? "0" : "1"; // 为了保持审核系统识别
}
- console.log(this.xukezData);
+ // console.log(this.xukezData);
// return;
update(this.xukezData).then((res) => {
console.log(res);
@@ -581,6 +590,7 @@
console.log(params, "params");
params["jurisdiction"] = this.userInfo.jurisdiction;
params["usetype"] = this.userData;
+ this.option.column[this.option.column.length - 2].prop = "opinionOur";
// return;
getList(
page.currentPage,
@@ -591,9 +601,21 @@
this.page.total = data.total;
this.data = data.records;
for (var k in this.data) {
- console.log(this.changeState(this.data[k]));
+ // console.log(this.changeState(this.data[k]));
this.data[k] = this.changeState(this.data[k]);
+ let paichusuoyijian = this.data[k].popinion
+ ? "派出所意见:" + this.data[k].popinion + ";"
+ : "";
+ let fenjuijian = this.data[k].xopinion
+ ? "分局意见:" + this.data[k].xopinion + ";"
+ : "";
+ let shijuyijian = this.data[k].sopinion
+ ? "市局意见:" + this.data[k].sopinion + ";"
+ : "";
+ this.data[k]["opinionOur"] =
+ paichusuoyijian + fenjuijian + shijuyijian;
}
+ console.log(this.data);
this.loading = false;
this.selectionClear();
});
diff --git a/src/views/securityGuard/Client.js b/src/views/securityGuard/Client.js
new file mode 100644
index 0000000..c00c47b
--- /dev/null
+++ b/src/views/securityGuard/Client.js
@@ -0,0 +1,1327 @@
+var CommandType;
+(function (CommandType) {
+ CommandType[CommandType["OpenDevice_Type"] = 1] = "OpenDevice_Type";
+ CommandType[CommandType["CloseDevice_Type"] = 2] = "CloseDevice_Type";
+ CommandType[CommandType["GetDeviceCount_Type"] = 3] = "GetDeviceCount_Type";
+ CommandType[CommandType["GetDeviceDescription_Type"] = 4] = "GetDeviceDescription_Type";
+ CommandType[CommandType["CaptureFingerData_Type"] = 5] = "CaptureFingerData_Type";
+ CommandType[CommandType["StartCapture_Type"] = 6] = "StartCapture_Type";
+ CommandType[CommandType["StopCapture_Type"] = 7] = "StopCapture_Type";
+ CommandType[CommandType["GeneralizeTemplate_Type"] = 8] = "GeneralizeTemplate_Type";
+ CommandType[CommandType["Verify_Type"] = 9] = "Verify_Type";
+ CommandType[CommandType["SetOption_Type"] = 10] = "SetOption_Type";
+ CommandType[CommandType["BmpToRaw_Type"] = 11] = "BmpToRaw_Type";
+ CommandType[CommandType["BmpToWSQ_Type"] = 12] = "BmpToWSQ_Type";
+ CommandType[CommandType["BmpToISO_Type"] = 13] = "BmpToISO_Type";
+ CommandType[CommandType["BmpToANSI_Type"] = 14] = "BmpToANSI_Type";
+ CommandType[CommandType["CID_Init_Type"] = 15] = "CID_Init_Type";
+ CommandType[CommandType["CID_Close_Type"] = 16] = "CID_Close_Type";
+ CommandType[CommandType["CID_GetChannelCount_Type"] = 17] = "CID_GetChannelCount_Type";
+ CommandType[CommandType["CID_BeginCapture_Type"] = 18] = "CID_BeginCapture_Type";
+ CommandType[CommandType["CID_GetFPRawData_Type"] = 19] = "CID_GetFPRawData_Type";
+ CommandType[CommandType["CID_GetFPBmpData_Type"] = 20] = "CID_GetFPBmpData_Type";
+ CommandType[CommandType["CID_EndCapture_Type"] = 21] = "CID_EndCapture_Type";
+ CommandType[CommandType["CID_GetVersion_Type"] = 22] = "CID_GetVersion_Type";
+ CommandType[CommandType["CID_GetDesc_Type"] = 23] = "CID_GetDesc_Type";
+ CommandType[CommandType["CID_Alg_GetVersion_Type"] = 25] = "CID_Alg_GetVersion_Type";
+ CommandType[CommandType["CID_Alg_Begin_Type"] = 26] = "CID_Alg_Begin_Type";
+ CommandType[CommandType["CID_Alg_FeatureExtract_Type"] = 27] = "CID_Alg_FeatureExtract_Type";
+ CommandType[CommandType["CID_Alg_FeatureMatch_Type"] = 28] = "CID_Alg_FeatureMatch_Type";
+ CommandType[CommandType["CID_Alg_ImageMatch_Type"] = 29] = "CID_Alg_ImageMatch_Type";
+ CommandType[CommandType["CID_Alg_GetQualityScore_Type"] = 32] = "CID_Alg_GetQualityScore_Type";
+ CommandType[CommandType["CID_Alg_End_Type"] = 35] = "CID_Alg_End_Type";
+ CommandType[CommandType["TrustLink_GetDeviceInfo_Type"] = 49] = "TrustLink_GetDeviceInfo_Type";
+ CommandType[CommandType["ARA_ReadIDCard_Type"] = 50] = "ARA_ReadIDCard_Type";
+ CommandType[CommandType["ARA_FeaConv_Type"] = 51] = "ARA_FeaConv_Type";
+ CommandType[CommandType["ARA_GetCurrentDeviceList_Type"] = 53] = "ARA_GetCurrentDeviceList_Type";
+ CommandType[CommandType["FRO900_OpenDevice_Type"] = 64] = "FRO900_OpenDevice_Type";
+ CommandType[CommandType["FRO900_CloseDevice_Type"] = 65] = "FRO900_CloseDevice_Type";
+ CommandType[CommandType["FRO900_GetDeviceCount_Type"] = 66] = "FRO900_GetDeviceCount_Type";
+ CommandType[CommandType["FRO900_CaptureFingerPrintData_Type"] = 67] = "FRO900_CaptureFingerPrintData_Type";
+ CommandType[CommandType["FRO900_GeneralizeTemplate_Type"] = 68] = "FRO900_GeneralizeTemplate_Type";
+ CommandType[CommandType["FRO900_Verify_Type"] = 69] = "FRO900_Verify_Type";
+ CommandType[CommandType["Iris_InitDevice_Type"] = 80] = "Iris_InitDevice_Type";
+ CommandType[CommandType["Iris_ReleaseDevice_type"] = 81] = "Iris_ReleaseDevice_type";
+ CommandType[CommandType["Iris_StartCapture_Type"] = 82] = "Iris_StartCapture_Type";
+ CommandType[CommandType["Iris_StartCapture2_Type"] = 83] = "Iris_StartCapture2_Type";
+ CommandType[CommandType["Iris_StopCapture_Type"] = 84] = "Iris_StopCapture_Type";
+ CommandType[CommandType["Iris_SetOptions_Type"] = 86] = "Iris_SetOptions_Type";
+ CommandType[CommandType["Iris_StartVerify_Type"] = 87] = "Iris_StartVerify_Type";
+ CommandType[CommandType["Iris_StartVerify2_Type"] = 88] = "Iris_StartVerify2_Type";
+ CommandType[CommandType["Iris_StopVerify_Type"] = 89] = "Iris_StopVerify_Type";
+ CommandType[CommandType["Iris_StartFastCapture_Type"] = 90] = "Iris_StartFastCapture_Type";
+ CommandType[CommandType["Iris_StartFastCapture2_Type"] = 91] = "Iris_StartFastCapture2_Type";
+ CommandType[CommandType["FingerKey_OpenDevice_Type"] = 96] = "FingerKey_OpenDevice_Type";
+ CommandType[CommandType["FingerKey_CloseDevice_Type"] = 97] = "FingerKey_CloseDevice_Type";
+ CommandType[CommandType["FingerKey_GetDeviceInformation_Type"] = 99] = "FingerKey_GetDeviceInformation_Type";
+ CommandType[CommandType["FingerKey_CaptureFingerData_Type"] = 100] = "FingerKey_CaptureFingerData_Type";
+ CommandType[CommandType["FingerKey_ImportFingerPrint_Type"] = 101] = "FingerKey_ImportFingerPrint_Type";
+ CommandType[CommandType["Camera_InitDevice_Type"] = 112] = "Camera_InitDevice_Type";
+ CommandType[CommandType["Camera_ReleaseDevice_Type"] = 113] = "Camera_ReleaseDevice_Type";
+ CommandType[CommandType["Camera_StartCapture_Type"] = 114] = "Camera_StartCapture_Type";
+ CommandType[CommandType["Camera_StopCapture_Type"] = 115] = "Camera_StopCapture_Type";
+ CommandType[CommandType["Camera_SetOption_Type"] = 116] = "Camera_SetOption_Type";
+})(CommandType || (CommandType = {}));
+var FingerPosition;
+(function (FingerPosition) {
+ FingerPosition[FingerPosition["UNKNOWN"] = 0] = "UNKNOWN";
+ FingerPosition[FingerPosition["RIGHT_THUMB"] = 1] = "RIGHT_THUMB";
+ FingerPosition[FingerPosition["RIGHT_INDEX"] = 2] = "RIGHT_INDEX";
+ FingerPosition[FingerPosition["RIGHT_MIDDLE"] = 3] = "RIGHT_MIDDLE";
+ FingerPosition[FingerPosition["RIGHT_RING"] = 4] = "RIGHT_RING";
+ FingerPosition[FingerPosition["RIGHT_LITTLE"] = 5] = "RIGHT_LITTLE";
+ FingerPosition[FingerPosition["LEFT_THUMB"] = 6] = "LEFT_THUMB";
+ FingerPosition[FingerPosition["LEFT_INDEX"] = 7] = "LEFT_INDEX";
+ FingerPosition[FingerPosition["LEFT_MIDDLE"] = 8] = "LEFT_MIDDLE";
+ FingerPosition[FingerPosition["LEFT_RING"] = 9] = "LEFT_RING";
+ FingerPosition[FingerPosition["LEFT_LITTLE"] = 10] = "LEFT_LITTLE";
+ FingerPosition[FingerPosition["THUMB_TWO"] = 21] = "THUMB_TWO";
+ FingerPosition[FingerPosition["LEFT_FOUR"] = 22] = "LEFT_FOUR";
+ FingerPosition[FingerPosition["RIGHT_FOUR"] = 23] = "RIGHT_FOUR";
+})(FingerPosition || (FingerPosition = {}));
+var FRO900_MissFinger;
+(function (FRO900_MissFinger) {
+ FRO900_MissFinger[FRO900_MissFinger["NO_FINGER_MISS"] = 0] = "NO_FINGER_MISS";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_INDEX"] = 1] = "MISS_FINGER_INDEX";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_MIDDLE"] = 2] = "MISS_FINGER_MIDDLE";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_RING"] = 4] = "MISS_FINGER_RING";
+ FRO900_MissFinger[FRO900_MissFinger["MISS_FINGER_LITTLE"] = 8] = "MISS_FINGER_LITTLE";
+})(FRO900_MissFinger || (FRO900_MissFinger = {}));
+var ID_FingerPosition;
+(function (ID_FingerPosition) {
+ ID_FingerPosition[ID_FingerPosition["UNKNOWN"] = 99] = "UNKNOWN";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_THUMB"] = 11] = "RIGHT_THUMB";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_INDEX"] = 12] = "RIGHT_INDEX";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_MIDDLE"] = 13] = "RIGHT_MIDDLE";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_RING"] = 14] = "RIGHT_RING";
+ ID_FingerPosition[ID_FingerPosition["RIGHT_LITTLE"] = 15] = "RIGHT_LITTLE";
+ ID_FingerPosition[ID_FingerPosition["LEFT_THUMB"] = 16] = "LEFT_THUMB";
+ ID_FingerPosition[ID_FingerPosition["LEFT_INDEX"] = 17] = "LEFT_INDEX";
+ ID_FingerPosition[ID_FingerPosition["LEFT_MIDDLE"] = 18] = "LEFT_MIDDLE";
+ ID_FingerPosition[ID_FingerPosition["LEFT_RING"] = 19] = "LEFT_RING";
+ ID_FingerPosition[ID_FingerPosition["LEFT_LITTLE"] = 20] = "LEFT_LITTLE";
+})(ID_FingerPosition || (ID_FingerPosition = {}));
+var CompressionType;
+(function (CompressionType) {
+ CompressionType[CompressionType["UnCompressed"] = 0] = "UnCompressed";
+ CompressionType[CompressionType["BitPacked"] = 1] = "BitPacked";
+ CompressionType[CompressionType["WSQ"] = 2] = "WSQ";
+ CompressionType[CompressionType["JPEG"] = 3] = "JPEG";
+ CompressionType[CompressionType["JPEG2000"] = 4] = "JPEG2000";
+ CompressionType[CompressionType["PNG"] = 5] = "PNG";
+})(CompressionType || (CompressionType = {}));
+var SecurityLevel;
+(function (SecurityLevel) {
+ SecurityLevel[SecurityLevel["Level_1"] = 1] = "Level_1";
+ SecurityLevel[SecurityLevel["Level_2"] = 2] = "Level_2";
+ SecurityLevel[SecurityLevel["Level_3"] = 3] = "Level_3";
+ SecurityLevel[SecurityLevel["Level_4"] = 4] = "Level_4";
+ SecurityLevel[SecurityLevel["Level_5"] = 5] = "Level_5";
+})(SecurityLevel || (SecurityLevel = {}));
+var ImageFormatType;
+(function (ImageFormatType) {
+ ImageFormatType[ImageFormatType["IRaw"] = 1] = "IRaw";
+ ImageFormatType[ImageFormatType["IBmp"] = 2] = "IBmp";
+ ImageFormatType[ImageFormatType["IISO"] = 3] = "IISO";
+ ImageFormatType[ImageFormatType["IANSI"] = 4] = "IANSI";
+})(ImageFormatType || (ImageFormatType = {}));
+var FeatureFormatType;
+(function (FeatureFormatType) {
+ FeatureFormatType[FeatureFormatType["FBione"] = 1] = "FBione";
+ FeatureFormatType[FeatureFormatType["FISO"] = 2] = "FISO";
+ FeatureFormatType[FeatureFormatType["FANSI"] = 3] = "FANSI";
+ FeatureFormatType[FeatureFormatType["FIDCard"] = 4] = "FIDCard";
+})(FeatureFormatType || (FeatureFormatType = {}));
+var CIDDeviceType;
+(function (CIDDeviceType) {
+ CIDDeviceType[CIDDeviceType["CID3000TC"] = 0] = "CID3000TC";
+ CIDDeviceType[CIDDeviceType["CID4000"] = 1] = "CID4000";
+ CIDDeviceType[CIDDeviceType["CID5000"] = 2] = "CID5000";
+ CIDDeviceType[CIDDeviceType["CID7000"] = 3] = "CID7000";
+ CIDDeviceType[CIDDeviceType["CID3000"] = 4] = "CID3000";
+ CIDDeviceType[CIDDeviceType["CID7000R"] = 5] = "CID7000R";
+})(CIDDeviceType || (CIDDeviceType = {}));
+var IrisDeviceType;
+(function (IrisDeviceType) {
+ IrisDeviceType[IrisDeviceType["IR100"] = 1] = "IR100";
+ IrisDeviceType[IrisDeviceType["IR200"] = 2] = "IR200";
+})(IrisDeviceType || (IrisDeviceType = {}));
+var IrisCaptureMode;
+(function (IrisCaptureMode) {
+ IrisCaptureMode[IrisCaptureMode["Two_Eyes"] = 1] = "Two_Eyes";
+ IrisCaptureMode[IrisCaptureMode["Left_Eye"] = 2] = "Left_Eye";
+ IrisCaptureMode[IrisCaptureMode["Right_Eye"] = 3] = "Right_Eye";
+})(IrisCaptureMode || (IrisCaptureMode = {}));
+var IDCardType;
+(function (IDCardType) {
+ IDCardType[IDCardType["IDCard_People"] = 1] = "IDCard_People";
+ IDCardType[IDCardType["IDCard_GAT"] = 2] = "IDCard_GAT";
+ IDCardType[IDCardType["IDCard_Foreign"] = 3] = "IDCard_Foreign";
+})(IDCardType || (IDCardType = {}));
+var Camera_Device_List;
+(function (Camera_Device_List) {
+ Camera_Device_List[Camera_Device_List["FC200V"] = 1] = "FC200V";
+ Camera_Device_List[Camera_Device_List["FC200H"] = 2] = "FC200H";
+ Camera_Device_List[Camera_Device_List["FC205"] = 3] = "FC205";
+ Camera_Device_List[Camera_Device_List["CID7000"] = 11] = "CID7000";
+})(Camera_Device_List || (Camera_Device_List = {}));
+;
+var NOT_CONNECT = -1;
+var Client = (function () {
+ function Client() {
+ this.url = 'ws://127.0.0.1:4397/aratek';
+ this.ws = null;
+ this.isConnect = false;
+ }
+ Client.prototype.CIDDeviceType = CIDDeviceType;
+ Client.prototype.SendMessage = function (msg) {
+ // console.log(this.isConnect)
+ if (this.isConnect) {
+ this.ws.send(msg);
+ }
+ };
+ Client.prototype.OpenDevice = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.OpenDevice_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GetDeviceCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GetDeviceCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GetDeviceDescription = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GetDeviceDescription_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CaptureFingerData = function (image_format, feature_format, timeout, fingerposition, compression_type, device_id, factor) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CaptureFingerData_Type,
+ "Image_Format": image_format,
+ "Feature_Format": feature_format,
+ "TimeOut": timeout,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": device_id,
+ "Factor": factor
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.StartCapture = function (feature_format, fingerposition) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.StartCapture_Type,
+ "Feature_Format": feature_format,
+ "Finger_Position": fingerposition
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.GeneralizeTemplate = function (fea1, fea2, fea3) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.GeneralizeTemplate_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Feature_3": fea3
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Verify = function (fea1, fea2, security_level) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Verify_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Security_Level": security_level
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.SetOption = function (LED_index, LED_status) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.SetOption_Type,
+ "LED_Index": LED_index,
+ "LED_Status": LED_status
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToRaw = function (bmp_imagedata, image_width, image_height) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToRaw_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToWSQ = function (bmp_imagedata, image_width, image_height, dpi, bitrate) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToWSQ_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "DPI": dpi,
+ "Bitrate": bitrate
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToISO = function (bmp_imagedata, image_width, image_height, fingerposition, compression_type, deviceid) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToISO_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": deviceid
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.BmpToANSI = function (bmp_imagedata, image_width, image_height, fingerposition, compression_type, deviceid) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.BmpToANSI_Type,
+ "Bmp_ImageData": bmp_imagedata,
+ "Image_Width": image_width,
+ "Image_Height": image_height,
+ "Finger_Position": fingerposition,
+ "Compression_Type": compression_type,
+ "Device_ID": deviceid
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Init = function (devicetype, that) {//that改变this指向Client实例
+ if (that.isConnect == false) {
+ // console.log("Unconnected service");
+ console.log("非连接服务");
+ return -1;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Init_Type,
+ "DeviceType": devicetype
+ };
+ that.SendMessage(JSON.stringify(cmd_json));
+ // console.log("连接设备成功");
+ };
+ Client.prototype.CID_Close = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Close_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetChannelCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetChannelCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_BeginCapture = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_BeginCapture_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetFPRawData = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetFPRawData_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetFPBmpData = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetFPBmpData_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_EndCapture = function (nChannel) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_EndCapture_Type,
+ "nChannel": nChannel
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetVersion = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetVersion_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_GetDesc = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_GetDesc_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_GetVersion = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_GetVersion_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_Begin = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_Begin_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_FeatureExtract = function (fingerposition, image_rawdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_FeatureExtract_Type,
+ "FingerPosition": fingerposition,
+ "Image_RawData": image_rawdata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_FeatureMatch = function (featuredata1, featuredata2) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_FeatureMatch_Type,
+ "FeatureData1": featuredata1,
+ "FeatureData2": featuredata2
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_ImageMatch = function (image_rawdata, featuredata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_ImageMatch_Type,
+ "RawImageData": image_rawdata,
+ "FeatureData": featuredata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ // Client.prototype.CID_Alg_GetQualityScore = function (image_rawdata) {
+ // if (this.isConnect == false) {
+ // console.log("Unconnected service");
+ // return NOT_CONNECT;
+ // }
+ // var cmd_json = {
+ // "RequestType": CommandType.CID_Alg_GetQualityScore_Type,
+ // "RawImageData": image_rawdata
+ // };
+ // // console.log(cmd_json)
+ // // return;
+ // this.SendMessage(JSON.stringify(cmd_json));
+ // };
+ Client.prototype.CID_Alg_GetQualityScore = function (image_rawdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_GetQualityScore_Type,
+ "RawImageData": image_rawdata
+ };
+ // console.log(cmd_json)
+ // return
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.CID_Alg_End = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.CID_Alg_End_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_ReadIDCard = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_ReadIDCard_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.TrustLink_GetDeviceInfo = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.TrustLink_GetDeviceInfo_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_FeaConv = function (feasrc, feasrc_fm, feadst_fm) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_FeaConv_Type,
+ "Fea_Src_Data": feasrc,
+ "Fea_Src_Format": feasrc_fm,
+ "Fea_Dst_Format": feadst_fm
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.ARA_GetCurrentDeviceList = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.ARA_GetCurrentDeviceList_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_OpenDevice = function (index) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_OpenDevice_Type,
+ "Index": index
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_GetDeviceCount = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_GetDeviceCount_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_CaptureFingerPrintData = function (fingerposition, imageformat, featureformat, compressiontype, factor, missfinger) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_CaptureFingerPrintData_Type,
+ "Finger_Position": fingerposition,
+ "Image_Format": imageformat,
+ "Feature_Format": featureformat,
+ "Compression_Type": compressiontype,
+ "Factor": factor,
+ "Miss_Finger_Position": missfinger
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_GeneralizeTemplate = function (fea1, fea2, fea3) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_GeneralizeTemplate_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Feature_3": fea3
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FRO900_Verify = function (fea1, fea2, security_level) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FRO900_Verify_Type,
+ "Feature_1": fea1,
+ "Feature_2": fea2,
+ "Security_Level": security_level
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_InitDevice = function (devicetype) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_InitDevice_Type,
+ "DeviceType": devicetype
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartFastCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartFastCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StartVerify = function (timeout, leftdata, rightdata) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StartVerify_Type,
+ "Timeout": timeout,
+ "LeftEye_FeaData": leftdata,
+ "RightEye_FeaData": rightdata
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_StopVerify = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_StopVerify_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_ReleaseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_ReleaseDevice_type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Iris_SetOptions = function (enrothresh) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Iris_SetOptions_Type,
+ "EnrollThresh": enrothresh
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_OpenDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_OpenDevice_Type,
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_CloseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_CloseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_GetDeviceInformation = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_GetDeviceInformation_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_CaptureFingerData = function (fingerposition, imageformat, featureformat, timeout) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_CaptureFingerData_Type,
+ "Image_Format": imageformat,
+ "Feature_Format": featureformat,
+ "TimeOut": timeout,
+ "Finger_Position": fingerposition
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.FingerKey_ImportFingerPrint = function (fingerposition, allfeature) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.FingerKey_ImportFingerPrint_Type,
+ "Finger_Position": fingerposition,
+ "AllFeatureData": allfeature
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_InitDevice = function (devicetype) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_InitDevice_Type,
+ "DeviceType": devicetype
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_ReleaseDevice = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_ReleaseDevice_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_StartCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_StartCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_StopCapture = function () {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_StopCapture_Type
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.Camera_SetOption = function (livedetectvalue) {
+ if (this.isConnect == false) {
+ console.log("Unconnected service");
+ return NOT_CONNECT;
+ }
+ var cmd_json = {
+ "RequestType": CommandType.Camera_SetOption_Type,
+ "LiveDetectSetting": livedetectvalue
+ };
+ this.SendMessage(JSON.stringify(cmd_json));
+ };
+ Client.prototype.beginFn; // 添加异步设备初始化,因为websocket需要时间来启动
+ Client.prototype.Connect_Server = function () {
+ var thisws = this;
+ this.ws = new WebSocket(this.url);
+ this.ws.onopen = function () {
+ console.log("指纹助手连接成功");
+ // alert("Connect Success");
+ thisws.isConnect = true;
+ // console.log(thisws.beginFn, 1)
+ // ;
+ let data = thisws.beginFn, my = thisws;//循环连接设备
+ let openequipment = function (beginFn, that) {
+ if (beginFn.fn(beginFn.CID5000, that) == -1) {
+ setTimeout(() => {
+ openequipment(data, my);
+ }, 2000);
+ }
+ }
+ openequipment(data, my);
+ };
+ // console.log(thisws.isConnect, 3)
+ this.ws.onmessage = function (ev) {
+ var data = JSON.parse(ev.data);
+ var responsetype = data.ResponseType;
+ // console.log(responsetype, data, '指纹机器返回code值');
+ if (responsetype == 15) {//自定义返回参数 初始化
+ if (thisws.OnCID_Alg_Begin) {
+ thisws.OnCID_Alg_Begin(data.ErrorCode, data.ErrorMessage);
+ }
+ return;
+ }
+ if (responsetype == 18) {//自定义返回参数 图片预览
+ if (thisws.OnCID_BeginCapture) {
+ thisws.OnCID_BeginCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ return;
+ }
+ if (responsetype == 32) {//自定义返回参数 图片预览
+ if (thisws.OnCID_Alg_GetQualityScore) {
+ thisws.OnCID_Alg_GetQualityScore(data.ErrorCode, data.ErrorMessage, data.Score);
+ }
+ return;
+ }
+ //
+ //
+ switch (responsetype) {
+ case CommandType.OpenDevice_Type:
+ if (thisws.OnOpenDevice) {
+ thisws.OnOpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CloseDevice_Type:
+ if (thisws.OnCloseDevice) {
+ thisws.OnCloseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.GetDeviceCount_Type:
+ if (thisws.OnGetDeviceCount) {
+ thisws.OnGetDeviceCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.GetDeviceDescription_Type:
+ var deviceinfo = {
+ sn: data.SN,
+ manufacturer: data.Manufacturer,
+ productname: data.ProductName,
+ productmodel: data.ProductModel,
+ fw_version: data.FW_Version,
+ hw_version: data.HW_Version,
+ image_width: data.Image_Width,
+ iamge_height: data.Image_Height,
+ dpi: data.DPI,
+ device_id: data.Device_ID
+ };
+ if (thisws.OnGetDeviceDescription) {
+ thisws.OnGetDeviceDescription(data.ErrorCode, data.ErrorMessage, deviceinfo);
+ }
+ break;
+ case CommandType.CaptureFingerData_Type:
+ var capimage = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data,
+ quality: data.Image_Quality,
+ NFIQ: data.Image_NFIQ
+ };
+ if (thisws.OnCaptureFingerData) {
+ thisws.OnCaptureFingerData(data.ErrorCode, data.ErrorMessage, capimage);
+ }
+ break;
+ case CommandType.StartCapture_Type:
+ var startimage = {
+ image_format: ImageFormatType.IBmp,
+ image_data: data.Image_Data,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data,
+ quality: data.Image_Quality,
+ NFIQ: data.Image_NFIQ
+ };
+ if (thisws.OnStartCapture) {
+ thisws.OnStartCapture(data.ErrorCode, data.ErrorMessage, startimage);
+ }
+ break;
+ case CommandType.StopCapture_Type:
+ if (thisws.OnStopCapture) {
+ thisws.OnStopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.GeneralizeTemplate_Type:
+ if (thisws.OnGeneralizeTemplate) {
+ thisws.OnGeneralizeTemplate(data.ErrorCode, data.ErrorMessage, data.Template_Data);
+ }
+ break;
+ case CommandType.Verify_Type:
+ if (thisws.OnVerify) {
+ thisws.OnVerify(data.ErrorCode, data.ErrorMessage, data.Verify_Score, data.Verify_Result);
+ }
+ break;
+ case CommandType.SetOption_Type:
+ if (thisws.OnSetOption) {
+ thisws.OnSetOption(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.BmpToRaw_Type:
+ if (thisws.OnBmpToRaw) {
+ thisws.OnBmpToRaw(data.ErrorCode, data.ErrorMessage, data.Raw_ImageData);
+ }
+ break;
+ case CommandType.BmpToWSQ_Type:
+ if (thisws.OnBmpToWSQ) {
+ thisws.OnBmpToWSQ(data.ErrorCode, data.ErrorMessage, data.WSQ_ImageData);
+ }
+ break;
+ case CommandType.BmpToISO_Type:
+ if (thisws.OnBmpToISO) {
+ thisws.OnBmpToISO(data.ErrorCode, data.ErrorMessage, data.ISO_ImageData);
+ }
+ break;
+ case CommandType.BmpToANSI_Type:
+ if (thisws.OnBmpToANSI) {
+ thisws.OnBmpToANSI(data.ErrorCode, data.ErrorMessage, data.ANSI_ImageData);
+ }
+ break;
+ case CommandType.CID_Init_Type:
+ if (thisws.OnCID_Init) {
+ thisws.OnCID_Init(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_Close_Type:
+ if (thisws.OnCID_Close) {
+ thisws.OnCID_Close(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetChannelCount_Type:
+ if (thisws.OnCID_GetCount) {
+ thisws.OnCID_GetCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.CID_BeginCapture_Type:
+ if (thisws.OnCID_BeginCapture) {
+ thisws.OnCID_BeginCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetFPRawData_Type:
+ if (thisws.OnCID_GetRawData) {
+ thisws.OnCID_GetRawData(data.ErrorCode, data.ErrorMessage, data.RawData, data.FeaData);
+ }
+ break;
+ case CommandType.CID_GetFPBmpData_Type:
+ if (thisws.OnCID_GetBmpData) {
+ thisws.OnCID_GetBmpData(data.ErrorCode, data.ErrorMessage, data.BmpData, data.FeaData);
+ }
+ break;
+ case CommandType.CID_EndCapture_Type:
+ if (thisws.OnCID_EndCapture) {
+ thisws.OnCID_EndCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_GetVersion_Type:
+ if (thisws.OnCID_GetVersion) {
+ thisws.OnCID_GetVersion(data.ErrorCode, data.ErrorMessage, data.Version);
+ }
+ break;
+ case CommandType.CID_GetDesc_Type:
+ if (thisws.OnCID_GetDesc) {
+ thisws.OnCID_GetDesc(data.ErrorCode, data.ErrorMessage, data.Description);
+ }
+ break;
+ case CommandType.CID_Alg_GetVersion_Type:
+ if (thisws.OnCID_Alg_GetVersion) {
+ thisws.OnCID_Alg_GetVersion(data.ErrorCode, data.ErrorMessage, data.Version);
+ }
+ break;
+ case CommandType.CID_Alg_Begin_Type:
+ console.log(11111)
+ if (thisws.OnCID_Alg_Begin) {
+ console.log(2222)
+ thisws.OnCID_Alg_Begin(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.CID_Alg_FeatureExtract_Type:
+ if (thisws.OnCID_Alg_FeatureExtract) {
+ thisws.OnCID_Alg_FeatureExtract(data.ErrorCode, data.ErrorMessage, data.FeatureData);
+ }
+ break;
+ case CommandType.CID_Alg_FeatureMatch_Type:
+ if (thisws.OnCID_Alg_FeatureMatch) {
+ thisws.OnCID_Alg_FeatureMatch(data.ErrorCode, data.ErrorMessage, data.Similarity);
+ }
+ break;
+ case CommandType.CID_Alg_ImageMatch_Type:
+ if (thisws.OnCID_Alg_ImageMatch) {
+ thisws.OnCID_Alg_ImageMatch(data.ErrorCode, data.ErrorMessage, data.Similarity);
+ }
+ break;
+ case CommandType.CID_Alg_GetQualityScore_Type:
+ if (thisws.OnCID_Alg_GetQualityScore) {
+ thisws.OnCID_Alg_GetQualityScore(data.ErrorCode, data.ErrorMessage, data.Score);
+ }
+ break;
+ case CommandType.CID_Alg_End_Type:
+ if (thisws.OnCID_Alg_End) {
+ thisws.OnCID_Alg_End(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.TrustLink_GetDeviceInfo_Type:
+ if (thisws.OnTrustLink_GetDeviceInfo) {
+ thisws.OnTrustLink_GetDeviceInfo(data.ErrorCode, data.ErrorMessage, data.MACAdress, data.IPAdress, data.HostName);
+ }
+ break;
+ case CommandType.ARA_FeaConv_Type:
+ if (thisws.OnARA_FeaConv) {
+ thisws.OnARA_FeaConv(data.ErrorCode, data.ErrorMessage, data.Fea_Dst_Data);
+ }
+ break;
+ case CommandType.ARA_GetCurrentDeviceList_Type:
+ if (thisws.OnARA_GetCurrentDeviceList) {
+ thisws.OnARA_GetCurrentDeviceList(data.ErrorCode, data.ErrorMessage, data.List);
+ }
+ break;
+ case CommandType.FRO900_OpenDevice_Type:
+ if (thisws.OnFRO900_OpenDevice) {
+ thisws.OnFRO900_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FRO900_GetDeviceCount_Type:
+ if (thisws.OnFRO900_GetDeviceCount) {
+ thisws.OnFRO900_GetDeviceCount(data.ErrorCode, data.ErrorMessage, data.Count);
+ }
+ break;
+ case CommandType.FRO900_CaptureFingerPrintData_Type:
+ if (data.PreviewImg != null) {
+ if (thisws.OnFRO900_CaptureFingerPrintData) {
+ thisws.OnFRO900_CaptureFingerPrintData(data.ErrorCode, data.ErrorMessage, null, null, null, null, data.PreviewImg);
+ }
+ }
+ else {
+ var FRO900_Capture_image_1 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_1,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_1,
+ quality: data.Image_Quality_1,
+ NFIQ: data.Image_NFIQ_1
+ };
+ var FRO900_Capture_image_2 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_2,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_2,
+ quality: data.Image_Quality_2,
+ NFIQ: data.Image_NFIQ_2
+ };
+ var FRO900_Capture_image_3 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_3,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_3,
+ quality: data.Image_Quality_3,
+ NFIQ: data.Image_NFIQ_3
+ };
+ var FRO900_Capture_image_4 = {
+ image_format: data.Image_Format,
+ image_data: data.Image_Data_4,
+ feature_format: data.Feature_Format,
+ feature_data: data.Feature_Data_4,
+ quality: data.Image_Quality_4,
+ NFIQ: data.Image_NFIQ_4
+ };
+ if (thisws.OnFRO900_CaptureFingerPrintData) {
+ thisws.OnFRO900_CaptureFingerPrintData(data.ErrorCode, data.ErrorMessage, FRO900_Capture_image_1, FRO900_Capture_image_2, FRO900_Capture_image_3, FRO900_Capture_image_4, null);
+ }
+ }
+ break;
+ case CommandType.FRO900_CloseDevice_Type:
+ if (thisws.OnFRO900_OpenDevice) {
+ thisws.OnFRO900_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FRO900_GeneralizeTemplate_Type:
+ if (thisws.OnGeneralizeTemplate) {
+ thisws.OnFRO900_GeneralizeTemplate(data.ErrorCode, data.ErrorMessage, data.Template_Data);
+ }
+ break;
+ case CommandType.FRO900_Verify_Type:
+ if (thisws.OnVerify) {
+ thisws.OnFRO900_Verify(data.ErrorCode, data.ErrorMessage, data.Verify_Score, data.Verify_Result);
+ }
+ break;
+ case CommandType.Iris_InitDevice_Type:
+ if (thisws.OnIris_InitDevice) {
+ thisws.OnIris_InitDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_StartCapture_Type:
+ if (thisws.OnIris_StartCapture) {
+ thisws.OnIris_StartCapture(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartCapture2_Type:
+ if (thisws.OnIris_StartCapture2) {
+ thisws.OnIris_StartCapture2(data.ErrorCode, data.ErrorMessage, data.Left_Eye_Image, data.Left_Eye_Data, data.Right_Eye_Image, data.Right_Eye_Data);
+ }
+ break;
+ case CommandType.Iris_StartFastCapture_Type:
+ if (thisws.OnIris_StartCapture) {
+ thisws.OnIris_StartCapture(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartFastCapture2_Type:
+ if (thisws.OnIris_StartCapture2) {
+ thisws.OnIris_StartCapture2(data.ErrorCode, data.ErrorMessage, data.Left_Eye_Image, data.Left_Eye_Data, data.Right_Eye_Image, data.Right_Eye_Data);
+ }
+ break;
+ case CommandType.Iris_StopCapture_Type:
+ if (thisws.OnIris_StopCapture) {
+ thisws.OnIris_StopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_StartVerify_Type:
+ if (thisws.OnIris_StartVerify) {
+ thisws.OnIris_StartVerify(data.ErrorCode, data.ErrorMessage, data.Face_Image, data.Distance);
+ }
+ break;
+ case CommandType.Iris_StartVerify2_Type:
+ if (thisws.OnIris_StartVerify2) {
+ thisws.OnIris_StartVerify2(data.ErrorCode, data.ErrorMessage, data.Verify_Result);
+ }
+ break;
+ case CommandType.Iris_StopVerify_Type:
+ if (thisws.OnIris_StopVerify) {
+ thisws.OnIris_StopVerify(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_ReleaseDevice_type:
+ if (thisws.OnIris_ReleaseDevice) {
+ thisws.OnIris_ReleaseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Iris_SetOptions_Type:
+ if (thisws.OnIris_SetOptions) {
+ thisws.OnIris_SetOptions(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.ARA_ReadIDCard_Type:
+ var infodata = {
+ chinese_name: data.CNName,
+ sex: data.Sex,
+ birth: data.Birth,
+ idnum: data.IDNum,
+ expdatebegin: data.ExpDateBegin,
+ expdateend: data.ExpDateEnd,
+ authority: data.Authority,
+ english_name: data.ENName,
+ country: data.Country,
+ version: data.Version,
+ address: data.Address,
+ passnum: data.PassNum,
+ issuecount: data.IssueCount,
+ nation: data.Nation,
+ newaddress: data.NewAddress,
+ feature1: data.Feature1,
+ feature2: data.Feature2,
+ photodata: data.PhotoData,
+ };
+ if (thisws.OnARA_ReadIDCard) {
+ thisws.OnARA_ReadIDCard(data.ErrorCode, data.ErrorMessage, data.CardType, infodata);
+ }
+ break;
+ case CommandType.FingerKey_OpenDevice_Type:
+ if (thisws.OnFingerKey_OpenDevice) {
+ thisws.OnFingerKey_OpenDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FingerKey_CloseDevice_Type:
+ if (thisws.OnFingerKey_CloseDevice) {
+ thisws.OnFingerKey_CloseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.FingerKey_GetDeviceInformation_Type:
+ var keyinfo = {
+ manufacturer: data.Manufacturer,
+ issuer: data.Issuer,
+ label: data.Label,
+ sn: data.SN,
+ hwver: data.HWVer,
+ fwver: data.FWVer,
+ };
+ if (thisws.OnFingerKey_GetDeviceInformation) {
+ thisws.OnFingerKey_GetDeviceInformation(data.ErrorCode, data.ErrorMessage, keyinfo);
+ }
+ break;
+ case CommandType.FingerKey_CaptureFingerData_Type:
+ if (thisws.OnFingerKey_CaptureFingerData) {
+ thisws.OnFingerKey_CaptureFingerData(data.ErrorCode, data.ErrorMessage, data.Image_Data, data.Feature_Data, data.Image_Quality);
+ }
+ break;
+ case CommandType.FingerKey_ImportFingerPrint_Type:
+ if (thisws.OnFingerKey_ImportFingerPrint) {
+ thisws.OnFingerKey_ImportFingerPrint(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_InitDevice_Type:
+ if (thisws.OnCamera_InitDevice) {
+ thisws.OnCamera_InitDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_ReleaseDevice_Type:
+ if (thisws.OnCamera_ReleaseDevice) {
+ thisws.OnCamera_ReleaseDevice(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_StartCapture_Type:
+ if (thisws.OnCamera_StartCapture) {
+ thisws.OnCamera_StartCapture(data.ErrorCode, data.ErrorMessage, data.ImageData, data.LiveDetect, data.FaceDetect, data.FaceQuality);
+ }
+ break;
+ case CommandType.Camera_StopCapture_Type:
+ if (thisws.OnCamera_StopCapture) {
+ thisws.OnCamera_StopCapture(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ case CommandType.Camera_SetOption_Type:
+ if (thisws.OnCamera_SetOption) {
+ thisws.OnCamera_SetOption(data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ default:
+ if (thisws.OnOtherError) {
+ thisws.OnOtherError(data.ResponseType, data.ErrorCode, data.ErrorMessage);
+ }
+ break;
+ }
+ };
+ this.ws.onclose = function () {
+ thisws.isConnect = false;
+ console.log("ws.onclose:Disconnect");
+ };
+ };
+ Client.prototype.Disconnect_Server = function () {
+ var thisws = this;
+ this.ws.close();
+ };
+ return Client;
+}());
+
+export default Client
\ No newline at end of file
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index e5a99d1..1b3912b 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -1,328 +1,393 @@
<template>
- <el-row :class="{ securityGuard: isSecurity }">
+ <el-row :class="{ securityGuard: isSecurity }">
+ <el-col :span="0" style="display: none">
+ <div class="box">
+ <el-scrollbar>
+ <basic-container>
+ <avue-tree
+ :option="treeOption"
+ :data="treeData"
+ @node-click="nodeClick"
+ />
+ </basic-container>
+ </el-scrollbar>
+ </div>
+ </el-col>
+ <el-col :span="24">
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :search.sync="search"
+ :table-loading="loading"
+ :data="data"
+ ref="crud"
+ v-model="form"
+ :permission="permissionList"
+ @row-del="rowDel"
+ :row-style="rowStyle"
+ @row-save="rowSave"
+ @row-update="rowUpdate"
+ :before-open="beforeOpen"
+ :page.sync="page"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <!-- @row-update="rowUpdate" -->
+ <template slot="menuLeft">
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ v-if="permission.securityGuard_import"
+ @click="handleImport1"
+ >保安员批量导入
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ v-if="permission.securityGuard_import"
+ @click="handleImport2"
+ >个人照片批量上传
+ </el-button>
+ <el-button
+ type="primary"
+ size="small"
+ plain
+ v-if="permission.securityGuard_security_apply"
+ icon="el-icon-s-promotion"
+ @click="handleSecurityApply"
+ >上岗证制证申请
+ </el-button>
- <el-col :span="0"
- style="display: none">
- <div class="box">
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="treeOption"
- :data="treeData"
- @node-click="nodeClick" />
- </basic-container>
- </el-scrollbar>
+ <el-button
+ type="danger"
+ style="display: none"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete"
+ >注 销
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="permission.user_role"
+ icon="el-icon-user"
+ @click="handleGrant"
+ >角色配置
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="permission.user_reset"
+ icon="el-icon-refresh"
+ @click="handleReset"
+ >密码重置
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-setting"
+ @click="handlePlatform"
+ >平台配置
+ </el-button>
+ <el-button
+ type="success"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >导入
+ </el-button>
+ <el-button
+ type="warning"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ </template>
+
+ <template slot-scope="{ type, size, row }" slot="menu">
+ <el-button
+ icon="el-icon-s-custom"
+ :size="size"
+ :type="type"
+ @click.stop="rowClick(row)"
+ >查看
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_delete && row.status != 2"
+ @click.stop="rowStatus(row)"
+ >离职登记
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="row.status == 2"
+ @click.stop="rowDellook(row)"
+ >离职查询
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_check"
+ @click.stop="rowCheck(row)"
+ >异常
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_paper"
+ @click.stop="certificateClick(row)"
+ >纸质证书制作
+ </el-button>
+ </template>
+
+ <template slot-scope="{ row }" slot="sex">
+ <el-tag v-if="row.sex == 1">男</el-tag>
+ <el-tag v-if="row.sex == 2">女</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="deptId">
+ <el-tag
+ class="rowClickSelf"
+ title="点击查看所属公司情况"
+ @click="rowClickSelf(row.deptId)"
+ >{{ row.deptName }}</el-tag
+ >
+ </template>
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="roleName">
+ <el-tag>{{ row.roleName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="deptName">
+ <el-tag>{{ row.deptName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userType">
+ {{
+ row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : ""
+ }}
+ </template>
+
+ <!-- 自定义新增和编辑中的指纹信息 -->
+ <!-- src="http://223.82.109.183:2081/zhba/upload/picture/85004574ae23472da37350b918960206.png" -->
+ <template slot-scope="{ type, disabled }" slot="fingerprintForm">
+ <div class="zhiwenMain">
+ <!-- <img class="zhiwenImgs" :src="zhiwenImg" alt="" />
+ <el-button type="primary" @click="openzhiwen" v-show="isOr">{{
+ zhiwenTitle
+ }}</el-button>
+ <el-button type="warning" @click="closezhiwen" v-show="!isOr">{{
+ zhiwenTitle
+ }}</el-button>
+ <el-button type="primary" @click="openccc">openccc</el-button>-->
+ <iframe
+ id="zhiwen"
+ ref="zhiwen"
+ src="/zhiwenDemo/CID.html"
+ frameborder="0"
+ width="100%"
+ height="100%"
+ name="zhiwen"
+ ></iframe>
</div>
- </el-col>
- <el-col :span="24">
- <basic-container>
- <avue-crud :option="option"
- :search.sync="search"
- :table-loading="loading"
- :data="data"
- ref="crud"
- v-model="form"
- :permission="permissionList"
- @row-del="rowDel"
- :row-style="rowStyle"
- @row-save="rowSave"
- @row-update="rowUpdate"
- :before-open="beforeOpen"
- :page.sync="page"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
- <!-- @row-update="rowUpdate" -->
- <template slot="menuLeft">
- <el-button type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- v-if="permission.securityGuard_import"
- @click="handleImport1">保安员批量导入
- </el-button>
- <el-button type="success"
- size="small"
- plain
- icon="el-icon-upload2"
- v-if="permission.securityGuard_import"
- @click="handleImport2">个人照片批量上传
- </el-button>
- <el-button type="primary"
- size="small"
- plain
- v-if="permission.securityGuard_security_apply"
- icon="el-icon-s-promotion"
- @click="handleSecurityApply">上岗证制证申请
- </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog
+ title="用户角色配置"
+ append-to-body
+ :visible.sync="roleBox"
+ width="345px"
+ >
+ <el-tree
+ :data="roleGrantList"
+ show-checkbox
+ check-strictly
+ default-expand-all
+ node-key="id"
+ ref="treeRole"
+ :default-checked-keys="roleTreeObj"
+ :props="props"
+ >
+ </el-tree>
- <el-button type="danger"
- style="display: none"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete">注 销
- </el-button>
- <el-button type="info"
- style="display: none"
- size="small"
- plain
- v-if="permission.user_role"
- icon="el-icon-user"
- @click="handleGrant">角色配置
- </el-button>
- <el-button type="info"
- style="display: none"
- size="small"
- plain
- v-if="permission.user_reset"
- icon="el-icon-refresh"
- @click="handleReset">密码重置
- </el-button>
- <el-button type="info"
- style="display: none"
- size="small"
- plain
- v-if="userInfo.role_name.includes('admin')"
- icon="el-icon-setting"
- @click="handlePlatform">平台配置
- </el-button>
- <el-button type="success"
- style="display: none"
- size="small"
- plain
- v-if="userInfo.role_name.includes('admin')"
- icon="el-icon-upload2"
- @click="handleImport">导入
- </el-button>
- <el-button type="warning"
- style="display: none"
- size="small"
- plain
- v-if="userInfo.role_name.includes('admin')"
- icon="el-icon-download"
- @click="handleExport">导出
- </el-button>
- </template>
-
- <template slot-scope="{ type, size, row }"
- slot="menu">
- <el-button icon="el-icon-s-custom"
- :size="size"
- :type="type"
- @click.stop="rowClick(row)">查看
- </el-button>
- <el-button icon="el-icon-edit"
- :size="size"
- :type="type"
- v-if="permission.securityGuard_delete && row.status != 2"
- @click.stop="rowStatus(row)">离职登记
- </el-button>
- <el-button icon="el-icon-edit"
- :size="size"
- :type="type"
- v-if="row.status == 2"
- @click.stop="rowDellook(row)">离职查询
- </el-button>
- <el-button icon="el-icon-edit"
- :size="size"
- :type="type"
- v-if="permission.securityGuard_check"
- @click.stop="rowCheck(row)">异常
- </el-button>
- <el-button icon="el-icon-edit"
- :size="size"
- :type="type"
- v-if="permission.securityGuard_paper"
- @click.stop="certificateClick(row)">纸质证书制作
- </el-button>
- </template>
-
- <template slot-scope="{ row }"
- slot="sex">
- <el-tag v-if="row.sex == 1">男</el-tag>
- <el-tag v-if="row.sex == 2">女</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="deptId">
- <el-tag class="rowClickSelf"
- title="点击查看所属公司情况"
- @click="rowClickSelf(row.deptId)">{{ row.deptName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="tenantName">
- <el-tag>{{ row.tenantName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="roleName">
- <el-tag>{{ row.roleName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="deptName">
- <el-tag>{{ row.deptName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="userTypeName">
- <el-tag>{{ row.userTypeName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="userType">
-
- {{
- row.userType == 6 ? '已制证' : row.userType == 7 ? '未制证' : ''
- }}
-
- </template>
- </avue-crud>
- <el-dialog title="用户角色配置"
- append-to-body
- :visible.sync="roleBox"
- width="345px">
- <el-tree :data="roleGrantList"
- show-checkbox
- check-strictly
- default-expand-all
- node-key="id"
- ref="treeRole"
- :default-checked-keys="roleTreeObj"
- :props="props">
- </el-tree>
-
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="roleBox = false">取 消</el-button>
- <el-button type="primary"
- @click="submitRole">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="用户数据导入"
- append-to-body
- :visible.sync="excelBox"
- width="555px">
- <avue-form :option="excelOption"
- v-model="excelForm"
- :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary"
- @click="handleTemplate">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- </el-dialog>
- <el-dialog title="用户平台配置"
- append-to-body
- :visible.sync="platformBox">
- <avue-crud :option="platformOption"
- :table-loading="platformLoading"
- :data="platformData"
- ref="platformCrud"
- v-model="platformForm"
- :before-open="platformBeforeOpen"
- :page.sync="platformPage"
- :permission="platformPermissionList"
- @row-update="platformRowUpdate"
- @search-change="platformSearchChange"
- @search-reset="platformSearchReset"
- @selection-change="platformSelectionChange"
- @current-change="platformCurrentChange"
- @size-change="platformSizeChange"
- @refresh-change="platformRefreshChange"
- @on-load="platformOnLoad">
- <template slot-scope="{ row }"
- slot="tenantName">
- <el-tag>{{ row.tenantName }}</el-tag>
- </template>
- <template slot-scope="{ row }"
- slot="userTypeName">
- <el-tag>{{ row.userTypeName }}</el-tag>
- </template>
- </avue-crud>
- </el-dialog>
- <el-dialog title="保安员导入"
- append-to-body
- :visible.sync="excelBox1"
- width="555px">
- <avue-form :option="excelOption1"
- v-model="excelForm1"
- :upload-after="uploadAfter1">
- <template slot="excelTemplate">
- <el-button type="primary"
- @click="handleTemplate1">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- </el-dialog>
- <el-dialog title="个人照片批量上传"
- append-to-body
- :visible.sync="excelBox2"
- width="555px">
- <avue-form :option="excelOption2"
- v-model="excelForm2"
- :upload-after="uploadAfter2">
- </avue-form>
- </el-dialog>
- <div style="position: fixed; top: 9999px; width: 100%; height: 100%; ">
- <div class="certificate_box"
- id="certificateDom">
- <div class="security_main"
- ref="certificateBox">
- <div class="security_m_l_titleName widt">
- {{ certificateObj.realName }}
- </div>
- <div class="security_m_r_o_jg widt">
- 南昌市公安局
- </div>
- <div class="security_m_l_titlepaperTimenian widt">
- {{ certificateYear }}
- </div>
- <div class="security_m_l_titlepaperTimeyue widt">
- {{ certificateMonth }}
- </div>
- <div class="security_m_l_downsecuritynumber widt">
- {{ certificateObj.securitynumber }}
- </div>
- <div class="security_m_r_o_right widt">
- {{ certificateObj.realName }}
- </div>
- <div class="security_m_r_o_rightbirthday widt">
- {{ certificateObj.cardid ? (certificateObj.cardid.slice(6, 10) +'.'+ certificateObj.cardid.slice(10, 12) +'.'+ certificateObj.cardid.slice(12, 14)) : '' }}
- </div>
- <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
- {{ certificateObj.registered }}
- </div>
- <div class="security_m_r_o_rightcardid">
- {{ certificateObj.cardid }}
- </div>
-
- </div>
- </div>
- </div>
- </basic-container>
- </el-col>
- </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="roleBox = false">取 消</el-button>
+ <el-button type="primary" @click="submitRole">确 定</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="用户数据导入"
+ append-to-body
+ :visible.sync="excelBox"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption"
+ v-model="excelForm"
+ :upload-after="uploadAfter"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ <el-dialog
+ title="用户平台配置"
+ append-to-body
+ :visible.sync="platformBox"
+ >
+ <avue-crud
+ :option="platformOption"
+ :table-loading="platformLoading"
+ :data="platformData"
+ ref="platformCrud"
+ v-model="platformForm"
+ :before-open="platformBeforeOpen"
+ :page.sync="platformPage"
+ :permission="platformPermissionList"
+ @row-update="platformRowUpdate"
+ @search-change="platformSearchChange"
+ @search-reset="platformSearchReset"
+ @selection-change="platformSelectionChange"
+ @current-change="platformCurrentChange"
+ @size-change="platformSizeChange"
+ @refresh-change="platformRefreshChange"
+ @on-load="platformOnLoad"
+ >
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ </avue-crud>
+ </el-dialog>
+ <el-dialog
+ title="保安员导入"
+ append-to-body
+ :visible.sync="excelBox1"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption1"
+ v-model="excelForm1"
+ :upload-after="uploadAfter1"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate1">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ <el-dialog
+ title="个人照片批量上传"
+ append-to-body
+ :visible.sync="excelBox2"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption2"
+ v-model="excelForm2"
+ :upload-after="uploadAfter2"
+ >
+ </avue-form>
+ </el-dialog>
+ <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
+ <div class="certificate_box" id="certificateDom">
+ <div class="security_main" ref="certificateBox">
+ <div class="security_m_l_titleName widt">
+ {{ certificateObj.realName }}
+ </div>
+ <div class="security_m_r_o_jg widt">南昌市公安局</div>
+ <div class="security_m_l_titlepaperTimenian widt">
+ {{ certificateYear }}
+ </div>
+ <div class="security_m_l_titlepaperTimeyue widt">
+ {{ certificateMonth }}
+ </div>
+ <div class="security_m_l_downsecuritynumber widt">
+ {{ certificateObj.securitynumber }}
+ </div>
+ <div class="security_m_r_o_right widt">
+ {{ certificateObj.realName }}
+ </div>
+ <div class="security_m_r_o_rightbirthday widt">
+ {{
+ certificateObj.cardid
+ ? certificateObj.cardid.slice(6, 10) +
+ "." +
+ certificateObj.cardid.slice(10, 12) +
+ "." +
+ certificateObj.cardid.slice(12, 14)
+ : ""
+ }}
+ </div>
+ <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
+ {{ certificateObj.registered }}
+ </div>
+ <div class="security_m_r_o_rightcardid">
+ {{ certificateObj.cardid }}
+ </div>
+ </div>
+ </div>
+ </div>
+ </basic-container>
+ </el-col>
+ </el-row>
</template>
<script>
import {
- getUser,
- getUserPlatform,
- remove,
- update,
- updatePlatform,
- add,
- securitySave,
- grant,
- resetPassword,
- getUserPractitionersInfo,
- updatePaperTime,
- saveOrUpdateUserPractitionersInfo,
+ getUser,
+ getUserPlatform,
+ remove,
+ update,
+ updatePlatform,
+ add,
+ securitySave,
+ grant,
+ resetPassword,
+ getUserPractitionersInfo,
+ updatePaperTime,
+ saveOrUpdateUserPractitionersInfo,
+ getzhiwen, //指纹
} from "@/api/system/user";
-import { securityApply } from '@/api/accreditationRecords/accreditationRecords'
+import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
import { getList } from "@/api/securityGuard/securityGuard";
import { getDeptLazyTree } from "@/api/system/dept";
import { getRoleTree, getRoleDetail } from "@/api/system/role";
@@ -333,1459 +398,1753 @@
import { securityFormPageColumn } from "./data";
import { mapState } from "vuex";
+//加载指纹类
+import Client from "./Client";
+import doneVue from "../work/done.vue";
+// import func from "vue-editor-bridge";
+
export default {
- data () {
- // const validatePass = (rule, value, callback) => {
- // if (value === "") {
- // callback(new Error("请输入密码"));
- // } else {
- // callback();
- // }
- // };
- // const validatePass2 = (rule, value, callback) => {
- // if (value === "") {
- // callback(new Error("请再次输入密码"));
- // } else if (value !== this.form.password) {
- // callback(new Error("两次输入密码不一致!"));
- // } else {
- // callback();
- // }
- // };
- // const validatePassNumber = (rule, value, callback) => {
- // var test = /^[0-9]*$/gm;
- // if (!test.test(value)) {
- // callback(new Error("请输入数字"));
- // } else {
- // callback();
- // }
- // };
- var date = new Date();
- let year = date.getFullYear(),
- mouth = date.getMonth() + 1,
- day = date.getDate(),
- oldy,
- oldm,
- oldd,
- ok = false;
+ data() {
+ // const validatePass = (rule, value, callback) => {
+ // if (value === "") {
+ // callback(new Error("请输入密码"));
+ // } else {
+ // callback();
+ // }
+ // };
+ // const validatePass2 = (rule, value, callback) => {
+ // if (value === "") {
+ // callback(new Error("请再次输入密码"));
+ // } else if (value !== this.form.password) {
+ // callback(new Error("两次输入密码不一致!"));
+ // } else {
+ // callback();
+ // }
+ // };
+ // const validatePassNumber = (rule, value, callback) => {
+ // var test = /^[0-9]*$/gm;
+ // if (!test.test(value)) {
+ // callback(new Error("请输入数字"));
+ // } else {
+ // callback();
+ // }
+ // };
+ var date = new Date();
+ let year = date.getFullYear(),
+ mouth = date.getMonth() + 1,
+ day = date.getDate(),
+ oldy,
+ oldm,
+ oldd,
+ ok = false;
- const validatePassCardid = (rule, value, callback) => {
- // console.log(oldy, oldm, oldd, year - oldy, mouth, day);
- var test =
- /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
- if (!test.test(value)) {
- callback(new Error("请输入正确身份证号码"));
- } else {
- //加入校验18岁到60岁的
- oldy = +value.slice(6, 10);
- oldm = +value.slice(10, 12);
- oldd = +value.slice(12, 14);
- ok =
- year - oldy < 18 || year - oldy > 60
- ? false
- : year - oldy == 18
- ? mouth < oldm
- ? false
- : mouth > oldm
- ? true
- : day < oldd
- ? false
- : true
- : year - oldy == 60
- ? mouth < oldm
- ? true
- : mouth > oldm
- ? false
- : day <= oldd
- ? false
- : true
- : true;
- if (ok) {
- callback();
- } else {
- // callback(new Error("根据国家要求,需在18岁至60岁"));
- callback(new Error("年龄不符"));
- }
- }
- };
- const validatePassPhone = (rule, value, callback) => {
- var test = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/g;
- if (!test.test(value)) {
- callback(new Error("请输入正确手机号码"));
- } else {
- callback();
- }
- };
- return {
- certificateYear: null,
- certificateMonth: null,
- certificateFlag: false,
- certificateObj: {
- realName: '',
- securitynumber: '',
- cardid: '',
- registered: ''
- },
- securityid: "",
- excelBox1: false,
- excelBox2: false,
- isSecurity: true,
- excelForm1: {},
- excelOption1: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "文件上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "文件上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data",
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-user/import-user?deptId=" + this.deptIds,
- },
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24,
- },
- ],
- },
- excelForm2: {},
- excelOption2: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "文件上传",
- prop: "file",
- type: "upload",
- drag: true,
- loadText: "文件上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data",
- },
- tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
- action: "/api/blade-resource/oss/endpoint/put-file-zip",
- },
- ],
- },
- form: {},
- search: {},
- roleBox: false,
- excelBox: false,
- platformBox: false,
- initFlag: true,
- selectionList: [],
- query: {},
- loading: true,
- platformLoading: false,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- roleId: "1412226235153731586",
- deptId: "1413470343230877697",
- deptIds: "",
- platformPage: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- init: {
- roleTree: [],
- deptTree: [],
- },
- props: {
- label: "title",
- value: "key",
- },
- roleGrantList: [],
- roleTreeObj: [],
- treeDeptId: "",
- treeData: [],
- treeOption: {
- nodeKey: "id",
- lazy: true,
- treeLoad: function (node, resolve) {
- const parentId = node.level === 0 ? 0 : node.data.id;
- getDeptLazyTree(parentId).then((res) => {
- resolve(
- res.data.data.map((item) => {
- return {
- ...item,
- leaf: !item.hasChildren,
- };
- })
- );
- });
- },
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "value",
- children: "children",
- },
- },
- choiceList: [],
- option: {
- height: "auto",
- calcHeight: 80,
- tip: true,
- searchShow: true,
- reserveSelection: true,
- selectable: (row) => {
- if (row.hold !== "1") {
- return false;
- } else {
- return true;
- }
- },
- indexWidth: 55,
- searchMenuSpan: 6,
- stripe: true,
- border: true,
- delBtn: true,
- align: "center",
- index: true,
- delBtnText: "注销",
- menuWidth: 327,
- selection: true,
- viewBtn: true,
- defaultExpandAll: true,
- //dialogType: 'drawer',
- dialogClickModal: false,
- column: securityFormPageColumn,
- group: [
- {
- label: "基础信息",
- labelWidth: "110",
- prop: "baseInfo",
- icon: "el-icon-user-solid",
- column: [
- {
- label: "所属保安公司",
- prop: "deptId",
- type: "tree",
- // dicUrl:
- // "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
- // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
- props: {
- label: "title",
- value: "id",
- },
- // disabled: true,
- rules: [
- {
- required: true,
- message: "请选择保安公司",
- trigger: "blur",
- },
- ],
- },
- {
- label: "姓名",
- prop: "realName",
- rules: [
- {
- required: true,
- message: "请输入姓名",
- trigger: "blur",
- },
- {
- min: 2,
- max: 5,
- message: "姓名长度在2到5个字符",
- },
- ],
- },
- // {
- // label: "登录账号",
- // prop: "account",
- // editDisabled: true,
- // rules: [
- // {
- // required: true,
- // message: "请输入登录账号",
- // trigger: "blur",
- // },
- // ],
- // // disabled: true,
- // },
- // {
- // label: "密码",
- // prop: "password",
- // type: "password",
- // hide: true,
- // editDisplay: false,
- // viewDisplay: false,
- // rules: [
- // { required: true, validator: validatePass, trigger: "blur" },
- // ],
- // },
- // {
- // label: "确认密码",
- // prop: "password2",
- // type: "password",
- // hide: true,
- // editDisplay: false,
- // viewDisplay: false,
- // rules: [
- // { required: true, validator: validatePass2, trigger: "blur" },
- // ],
- // },
- ],
- },
- {
- label: "详细信息",
- prop: "detailInfo",
- labelWidth: "110",
- icon: "el-icon-s-order",
- column: [
- {
- label: "身份证号",
- prop: "cardid",
- hide: true,
- overHidden: true,
- rules: [
- {
- required: true,
- message: "请输入身份证号",
- trigger: "blur",
- },
- {
- required: true,
- validator: validatePassCardid,
- trigger: "blur",
- },
- ],
- },
- {
- label: "手机号码",
- prop: "phone",
- overHidden: true,
- rules: [
- {
- required: true,
- message: "请输入手机号",
- trigger: "blur",
- },
- {
- required: true,
- validator: validatePassPhone,
- trigger: "blur",
- },
- ],
- },
- // {
- // label: "昵称",
- // prop: "name",
- // },
- {
- label: "个人照片",
- type: "upload",
- listType: "picture-img",
- propsHttp: {
- res: "data",
- url: "url",
- },
- canvasOption: {
- text: " ",
- ratio: 0.1,
- },
- action: "/api/blade-resource/oss/endpoint/put-files",
- tip: "上传二代身份证一寸近期彩色正面免冠图象, (358像素(宽) × 441像素(高)、分辨率350dpi)且不超过500kb",
- span: 12,
- // row: true,
- prop: "avatar",
- },
- {
- label: "指纹信息",
- type: "upload",
- listType: "picture-img",
- propsHttp: {
- res: "data",
- url: "url",
- },
- canvasOption: {
- text: " ",
- ratio: 0.1,
- },
- action: "/api/blade-resource/oss/endpoint/put-files",
- tip: "只能上传jpg/png指纹信息,且不超过500kb",
- span: 12,
- // row: true,
- prop: "fingerprint",
- },
- {
- label: "是否持证",
- prop: "hold",
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
- // props: {
- // label: "dictValue",
- // value: "dictKey",
- // },
- type: "select",
- dicData: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "2",
- },
- {
- label: "已吊销",
- value: "3",
- },
- ],
- rules: [
- {
- required: true,
- message: "请选择",
- trigger: "blur",
- },
- ],
- },
- {
- label: "保安员证编号",
- prop: "securitynumber",
- hide: true,
- },
- // {
- // label: "发证日期",
- // prop: "paperTime",
- // hide: true,
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd",
- // },
- {
- label: "电子邮箱",
- prop: "email",
- },
- // {
- // label: "籍贯",
- // prop: "nativeplace",
- // },
- {
- label: "民族",
- prop: "nation",
- },
- {
- label: "最高学历",
- prop: "education1",
- type: "select",
- dicUrl:
- "/api/blade-system/dict-biz/dictionary?code=educationType",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- dataType: "number",
- slot: true,
- },
- {
- label: "政治面貌",
- prop: "politicaloutlook",
- },
- {
- label: "健康状态",
- prop: "healstats",
- },
- {
- label: "身高",
- prop: "height",
- },
- {
- label: "联系地址",
- prop: "address"
- },
- {
- label: "住址",
- prop: "registered",
- rules: [
- {
- required: true,
- message: "请输入住址",
- trigger: "click",
- },
- ],
- },
- {
- label: "所属辖区",
- prop: "jurisdiction",
- // multiple: true,
- type: "tree",
- dicUrl: "/api/jurisdiction/lazy-tree",
- props: {
- label: "title",
- value: "id",
- },
- checkStrictly: true,
- slot: true,
- rules: [
- {
- required: false,
- message: "请选择所属辖区",
- trigger: "click",
- },
- ],
- },
- {
- label: "入职时间",
- prop: "rtime",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- rules: [
- {
- required: true,
- message: "请输入入职时间",
- trigger: "click",
- },
- ],
- },
- {
- label: "性别",
- prop: "sex",
- type: "select",
- slot: true,
- dicData: [
- {
- label: "男",
- value: 1,
- },
- {
- label: "女",
- value: 2,
- },
- // {
- // label: "未知",
- // value: 3,
- // },
- ],
- rules: [
- {
- required: true,
- message: "请选择性别",
- trigger: "blur",
- },
- ],
- },
- // {
- // label: "生日",
- // type: "date",
- // prop: "birthday",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd",
- // },
- ],
- },
- ],
- },
- data: [],
- platformQuery: {},
- platformSelectionList: [],
- platformData: [],
- platformForm: {},
- platformOption: {
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- selection: true,
- viewBtn: true,
- dialogClickModal: false,
- menuWidth: 120,
- editBtnText: "配置",
- column: [
- {
- label: "登录账号",
- prop: "account",
- search: true,
- display: false,
- },
- {
- label: "所属保安单位",
- prop: "tenantName",
- slot: true,
- display: false,
- },
- {
- label: "姓名",
- prop: "realName",
- search: true,
- display: false,
- },
- {
- label: "平台",
- prop: "userTypeName",
- slot: true,
- display: false,
- },
- {
- label: "平台",
- type: "select",
- dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- dataType: "number",
- search: true,
- hide: true,
- display: false,
- prop: "userType",
- rules: [
- {
- required: true,
- message: "请选择平台",
- trigger: "blur",
- },
- ],
- },
- {
- label: "拓展",
- prop: "userExt",
- type: "textarea",
- minRows: 8,
- span: 24,
- overHidden: true,
- row: true,
- hide: true,
- },
- ],
- },
- excelForm: {},
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "模板上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data",
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-user/import-user",
- },
- // {
- // label: "数据覆盖",
- // prop: "isCovered",
- // type: "switch",
- // align: "center",
- // width: 80,
- // dicData: [
- // {
- // label: "否",
- // value: 0,
- // },
- // {
- // label: "是",
- // value: 1,
- // },
- // ],
- // value: 0,
- // slot: true,
- // rules: [
- // {
- // required: true,
- // message: "请选择是否覆盖",
- // trigger: "blur",
- // },
- // ],
- // },
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24,
- },
- ],
- },
- };
- },
- watch: {
- "form.tenantId" () {
- if (this.form.tenantId !== "" && this.initFlag) {
- this.initData(this.form.tenantId);
- }
- },
- "form.deptId" () {
- this.initData(this.form.tenantId);
- },
- "excelForm.isCovered" () {
- if (this.excelForm.isCovered !== "") {
- const column = this.findObject(this.excelOption.column, "excelFile");
- column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
- }
- },
- },
- computed: {
- ...mapGetters(["userInfo", "permission"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.securityGuard_add, false),
- viewBtn: this.vaildData(null, false),
- delBtn: this.vaildData(this.permission.securityGuard_delete, false),
- editBtn: this.vaildData(this.permission.securityGuard_edit, false),
- };
- },
- platformPermissionList () {
- return {
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: this.vaildData(this.permission.user_edit, false),
- };
- },
- ids () {
- let ids = [];
- this.selectionList.forEach((ele) => {
- ids.push(ele.id);
- });
- return ids.join(",");
- },
- ...mapState({
- userInfo: (state) => state.user.userInfo,
- }),
- },
- beforeCreate () { },
- created () {
- console.log(this.userInfo.role_name,123541);
- if(this.userInfo.role_name=="办证管理员"){
- console.log(this.userInfo.role_name,5555225);
- this.search["userType"] = 7;
+ const validatePassCardid = (rule, value, callback) => {
+ // console.log(oldy, oldm, oldd, year - oldy, mouth, day);
+ var test =
+ /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
+ if (!test.test(value)) {
+ callback(new Error("请输入正确身份证号码"));
+ } else {
+ //加入校验18岁到60岁的
+ oldy = +value.slice(6, 10);
+ oldm = +value.slice(10, 12);
+ oldd = +value.slice(12, 14);
+ ok =
+ year - oldy < 18 || year - oldy > 60
+ ? false
+ : year - oldy == 18
+ ? mouth < oldm
+ ? false
+ : mouth > oldm
+ ? true
+ : day < oldd
+ ? false
+ : true
+ : year - oldy == 60
+ ? mouth < oldm
+ ? true
+ : mouth > oldm
+ ? false
+ : day <= oldd
+ ? false
+ : true
+ : true;
+ if (ok) {
+ callback();
+ } else {
+ // callback(new Error("根据国家要求,需在18岁至60岁"));
+ callback(new Error("年龄不符"));
}
- },
- mounted () {
- // this.option.column[0].hide = true
- // 非保安单位模式默认加载管理组数据
- if (!website.tenantMode) {
- this.initData(website.tenantId);
- }
- this.search["status"] = 1;
- if(this.userInfo.roleName=="办证管理员"){
- this.search["userType"] = 7;
- }
- this.deptIds = this.userInfo.dept_id;
- },
- methods: {
- handleImport1 () {
- this.excelBox1 = true;
- },
- uploadAfter1 (res, done, loading, column) {
- window.console.log(column);
- this.excelBox1 = false;
- this.refreshChange();
- done();
- },
- handleTemplate1 () {
- window.open(`/api/blade-user/export-template-security`);
- },
- handleImport2 () {
- this.excelBox2 = true;
- },
- uploadAfter2 (res, done, loading, column) {
- window.console.log(column);
- this.excelBox2 = false;
- this.refreshChange();
- done();
- },
-
- //行点击事件
- rowClick (row) {
- this.$router.push({
- path: "/securityGuardDetail",
- query: { row: JSON.stringify(row) },
- });
- },
- //行点击事件
- certificateClick (row) {
- if (row) {
- var time = this.getNewTime()
- this.certificateYear = time[0]
- this.certificateMonth = time[1]
- this.certificateObj = row
- setTimeout(() => {
- this.Print();
- }, 500);
- }
- },
- Print () {
- if (this.certificateObj.registered == '' || this.certificateObj.registered == null) {
- this.$message({ message: '请完善住址信息', type: 'warning' })
- return
- }
- //更新发证时间
- var printDom = document.getElementById("certificateDom");
- printDom.style.position = "absolute";
- printDom.style.top = "-25.0%";
- printDom.style.left = "-23%";
- printDom.style.width = "120%";
- printDom.style.height = "100%";
- printDom.style.fontFamily = "SimSun";
-
- this.$print('#certificateDom', {
- noPrint: '.noPrint',
- onStart: () => {
- // console.log('打印开始', Date.parse(new Date()));
- },
- onEnd: () => {
- this.updateUserInfo();
- // console.log('打印完成', Date.parse(new Date()));
- }
- });
-
-
- },
- getNewTime () {
- var nowTime = new Date()
-
- var oneHoursAgo = new Date(new Date(nowTime).getTime() - 1 * 60 * 60 * 1000)
- var oneHoursAgoY = oneHoursAgo.getFullYear()
- var oneHoursAgoM = oneHoursAgo.getMonth() + 1 < 10 ? '0' + (oneHoursAgo.getMonth() + 1) : oneHoursAgo.getMonth() + 1
-
- /**
- * @return 返回1小时,2小时,3小时,4小时,24小时
- */
- return [oneHoursAgoY, oneHoursAgoM]
- },
- //更新用户发证时间
- updateUserInfo () {
- var nowTime = new Date()
- var oneHoursAgo = new Date(new Date(nowTime).getTime() - 1 * 60 * 60 * 1000)
- var oneHoursAgoY = oneHoursAgo.getFullYear()
- var oneHoursAgoM = oneHoursAgo.getMonth() + 1 < 10 ? '0' + (oneHoursAgo.getMonth() + 1) : oneHoursAgo.getMonth() + 1
- var day = oneHoursAgo.getDay();
- var date = oneHoursAgoY + "-" + oneHoursAgoM + "-" + day;
- const data = {
- id: this.certificateObj.id,
- userType: 6,
- paperTime: date
- }
- updatePaperTime(data);
- },
- rowClickSelf (row) {
- this.$router.push({
- path: "/securityUnitChild",
- query: { fromSecunityGuardId: row },
- });
- },
- nodeClick (data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoad(this.page);
- },
- initData (tenantId) {
- // getRoleTree(tenantId).then((res) => {
- // const column = this.findObject(this.option.group, "roleId");
- // column.dicData = res.data.data;
- // });
- // getDeptTree(tenantId).then((res) => {
- // const column = this.findObject(this.option.group, "deptId");
- // column.dicData = res.data.data;
- // });
- // getPostList(tenantId).then((res) => {
- // const column = this.findObject(this.option.group, "postId");
- // column.dicData = res.data.data;
- // });
- },
- submitRole () {
- const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
- grant(this.ids, roleList).then(() => {
- this.roleBox = false;
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.onLoad(this.page);
- });
- },
- //制证申请
- handleSecurityApply () {
- if (this.choiceList.length === 0) {
- this.$message.warning("请勾选至少一位持证保安员");
- return;
- }
- this.$confirm("共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- let cho = this.choiceList;
- let str = "";
- for (let k in cho) {
- str += cho[k].id;
- if (k != cho.length - 1) {
- str += ",";
- }
- }
- const data = {
- ids: str,
- createUser: this.userInfo.user_id
- }
- return securityApply(data);
- })
- .then(() => {
- // this.$refs.crud.toggleSelection();
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- rowSave (row, done, loading) {
- if (row.deptId) {
- row.deptId = row.deptId;
- }
- if (row.roleId) {
- row.roleId = row.roleId.join(",");
- }
- if (row.postId) {
- row.postId = row.postId.join(",");
- }
-
- const userMap = {
- user: {
- account: row.account,
- avatar: row.avatar,
- fingerprint: row.fingerprint,
- healstats: row.healstats,
- address: row.address,
- birthday: row.birthday,
- cardid: row.cardid,
- deptId: row.deptId,
- education: row.education1,
- email: row.email,
- height: row.height,
- hold: row.hold,
- jurisdiction: row.jurisdiction,
- myPicture: row.myPicture,
- name: row.name,
- nation: row.nation,
- nativeplace: row.nativeplace,
- password: row.password,
- password2: row.password2,
- phone: row.phone,
- politicaloutlook: row.politicaloutlook,
- realName: row.realName,
- registered: row.registered,
- rtime: row.rtime,
- securitynumber: row.securitynumber,
- sex: row.sex,
- },
- };
-
- securitySave(userMap).then(
- () => {
- this.initFlag = false;
- this.$alert("账号为身份证号码,密码为身份证后六位", "温馨提示", {
- confirmButtonText: "确定",
- callback: (action) => {
- this.$message({
- type: "success",
- message: `操作成功`,
- });
- this.onLoad(this.page);
- done();
- },
- });
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- },
- rowUpdate (row, index, done, loading) {
- row.deptId = row.deptId;
- row.roleId = row.roleId.join(",");
- row.postId = row.postId.join(",");
- //值替换,education 放在页面会卡死
- row.education = row.education1;
- update(row).then(
- () => {
- this.initFlag = false;
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- },
- rowDellook (row) {
- this.$alert(
- row.reasonForLeav == "" ? "未填写" : row.reasonForLeav,
- "离职原因",
- {
- confirmButtonText: "确定",
- callback: (action) => { },
- }
- );
- },
- rowStatus (row) {
- this.$prompt("离职原因", "提示", {
- confirmButtonText: "确定离职",
- cancelButtonText: "取消",
- inputErrorMessage: "",
- })
- .then(({ value }) => {
- row.reasonForLeav = value;
- row.status = "2";
- // return;
- update(row).then((res) => {
- this.$message({
- type: "success",
- message: "操作成功",
- });
- });
- this.refreshChange();
- })
- .catch(() => { });
- },
- rowDel (row) {
- this.$confirm("确定注销当前用户?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- rowCheck (row) {
- this.$confirm("确定审查异常标记?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- row.examinationType = "1";
- return update(row);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- searchReset () {
- this.query = {};
- this.treeDeptId = "";
- this.onLoad(this.page);
- },
- searchChange (params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange (list) {
- // this.selectionList = list;
- this.choiceList = [];
- for (let k in list) {
- this.choiceList.push({
- id: list[k].id,
- });
- }
- },
- selectionClear () {
- // this.selectionList = [];
- // this.$refs.crud.toggleSelection();
- },
- handleDelete () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择保安注销?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.$refs.crud.toggleSelection();
- });
- },
- handleReset () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择账号密码重置为123456?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return resetPassword(this.ids);
- })
- .then(() => {
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.$refs.crud.toggleSelection();
- });
- },
- handleGrant () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.roleTreeObj = [];
- if (this.selectionList.length === 1) {
- this.roleTreeObj = this.selectionList[0].roleId.split(",");
- }
- getRoleTree().then((res) => {
- this.roleGrantList = res.data.data;
- this.roleBox = true;
- });
- },
- handlePlatform () {
- this.platformBox = true;
- },
- handleImport () {
- this.excelBox = true;
- },
- uploadAfter (res, done, loading, column) {
- window.console.log(column);
- this.excelBox = false;
- this.refreshChange();
- done();
- },
- handleExport () {
- this.$confirm("是否导出保安数据?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- window.open(
- `/api/blade-user/export-user?${this.website.tokenHeader
- }=${getToken()}&account=${this.search.account}&realName=${this.search.realName
- }`
- );
- });
- },
- handleTemplate () {
- window.open(
- `/api/blade-user/export-template?${this.website.tokenHeader
- }=${getToken()}`
- );
- },
- beforeOpen (done, type) {
- var that = this;
- if (["edit", "view"].includes(type)) {
- getUser(this.form.id).then((res) => {
- this.form = res.data.data;
- var d = {
- education1: res.data.data.education,
- };
- this.form = {
- ...this.form,
- ...d,
- };
- // this.from["education1"] = res.data.data.education;
- if (this.form.hasOwnProperty("deptId")) {
- this.form.deptId = this.form.deptId;
- }
- if (this.form.hasOwnProperty("roleId")) {
- this.form.roleId = this.form.roleId.split(",");
- }
- if (this.form.hasOwnProperty("postId")) {
- this.form.postId = this.form.postId.split(",");
- }
- var userInfo = res.data.data;
- //获取用户从业信息
- getUserPractitionersInfo(userInfo.id).then((res1) => {
- that.form.UserPractitionersInfo = res1.data.data;
- });
- });
- }
- this.initFlag = true;
- done();
- },
- currentChange (currentPage) {
- this.page.currentPage = currentPage;
- },
- //行样式调整
- rowStyle ({ row, column, rowIndex }) {
- if (row.examinationType == "1") {
+ }
+ };
+ const validatePassPhone = (rule, value, callback) => {
+ var test = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/g;
+ if (!test.test(value)) {
+ callback(new Error("请输入正确手机号码"));
+ } else {
+ callback();
+ }
+ };
+ return {
+ // 指纹数据
+ isopen: false, //识别是否需要传指纹进去(解决异步传递后指纹DOM不存在的问题)
+ zhiwenImg: "",
+ zhiwenChart: "",
+ zhiwenTitle: "开始采集",
+ Client: "", //实例化指纹采集类合集
+ isOr: true,
+ begin_cap: false,
+ RAWzhiwen: "",
+ yuzhi: 60, //指纹获取结束阈值
+ // 指纹数据
+ certificateYear: null,
+ certificateMonth: null,
+ certificateFlag: false,
+ certificateObj: {
+ realName: "",
+ securitynumber: "",
+ cardid: "",
+ registered: "",
+ },
+ securityid: "",
+ excelBox1: false,
+ excelBox2: false,
+ isSecurity: true,
+ excelForm1: {},
+ excelOption1: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "文件上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "文件上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user?deptId=" + this.deptIds,
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ excelForm2: {},
+ excelOption2: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "文件上传",
+ prop: "file",
+ type: "upload",
+ drag: true,
+ loadText: "文件上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
+ action: "/api/blade-resource/oss/endpoint/put-file-zip",
+ },
+ ],
+ },
+ form: {},
+ search: {},
+ roleBox: false,
+ excelBox: false,
+ platformBox: false,
+ initFlag: true,
+ selectionList: [],
+ query: {},
+ loading: true,
+ platformLoading: false,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ roleId: "1412226235153731586",
+ deptId: "1413470343230877697",
+ deptIds: "",
+ platformPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ init: {
+ roleTree: [],
+ deptTree: [],
+ },
+ props: {
+ label: "title",
+ value: "key",
+ },
+ roleGrantList: [],
+ roleTreeObj: [],
+ treeDeptId: "",
+ treeData: [],
+ treeOption: {
+ nodeKey: "id",
+ lazy: true,
+ treeLoad: function (node, resolve) {
+ const parentId = node.level === 0 ? 0 : node.data.id;
+ getDeptLazyTree(parentId).then((res) => {
+ resolve(
+ res.data.data.map((item) => {
return {
- color: "#ff2727",
+ ...item,
+ leaf: !item.hasChildren,
};
- }
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange () {
- this.onLoad(this.page, this.query);
- },
- onLoad (page, params = {}) {
- params = this.search;
- var that = this;
- //获取当前登录人员的角色信息
- var roleIds = this.userInfo.role_id.split(",");
- roleIds.forEach((roleId) => {
- getRoleDetail(roleId).then((res) => {
- var roleAlias = res.data.data.roleAlias;
- if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
- //去除保安公司查询
- const column = that.findObject(that.option.column, "deptId");
- column.search = false;
- const deptColumn = that.findObject(that.option.group, "deptId");
- deptColumn.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
- //禁止编辑
- deptColumn.disabled = true;
- deptColumn.value = that.userInfo.dept_id;
- that.isSecurity = false;
- //如果是保安公司管理员
- params["deptId"] = that.userInfo.dept_id;
-
- //导入action 修改
- const importColumn = that.findObject(
- that.excelOption1.column,
- "excelFile"
- );
- importColumn.action =
- "/api/blade-user/import-user?deptId=" + this.deptIds;
- } else if (roleAlias == "公安管理员") {
- params["jurisdiction"] = that.userInfo.jurisdiction;
- var columnDept = that.findObject(that.option.column, "deptId");
- columnDept.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
- that.userInfo.jurisdiction;
- var ColumnDeptUpdate = that.findObject(that.option.group, "deptId");
- ColumnDeptUpdate.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
- that.userInfo.jurisdiction;
- } else if (roleAlias == "培训公司管理员") {
- //如果是保安公司管理员
- params["trainingUnitId"] = that.userInfo.dept_id;
- var columnDept2 = that.findObject(that.option.column, "deptId");
- columnDept2.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
- var ColumnDeptUpdate2 = that.findObject(
- that.option.group,
- "deptId"
- );
- ColumnDeptUpdate2.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
- } else {
- var columnDept1 = that.findObject(that.option.column, "deptId");
- columnDept1.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
- var ColumnDeptUpdate1 = that.findObject(
- that.option.group,
- "deptId"
- );
- ColumnDeptUpdate1.dicUrl =
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
- }
-
- let values = {
- ...params,
- };
- values = {
- ...params,
- roleAlias: "111",
- ...that.query,
- };
-
- that.loading = true;
- getList(page.currentPage, page.pageSize, values).then((res) => {
- const data = res.data.data;
- that.page.total = data.total;
- var d = data.records;
- var date = new Date();
- var datayear = date.getFullYear();
- for (const key in d) {
- var year = d[key].cardid.slice(6, 10);
- d[key]["age"] = +datayear - +year;
- // d[key].securitynumber = "赣洪202100009";
- }
- that.data = data.records;
- that.loading = false;
- that.selectionClear();
- });
- });
- });
- },
- platformRowUpdate (row, index, done, loading) {
- updatePlatform(row.id, row.userType, row.userExt).then(
- () => {
- this.platformOnLoad(this.platformPage);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
+ })
);
+ });
},
- platformBeforeOpen (done, type) {
- if (["edit", "view"].includes(type)) {
- getUserPlatform(this.platformForm.id).then((res) => {
- this.platformForm = res.data.data;
- });
- }
- done();
+ addBtn: false,
+ menu: false,
+ size: "small",
+ props: {
+ labelText: "标题",
+ label: "title",
+ value: "value",
+ children: "children",
},
- platformSearchReset () {
- this.platformQuery = {};
- this.platformOnLoad(this.platformPage);
+ },
+ choiceList: [],
+ option: {
+ height: "auto",
+ calcHeight: 80,
+ tip: true,
+ searchShow: true,
+ reserveSelection: true,
+ selectable: (row) => {
+ if (row.hold !== "1") {
+ return false;
+ } else {
+ return true;
+ }
},
- platformSearchChange (params, done) {
- this.platformQuery = params;
- this.platformPage.currentPage = 1;
- this.platformOnLoad(this.platformPage, params);
- done();
- },
- platformSelectionChange (list) {
- this.platformSelectionList = list;
- },
- platformSelectionClear () {
- this.platformSelectionList = [];
- this.$refs.platformCrud.toggleSelection();
- },
- platformCurrentChange (currentPage) {
- this.platformPage.currentPage = currentPage;
- },
- platformSizeChange (pageSize) {
- this.platformPage.pageSize = pageSize;
- },
- platformRefreshChange () {
- this.platformOnLoad(this.platformPage, this.platformQuery);
- },
- platformOnLoad (page, params = {}) {
- this.platformLoading = true;
- getList(
- page.currentPage,
- page.pageSize,
- Object.assign(params, this.query),
- this.treeDeptId
- ).then((res) => {
- const data = res.data.data;
- this.platformPage.total = data.total;
- this.platformData = data.records;
- this.platformLoading = false;
- this.selectionClear();
- });
- },
+ indexWidth: 55,
+ searchMenuSpan: 6,
+ stripe: true,
+ border: true,
+ delBtn: true,
+ align: "center",
+ index: true,
+ delBtnText: "注销",
+ menuWidth: 327,
+ selection: true,
+ viewBtn: true,
+ defaultExpandAll: true,
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ column: securityFormPageColumn,
+ group: [
+ {
+ label: "基础信息",
+ labelWidth: "110",
+ prop: "baseInfo",
+ icon: "el-icon-user-solid",
+ column: [
+ {
+ label: "所属保安公司",
+ prop: "deptId",
+ type: "tree",
+ // dicUrl:
+ // "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ // disabled: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择保安公司",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "姓名",
+ prop: "realName",
+ rules: [
+ {
+ required: true,
+ message: "请输入姓名",
+ trigger: "blur",
+ },
+ {
+ min: 2,
+ max: 5,
+ message: "姓名长度在2到5个字符",
+ },
+ ],
+ },
+ // {
+ // label: "登录账号",
+ // prop: "account",
+ // editDisabled: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入登录账号",
+ // trigger: "blur",
+ // },
+ // ],
+ // // disabled: true,
+ // },
+ // {
+ // label: "密码",
+ // prop: "password",
+ // type: "password",
+ // hide: true,
+ // editDisplay: false,
+ // viewDisplay: false,
+ // rules: [
+ // { required: true, validator: validatePass, trigger: "blur" },
+ // ],
+ // },
+ // {
+ // label: "确认密码",
+ // prop: "password2",
+ // type: "password",
+ // hide: true,
+ // editDisplay: false,
+ // viewDisplay: false,
+ // rules: [
+ // { required: true, validator: validatePass2, trigger: "blur" },
+ // ],
+ // },
+ ],
+ },
+ {
+ label: "详细信息",
+ prop: "detailInfo",
+ labelWidth: "110",
+ icon: "el-icon-s-order",
+ column: [
+ {
+ label: "身份证号",
+ prop: "cardid",
+ hide: true,
+ overHidden: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入身份证号",
+ trigger: "blur",
+ },
+ {
+ required: true,
+ validator: validatePassCardid,
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "手机号码",
+ prop: "phone",
+ overHidden: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入手机号",
+ trigger: "blur",
+ },
+ {
+ required: true,
+ validator: validatePassPhone,
+ trigger: "blur",
+ },
+ ],
+ },
+ // {
+ // label: "昵称",
+ // prop: "name",
+ // },
+ {
+ label: "个人照片",
+ type: "upload",
+ listType: "picture-img",
+ propsHttp: {
+ res: "data",
+ url: "url",
+ },
+ canvasOption: {
+ text: " ",
+ ratio: 0.1,
+ },
+ action: "/api/blade-resource/oss/endpoint/put-files",
+ tip: "上传二代身份证一寸近期彩色正面免冠图象, (358像素(宽) × 441像素(高)、分辨率350dpi)且不超过500kb",
+ span: 12,
+ // row: true,
+ prop: "avatar",
+ },
+ {
+ label: "指纹信息",
+ // type: "upload",
+ // listType: "picture-img",
+ // propsHttp: {
+ // res: "data",
+ // url: "url",
+ // },
+ // canvasOption: {
+ // text: " ",
+ // ratio: 0.1,
+ // },
+ // action: "/api/blade-resource/oss/endpoint/put-files",
+ // tip: "只能上传jpg/png指纹信息,且不超过500kb",
+ span: 12,
+ // row: true,
+ prop: "fingerprint",
+ },
+ // {
+ // label: "指纹信息",
+ // type: "upload",
+ // listType: "picture-img",
+ // propsHttp: {
+ // res: "data",
+ // url: "url",
+ // },
+ // canvasOption: {
+ // text: " ",
+ // ratio: 0.1,
+ // },
+ // action: "/api/blade-resource/oss/endpoint/put-files",
+ // tip: "只能上传jpg/png指纹信息,且不超过500kb",
+ // span: 12,
+ // // row: true,
+ // prop: "fingerprint",
+ // },
+ {
+ label: "是否持证",
+ prop: "hold",
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
+ // props: {
+ // label: "dictValue",
+ // value: "dictKey",
+ // },
+ type: "select",
+ dicData: [
+ {
+ label: "是",
+ value: "1",
+ },
+ {
+ label: "否",
+ value: "2",
+ },
+ {
+ label: "已吊销",
+ value: "3",
+ },
+ ],
+ rules: [
+ {
+ required: true,
+ message: "请选择",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "保安员证编号",
+ prop: "securitynumber",
+ hide: true,
+ },
+ // {
+ // label: "发证日期",
+ // prop: "paperTime",
+ // hide: true,
+ // type: "date",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // },
+ {
+ label: "电子邮箱",
+ prop: "email",
+ },
+ // {
+ // label: "籍贯",
+ // prop: "nativeplace",
+ // },
+ {
+ label: "民族",
+ prop: "nation",
+ },
+ {
+ label: "最高学历",
+ prop: "education1",
+ type: "select",
+ dicUrl:
+ "/api/blade-system/dict-biz/dictionary?code=educationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ slot: true,
+ },
+ {
+ label: "政治面貌",
+ prop: "politicaloutlook",
+ },
+ {
+ label: "健康状态",
+ prop: "healstats",
+ },
+ {
+ label: "身高",
+ prop: "height",
+ },
+ {
+ label: "联系地址",
+ prop: "address",
+ },
+ {
+ label: "住址",
+ prop: "registered",
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入住址",
+ // trigger: "click",
+ // },
+ // ],
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ // multiple: true,
+ type: "tree",
+ dicUrl: "/api/jurisdiction/lazy-tree",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ checkStrictly: true,
+ slot: true,
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "入职时间",
+ prop: "rtime",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入入职时间",
+ // trigger: "click",
+ // },
+ // ],
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ slot: true,
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ // {
+ // label: "未知",
+ // value: 3,
+ // },
+ ],
+ rules: [
+ {
+ required: true,
+ message: "请选择性别",
+ trigger: "blur",
+ },
+ ],
+ },
+ // {
+ // label: "生日",
+ // type: "date",
+ // prop: "birthday",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // },
+ ],
+ },
+ ],
+ },
+ data: [],
+ platformQuery: {},
+ platformSelectionList: [],
+ platformData: [],
+ platformForm: {},
+ platformOption: {
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ dialogClickModal: false,
+ menuWidth: 120,
+ editBtnText: "配置",
+ column: [
+ {
+ label: "登录账号",
+ prop: "account",
+ search: true,
+ display: false,
+ },
+ {
+ label: "所属保安单位",
+ prop: "tenantName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "姓名",
+ prop: "realName",
+ search: true,
+ display: false,
+ },
+ {
+ label: "平台",
+ prop: "userTypeName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "平台",
+ type: "select",
+ dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ search: true,
+ hide: true,
+ display: false,
+ prop: "userType",
+ rules: [
+ {
+ required: true,
+ message: "请选择平台",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "拓展",
+ prop: "userExt",
+ type: "textarea",
+ minRows: 8,
+ span: 24,
+ overHidden: true,
+ row: true,
+ hide: true,
+ },
+ ],
+ },
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "模板上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "模板上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user",
+ },
+ // {
+ // label: "数据覆盖",
+ // prop: "isCovered",
+ // type: "switch",
+ // align: "center",
+ // width: 80,
+ // dicData: [
+ // {
+ // label: "否",
+ // value: 0,
+ // },
+ // {
+ // label: "是",
+ // value: 1,
+ // },
+ // ],
+ // value: 0,
+ // slot: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择是否覆盖",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ };
+ },
+ watch: {
+ "form.tenantId"() {
+ if (this.form.tenantId !== "" && this.initFlag) {
+ this.initData(this.form.tenantId);
+ }
},
+ "form.fingerprint"() {
+ let that = this;
+ if (this.form.fingerprint != undefined) {
+ that.isopen = true;
+ let isoks = false;
+ function sets(state, fingerprint, myPicture) {
+ isoks = state;
+ var winzhiwen = document.getElementById("zhiwen").contentWindow;
+ winzhiwen.setZhiwenData({
+ imgBMP: fingerprint,
+ // imgBMP: imgBMP,
+ // CID_img_raw: CID_img_raw,
+ featuredatas: myPicture,
+ isoks: isoks,
+ });
+ }
+ setTimeout(() => {
+ // if()
+ if (!this.form.id) {
+ sets(false);
+ return;
+ }
+ // return;
+ getzhiwen(this.form.id).then((res) => {
+ const data = res.data.data;
+ if (that.isopen) {
+ if (
+ data.fingerprint != "" &&
+ data.fingerprint != undefined &&
+ data.myPicture != "" &&
+ data.myPicture != undefined
+ ) {
+ sets(true, data.fingerprint, data.myPicture);
+ } else {
+ sets(false);
+ }
+ }
+ });
+ }, 1800);
+ } else {
+ that.isopen = false;
+ }
+ },
+ "form.deptId"() {
+ this.initData(this.form.tenantId);
+ },
+ "excelForm.isCovered"() {
+ if (this.excelForm.isCovered !== "") {
+ const column = this.findObject(this.excelOption.column, "excelFile");
+ column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
+ }
+ },
+ },
+ computed: {
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.securityGuard_add, false),
+ viewBtn: this.vaildData(null, false),
+ delBtn: this.vaildData(this.permission.securityGuard_delete, false),
+ editBtn: this.vaildData(this.permission.securityGuard_edit, false),
+ };
+ },
+ platformPermissionList() {
+ return {
+ addBtn: false,
+ viewBtn: false,
+ delBtn: false,
+ editBtn: this.vaildData(this.permission.user_edit, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ ...mapState({
+ userInfo: (state) => state.user.userInfo,
+ }),
+ },
+ beforeCreate() {},
+ created() {
+ console.log(this.userInfo.role_name, 123541);
+ if (this.userInfo.role_name == "办证管理员") {
+ console.log(this.userInfo.role_name, 5555225);
+ this.search["userType"] = 7;
+ }
+ },
+ mounted() {
+ // this.option.column[0].hide = true
+ // 非保安单位模式默认加载管理组数据
+ if (!website.tenantMode) {
+ this.initData(website.tenantId);
+ }
+ this.search["status"] = 1;
+ if (this.userInfo.roleName == "办证管理员") {
+ this.search["userType"] = 7;
+ }
+ this.deptIds = this.userInfo.dept_id;
+
+ // this.beginzhiwen();
+ },
+ methods: {
+ openccc() {
+ console.log(this.zhiwenImg);
+ // console.log(this.zhiwenChart);
+ // this.Client.CID_Alg_FeatureExtract(
+ // //99是获取特征
+ // // ID_FingerPosition.UNKNOWN,
+ // 99,
+ // this.RAWzhiwen
+ // );
+ // console.log(this.RAWzhiwen);
+ },
+ beginzhiwen() {
+ //初始化指纹采集系统
+ let that = this;
+ this.Client = new Client(); //实例化指纹采集类
+ //添加指纹消息提醒
+ //初始化设备
+ this.Client.beginFn = {
+ fn: this.Client.CID_Init,
+ CID5000: this.Client.CIDDeviceType.CID5000,
+ };
+ this.Client.OnCID_Alg_Begin = function (code, msg) {
+ //初始化机器返数据
+ if (code == 1) {
+ console.log("初始化成功");
+ that.zhiwenTitle = "选定指纹";
+ that.isOr = false;
+ that.beginUseImg(); //开始预览指纹
+ } else {
+ that.closezhiwen();
+ alert("设备被占用或发生不可预料原因 错误码:" + code);
+ console.log("算法初始化发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Close = function (code, msg) {
+ //关闭机器返数据
+ if (code == 1) {
+ console.log("关闭设备成功");
+ that.Client.CID_Alg_FeatureExtract(
+ //99是获取特征
+ // ID_FingerPosition.UNKNOWN,
+ 99,
+ that.RAWzhiwen
+ );
+ that.zhiwenTitle = "开始采集";
+ that.isOr = true;
+ } else {
+ console.log("关闭设备发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_BeginCapture = function (code, msg) {
+ //开始使用预览图片模式函数
+ // console.log(code, "图片模式开始");
+ if (code == 1) {
+ that.Client.CID_GetFPBmpData(0);
+ } else {
+ console.log("开始采集发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_GetBmpData = function (code, msg, imagedata, feadata) {
+ //使用预览图片模式 采集 BMP格式
+ // console.log(msg, "图片模式采集");
+ if (code == 1) {
+ that.zhiwenImg = "data:image/bmp;base64," + imagedata;
+ if (that.begin_cap) {
+ that.Client.BmpToRaw(imagedata, 256, 360);
+ }
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ console.log("采集发生错误 错误码:" + code);
+ }
+ };
+ // this.Client.OnBmpToRaw = function (code, msg, imagedata) {
+ // //使用预览图片模式 BMP格式转换成RAW
+ // // console.log(code, msg, "BMP格式转换成RAW");
+ // // console.log(imagedata, "BMP格式转换成RAW");
+ // if (code == 0) {
+ // that.RAWzhiwen = imagedata;
+ // // console.log(imagedata);
+ // that.Client.CID_Alg_GetQualityScore(imagedata);
+ // } else {
+ // that.Client.CID_EndCapture(0);
+ // that.begin_cap = false;
+ // console.log("格式转换失败," + code + " " + msg);
+ // }
+ // };
+ this.Client.OnBmpToRaw = function (code, msg, imagedata) {
+ //使用预览图片模式 BMP格式转换成RAW
+ // console.log(code, msg, "BMP格式转换成RAW");
+ if (code == 0) {
+ that.Client.CID_Alg_GetQualityScore(imagedata);
+ // console.log(imagedata);
+ that.RAWzhiwen = imagedata;
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ alert("格式转换失败," + code + " " + msg);
+ }
+ };
+ this.Client.OnCID_EndCapture = function (code, msg) {
+ //使用预览图片模式 停止采集
+ if (code == 1) {
+ if (that.begin_cap) {
+ that.Client.CID_BeginCapture(0);
+ }
+ } else {
+ that.begin_cap = false;
+ console.log("停止采集发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Alg_GetQualityScore = function (code, msg, score) {
+ //停止获取
+ console.log(
+ "code:" + code + ";",
+ "msg:" + msg + ";",
+ "score:" + score + ";",
+ "传送RAW图片代码后返回值"
+ );
+ if (code == 1) {
+ if (score >= that.yuzhi) {
+ that.begin_cap = false;
+ that.Client.CID_EndCapture(0);
+ that.Client.CID_Alg_FeatureExtract(
+ //99是获取特征
+ // ID_FingerPosition.UNKNOWN,
+ 99,
+ that.RAWzhiwen
+ );
+ } else {
+ that.Client.CID_EndCapture(0);
+ }
+ } else if (code == -9) {
+ that.Client.CID_EndCapture(0);
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ // console.log("获取质量分数发生错误 错误码:" + code);
+ console.log("获取质量分数发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Alg_FeatureExtract = function (code, msg, featuredata) {
+ //获取特征
+ if (code == 1) {
+ that.zhiwenChart = featuredata;
+ console.log("特征提取成功");
+ console.log("特征提取成功", that.zhiwenChart);
+ } else {
+ console.log("特征提取发生错误 错误码:" + code);
+ }
+ };
+ },
+ openzhiwen() {
+ // 连接指纹助手
+ this.Client.Connect_Server(); //成功后台打印Connect Success
+ //成功后将自动初始化设备
+ //若不成功将重复2秒计时重连设备
+ },
+ closezhiwen() {
+ // 关闭指纹设备
+ if (!this.Client.isConnect) {
+ console.log("助手程序未连接");
+ return;
+ }
+ this.Client.CID_Close();
+ },
+ beginUseImg() {
+ //开始预览图片
+ if (!this.Client.isConnect) {
+ alert("助手程序未连接");
+ return;
+ }
+ this.begin_cap = true;
+ this.Client.CID_BeginCapture(0);
+ },
+ handleImport1() {
+ this.excelBox1 = true;
+ },
+ uploadAfter1(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox1 = false;
+ this.refreshChange();
+ done();
+ },
+ handleTemplate1() {
+ window.open(`/api/blade-user/export-template-security`);
+ },
+ handleImport2() {
+ this.excelBox2 = true;
+ },
+ uploadAfter2(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox2 = false;
+ this.refreshChange();
+ done();
+ },
+
+ //行点击事件
+ rowClick(row) {
+ this.$router.push({
+ path: "/securityGuardDetail",
+ query: { row: JSON.stringify(row) },
+ });
+ },
+ //行点击事件
+ certificateClick(row) {
+ if (row) {
+ var time = this.getNewTime();
+ this.certificateYear = time[0];
+ this.certificateMonth = time[1];
+ this.certificateObj = row;
+ setTimeout(() => {
+ this.Print();
+ }, 500);
+ }
+ },
+ Print() {
+ if (
+ this.certificateObj.registered == "" ||
+ this.certificateObj.registered == null
+ ) {
+ this.$message({ message: "请完善住址信息", type: "warning" });
+ return;
+ }
+ //更新发证时间
+ var printDom = document.getElementById("certificateDom");
+ printDom.style.position = "absolute";
+ printDom.style.top = "-25.0%";
+ printDom.style.left = "-23%";
+ printDom.style.width = "120%";
+ printDom.style.height = "100%";
+ printDom.style.fontFamily = "SimSun";
+
+ this.$print("#certificateDom", {
+ noPrint: ".noPrint",
+ onStart: () => {
+ // console.log('打印开始', Date.parse(new Date()));
+ },
+ onEnd: () => {
+ this.updateUserInfo();
+ // console.log('打印完成', Date.parse(new Date()));
+ },
+ });
+ },
+ getNewTime() {
+ var nowTime = new Date();
+
+ var oneHoursAgo = new Date(
+ new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
+ );
+ var oneHoursAgoY = oneHoursAgo.getFullYear();
+ var oneHoursAgoM =
+ oneHoursAgo.getMonth() + 1 < 10
+ ? "0" + (oneHoursAgo.getMonth() + 1)
+ : oneHoursAgo.getMonth() + 1;
+
+ /**
+ * @return 返回1小时,2小时,3小时,4小时,24小时
+ */
+ return [oneHoursAgoY, oneHoursAgoM];
+ },
+ //更新用户发证时间
+ updateUserInfo() {
+ var nowTime = new Date();
+ var oneHoursAgo = new Date(
+ new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
+ );
+ var oneHoursAgoY = oneHoursAgo.getFullYear();
+ var oneHoursAgoM =
+ oneHoursAgo.getMonth() + 1 < 10
+ ? "0" + (oneHoursAgo.getMonth() + 1)
+ : oneHoursAgo.getMonth() + 1;
+ var day = oneHoursAgo.getDay();
+ var date = oneHoursAgoY + "-" + oneHoursAgoM + "-" + day;
+ const data = {
+ id: this.certificateObj.id,
+ userType: 6,
+ paperTime: date,
+ };
+ updatePaperTime(data);
+ },
+ rowClickSelf(row) {
+ this.$router.push({
+ path: "/securityUnitChild",
+ query: { fromSecunityGuardId: row },
+ });
+ },
+ nodeClick(data) {
+ this.treeDeptId = data.id;
+ this.page.currentPage = 1;
+ this.onLoad(this.page);
+ },
+ initData(tenantId) {
+ // getRoleTree(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "roleId");
+ // column.dicData = res.data.data;
+ // });
+ // getDeptTree(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "deptId");
+ // column.dicData = res.data.data;
+ // });
+ // getPostList(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "postId");
+ // column.dicData = res.data.data;
+ // });
+ },
+ submitRole() {
+ const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
+ grant(this.ids, roleList).then(() => {
+ this.roleBox = false;
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.onLoad(this.page);
+ });
+ },
+ //制证申请
+ handleSecurityApply() {
+ if (this.choiceList.length === 0) {
+ this.$message.warning("请勾选至少一位持证保安员");
+ return;
+ }
+ this.$confirm(
+ "共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?",
+ {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }
+ )
+ .then(() => {
+ let cho = this.choiceList;
+ let str = "";
+ for (let k in cho) {
+ str += cho[k].id;
+ if (k != cho.length - 1) {
+ str += ",";
+ }
+ }
+ const data = {
+ ids: str,
+ createUser: this.userInfo.user_id,
+ };
+ return securityApply(data);
+ })
+ .then(() => {
+ // this.$refs.crud.toggleSelection();
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ rowSave(row, done, loading) {
+ // var dom = document.getElementById("zhiwenOur");
+ // window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click();
+ var winzhiwen = document.getElementById("zhiwen").contentWindow;
+ let zhiwen = winzhiwen.outZhiwenData();
+ // console.log(zhiwen);
+ // for (let k in zhiwen) {
+ // console.log(k);
+ // console.log(zhiwen[k]);
+ // }
+ // return;
+ if (row.deptId) {
+ row.deptId = row.deptId;
+ }
+ if (row.roleId) {
+ row.roleId = row.roleId.join(",");
+ }
+ if (row.postId) {
+ row.postId = row.postId.join(",");
+ }
+ const userMap = {
+ user: {
+ //指纹↓
+ fingerprint: zhiwen.imgBMP, //图
+ myPicture: zhiwen.featuredata, //特征
+ //指纹↑
+ account: row.account,
+ avatar: row.avatar,
+ // fingerprint: row.fingerprint,
+ healstats: row.healstats,
+ address: row.address,
+ birthday: row.birthday,
+ cardid: row.cardid,
+ deptId: row.deptId,
+ education: row.education1,
+ email: row.email,
+ height: row.height,
+ hold: row.hold,
+ jurisdiction: row.jurisdiction,
+ // myPicture: row.myPicture,
+ name: row.name,
+ nation: row.nation,
+ nativeplace: row.nativeplace,
+ password: row.password,
+ password2: row.password2,
+ phone: row.phone,
+ politicaloutlook: row.politicaloutlook,
+ realName: row.realName,
+ registered: row.registered,
+ rtime: row.rtime,
+ securitynumber: row.securitynumber,
+ sex: row.sex,
+ },
+ };
+
+ securitySave(userMap).then(
+ () => {
+ this.initFlag = false;
+ this.$alert("账号为身份证号码,密码为身份证后六位", "温馨提示", {
+ confirmButtonText: "确定",
+ callback: (action) => {
+ this.$message({
+ type: "success",
+ message: `操作成功`,
+ });
+ this.onLoad(this.page);
+ done();
+ },
+ });
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ row.deptId = row.deptId;
+ row.roleId = row.roleId.join(",");
+ row.postId = row.postId.join(",");
+ //值替换,education 放在页面会卡死
+ row.education = row.education1;
+
+ var winzhiwen = document.getElementById("zhiwen").contentWindow;
+ let zhiwen = winzhiwen.outZhiwenData();
+ // console.log(zhiwen);
+ if (zhiwen.isoks) {
+ row.fingerprint = zhiwen.imgBMP;
+ row.myPicture = zhiwen.featuredata;
+ }
+ // console.log(row);
+ // return;
+ update(row).then(
+ () => {
+ this.initFlag = false;
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowDellook(row) {
+ this.$alert(
+ row.reasonForLeav == "" ? "未填写" : row.reasonForLeav,
+ "离职原因",
+ {
+ confirmButtonText: "确定",
+ callback: (action) => {},
+ }
+ );
+ },
+ rowStatus(row) {
+ this.$prompt("离职原因", "提示", {
+ confirmButtonText: "确定离职",
+ cancelButtonText: "取消",
+ inputErrorMessage: "",
+ })
+ .then(({ value }) => {
+ row.reasonForLeav = value;
+ row.status = "2";
+ // return;
+ update(row).then((res) => {
+ this.$message({
+ type: "success",
+ message: "操作成功",
+ });
+ });
+ this.refreshChange();
+ })
+ .catch(() => {});
+ },
+ rowDel(row) {
+ this.$confirm("确定注销当前用户?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ rowCheck(row) {
+ this.$confirm("确定审查异常标记?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ row.examinationType = "1";
+ return update(row);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ searchReset() {
+ this.query = {};
+ this.treeDeptId = "";
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ // this.selectionList = list;
+ this.choiceList = [];
+ for (let k in list) {
+ this.choiceList.push({
+ id: list[k].id,
+ });
+ }
+ },
+ selectionClear() {
+ // this.selectionList = [];
+ // this.$refs.crud.toggleSelection();
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择保安注销?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleReset() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择账号密码重置为123456?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return resetPassword(this.ids);
+ })
+ .then(() => {
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleGrant() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.roleTreeObj = [];
+ if (this.selectionList.length === 1) {
+ this.roleTreeObj = this.selectionList[0].roleId.split(",");
+ }
+ getRoleTree().then((res) => {
+ this.roleGrantList = res.data.data;
+ this.roleBox = true;
+ });
+ },
+ handlePlatform() {
+ this.platformBox = true;
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+ handleExport() {
+ this.$confirm("是否导出保安数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(
+ `/api/blade-user/export-user?${
+ this.website.tokenHeader
+ }=${getToken()}&account=${this.search.account}&realName=${
+ this.search.realName
+ }`
+ );
+ });
+ },
+ handleTemplate() {
+ window.open(
+ `/api/blade-user/export-template?${
+ this.website.tokenHeader
+ }=${getToken()}`
+ );
+ },
+ beforeOpen(done, type) {
+ var that = this;
+ if (["edit", "view"].includes(type)) {
+ getUser(this.form.id).then((res) => {
+ this.form = res.data.data;
+ var d = {
+ education1: res.data.data.education,
+ };
+ this.form = {
+ ...this.form,
+ ...d,
+ };
+ // this.from["education1"] = res.data.data.education;
+ if (this.form.hasOwnProperty("deptId")) {
+ this.form.deptId = this.form.deptId;
+ }
+ if (this.form.hasOwnProperty("roleId")) {
+ this.form.roleId = this.form.roleId.split(",");
+ }
+ if (this.form.hasOwnProperty("postId")) {
+ this.form.postId = this.form.postId.split(",");
+ }
+ var userInfo = res.data.data;
+ //获取用户从业信息
+ getUserPractitionersInfo(userInfo.id).then((res1) => {
+ that.form.UserPractitionersInfo = res1.data.data;
+ });
+ });
+ }
+ this.initFlag = true;
+ done();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ //行样式调整
+ rowStyle({ row, column, rowIndex }) {
+ if (row.examinationType == "1") {
+ return {
+ color: "#ff2727",
+ };
+ }
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ params = this.search;
+ var that = this;
+ //获取当前登录人员的角色信息
+ var roleIds = this.userInfo.role_id.split(",");
+ roleIds.forEach((roleId) => {
+ getRoleDetail(roleId).then((res) => {
+ var roleAlias = res.data.data.roleAlias;
+ if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
+ //去除保安公司查询
+ const column = that.findObject(that.option.column, "deptId");
+ column.search = false;
+ const deptColumn = that.findObject(that.option.group, "deptId");
+ deptColumn.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ //禁止编辑
+ deptColumn.disabled = true;
+ deptColumn.value = that.userInfo.dept_id;
+ that.isSecurity = false;
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+
+ //导入action 修改
+ const importColumn = that.findObject(
+ that.excelOption1.column,
+ "excelFile"
+ );
+ importColumn.action =
+ "/api/blade-user/import-user?deptId=" + this.deptIds;
+ } else if (roleAlias == "公安管理员") {
+ params["jurisdiction"] = that.userInfo.jurisdiction;
+ var columnDept = that.findObject(that.option.column, "deptId");
+ columnDept.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+ that.userInfo.jurisdiction;
+ var ColumnDeptUpdate = that.findObject(that.option.group, "deptId");
+ ColumnDeptUpdate.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+ that.userInfo.jurisdiction;
+ } else if (roleAlias == "培训公司管理员") {
+ //如果是保安公司管理员
+ params["trainingUnitId"] = that.userInfo.dept_id;
+ var columnDept2 = that.findObject(that.option.column, "deptId");
+ columnDept2.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ var ColumnDeptUpdate2 = that.findObject(
+ that.option.group,
+ "deptId"
+ );
+ ColumnDeptUpdate2.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ } else {
+ var columnDept1 = that.findObject(that.option.column, "deptId");
+ columnDept1.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ var ColumnDeptUpdate1 = that.findObject(
+ that.option.group,
+ "deptId"
+ );
+ ColumnDeptUpdate1.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ }
+
+ let values = {
+ ...params,
+ };
+ values = {
+ ...params,
+ roleAlias: "111",
+ ...that.query,
+ };
+
+ that.loading = true;
+ getList(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ that.page.total = data.total;
+ var d = data.records;
+ var date = new Date();
+ var datayear = date.getFullYear();
+ for (const key in d) {
+ var year = d[key].cardid.slice(6, 10);
+ d[key]["age"] = +datayear - +year;
+ // d[key].securitynumber = "赣洪202100009";
+ }
+ that.data = data.records;
+ that.loading = false;
+ that.selectionClear();
+ });
+ });
+ });
+ },
+ platformRowUpdate(row, index, done, loading) {
+ updatePlatform(row.id, row.userType, row.userExt).then(
+ () => {
+ this.platformOnLoad(this.platformPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ platformBeforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getUserPlatform(this.platformForm.id).then((res) => {
+ this.platformForm = res.data.data;
+ });
+ }
+ done();
+ },
+ platformSearchReset() {
+ this.platformQuery = {};
+ this.platformOnLoad(this.platformPage);
+ },
+ platformSearchChange(params, done) {
+ this.platformQuery = params;
+ this.platformPage.currentPage = 1;
+ this.platformOnLoad(this.platformPage, params);
+ done();
+ },
+ platformSelectionChange(list) {
+ this.platformSelectionList = list;
+ },
+ platformSelectionClear() {
+ this.platformSelectionList = [];
+ this.$refs.platformCrud.toggleSelection();
+ },
+ platformCurrentChange(currentPage) {
+ this.platformPage.currentPage = currentPage;
+ },
+ platformSizeChange(pageSize) {
+ this.platformPage.pageSize = pageSize;
+ },
+ platformRefreshChange() {
+ this.platformOnLoad(this.platformPage, this.platformQuery);
+ },
+ platformOnLoad(page, params = {}) {
+ this.platformLoading = true;
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query),
+ this.treeDeptId
+ ).then((res) => {
+ const data = res.data.data;
+ this.platformPage.total = data.total;
+ this.platformData = data.records;
+ this.platformLoading = false;
+ this.selectionClear();
+ });
+ },
+ },
};
</script>
<style lang="scss" scoped>
.box {
- height: 800px;
+ height: 800px;
}
.el-scrollbar {
- height: 100%;
+ height: 100%;
}
.box .el-scrollbar__wrap {
- overflow: scroll;
+ overflow: scroll;
}
.rowClickSelf {
- &:hover {
- cursor: pointer;
- }
+ &:hover {
+ cursor: pointer;
+ }
}
//保安证 本子
.certificate_box {
- width: 100%;
- height: 90%;
- background-color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- font: normal 18px 'SimSuncss' !important;
+ width: 100%;
+ height: 90%;
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ font: normal 18px "SimSuncss" !important;
}
.security_main {
- width: 630px;
- height: 512px;
- // border: 1px solid rgba($color: #a5a5a5, $alpha: 0.5);
- // display: flex;
- // align-items: center;
- // justify-content: space-around;
- // background-size: 100% 100%;
- // background-repeat: no-repeat;
- position: relative;
+ width: 630px;
+ height: 512px;
+ // border: 1px solid rgba($color: #a5a5a5, $alpha: 0.5);
+ // display: flex;
+ // align-items: center;
+ // justify-content: space-around;
+ // background-size: 100% 100%;
+ // background-repeat: no-repeat;
+ position: relative;
}
// 标题
$upTop: 45px;
$downTop: 265px; //整体高度
//经国家保安员考试审查合格。<br />特颁此证。
.security_main-title {
- position: absolute;
- top: $upTop;
- left: 34px;
- line-height: 45px;
- letter-spacing: 3px;
+ position: absolute;
+ top: $upTop;
+ left: 34px;
+ line-height: 45px;
+ letter-spacing: 3px;
}
//发证公安机关 (印章)
.security_m_l_center {
- position: absolute;
- top: 270px;
- left: 30px;
- line-height: 40px;
+ position: absolute;
+ top: 270px;
+ left: 30px;
+ line-height: 40px;
}
//证件编号
.security_m_l_down {
- position: absolute;
- top: 379px;
- left: 32px;
+ position: absolute;
+ top: 379px;
+ left: 32px;
}
$rightLeft: 343px;
@@ -1795,140 +2154,155 @@
$lineHigeht: 30px;
//姓名
.security_m_r_a {
- position: absolute;
- top: $downTop;
- left: $rightLeft;
- width: $rightWidth;
- text-align: justify;
- text-align-last: justify;
+ position: absolute;
+ top: $downTop;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
}
//出生年月
.security_m_r_b {
- position: absolute;
- top: $downTop + $lineHigeht * 1;
- left: $rightLeft;
- width: $rightWidth;
- text-align: justify;
- text-align-last: justify;
+ position: absolute;
+ top: $downTop + $lineHigeht * 1;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
}
//地址
.security_m_r_c {
- position: absolute;
- top: $downTop + $lineHigeht * 2;
- left: $rightLeft;
- width: $rightWidth;
- text-align: justify;
- text-align-last: justify;
+ position: absolute;
+ top: $downTop + $lineHigeht * 2;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
}
//公民身份证
.security_m_r_d {
- position: absolute;
- top: 363px;
- left: $rightLeft;
- width: $rightWidth;
- text-align: justify;
- text-align-last: justify;
+ position: absolute;
+ top: 363px;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
}
//照片
// width: calc(358px / 22px);
// height: calc(441px / 22px);
.security_m_r_imgs {
- width: calc(358px / 3);
- height: calc(441px / 3);
- position: absolute;
- top: $upTop;
- left: 421px;
- img {
- width: 100%;
- height: 100%;
- }
+ width: calc(358px / 3);
+ height: calc(441px / 3);
+ position: absolute;
+ top: $upTop;
+ left: 421px;
+ img {
+ width: 100%;
+ height: 100%;
+ }
}
// 内容
// 抬头名字
.security_m_l_titleName {
- position: absolute;
- top: 45px;
- left: 121px;
- right: 0;
- line-height: 45px;
- letter-spacing: 3px;
+ position: absolute;
+ top: 45px;
+ left: 121px;
+ right: 0;
+ line-height: 45px;
+ letter-spacing: 3px;
}
//发证时间
$timeTop: 312px; //整体高度
//年
.security_m_l_titlepaperTimenian {
- position: absolute;
- top: $timeTop;
- left: 109px;
- line-height: 40px;
+ position: absolute;
+ top: $timeTop;
+ left: 109px;
+ line-height: 40px;
}
//月
.security_m_l_titlepaperTimeyue {
- position: absolute;
- top: $timeTop;
- left: 168px;
- line-height: 40px;
+ position: absolute;
+ top: $timeTop;
+ left: 168px;
+ line-height: 40px;
}
//日
.security_m_l_titlepaperTimeri {
- position: absolute;
- top: $timeTop;
- left: 159px;
- line-height: 40px;
+ position: absolute;
+ top: $timeTop;
+ left: 159px;
+ line-height: 40px;
}
//证件编号
.security_m_l_downsecuritynumber {
- position: absolute;
- top: 386px; //整体高度
- left: 145px;
+ position: absolute;
+ top: 386px; //整体高度
+ left: 145px;
}
//内容
// 姓名
$centerLeft: 458px;
.security_m_r_o_right {
- position: absolute;
- top: $downTop + $lineHigeht * 0-2px;
- left: $centerLeft;
- // width: $rightWidth;
+ position: absolute;
+ top: $downTop + $lineHigeht * 0-2px;
+ left: $centerLeft;
+ // width: $rightWidth;
}
// 生日
.security_m_r_o_rightbirthday {
- position: absolute;
- top: $downTop + $lineHigeht * 1-4px;
- left: $centerLeft;
- // width: $rightWidth;
+ position: absolute;
+ top: $downTop + $lineHigeht * 1-4px;
+ left: $centerLeft;
+ // width: $rightWidth;
}
// 地址
.security_m_r_o_rightaddress {
- position: absolute;
- top: $downTop + $lineHigeht * 2 -6px;
- left: $centerLeft;
- width: 185px;
+ position: absolute;
+ top: $downTop + $lineHigeht * 2 -6px;
+ left: $centerLeft;
+ width: 185px;
}
// 身份证
.security_m_r_o_rightcardid {
- position: absolute;
- top: $downTop + $lineHigeht * 4 +10px;
- left: $centerLeft;
- // width: $rightWidth;
+ position: absolute;
+ top: $downTop + $lineHigeht * 4 +10px;
+ left: $centerLeft;
+ // width: $rightWidth;
}
//背景图
.security_main_backImge {
- position: absolute;
- width: 100%;
- height: 100%;
- background-image: url(/img/securityCertificate/bazsss.png);
- background-size: 100% 100%;
- background-repeat: no-repeat;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ background-image: url(/img/securityCertificate/bazsss.png);
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
}
-.security_m_r_o_jg{
- position: absolute;
- top: 267px;
- left: 210px;
- line-height: 40px;
- letter-spacing: 2px;
+.security_m_r_o_jg {
+ position: absolute;
+ top: 267px;
+ left: 210px;
+ line-height: 40px;
+ letter-spacing: 2px;
}
+.zhiwenMain {
+ width: 100%;
+ height: 305px;
+ // display: flex;
+ // align-items: center;
+ // justify-content: space-around;
+ // border: 1px solid red;
+}
+// .zhiwenImgs {
+// width: 178px;
+// height: 178px;
+// border-radius: 5px;
+// text-align: center;
+// border: 1px dashed #8c939d;
+// }
</style>
diff --git "a/src/views/securityGuard/securityGuard\346\214\207\347\272\271\350\207\252\345\212\250\350\257\206\345\210\253\357\274\210\351\233\206\346\210\220VUE\346\212\245\351\224\231\357\274\211-9.vue" "b/src/views/securityGuard/securityGuard\346\214\207\347\272\271\350\207\252\345\212\250\350\257\206\345\210\253\357\274\210\351\233\206\346\210\220VUE\346\212\245\351\224\231\357\274\211-9.vue"
new file mode 100644
index 0000000..3a4c06f
--- /dev/null
+++ "b/src/views/securityGuard/securityGuard\346\214\207\347\272\271\350\207\252\345\212\250\350\257\206\345\210\253\357\274\210\351\233\206\346\210\220VUE\346\212\245\351\224\231\357\274\211-9.vue"
@@ -0,0 +1,2226 @@
+<template>
+ <el-row :class="{ securityGuard: isSecurity }">
+ <el-col :span="0" style="display: none">
+ <div class="box">
+ <el-scrollbar>
+ <basic-container>
+ <avue-tree
+ :option="treeOption"
+ :data="treeData"
+ @node-click="nodeClick"
+ />
+ </basic-container>
+ </el-scrollbar>
+ </div>
+ </el-col>
+ <el-col :span="24">
+ <basic-container>
+ <avue-crud
+ :option="option"
+ :search.sync="search"
+ :table-loading="loading"
+ :data="data"
+ ref="crud"
+ v-model="form"
+ :permission="permissionList"
+ @row-del="rowDel"
+ :row-style="rowStyle"
+ @row-save="rowSave"
+ @row-update="rowUpdate"
+ :before-open="beforeOpen"
+ :page.sync="page"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <!-- @row-update="rowUpdate" -->
+ <template slot="menuLeft">
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ v-if="permission.securityGuard_import"
+ @click="handleImport1"
+ >保安员批量导入
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ v-if="permission.securityGuard_import"
+ @click="handleImport2"
+ >个人照片批量上传
+ </el-button>
+ <el-button
+ type="primary"
+ size="small"
+ plain
+ v-if="permission.securityGuard_security_apply"
+ icon="el-icon-s-promotion"
+ @click="handleSecurityApply"
+ >上岗证制证申请
+ </el-button>
+
+ <el-button
+ type="danger"
+ style="display: none"
+ size="small"
+ plain
+ icon="el-icon-delete"
+ @click="handleDelete"
+ >注 销
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="permission.user_role"
+ icon="el-icon-user"
+ @click="handleGrant"
+ >角色配置
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="permission.user_reset"
+ icon="el-icon-refresh"
+ @click="handleReset"
+ >密码重置
+ </el-button>
+ <el-button
+ type="info"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-setting"
+ @click="handlePlatform"
+ >平台配置
+ </el-button>
+ <el-button
+ type="success"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >导入
+ </el-button>
+ <el-button
+ type="warning"
+ style="display: none"
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('admin')"
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ </template>
+
+ <template slot-scope="{ type, size, row }" slot="menu">
+ <el-button
+ icon="el-icon-s-custom"
+ :size="size"
+ :type="type"
+ @click.stop="rowClick(row)"
+ >查看
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_delete && row.status != 2"
+ @click.stop="rowStatus(row)"
+ >离职登记
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="row.status == 2"
+ @click.stop="rowDellook(row)"
+ >离职查询
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_check"
+ @click.stop="rowCheck(row)"
+ >异常
+ </el-button>
+ <el-button
+ icon="el-icon-edit"
+ :size="size"
+ :type="type"
+ v-if="permission.securityGuard_paper"
+ @click.stop="certificateClick(row)"
+ >纸质证书制作
+ </el-button>
+ </template>
+
+ <template slot-scope="{ row }" slot="sex">
+ <el-tag v-if="row.sex == 1">男</el-tag>
+ <el-tag v-if="row.sex == 2">女</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="deptId">
+ <el-tag
+ class="rowClickSelf"
+ title="点击查看所属公司情况"
+ @click="rowClickSelf(row.deptId)"
+ >{{ row.deptName }}</el-tag
+ >
+ </template>
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="roleName">
+ <el-tag>{{ row.roleName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="deptName">
+ <el-tag>{{ row.deptName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userType">
+ {{
+ row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : ""
+ }}
+ </template>
+
+ <!-- 自定义新增和编辑中的指纹信息 -->
+ <!-- src="http://223.82.109.183:2081/zhba/upload/picture/85004574ae23472da37350b918960206.png" -->
+ <template slot-scope="{ type, disabled }" slot="fingerprintForm">
+ <div class="zhiwenMain">
+ <img class="zhiwenImgs" :src="zhiwenImg" alt="" />
+ <el-button type="primary" @click="openzhiwen" v-show="isOr">{{
+ zhiwenTitle
+ }}</el-button>
+ <el-button type="warning" @click="closezhiwen" v-show="!isOr">{{
+ zhiwenTitle
+ }}</el-button>
+ <el-button type="primary" @click="openccc">openccc</el-button>
+ </div>
+ </template>
+ </avue-crud>
+ <el-dialog
+ title="用户角色配置"
+ append-to-body
+ :visible.sync="roleBox"
+ width="345px"
+ >
+ <el-tree
+ :data="roleGrantList"
+ show-checkbox
+ check-strictly
+ default-expand-all
+ node-key="id"
+ ref="treeRole"
+ :default-checked-keys="roleTreeObj"
+ :props="props"
+ >
+ </el-tree>
+
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="roleBox = false">取 消</el-button>
+ <el-button type="primary" @click="submitRole">确 定</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="用户数据导入"
+ append-to-body
+ :visible.sync="excelBox"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption"
+ v-model="excelForm"
+ :upload-after="uploadAfter"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ <el-dialog
+ title="用户平台配置"
+ append-to-body
+ :visible.sync="platformBox"
+ >
+ <avue-crud
+ :option="platformOption"
+ :table-loading="platformLoading"
+ :data="platformData"
+ ref="platformCrud"
+ v-model="platformForm"
+ :before-open="platformBeforeOpen"
+ :page.sync="platformPage"
+ :permission="platformPermissionList"
+ @row-update="platformRowUpdate"
+ @search-change="platformSearchChange"
+ @search-reset="platformSearchReset"
+ @selection-change="platformSelectionChange"
+ @current-change="platformCurrentChange"
+ @size-change="platformSizeChange"
+ @refresh-change="platformRefreshChange"
+ @on-load="platformOnLoad"
+ >
+ <template slot-scope="{ row }" slot="tenantName">
+ <el-tag>{{ row.tenantName }}</el-tag>
+ </template>
+ <template slot-scope="{ row }" slot="userTypeName">
+ <el-tag>{{ row.userTypeName }}</el-tag>
+ </template>
+ </avue-crud>
+ </el-dialog>
+ <el-dialog
+ title="保安员导入"
+ append-to-body
+ :visible.sync="excelBox1"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption1"
+ v-model="excelForm1"
+ :upload-after="uploadAfter1"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate1">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+ <el-dialog
+ title="个人照片批量上传"
+ append-to-body
+ :visible.sync="excelBox2"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption2"
+ v-model="excelForm2"
+ :upload-after="uploadAfter2"
+ >
+ </avue-form>
+ </el-dialog>
+ <div style="position: fixed; top: 9999px; width: 100%; height: 100%">
+ <div class="certificate_box" id="certificateDom">
+ <div class="security_main" ref="certificateBox">
+ <div class="security_m_l_titleName widt">
+ {{ certificateObj.realName }}
+ </div>
+ <div class="security_m_r_o_jg widt">南昌市公安局</div>
+ <div class="security_m_l_titlepaperTimenian widt">
+ {{ certificateYear }}
+ </div>
+ <div class="security_m_l_titlepaperTimeyue widt">
+ {{ certificateMonth }}
+ </div>
+ <div class="security_m_l_downsecuritynumber widt">
+ {{ certificateObj.securitynumber }}
+ </div>
+ <div class="security_m_r_o_right widt">
+ {{ certificateObj.realName }}
+ </div>
+ <div class="security_m_r_o_rightbirthday widt">
+ {{
+ certificateObj.cardid
+ ? certificateObj.cardid.slice(6, 10) +
+ "." +
+ certificateObj.cardid.slice(10, 12) +
+ "." +
+ certificateObj.cardid.slice(12, 14)
+ : ""
+ }}
+ </div>
+ <div class="security_m_r_o_rightaddress security_m_r_o_l_r widt">
+ {{ certificateObj.registered }}
+ </div>
+ <div class="security_m_r_o_rightcardid">
+ {{ certificateObj.cardid }}
+ </div>
+ </div>
+ </div>
+ </div>
+ </basic-container>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+import {
+ getUser,
+ getUserPlatform,
+ remove,
+ update,
+ updatePlatform,
+ add,
+ securitySave,
+ grant,
+ resetPassword,
+ getUserPractitionersInfo,
+ updatePaperTime,
+ saveOrUpdateUserPractitionersInfo,
+} from "@/api/system/user";
+import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
+import { getList } from "@/api/securityGuard/securityGuard";
+import { getDeptLazyTree } from "@/api/system/dept";
+import { getRoleTree, getRoleDetail } from "@/api/system/role";
+import { getPostList } from "@/api/system/post";
+import { mapGetters } from "vuex";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
+import { securityFormPageColumn } from "./data";
+import { mapState } from "vuex";
+
+//加载指纹类
+import Client from "./Client";
+
+export default {
+ data() {
+ // const validatePass = (rule, value, callback) => {
+ // if (value === "") {
+ // callback(new Error("请输入密码"));
+ // } else {
+ // callback();
+ // }
+ // };
+ // const validatePass2 = (rule, value, callback) => {
+ // if (value === "") {
+ // callback(new Error("请再次输入密码"));
+ // } else if (value !== this.form.password) {
+ // callback(new Error("两次输入密码不一致!"));
+ // } else {
+ // callback();
+ // }
+ // };
+ // const validatePassNumber = (rule, value, callback) => {
+ // var test = /^[0-9]*$/gm;
+ // if (!test.test(value)) {
+ // callback(new Error("请输入数字"));
+ // } else {
+ // callback();
+ // }
+ // };
+ var date = new Date();
+ let year = date.getFullYear(),
+ mouth = date.getMonth() + 1,
+ day = date.getDate(),
+ oldy,
+ oldm,
+ oldd,
+ ok = false;
+
+ const validatePassCardid = (rule, value, callback) => {
+ // console.log(oldy, oldm, oldd, year - oldy, mouth, day);
+ var test =
+ /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
+ if (!test.test(value)) {
+ callback(new Error("请输入正确身份证号码"));
+ } else {
+ //加入校验18岁到60岁的
+ oldy = +value.slice(6, 10);
+ oldm = +value.slice(10, 12);
+ oldd = +value.slice(12, 14);
+ ok =
+ year - oldy < 18 || year - oldy > 60
+ ? false
+ : year - oldy == 18
+ ? mouth < oldm
+ ? false
+ : mouth > oldm
+ ? true
+ : day < oldd
+ ? false
+ : true
+ : year - oldy == 60
+ ? mouth < oldm
+ ? true
+ : mouth > oldm
+ ? false
+ : day <= oldd
+ ? false
+ : true
+ : true;
+ if (ok) {
+ callback();
+ } else {
+ // callback(new Error("根据国家要求,需在18岁至60岁"));
+ callback(new Error("年龄不符"));
+ }
+ }
+ };
+ const validatePassPhone = (rule, value, callback) => {
+ var test = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/g;
+ if (!test.test(value)) {
+ callback(new Error("请输入正确手机号码"));
+ } else {
+ callback();
+ }
+ };
+ return {
+ // 指纹数据
+ zhiwenImg: "",
+ zhiwenChart: "",
+ zhiwenTitle: "开始采集",
+ Client: "", //实例化指纹采集类合集
+ isOr: true,
+ begin_cap: false,
+ RAWzhiwen: "",
+ yuzhi: 60, //指纹获取结束阈值
+ // 指纹数据
+ certificateYear: null,
+ certificateMonth: null,
+ certificateFlag: false,
+ certificateObj: {
+ realName: "",
+ securitynumber: "",
+ cardid: "",
+ registered: "",
+ },
+ securityid: "",
+ excelBox1: false,
+ excelBox2: false,
+ isSecurity: true,
+ excelForm1: {},
+ excelOption1: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "文件上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "文件上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user?deptId=" + this.deptIds,
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ excelForm2: {},
+ excelOption2: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "文件上传",
+ prop: "file",
+ type: "upload",
+ drag: true,
+ loadText: "文件上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 zip 压缩文件,照片文件名以身份证号码命名",
+ action: "/api/blade-resource/oss/endpoint/put-file-zip",
+ },
+ ],
+ },
+ form: {},
+ search: {},
+ roleBox: false,
+ excelBox: false,
+ platformBox: false,
+ initFlag: true,
+ selectionList: [],
+ query: {},
+ loading: true,
+ platformLoading: false,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ roleId: "1412226235153731586",
+ deptId: "1413470343230877697",
+ deptIds: "",
+ platformPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ init: {
+ roleTree: [],
+ deptTree: [],
+ },
+ props: {
+ label: "title",
+ value: "key",
+ },
+ roleGrantList: [],
+ roleTreeObj: [],
+ treeDeptId: "",
+ treeData: [],
+ treeOption: {
+ nodeKey: "id",
+ lazy: true,
+ treeLoad: function (node, resolve) {
+ const parentId = node.level === 0 ? 0 : node.data.id;
+ getDeptLazyTree(parentId).then((res) => {
+ resolve(
+ res.data.data.map((item) => {
+ return {
+ ...item,
+ leaf: !item.hasChildren,
+ };
+ })
+ );
+ });
+ },
+ addBtn: false,
+ menu: false,
+ size: "small",
+ props: {
+ labelText: "标题",
+ label: "title",
+ value: "value",
+ children: "children",
+ },
+ },
+ choiceList: [],
+ option: {
+ height: "auto",
+ calcHeight: 80,
+ tip: true,
+ searchShow: true,
+ reserveSelection: true,
+ selectable: (row) => {
+ if (row.hold !== "1") {
+ return false;
+ } else {
+ return true;
+ }
+ },
+ indexWidth: 55,
+ searchMenuSpan: 6,
+ stripe: true,
+ border: true,
+ delBtn: true,
+ align: "center",
+ index: true,
+ delBtnText: "注销",
+ menuWidth: 327,
+ selection: true,
+ viewBtn: true,
+ defaultExpandAll: true,
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ column: securityFormPageColumn,
+ group: [
+ {
+ label: "基础信息",
+ labelWidth: "110",
+ prop: "baseInfo",
+ icon: "el-icon-user-solid",
+ column: [
+ {
+ label: "所属保安公司",
+ prop: "deptId",
+ type: "tree",
+ // dicUrl:
+ // "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ // disabled: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择保安公司",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "姓名",
+ prop: "realName",
+ rules: [
+ {
+ required: true,
+ message: "请输入姓名",
+ trigger: "blur",
+ },
+ {
+ min: 2,
+ max: 5,
+ message: "姓名长度在2到5个字符",
+ },
+ ],
+ },
+ // {
+ // label: "登录账号",
+ // prop: "account",
+ // editDisabled: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入登录账号",
+ // trigger: "blur",
+ // },
+ // ],
+ // // disabled: true,
+ // },
+ // {
+ // label: "密码",
+ // prop: "password",
+ // type: "password",
+ // hide: true,
+ // editDisplay: false,
+ // viewDisplay: false,
+ // rules: [
+ // { required: true, validator: validatePass, trigger: "blur" },
+ // ],
+ // },
+ // {
+ // label: "确认密码",
+ // prop: "password2",
+ // type: "password",
+ // hide: true,
+ // editDisplay: false,
+ // viewDisplay: false,
+ // rules: [
+ // { required: true, validator: validatePass2, trigger: "blur" },
+ // ],
+ // },
+ ],
+ },
+ {
+ label: "详细信息",
+ prop: "detailInfo",
+ labelWidth: "110",
+ icon: "el-icon-s-order",
+ column: [
+ {
+ label: "身份证号",
+ prop: "cardid",
+ hide: true,
+ overHidden: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入身份证号",
+ trigger: "blur",
+ },
+ {
+ required: true,
+ validator: validatePassCardid,
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "手机号码",
+ prop: "phone",
+ overHidden: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入手机号",
+ trigger: "blur",
+ },
+ {
+ required: true,
+ validator: validatePassPhone,
+ trigger: "blur",
+ },
+ ],
+ },
+ // {
+ // label: "昵称",
+ // prop: "name",
+ // },
+ {
+ label: "个人照片",
+ type: "upload",
+ listType: "picture-img",
+ propsHttp: {
+ res: "data",
+ url: "url",
+ },
+ canvasOption: {
+ text: " ",
+ ratio: 0.1,
+ },
+ action: "/api/blade-resource/oss/endpoint/put-files",
+ tip: "上传二代身份证一寸近期彩色正面免冠图象, (358像素(宽) × 441像素(高)、分辨率350dpi)且不超过500kb",
+ span: 12,
+ // row: true,
+ prop: "avatar",
+ },
+ {
+ label: "指纹信息",
+ // type: "upload",
+ // listType: "picture-img",
+ // propsHttp: {
+ // res: "data",
+ // url: "url",
+ // },
+ // canvasOption: {
+ // text: " ",
+ // ratio: 0.1,
+ // },
+ // action: "/api/blade-resource/oss/endpoint/put-files",
+ // tip: "只能上传jpg/png指纹信息,且不超过500kb",
+ span: 12,
+ // row: true,
+ prop: "fingerprint",
+ },
+ // {
+ // label: "指纹信息",
+ // type: "upload",
+ // listType: "picture-img",
+ // propsHttp: {
+ // res: "data",
+ // url: "url",
+ // },
+ // canvasOption: {
+ // text: " ",
+ // ratio: 0.1,
+ // },
+ // action: "/api/blade-resource/oss/endpoint/put-files",
+ // tip: "只能上传jpg/png指纹信息,且不超过500kb",
+ // span: 12,
+ // // row: true,
+ // prop: "fingerprint",
+ // },
+ {
+ label: "是否持证",
+ prop: "hold",
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
+ // props: {
+ // label: "dictValue",
+ // value: "dictKey",
+ // },
+ type: "select",
+ dicData: [
+ {
+ label: "是",
+ value: "1",
+ },
+ {
+ label: "否",
+ value: "2",
+ },
+ {
+ label: "已吊销",
+ value: "3",
+ },
+ ],
+ rules: [
+ {
+ required: true,
+ message: "请选择",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "保安员证编号",
+ prop: "securitynumber",
+ hide: true,
+ },
+ // {
+ // label: "发证日期",
+ // prop: "paperTime",
+ // hide: true,
+ // type: "date",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // },
+ {
+ label: "电子邮箱",
+ prop: "email",
+ },
+ // {
+ // label: "籍贯",
+ // prop: "nativeplace",
+ // },
+ {
+ label: "民族",
+ prop: "nation",
+ },
+ {
+ label: "最高学历",
+ prop: "education1",
+ type: "select",
+ dicUrl:
+ "/api/blade-system/dict-biz/dictionary?code=educationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ slot: true,
+ },
+ {
+ label: "政治面貌",
+ prop: "politicaloutlook",
+ },
+ {
+ label: "健康状态",
+ prop: "healstats",
+ },
+ {
+ label: "身高",
+ prop: "height",
+ },
+ {
+ label: "联系地址",
+ prop: "address",
+ },
+ {
+ label: "住址",
+ prop: "registered",
+ rules: [
+ {
+ required: true,
+ message: "请输入住址",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "所属辖区",
+ prop: "jurisdiction",
+ // multiple: true,
+ type: "tree",
+ dicUrl: "/api/jurisdiction/lazy-tree",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ checkStrictly: true,
+ slot: true,
+ rules: [
+ {
+ required: false,
+ message: "请选择所属辖区",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "入职时间",
+ prop: "rtime",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ rules: [
+ {
+ required: true,
+ message: "请输入入职时间",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ slot: true,
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ // {
+ // label: "未知",
+ // value: 3,
+ // },
+ ],
+ rules: [
+ {
+ required: true,
+ message: "请选择性别",
+ trigger: "blur",
+ },
+ ],
+ },
+ // {
+ // label: "生日",
+ // type: "date",
+ // prop: "birthday",
+ // format: "yyyy-MM-dd",
+ // valueFormat: "yyyy-MM-dd",
+ // },
+ ],
+ },
+ ],
+ },
+ data: [],
+ platformQuery: {},
+ platformSelectionList: [],
+ platformData: [],
+ platformForm: {},
+ platformOption: {
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ dialogClickModal: false,
+ menuWidth: 120,
+ editBtnText: "配置",
+ column: [
+ {
+ label: "登录账号",
+ prop: "account",
+ search: true,
+ display: false,
+ },
+ {
+ label: "所属保安单位",
+ prop: "tenantName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "姓名",
+ prop: "realName",
+ search: true,
+ display: false,
+ },
+ {
+ label: "平台",
+ prop: "userTypeName",
+ slot: true,
+ display: false,
+ },
+ {
+ label: "平台",
+ type: "select",
+ dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ dataType: "number",
+ search: true,
+ hide: true,
+ display: false,
+ prop: "userType",
+ rules: [
+ {
+ required: true,
+ message: "请选择平台",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "拓展",
+ prop: "userExt",
+ type: "textarea",
+ minRows: 8,
+ span: 24,
+ overHidden: true,
+ row: true,
+ hide: true,
+ },
+ ],
+ },
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "模板上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "模板上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user",
+ },
+ // {
+ // label: "数据覆盖",
+ // prop: "isCovered",
+ // type: "switch",
+ // align: "center",
+ // width: 80,
+ // dicData: [
+ // {
+ // label: "否",
+ // value: 0,
+ // },
+ // {
+ // label: "是",
+ // value: 1,
+ // },
+ // ],
+ // value: 0,
+ // slot: true,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择是否覆盖",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ };
+ },
+ watch: {
+ "form.tenantId"() {
+ if (this.form.tenantId !== "" && this.initFlag) {
+ this.initData(this.form.tenantId);
+ }
+ },
+ "form.fingerprint"() {
+ // console.log(this.form.fingerprint);
+ if (this.form.fingerprint != "") {
+ this.zhiwenImg = this.form.fingerprint;
+ this.zhiwenTitle = "重新采集";
+ } else {
+ this.zhiwenImg = "/img/zhiwen/zhiwenWu.png";
+ this.zhiwenTitle = "开始采集";
+ }
+ },
+ "form.deptId"() {
+ this.initData(this.form.tenantId);
+ },
+ "excelForm.isCovered"() {
+ if (this.excelForm.isCovered !== "") {
+ const column = this.findObject(this.excelOption.column, "excelFile");
+ column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
+ }
+ },
+ },
+ computed: {
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.securityGuard_add, false),
+ viewBtn: this.vaildData(null, false),
+ delBtn: this.vaildData(this.permission.securityGuard_delete, false),
+ editBtn: this.vaildData(this.permission.securityGuard_edit, false),
+ };
+ },
+ platformPermissionList() {
+ return {
+ addBtn: false,
+ viewBtn: false,
+ delBtn: false,
+ editBtn: this.vaildData(this.permission.user_edit, false),
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ ...mapState({
+ userInfo: (state) => state.user.userInfo,
+ }),
+ },
+ beforeCreate() {},
+ created() {
+ console.log(this.userInfo.role_name, 123541);
+ if (this.userInfo.role_name == "办证管理员") {
+ console.log(this.userInfo.role_name, 5555225);
+ this.search["userType"] = 7;
+ }
+ },
+ mounted() {
+ // this.option.column[0].hide = true
+ // 非保安单位模式默认加载管理组数据
+ if (!website.tenantMode) {
+ this.initData(website.tenantId);
+ }
+ this.search["status"] = 1;
+ if (this.userInfo.roleName == "办证管理员") {
+ this.search["userType"] = 7;
+ }
+ this.deptIds = this.userInfo.dept_id;
+
+ this.beginzhiwen();
+ },
+ methods: {
+ openccc() {
+ // console.log(this.zhiwenImg);
+ console.log(this.zhiwenChart);
+ // console.log(this.RAWzhiwen);
+ },
+ beginzhiwen() {
+ //初始化指纹采集系统
+ let that = this;
+ this.Client = new Client(); //实例化指纹采集类
+ //添加指纹消息提醒
+ //初始化设备
+ this.Client.beginFn = {
+ fn: this.Client.CID_Init,
+ CID5000: this.Client.CIDDeviceType.CID5000,
+ };
+ this.Client.OnCID_Alg_Begin = function (code, msg) {
+ //初始化机器返数据
+ if (code == 1) {
+ console.log("初始化成功");
+ that.zhiwenTitle = "结束采集";
+ that.isOr = false;
+ that.beginUseImg(); //开始预览指纹
+ } else {
+ that.closezhiwen();
+ alert("设备被占用或发生不可预料原因 错误码:" + code);
+ console.log("算法初始化发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Close = function (code, msg) {
+ //关闭机器返数据
+ if (code == 1) {
+ console.log("关闭设备成功");
+ that.zhiwenTitle = "开始采集";
+ that.isOr = true;
+ } else {
+ console.log("关闭设备发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_BeginCapture = function (code, msg) {
+ //开始使用预览图片模式函数
+ // console.log(code, "图片模式开始");
+ if (code == 1) {
+ that.Client.CID_GetFPBmpData(0);
+ } else {
+ console.log("开始采集发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_GetBmpData = function (code, msg, imagedata, feadata) {
+ //使用预览图片模式 采集 BMP格式
+ // console.log(msg, "图片模式采集");
+ if (code == 1) {
+ that.zhiwenImg = "data:image/bmp;base64," + imagedata;
+ if (that.begin_cap) {
+ that.Client.BmpToRaw(imagedata, 256, 360);
+ }
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ console.log("采集发生错误 错误码:" + code);
+ }
+ };
+ // this.Client.OnBmpToRaw = function (code, msg, imagedata) {
+ // //使用预览图片模式 BMP格式转换成RAW
+ // // console.log(code, msg, "BMP格式转换成RAW");
+ // // console.log(imagedata, "BMP格式转换成RAW");
+ // if (code == 0) {
+ // that.RAWzhiwen = imagedata;
+ // // console.log(imagedata);
+ // that.Client.CID_Alg_GetQualityScore(imagedata);
+ // } else {
+ // that.Client.CID_EndCapture(0);
+ // that.begin_cap = false;
+ // console.log("格式转换失败," + code + " " + msg);
+ // }
+ // };
+ this.Client.OnBmpToRaw = function (code, msg, imagedata) {
+ //使用预览图片模式 BMP格式转换成RAW
+ // console.log(code, msg, "BMP格式转换成RAW");
+ if (code == 0) {
+ that.Client.CID_Alg_GetQualityScore(imagedata);
+ that.RAWzhiwen = imagedata;
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ alert("格式转换失败," + code + " " + msg);
+ }
+ };
+ this.Client.OnCID_EndCapture = function (code, msg) {
+ //使用预览图片模式 停止采集
+ if (code == 1) {
+ if (that.begin_cap) {
+ that.Client.CID_BeginCapture(0);
+ }
+ } else {
+ that.begin_cap = false;
+ console.log("停止采集发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Alg_GetQualityScore = function (code, msg, score) {
+ //停止获取
+ console.log(
+ "code:" + code + ";",
+ "msg:" + msg + ";",
+ "score:" + score + ";",
+ "传送RAW图片代码后返回值"
+ );
+ if (code == 1) {
+ if (score >= that.yuzhi) {
+ that.begin_cap = false;
+ that.Client.CID_EndCapture(0);
+ that.Client.CID_Alg_FeatureExtract(
+ //99是获取特征
+ // ID_FingerPosition.UNKNOWN,
+ 99,
+ that.RAWzhiwen
+ );
+ } else {
+ that.Client.CID_EndCapture(0);
+ }
+ } else if (code == -9) {
+ that.Client.CID_EndCapture(0);
+ } else {
+ that.Client.CID_EndCapture(0);
+ that.begin_cap = false;
+ // console.log("获取质量分数发生错误 错误码:" + code);
+ console.log("获取质量分数发生错误 错误码:" + code);
+ }
+ };
+ this.Client.OnCID_Alg_FeatureExtract = function (code, msg, featuredata) {
+ //获取特征
+ if (code == 1) {
+ that.zhiwenChart = featuredata;
+ console.log("特征提取成功");
+ console.log("特征提取成功", that.zhiwenChart);
+ } else {
+ console.log("特征提取发生错误 错误码:" + code);
+ }
+ };
+ },
+ openzhiwen() {
+ // 连接指纹助手
+ this.Client.Connect_Server(); //成功后台打印Connect Success
+ //成功后将自动初始化设备
+ //若不成功将重复2秒计时重连设备
+ },
+ closezhiwen() {
+ // 关闭指纹设备
+ if (!this.Client.isConnect) {
+ console.log("助手程序未连接");
+ return;
+ }
+ this.Client.CID_Close();
+ },
+ beginUseImg() {
+ //开始预览图片
+ if (!this.Client.isConnect) {
+ alert("助手程序未连接");
+ return;
+ }
+ this.begin_cap = true;
+ this.Client.CID_BeginCapture(0);
+ },
+ handleImport1() {
+ this.excelBox1 = true;
+ },
+ uploadAfter1(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox1 = false;
+ this.refreshChange();
+ done();
+ },
+ handleTemplate1() {
+ window.open(`/api/blade-user/export-template-security`);
+ },
+ handleImport2() {
+ this.excelBox2 = true;
+ },
+ uploadAfter2(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox2 = false;
+ this.refreshChange();
+ done();
+ },
+
+ //行点击事件
+ rowClick(row) {
+ this.$router.push({
+ path: "/securityGuardDetail",
+ query: { row: JSON.stringify(row) },
+ });
+ },
+ //行点击事件
+ certificateClick(row) {
+ if (row) {
+ var time = this.getNewTime();
+ this.certificateYear = time[0];
+ this.certificateMonth = time[1];
+ this.certificateObj = row;
+ setTimeout(() => {
+ this.Print();
+ }, 500);
+ }
+ },
+ Print() {
+ if (
+ this.certificateObj.registered == "" ||
+ this.certificateObj.registered == null
+ ) {
+ this.$message({ message: "请完善住址信息", type: "warning" });
+ return;
+ }
+ //更新发证时间
+ var printDom = document.getElementById("certificateDom");
+ printDom.style.position = "absolute";
+ printDom.style.top = "-25.0%";
+ printDom.style.left = "-23%";
+ printDom.style.width = "120%";
+ printDom.style.height = "100%";
+ printDom.style.fontFamily = "SimSun";
+
+ this.$print("#certificateDom", {
+ noPrint: ".noPrint",
+ onStart: () => {
+ // console.log('打印开始', Date.parse(new Date()));
+ },
+ onEnd: () => {
+ this.updateUserInfo();
+ // console.log('打印完成', Date.parse(new Date()));
+ },
+ });
+ },
+ getNewTime() {
+ var nowTime = new Date();
+
+ var oneHoursAgo = new Date(
+ new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
+ );
+ var oneHoursAgoY = oneHoursAgo.getFullYear();
+ var oneHoursAgoM =
+ oneHoursAgo.getMonth() + 1 < 10
+ ? "0" + (oneHoursAgo.getMonth() + 1)
+ : oneHoursAgo.getMonth() + 1;
+
+ /**
+ * @return 返回1小时,2小时,3小时,4小时,24小时
+ */
+ return [oneHoursAgoY, oneHoursAgoM];
+ },
+ //更新用户发证时间
+ updateUserInfo() {
+ var nowTime = new Date();
+ var oneHoursAgo = new Date(
+ new Date(nowTime).getTime() - 1 * 60 * 60 * 1000
+ );
+ var oneHoursAgoY = oneHoursAgo.getFullYear();
+ var oneHoursAgoM =
+ oneHoursAgo.getMonth() + 1 < 10
+ ? "0" + (oneHoursAgo.getMonth() + 1)
+ : oneHoursAgo.getMonth() + 1;
+ var day = oneHoursAgo.getDay();
+ var date = oneHoursAgoY + "-" + oneHoursAgoM + "-" + day;
+ const data = {
+ id: this.certificateObj.id,
+ userType: 6,
+ paperTime: date,
+ };
+ updatePaperTime(data);
+ },
+ rowClickSelf(row) {
+ this.$router.push({
+ path: "/securityUnitChild",
+ query: { fromSecunityGuardId: row },
+ });
+ },
+ nodeClick(data) {
+ this.treeDeptId = data.id;
+ this.page.currentPage = 1;
+ this.onLoad(this.page);
+ },
+ initData(tenantId) {
+ // getRoleTree(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "roleId");
+ // column.dicData = res.data.data;
+ // });
+ // getDeptTree(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "deptId");
+ // column.dicData = res.data.data;
+ // });
+ // getPostList(tenantId).then((res) => {
+ // const column = this.findObject(this.option.group, "postId");
+ // column.dicData = res.data.data;
+ // });
+ },
+ submitRole() {
+ const roleList = this.$refs.treeRole.getCheckedKeys().join(",");
+ grant(this.ids, roleList).then(() => {
+ this.roleBox = false;
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.onLoad(this.page);
+ });
+ },
+ //制证申请
+ handleSecurityApply() {
+ if (this.choiceList.length === 0) {
+ this.$message.warning("请勾选至少一位持证保安员");
+ return;
+ }
+ this.$confirm(
+ "共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?",
+ {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }
+ )
+ .then(() => {
+ let cho = this.choiceList;
+ let str = "";
+ for (let k in cho) {
+ str += cho[k].id;
+ if (k != cho.length - 1) {
+ str += ",";
+ }
+ }
+ const data = {
+ ids: str,
+ createUser: this.userInfo.user_id,
+ };
+ return securityApply(data);
+ })
+ .then(() => {
+ // this.$refs.crud.toggleSelection();
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ rowSave(row, done, loading) {
+ if (row.deptId) {
+ row.deptId = row.deptId;
+ }
+ if (row.roleId) {
+ row.roleId = row.roleId.join(",");
+ }
+ if (row.postId) {
+ row.postId = row.postId.join(",");
+ }
+
+ const userMap = {
+ user: {
+ account: row.account,
+ avatar: row.avatar,
+ fingerprint: row.fingerprint,
+ healstats: row.healstats,
+ address: row.address,
+ birthday: row.birthday,
+ cardid: row.cardid,
+ deptId: row.deptId,
+ education: row.education1,
+ email: row.email,
+ height: row.height,
+ hold: row.hold,
+ jurisdiction: row.jurisdiction,
+ myPicture: row.myPicture,
+ name: row.name,
+ nation: row.nation,
+ nativeplace: row.nativeplace,
+ password: row.password,
+ password2: row.password2,
+ phone: row.phone,
+ politicaloutlook: row.politicaloutlook,
+ realName: row.realName,
+ registered: row.registered,
+ rtime: row.rtime,
+ securitynumber: row.securitynumber,
+ sex: row.sex,
+ },
+ };
+
+ securitySave(userMap).then(
+ () => {
+ this.initFlag = false;
+ this.$alert("账号为身份证号码,密码为身份证后六位", "温馨提示", {
+ confirmButtonText: "确定",
+ callback: (action) => {
+ this.$message({
+ type: "success",
+ message: `操作成功`,
+ });
+ this.onLoad(this.page);
+ done();
+ },
+ });
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ row.deptId = row.deptId;
+ row.roleId = row.roleId.join(",");
+ row.postId = row.postId.join(",");
+ //值替换,education 放在页面会卡死
+ row.education = row.education1;
+ update(row).then(
+ () => {
+ this.initFlag = false;
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowDellook(row) {
+ this.$alert(
+ row.reasonForLeav == "" ? "未填写" : row.reasonForLeav,
+ "离职原因",
+ {
+ confirmButtonText: "确定",
+ callback: (action) => {},
+ }
+ );
+ },
+ rowStatus(row) {
+ this.$prompt("离职原因", "提示", {
+ confirmButtonText: "确定离职",
+ cancelButtonText: "取消",
+ inputErrorMessage: "",
+ })
+ .then(({ value }) => {
+ row.reasonForLeav = value;
+ row.status = "2";
+ // return;
+ update(row).then((res) => {
+ this.$message({
+ type: "success",
+ message: "操作成功",
+ });
+ });
+ this.refreshChange();
+ })
+ .catch(() => {});
+ },
+ rowDel(row) {
+ this.$confirm("确定注销当前用户?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ rowCheck(row) {
+ this.$confirm("确定审查异常标记?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ row.examinationType = "1";
+ return update(row);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+ searchReset() {
+ this.query = {};
+ this.treeDeptId = "";
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ selectionChange(list) {
+ // this.selectionList = list;
+ this.choiceList = [];
+ for (let k in list) {
+ this.choiceList.push({
+ id: list[k].id,
+ });
+ }
+ },
+ selectionClear() {
+ // this.selectionList = [];
+ // this.$refs.crud.toggleSelection();
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择保安注销?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleReset() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择账号密码重置为123456?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return resetPassword(this.ids);
+ })
+ .then(() => {
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ handleGrant() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.roleTreeObj = [];
+ if (this.selectionList.length === 1) {
+ this.roleTreeObj = this.selectionList[0].roleId.split(",");
+ }
+ getRoleTree().then((res) => {
+ this.roleGrantList = res.data.data;
+ this.roleBox = true;
+ });
+ },
+ handlePlatform() {
+ this.platformBox = true;
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+ handleExport() {
+ this.$confirm("是否导出保安数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(
+ `/api/blade-user/export-user?${
+ this.website.tokenHeader
+ }=${getToken()}&account=${this.search.account}&realName=${
+ this.search.realName
+ }`
+ );
+ });
+ },
+ handleTemplate() {
+ window.open(
+ `/api/blade-user/export-template?${
+ this.website.tokenHeader
+ }=${getToken()}`
+ );
+ },
+ beforeOpen(done, type) {
+ var that = this;
+ if (["edit", "view"].includes(type)) {
+ getUser(this.form.id).then((res) => {
+ this.form = res.data.data;
+ var d = {
+ education1: res.data.data.education,
+ };
+ this.form = {
+ ...this.form,
+ ...d,
+ };
+ // this.from["education1"] = res.data.data.education;
+ if (this.form.hasOwnProperty("deptId")) {
+ this.form.deptId = this.form.deptId;
+ }
+ if (this.form.hasOwnProperty("roleId")) {
+ this.form.roleId = this.form.roleId.split(",");
+ }
+ if (this.form.hasOwnProperty("postId")) {
+ this.form.postId = this.form.postId.split(",");
+ }
+ var userInfo = res.data.data;
+ //获取用户从业信息
+ getUserPractitionersInfo(userInfo.id).then((res1) => {
+ that.form.UserPractitionersInfo = res1.data.data;
+ });
+ });
+ }
+ this.initFlag = true;
+ done();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ //行样式调整
+ rowStyle({ row, column, rowIndex }) {
+ if (row.examinationType == "1") {
+ return {
+ color: "#ff2727",
+ };
+ }
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ params = this.search;
+ var that = this;
+ //获取当前登录人员的角色信息
+ var roleIds = this.userInfo.role_id.split(",");
+ roleIds.forEach((roleId) => {
+ getRoleDetail(roleId).then((res) => {
+ var roleAlias = res.data.data.roleAlias;
+ if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
+ //去除保安公司查询
+ const column = that.findObject(that.option.column, "deptId");
+ column.search = false;
+ const deptColumn = that.findObject(that.option.group, "deptId");
+ deptColumn.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ //禁止编辑
+ deptColumn.disabled = true;
+ deptColumn.value = that.userInfo.dept_id;
+ that.isSecurity = false;
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+
+ //导入action 修改
+ const importColumn = that.findObject(
+ that.excelOption1.column,
+ "excelFile"
+ );
+ importColumn.action =
+ "/api/blade-user/import-user?deptId=" + this.deptIds;
+ } else if (roleAlias == "公安管理员") {
+ params["jurisdiction"] = that.userInfo.jurisdiction;
+ var columnDept = that.findObject(that.option.column, "deptId");
+ columnDept.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+ that.userInfo.jurisdiction;
+ var ColumnDeptUpdate = that.findObject(that.option.group, "deptId");
+ ColumnDeptUpdate.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+ that.userInfo.jurisdiction;
+ } else if (roleAlias == "培训公司管理员") {
+ //如果是保安公司管理员
+ params["trainingUnitId"] = that.userInfo.dept_id;
+ var columnDept2 = that.findObject(that.option.column, "deptId");
+ columnDept2.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ var ColumnDeptUpdate2 = that.findObject(
+ that.option.group,
+ "deptId"
+ );
+ ColumnDeptUpdate2.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ } else {
+ var columnDept1 = that.findObject(that.option.column, "deptId");
+ columnDept1.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ var ColumnDeptUpdate1 = that.findObject(
+ that.option.group,
+ "deptId"
+ );
+ ColumnDeptUpdate1.dicUrl =
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+ }
+
+ let values = {
+ ...params,
+ };
+ values = {
+ ...params,
+ roleAlias: "111",
+ ...that.query,
+ };
+
+ that.loading = true;
+ getList(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ that.page.total = data.total;
+ var d = data.records;
+ var date = new Date();
+ var datayear = date.getFullYear();
+ for (const key in d) {
+ var year = d[key].cardid.slice(6, 10);
+ d[key]["age"] = +datayear - +year;
+ // d[key].securitynumber = "赣洪202100009";
+ }
+ that.data = data.records;
+ that.loading = false;
+ that.selectionClear();
+ });
+ });
+ });
+ },
+ platformRowUpdate(row, index, done, loading) {
+ updatePlatform(row.id, row.userType, row.userExt).then(
+ () => {
+ this.platformOnLoad(this.platformPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ platformBeforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getUserPlatform(this.platformForm.id).then((res) => {
+ this.platformForm = res.data.data;
+ });
+ }
+ done();
+ },
+ platformSearchReset() {
+ this.platformQuery = {};
+ this.platformOnLoad(this.platformPage);
+ },
+ platformSearchChange(params, done) {
+ this.platformQuery = params;
+ this.platformPage.currentPage = 1;
+ this.platformOnLoad(this.platformPage, params);
+ done();
+ },
+ platformSelectionChange(list) {
+ this.platformSelectionList = list;
+ },
+ platformSelectionClear() {
+ this.platformSelectionList = [];
+ this.$refs.platformCrud.toggleSelection();
+ },
+ platformCurrentChange(currentPage) {
+ this.platformPage.currentPage = currentPage;
+ },
+ platformSizeChange(pageSize) {
+ this.platformPage.pageSize = pageSize;
+ },
+ platformRefreshChange() {
+ this.platformOnLoad(this.platformPage, this.platformQuery);
+ },
+ platformOnLoad(page, params = {}) {
+ this.platformLoading = true;
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query),
+ this.treeDeptId
+ ).then((res) => {
+ const data = res.data.data;
+ this.platformPage.total = data.total;
+ this.platformData = data.records;
+ this.platformLoading = false;
+ this.selectionClear();
+ });
+ },
+ },
+};
+</script>
+
+<style lang="scss" scoped>
+.box {
+ height: 800px;
+}
+
+.el-scrollbar {
+ height: 100%;
+}
+
+.box .el-scrollbar__wrap {
+ overflow: scroll;
+}
+.rowClickSelf {
+ &:hover {
+ cursor: pointer;
+ }
+}
+//保安证 本子
+.certificate_box {
+ width: 100%;
+ height: 90%;
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ font: normal 18px "SimSuncss" !important;
+}
+.security_main {
+ width: 630px;
+ height: 512px;
+ // border: 1px solid rgba($color: #a5a5a5, $alpha: 0.5);
+ // display: flex;
+ // align-items: center;
+ // justify-content: space-around;
+ // background-size: 100% 100%;
+ // background-repeat: no-repeat;
+ position: relative;
+}
+// 标题
+$upTop: 45px;
+$downTop: 265px; //整体高度
+//经国家保安员考试审查合格。<br />特颁此证。
+.security_main-title {
+ position: absolute;
+ top: $upTop;
+ left: 34px;
+ line-height: 45px;
+ letter-spacing: 3px;
+}
+//发证公安机关 (印章)
+.security_m_l_center {
+ position: absolute;
+ top: 270px;
+ left: 30px;
+ line-height: 40px;
+}
+//证件编号
+.security_m_l_down {
+ position: absolute;
+ top: 379px;
+ left: 32px;
+}
+
+$rightLeft: 343px;
+$rightFontSize: 18px;
+$rightWidth: 77px;
+
+$lineHigeht: 30px;
+//姓名
+.security_m_r_a {
+ position: absolute;
+ top: $downTop;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
+}
+//出生年月
+.security_m_r_b {
+ position: absolute;
+ top: $downTop + $lineHigeht * 1;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
+}
+//地址
+.security_m_r_c {
+ position: absolute;
+ top: $downTop + $lineHigeht * 2;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
+}
+//公民身份证
+.security_m_r_d {
+ position: absolute;
+ top: 363px;
+ left: $rightLeft;
+ width: $rightWidth;
+ text-align: justify;
+ text-align-last: justify;
+}
+//照片
+// width: calc(358px / 22px);
+// height: calc(441px / 22px);
+.security_m_r_imgs {
+ width: calc(358px / 3);
+ height: calc(441px / 3);
+ position: absolute;
+ top: $upTop;
+ left: 421px;
+ img {
+ width: 100%;
+ height: 100%;
+ }
+}
+
+// 内容
+// 抬头名字
+.security_m_l_titleName {
+ position: absolute;
+ top: 45px;
+ left: 121px;
+ right: 0;
+ line-height: 45px;
+ letter-spacing: 3px;
+}
+//发证时间
+$timeTop: 312px; //整体高度
+//年
+.security_m_l_titlepaperTimenian {
+ position: absolute;
+ top: $timeTop;
+ left: 109px;
+ line-height: 40px;
+}
+//月
+.security_m_l_titlepaperTimeyue {
+ position: absolute;
+ top: $timeTop;
+ left: 168px;
+ line-height: 40px;
+}
+//日
+.security_m_l_titlepaperTimeri {
+ position: absolute;
+ top: $timeTop;
+ left: 159px;
+ line-height: 40px;
+}
+//证件编号
+.security_m_l_downsecuritynumber {
+ position: absolute;
+ top: 386px; //整体高度
+ left: 145px;
+}
+
+//内容
+// 姓名
+$centerLeft: 458px;
+.security_m_r_o_right {
+ position: absolute;
+ top: $downTop + $lineHigeht * 0-2px;
+ left: $centerLeft;
+ // width: $rightWidth;
+}
+// 生日
+.security_m_r_o_rightbirthday {
+ position: absolute;
+ top: $downTop + $lineHigeht * 1-4px;
+ left: $centerLeft;
+ // width: $rightWidth;
+}
+// 地址
+.security_m_r_o_rightaddress {
+ position: absolute;
+ top: $downTop + $lineHigeht * 2 -6px;
+ left: $centerLeft;
+ width: 185px;
+}
+// 身份证
+.security_m_r_o_rightcardid {
+ position: absolute;
+ top: $downTop + $lineHigeht * 4 +10px;
+ left: $centerLeft;
+ // width: $rightWidth;
+}
+//背景图
+.security_main_backImge {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ background-image: url(/img/securityCertificate/bazsss.png);
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+}
+
+.security_m_r_o_jg {
+ position: absolute;
+ top: 267px;
+ left: 210px;
+ line-height: 40px;
+ letter-spacing: 2px;
+}
+.zhiwenMain {
+ width: 100%;
+ height: 240px;
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ // border: 1px solid red;
+}
+.zhiwenImgs {
+ width: 178px;
+ height: 178px;
+ border-radius: 5px;
+ text-align: center;
+ border: 1px dashed #8c939d;
+}
+</style>
--
Gitblit v1.9.3