songshankun
2023-10-30 9bde1998a8a0bc6c1ab314f8cf27c10aef016689
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
  })
}