若在筛选区域使用该组件,且进行时间范围筛选
1、在xx.data.ts(即筛选区、表格、表单数据)中
{
label: t('modal.registrationTime'),
field: 'createTime', //表格中展示对应显示得field
component: 'RangePicker', //组件名称 区间日期选择
colProps: { span:6 },
componentProps:{
valueFormat: 'YYYY-MM-DD', //转格式
}
},
注:field为表格中展示得数据(即表格数据中对应得field)
2、在index页面表格配置中得formConfig中进行配置
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
// 是否折叠
showAdvancedButton: false,
fieldMapToNumber: [],
fieldMapToTime: [['createTime',['beginDate','endDate'], 'YYYY-MM-DD']],
// 修改按钮字样
submitButtonOptions: {
// disabled: true,
text: t('modal.filterText'),
},
},
注:fieldMapToTime: [['createTime',['beginDate','endDate'], 'YYYY-MM-DD']],中 createTime为筛选数据中对应得field 'beginDate','endDate'是转换得搜索参数名即接口提供得筛选参数名 YYYY-MM-DD格式
如果有多个RangerPicker进行筛选
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
// 是否折叠
showAdvancedButton: false,
fieldMapToNumber: [],
fieldMapToTime:fieldMapToTime: [['createTime', ['beginDate', 'endDate'], 'YYYY-MM- DD'], ['successTime', ['beginDate', 'endDate'], 'YYYY-MM-DD']],
// 修改按钮字样
submitButtonOptions: {
// disabled: true,
text: t('modal.filterText'),
},
},