zhangwencui
7 天以前 7619c19a67c2ac824f803090bab753fc5ea14408
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
46
47
48
49
50
51
52
53
import { requestClient } from '#/api/request';
 
export namespace MesDvMachineryTypeApi {
  /** MES 设备类型 */
  export interface MachineryType {
    id?: number; // 设备类型编号
    parentId?: number; // 父类型编号
    code?: string; // 类型编码
    name?: string; // 类型名称
    sort?: number; // 显示排序
    status?: number; // 状态
    remark?: string; // 备注
    createTime?: Date; // 创建时间
    children?: MachineryType[]; // 子类型
  }
}
 
/** 查询设备类型列表 */
export function getMachineryTypeList(params?: any) {
  return requestClient.get<MesDvMachineryTypeApi.MachineryType[]>(
    '/mes/dv/machinery-type/list',
    { params },
  );
}
 
/** 查询设备类型精简列表 */
export function getMachineryTypeSimpleList() {
  return requestClient.get<MesDvMachineryTypeApi.MachineryType[]>(
    '/mes/dv/machinery-type/simple-list',
  );
}
 
/** 查询设备类型详情 */
export function getMachineryType(id: number) {
  return requestClient.get<MesDvMachineryTypeApi.MachineryType>(
    `/mes/dv/machinery-type/get?id=${id}`,
  );
}
 
/** 新增设备类型 */
export function createMachineryType(data: MesDvMachineryTypeApi.MachineryType) {
  return requestClient.post('/mes/dv/machinery-type/create', data);
}
 
/** 修改设备类型 */
export function updateMachineryType(data: MesDvMachineryTypeApi.MachineryType) {
  return requestClient.put('/mes/dv/machinery-type/update', data);
}
 
/** 删除设备类型 */
export function deleteMachineryType(id: number) {
  return requestClient.delete(`/mes/dv/machinery-type/delete?id=${id}`);
}