From 5ad61d6ad3a0ce12c7fe0808527069b09a7c9c0d Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 16 九月 2025 17:31:05 +0800 Subject: [PATCH] 新增基础产品 --- src/api/fysp/taskApi.js | 85 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 79 insertions(+), 6 deletions(-) diff --git a/src/api/fysp/taskApi.js b/src/api/fysp/taskApi.js index ba8a90b..189f0f1 100644 --- a/src/api/fysp/taskApi.js +++ b/src/api/fysp/taskApi.js @@ -2,10 +2,60 @@ export default { /** + * 鏂板缓浠诲姟 + * @param {Object} task + */ + putTask(task){ + return $fysp.put(`task/create`, task).then((res) => res.data); + }, + /** + * 鏍规嵁涓婚敭鑾峰彇鎬讳换鍔℃垨鏃ヤ换鍔� + */ + fetchTaskById(id){ + return $fysp.get(`task/${id}`).then((res) => res.data); + }, + + /** * 鑾峰彇椤跺眰浠诲姟 */ getTopTask() { return $fysp.get('task/alltask/0').then((res) => res.data); + }, + + getLastTopTask(task){ + return $fysp.post(`task/lastTask`, task).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); }, /** @@ -15,6 +65,18 @@ */ 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); }, /** @@ -32,10 +94,21 @@ }, /** + * 鑾峰彇鍏蜂綋瀛愪换鍔′俊鎭� + * @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); + }, + + /** * 鑾峰彇瀛愪换鍔¢棶棰樿鎯� */ - async getProBySubtask(id) { - return await $fysp + getProBySubtask(id) { + return $fysp .get('problemlist/subtask', { params: { stGuid: id @@ -46,15 +119,15 @@ /** * 閫氳繃鎬讳换鍔d鍜屾椂闂村尯闂磋幏鍙栧瓙浠诲姟鍒楄〃 */ - async getByTopTaskAndDate({startTime, endTime, sceneTypeId, topTaskId}) { + 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); + return $fysp.get(`subtask/getSubTask${params}`).then((res) => res.data); }, /** * 鑾峰彇鏌愪釜鍦烘櫙鐨勫贰鏌ヤ换鍔� */ - async getSubtaskByScene({startTime, endTime, sceneId}) { + getSubtaskByScene({startTime, endTime, sceneId}) { const params = `?startTime=${startTime}&endTime=${endTime}&sceneId=${sceneId}`; - return await $fysp.get(`subtask/byScene${params}`).then((res) => res.data); + return $fysp.get(`subtask/byScene${params}`).then((res) => res.data); } }; -- Gitblit v1.9.3