| | |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { card } = this.props |
| | | let _verify = fromJS(card.verify || {range: 1}).toJS() |
| | | let _verify = fromJS(card.verify || {}).toJS() |
| | | let _columns = _verify.columns || [] |
| | | |
| | | delete _verify.dataresource |
| | | |
| | | // 旧数据兼容 |
| | | _columns = _columns.map(col => { |
| | |
| | | col.type = col.type || 'Nvarchar(50)' |
| | | col.import = col.import || 'true' |
| | | col.required = col.required || 'true' |
| | | |
| | | if (col.type === 'text' || col.type === 'image') { |
| | | col.type = 'Nvarchar(50)' |
| | | } else if (col.type === 'number') { |
| | | col.type = 'Decimal(18,2)' |
| | | } |
| | | |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | col.limit = col.type.match(/\d+/)[0] |
| | |
| | | return col |
| | | }) |
| | | |
| | | if (!_verify.hasOwnProperty('range')) { |
| | | _verify.range = 1 |
| | | } |
| | | |
| | | this.setState({ |
| | | verify: { |
| | | ..._verify, |