alifd的深度教程
1、
对于日期控件,在转换过程中要考虑,如果不考虑转换的话,容易有值,感染验证控件。
<FormItem style={{ margin: 0 }}
labelCol={{
fixedSpan: 9,
}}
wrapperCol={{
span: 15,
}}
label=''
required
hasFeedback
requiredMessage='请选择时间'
name='expiredDate'
>
<DatePicker style={{ width: "162px" }}
disabled={[1, 2].includes(edit.form[0].status)}
disabledDate={disabledDate}
onChange={(val) => { this.formChange(`edit.form[${currentStep}].expiredDate`, val?.valueOf()) }}
value={edit.form[currentStep].expiredDate ? moment(edit.form[currentStep].expiredDate) : null}
/>
</FormItem>
2、对于DatePicker 控件的问题
<DatePicker style={{ width: "162px" }}
disabled={[1, 2].includes(edit.form[0].status)}
disabledDate={disabledDate}
value={edit.form[currentStep].expiredDate ? moment(edit.form[currentStep].expiredDate) : null}
/>
会得到这样的数据,因为这样是格林威治时间
taskTime: ["2022-07-04T16:00:00.000Z", "2022-07-14T16:00:00.000Z"]
格林威治时间是正常的时间,可读性不强,前端和后端都能接收,但是可读性不强,所以我们要进行封装,封装value+onchange的事件。
3、<FormItem style={{ margin: 0 }}>
intput
</FormItem>
这样的组合,是吧 name写在formitem上的,这是符合常理的
4、在antd中也是相同的问题

返回的是格林威治时间
漫思