chore: init bj_power monorepo (dashboard/mes/wms/wms_client/workstation), clear subproject git metadata and align naming to folder names
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
import { MockMethod, Recordable } from 'vite-plugin-mock'
|
||||
import { resultPageSuccess, resultSuccess } from './_util'
|
||||
|
||||
export default [
|
||||
// 获取单个工件信息
|
||||
{
|
||||
url: /\/api\/v1\/workpieces\/\d+$/,
|
||||
method: 'get',
|
||||
timeout: 500,
|
||||
response: (opt: { url: Recordable }) => {
|
||||
const workpieceId = opt.url.split('/')[5]
|
||||
return resultSuccess({
|
||||
id: Number(workpieceId),
|
||||
trayNo: '@/integer(1,60)',
|
||||
orderId: '@/integer(1,10)',
|
||||
status: '正常',
|
||||
position: '@/integer(1,60)',
|
||||
currentStep: '@/integer(1,10)',
|
||||
nextStep: '@/integer(1,10)',
|
||||
sort: '@/integer(1,60)',
|
||||
'startedAt|1684332167-1684432167': 1684432167,
|
||||
'finishedAt|1684332167-1684432167': 1684432167,
|
||||
remark: '6日维护',
|
||||
'updatedAt|1684332167-1684432167': 1684432167,
|
||||
'createdAt|1684332167-1684432167': 1684432167
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取详细资料
|
||||
{
|
||||
url: /\/api\/v1\/workpieces\/\d+\/detail$/,
|
||||
method: 'get',
|
||||
timeout: 500,
|
||||
response: (opt: { url: Recordable }) => {
|
||||
const workpieceId = opt.url.split('/')[4]
|
||||
if (Number(workpieceId)) {
|
||||
return resultSuccess({
|
||||
id: Number(workpieceId),
|
||||
trayNo: '@/integer(1,60)',
|
||||
orderId: '@/integer(1,10)',
|
||||
status: '正常',
|
||||
position: '@/integer(1,60)',
|
||||
currentStep: '@/integer(1,10)',
|
||||
nextStep: '@/integer(1,10)',
|
||||
sort: '@/integer(1,60)',
|
||||
'startedAt|1684332167-1684432167': 1684432167,
|
||||
'finishedAt|1684332167-1684432167': 1684432167,
|
||||
remark: '6日维护',
|
||||
'updatedAt|1684332167-1684432167': 1684432167,
|
||||
'createdAt|1684332167-1684432167': 1684432167
|
||||
})
|
||||
}
|
||||
return resultSuccess(null)
|
||||
}
|
||||
},
|
||||
// 获取工件列表接口
|
||||
{
|
||||
url: '/api/v1/workpieces',
|
||||
method: 'get',
|
||||
response: (opt: { url: Recordable; query: Recordable }) => {
|
||||
const limit = Number(opt.query['limit'])
|
||||
return resultPageSuccess({
|
||||
page: Number(opt.query['page']),
|
||||
limit: Number(opt.query['limit']),
|
||||
total: 12,
|
||||
'data|10': [
|
||||
{
|
||||
'id|+1': 1,
|
||||
trayNo: '@/integer(1,60)',
|
||||
orderId: '@/integer(1,10)',
|
||||
orderNo: '@/string("lower", 1, 10)',
|
||||
workOrderId: '@/integer(1,10)',
|
||||
rackId: '@/integer(1,2)',
|
||||
rackName: '@/string("lower", 1, 10)',
|
||||
locationNo: '@/integer(1,60)',
|
||||
status:
|
||||
"@pick(['CREATED', 'IN_HANDLING', 'PROCESSING', 'WAITING_UNLOAD', 'ON_BUFFER', 'WAITING_DECISION', 'COMPLETED', 'SCRAPPED', 'SUSPENDED'])",
|
||||
position: '@/string("lower", 1, 10)',
|
||||
currentStep: '@/integer(1,10)',
|
||||
nextStep: '@/integer(1,10)',
|
||||
sort: '@/integer(1,60)',
|
||||
'startedAt|1684332167-1684432167': 1684432167,
|
||||
'finishedAt|1684332167-1684432167': 1684432167,
|
||||
remark: '6日维护',
|
||||
'updatedAt|1684332167-1684432167': 1684432167,
|
||||
'createdAt|1684332167-1684432167': 1684432167
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取订单工件列表接口
|
||||
{
|
||||
url: /\/api\/v1\/work-orders\/\d+\/workpieces/,
|
||||
method: 'get',
|
||||
response: (opt: { url: Recordable; query: Recordable }) => {
|
||||
const limit = Number(opt.query['limit'])
|
||||
return resultPageSuccess({
|
||||
page: Number(opt.query['page']),
|
||||
limit: Number(opt.query['limit']),
|
||||
total: 3,
|
||||
'data|3': [
|
||||
{
|
||||
'id|+1': 1,
|
||||
trayNo: '@/integer(1,60)',
|
||||
orderId: '@/integer(1,10)',
|
||||
'status|1': ['生产中', '已完成'],
|
||||
position: '@/integer(1,60)',
|
||||
currentStep: '@/integer(1,10)',
|
||||
nextStep: '@/integer(1,10)',
|
||||
sort: '@/integer(1,60)',
|
||||
'startedAt|1684332167-1684432167': 1684432167,
|
||||
'finishedAt|1684332167-1684432167': 1684432167,
|
||||
remark: '6日维护',
|
||||
'updatedAt|1684332167-1684432167': 1684432167,
|
||||
'createdAt|1684332167-1684432167': 1684432167
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
// 新建工件接口
|
||||
{
|
||||
url: '/api/v1/workpieces',
|
||||
method: 'post',
|
||||
response: () => {
|
||||
return resultSuccess(null)
|
||||
}
|
||||
},
|
||||
// 编辑工件接口
|
||||
{
|
||||
url: '/api/v1/workpieces',
|
||||
method: 'put',
|
||||
response: () => {
|
||||
return resultSuccess(null)
|
||||
}
|
||||
},
|
||||
// 删除工件
|
||||
{
|
||||
url: /\/api\/v1\/workpieces\/\d+/,
|
||||
method: 'delete',
|
||||
response: () => {
|
||||
return resultSuccess(null)
|
||||
}
|
||||
},
|
||||
// 批量删除工件
|
||||
{
|
||||
url: `/api/v1/workpieces/batch-delete`,
|
||||
method: 'post',
|
||||
timeout: 300,
|
||||
response: () => {
|
||||
return resultSuccess(null)
|
||||
}
|
||||
}
|
||||
] as MockMethod[]
|
||||
Reference in New Issue
Block a user