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
|
})
|
}
|