You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.5 KiB
79 lines
1.5 KiB
import { eamServer } from '../../index' |
|
|
|
export interface IDevice { |
|
id: number |
|
name: string |
|
categoryId: string |
|
serialNo: string |
|
sn: string |
|
status: number |
|
description: string |
|
cost: string |
|
createTime: string |
|
updateTime: string |
|
creator: string |
|
updater: string |
|
testSheetId: number |
|
testSheetStatus: string |
|
testSheetDetail: string |
|
} |
|
|
|
export interface IDeviceOV { |
|
id?: number |
|
name: string |
|
categoryId: string |
|
templateId: string |
|
serialNo?: string |
|
sn: string |
|
description: string |
|
cost: string |
|
} |
|
|
|
export const operantDevice = (type: OperantAction, data: IDeviceOV) => { |
|
return eamServer({ |
|
url: `/device/${type}`, |
|
method: type === 'create' ? 'post' : 'put', |
|
data, |
|
}) |
|
} |
|
|
|
export const deleteDevice = (id: string) => |
|
eamServer({ |
|
url: `/device/delete`, |
|
method: 'delete', |
|
params: { id }, |
|
}) |
|
|
|
export const getDeviceInfo = (id: number) => |
|
eamServer({ |
|
url: `/device/get`, |
|
method: 'get', |
|
params: { id }, |
|
}) |
|
|
|
export const getDevicePage = (params: PageParam) => |
|
eamServer<{ |
|
list: IDevice[] |
|
total: number |
|
}>({ url: '/device/page', method: 'get', params }) |
|
|
|
|
|
|
|
// ============== 测试工单相关 ============== |
|
|
|
export const operantDeviceTestSheet = (type: OperantAction, params: any) => { |
|
if (type === 'create') { |
|
return eamServer({ |
|
url: '/test-sheet/create', |
|
method: 'post', |
|
params, |
|
}) |
|
} |
|
if (type === 'update') { |
|
return eamServer({ |
|
url: '/test-sheet/update', |
|
method: 'put', |
|
params, |
|
}) |
|
} |
|
}
|
|
|