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/monitor/face/index.vue |   86 +++++++++++++++++-------------------------
 1 files changed, 35 insertions(+), 51 deletions(-)

diff --git a/src/views/system/monitor/face/index.vue b/src/views/system/monitor/face/index.vue
index 830997a..11ceac1 100644
--- a/src/views/system/monitor/face/index.vue
+++ b/src/views/system/monitor/face/index.vue
@@ -22,14 +22,6 @@
               <p>寮傚父鏁�</p >
             </div>
             <div class="dashboard-item">
-              <h3>{{ count.totalViews }}</h3>
-              <p>鐢熸垚寮傚父宸ュ崟鏁�</p >
-            </div>
-            <div class="dashboard-item">
-              <h3>{{ count.totalFace }}</h3>
-              <p>鎶撴媿鏁版嵁鎬婚噺</p >
-            </div>
-            <div class="dashboard-item">
               <h3>{{ count.viewsPercentage }}%</h3>
               <p>璁惧杩愯鐜�</p >
             </div>
@@ -52,15 +44,14 @@
           v-model="queryParams.address"
           placeholder="璇烽�夋嫨鍖哄煙"
           clearable
+          @change="handleQuery"
         >
-          <el-option label="鑷础甯�" value="鑷础甯�"/>
-          <el-option label="娌挎哗鍖�" value="娌挎哗鍖�"/>
-          <el-option label="澶у畨鍖�" value="澶у畨鍖�"/>
-          <el-option label="璐′簳鍖�" value="璐′簳鍖�"/>
-          <el-option label="鑷祦浜曞尯" value="鑷祦浜曞尯"/>
-          <el-option label="楂樻柊鍖�" value="楂樻柊鍖�"/>
-          <el-option label="鑽e幙" value="鑽e幙"/>
-          <el-option label="瀵岄『鍘�" value="瀵岄『鍘�"/>
+        <el-option
+            v-for="dept in deptList"
+            :key="dept.deptId"
+            :label="dept.area"
+            :value="dept.deptId"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="璁惧鐘舵��" prop="onState">
@@ -78,29 +69,14 @@
         />
         </el-select>
       </el-form-item>
-       <el-form-item label="鏄惁鐢熸垚寮傚父宸ュ崟" prop="defaultOrder" label-width="130px">
-         <el-select
-           v-model="queryParams.defaultOrder"
-           placeholder="鏄惁鐢熸垚寮傚父宸ュ崟"
-           clearable
-           style="width: 170px"
-         >
-         <el-option
-           v-for="dict in dict.type.platform_yes_no"
-           :key="dict.value"
-           :label="dict.label"
-           :value="dict.value"
-         />
-         </el-select>
-        </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">鎼滅储</el-button>
+        <el-button icon="el-icon-refresh" size="small" @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="warning"
           plain
@@ -109,30 +85,31 @@
           @click="handleExport"
           v-hasPermi="['system:monitor:export']"
         >瀵煎嚭</el-button>
-      </el-col>
+      </el-col> -->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monitorList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" align="center" />
       <el-table-column label="璁惧鍚嶇О" align="center" prop="name" width="280" fixed show-overflow-tooltip/>
       <el-table-column label="璁惧缂栫爜" align="center" prop="serialNumber" width="180"/>
-      <el-table-column label="鏍囩" align="center" prop="publicSecurity" width="180" v-if="columns[0].visible"/>
-      <el-table-column label="鍖哄煙" align="center" prop="address" width="180" v-if="columns[1].visible"/>
+      <el-table-column label="鏍囩" align="center" width="180" v-if="columns[0].visible">
+        <template slot-scope="scope">
+          <div>{{ scope.row.provinceTag == 0 ? "鐪佸巺" : "甯傚眬" }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="鍖哄煙" align="center" prop="area" width="180" v-if="columns[1].visible"/>
       <el-table-column label="璁惧鐘舵��" align="center" prop="onState" v-if="columns[2].visible">
       <template slot-scope="scope">
         <dict-tag :options="dict.type.camera_state" :value="scope.row.onState"/>
       </template>
       </el-table-column>
-      <el-table-column label="鏄惁鐢熸垚寮傚父宸ュ崟" align="center" prop="defaultOrder" width="180" v-if="columns[3].visible">
-      <template slot-scope="scope">
-        <dict-tag :options="dict.type.platform_yes_no" :value="scope.row.defaultOrder"/>
-      </template>
-      </el-table-column>
-      <el-table-column label="鏁版嵁鏃堕棿" align="center" prop="installedTime" width="180" v-if="columns[4].visible"/>
-      <el-table-column label="绠$悊鍗曚綅" align="center" prop="managementUnit" width="180" v-if="columns[5].visible"/>
-      <el-table-column label="鎶撴媿閲�" align="center" prop="a" width="180" v-if="columns[6].visible"/>
-      <el-table-column label="鎸佺画鏃犳暟鎹ぉ鏁�" align="center" prop="a" width="180" v-if="columns[7].visible"/>
+      <el-table-column label="鏄惁鐢熸垚寮傚父宸ュ崟" align="center" prop="error" width="180" v-if="columns[3].visible" />
+      <el-table-column label="鏁版嵁鏃堕棿" align="center" prop="mongoCreateTime" width="180" v-if="columns[4].visible"/>
+      <el-table-column label="绠$悊鍗曚綅" align="center" prop="unitName" width="180" v-if="columns[5].visible"/>
+      <el-table-column label="鎶撴媿閲�" align="center" prop="dataCount" width="180" v-if="columns[6].visible"/>
+      <el-table-column label="鏃堕挓鍑嗙‘鐜�" align="center" prop="clockPercent" width="180" v-if="columns[7].visible"/>
+      <el-table-column label="澶у浘鍙敤鐜�" align="center" prop="bigUsefulPercent" width="180" v-if="columns[8].visible"/>
+      <el-table-column label="浜鸿劯鍚堟牸鐜�" align="center" prop="faceEligPercent" width="180" v-if="columns[9].visible"/>
       <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"  fixed="right">
           <template slot-scope="scope">
             <el-button
@@ -190,8 +167,8 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
         <el-button @click="cancel">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
       </div>
     </el-dialog>
 
@@ -239,12 +216,13 @@
 
 <script>
 import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
-
+import { listDept } from "@/api/system/dept";
 export default {
   name: "Monitor",
   dicts: ['sys_normal_disable','platform_yes_no','camera_state'],
   data() {
     return {
+      deptList: [],
       // 鍒椾俊鎭�
       columns: [
         { key: 0, label: `鏍囩`, visible: true },
@@ -254,7 +232,9 @@
         { key: 4, label: `鏁版嵁鏃堕棿`, visible: true },
         { key: 5, label: `绠$悊鍗曚綅`, visible: true },
         { key: 6, label: `鎶撴媿閲廯, visible: true },
-        { key: 7, label: `鎸佺画鏃犳暟鎹ぉ鏁癭, visible: true }
+        { key: 7, label: `鏃堕挓鍑嗙‘鐜嘸, visible: true },
+        { key: 8, label: `澶у浘鍙敤鐜嘸, visible: true },
+        { key: 9, label: `浜鸿劯鍚堟牸鐜嘸, visible: true }
       ],
       count: {
         totalPosts: 0,
@@ -317,6 +297,9 @@
   created() {
     this.getVideoCount();
     this.getList();
+    listDept({ status: 0 }).then(response => {
+      this.deptList = response.data.filter(item => item.area);
+    });
   },
   methods: {
     /** 鏌ヨ璁惧璧勪骇鍒楄〃 */
@@ -361,6 +344,7 @@
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
+      this.queryParams.address = '';
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -443,7 +427,7 @@
   display: flex;
   justify-content: center;
   align-items: center;
-  border-radius: 4px;
+  border-radius: 10px;
   width: 130px;
   height: 80px;
   margin-left: 5%;

--
Gitblit v1.8.0