| | |
| | | <template> |
| | | <BaseCard title="任务监控"> |
| | | <!-- <template #expand> --> |
| | | <!-- <SupervisionVisual></SupervisionVisual> --> |
| | | <!-- </template> --> |
| | | <!-- <template #expand> |
| | | <SupervisionVisual></SupervisionVisual> |
| | | </template> --> |
| | | <el-scrollbar ref="scrollbarRef"> |
| | | <!-- <el-row justify="space-evenly"> |
| | | <el-statistic title="今日完成" :value="10"> </el-statistic> |
| | | <el-statistic title="本周完成" :value="10"> </el-statistic> |
| | | </el-row> --> |
| | | <!-- <el-row> --> |
| | | <TaskItem v-for="item in tasks" :key="item.guid" v-bind="item"></TaskItem> |
| | | <TaskItem v-for="item in tasks" :key="item.guid" :value="item"></TaskItem> |
| | | <!-- <TaskSummary></TaskSummary> --> |
| | | <!-- </el-row> --> |
| | | |
| | | <!-- <el-row> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | /** |
| | | * 1. 按照场景类型进行统计展示 |
| | | */ |
| | | import { inject, ref, onMounted, computed } from 'vue' |
| | | import { unCalc } from '@/utils/css-util' |
| | | |
| | | import SelfInspection from '@/views/inspection/SelfInspection.vue' |
| | | import JointEnforcement from '@/views/inspection/JointEnforcement.vue' |
| | | import SupervisionVisual from '@/views/visualization/SupervisionVisual.vue' |
| | | import TaskSummary from '@/views/management/TaskSummary.vue' |
| | | |
| | | import { useSubtaskStore } from '@/stores/subtask.js' |
| | | |
| | | import taskApi from '@/api/fysp/taskApi.js' |
| | | |
| | | /** |
| | | * 任务完成情况 |
| | |
| | | const subtaskStore = useSubtaskStore() |
| | | const tasks = ref([]) |
| | | const sceneTaskMap = ref(new Map()) |
| | | const subtaskLoading = ref(false) |
| | | |
| | | function onGetTaskInfo(tInfoList) { |
| | | const resList = [] |
| | | |
| | | tInfoList.forEach((tInfo) => { |
| | | const _sceneTaskMap = new Map() |
| | | // 有巡查进度的场景类型的总完成量(针对某些场景类型不做巡查但依旧在计划中的情况) |
| | | let _totaltask = 0, |
| | | _completetask = 0 |
| | | |
| | | // 将各场景类型的巡查量 |
| | | for (const key in tInfo.totaltaskByScene) { |
| | | const e = tInfo.totaltaskByScene[key] |
| | | _sceneTaskMap.set(key, { |
| | | const v = { |
| | | sceneType: key, |
| | | total: e, |
| | | finish: tInfo.completetaskByScene[key] ? tInfo.completetaskByScene[key] : 0 |
| | | }) |
| | | } |
| | | _sceneTaskMap.set(key, v) |
| | | if (v.finish > 0) { |
| | | _totaltask += v.total |
| | | _completetask += v.finish |
| | | } |
| | | } |
| | | // const total = tInfo.totaltask |
| | | // tInfo.subTaskSummary.forEach((s) => { |
| | | // if (!_sceneTaskMap.has(s.scene.type)) { |
| | | // _sceneTaskMap.set(s.scene.type, { |
| | | // sceneType: s.scene.type, |
| | | // total: total, |
| | | // finish: 0 |
| | | // }) |
| | | // } |
| | | // const st = _sceneTaskMap.get(s.scene.type) |
| | | // st.finish++ |
| | | // }) |
| | | |
| | | const task = { |
| | | name: tInfo.name, |
| | | province: tInfo.provinceName, |
| | | district: tInfo.districtName, |
| | | totaltask: tInfo.totaltask, |
| | | completetask: tInfo.completetask, |
| | | // name: tInfo.name, |
| | | // province: tInfo.provinceName, |
| | | // district: tInfo.districtName, |
| | | // totaltask: tInfo.totaltask, |
| | | // completetask: tInfo.completetask, |
| | | ...tInfo, |
| | | _totaltask, |
| | | _completetask, |
| | | count: [] |
| | | } |
| | | |
| | |
| | | tasks.value = resList |
| | | } |
| | | |
| | | const area = { |
| | | provincecode: null, |
| | | provincename: '上海市', |
| | | citycode: undefined, |
| | | cityname: undefined, |
| | | districtcode: undefined, |
| | | districtname: undefined, |
| | | starttime: '2025-06-01 00:00:00', |
| | | endtime: '2025-06-30 23:59:59', |
| | | scensetypeid: undefined |
| | | } |
| | | function cal() { |
| | | subtaskStore.onAllTaskRefreshed(onGetTaskInfo) |
| | | subtaskLoading.value = true |
| | | taskApi |
| | | .fetchTopTaskProgress(area) |
| | | .then((res) => { |
| | | if (res.data.length == 0) return |
| | | onGetTaskInfo(res.data) |
| | | }) |
| | | .finally(() => (subtaskLoading.value = false)) |
| | | // subtaskStore.onAllTaskRefreshed(onGetTaskInfo) |
| | | } |
| | | |
| | | onMounted(() => { |