From e5fae45afc610c0cbc5620f2e9138e2188dcf243 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 16 一月 2025 12:20:29 +0800
Subject: [PATCH] 资产管理权限、工单故障显示优化

---
 src/views/system/data-manage/data-detail/index.vue |   76 +++++++++++++++++++++++++++++++++-----
 1 files changed, 66 insertions(+), 10 deletions(-)

diff --git a/src/views/system/data-manage/data-detail/index.vue b/src/views/system/data-manage/data-detail/index.vue
index 706b14b..6f8e038 100644
--- a/src/views/system/data-manage/data-detail/index.vue
+++ b/src/views/system/data-manage/data-detail/index.vue
@@ -76,15 +76,21 @@
     </el-row>
     <div style="display: flex;position: relative">
       <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-        <el-form-item label="鍏抽敭璇�" prop="bayonetNumber">
-          <el-input v-model="queryParams.keyword" placeholder="鍏抽敭璇嶆悳绱�" clearable @input="handleQuery"/>
+        <el-form-item label="鍏抽敭瀛�" prop="bayonetNumber">
+          <el-input v-model="queryParams.keyword" placeholder="鍥芥爣鐮�/璁惧鍚�/ip鎼滅储" clearable @keyup.enter.native="handleQuery" @clear="handleQuery"/>
+        </el-form-item>
+        <el-form-item :label="this.optionsName" prop="option" v-show = "this.optionsStatus">
+          <el-select  v-model="queryParams.option" size="small" clearable @change="handleQuery">
+            <el-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="鏃堕棿" prop="date">
             <el-date-picker
               v-model="queryParams.date"
               type="date"
               placeholder="閫夋嫨鏃ユ湡"
-              value-format="yyyy-MM-dd">
+              value-format="yyyy-MM-dd"
+              @change="handleQuery">
             </el-date-picker>
         </el-form-item>
         <el-form-item>
@@ -96,8 +102,14 @@
                      :columns="showList"></right-toolbar>
     </div>
 
+    <div  v-show="exportUrl" style="margin-bottom: 5px">
+      <el-button  slot="reference" type="primary" size="mini" @click="handleExport(exportUrl)" plain
+                 v-hasPermi="['platform:platform:export']">瀵煎嚭
+      </el-button>
+    </div>
+
     <div v-show="index === 'image_resource_security'" style="margin-bottom: 5px">
-        <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleExport"
+        <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleImport"
                    v-hasPermi="['platform:platform:export']">瀵煎叆
         </el-button>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -105,8 +117,14 @@
 
     <div>
       <el-table v-loading="loading" :data="tableData.list">
-        <el-table-column :prop="item.prop" :label="item.label" :width="item.width" v-for="(item, index) in tableHead"
-                         :key="index" v-if="showListPD(item)"/>
+<!--        <el-table-column :prop="item.prop" :label="item.label" :width="item.width" v-for="(item, index) in tableHead"-->
+<!--                         :key="index" v-if="showListPD(item)">-->
+        <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead"
+                         :key="index" v-if="showListPD(item)">
+          <template slot-scope="scope">
+            <span :class="{'error-text': scope.row[item.error]}"> {{ scope.row[item.prop] }} </span>
+          </template>
+        </el-table-column>
       </el-table>
     </div>
 
@@ -197,6 +215,7 @@
         url: process.env.VUE_APP_BASE_API + "/platform/resourceSecurity/importData"
       },
       imageResourceSecurity: [],
+      options: [],
       resourceForm: {},
       resourceOpen: false,
       totalKiosks: 1157,
@@ -229,6 +248,7 @@
         keyword: '',
         date: '',
         dataType: 0,
+        option: null,
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -255,10 +275,15 @@
       showList: [],
       tableHead: [],
       cardList: [],
-      index: null
+      index: null,
+      exportUrl: null,
     };
   },
+
   mounted() {
+    //淇敼椤电鍚�
+    const obj = Object.assign({},this.$route,{title: this.$route.query.ruleName})
+    this.$tab.updatePage(obj);
     // 鑾峰彇褰撳墠鏃ユ湡
     const today = new Date();
 
@@ -269,34 +294,56 @@
 
     // 鎷兼帴鎴� yyyy-MM-dd 鏍煎紡
     this.queryParams.date = `${year}-${month}-${day}`;
+    this.index = this.$route.query.index;
+
     if (this.$route.query.type === '1') {
       let data = videoData.table.filter(item => item.index === this.$route.query.index)[0]
       this.tableHead = data.columns;
       this.cardList = data.card;
       this.showList = data.showList;
+      this.optionsStatus = data.optionsStatus;
+      this.options = data.options;
+      this.optionsName = data.optionsName;
+      this.exportUrl = data.exportUrl
     }
     if (this.$route.query.type === '2') {
       let data = carData.table.filter(item => item.index === this.$route.query.index)[0]
       this.tableHead = data.columns;
       this.cardList = data.card;
       this.showList = data.showList;
+      this.optionsStatus = data.optionsStatus;
+      this.options = data.options;
+      this.optionsName = data.optionsName;
+      this.exportUrl = data.exportUrl
     }
     if (this.$route.query.type === '3') {
       let data = faceData.table.filter(item => item.index === this.$route.query.index)[0]
       this.tableHead = data.columns;
       this.cardList = data.card;
       this.showList = data.showList;
+      this.optionsStatus = data.optionsStatus;
+      this.options = data.options;
+      this.optionsName = data.optionsName;
+      this.exportUrl = data.exportUrl
     }
     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.showList = data.showList;
+      this.optionsStatus = data.optionsStatus;
+      this.options = data.options;
+      this.optionsName = data.optionsName;
+      this.exportUrl = data.exportUrl
     }
-    this.getDicts(this.$route.query.dict)
     this.getList();
   },
   methods: {
+    getColor(value, prop) {
+
+      // 榛樿棰滆壊
+      return 'red';
+    },
     clickTab(active) {
       this.queryParams.dataType = active
       this.getList()
@@ -389,9 +436,16 @@
       this.handleQuery();
     },
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
-    handleExport() {
+    handleImport() {
       this.upload.title = "鏁版嵁瀵煎叆";
       this.upload.open = true;
+    },
+    handleExport(url) {
+      this.download(url, {
+        ...this.queryParams,
+      }, this.$route.query.ruleName+`_${new Date().getTime()}.xlsx`, {
+        timeout: 60000
+      })
     },
     /** 涓嬭浇妯℃澘 */
     importTemplate() {
@@ -422,7 +476,9 @@
 .tab {
   padding: 5px 15px;
 }
-
+.error-text {
+  color: red;
+}
 .tab:hover {
   cursor: pointer;
   user-select: none;

--
Gitblit v1.8.0