| | |
| | | } |
| | | |
| | | handleSearch = (card) => { |
| | | const {menu} = this.props |
| | | const { menu } = this.props |
| | | const { config } = this.state |
| | | let _inputfields = [] |
| | | let _linkableFields = [] |
| | |
| | | */ |
| | | handleSubmit = () => { |
| | | const { btnTab } = this.props |
| | | const { config, modaltype, optionLibs } = this.state |
| | | const { config, modaltype, optionLibs, card } = this.state |
| | | |
| | | if (modaltype === 'search') { |
| | | this.modalFormRef.handleConfirm().then(res => { |
| | |
| | | options: res.options |
| | | }) |
| | | } |
| | | let _groups = config.groups.map(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | |
| | | let _groups = null |
| | | |
| | | if (card.iscopy) { |
| | | _groups = config.groups.map(group => { |
| | | let _index = null |
| | | group.sublist.forEach((item, index) => { |
| | | if (item.uuid === card.originUuid) { |
| | | _index = index |
| | | } |
| | | }) |
| | | |
| | | if (_index !== null) { |
| | | group.sublist.splice(_index + 1, 0, res) |
| | | } |
| | | |
| | | if (group.isDefault) { |
| | | group.sublist = group.sublist.filter(item => !item.origin) |
| | | } |
| | | return group |
| | | }) |
| | | if (group.isDefault) { |
| | | group.sublist = group.sublist.filter(item => !item.origin) |
| | | } |
| | | return group |
| | | }) |
| | | } else { |
| | | _groups = config.groups.map(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | | return item |
| | | } |
| | | }) |
| | | if (group.isDefault) { |
| | | group.sublist = group.sublist.filter(item => !item.origin) |
| | | } |
| | | return group |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...config, groups: _groups}, |
| | |
| | | }).then(res => { |
| | | let _LongParam = '' |
| | | if (res.status && res.LongParam) { |
| | | _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | try { |
| | | _LongParam = JSON.parse(_LongParam) |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | |
| | | |
| | | if (result.LongParam) { |
| | | try { |
| | | _LongParam = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | _LongParam = JSON.parse(_LongParam) |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | |
| | | |
| | | let tabParam = { // 添加菜单tab页 |
| | | func: 'sPC_sMenusTab_AddUpt', |
| | | MenuID: btnTab.uuid, |
| | | LText: config.tabs.map((item, index) => { |
| | | return `select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${(index + 1) * 10}' as Sort` |
| | | }) |
| | | MenuID: btnTab.uuid |
| | | } |
| | | tabParam.LText = tabParam.LText.join(' union all ') |
| | | tabParam.LText = Utils.formatOptions(tabParam.LText) |
| | | |
| | | let _LText = [] |
| | | let _index = 1 |
| | | |
| | | config.tabgroups.forEach(groupId => { |
| | | config[groupId].forEach(item => { |
| | | _LText.push(`select '${btnTab.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_index * 10}' as Sort`) |
| | | _index++ |
| | | }) |
| | | }) |
| | | |
| | | _LText = _LText.join(' union all ') |
| | | |
| | | tabParam.LText = Utils.formatOptions(_LText) |
| | | |
| | | tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) |
| | | |
| | |
| | | }) |
| | | let _LongParam = '' |
| | | if (res.LongParam) { |
| | | _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | try { |
| | | _LongParam = JSON.parse(_LongParam) |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | |
| | | </DndProvider> |
| | | {/* 编辑表单 */} |
| | | <Modal |
| | | title={this.state.dict['header.modal.form.edit']} |
| | | title={this.state.card && this.state.card.iscopy ? this.state.dict['header.modal.form.copy'] : this.state.dict['header.modal.form.edit']} |
| | | visible={modaltype === 'search'} |
| | | width={700} |
| | | maskClosable={false} |
| | |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | optionLibs={this.state.optionLibs} |
| | | wrappedComponentRef={(inst) => this.modalFormRef = inst} |
| | | /> |
| | |
| | | card={this.state.card} |
| | | tabs={this.state.tabviews} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | card={this.state.card} |
| | | tabs={this.state.tabviews} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | wrappedComponentRef={(inst) => this.tabsFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | dict={this.state.dict} |
| | | menu={this.props.menu} |
| | | config={this.state.config} |
| | | inputSubmit={this.settingSave} |
| | | usefulFields={this.props.permFuncField} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | |
| | | > |
| | | <GroupForm |
| | | groups={config.groups} |
| | | group={this.state.editgroup} |
| | | dict={this.state.dict} |
| | | group={this.state.editgroup} |
| | | inputSubmit={this.handleGroupSave} |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | | /> |
| | | </Modal> |