| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | searchable: true, |
| | | copy: true, |
| | | width: '28%' |
| | | }, |
| | | { |
| | |
| | | { value: 'datetime', text: 'datetime' }, |
| | | ], |
| | | editable: true, |
| | | copy: true, |
| | | width: '25%', |
| | | } |
| | | ], |
| | |
| | | |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, _columns, searches, config.subtype, config.hasExtend) |
| | | |
| | | if (type === 'submit' && r.custompage && setting.queryType !== 'statistics') { |
| | | Modal.info({ |
| | | title: '数据源或自定义脚本中使用了自定义分页,查询类型请使用统计!', |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | if (r.custompage && setting.laypage === 'true' && _columns.findIndex(col => col.field === 'mk_total') === -1) { |
| | | if (config.subtype !== 'basetable') { |
| | | const that = this |
| | |
| | | }) |
| | | } |
| | | |
| | | tolowercase = (type) => { |
| | | const that = this |
| | | confirm({ |
| | | content: type === 'sub' ? '确定将子表字段转为小写吗?' : '确定将字段转为小写吗?', |
| | | onOk() { |
| | | that.execlowercase(type) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | execlowercase = (type) => { |
| | | const { subColumns, columns } = this.state |
| | | |
| | | if (type === 'sub') { |
| | | this.setState({subColumns: fromJS(subColumns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } else { |
| | | this.setState({columns: fromJS(columns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | type="fields" |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase()}/> |
| | | <ExcelOut data={columns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> : <TabPane tab={ |
| | |
| | | type="fields" |
| | | updatefield={this.updateSubfields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase('sub')}/> |
| | | <ExcelOut data={subColumns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.subdatasource = inst} data={subColumns} columns={colColumns} onChange={(subColumns) => this.setState({subColumns})}/> |
| | | </TabPane> : null} |