From fce4de633059cb57ab89ede8f6d63c77afa19cda Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 28 七月 2022 10:55:15 +0800 Subject: [PATCH] 2022-07-28 --- src/views/design/sidemenu/editthdmenu/index.jsx | 181 ++++---------------------------------------- 1 files changed, 19 insertions(+), 162 deletions(-) diff --git a/src/views/design/sidemenu/editthdmenu/index.jsx b/src/views/design/sidemenu/editthdmenu/index.jsx index 5a6d731..3680e40 100644 --- a/src/views/design/sidemenu/editthdmenu/index.jsx +++ b/src/views/design/sidemenu/editthdmenu/index.jsx @@ -10,8 +10,6 @@ import Api from '@/api' import MKEmitter from '@/utils/events.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' import MkIcon from '@/components/mk-icon' import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' @@ -20,12 +18,6 @@ import './index.scss' const MenuForm = asyncLoadComponent(() => import('../thdmenuform')) -const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) -const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) -const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig')) -const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) -const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) -const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) const { confirm } = Modal @@ -38,21 +30,9 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, confirmLoading: false, // 鎻愪氦涓�傘�傘�� loading: false, // 缂栬緫鑿滃崟鎴栦娇鐢ㄥ凡浣跨敤妯℃澘鏃讹紝鑾峰彇閰嶇疆淇℃伅 - btnParam: null, // 缂栬緫鎸夐挳鐨勯厤缃俊鎭� menulist: null, // 缂栬緫涓殑鑿滃崟 - tabview: '', // 閫夋嫨妯℃澘绐楀彛锛坱emplate锛夈�佸熀纭�琛ㄦ牸閰嶇疆锛圕ommonTable锛夈�佽〃鍗曪紙Modal锛夈�佸瓙琛紙SubTable锛� - editMenu: null, // 缂栬緫鑿滃崟 - editAction: null, // 缂栬緫鎸夐挳 - editTab: null, // 缂栬緫鏍囩 - tabConfig: null, // 鏍囩閰嶇疆淇℃伅 - editSubTab: null, // 缂栬緫瀛愭爣绛撅紙鏍囩涓殑鏍囩锛� - subTabConfig: null, // 瀛愭爣绛鹃厤缃俊鎭� - subConfig: null, // 瀛愰厤缃俊鎭� - btnTab: null, // 鎵撳紑鏂版爣绛炬垨褰撳墠椤甸潰鍒锋柊鐨勬寜閽� - btnTabConfig: null, // 鎵撳紑鏂版爣绛炬寜閽厤缃� handleMVisible: false, // 娣诲姞鎴栦慨鏀硅彍鍗曟ā鎬佹锛堣鑹叉潈闄愬垎閰嶇瓑锛� sysMenu: null, // 娣诲姞鎴栫紪杈戣彍鍗曪紙瑙掕壊鏉冮檺鍒嗛厤绛夛級 change: false @@ -87,7 +67,7 @@ if (this.state.change) { notification.warning({ top: 92, - message: this.state.dict['model.menu.presave'], + message: '鑿滃崟椤哄簭宸茶皟鏁达紝璇蜂繚瀛橈紒', duration: 5 }) return @@ -131,69 +111,24 @@ handleMVisible: true, sysMenu: _menu }) + } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(_menu.PageParam.Template)) { + sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) + let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu))) - return + window.open(`#/basedesign/${_param}`) + } else if (_menu.PageParam.Template === 'CustomPage') { + let _param = { + MenuType: 'custom', + MenuId: _menu.MenuID, + ParentId: _menu.ParentId, + MenuName: _menu.MenuName, + MenuNo: _menu.MenuNo + } + + _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) + + window.open(`#/menudesign/${_param}`) } - - // let _param = '' - // if (card.type === 'CustomPage') { - // _param = { - // MenuType: 'custom', - // MenuId: card.MenuID, - // ParentId: card.ParentId, - // MenuName: card.MenuName, - // MenuNo: card.MenuNo - // } - // _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - // } - // window.open(`#/menudesign/${_param}`)} - - // let param = { - // func: 'sPC_Get_LongParam', - // MenuID: _menu.MenuID - // } - - // this.setState({ - // loading: true - // }) - - // Api.getSystemConfig(param).then(res => { - // if (res.status) { - // let _LongParam = '' - // if (res.LongParam) { - // try { - // _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - // } catch (e) { - // console.warn('Parse Failure') - // _LongParam = '' - // } - // } - - // _menu.LongParam = _LongParam - // _menu.fstMenuId = _menu.FstId - // _menu.supMenuList = this.props.supMenuList - // _menu.fstMenuList = this.props.menuTree - // _menu.open_edition = res.open_edition || '' - - - // this.setState({ - // editMenu: _menu, - // loading: false, - // tabview: _menu.PageParam.Template - // }, () => { - // document.getElementById('root').style.overflowY = 'hidden' - // }) - // } else { - // this.setState({ - // loading: false - // }) - // notification.warning({ - // top: 92, - // message: res.message, - // duration: 5 - // }) - // } - // }) } } @@ -248,30 +183,11 @@ } } - exittabview = () => { - this.setState({tabview: ''}) - document.getElementById('root').style.overflowY = 'unset' - } - - handleView = (param) => { - this.setState({ - tabview: '' - }, () => { - if (param) { - this.setState(param) - document.getElementById('root').style.overflowY = 'hidden' - } else { - document.getElementById('root').style.overflowY = 'unset' - } - }) - } - /** * @description 涓夌骇鑿滃崟娣诲姞鎴栦慨鏀� */ memuSubmit = () => { const { sysMenu } = this.state - let sysTemplates = fromJS(this.state.sysTemplates).toJS() this.menuFormRef.handleConfirm().then(res => { let PageParam = { @@ -309,11 +225,9 @@ Api.getSystemConfig(param).then(response => { if (response.status) { this.setState({ - sysTemplates: sysTemplates, confirmLoading: false, handleMVisible: false, - sysMenu: '', - tabview: '' + sysMenu: null }) MKEmitter.emit('mkUpdateMenuList') @@ -365,8 +279,7 @@ this.setState({ confirmLoading: false, handleMVisible: false, - sysMenu: '', - tabview: '' + sysMenu: null }) MKEmitter.emit('mkUpdateMenuList') @@ -430,62 +343,6 @@ <Button type="primary" className="mk-save-menu" disabled={!change} onClick={() => {this.handleSubBtn('confirm')}}>淇濆瓨</Button> <Button onClick={() => {this.handleSubBtn('close')}}>鍏抽棴</Button> </div> - - {this.state.tabview === 'TreePage' ? - <TreePageConfig - menu={this.state.editMenu} - reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'CalendarPage' ? - <CalendarPageConfig - menu={this.state.editMenu} - reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'CommonTable' ? - <ComTableConfig - menu={this.state.editMenu} - reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'Modal' ? - <ModalConfig - menu={this.state.editMenu} - editTab={this.state.editTab} - tabConfig={this.state.tabConfig} - editSubTab={this.state.editSubTab} - subTabConfig={this.state.subTabConfig} - btnTab={this.state.btnTab} - btnTabConfig={this.state.btnTabConfig} - editAction={this.state.editAction} - subConfig={this.state.subConfig} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'SubTable' ? - <SubTable - menu={this.state.editMenu} - editTab={this.state.editTab} - editSubTab={this.state.editSubTab} - tabConfig={this.state.tabConfig} - btnTab={this.state.btnTab} - btnTabConfig={this.state.btnTabConfig} - config={this.state.subConfig} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'FormTab' ? - <FormTabConfig - menu={this.state.editMenu} - btnTab={this.state.btnTab} - config={this.state.subConfig} - handleView={this.handleView} - /> : null - } {/* 娣诲姞绯荤粺鑿滃崟 */} <Modal title="淇敼鑿滃崟" -- Gitblit v1.8.0