| | |
| | | import Utils, { FuncUtils } from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import SettingForm from './settingform' |
| | | import CreateFunc from '@/templates/zshare/createfunc' |
| | | import CreateInterface from '@/templates/zshare/createinterface' |
| | |
| | | search: _search, |
| | | menu: menu |
| | | }) |
| | | |
| | | MKEmitter.emit('modalStatus', '数据源') |
| | | } |
| | | |
| | | /** |
| | |
| | | loading: true |
| | | }) |
| | | this.settingRef.handleConfirm().then(setting => { |
| | | let res = this.resetSetting(setting) |
| | | let res = this.resetSetting(setting, config.setting) |
| | | this.setState({ |
| | | visible: false, |
| | | loading: false |
| | |
| | | res.columnfixed = res.columnfixed === 'true' |
| | | |
| | | this.props.updatesetting({...config, setting: res}) |
| | | |
| | | MKEmitter.emit('modalStatus', false) |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | const { menu } = this.state |
| | | |
| | | this.settingRef.handleConfirm('loading').then(setting => { |
| | | let res = this.resetSetting(setting) |
| | | let res = this.resetSetting(setting, config.setting) |
| | | let _config = {...config, setting: res} |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql |
| | | let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc)) // 删除存储过程sql |
| | |
| | | const { menu } = this.state |
| | | |
| | | this.settingRef.handleConfirm('loading').then(setting => { |
| | | let res = this.resetSetting(setting) |
| | | let res = this.resetSetting(setting, config.setting) |
| | | let _config = {...config, setting: res} |
| | | let _menu = { |
| | | type: config.Template === 'CommonTable' ? 'main' : 'subtable', |
| | |
| | | }) |
| | | } |
| | | |
| | | resetSetting = (s) => { |
| | | resetSetting = (s, ori) => { |
| | | let setting = fromJS(s).toJS() |
| | | let maxScript = 0 |
| | | |
| | | setting.show = ori.show || 'true' |
| | | setting.advanceType = ori.advanceType || 'modal' |
| | | setting.advanceWidth = ori.advanceWidth || 1000 |
| | | setting.drawerPlacement = ori.drawerPlacement || 'right' |
| | | setting.searchRatio = ori.searchRatio || 6 |
| | | setting.searchLwidth = ori.searchLwidth !== undefined ? ori.searchLwidth : 33.3 |
| | | |
| | | if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { |
| | | window.GLOB.funcs.forEach(m => { |
| | |
| | | {/* 设置全局配置及列表数据源 */} |
| | | <Modal |
| | | wrapClassName="model-table-setting-verify-modal" |
| | | title={dict['model.edit']} |
| | | title="数据源配置" |
| | | visible={visible} |
| | | width={900} |
| | | maskClosable={false} |
| | | onCancel={() => { this.setState({ visible: false, loading: false })}} |
| | | onCancel={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false })}} |
| | | footer={[ |
| | | record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null, |
| | | record && record.interType === 'inner' ? <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>{this.state.dict['model.cancel']}</Button>, |
| | | <Button key="cancel" onClick={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false, loading: false }) }}>{this.state.dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button> |
| | | ]} |
| | | destroyOnClose |