From 756be572e470c4a2e2e971350a545b3e8d9c0180 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 12 七月 2024 17:17:07 +0800 Subject: [PATCH] 2024.7.12 --- src/views/inspection/problem/ProblemTrack.vue | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/inspection/problem/ProblemTrack.vue b/src/views/inspection/problem/ProblemTrack.vue index 23ea39f..29cc15a 100644 --- a/src/views/inspection/problem/ProblemTrack.vue +++ b/src/views/inspection/problem/ProblemTrack.vue @@ -22,6 +22,7 @@ <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' @@ -36,13 +37,17 @@ return { subtaskList: [], 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() } } @@ -52,7 +57,7 @@ }, methods: { fetchSubtask() { - taskApi.fetchSubtaskSummaryByArea(this.areaStore.area).then((res) => { + taskApi.fetchSubtaskSummaryByArea(this.area).then((res) => { this.subtaskList = res.data }) }, @@ -67,6 +72,7 @@ }, mounted() { // this.fetchSubtask() + this.area = this.areaStore.area } } </script> -- Gitblit v1.9.3