From 62feac7e932a1faf6c05d7ac8df4c25a113eeb88 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期二, 31 十月 2023 20:21:08 +0800 Subject: [PATCH] feat: 添加任务信息组件 --- src/api/index.ts | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 1517ce2..708b8b2 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import { request } from '@/common/utils' -import type { TasksGroupByChannel } from './task' +import type { CraftParamsResponse, TasksGroupByChannel } from './task' import type { PLCResponse } from './plc' export interface BaseResponse<T = any> { @@ -36,6 +36,10 @@ procedureId: number } +/** + * 鑾峰彇PLC杩愯鏁版嵁 + * @param params + */ export function getProductProgress(params: ProductProgressParams) { return request<BaseResponse<PLCResponse>>({ url: '/v1/plc/productProgress', @@ -43,3 +47,29 @@ data: params }) } +export interface CraftParamsParams { + id: number +} + +/** + * 鑾峰彇宸ヨ壓鍙傛暟 + * @param params + */ +export function getCraftParams(params: CraftParamsParams) { + return request<BaseResponse<CraftParamsResponse>>({ + url: `v1/task/start/${params.id}`, + method: 'get', + data: params + }) +} + +export interface SendProcessParamsParams { + procedureId: number +} +export function sendProcessParams(params: SendProcessParamsParams) { + return request<BaseResponse>({ + url: `v1/task/sendProcessParams`, + method: 'post', + data: params + }) +} -- Gitblit v1.8.0