From 3908a403cb3a852bee96414a8bb82b88371e7b5a Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 22 十月 2024 11:42:33 +0800
Subject: [PATCH] 1. 任务调整模块修改(暂存)

---
 src/views/fysp/task/TaskManage.vue |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/views/fysp/task/TaskManage.vue b/src/views/fysp/task/TaskManage.vue
index 68efe34..a3e4f21 100644
--- a/src/views/fysp/task/TaskManage.vue
+++ b/src/views/fysp/task/TaskManage.vue
@@ -39,24 +39,26 @@
           <el-tabs model-value="first">
             <el-tab-pane label="鐩戠璁″垝" name="first">
               <el-row>
-                <el-col :span="curSubTaskList.length > 0 ? 16 : 24">
+                <el-col :span="curSubTaskList ? 16 : 24">
                   <CompMonitorPlan
                     :task="curTask.data"
                     @date-change="onDateChange"
                   ></CompMonitorPlan>
                 </el-col>
-                <el-col v-if="curSubTaskList.length > 0" :span="8">
+                <el-col v-if="curSubTaskList" :span="8">
                   <CompSubTaskList
+                    create
                     :data="curSubTaskList"
+                    :loading="subTaskLoading"
                     height="56vh"
                     @add="subTaskDrawer = true"
                   ></CompSubTaskList>
                 </el-col>
               </el-row>
             </el-tab-pane>
-            <el-tab-pane label="鐩戠鍦板浘" name="second">
+            <!-- <el-tab-pane label="鐩戠鍦板浘" name="second">
               <CompTaskMap></CompTaskMap>
-            </el-tab-pane>
+            </el-tab-pane> -->
           </el-tabs>
         </el-row>
         <el-divider></el-divider>
@@ -177,7 +179,8 @@
       // 褰撳墠閫夋嫨鐨勬棩浠诲姟
       curDayTask: {},
       // 褰撳墠閫夋嫨鐨勬棩浠诲姟涓嬬殑瀛愪换鍔�
-      curSubTaskList: [],
+      curSubTaskList: undefined,
+      subTaskLoading: false,
       // 鎬讳换鍔℃柊澧炲脊鍑烘
       topTaskAddVisible: false
     };
@@ -238,7 +241,7 @@
       this.task = task;
       this.sideLoading = false;
       this.mainLoading = true;
-      this.curSubTaskList = []
+      this.curSubTaskList = undefined;
       taskApi
         .fetchMonitorObjectVersion(task.data.tguid)
         .then((res) => {
@@ -268,11 +271,19 @@
       });
     },
     onDateChange(dayTask) {
-      // this.subTaskDrawer = true;
-      this.curDayTask = dayTask;
-      taskApi.fetchSubtaskByDayTask(dayTask.guid).then((res) => {
-        this.curSubTaskList = res;
-      });
+      if (dayTask) {
+        this.subTaskLoading = true;
+        // this.subTaskDrawer = true;
+        this.curDayTask = dayTask;
+        taskApi
+          .fetchSubtaskByDayTask(dayTask.guid)
+          .then((res) => {
+            this.curSubTaskList = res;
+          })
+          .finally(() => (this.subTaskLoading = false));
+      } else {
+        this.curSubTaskList = [];
+      }
     },
     navToTaskCreate(value) {
       this.topTaskAddVisible = false;

--
Gitblit v1.9.3