| | |
| | | <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> |
| | | <Popconfirm |
| | | title={props.dict['header.form.query.delete']} |
| | | okText={props.dict['model.confirm']} |
| | | cancelText={props.dict['model.cancel']} |
| | | overlayClassName="popover-confirm" |
| | | title={props.dict['model.query.delete']} |
| | | onConfirm={() => this.handleDelete(record.key) |
| | | }> |
| | | <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> |
| | |
| | | } |
| | | |
| | | handleDelete = key => { |
| | | const dataSource = [...this.state.dataSource] |
| | | this.setState({ dataSource: dataSource.filter(item => item.key !== key) }) |
| | | const dataSource = this.state.dataSource.filter(item => item.key !== key) |
| | | this.setState({ dataSource }) |
| | | this.props.onChange && this.props.onChange(dataSource) |
| | | } |
| | | |
| | | handleAdd = () => { |
| | |
| | | if (type === 'link') { |
| | | newData.ParentID = `${count}` |
| | | } |
| | | let data = [...dataSource, newData] |
| | | this.setState({ |
| | | dataSource: [...dataSource, newData], |
| | | dataSource: data, |
| | | count: count + 1 |
| | | }) |
| | | this.props.onChange && this.props.onChange(data) |
| | | } |
| | | |
| | | handleSave = row => { |
| | |
| | | ...row |
| | | }) |
| | | this.setState({ dataSource: newData }) |
| | | this.props.onChange && this.props.onChange(newData) |
| | | } |
| | | |
| | | resetColumn = (type) => { |
| | |
| | | <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> |
| | | <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> |
| | | <Popconfirm |
| | | title={this.props.dict['header.form.query.delete']} |
| | | okText={this.props.dict['model.confirm']} |
| | | cancelText={this.props.dict['model.cancel']} |
| | | overlayClassName="popover-confirm" |
| | | title={this.props.dict['model.query.delete']} |
| | | onConfirm={() => this.handleDelete(record.key) |
| | | }> |
| | | <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> |