From c40f4c1267dae4fcf27dbbd75ea83014fba87783 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 15 七月 2025 15:28:21 +0800
Subject: [PATCH] 新增联合执法清单

---
 src/views/fysp/check/components/CompProRecent.vue |   55 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/src/views/fysp/check/components/CompProRecent.vue b/src/views/fysp/check/components/CompProRecent.vue
index 930bbbb..6305479 100644
--- a/src/views/fysp/check/components/CompProRecent.vue
+++ b/src/views/fysp/check/components/CompProRecent.vue
@@ -1,5 +1,5 @@
 <template>
-  <CompGenericWrapper type="dialog">
+  <CompGenericWrapper type="dialog" draggable :modal="false">
     <template #content>
       <el-tabs v-model="activeName" type="card">
         <el-tab-pane
@@ -57,7 +57,9 @@
 <script>
 import CompProblemAddOrUpd from './CompProblemAddOrUpd.vue';
 import taskApi from '@/api/fysp/taskApi';
+import problemApi from '@/api/fysp/problemApi';
 import { useCloned } from '@vueuse/core';
+import dayjs from 'dayjs';
 export default {
   computed: {
     // repeteRate() {
@@ -97,7 +99,7 @@
     }
   },
   components: {
-    CompProblemAddOrUpd,
+    CompProblemAddOrUpd
   },
   mounted() {},
   data() {
@@ -132,16 +134,13 @@
     updateSubtask() {},
     generateQueryParam() {
       // 浠婂ぉ鐨勬棩鏈�
-      const today = new Date();
+      const today = dayjs(this.subtask.stPlanTime);
       // 涓変釜鏈堝墠
-      const threeMonthsAgo = new Date(today);
-      threeMonthsAgo.setMonth(today.getMonth() - 3);
+      const threeMonthsAgo = today.subtract(3, 'month');
       // 璁$畻鍗婂勾鍓嶇殑鏃ユ湡
-      const sixMonthsAgo = new Date(today);
-      sixMonthsAgo.setMonth(today.getMonth() - 6);
+      const sixMonthsAgo = today.subtract(6, 'month');
       // 璁$畻涓�骞村墠鐨勬棩鏈�
-      const oneYearAgo = new Date(today);
-      oneYearAgo.setFullYear(today.getFullYear() - 1);
+      const oneYearAgo = today.subtract(1, 'year');
 
       return {
         startTime:
@@ -157,28 +156,32 @@
     /**
      * 鑾峰彇杩戞湡鎯呭喌
      * */
-    async getRecentPros() {
+    getRecentPros() {
       this.loading = true;
       this.subtaskCount = 0;
       // 鑾峰彇瀛愪换鍔″垪琛�
-      await taskApi
-        .getSubtaskByScene(this.generateQueryParam())
-        .then((subtasks) => {
-          this.curProList = [];
-          if (subtasks) {
-            subtasks.forEach((subtask) => {
-              // 鑾峰彇闂鍒楄〃
-              this.getProBySubtask(subtask);
-            });
-          }
-        });
-      // 棰濆澶勭悊
-      this.curProList.sort((o1, o2) => o2.getDate() - o1.getDate());
-      this.loading = false;
+      taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => {
+        this.curProList = [];
+        if (subtasks) {
+          const promiseList = [];
+          subtasks.forEach((subtask) => {
+            // 鑾峰彇闂鍒楄〃
+            promiseList.push(this.getProBySubtask(subtask));
+          });
+          Promise.all(promiseList)
+            .then(() => {
+              // 棰濆澶勭悊
+              this.curProList.sort((o1, o2) => {
+                return o2._time > o1._time;
+              });
+            })
+            .finally(() => (this.loading = false));
+        }
+      });
     },
     // 鏍规嵁瀛愪换鍔¤幏鍙栭噷闈㈢殑闂鍒楄〃
-    async getProBySubtask(subtask) {
-      taskApi.getProBySubtask(subtask.stGuid).then((pros) => {
+    getProBySubtask(subtask) {
+      return problemApi.getProBySubtask(subtask.stGuid).then((pros) => {
         if (pros) {
           pros.forEach((pro) => {
             if (pro.ptguid == this.deepCopyPro.ptguid) {

--
Gitblit v1.9.3