From b2f563e557d7b19334b6591a00001e3fb522da21 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 13 六月 2025 17:05:44 +0800
Subject: [PATCH] 2025.6.13

---
 src/views/management/TaskStats.vue |  138 +++++++++++++++++++++++++++++++---------------
 1 files changed, 93 insertions(+), 45 deletions(-)

diff --git a/src/views/management/TaskStats.vue b/src/views/management/TaskStats.vue
index 509ba31..4b1860d 100644
--- a/src/views/management/TaskStats.vue
+++ b/src/views/management/TaskStats.vue
@@ -1,55 +1,103 @@
 <template>
-  <div class="border-r-small">
-    <div class="f-l">鍚勭洃绠″尯鍘跨殑宸℃煡瀹屾垚鎯呭喌</div>
-    <el-row>
+  <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>
-    </el-row>
-  </div>
+      <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>
-export default {
-  data() {
-    return {
-      tasks: []
-    }
-  },
-  watch: {},
-  methods: {},
-  mounted() {
-    let i = 0
-    while (i < 3) {
-      this.tasks.push({
-        guid: 'SMuheEkjswioSn7A',
-        name: '2024骞�6鏈堜笂娴峰競闈欏畨鍖哄贰鏌ヤ换鍔�',
-        district: '闈欏畨鍖�',
-        planTime: '2024-06',
-        startTime: '2024-06-01 00:00:00',
-        endTime: '2024-06-30 23:59:59',
-        userName: '鏈辨寮�#閭㈠瓙鐞�',
-        status: '姝e湪鎵ц',
-        count: [
-          {
-            sceneType: '宸ュ湴',
-            total: 90,
-            finish: 45
-          },
-          {
-            sceneType: '椁愰ギ',
-            total: 90,
-            finish: 45
-          },
-          {
-            sceneType: '姹戒慨',
-            total: 90,
-            finish: 45
-          }
-        ]
+<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
       })
-      i++
     }
-  }
+    // 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>

--
Gitblit v1.9.3