From 9f34f63158cee4c7e4e097d3da00a583abe3ebcd Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 02 九月 2024 23:10:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/data-manage/data-detail/index.vue |  121 +++++++++++++++++++++++++++------------
 1 files changed, 83 insertions(+), 38 deletions(-)

diff --git a/src/views/system/data-manage/data-detail/index.vue b/src/views/system/data-manage/data-detail/index.vue
index 63842fe..33cf76e 100644
--- a/src/views/system/data-manage/data-detail/index.vue
+++ b/src/views/system/data-manage/data-detail/index.vue
@@ -8,10 +8,13 @@
               <i :class="card.icon"></i>
             </div>
           </div>
-          <div v-for="data, index in card.dataList" class="dashboard-item" :key="data.label">
-            <div style="color: #5C9BF8;margin-bottom: 20px;font-size: 20px">{{ platformList.count[index] }}</div>
-            <div>{{ data.label }}</div>
+          <div v-if="card.dataList && card.dataList.length > 0">
+            <div v-if="data" v-for="(data, index) in card.dataList" class="dashboard-item" :key="data.label">
+              <div style="color: #5C9BF8;margin-bottom: 20px;font-size: 20px">{{ tableData.count[index] }}</div>
+              <div>{{ data.label }}</div>
+            </div>
           </div>
+
         </div>
         <!--        <el-col :span="1">-->
         <!--          <div class="dashboard-item">-->
@@ -22,26 +25,32 @@
       </el-row>
     </el-card>
 
-    <!--    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
-    <!--      <el-form-item label="鍗″彛缂栧彿" prop="bayonetNumber">-->
-    <!--        <el-input v-model="queryParams.bayonetNumber" placeholder="璇疯緭鍏ュ崱鍙g紪鍙�" clearable-->
-    <!--          @keyup.enter.native="handleQuery" />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item label="鍗″彛鍚嶇О" prop="bayonetName">-->
-    <!--        <el-input v-model="queryParams.bayonetName" placeholder="璇疯緭鍏ュ崱鍙e悕绉�" clearable @keyup.enter.native="handleQuery" />-->
-    <!--      </el-form-item>-->
-    <!--      <el-form-item>-->
-    <!--        <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-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="鍏抽敭璇�" prop="bayonetNumber">
+        <el-input v-model="queryParams.keyword" placeholder="鍏抽敭璇嶆悳绱�" clearable
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="鏃堕棿鑼冨洿" prop="timeRange">
+        <el-date-picker
+          v-model="queryParams.timeRange"
+          type="daterange"
+          range-separator="鑷�"
+          start-placeholder="寮�濮嬫棩鏈�"
+          end-placeholder="缁撴潫鏃ユ湡">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <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" v-show="index === 'image_resource_security'">
       <el-container>
         <el-main>
           <h2>瑙嗛鍥惧儚璧勬簮瀹夊叏绠$悊</h2>
           <el-row :gutter="20">
-            <el-col :xl="3" :lg="3" :md="6" :sm="6" :xs="12" v-for="(item, index) in imageResourceSecurity" :key="index"
+            <el-col :xl="3" :lg="3" :md="6" :sm="6" :xs="12" v-if="imageResourceSecurity && imageResourceSecurity.length > 0" v-for="(item, index) in imageResourceSecurity" :key="index"
               class="col-margin">
               <el-card style="
                 min-width: 150px;
@@ -73,9 +82,12 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="platformList.list">
-      <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead" :key="index" />
-    </el-table>
+    <div v-if="tableData.list && tableData.list.length >0">
+      <el-table v-loading="loading" :data="tableData.list">
+        <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead" :key="index" v-if="item"/>
+      </el-table>
+    </div>
+    <el-empty v-else description="鏆傛棤鏁版嵁"></el-empty>
 
     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
       @pagination="getList" />
@@ -103,7 +115,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="cancel">鍙� 娑�</el-button>
+        <el-button @click="cancelR">鍙� 娑�</el-button>
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
       </div>
     </el-dialog>
@@ -137,8 +149,27 @@
 import { getToken } from "@/utils/auth";
 export default {
   name: "Platform",
+  // watch: {
+  //   tableData: {
+  //     immediate: true,
+  //     deep: true,
+  //     handler(newVal) {
+  //       if(newVal && newVal.list) {
+  //         this.list = newVal.detail;
+  //       }
+  //     }
+  //   }
+  // },
+  // computed: {
+  //   startTime() {
+  //     var date = new Date();
+  //     var s1 = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + (date.getDate()-1);
+  //     return s1;
+  //   }
+  // },
   data() {
     return {
+      list: [],
       // 瀵煎叆鍙傛暟
       upload: {
         // 鏄惁鏄剧ず寮瑰嚭灞�
@@ -171,8 +202,9 @@
       showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
-      // 鍗″彛杩囪溅鏁版嵁涓�鑷存�ц〃鏍兼暟鎹�
-      platformList: [],
+      tableData: {
+        list: []
+      },
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
@@ -181,9 +213,8 @@
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        regionCode: null,
-        bayonetName: null,
-        bayonetNumber: null,
+        keyword: '',
+        timeRange: [],
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -205,26 +236,35 @@
           { required: true, message: "璇疯緭鍏ヨ棰戜紶杈撶綉鍗遍櫓璧勪骇姣斾緥", trigger: "blur" },
           { type: "number", message: "瑙嗛浼犺緭缃戝嵄闄╄祫浜ф瘮渚嬪繀椤讳负鏁板瓧", trigger: "blur" }
         ],
-        boundaryIntegrity: [
-          { required: true, message: "璇疯緭鍏ヨ棰戜紶杈撶綉杈圭晫瀹屾暣鎬ф娴嬫墸鍒嗛」", trigger: "blur" },
-          { type: "number", message: "瑙嗛浼犺緭缃戣竟鐣屽畬鏁存�ф娴嬫墸鍒嗛」蹇呴』涓烘暟瀛�", trigger: "blur" }
-        ]
+
       },
       tableHead: [],
       cardList: [],
       index: null
     };
   },
-  beforeRouteEnter(to, from, next) {
-    console.log(to);
-    next();
-  },
-  created() {
+  mounted() {
+    // 鑾峰彇褰撳墠鏃ユ湡
+    const today = new Date();
+
+    // 灏嗘棩鏈熷噺鍘讳竴澶�
+    const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
+
+    // 鑾峰彇骞淬�佹湀銆佹棩
+    const year = yesterday.getFullYear();
+    let month = (yesterday.getMonth() + 1).toString().padStart(2, '0'); // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ュ姞1
+    let day = yesterday.getDate().toString().padStart(2, '0');
+
+    // 鎷兼帴鎴� yyyy-MM-dd 鏍煎紡
+    let yesterday1 =  `${year}-${month}-${day}`;
+    this.queryParams.timeRange = [yesterday1, yesterday1]
     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;
+      console.log(this.cardList, "wcnm")
     }
     if (this.$route.query.type === '2') {
       let data = carData.table.filter(item => item.index === this.$route.query.index)[0]
@@ -265,7 +305,7 @@
       });
     },
     // 鍙栨秷鎸夐挳
-    cancel() {
+    cancelR() {
       this.resourceOpen = false;
       this.reset("resourceForm");
     },
@@ -282,14 +322,19 @@
       if (this.index === 'image_resource_security') {
         this.getSecurityCard()
       }
+      if (this.queryParams.timeRange && this.queryParams.timeRange.length > 0) {
+        this.queryParams.startTime = this.queryParams.timeRange[0]
+        this.queryParams.endTime = this.queryParams.timeRange[1]
+      }
       dataCenter(url, this.queryParams).then(response => {
-        this.platformList = response.data;
+        response.data.list = response.data.list && response.data.list.length >0 ? response.data.list : []
+        this.tableData = response.data;
         this.total = response.total;
         this.loading = false;
       });
     },
     // 鍙栨秷鎸夐挳
-    cancel() {
+    cancelImport() {
       this.open = false;
       this.reset();
     },

--
Gitblit v1.8.0