From b0f14528e49fcfb6d486bf1e920f0457cbac6049 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期六, 18 十一月 2023 14:32:43 +0800 Subject: [PATCH] 没有任务的时候如果plc有数据也需要显示百分比和老看板保持一致 --- src/api/index.ts | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 03bc1c8..8c68113 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -11,6 +11,13 @@ msg: string } +export interface ListResponse<T = any> { + code: number + data: T + msg: string + total: number +} + export interface TaskListParams { /** 1鏈畬鎴�2浠婂ぉ鏈畬鎴�3宸插畬鎴� */ type: 1 | 2 | 3 @@ -113,11 +120,26 @@ } /** - * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� + * 璁惧畾褰撳墠璁惧 */ export function apiSetCurrentDevice(data: SetCurrentDeviceParams) { - return request<BaseResponse<Devices>>({ + 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 }) @@ -134,7 +156,7 @@ * @param params */ export function apiGetCraftModelList(params: CraftModelListParams) { - return request<BaseResponse<CraftModel[]>>({ + return request<ListResponse<CraftModel[]>>({ url: '/v1/processModel/list', method: 'get', params -- Gitblit v1.8.0