From 7e7424b2662e5b27dcc1c0d37f43e909e0b15ee1 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期四, 02 十一月 2023 16:47:38 +0800 Subject: [PATCH] feat: 轮询plc/设备/调整集群状态组件/title组件加图标 --- src/api/index.ts | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 708b8b2..c8e30e9 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,7 @@ import { request } from '@/common/utils' import type { CraftParamsResponse, TasksGroupByChannel } from './task' import type { PLCResponse } from './plc' +import type { Devices } from './device' export interface BaseResponse<T = any> { code: number @@ -66,6 +67,11 @@ export interface SendProcessParamsParams { procedureId: number } + +/** + * 涓嬪彂宸ヨ壓鍙傛暟 + * @param params + */ export function sendProcessParams(params: SendProcessParamsParams) { return request<BaseResponse>({ url: `v1/task/sendProcessParams`, @@ -73,3 +79,29 @@ data: params }) } + +export interface FinishTaskParams { + id: number +} + +/** + * 缁撴潫浠诲姟 + * @param params + */ +export function finishTask(params: FinishTaskParams) { + return request<BaseResponse>({ + url: `v1/task/finish/${params.id}`, + method: 'put', + data: params + }) +} + +/** + * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛� + */ +export function getDeviceList() { + return request<BaseResponse<Devices>>({ + url: `/v1/device/list`, + method: 'get' + }) +} -- Gitblit v1.8.0