From 2e4133d2bbb0f4626cf336f3e456783b9fb7867e Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 04 八月 2022 02:40:08 +0800
Subject: [PATCH] 优化部分样式

---
 src/views/equipmentManagement/equipmentList/components/AddBox.vue |  190 ++++++++++++++---------------------------------
 1 files changed, 57 insertions(+), 133 deletions(-)

diff --git a/src/views/equipmentManagement/equipmentList/components/AddBox.vue b/src/views/equipmentManagement/equipmentList/components/AddBox.vue
index c4091d4..dc7f034 100644
--- a/src/views/equipmentManagement/equipmentList/components/AddBox.vue
+++ b/src/views/equipmentManagement/equipmentList/components/AddBox.vue
@@ -5,10 +5,7 @@
     <div class="close iconfont" @click="close()">&#xe60f;</div>
 
     <div class="search">
-      <el-input
-        v-model="searchContent"
-        placeholder="璇疯緭鍏ラ泦缇P/闆嗙兢鍚嶇О/璁惧IP/璁惧鍚嶇О"
-      ></el-input>
+      <el-input v-model="searchContent" placeholder="璇疯緭鍏ラ泦缇P/闆嗙兢鍚嶇О/璁惧IP/璁惧鍚嶇О"></el-input>
       <div class="button" @click="searchCluster">鎼滅储闆嗙兢</div>
       <div class="button" @click="searchDevice">鎼滅储璁惧</div>
     </div>
@@ -16,11 +13,7 @@
     <div class="clusterList">
       <div class="tableList" v-if="listType == 'cluster'">
         <div class="header">
-          <div
-            class="label"
-            v-for="(item, index) in clusterHeader"
-            :key="index"
-          >
+          <div class="label" v-for="(item, index) in clusterHeader" :key="index">
             {{ item }}
           </div>
         </div>
@@ -39,54 +32,21 @@
                   <!-- 娣诲姞 -->
                   <span v-if="!item.canAdd">-</span>
                   <template v-else>
-                    <span
-                      class="iconfont option"
-                      @click="showBox('cluster', item.clusterId)"
-                      >&#xe63f;</span
-                    >
+                    <span class="iconfont option" @click="showBox('cluster', item.clusterId)">&#xe63f;</span>
                     <!-- 闆嗙兢璇︽儏  -->
-                    <span
-                      class="iconfont option"
-                      @click="showChildrenLIst(index, item.clusterId)"
-                      >&#xe63e;</span
-                    >
+                    <span class="iconfont option" @click="showChildrenLIst(index, item.clusterId)">&#xe63e;</span>
                   </template>
                 </div>
               </div>
 
-              <div
-                class="overList"
-                :class="{ isShow: showClusterChild == index }"
-              >
-                <el-table
-                  :data="overList"
-                  :fit="true"
-                  header-row-class-name="overList-head"
-                >
-                  <el-table-column
-                    label="搴忓彿"
-                    type="index"
-                    width="146"
-                    class-name="index "
-                  >
-                  </el-table-column>
-                  <el-table-column
-                    prop="dev_id"
-                    label="璁惧ID"
-                    width="146"
-                  ></el-table-column>
+              <div class="overList" :class="{ isShow: showClusterChild == index }">
+                <el-table :data="overList" :fit="true" header-row-class-name="overList-head">
+                  <el-table-column label="搴忓彿" type="index" width="146" class-name="index "> </el-table-column>
+                  <el-table-column prop="dev_id" label="璁惧ID"></el-table-column>
 
-                  <el-table-column
-                    prop="dev_ip"
-                    label="璁惧IP"
-                    width="146"
-                  ></el-table-column>
+                  <el-table-column prop="dev_ip" label="璁惧IP" width="146"></el-table-column>
 
-                  <el-table-column
-                    prop="dev_name"
-                    label="璁惧鍚嶇О"
-                    width="240"
-                  ></el-table-column>
+                  <el-table-column prop="dev_name" label="璁惧鍚嶇О" width="240"></el-table-column>
                 </el-table>
 
                 <div class="iconfont" @click="showClusterChild = null">
@@ -99,38 +59,12 @@
         </div>
       </div>
 
-      <el-table
-        :data="equipmentList"
-        :fit="true"
-        v-if="listType == 'equipment'"
-      >
-        <el-table-column
-          label="搴忓彿"
-          type="index"
-          width="72"
-          class-name="index"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="devId"
-          label="璁惧ID"
-          width="107"
-        ></el-table-column>
-        <el-table-column
-          prop="devName"
-          label="璁惧鍚嶇О"
-          width="107"
-        ></el-table-column>
-        <el-table-column
-          prop="devIp"
-          label="璁惧IP"
-          width="107"
-        ></el-table-column>
-        <el-table-column
-          prop="clusterName"
-          label="鎵�灞為泦缇�"
-          width="107"
-        ></el-table-column>
+      <el-table :data="equipmentList" :fit="true" v-if="listType == 'equipment'">
+        <el-table-column label="搴忓彿" type="index" width="72" class-name="index"> </el-table-column>
+        <el-table-column prop="devId" label="璁惧ID"></el-table-column>
+        <el-table-column prop="devName" label="璁惧鍚嶇О" width="107"></el-table-column>
+        <el-table-column prop="devIp" label="璁惧IP" width="107"></el-table-column>
+        <el-table-column prop="clusterName" label="鎵�灞為泦缇�" width="107"></el-table-column>
         <el-table-column label="鐘舵��" width="107">
           <template slot-scope="scope">
             <div v-if="!scope.row.canAdd" class="status green">宸叉坊鍔�</div>
@@ -143,10 +77,7 @@
             <div class="options" v-if="scope">
               <!-- 娣诲姞 -->
               <span v-if="!scope.row.canAdd">-</span>
-              <span
-                v-else
-                class="iconfont option"
-                @click="showBox('dev', scope.row.devId, scope.row.clusterId)"
+              <span v-else class="iconfont option" @click="showBox('dev', scope.row.devId, scope.row.clusterId)"
                 >&#xe63f;</span
               >
             </div>
@@ -159,8 +90,7 @@
       <div class="title">鐢宠娣诲姞璁惧</div>
       <div class="des">
         <span class="iconfont">&#xe601;</span>
-        濡傝澶囧凡鍔犲叆闆嗙兢锛屾坊鍔犵鐞嗗悗闆嗙兢涓嬫墍鏈夎澶囧皢鍦ㄨ澶囩鐞�
-        椤甸潰鏄剧ず锛屽苟鏀寔淇℃伅鏌ョ湅鍙婄鐞嗐��
+        濡傝澶囧凡鍔犲叆闆嗙兢锛屾坊鍔犵鐞嗗悗闆嗙兢涓嬫墍鏈夎澶囧皢鍦ㄨ澶囩鐞� 椤甸潰鏄剧ず锛屽苟鏀寔淇℃伅鏌ョ湅鍙婄鐞嗐��
       </div>
       <div class="ask">瀵嗛挜淇℃伅璇疯闂澶囩鐞嗕汉鍛�</div>
       <el-input v-model="auth_password"></el-input>
@@ -173,13 +103,7 @@
 </template>
 
 <script>
-import {
-  findDeviceListAll,
-  findClustersBySearch,
-  getDevicesByCluster,
-  addCluster,
-  addDeviceToUser,
-} from "@/api/device";
+import { findDeviceListAll, findClustersBySearch, getDevicesByCluster, addCluster, addDeviceToUser } from "@/api/device"
 
 export default {
   data() {
@@ -193,41 +117,41 @@
       equipmentList: [],
       overList: [],
       auth_password: "", //鎺堟潈绉橀挜
-      addObj: {},
-    };
+      addObj: {}
+    }
   },
 
   methods: {
     close() {
-      this.$emit("close");
+      this.$emit("close")
     },
     async showChildrenLIst(index, id) {
       if (this.showClusterChild === index) {
-        this.showClusterChild = null;
-        return;
+        this.showClusterChild = null
+        return
       } else if (!index) {
-        this.showClusterChild = index;
+        this.showClusterChild = index
       }
-      this.showClusterChild = null;
+      this.showClusterChild = null
       setTimeout(() => {
-        this.showClusterChild = index;
-      }, 400);
+        this.showClusterChild = index
+      }, 400)
 
       const res = await getDevicesByCluster({
-        clusterId: id,
-      });
+        clusterId: id
+      })
       if (res && res.success) {
-        this.overList = res.data.list;
+        this.overList = res.data.list
       }
     },
     async getCluster() {
       const res = await findClustersBySearch({
         InputText: this.searchContent,
         Page: 1,
-        Size: 10000,
-      });
+        Size: 10000
+      })
       if (res && res.success) {
-        this.clusterList = res.data.list;
+        this.clusterList = res.data.list
       }
     },
 
@@ -235,57 +159,57 @@
       const res = await findDeviceListAll({
         InputText: this.searchContent,
         Page: 1,
-        Size: 10000,
-      });
+        Size: 10000
+      })
       if (res && res.success) {
-        this.equipmentList = res.data.list;
+        this.equipmentList = res.data.list
       }
     },
 
     searchCluster() {
-      this.getCluster();
-      this.listType = "cluster";
+      this.getCluster()
+      this.listType = "cluster"
     },
 
     searchDevice() {
-      this.getDevice();
-      this.listType = "equipment";
+      this.getDevice()
+      this.listType = "equipment"
     },
 
     async submit() {
-      let res = {};
+      let res = {}
       if (this.addObj.type == "cluster") {
         res = await addCluster({
           authPwd: this.auth_password,
-          clusterId: this.addObj.id,
-        });
+          clusterId: this.addObj.id
+        })
       } else {
         res = await addDeviceToUser({
           authPwd: this.auth_password,
           deviceId: this.addObj.id,
-          clusterId: this.addObj.cid,
-        });
+          clusterId: this.addObj.cid
+        })
       }
 
       if (res && res.success) {
         this.$notify({
           type: "success",
-          message: "娣诲姞鎴愬姛",
-        });
-        this.close();
+          message: "娣诲姞鎴愬姛"
+        })
+        this.close()
       }
     },
     showBox(type, id, cid) {
-      this.auth_password = "";
-      this.showPasswordBox = true;
+      this.auth_password = ""
+      this.showPasswordBox = true
       this.addObj = {
         type,
         id,
-        cid,
-      };
-    },
-  },
-};
+        cid
+      }
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -593,4 +517,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0