From 16eb67ab6b103663d30cad9ba74360f982e131cb Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 03 九月 2024 10:34:59 +0800
Subject: [PATCH] 自定义列显隐控制

---
 src/views/system/data-manage/index.vue |  408 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 371 insertions(+), 37 deletions(-)

diff --git a/src/views/system/data-manage/index.vue b/src/views/system/data-manage/index.vue
index eef8562..427d42f 100644
--- a/src/views/system/data-manage/index.vue
+++ b/src/views/system/data-manage/index.vue
@@ -3,16 +3,35 @@
     <div class="container">
       <el-row type="flex" justify="center">
         <el-col :span="24">
-          <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">浜鸿劯鏁版嵁寮傚父妫�娴�</h3>
+          <h3
+            style="
+              color: rgb(104, 104, 103);
+              padding-top: 20px;
+              padding-bottom: 20px;
+            "
+          >
+            瑙嗛杩愯鐩戞帶
+          </h3>
         </el-col>
       </el-row>
-
-      <el-row type="flex" justify="center">
-        <el-col :span="6" v-for="(item, index) in faceData" :key="index">
-          <el-link @click="handleDetail(item)">
-            <el-card style="width:150px;height: 150px;text-align: center;">
-              <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i>
-              <div>{{ item.name }}</div>
+      <el-row :gutter="20">
+        <el-col
+          :xl="4"
+          :lg="4"
+          :md="6"
+          :sm="6"
+          :xs="12"
+          v-for="(item, index) in videoData"
+          :key="index"
+          :style="item.ruleName == '' ? 'display:none' : ''"
+          class="col-margin"
+        >
+          <el-link @click="handleDetail(item, item.ruleIndex, item.apiUrl)" style="width: 100%">
+            <el-card
+              style="min-width: 150px;width:100%; height: 150px; text-align: center"
+            >
+              <i style="font-size: 40px; padding: 15px" :class="item.icon"></i>
+              <div>{{ item.ruleName }}</div>
             </el-card>
           </el-link>
         </el-col>
@@ -22,58 +41,373 @@
     <div class="container">
       <el-row type="flex" justify="center">
         <el-col :span="24">
-          <h3 style="color: rgb(104,104,103);padding-top: 20px;padding-bottom: 20px;">杞︿咯鏁版嵁寮傚父妫�娴�</h3>
+          <h3
+            style="
+              color: rgb(104, 104, 103);
+              padding-top: 20px;
+              padding-bottom: 20px;
+            "
+          >
+            杞﹁締杩愯鐩戞帶
+          </h3>
         </el-col>
       </el-row>
 
-      <el-row type="flex">
-        <el-col :span="6" v-for="(item, index) in carData" :key="index">
-          <el-link @click="handleDetail(item)">
-            <el-card style="width:150px;height: 150px;text-align: center;">
-              <i style="font-size: 40px;padding: 15px;" :class="item.icon"></i>
-              <div>{{ item.name }}</div>
+      <el-row :gutter="20">
+        <el-col
+          :xl="4"
+          :lg="4"
+          :md="6"
+          :sm="6"
+          :xs="12"
+          v-for="(item, index) in carData"
+          :key="index"
+          :style="item.ruleName == '' ? 'display:none' : ''"
+          class="col-margin"
+        >
+          <el-link @click="handleDetail(item, item.ruleIndex, item.apiUrl)" style="width: 100%">
+            <el-card style="min-width: 150px;width:100%; height: 150px; text-align: center">
+              <i style="font-size: 40px; padding: 15px" :class="item.icon"></i>
+              <div>{{ item.ruleName }}</div>
             </el-card>
           </el-link>
         </el-col>
       </el-row>
     </div>
+
+    <div class="container">
+      <el-row type="flex" justify="center">
+        <el-col :span="24">
+          <h3
+            style="
+              color: rgb(104, 104, 103);
+              padding-top: 20px;
+              padding-bottom: 20px;
+            "
+          >
+            浜鸿劯杩愯鐩戞帶
+          </h3>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col
+          :xl="4"
+          :lg="4"
+          :md="6"
+          :sm="6"
+          :xs="12"
+          v-for="(item, index) in faceData"
+          :key="index"
+          :style="item.ruleName == '' ? 'display:none' : ''"
+          class="col-margin"
+        >
+          <el-link @click="handleDetail(item, item.ruleIndex, item.apiUrl)" style="width: 100%">
+            <el-card style="min-width: 150px;width:100%; height: 150px; text-align: center">
+              <i style="font-size: 40px; padding: 15px" :class="item.icon"></i>
+              <div>{{ item.ruleName }}</div>
+            </el-card>
+          </el-link>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="container">
+      <el-row type="flex" justify="center">
+        <el-col :span="24">
+          <h3
+            style="
+              color: rgb(104, 104, 103);
+              padding-top: 20px;
+              padding-bottom: 20px;
+            "
+          >
+            璧勪骇绠$悊
+          </h3>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col
+          :xl="4"
+          :lg="4"
+          :md="6"
+          :sm="6"
+          :xs="12"
+          v-for="(item, index) in equipment"
+          :key="index"
+          :style="item.ruleName == '' ? 'display:none' : ''"
+          class="col-margin"
+        >
+          <el-link @click="jumpToEquipment" style="width: 100%">
+            <el-card style="min-width: 150px;width:100%; height: 150px; text-align: center">
+              <i style="font-size: 40px; padding: 15px" :class="item.icon"></i>
+              <div>{{ item.ruleName }}</div>
+            </el-card>
+          </el-link>
+        </el-col>
+      </el-row>
+      <br />
+    </div>
+    <br /><br /><br /><br />
   </div>
 </template>
 
 <script>
+import { listCheckRule } from "@/api/platform/check-rule";
 export default {
   data() {
     return {
-      faceData: [
-        { name: '浜鸿劯璇嗗埆鏃堕挓鍑嗙‘鎬�', icon: 'el-icon-alarm-clock', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
-        { name: '浜鸿劯鎶撴媿鏁版嵁鐩戞祴', icon: 'el-icon-user', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
-        { name: '浜鸿劯鏁版嵁瓒嬪娍鍒嗘瀽', icon: 'el-icon-data-line', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
-        { name: '浜鸿劯鎶撴媿璁惧娲昏穬鎬�', icon: 'el-icon-timer', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
-        { name: '浜鸿劯鎶撴媿涓婁紶鍙婃椂鎬�', icon: 'el-icon-money', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
-        { name: '浜鸿劯鎶撴媿澶у浘鍙敤鎬�', icon: 'el-icon-data-analysis', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' },
+      videoData: [
+        {
+          name: "骞冲彴鍦ㄧ嚎",
+          icon: "el-icon-connection",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "涓�鏈轰竴妗�",
+          icon: "el-icon-folder",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "鐐逛綅鍦ㄧ嚎",
+          icon: "el-icon-search",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "褰曞儚鍙敤",
+          icon: "el-icon-turn-off",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "瑙嗛鏍囨敞",
+          icon: "el-icon-place",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "閲嶇偣鎸囨尌鍥惧儚鍦ㄧ嚎鐜�",
+          icon: "el-icon-film",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "瑙嗛鍥惧儚璧勬簮瀹夊叏绠$悊",
+          icon: "el-icon-house",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "瑙嗛鍥惧儚璐ㄩ噺",
+          icon: "el-icon-set-up",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "",
+          icon: "el-icon-connection",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "",
+          icon: "el-icon-connection",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "",
+          icon: "el-icon-connection",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
+        {
+          name: "",
+          icon: "el-icon-connection",
+          description: "鎻忚堪淇℃伅",
+          type: "1",
+        },
       ],
       carData: [
-        { name: '鍗″彛杩囪溅鏁版嵁涓�鑷存��', icon: 'el-icon-truck', description: '鎻忚堪淇℃伅', routerUrl: '/car/vehicle-data-monitor/index' }
-      ]
-    }
+        {
+          name: "瑙嗗浘搴撳鎺ョǔ瀹氭��",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "鐐逛綅鍦ㄧ嚎鐜�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧url鍙敤鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        {
+          name: "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�",
+          icon: "el-icon-truck",
+          description: "鎻忚堪淇℃伅",
+          type: "2",
+        },
+        { name: "", icon: "el-icon-truck", description: "鎻忚堪淇℃伅", type: "2" },
+        { name: "", icon: "el-icon-truck", description: "鎻忚堪淇℃伅", type: "2" },
+      ],
+      faceData: [
+        {
+          name: "瑙嗗浘搴撳鎺ョǔ瀹氭��",
+          icon: "el-icon-alarm-clock",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "鐐逛綅鍦ㄧ嚎鐜�",
+          icon: "el-icon-user",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "鐩綍涓�鑷寸巼",
+          icon: "el-icon-data-line",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "浜鸿劯鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�",
+          icon: "el-icon-timer",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "璁惧鎶撴媿鍥剧墖鍚堟牸鎬�",
+          icon: "el-icon-money",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "璁惧鎶撴媿鍥剧墖鏃堕挓鍑嗙‘鎬�",
+          icon: "el-icon-data-analysis",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "鎶撴媿浜鸿劯鏁版嵁涓婁紶鍙婃椂鎬�",
+          icon: "el-icon-thumb",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "浜鸿劯鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�",
+          icon: "el-icon-pie-chart",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        {
+          name: "",
+          icon: "el-icon-data-line",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+        { name: "", icon: "el-icon-timer", description: "鎻忚堪淇℃伅", type: "3" },
+        { name: "", icon: "el-icon-money", description: "鎻忚堪淇℃伅", type: "3" },
+        {
+          name: "",
+          icon: "el-icon-data-analysis",
+          description: "鎻忚堪淇℃伅",
+          type: "3",
+        },
+      ],
+      equipment: [
+        {
+          ruleName: "璧勪骇绠$悊",
+          ruleIndex: 'assetManagement',
+          icon: "el-icon-wallet",
+          description: "鎻忚堪淇℃伅",
+          ruleCategory: "4",
+          apiUrl: 'assetManagement'
+        }
+      ],
+    };
+  },
+  mounted() {
+    this.getList();
   },
   methods: {
-    handleDetail(item) {
+    getList() {
+      listCheckRule().then((response) => {
+        this.videoData = response.data.videoRules;
+        this.faceData = response.data.faceRules;
+        this.carData = response.data.carRules;
+        this.loading = false;
+      });
+    },
+    jumpToEquipment() {
       this.$router.push({
-        path: item.routerUrl,
-        params: {
-          id: item.id
-        }
-      })
-    }
-  }
-}
+        path: '/equipment'
+      });
+    },
+    handleDetail(item, index, url) {
+      this.$router.push({
+        path: `/data-manage/data-detail/index/1/1?type=${item.ruleCategory}&index=${index}&url=${url}`,
+      });
+    },
+  },
+};
 </script>
 
 <style scoped>
 .container {
-  margin-left: 100px;
-  margin-right: 100px;
-  margin-top: 10px;
+  width: 90%;
+  margin: 10px auto;
+}
+
+.col-margin {
+  margin-bottom: 20px;
+}
+::v-deep .el-link--inner{
+  width: 100% !important;
 }
 </style>

--
Gitblit v1.8.0