From 2fde4b5e92cf74f7cf9b7a798ba52577753ef90d Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 16 八月 2024 16:55:32 +0800
Subject: [PATCH] 自定义列图标

---
 src/views/system/data-manage/data-detail/index.vue |   55 +++++++++++++++++++++++++++----------------------------
 1 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/src/views/system/data-manage/data-detail/index.vue b/src/views/system/data-manage/data-detail/index.vue
index b2d4cc6..fd1f243 100644
--- a/src/views/system/data-manage/data-detail/index.vue
+++ b/src/views/system/data-manage/data-detail/index.vue
@@ -2,22 +2,22 @@
   <div class="app-container">
     <el-card class="box-card">
       <el-row style="display: flex; flex-direction: row; align-items: center" justify="space-between">
-          <div v-for="card in cardList" style="display: flex;flex-direction: row; ">
-            <div>
-              <div class="icon-container">
-                <i :class="card.icon"></i>
-              </div>
-            </div>
-            <div v-for="data in card.dataList" class="dashboard-item">
-              <div style="color: #5C9BF8">{{ data.value }}</div>
-              <div>{{data.label}}</div>
+        <div v-for="card in cardList" style="display: flex;flex-direction: row; margin-right: 50px">
+          <div>
+            <div class="icon-container">
+              <i :class="card.icon"></i>
             </div>
           </div>
-<!--        <el-col :span="1">-->
-<!--          <div class="dashboard-item">-->
-<!--            <div style="width: 1px;height: 55px;border: 1px solid #D7EBFA;margin: 20px;"></div>-->
-<!--          </div>-->
-<!--        </el-col>-->
+          <div v-for="data in card.dataList" class="dashboard-item">
+            <div style="color: #5C9BF8;margin-bottom: 20px;font-size: 20px">{{ data.value }}</div>
+            <div>{{ data.label }}</div>
+          </div>
+        </div>
+        <!--        <el-col :span="1">-->
+        <!--          <div class="dashboard-item">-->
+        <!--            <div style="width: 1px;height: 55px;border: 1px solid #D7EBFA;margin: 20px;"></div>-->
+        <!--          </div>-->
+        <!--        </el-col>-->
         <el-col :span="8"></el-col>
       </el-row>
     </el-card>
@@ -57,10 +57,7 @@
     </el-row>
 
     <el-table v-loading="loading" :data="platformList" @selection-change="handleSelectionChange">
-      <template v-for="(item, index) in tableHead">
-        <el-table-column :key="item.name" :prop="item.prop" :label="item.label">
-        </el-table-column>
-      </template>
+      <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead" :key="index" />
 
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -103,7 +100,7 @@
 </template>
 
 <script>
-import { listPlatform, getPlatform, delPlatform, addPlatform, updatePlatform } from "@/api/platform/vehicle-data-monitor";
+import { dataCenter } from "@/api/platform/data-center";
 import { videoData, carData, faceData, equipment } from "./list";
 import store from '@/store';
 
@@ -165,8 +162,6 @@
       let data = videoData.table.filter(item => item.index === this.$route.query.index)[0]
       this.tableHead = data.columns;
       this.cardList = data.card;
-      console.log(data, "aaa")
-      console.log(this.cardList, "ddd")
     };
     if (this.$route.query.type === '2') {
       let data = carData.table.filter(item => item.index === this.$route.query.index)[0]
@@ -178,15 +173,19 @@
       this.tableHead = data.columns;
       this.cardList = data.card;
     }
-    if (this.$route.query.type === '4') this.tableHead = equipment[this.$route.query.index].columns;
-    this.getList();
+    if (this.$route.query.type === '4') {
+      let data = equipment.table.filter(item => item.index === this.$route.query.index)[0]
+      this.tableHead = data.columns;
+      this.cardList = data.card;
+    }
+    this.getList(this.$route.query.url);
   },
   methods: {
     /** 鏌ヨ鍗″彛杩囪溅鏁版嵁涓�鑷存�у垪琛� */
-    getList() {
+    getList(url) {
       this.loading = true;
-      listPlatform(this.queryParams).then(response => {
-        this.platformList = response.rows;
+      dataCenter(url, this.queryParams).then(response => {
+        this.platformList = response.data;
         this.total = response.total;
         this.loading = false;
       });
@@ -215,7 +214,7 @@
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
       this.queryParams.pageNum = 1;
-      this.getList();
+      this.getList(this.$route.query.url);
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
@@ -316,6 +315,6 @@
   flex-direction: column;
   justify-content: center;
   align-items: center;
-  width: 200px;
+  width: 150px;
 }
 </style>

--
Gitblit v1.8.0