提交 732de564 authored 作者: 钟是志's avatar 钟是志

22738 手机端。走读申请 201902070129 把必填星号加上

上级 9aa31060
...@@ -81,12 +81,21 @@ export default class MobileDate extends Component { ...@@ -81,12 +81,21 @@ export default class MobileDate extends Component {
this.triggerChange(dates); this.triggerChange(dates);
}; };
MustSpan = () => {
const { required } = this.props;
if(required){
return <span style={{color: 'red'}}>* </span>;
}else{
return null;
}
};
render() { render() {
let {dates} = this.state; let {dates} = this.state;
const {format} = this.props; const {format, required} = this.props;
const startTime = dates.length > 0 ? dates[0] && dates[0].valueOf() : null; const startTime = dates.length > 0 ? dates[0] && dates[0].valueOf() : null;
const endTime = dates.length > 1 ? dates[1].valueOf() : null; const endTime = dates.length > 1 ? dates[1].valueOf() : null;
const MustSpan = this.MustSpan();
return ( return (
<div> <div>
<DatePicker <DatePicker
...@@ -102,7 +111,7 @@ export default class MobileDate extends Component { ...@@ -102,7 +111,7 @@ export default class MobileDate extends Component {
value={!!startTime ? new Date(startTime) : null} value={!!startTime ? new Date(startTime) : null}
format={format ? format : 'YYYY-MM-DD HH:mm:ss'} format={format ? format : 'YYYY-MM-DD HH:mm:ss'}
onChange={(date) => this.handelStartChange(date)}> onChange={(date) => this.handelStartChange(date)}>
<List.Item arrow="horizontal">开始时间</List.Item> <List.Item arrow="horizontal">{MustSpan}开始时间</List.Item>
</DatePicker> </DatePicker>
<DatePicker <DatePicker
// value={this.state.date} // value={this.state.date}
...@@ -117,7 +126,7 @@ export default class MobileDate extends Component { ...@@ -117,7 +126,7 @@ export default class MobileDate extends Component {
locale={{okText: '确定', dismissText: '取消'}} locale={{okText: '确定', dismissText: '取消'}}
format={format ? format : 'YYYY-MM-DD HH:mm:ss'} format={format ? format : 'YYYY-MM-DD HH:mm:ss'}
onChange={(date) => this.handelEndChange(date)}> onChange={(date) => this.handelEndChange(date)}>
<List.Item arrow="horizontal">结束时间</List.Item> <List.Item arrow="horizontal">{MustSpan}结束时间</List.Item>
</DatePicker> </DatePicker>
</div> </div>
); );
......
...@@ -2791,7 +2791,7 @@ export default class tableCom extends Component { ...@@ -2791,7 +2791,7 @@ export default class tableCom extends Component {
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [{ required: required, message: '请选择起止时间' }], : [{ required: required, message: '请选择起止时间' }],
})(<MobileDate disabled={disabled} formate={json.format} />); })(<MobileDate disabled={disabled} formate={json.format} required={required}/>);
if ( if (
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) && (json.isMobileLabel == null && json.isLabel)) &&
...@@ -2803,6 +2803,7 @@ export default class tableCom extends Component { ...@@ -2803,6 +2803,7 @@ export default class tableCom extends Component {
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
required={required}
> >
{cm} {cm}
</MobileItem> </MobileItem>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论