|
|
@ -1,13 +1,14 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import { dateFormatter, dateFormatter3 } from '@/utils/formatTime' |
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
import {validateYS} from '@/utils/validator' |
|
|
|
import { validateYS } from '@/utils/validator' |
|
|
|
|
|
|
|
/** |
|
|
|
* @returns {Array} 班次 |
|
|
|
*/ |
|
|
|
export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
export const Shift = useCrudSchemas( |
|
|
|
reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '代码', |
|
|
|
field: 'code', |
|
|
@ -16,7 +17,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
width: 150, |
|
|
|
fixed: 'left' |
|
|
|
}, |
|
|
|
isSearch: true, |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '名称', |
|
|
@ -24,27 +25,27 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '开始时间', |
|
|
|
field: 'beginTime', |
|
|
|
isTable: true, |
|
|
|
formatter: dateFormatter, |
|
|
|
formatter: dateFormatter3, |
|
|
|
detail: { |
|
|
|
dateFormat: 'HH:mm:ss' |
|
|
|
}, |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 180, |
|
|
|
width: 180 |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'TimePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'time', |
|
|
|
dateFormat: 'HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
@ -53,7 +54,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
component: 'TimePicker', |
|
|
|
componentProps: { |
|
|
|
valueFormat: 'HH:mm:ss', |
|
|
|
type: 'timeSelect', |
|
|
|
type: 'timeSelect' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -61,9 +62,9 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
label: '结束时间', |
|
|
|
field: 'entTime', |
|
|
|
isTable: true, |
|
|
|
formatter: dateFormatter, |
|
|
|
formatter: dateFormatter3, |
|
|
|
detail: { |
|
|
|
dateFormat: 'HH:mm:ss', |
|
|
|
dateFormat: 'HH:mm:ss' |
|
|
|
}, |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
@ -72,10 +73,10 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'TimePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'time', |
|
|
|
dateFormat: 'HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
@ -84,7 +85,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
component: 'TimePicker', |
|
|
|
componentProps: { |
|
|
|
valueFormat: 'HH:mm:ss', |
|
|
|
type: 'timeSelect', |
|
|
|
type: 'timeSelect' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -105,7 +106,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
inactiveValue: 'FALSE', |
|
|
|
activeValue: 'TRUE' |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
@ -125,7 +126,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
inactiveValue: 'FALSE', |
|
|
|
activeValue: 'TRUE' |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '生效时间', |
|
|
@ -142,12 +143,12 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'datetime', |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '失效时间', |
|
|
@ -164,12 +165,12 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'datetime', |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '备注', |
|
|
@ -177,7 +178,7 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: 150 |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
@ -188,15 +189,15 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
}, |
|
|
|
formatter: dateFormatter, |
|
|
|
detail: { |
|
|
|
dateFormat : 'YYYY-MM-DD HH:mm:ss' |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'datetime', |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -226,10 +227,10 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
|
style: {width:'100%'}, |
|
|
|
style: { width: '100%' }, |
|
|
|
type: 'datetime', |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
valueFormat: 'x', |
|
|
|
valueFormat: 'x' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -247,37 +248,26 @@ export const Shift = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isDetail: false, |
|
|
|
isForm: false , |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
fixed: 'right' |
|
|
|
} |
|
|
|
} |
|
|
|
])) |
|
|
|
]) |
|
|
|
) |
|
|
|
|
|
|
|
//表单校验
|
|
|
|
export const ShiftRules = reactive({ |
|
|
|
code: [ |
|
|
|
{ required: true, message: '请输入代码', trigger: 'blur' }, |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, |
|
|
|
{ validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} |
|
|
|
], |
|
|
|
name: [ |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|
], |
|
|
|
remark: [ |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|
], |
|
|
|
beginTime: [ |
|
|
|
{ required: true, message: '请输入开始时间', trigger: 'blur' } |
|
|
|
], |
|
|
|
entTime: [ |
|
|
|
{ required: true, message: '请输入结束时间', trigger: 'blur' } |
|
|
|
], |
|
|
|
endAtNextDay: [ |
|
|
|
{ required: true, message: '请选择是否跨天', trigger: 'change' } |
|
|
|
], |
|
|
|
available: [ |
|
|
|
{ required: true, message: '请选择是否可用', trigger: 'change' } |
|
|
|
{ validator: validateYS, message: '请输入正确的代码', trigger: 'blur' } |
|
|
|
], |
|
|
|
name: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
|
remark: [{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
|
beginTime: [{ required: true, message: '请输入开始时间', trigger: 'blur' }], |
|
|
|
entTime: [{ required: true, message: '请输入结束时间', trigger: 'blur' }], |
|
|
|
endAtNextDay: [{ required: true, message: '请选择是否跨天', trigger: 'change' }], |
|
|
|
available: [{ required: true, message: '请选择是否可用', trigger: 'change' }] |
|
|
|
}) |
|
|
|