Просмотр исходного кода

#IQRV #comment [Healthmanager] 本地离线维护桌面调用实现

gifur 4 лет назад
Родитель
Сommit
e8a2ce99d1

+ 2 - 2
Module/mod_healthmanager/HealthManager_def_g.h

@@ -330,7 +330,7 @@ struct HealthManagerService_Gateway_Req
 	int option;
 	unsigned int additional;
 	int nParam1;
-	int nParam1;
+	int nParam2;
 	CSimpleStringA strParam1;
 	CSimpleStringA strParam2;
 	CAutoArray<int> reserved1;
@@ -338,7 +338,7 @@ struct HealthManagerService_Gateway_Req
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & type & option & additional & nParam1 & nParam1 & strParam1 & strParam2 & reserved1 & reserved2;
+		auto & buf = Buf & type & option & additional & nParam1 & nParam2 & strParam1 & strParam2 & reserved1 & reserved2;
 	}
 
 };

+ 1 - 1
Module/mod_healthmanager/Healthmanager.xml

@@ -170,7 +170,7 @@
         <param name="option" type="int" />
         <param name="additional" type="uint"/>
         <param name="nParam1" type="int" />
-        <param name="nParam1" type="int" />
+        <param name="nParam2" type="int" />
         <param name="strParam1" type="string" />
         <param name="strParam2" type="string" />
         <param name="reserved1" type="array_int"/>

+ 1 - 1
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -2277,7 +2277,7 @@ void CHealthManagerEntity::Gateway(SpReqAnsContext<HealthManagerService_Gateway_
     ErrorCodeEnum tmpResult(Error_Succeed);
     CSimpleStringA tmpMsg(true);
 
-	if (ctx->Req.option != 1) {
+	if (ctx->Req.type != 1) {
 		result = Error_NotSupport;
 	} else {
 	

+ 1 - 0
addin/res/ManagerDesktop/js/guide.js

@@ -1895,6 +1895,7 @@ $(function () {
 
         $('#header_right #header_help_info_div').bind('click', function() {
             //reloadThisPage();
+            //RVC.HealthmanagerEntityCtrl.OpenLocalMaintainPage();
             utilStartAlertDialog('功能暂未实现!');
         });
 

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

@@ -1779,12 +1779,14 @@ $(function () {
         methodID: {
             ControlTerminalLife: 7,
             DeployTerminal : 8,
-            ControlEntityLife : 9
+            ControlEntityLife : 9,
+            Gateway : 10
         },
         methodSignature: {
             ControlTerminalLife: 397251033,
             DeployTerminal : -1435088905,
-            ControlEntityLife:1220598826
+            ControlEntityLife:1220598826,
+            Gateway : -1816595817
         },
 
         ControlTerminalLife: function (req, callback) {
@@ -1805,6 +1807,11 @@ $(function () {
                 ({id:this.methodID.ControlEntityLife, sig:this.methodSignature.ControlEntityLife}),
                  callback);
         },
+        Gateway: function (req, callback) {
+            this.webSocketInvokeEx(req, 
+                ({id:this.methodID.Gateway, sig:this.methodSignature.Gateway}),
+                 callback);
+        },
 
         ControlTerminalLifeNo: function(cmdValue) {
             let req = new Request();
@@ -1838,6 +1845,7 @@ $(function () {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(1);
             }
         },
+
         QuitApp: function(flag) {
             if(typeof flag === 'undefined') {
                 utilStartConfirmDialog("确认要退出可视柜台应用程序?", function() {
@@ -1847,11 +1855,13 @@ $(function () {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(2);
             }
         },
+
         UPSOffPC: function() {
             utilStartConfirmDialog("确认通过UPS关闭计算机?(点击确认并操作成功后请在5分钟内拔离插座电源线以彻底关闭计算机,否则机器将会重启!)", function() {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(6);
             });
         },
+
         PowerOffPC: function(flag) {
             if(typeof flag === 'undefined') {
                 utilStartConfirmDialog("确认要关闭计算机?", function() {
@@ -1861,6 +1871,7 @@ $(function () {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(5);
             }
         },
+
         RestartPC: function(flag) {
             if(typeof flag === 'undefined') {
                 utilStartConfirmDialog("确认要重启计算机?", function() {
@@ -1869,6 +1880,35 @@ $(function () {
             } else {
                 RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(4);
             }
+        },
+
+        OpenLocalMaintainPage: function() {
+
+            let req = new Request();
+            req.type = 1;// 打开本地维护桌面
+            req.option = 0;
+            req.additional = 0;
+            req.nParam1 = 0;
+            req.nParam2 = 0;
+            req.strParam1 = '';
+            req.strParam2 = '';
+            req.reserved1 = [];
+            req.reserved2 = [];
+
+            utilStartSubmitDialog();
+            this.Gateway(req, function(ret) {
+                utilStopSubmitDialog();
+                if (ret.errorCode === 0) {
+                    let result = JSON.parse(ret[this.sigResponseUUID])
+                    if(result.result === 0) {
+                        utilStartAlertDialog("操作成功!");
+                    } else {
+                        utilStartAlertDialog("操作失败:" + result.result + ' ' + result.msg);
+                    }
+                } else {
+                    RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
+                }
+            });
         }
     });