From 3d69806588add38f981b02bfe70771588d9520fa Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 31 十月 2023 10:17:56 +0800
Subject: [PATCH] index文件
---
src/api/index.ts | 46 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/src/api/index.ts b/src/api/index.ts
index 336ce12..1517ce2 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -1 +1,45 @@
-export {}
+import { request } from '@/common/utils'
+import type { TasksGroupByChannel } from './task'
+import type { PLCResponse } from './plc'
+
+export interface BaseResponse<T = any> {
+ code: number
+ data: T
+ msg: string
+}
+
+export interface TaskListParams {
+ /** 1鏈畬鎴�2浠婂ぉ鏈畬鎴�3宸插畬鎴� */
+ type: 1 | 2 | 3
+ /** 閫氶亾鍙� 涓嶄紶鏌ユ墍鏈夐�氶亾鐨� */
+ channel?: number
+ /** 浠庣鍑犱釜寮�濮嬫煡锛屼粠0寮�濮� */
+ offset: number
+ /** 鏌ュ灏戞潯 */
+ limit: number
+}
+
+/**
+ * 鑾峰彇浠诲姟鍒楄〃
+ * @param params
+ */
+export function getTaskList(params: TaskListParams) {
+ return request<BaseResponse<TasksGroupByChannel>>({
+ url: '/v1/task/list',
+ method: 'get',
+ params
+ })
+}
+
+export interface ProductProgressParams {
+ channel: number
+ procedureId: number
+}
+
+export function getProductProgress(params: ProductProgressParams) {
+ return request<BaseResponse<PLCResponse>>({
+ url: '/v1/plc/productProgress',
+ method: 'post',
+ data: params
+ })
+}
--
Gitblit v1.8.0