| | |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | col.required = col.required || 'false' |
| | | |
| | | if (!['text', 'image', 'number'].includes(col.type)) { |
| | | if (/^Decimal/ig.test(col.type)) { |
| | | col.type = 'number' |
| | | } else { |
| | | col.type = 'text' |
| | | } |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (/,,/ig.test(values.sql)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义sql语句中,不可出现连续的英文逗号(,,)', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let error = Utils.verifySql(values.sql, 'customscript') |
| | |
| | | columns.push(cell) |
| | | }) |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | config.subColumns.forEach(item => { |
| | | if (fields.includes(item.field) || !item.field) return |
| | | fields.push(item.field) |
| | | |
| | | let cell = { |
| | | Column: item.field, |
| | | Text: item.label, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | required: 'false', |
| | | type: 'text', |
| | | uuid: Utils.getuuid() |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.type = 'number' |
| | | cell.decimal = item.decimal |
| | | } |
| | | |
| | | columns.push(cell) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | Column: col.Column, |
| | | Text: col.Text, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: col.output || 'true', |
| | | required: col.required || 'false', |
| | | type: 'text', |
| | | } |
| | | columns = columns.map(col => { |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | col.required = col.required || 'false' |
| | | |
| | | return _cell |
| | | }) |
| | | } |
| | | if (!['text', 'image', 'number'].includes(col.type)) { |
| | | if (/^Decimal/ig.test(col.type)) { |
| | | col.type = 'number' |
| | | } else { |
| | | col.type = 'text' |
| | | } |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | // if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) { |
| | | // columns = columns.map(col => { |
| | | // let _cell = { |
| | | // uuid: Utils.getuuid(), |
| | | // Column: col.Column, |
| | | // Text: col.Text, |
| | | // Width: 20, |
| | | // abs: 'false', |
| | | // output: col.output || 'true', |
| | | // required: col.required || 'false', |
| | | // type: 'text', |
| | | // } |
| | | |
| | | // return _cell |
| | | // }) |
| | | // } |
| | | |
| | | this.setState({verify: {...verify, columns}}) |
| | | } |