From f20a554bdb24e9dfde9dc6a69d78595944f61d15 Mon Sep 17 00:00:00 2001
From: mark <mark18340872469@163.com>
Date: 星期二, 25 十月 2022 14:53:57 +0800
Subject: [PATCH] 设备管理 样式调整

---
 src/views/hashrate/HashManage/components/EquipmentForm.vue |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/src/views/hashrate/HashManage/components/EquipmentForm.vue b/src/views/hashrate/HashManage/components/EquipmentForm.vue
index 5522d29..bbf7174 100644
--- a/src/views/hashrate/HashManage/components/EquipmentForm.vue
+++ b/src/views/hashrate/HashManage/components/EquipmentForm.vue
@@ -83,10 +83,10 @@
         </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="{
@@ -126,6 +126,8 @@
 <script>
 import SettingBox from "./SettingBox";
 import { getCameraByPage } from "@/api/clusterManage";
+import { changeRunType } from "@/api/pollConfig";
+
 export default {
   props: {
     id: {},
@@ -185,25 +187,26 @@
       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: {

--
Gitblit v1.8.0