From db5872786c1e1697a59af41386136ee002bb68ad Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 30 六月 2023 17:17:12 +0800
Subject: [PATCH] 修改为汇丰默认图标,修改处理率计算方式

---
 src/views/hashrate/HashManage/components/EquipmentForm.vue |  175 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 82 insertions(+), 93 deletions(-)

diff --git a/src/views/hashrate/HashManage/components/EquipmentForm.vue b/src/views/hashrate/HashManage/components/EquipmentForm.vue
index 5522d29..2dbadfc 100644
--- a/src/views/hashrate/HashManage/components/EquipmentForm.vue
+++ b/src/views/hashrate/HashManage/components/EquipmentForm.vue
@@ -1,8 +1,6 @@
 <template>
   <div class="EquipmentForm">
-    <div class="back">
-      <span class="iconfont" @click="hiddenList">&#xe62c;</span>{{ name }}
-    </div>
+    <div class="back"><span class="iconfont" @click="hiddenList">&#xe62c;</span>{{ name }}</div>
     <div class="header">
       <div class="search">
         <el-input v-model="searchInput" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
@@ -29,34 +27,14 @@
         :fit="true"
         :stripe="true"
       >
-        <el-table-column
-          label="搴忓彿"
-          type="index"
-          align="center"
-          width="80"
-        ></el-table-column>
-        <el-table-column
-          label="鎽勫儚鏈哄悕绉�"
-          align="center"
-          show-overflow-tooltip
-        >
+        <el-table-column label="搴忓彿" type="index" align="center" width="80"></el-table-column>
+        <el-table-column label="鎽勫儚鏈哄悕绉�" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
-            <span>{{
-              scope.row.alias !== "" ? scope.row.alias : scope.row.name
-            }}</span>
+            <span>{{ scope.row.alias !== "" ? scope.row.alias : scope.row.name }}</span>
           </template>
         </el-table-column>
-        <el-table-column
-          label="鎽勫儚鏈哄湴鍧�"
-          prop="addr"
-          align="center"
-          show-overflow-tooltip
-        ></el-table-column>
-        <el-table-column
-          label="鎽勫儚鏈篒P"
-          prop="ip"
-          align="center"
-        ></el-table-column>
+        <el-table-column label="鎽勫儚鏈哄湴鍧�" prop="addr" align="center" show-overflow-tooltip></el-table-column>
+        <el-table-column label="鎽勫儚鏈篒P" prop="ip" align="center"></el-table-column>
         <el-table-column label="鎽勫儚鏈虹被鍨�" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.runType | cameraType }}</span>
@@ -64,9 +42,7 @@
         </el-table-column>
         <el-table-column label="鎵ц绠楁硶" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
-            <span v-if="scope.row.tasks != null">{{
-              scope.row.tasks | taskList
-            }}</span>
+            <span v-if="scope.row.tasks != null">{{ scope.row.tasks | taskList }}</span>
             <span v-else>-</span>
           </template>
         </el-table-column>
@@ -83,16 +59,16 @@
         </el-table-column>
         <el-table-column label="瀹炴椂/杞" align="center" width="100px">
           <template slot-scope="scope">
-            <span v-if="scope.row.runType === -1">-</span>
+            <span v-if="scope.row.runType == -1">-</span>
             <toggle-button
               v-else
-              :value="scope.row.runType === 1"
+              :value="scope.row.runType == 1"
               :width="60"
               :labels="{ checked: '瀹炴椂', unchecked: '杞' }"
               :color="{
                 checked: '#4D88FF',
                 unchecked: '#FF7733',
-                disabled: '#CCCCCC',
+                disabled: '#CCCCCC'
               }"
               :sync="true"
               @change="pollSwitch(scope.row)"
@@ -107,7 +83,7 @@
           :current-page="page"
           :page-size="size"
           layout="total, sizes, prev, pager, next, jumper"
-          :page-sizes="[5, 10, 15, 20, 25]"
+          :page-sizes="[5, 10, 15, 20, 25, 100]"
           :total="total"
           background
           :small="true"
@@ -115,27 +91,25 @@
       </div>
     </div>
 
-    <SettingBox
-      v-if="showSettingBox"
-      @close="showSettingBox = false"
-      :id="id"
-    ></SettingBox>
+    <SettingBox v-if="showSettingBox" @close="showSettingBox = false" :id="id"></SettingBox>
   </div>
 </template>
 
 <script>
-import SettingBox from "./SettingBox";
-import { getCameraByPage } from "@/api/clusterManage";
+import SettingBox from "./SettingBox"
+import { getCameraByPage } from "@/api/clusterManage"
+import { changeRunType } from "@/api/pollConfig"
+
 export default {
   props: {
     id: {},
-    name: {},
+    name: {}
   },
   components: {
-    SettingBox,
+    SettingBox
   },
   created() {
-    this.getDevice();
+    this.getDevice()
   },
   data() {
     return {
@@ -144,8 +118,8 @@
       dataList: [],
       page: 1,
       size: 10,
-      total: 100,
-    };
+      total: 100
+    }
   },
   methods: {
     async getDevice() {
@@ -153,78 +127,93 @@
         deviceId: this.id,
         inputText: this.searchInput,
         page: this.page,
-        size: this.size,
-      });
+        size: this.size
+      })
       if (res && res.success) {
-        this.dataList = res.data.lists;
-        this.total = res.data.total;
+        this.dataList = res.data.lists
+        this.total = res.data.total
       }
+
+      // let exportList = []
+
       // 鏍规嵁rtsp 鎻愬彇ip鍦板潃
-      const ipReg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
+      const ipReg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/
       this.dataList.forEach((cam) => {
+        // var cinfo = {
+        //   channel: cam.rtsp,
+        //   nama: cam.name,
+        //   task: cam.tasks
+        //     .map((task) => {
+        //       return task.taskname
+        //     })
+        //     .join(",")
+        // }
+
+        // exportList.push(cinfo)
+
         // 鍥芥爣鎽勫儚鏈轰笉鏄剧ずip
         if (cam.type === 1) {
-          cam.ip = "-";
-          return;
+          cam.ip = "-"
+          return
         }
-        let ip = ipReg.exec(cam.rtsp);
-        if (ip.length > 0) {
-          cam.ip = ip[0];
+        let ip = ipReg.exec(cam.rtsp)
+        if (ip && ip.length > 0) {
+          cam.ip = ip[0]
         }
-      });
+      })
+
+      // console.table(exportList)
     },
     handleSizeChange(size) {
-      this.size = size;
-      this.getDevice();
+      this.size = size
+      this.getDevice()
     },
     refrash(page) {
-      this.page = page;
-      this.getDevice();
+      this.page = page
+      this.getDevice()
     },
     hiddenList() {
-      this.$emit("hiddenList");
+      this.$emit("hiddenList")
     },
     pollSwitch(row) {
-      changeRunType({ camera_ids: [row.id], run_type: row.run_type ^ 1 }).then(
-        (rsp) => {
-          if (rsp && rsp.success) {
-            this.$notify({
-              type: "success",
-              message: "閰嶇疆鎴愬姛",
-            });
-
-            row.run_type = row.run_type ^ 1;
-          } else {
-            this.$notify({
-              type: "error",
-              message: "閰嶇疆澶辫触",
-            });
-          }
-
-          // this.PollData.fetchPollList();
+      row.runType = row.runType ^ 1
+      changeRunType({
+        camera_ids: [row.id],
+        run_type: row.runType ^ 1,
+        clusterId: row.clusterId
+      }).then((rsp) => {
+        if (rsp && rsp.success) {
+          this.$notify({
+            type: "success",
+            message: "閰嶇疆鎴愬姛"
+          })
+        } else {
+          this.$notify({
+            type: "error",
+            message: "閰嶇疆澶辫触"
+          })
         }
-      );
-    },
+
+        // this.PollData.fetchPollList();
+      })
+    }
   },
   filters: {
     cameraType(type) {
-      return type === -1 ? "鐩戞帶鎽勫儚鏈�" : "AI鎽勫儚鏈�";
+      return type === -1 ? "鐩戞帶鎽勫儚鏈�" : "AI鎽勫儚鏈�"
     },
     taskList(tasks) {
       return tasks
-        .filter((task) => {
-          return task.hasRule;
-        })
         .map((task) => {
-          return task.taskname;
+          return task.taskname
         })
-        .join(",");
+        .join(",")
     },
     switchText(type) {
-      return type ? "宸插紑鍚�" : "鏈紑鍚�";
-    },
-  },
-};
+      return type ? "宸插紑鍚�" : "鏈紑鍚�"
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -456,4 +445,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0