From 6c919b7a55f15af56b212d059f1a5ea44d1ed5b8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 04 十一月 2022 17:05:46 +0800 Subject: [PATCH] 2022-11-04 --- src/menu/components/form/simple-form/options.jsx | 7 +++ src/menu/components/card/data-card/options.jsx | 7 +++ src/menu/components/form/step-form/options.jsx | 7 +++ src/menu/datasource/verifycard/settingform/index.jsx | 7 +++ src/utils/utils-custom.js | 28 ++++++++++++++ src/templates/comtableconfig/index.jsx | 4 +- src/templates/comtableconfig/updatetable/index.jsx | 18 ++++++-- 7 files changed, 71 insertions(+), 7 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 09778c0..c750cfc 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -26,6 +26,13 @@ let modules = [] if (subtype === 'propcard' || subtype === 'datacard') { modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) + + if (subtype === 'propcard' && wrap.supModule && wrap.supModule.length > 0 && wrap.supModule[0] !== 'empty') { + let has = MenuUtils.checkSupModules(modules, wrap.supModule.slice(-1)[0]) + if (!has) { + wrap.supModule = '' + } + } } let roleList = sessionStorage.getItem('sysRoles') diff --git a/src/menu/components/form/simple-form/options.jsx b/src/menu/components/form/simple-form/options.jsx index b2c3953..c9182cf 100644 --- a/src/menu/components/form/simple-form/options.jsx +++ b/src/menu/components/form/simple-form/options.jsx @@ -38,6 +38,13 @@ let menu = window.GLOB.customMenu modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) + if (wrap.supModule && wrap.supModule.length > 0 && wrap.supModule[0] !== 'empty') { + let has = MenuUtils.checkSupModules(modules, wrap.supModule.slice(-1)[0]) + if (!has) { + wrap.supModule = '' + } + } + const wrapForm = [ { type: 'text', diff --git a/src/menu/components/form/step-form/options.jsx b/src/menu/components/form/step-form/options.jsx index d162d66..4011d4e 100644 --- a/src/menu/components/form/step-form/options.jsx +++ b/src/menu/components/form/step-form/options.jsx @@ -22,6 +22,13 @@ let menu = window.GLOB.customMenu modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) + if (wrap.supModule && wrap.supModule.length > 0 && wrap.supModule[0] !== 'empty') { + let has = MenuUtils.checkSupModules(modules, wrap.supModule.slice(-1)[0]) + if (!has) { + wrap.supModule = '' + } + } + const wrapForm = [ { type: 'text', diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index 9735f10..7f8ddb1 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -73,6 +73,13 @@ _setting.supModule = setting.supModule || [] _setting.execute = setting.execute || 'true' + if (_setting.supModule.length > 0 && _setting.supModule[0] !== 'empty') { + let has = MenuUtils.checkSupModules(modules, _setting.supModule.slice(-1)[0]) + if (!has) { + _setting.supModule = [] + } + } + this.setState({modules, innerRules, innertip, setting: _setting, ismain}) } diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 09683e2..7b6778d 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -28,7 +28,7 @@ const Versions = asyncComponent(() => import('@/menu/versions')) const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) -const UpdateTable = asyncComponent(() => import('./updatetable')) +// const UpdateTable = asyncComponent(() => import('./updatetable')) const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) @@ -1268,7 +1268,7 @@ <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> - <UpdateTable config={config}/> + {/* <UpdateTable config={config}/> */} <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx index 8092a09..d810c7d 100644 --- a/src/templates/comtableconfig/updatetable/index.jsx +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -74,8 +74,9 @@ let uuids = {} let formActions = [] let popActions = [] + let errors = [] - let tbl = this.getTable(config, uuids, formActions, popActions) + let tbl = this.getTable(config, uuids, errors, formActions, popActions, '涓昏〃') if (config.autoMatic && config.autoMatic.enable === 'true' && uuids[config.autoMatic.action]) { _config.autoMatic = {...config.autoMatic} @@ -86,6 +87,10 @@ _config.components.push(tbl) + if (config.tabgroups && config.tabgroups.length > 0) { + + } + console.log(config) console.log(_config) @@ -94,10 +99,11 @@ }, 5000) } - getTable = (config, uuids, formActions, popActions) => { + getTable = (config, uuids, errors, formActions, popActions, name) => { let _card = { uuid: Utils.getuuid(), type: 'table', + name: name, format: 'array', pageable: true, switchable: true, @@ -325,12 +331,14 @@ if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { - formActions.push({origin: btn.uuid, uuid: _btn.uuid}) + formActions.push({origin: btn.uuid, uuid: _btn.uuid, name: name, label: btn.label}) } else if (btn.OpenType === 'popview') { - popActions.push({origin: btn.uuid, linkTab: btn.linkTab || '', uuid: _btn.uuid}) + popActions.push({origin: btn.uuid, linkTab: btn.linkTab || '', uuid: _btn.uuid, name: name, label: btn.label}) } else if (btn.OpenType === 'tab') { if (btn.tabTemplate === 'FormTab' || !btn.linkmenu || btn.linkmenu.length !== 3) { + + errors.push(name + '涓寜閽��' + btn.label + '銆嬩笉鍦ㄦ敮鎸�') return } } @@ -371,7 +379,7 @@ let sets = ['tableName', 'interType', 'sysInterface', 'innerFunc', 'interface', 'proInterface', 'outerFunc', 'dataresource', ['queryType', 'query'], 'primaryKey', 'order', 'execute', ['laypage', 'true'], ['pageSize', 10], ['onload', 'true']] let wraps = ['tableType', ['bordered', 'true'], 'actionfixed', ['size', 'middle'], ['selected', 'false'], ['tableMode', 'compatible'], ['mask', 'show'], ['borderColor', '#e8e8e8'], 'height', 'controlField', 'controlVal'] // useMSearch supModule - _card.scripts = config.setting.scripts + _card.scripts = config.setting.scripts || [] sets.forEach(n => { if (n === 'interType' && !['system', 'inner', 'outer'].includes(config.setting.interType)) { diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 77d77ab..eb23ab6 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -277,6 +277,31 @@ } /** + * @description 鑾峰彇涓婄骇妯″潡 + * @return {String} selfId 褰撳墠缁勪欢id + */ + static checkSupModules (modules, supId) { + let has = false + + let check = (list) => { + list.forEach(m => { + if (has) return + if (supId === m.value) { + has = true + return + } + if (m.children) { + check(m.children) + } + }) + } + + check(modules) + + return has + } + + /** * @description 鑾峰彇鍙叧鑱旀ā鍧� */ static getLinkModules (components) { @@ -815,6 +840,9 @@ if (em) { item.setting.supModule = '' } + if (item.wrap && item.wrap.supModule) { + item.wrap.supModule = item.setting.supModule + } } if (item.wrap && item.wrap.doubleClick) { -- Gitblit v1.8.0