| | |
| | | voucher: [], |
| | | voucherDetail: [], |
| | | systemScripts: [], |
| | | columnsFields: [], |
| | | uniqueColumns: [ |
| | | { |
| | | title: '字段名', |
| | |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | width: '15%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | | {this.props.dict['header.form.status.forbidden']} |
| | | <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" /> |
| | | </div> |
| | | ) : |
| | | ( |
| | | <div> |
| | | {this.props.dict['header.form.status.open']} |
| | | <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" /> |
| | | </div> |
| | | ) |
| | | }, |
| | | { |
| | | title: '操作', |
| | | align: 'center', |
| | | width: '25%', |
| | | dataIndex: 'operation', |
| | | render: (text, record) => |
| | | (<div> |
| | | <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'unique')} style={{color: '#1890ff'}}><Icon type="edit" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'unique', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> |
| | | <Popconfirm |
| | | title={this.props.dict['header.form.query.delete']} |
| | | okText={this.props.dict['model.confirm']} |
| | | cancelText={this.props.dict['header.cancel']} |
| | | onConfirm={() => this.handleDelete(record, 'unique') |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> |
| | | </Popconfirm> |
| | | </div>) |
| | | } |
| | | ], |
| | | onceUniqueColumns: [ |
| | | { |
| | | title: '字段名', |
| | | dataIndex: 'field', |
| | | width: '45%' |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | width: '30%', |
| | | render: (text, record) => record.status === 'false' ? |
| | | ( |
| | | <div> |
| | |
| | | this.getsysScript() |
| | | }) |
| | | } |
| | | |
| | | if (this.props.card.Ot === 'requiredOnce') { |
| | | let _columns = fromJS(config.columns).toJS() |
| | | _columns = _columns.filter(col => col.field) |
| | | |
| | | if (this.props.floor === 'subtable' && _columns.filter(col => col.field.toLowerCase() === 'bid').length === 0) { // 子表表单中增加BID |
| | | _columns.unshift({ |
| | | uuid: 'BID', |
| | | field: 'BID', |
| | | label: 'BID', |
| | | type: 'text' |
| | | }) |
| | | } |
| | | this.setState({ |
| | | columnsFields: _columns |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount() { |
| | |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, fields, uniqueColumns, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail } = this.state |
| | | const { verify, fields, uniqueColumns, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </TabPane> |
| | | <TabPane tab={card.Ot !== 'requiredOnce' ? '唯一性验证' : '同类数据验证'} key="2"> |
| | | <UniqueForm |
| | | fields={fields} |
| | | btn={card} |
| | | fields={card.Ot !== 'requiredOnce' ? fields : columnsFields} |
| | | dict={this.props.dict} |
| | | uniqueChange={this.uniqueChange} |
| | | wrappedComponentRef={(inst) => this.uniqueForm = inst} |
| | |
| | | rowKey="uuid" |
| | | className="custom-table" |
| | | dataSource={verify.uniques} |
| | | columns={uniqueColumns} |
| | | columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} |
| | | pagination={false} |
| | | /> |
| | | </TabPane> |