| | |
| | | thawBtnVisible: false, // 解冻按钮弹窗 |
| | | thawbtnlist: null, // 解冻按钮列表 |
| | | thawButtons: [], // 已选择要解冻的按钮 |
| | | activeKey: '0' // 默认展开基本信息 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | sqlVerifing: false // sql验证 |
| | | } |
| | | |
| | | /** |
| | |
| | | _config.tabgroups = _config.tabgroups || ['tabs'] |
| | | _config.setting.subtabs = _config.setting.subtabs || [] |
| | | _config.Template = 'CommonTable' |
| | | _config.easyCode = _config.easyCode || '' |
| | | |
| | | let _oriActions = [] |
| | | if (_config.type === 'user') { |
| | |
| | | MenuID: 'currenttab', |
| | | text: this.state.dict['header.form.currenttab'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'easyCode', |
| | | label: this.state.dict['header.form.easyCode'], |
| | | initVal: _config.easyCode, |
| | | required: false, |
| | | readonly: false |
| | | } |
| | | ] |
| | | }) |
| | |
| | | |
| | | _search = _search.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | | config: {...config, search: _search}, |
| | | optionLibs: optionLibs, |
| | | modaltype: '' |
| | | }) |
| | | if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: res.dataSource |
| | | } |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | | config: {...config, search: _search}, |
| | | optionLibs: optionLibs, |
| | | modaltype: '' |
| | | }) |
| | | } else { |
| | | this.setState({sqlVerifing: false}) |
| | | |
| | | Modal.error({ |
| | | title: result.message |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | config: {...config, search: _search}, |
| | | optionLibs: optionLibs, |
| | | modaltype: '' |
| | | }) |
| | | } |
| | | }) |
| | | } else if (modaltype === 'actionEdit' || modaltype === 'actionCopy') { |
| | | this.actionFormRef.handleConfirm().then(res => { |
| | |
| | | } |
| | | |
| | | let _LongParam = '' |
| | | let _config = {...config, tables: this.state.selectedTables} |
| | | let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode} |
| | | let _pageParam = {...menu.PageParam, OpenType: res.opentype} |
| | | |
| | | // 未设置数据源或标签不合法时,启用状态为false |
| | |
| | | ParentID: res.parentId, |
| | | MenuID: menu.MenuID, |
| | | MenuNo: res.menuNo, |
| | | EasyCode: res.easyCode, |
| | | Template: menu.PageParam.Template || '', |
| | | MenuName: res.menuName, |
| | | PageParam: JSON.stringify(_pageParam), |
| | |
| | | }) |
| | | } else { |
| | | this.menuformRef.handleConfirm().then(res => { |
| | | let _config = {...config, tables: this.state.selectedTables} |
| | | let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode} |
| | | let _pageParam = {...menu.PageParam, OpenType: res.opentype} |
| | | let _originMenu = { |
| | | ...originMenu, |
| | |
| | | Api.getLocalConfig(param) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...config, setting: res}, |
| | | settingVisible: false, |
| | | }) |
| | | |
| | | |
| | | if (res.interType === 'inner' && !res.innerFunc && /\s/.test(res.dataresource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | | |
| | | let _dataresource = res.dataresource |
| | | |
| | | if (res.queryType === 'statistics') { |
| | | let fieldmap = new Map() |
| | | let options = config.search.map(item => { |
| | | let _field = item.key |
| | | let _val = '' |
| | | |
| | | if (fieldmap.has(_field)) { |
| | | _field = _field + '1' |
| | | } |
| | | |
| | | fieldmap.set(item.key, true) |
| | | |
| | | if (/date/.test(item.type)) { |
| | | _val = '1900-01-01' |
| | | } |
| | | |
| | | return { |
| | | reg: new RegExp('@' + _field + '@', 'ig'), |
| | | value: _val |
| | | } |
| | | }) |
| | | |
| | | options.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) |
| | | }) |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: _dataresource |
| | | } |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | | config: {...config, setting: res}, |
| | | settingVisible: false |
| | | }) |
| | | } else { |
| | | this.setState({sqlVerifing: false}) |
| | | |
| | | Modal.error({ |
| | | title: result.message |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | config: {...config, setting: res}, |
| | | settingVisible: false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | }) |
| | | } else { |
| | | this.menuformRef.handleConfirm().then(res => { |
| | | let _config = {...config, tables: this.state.selectedTables} |
| | | let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode} |
| | | let _pageParam = {...menu.PageParam, OpenType: res.opentype} |
| | | let _originMenu = { |
| | | ...originMenu, |
| | |
| | | width={700} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | confirmLoading={this.state.sqlVerifing} |
| | | onCancel={this.editModalCancel} |
| | | destroyOnClose |
| | | > |
| | |
| | | <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, |
| | | <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, |
| | | <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button> |
| | | <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |