<template>
|
<BaseCard title="任务监控">
|
<!-- <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>
|
<TaskSummary></TaskSummary>
|
<!-- </el-row> -->
|
|
<!-- <el-row>
|
<el-col :span="12">
|
<SelfInspection></SelfInspection>
|
</el-col>
|
<el-col :span="12">
|
<JointEnforcement></JointEnforcement>
|
</el-col>
|
</el-row> -->
|
</el-scrollbar>
|
</BaseCard>
|
</template>
|
|
<script setup>
|
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'
|
|
/**
|
* 任务完成情况
|
*/
|
const excludeMapHeight = inject('excludeMapHeight')
|
const height = ref(`calc(${unCalc(excludeMapHeight)} - 36px)`)
|
|
const subtaskStore = useSubtaskStore()
|
const tasks = ref([])
|
const sceneTaskMap = ref(new Map())
|
|
function onGetTaskInfo(tInfoList) {
|
const resList = []
|
|
tInfoList.forEach((tInfo) => {
|
const _sceneTaskMap = new Map()
|
for (const key in tInfo.totaltaskByScene) {
|
const e = tInfo.totaltaskByScene[key]
|
_sceneTaskMap.set(key, {
|
sceneType: key,
|
total: e,
|
finish: tInfo.completetaskByScene[key] ? tInfo.completetaskByScene[key] : 0
|
})
|
}
|
// 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,
|
count: []
|
}
|
|
for (const key of _sceneTaskMap.keys()) {
|
const value = _sceneTaskMap.get(key)
|
task.count.push(value)
|
}
|
resList.push(task)
|
})
|
|
tasks.value = resList
|
}
|
|
function cal() {
|
subtaskStore.onAllTaskRefreshed(onGetTaskInfo)
|
}
|
|
onMounted(() => {
|
cal()
|
})
|
</script>
|
|
<style scoped>
|
.text {
|
background-color: aliceblue;
|
}
|
</style>
|