| | |
| | | editable: true, |
| | | unique: true, |
| | | copy: true, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | | message: '字段名只允许包含数字、字母、汉字以及_' |
| | | }], |
| | | width: '28%' |
| | | }, |
| | | { |
| | |
| | | render: (text) => { |
| | | let title = text.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | text = title ? text.replace(title, '') : text |
| | | let _text = title ? text.replace(title, '') : text |
| | | |
| | | return ( |
| | | <div> |
| | | {title ? <span style={{color: '#a50'}}>{title}</span> : null} |
| | | <Paragraph copyable ellipsis={{ rows: 4, expandable: true }}>{text}</Paragraph> |
| | | {title ? <span style={{color: '#a50'}}>{title}<span style={{fontSize: '12px', marginLeft: '5px'}}>{_text.length}</span></span> : null} |
| | | <Paragraph copyable={{ text: text }} ellipsis={{ rows: 4, expandable: true }}>{_text}</Paragraph> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | this.setState({loading: false}) |
| | | }) |
| | | } else if (activeKey === 'columns') { |
| | | if (this.datasource && this.datasource.state.editingKey) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段未保存,请保存后切换!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | activeKey: val, |
| | | loading: false |
| | |
| | | reject() |
| | | }) |
| | | } else if (activeKey === 'columns') { |
| | | if (this.datasource && this.datasource.state.editingKey) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段未保存,请保存后提交!', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, scripts }) }, reject, false) |
| | | } else if (activeKey === 'scripts') { |
| | | let _loading = false |
| | |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <CopyOutlined title="以逗号拼接形式复制字段" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> |
| | | <TabPane tab={ |
| | | <span> |