| | |
| | | min: 5, |
| | | max: 200, |
| | | editable: true, |
| | | width: '20%' |
| | | width: '14%', |
| | | render: (text) => text || 20 |
| | | }, |
| | | { |
| | | title: '类型', |
| | | dataIndex: 'type', |
| | | inputType: 'select', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | width: '18%', |
| | | render: (text) => { |
| | | if (text === 'image') { |
| | | return '图片' |
| | |
| | | { |
| | | title: '取绝对值', |
| | | dataIndex: 'abs', |
| | | inputType: 'select', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | width: '14%', |
| | | render: (text) => { |
| | | if (text === 'true') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | }, |
| | | options: [ |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'} |
| | | ] |
| | | }, |
| | | { |
| | | title: '导出', |
| | | dataIndex: 'output', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '14%', |
| | | render: (text) => { |
| | | if (text !== 'false') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | |
| | | if (card.intertype !== 'system') { |
| | | _verify.enable = 'false' |
| | | } |
| | | if (_verify.columns[0] && !_verify.columns[0].type) { |
| | | if (_verify.columns[0] && (!_verify.columns[0].type || !_verify.columns[0].output)) { |
| | | _verify.columns = _verify.columns.map(col => { |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | return col |
| | | }) |
| | | } |
| | |
| | | } |
| | | values.uuid = Utils.getuuid() |
| | | values.abs = 'false' |
| | | values.output = 'true' |
| | | verify.columns.push(values) |
| | | |
| | | this.setState({ |
| | |
| | | Text: item.label, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | type: 'text', |
| | | uuid: Utils.getuuid() |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text')) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | Column: col.Column, |
| | | Text: col.Text, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | type: 'text', |
| | | } |
| | | |
| | | return _cell |
| | | }) |
| | | } |
| | | |
| | | this.setState({verify: {...verify, columns}}) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, excelColumns, defaultscript } = this.state |
| | |
| | | |
| | | return ( |
| | | <div id="verify-excelout-box-tab"> |
| | | <Tabs defaultActiveKey="1" className="verify-card-box" onChange={this.tabchange}> |
| | | <Tabs defaultActiveKey="1" className="excelout-verify-card-box" onChange={this.tabchange}> |
| | | <TabPane tab={ |
| | | <span> |
| | | Excel导出列 |
| | |
| | | 清空Excel列 |
| | | </Button> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index。</div> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="exceloutcolumn" data={verify.columns} columns={excelColumns} onChange={(columns) => this.setState({verify: {...verify, columns}})}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | | 自定义脚本 |
| | | 回调脚本 |
| | | {verify.enable === 'true' ? <span className="count-tip">1</span> : null} |
| | | </span> |
| | | } key="6"> |