From a02fc6a77fa1b35c6516b2d37108d80e260c6c85 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 十一月 2024 22:05:08 +0800 Subject: [PATCH] 2024-11-07 --- src/menu/components/share/copycomponent/index.jsx | 63 ++++++++++++++++++++----------- 1 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/menu/components/share/copycomponent/index.jsx b/src/menu/components/share/copycomponent/index.jsx index fea13ae..3cebc71 100644 --- a/src/menu/components/share/copycomponent/index.jsx +++ b/src/menu/components/share/copycomponent/index.jsx @@ -11,43 +11,60 @@ card: PropTypes.object } + transConfig = (config, type) => { + if (type === 'menucell') { + config.setting.type = 'linkmenu' + config.setting.linkMenuId = '' + config.setting.copyMenuId = '' + } else if (type === 'mobnavbar') { + delete config.open_edition + delete config.dataName + + config.menus.forEach(item => { + item.property = 'menu' + item.open = 'self' + + delete item.copyMenuId + delete item.clearMenu + delete item.linkMenuId + }) + } else if (config.type === 'menubar' && config.subtype === 'menubar') { + let cell = config.subMenus[0] + config.subMenus = [] + + if (cell) { + cell.setting.type = 'menu' + cell.setting.linkMenuId = '' + cell.setting.copyMenuId = '' + + config.subMenus.push(cell) + } + } else if (['normaltable', 'editable', 'basetable'].includes(type)) { + config.action = config.action.filter(item => !item.origin) + config.cols = config.cols.filter(item => !item.origin) + config.search = config.search.filter(item => !item.origin) + delete config.isNew + } + } + trigger = () => { const { card, type } = this.props let _val = fromJS(card).toJS() _val.copyType = type + this.transConfig(_val, type) + try { delete _val.$srcId - let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') + let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') if (srcid) { _val.$srcId = srcid } - if (type === 'menucell') { - _val.setting.type = 'linkmenu' - _val.setting.linkMenuId = '' - _val.setting.copyMenuId = '' - } else if (_val.type === 'menubar' && _val.subtype === 'menubar') { - let cell = _val.subMenus[0] - _val.subMenus = [] - - if (cell) { - cell.setting.type = 'menu' - cell.setting.linkMenuId = '' - cell.setting.copyMenuId = '' - - _val.subMenus.push(cell) - } - } else if (['normaltable', 'editable', 'basetable'].includes(type)) { - _val.action = _val.action.filter(item => !item.origin) - _val.cols = _val.cols.filter(item => !item.origin) - _val.search = _val.search.filter(item => !item.origin) - delete _val.isNew - } - _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { + console.warn(e) message.warning('澶嶅埗澶辫触锛岃閲嶈瘯锛�') _val = '' } -- Gitblit v1.8.0