From 92bd815250054f79473bfe10df31b93c996e32ea Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 06 十一月 2023 17:51:04 +0800
Subject: [PATCH] 工艺列表的更新按钮状态修改
---
src/api/index.ts | 132 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 131 insertions(+), 1 deletions(-)
diff --git a/src/api/index.ts b/src/api/index.ts
index 1517ce2..e474d51 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -1,11 +1,21 @@
import { request } from '@/common/utils'
-import type { TasksGroupByChannel } from './task'
+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 {
@@ -36,6 +46,10 @@
procedureId: number
}
+/**
+ * 鑾峰彇PLC杩愯鏁版嵁
+ * @param params
+ */
export function getProductProgress(params: ProductProgressParams) {
return request<BaseResponse<PLCResponse>>({
url: '/v1/plc/productProgress',
@@ -43,3 +57,119 @@
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
+}
+
+/**
+ * 涓嬪彂宸ヨ壓鍙傛暟
+ * @param params
+ */
+export function sendProcessParams(params: SendProcessParamsParams) {
+ return request<BaseResponse>({
+ url: `v1/task/sendProcessParams`,
+ method: 'post',
+ 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'
+ })
+}
+
+export interface SetCurrentDeviceParams {
+ currentDeviceID: string
+}
+
+/**
+ * 鑾峰彇褰撳墠闈㈡澘缁戝畾鐨勮澶囧垪琛�
+ */
+export function apiSetCurrentDevice(data: SetCurrentDeviceParams) {
+ return request<BaseResponse<Devices>>({
+ url: `/v1/device/setCurrentDeviceId`,
+ 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