From 49d084254f77912b46b5abc3e82bc2f6a14a2363 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期三, 15 十一月 2023 11:05:58 +0800
Subject: [PATCH] feat: 修复工序运行时间不更新的问题; 选中已完成任务工序运行时间以选中任务为准

---
 src/api/index.ts |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)

diff --git a/src/api/index.ts b/src/api/index.ts
index c8e30e9..8c68113 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -2,11 +2,20 @@
 import type { CraftParamsResponse, TasksGroupByChannel } from './task'
 import type { PLCResponse } from './plc'
 import type { Devices } from './device'
+import type { CraftModel } from './craftModel'
+import type { Problem } from './problem'
 
 export interface BaseResponse<T = any> {
   code: number
   data: T
   msg: string
+}
+
+export interface ListResponse<T = any> {
+  code: number
+  data: T
+  msg: string
+  total: number
 }
 
 export interface TaskListParams {
@@ -105,3 +114,77 @@
     method: 'get'
   })
 }
+
+export interface SetCurrentDeviceParams {
+  currentDeviceID: string
+}
+
+/**
+ * 璁惧畾褰撳墠璁惧
+ */
+export function apiSetCurrentDevice(data: SetCurrentDeviceParams) {
+  return request<BaseResponse>({
+    url: `/v1/device/setCurrentDeviceId`,
+    method: 'post',
+    data
+  })
+}
+
+export interface SetCurrentDeviceConfigParams {
+  needSetProcessParams: boolean
+}
+
+/**
+ * 璁惧畾褰撳墠璁惧閰嶇疆
+ */
+export function apiSetCurrentDeviceConfig(data: SetCurrentDeviceConfigParams) {
+  return request<BaseResponse>({
+    url: `/v1/device/config`,
+    method: 'post',
+    data
+  })
+}
+
+export interface CraftModelListParams {
+  procedureId: number
+  page: number
+  pageSize: number
+}
+
+/**
+ * 鑾峰彇宸ヨ壓妯″瀷鍒楄〃
+ * @param params
+ */
+export function apiGetCraftModelList(params: CraftModelListParams) {
+  return request<ListResponse<CraftModel[]>>({
+    url: '/v1/processModel/list',
+    method: 'get',
+    params
+  })
+}
+
+export interface UpdateCraftPrams {
+  procedureId: number
+}
+
+/**
+ * 鏇存柊宸ヨ壓妯″瀷
+ * @param params
+ */
+export function updateCraftParams(params: UpdateCraftPrams) {
+  return request<BaseResponse>({
+    url: '/v1/task/updateProcessParams',
+    method: 'post',
+    data: params
+  })
+}
+
+/**
+ * 鑾峰彇闂璇婃柇闂鍒楄〃
+ */
+export function apiGetProblemList() {
+  return request<BaseResponse<Problem[]>>({
+    url: '/v1/system/problemList',
+    method: 'get'
+  })
+}

--
Gitblit v1.8.0