From b292a0a81869547e94fd85e783f9597db241a87e Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 15 七月 2024 17:30:37 +0800
Subject: [PATCH] 2024.7.15

---
 src/views/inspection/problem/ProblemTrack.vue |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/views/inspection/problem/ProblemTrack.vue b/src/views/inspection/problem/ProblemTrack.vue
index 23ea39f..ebab9b2 100644
--- a/src/views/inspection/problem/ProblemTrack.vue
+++ b/src/views/inspection/problem/ProblemTrack.vue
@@ -1,11 +1,12 @@
 <template>
-  <div class="border-r-small">
+  <!-- <div class="border-r-small"> -->
+  <BaseCard>
     <div class="font-large">闂鏁存敼璺熻釜</div>
     <div>
       <el-row justify="end">
         <OptionTime v-model="time" type="date"></OptionTime>
       </el-row>
-      <ProblemSummary :data="subtaskList"></ProblemSummary>
+      <ProblemSummary :data="subtaskList" :proStatistic="proStatistic"></ProblemSummary>
       <ProblemTable :data="subtaskList"></ProblemTable>
     </div>
     <el-collapse v-model="activeNames" @change="handleChange">
@@ -16,12 +17,14 @@
         <ProblemType ref="pTypeRef"></ProblemType>
       </el-collapse-item>
     </el-collapse>
-  </div>
+  </BaseCard>
+  <!-- </div> -->
 </template>
 
 <script>
 import { useAreaStore } from '@/stores/area.js'
 import { mapStores } from 'pinia'
+import dayjs from 'dayjs'
 
 import ProblemTable from './component/ProblemTable.vue'
 import ProblemSummary from './component/ProblemSummary.vue'
@@ -29,21 +32,33 @@
 import ProblemType from './component/ProblemType.vue'
 
 import taskApi from '@/api/fysp/taskApi.js'
+import problemApi from '@/api/fysp/problemApi.js'
 
 export default {
   components: { ProblemSummary, ProblemTable, ProblemChangeChart, ProblemType },
   data() {
     return {
+      // 鍗曟棩浠诲姟璇︽儏
       subtaskList: [],
+      // 鍗曟棩闂缁熻
+      proStatistic: [],
+      // 鎶樺彔妗嗘縺娲诲悕绉伴泦鍚�
       activeNames: ['1', '2'],
-      time: ''
+      // 褰撳墠鏃堕棿
+      time: '',
+      // 绛涢�夊尯鍩熸潯浠�
+      area: {}
     }
   },
   watch: {
     time(nV, oV) {
       if (nV != oV) {
-        this.areaStore.setTimeOneDay(nV)
+        const d = nV ? dayjs(nV) : dayjs()
+        this.area.starttime = d.startOf('day').format('YYYY-MM-DD HH:mm:ss')
+        this.area.endtime = d.endOf('day').format('YYYY-MM-DD HH:mm:ss')
+        // this.areaStore.setTimeOneDay(nV)
         this.fetchSubtask()
+        this.fetchDayProblemsStatistic()
       }
     }
   },
@@ -52,8 +67,16 @@
   },
   methods: {
     fetchSubtask() {
-      taskApi.fetchSubtaskSummaryByArea(this.areaStore.area).then((res) => {
+      taskApi.fetchSubtaskSummaryByArea(this.area).then((res) => {
         this.subtaskList = res.data
+      })
+    },
+    fetchDayProblemsStatistic() {
+      // this.fetchData((page, pageSize) => {
+      //   return
+      // })
+      problemApi.fetchProblemsStatistic(this.area).then((res) => {
+        this.proStatistic = res
       })
     },
     handleChange(val) {
@@ -67,6 +90,7 @@
   },
   mounted() {
     // this.fetchSubtask()
+    this.area = this.areaStore.area
   }
 }
 </script>

--
Gitblit v1.9.3