| | |
| | | |
| | | class EdiFieldsTable extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | onChange: PropTypes.func // 数据变化 |
| | | } |
| | | |
| | |
| | | editable: true, |
| | | width: '20%', |
| | | options: [ |
| | | {value: 'left', text: 'left'}, |
| | | {value: 'center', text: 'center'}, |
| | | {value: 'right', text: 'right'}, |
| | | {value: 'justify', text: 'justify'} |
| | | ] |
| | | {value: 'left', text: '居左'}, |
| | | {value: 'center', text: '居中'}, |
| | | {value: 'right', text: '居右'}, |
| | | // {value: 'justify', text: 'justify'} |
| | | ], |
| | | render: (text, record) => { |
| | | if (text === 'center') { |
| | | return '居中' |
| | | } else if (text === 'right') { |
| | | return '居右' |
| | | } else { |
| | | return '居左' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | |
| | | this.setState({loading: false}) |
| | | }) |
| | | return |
| | | } else if (fields.filter(f => f.toLowerCase() === 'value').length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段名不可使用value!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: true}, () => { |
| | | this.setState({loading: false}) |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ data }, () => { |
| | |
| | | |
| | | return ( |
| | | <div className="modal-card-field-table"> |
| | | {data.length < 3 ? <PlusOutlined className="add-row" onClick={this.handleAdd} /> : null} |
| | | {data.length < 6 ? <PlusOutlined className="add-row" onClick={this.handleAdd} /> : null} |
| | | {!loading ? <EditTable indexShow={false} actions={['edit', 'move', 'del']} data={data} columns={columns} onChange={this.changeData}/> : null} |
| | | </div> |
| | | ) |