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.
 
 
 

121 lines
2.3 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const HolidayRules = reactive({
holidayName: [
{ required: true, message: '请输入节日名称', trigger: 'blur' }
],
holidayType: [
{ required: true, message: '请输入节日类型', trigger: 'blur' }
],
holidayDate: [
{ required: true, message: '请输入节日日期', trigger: 'blur' }
],
})
export const Holiday = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable:false,
isForm:false
},
{
label: 'KEY',
field: 'keyDate',
sort: 'custom',
isSearch: false,
isTable:false,
isForm:false
},
{
label: '节日名称',
field: 'holidayName',
sort: 'custom',
isSearch: true,
},
{
label: '节日类型;',
field: 'holidayType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.HOLIDAY_TYPE,
dictClass: 'string',
form: {
component: 'Select',
value: '1',
},
},
{
label: '节日年份',
field: 'holidayYear',
sort: 'custom',
isSearch: true,
isForm:false,
isTable:true,
form: {
component: 'InputNumber',
value: '2023',
},
},
{
label: '节日日期',
field: 'holidayDate',
sort: 'custom',
formatter: dateFormatter2,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'YYYY-MM-DD 00:00:00',
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'date',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.COMMON_STATUS,
dictClass: 'string',
isForm: true,
isSearch: false,
isTable: true,
form: {
component: 'Switch',
value: '1',
componentProps: {
inactiveValue: '0',
activeValue: '1'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))