Browse Source

#IQRV #comment [JS] 保存硬件配置时启动密码键盘实体

gifur 4 years ago
parent
commit
c5feb6dc92
2 changed files with 67 additions and 23 deletions
  1. 58 21
      addin/res/ManagerDesktop/js/guide.js
  2. 9 2
      addin/res/ManagerDesktop/js/public.js

+ 58 - 21
addin/res/ManagerDesktop/js/guide.js

@@ -186,15 +186,7 @@ function LoadDeviceAdaptersWithEvent(flag)
     FulfillDevAdapterFileList(deviceName, vendorName, globalInterestRootFlag, flag);
 }
 
-function InitCurrentVendorSelect()
-{
-    if(globalSelectVendorType === '') {
-        GetTerminalBaseInfo();
-    }
-    const vendorZhCnName = DisplayVendorFriendName(globalSelectVendorType);
-    $('#gui_adapter_config_vendor').attr('value', globalSelectVendorType);
-    $('#gui_adapter_config_vendor').html(vendorZhCnName);
-}
+
 
 function AdapterSelectChange(name)
 {
@@ -328,7 +320,7 @@ $(function () {
                         RVC.GuideController.hideAllRebootTipElem();
                         if(req.restartApp) {
                             $('#guide_restart_loading').show();
-                        } else if(req.restartPC) {
+                        } else if(req.reboot_pagrestartPC) {
                             $('#guide_reboot_loading').show();
                         }
                         $('#guide_reboot_page').show();
@@ -436,6 +428,17 @@ $(function () {
         });
     }
 
+
+    function InitCurrentVendorSelect()
+    {
+        if(globalSelectVendorType === '') {
+            GetTerminalBaseInfo();
+        }
+        const vendorZhCnName = DisplayVendorFriendName(globalSelectVendorType);
+        $('#gui_adapter_config_vendor').attr('value', globalSelectVendorType);
+        $('#gui_adapter_config_vendor').html(vendorZhCnName);
+    }
+
     function InitTemrinalAbout(server_ip, new_terminalno, vendorName)
     {
         let req = new Request();
@@ -584,10 +587,7 @@ $(function () {
                         RVC.GuideController.gotoPage(result.nextStep);
                     });
                 } else {
-                    utilStartAlertDialog("操作失败:[" + result.result + "] " + result.additionalMsg, 
-                    function(){
-                        RVC.GuideController.gotoPage(result.nextStep);
-                    });
+                    utilStartAlertDialog("操作失败:[" + result.result + "] " + result.additionalMsg);
                 }
             } else {
                 RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
@@ -826,20 +826,53 @@ $(function () {
         });
     }
 
+    /**不使用,转到实体里头处理 */
+    function StartBasicHardwareEntity(entityName, sucCallback)
+    {
+        let req = new Request();
+        req.option = 1; //启动实体
+        req.additional = 0;
+        req.devId = 0;
+        req.entityName = entityName;
+        req.force = true;
+        req.param = '';
+        req.reserved1 = 0;
+        req.reserved2 = '';
+        req.timeout = 60000;
+
+        RVC.HealthmanagerEntityCtrl.ControlEntityLife(req, function(ret) {
+            if(ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.result == 0) {
+                    if(sucCallback) {
+                        sucCallback();
+                    }
+                } else {
+                    utilShowToast("启动模块" + entityName + "失败:[" + result.result + "] " + result.msg);
+                }
+            } else {
+                RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
+            }
+        });
+    }
+
+    /**
+     * 结束基本硬件配置后的操作
+     */
     function FinshedDevAdapterConfig()
     {
         let req = new Request();
         req.preStep = DeployStepChain.AdapterConfig[preStepIndex];
         req.currStep = DeployStepChain.AdapterConfig[curStepIndex];
         req.nextStep = DeployStepChain.AdapterConfig[nextStepIndex];
-        req.param1 = 0;
-        req.param2 = 0;
-        req.param3 = '';
-        req.param4 = '';
+        req.param1 = 1; //Start
+        req.param2 = 1; //Force
+        req.param3 = 'PinPad';
+        req.param4 = ''; //Start param
         req.param5 = '';
         req.array1 = [0];
         req.array2 = [''];
-        req.options = 0;
+        req.options = 0x4; //ControlEntity
         req.additional = 0;
         req.restartApp = false;
         req.restartPC = false;
@@ -881,7 +914,11 @@ $(function () {
         req.restartApp = true;
         req.restartPC = false;
 
-        utilStartSubmitDialog();
+        if(req.restartApp) {
+            utilStartSubmitDialog("请求重启应用,请稍后...");
+        } else {
+            utilStartSubmitDialog();
+        }
         RVC.HealthmanagerEntityCtrl.DeployTerminal(req, function(ret) {
             utilStopSubmitDialog();
             if(ret.errorCode === 0) {
@@ -1402,7 +1439,7 @@ $(function () {
                     DeployStep_3rdParty_FontInstall
              * 
              */
-            RVC.GuideController.gotoPage(CONST.DeployStep_AccessAuthorize);
+            RVC.GuideController.gotoPage(CONST.DeployStep_Begin);
         }
     }
 

+ 9 - 2
addin/res/ManagerDesktop/js/public.js

@@ -1707,11 +1707,13 @@ $(function () {
         className: 'HealthManagerService',
         methodID: {
             ControlTerminalLife: 7,
-            DeployTerminal : 8
+            DeployTerminal : 8,
+            ControlEntityLife : 9
         },
         methodSignature: {
             ControlTerminalLife: 397251033,
-            DeployTerminal : -1435088905
+            DeployTerminal : -1435088905,
+            ControlEntityLife:1220598826
         },
 
         ControlTerminalLife: function (req, callback) {
@@ -1727,6 +1729,11 @@ $(function () {
                 ({id:this.methodID.DeployTerminal, sig:this.methodSignature.DeployTerminal}),
                  callback);
         },
+        ControlEntityLife: function (req, callback) {
+            this.webSocketInvokeEx(req, 
+                ({id:this.methodID.ControlEntityLife, sig:this.methodSignature.ControlEntityLife}),
+                 callback);
+        },
 
         ControlTerminalLifeNo: function(cmdValue) {
             let req = new Request();