Quellcode durchsuchen

自动化接口

q vor 11 Monaten
Ursprung
Commit
5e6fa08286

+ 0 - 1
webmain/flow/input/mode_dcs_groupAction.php

@@ -40,7 +40,6 @@ class mode_dcs_groupClassAction extends inputAction{
                     if ($crow['pid'] == $row['id']) {
                         $newRowArr[] = $crow;
                     }
-
                 }
             }
         }

+ 10 - 4
webmain/flow/page/input_dcs_group.html

@@ -1,16 +1,16 @@
 <table width="100%" border="0" class="ke-zeroborder">
     <tbody>
     <tr class="autoyijianview">
-        <td height="34" width="15%" align="right" class="ys1">*^pid^</td>
-        <td width="35%" class="ys2">{pid}</td>
         <td height="34" width="15%" align="right" class="ys1">*^name^</td>
         <td width="35%" class="ys2">{name}</td>
-    </tr>
-    <tr>
         <td height="34" width="15%" align="right" class="ys1">^key^</td>
         <td width="35%" class="ys2">{key}</td>
+    </tr>
+    <tr>
         <td height="34" width="15%" align="right" class="ys1">*^level^</td>
         <td width="35%" class="ys2">{level}</td>
+        <td height="34" align="right" class="ys1"></td>
+        <td class="ys2"></td>
     </tr>
     <tr>
         <td height="34" align="right" class="ys1">^icon^</td>
@@ -19,6 +19,12 @@
     <tr>
         <td height="34" width="15%" align="right" class="ys1">*^sort^</td>
         <td width="35%" class="ys2">{sort}</td>
+        <td height="34" width="15%" align="right" class="ys1">*^pid^</td>
+        <td width="35%" class="ys2">{pid}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">*^is_show^</td>
+        <td width="35%" class="ys2">{is_show}</td>
         <td height="34" align="right" class="ys1"></td>
         <td class="ys2"></td>
     </tr>

+ 10 - 4
webmain/flow/page/view_dcs_group_0.html

@@ -1,16 +1,16 @@
 <table width="100%" border="0" class="ke-zeroborder">
     <tbody>
     <tr class="autoyijianview">
-        <td height="34" width="15%" align="right" class="ys1">^pid^</td>
-        <td width="35%" class="ys2">{pid}</td>
         <td height="34" width="15%" align="right" class="ys1">^name^</td>
         <td width="35%" class="ys2">{name}</td>
-    </tr>
-    <tr>
         <td height="34" width="15%" align="right" class="ys1">^key^</td>
         <td width="35%" class="ys2">{key}</td>
+    </tr>
+    <tr>
         <td height="34" width="15%" align="right" class="ys1">^level^</td>
         <td width="35%" class="ys2">{level}</td>
+        <td height="34" align="right" class="ys1"></td>
+        <td class="ys2"></td>
     </tr>
     <tr>
         <td height="34" align="right" class="ys1">^icon^</td>
@@ -19,6 +19,12 @@
     <tr>
         <td height="34" width="15%" align="right" class="ys1">^sort^</td>
         <td width="35%" class="ys2">{sort}</td>
+        <td height="34" width="15%" align="right" class="ys1">^pid^</td>
+        <td width="35%" class="ys2">{pid}</td>
+    </tr>
+    <tr>
+        <td height="34" width="15%" align="right" class="ys1">^is_show^</td>
+        <td width="35%" class="ys2">{is_show}</td>
         <td height="34" align="right" class="ys1"></td>
         <td class="ys2"></td>
     </tr>

+ 0 - 6
webmain/model/flow/dcs_groupModel.php

@@ -11,12 +11,6 @@ class flow_dcs_groupClassModel extends flowModel
 
 	public function flowrsreplace($rs, $lx=0)
 	{
-//        if ($rs['level'] == 1) {
-//            $rs['name'] = "<font style='font-weight:800; color:#000;'>".$rs['name']."</font>";
-//        } else {
-//            $rs['name'] = str_repeat('<img src="images/white.gif" class="icons">', $rs['level'])."|-".$rs['name'];
-//        }
-
         if(!empty($rs['icon']))
             $rs['icon'] = "<img src='".$rs['icon']."' width='30' height='30'>";
 

+ 47 - 3
webmain/task/openapi/openDcsApiAction.php

@@ -7,11 +7,54 @@
 class openDcsApiClassAction extends openapiAction
 {
 
+    public function testAction() {
+
+        // $shell = "echo 'success' ";
+        // $shellExec = shell_exec($shell);
+        // // var_dump($shellExec);
+        // if($shellExec){echo 'ok';} else {echo 'error'}
+
+        $pids = [
+            "ns=12380;s=九八零变电所80Z004照明回路_Ia",
+            "ns=12380;s=九八零变电所5105_IA",
+            "ns=12380;s=九八零变电所5101_UB",
+            # 添加其他节点地址...
+        ];
+
+        $pyPath = "/home/python_proj/python_custom_script/zaoquan/dcs/";
+        $pyFName = "test1.py";
+        $pyKeyWord = "/usr/bin/python311";
+
+        $pidsJson = json_encode($pids);
+
+        $command = "$pyKeyWord {$pyPath}{$pyFName}". ' ' . escapeshellarg("{$pidsJson}");
+        // $output = shell_exec($command);
+
+        // return shell_exec($command);
+
+        try {
+            // 调用Python脚本
+            $output = shell_exec($command);
+
+            // 解析Python脚本返回的JSON数据
+            $data = json_decode($output, true);
+            $data['a'] = 'aaa';
+            // 返回JSON格式的数据给前端
+            header('Content-Type: application/json');
+            echo json_encode($data);
+        } catch (Exception $e) {
+            // 返回错误消息给前端
+            header('Content-Type: application/json');
+            echo json_encode(array("error" => $e->getMessage()));
+        }
+
+    }
+
     public function dcs_doorAction() {
 
         $rawArr = $this->getpostarr();
 
-        $groupArr = m("dcs_group")->getall("1=1");
+        $groupArr = m("dcs_group")->getall("1=1 and is_show=1");
         $rowArr = ["nav"=>[]];
         $pcon = 0;
         for ($i = 0; $i < count($groupArr); $i++) {
@@ -26,8 +69,9 @@ class openDcsApiClassAction extends openapiAction
                     if ($crow['pid'] == $row['id']) {
                         $rowArr["nav"][$pcon]["list"][] = [
                             "icon" => URL.(empty($crow['icon']) ? $row['icon'] : $crow['icon']),
-                            "module"=>$crow['key'],
-                            "name"=>$crow['name']
+                            "module"=>$row['key'],
+                            "name"=>$crow['name'],
+                            "sys_code"=>$crow['key'],
                         ];
                     }
                 }

+ 0 - 54
webmain/task/openapi/openDcsOpcAction.php

@@ -1,54 +0,0 @@
-<?php
-
-/**
- *    会议相关
- *    请求地址如:http://oa.test/api.php?m=openmeet&a=test&openkey=fee5efd3a93ca5c6a85b679cde60faa2
- */
-class openDcsOpcClassAction extends openapiAction
-{
-
-    public function testAction() {
-                
-        // $shell = "echo 'success' ";
-        // $shellExec = shell_exec($shell);
-        // // var_dump($shellExec);
-        // if($shellExec){echo 'ok';} else {echo 'error'}
-        
-        $pids = [
-            "ns=12380;s=九八零变电所80Z004照明回路_Ia",
-            "ns=12380;s=九八零变电所5105_IA",
-            "ns=12380;s=九八零变电所5101_UB",
-            # 添加其他节点地址...
-        ];
-        
-        $pyPath = "/home/python_proj/python_custom_script/zaoquan/dcs/";
-        $pyFName = "test1.py";
-        $pyKeyWord = "/usr/bin/python311";
-        
-        $pidsJson = json_encode($pids);
-
-        $command = "$pyKeyWord {$pyPath}{$pyFName}". ' ' . escapeshellarg("{$pidsJson}");
-        // $output = shell_exec($command);
-
-        // return shell_exec($command);
-        
-        try {
-            // 调用Python脚本
-            $output = shell_exec($command);
-            
-            // 解析Python脚本返回的JSON数据
-            $data = json_decode($output, true);
-            $data['a'] = 'aaa';
-            // 返回JSON格式的数据给前端
-            header('Content-Type: application/json');
-            echo json_encode($data);
-        } catch (Exception $e) {
-            // 返回错误消息给前端
-            header('Content-Type: application/json');
-            echo json_encode(array("error" => $e->getMessage()));
-        }
-
-    }
-
-
-}