| | |
| | | { |
| | | title: this.props.dict['model.form.field'], |
| | | dataIndex: 'Column', |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.name'], |
| | | dataIndex: 'Text', |
| | | width: '20%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.export'], |
| | | dataIndex: 'export', |
| | | width: '20%', |
| | | editable: true, |
| | | render: (text, record) => record.export !== 'false' ? this.props.dict['model.true'] : this.props.dict['model.false'] |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: this.props.dict['model.form.columnWidth'], |
| | | dataIndex: 'Width', |
| | | width: '20%' |
| | | width: '25%' |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | let fields = verify.columns.map(item => item.Column) |
| | | if (fields.includes(values.Column)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: values.Column + '字段已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | values.uuid = Utils.getuuid() |
| | | verify.columns.push(values) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | columnFieldInput = () => { |
| | | const { config } = this.props |
| | | const { verify } = this.state |
| | | |
| | | let columns = fromJS(verify.columns).toJS() |
| | | let fields = columns.map(item => item.Column) |
| | | |
| | | config.columns.forEach(item => { |
| | | if (fields.includes(item.field)) return |
| | | fields.push(item.field) |
| | | |
| | | columns.push({ |
| | | Column: item.field, |
| | | Text: item.label, |
| | | Width: 20, |
| | | uuid: Utils.getuuid() |
| | | }) |
| | | }) |
| | | |
| | | this.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, excelColumns, defaultscript } = this.state |
| | |
| | | columnChange={this.columnChange} |
| | | wrappedComponentRef={(inst) => this.columnForm = inst} |
| | | /> |
| | | <Button className="excel-col-add mk-green" title="添加显示列字段" onClick={this.columnFieldInput}> |
| | | 同步显示列 |
| | | </Button> |
| | | <Table |
| | | bordered |
| | | rowKey="uuid" |