riku
2024-07-12 756be572e470c4a2e2e971350a545b3e8d9c0180
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>