| | |
| | | const { TabPane } = Tabs |
| | | const { Paragraph } = Typography |
| | | const { Search } = Input |
| | | const { confirm } = Modal |
| | | |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | |
| | | reload: false, |
| | | script: null, |
| | | scriptValue: '', |
| | | cols: null, |
| | | colColumns: [ |
| | | { |
| | | title: '名称', |
| | |
| | | |
| | | submitDataSource = () => { |
| | | const { config, mainSearch } = this.props |
| | | const { activeKey, setting, columns, subColumns, scripts } = this.state |
| | | const { activeKey, setting, columns, subColumns, scripts, cols } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | let arr = columns.map(col => col.field.toLowerCase()) |
| | |
| | | defaultSearch: _search, |
| | | setting: res |
| | | }, () => { |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols }) }, reject, false) |
| | | }) |
| | | }, () => { |
| | | reject() |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } else if (activeKey === 'subcolumns') { |
| | | if (this.subdatasource && this.subdatasource.state.editingKey) { |
| | | notification.warning({ |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } else if (activeKey === 'scripts') { |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | |
| | | return |
| | | } |
| | | |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } |
| | | }) |
| | | } |
| | |
| | | message.success('复制成功。') |
| | | } |
| | | |
| | | addProcess = () => { |
| | | const { config } = this.props |
| | | const { columns } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') return |
| | | |
| | | let fields = [] |
| | | let cols = [] |
| | | let _cols = columns.map(item => item.field.toLowerCase()) |
| | | |
| | | if (!_cols.includes('remark_w')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '备注', field: 'remark_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '备注', field: 'remark_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 }) |
| | | } |
| | | if (!_cols.includes('statusname_w')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '状态', field: 'statusname_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '状态', field: 'statusname_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 }) |
| | | } |
| | | if (!_cols.includes('works_flow_param')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '流程参数', field: 'works_flow_param', datatype: 'Nvarchar(512)', fieldlength: 512, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '流程参数', field: 'works_flow_param', type: 'text', Hide: 'true', IsSort: 'false', fieldlength: 512 }) |
| | | } |
| | | |
| | | if (fields.length === 0) return |
| | | |
| | | const that = this |
| | | |
| | | if (config.subtype !== 'basetable') { |
| | | cols = null |
| | | } |
| | | |
| | | confirm({ |
| | | content: cols ? '显示列中是否添加工作流字段?' : '字段集中是否添加工作流字段?', |
| | | onOk() { |
| | | that.setState({ |
| | | cols: cols, |
| | | columns: [...fields, ...columns] |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | setting={setting} |
| | | scripts={scripts} |
| | | updateStatus={this.updateStatus} |
| | | addProcess={this.addProcess} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | | /> : null} |
| | | </TabPane> |
| | |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | scriptSubmit={this.scriptSubmit} |
| | | addProcess={this.addProcess} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | | /> |
| | | <EditTable actions={['move']} data={scripts} columns={scriptsColumns} onChange={this.changeScripts}/> |