|
|
@ -1,9 +1,17 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
|
|
|
const trueFalse = [{ |
|
|
|
label: '是', |
|
|
|
value: true |
|
|
|
}, { |
|
|
|
label: '否', |
|
|
|
value: false |
|
|
|
}] |
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
export const InspectionStageRules = reactive({ |
|
|
|
code: [required], |
|
|
|
description: [required], |
|
|
|
dynamicModifyCode: [required], |
|
|
|
okTimes: [required], |
|
|
|
okTimeStage: [required], |
|
|
@ -12,28 +20,28 @@ export const InspectionStageRules = reactive({ |
|
|
|
isStartStage: [required], |
|
|
|
skipInspection: [required], |
|
|
|
inspectionStringency: [required], |
|
|
|
available: [required], |
|
|
|
concurrencyStamp: [required] |
|
|
|
}) |
|
|
|
|
|
|
|
export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
|
|
|
|
{ |
|
|
|
label: '编码', |
|
|
|
field: 'code', |
|
|
|
label: '描述', |
|
|
|
field: 'description', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '动态修改规则编码', |
|
|
|
field: 'dynamicModifyCode', |
|
|
|
label: '阶段', |
|
|
|
field: 'stage', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'description', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'OK次数', |
|
|
@ -43,6 +51,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
@ -53,6 +64,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
@ -63,6 +77,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
@ -73,6 +90,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
@ -80,104 +100,58 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
field: 'isStartStage', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => { |
|
|
|
return trueFalse.find((account) => account.value == cellValue)?.label |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Radio' |
|
|
|
} |
|
|
|
component: 'Switch', |
|
|
|
value:true |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'Switch', |
|
|
|
default: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否略过检验', |
|
|
|
field: 'skipInspection', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => { |
|
|
|
return trueFalse.find((account) => account.value == cellValue)?.label |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Radio' |
|
|
|
component: 'Switch', |
|
|
|
value:true |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'Switch', |
|
|
|
default: true |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '检验严格性', |
|
|
|
field: 'inspectionStringency', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
|
field: 'available', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isSearch: true, |
|
|
|
search: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
type: 'daterange', |
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|
|
|
} |
|
|
|
dictType: DICT_TYPE.INSPECTION_SEVERITY, |
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
}, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '删除时间', |
|
|
|
field: 'deletionTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isSearch: true, |
|
|
|
search: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
type: 'daterange', |
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|
|
|
} |
|
|
|
tableForm: { |
|
|
|
type: 'Select' |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
type: 'datetime', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '删除者ID', |
|
|
|
field: 'deleterId', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '扩展属性', |
|
|
|
field: 'extraProperties', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '并发乐观锁', |
|
|
|
field: 'concurrencyStamp', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '地点id', |
|
|
|
field: 'siteId', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
width: 300, |
|
|
|
fixed: 'right' |
|
|
|
} |
|
|
|
}, |
|
|
|
isTableForm: false, |
|
|
|
} |
|
|
|
])) |
|
|
|
|
|
|
|