From e38ea524ec4107ed7f8b1d7491a4177632dd3402 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 15 十月 2024 11:26:26 +0800
Subject: [PATCH] 部分代码修正

---
 src/api/fysp/taskApi.js |  106 +++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 94 insertions(+), 12 deletions(-)

diff --git a/src/api/fysp/taskApi.js b/src/api/fysp/taskApi.js
index 1d6a3d8..da5ef7a 100644
--- a/src/api/fysp/taskApi.js
+++ b/src/api/fysp/taskApi.js
@@ -5,29 +5,111 @@
    * 鑾峰彇椤跺眰浠诲姟
    */
   getTopTask() {
-    return $fysp.get('task/alltask/0');
+    return $fysp.get('task/alltask/0').then((res) => res.data);
+  },
+
+  /**
+   * 鑾峰彇鎬讳换鍔$殑鐩戠鍦烘櫙鐗堟湰淇℃伅
+   */
+  fetchMonitorObjectVersion(taskId) {
+    return $fysp.get(`monitorobjectversion/task/${taskId}`).then((res) => res.data);
+  },
+
+  /**
+   * 娣诲姞鐩戠瀵硅薄
+   */
+  addMonitorObject(objList) {
+    return $fysp.put(`monitorobjectversion/addlist`, objList).then((res) => res.data);
+  },
+
+  /**
+   * 鏇存柊鐩戠瀵硅薄
+   */
+  updateMonitorObject(objList) {
+    return $fysp.post(`monitorobjectversion/uplist`, objList).then((res) => res.data);
+  },
+
+  /**
+   * 鍒犻櫎鐩戠瀵硅薄
+   */
+  deleteMonitorObject(objList) {
+    return $fysp({
+      method: 'delete',
+      url: 'monitorobjectversion/deleteList',
+      data: objList
+    }).then((res) => res.data);
+  },
+
+  /**
+   * 鏌ヨ鎬讳换鍔�
+   * @param {Object} param
+   * @returns
+   */
+  fetchTopTasks(param) {
+    return $fysp.post('task/find', param).then((res) => res.data);
+  },
+
+  /**
+   * 鑾峰彇姣忔棩浠诲姟缁熻淇℃伅
+   * @param {String} topTaskId 鎬讳换鍔′富閿甶d
+   * @param {String} userId 鐢ㄦ埛id锛屽綋鐢ㄦ埛绫诲瀷userType涓�1锛堢洃绠$敤鎴凤級鏃讹紝浼氭牴鎹敤鎴穒d鑾峰彇鍏舵潈闄愬唴鐨勭粺璁′俊鎭�
+   * @param {String} userType 鐢ㄦ埛绫诲瀷锛�0锛氱鐞嗗憳锛�1锛氱洃绠$敤鎴凤紱2锛氭斂搴滈儴闂紱3锛氫紒涓�
+   */
+  fetchDayTasks(topTaskId, userId = '', userType = '0') {
+    return $fysp
+      .get(`task/dayTask/${topTaskId}?userId=${userId}&userType=${userType}`)
+      .then((res) => res.data);
   },
 
   /**
    * 鑾峰彇瀛愪换鍔$粺璁′俊鎭�
    */
   getSubtaskSummary({ topTaskId = undefined, sceneTypeId = undefined }) {
-    return $fysp.get('subtask/summary', {
-      params: {
-        topTaskId: topTaskId,
-        sceneTypeId: sceneTypeId
-      }
-    });
+    return $fysp
+      .get('subtask/summary', {
+        params: {
+          topTaskId: topTaskId,
+          sceneTypeId: sceneTypeId
+        }
+      })
+      .then((res) => res.data);
+  },
+
+  /**
+   * 鑾峰彇鍏蜂綋瀛愪换鍔′俊鎭�
+   * @param {String} dayTaskId 鏃ヤ换鍔′富閿甶d
+   * @param {String} userId 鐢ㄦ埛id锛屽綋鐢ㄦ埛绫诲瀷userType涓�1锛堢洃绠$敤鎴凤級鏃讹紝浼氭牴鎹敤鎴穒d鑾峰彇鍏舵潈闄愬唴鐨勭粺璁′俊鎭�
+   * @param {String} userType 鐢ㄦ埛绫诲瀷锛�0锛氱鐞嗗憳锛�1锛氱洃绠$敤鎴凤紱2锛氭斂搴滈儴闂紱3锛氫紒涓�
+   */
+  fetchSubtaskByDayTask(dayTaskId, userId = '', userType = '0') {
+    const params = `?dayTaskId=${dayTaskId}&userId=${userId}&userType=${userType}`;
+    return $fysp.get(`subtask/byDayTaskId${params}`).then((res) => res.data);
   },
 
   /**
    * 鑾峰彇瀛愪换鍔¢棶棰樿鎯�
    */
   getProBySubtask(id) {
-    return $fysp.get('problemlist/subtask', {
-      params: {
-        stGuid: id
-      }
-    });
+    return $fysp
+      .get('problemlist/subtask', {
+        params: {
+          stGuid: id
+        }
+      })
+      .then((res) => res.data);
+  },
+  /** 
+   * 閫氳繃鎬讳换鍔d鍜屾椂闂村尯闂磋幏鍙栧瓙浠诲姟鍒楄〃
+   */
+  async getByTopTaskAndDate({startTime, endTime, sceneTypeId, topTaskId}) {
+    const params = `?startTime=${startTime}&endTime=${endTime}&sceneTypeId=${sceneTypeId}&topTaskId=${topTaskId}`;
+    return await $fysp.get(`subtask/getSubTask${params}`).then((res) => res.data);
+  },
+  /** 
+   * 鑾峰彇鏌愪釜鍦烘櫙鐨勫贰鏌ヤ换鍔�
+   */
+  async getSubtaskByScene({startTime, endTime, sceneId}) {
+    const params = `?startTime=${startTime}&endTime=${endTime}&sceneId=${sceneId}`;
+    return await $fysp.get(`subtask/byScene${params}`).then((res) => res.data);
   }
 };

--
Gitblit v1.9.3