From 83592b5c2dcbfd0a91d36dfa89f1a6cbe95ab1d1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 十月 2022 15:22:01 +0800 Subject: [PATCH] 2022-10-27 --- src/tabviews/custom/index.jsx | 49 +++++++++++++++++++++++-------------------------- 1 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 9b9aa3b..30f4f7a 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -36,11 +36,11 @@ const NormalTree = asyncComponent(() => import('./components/tree/antd-tree')) const Balcony = asyncComponent(() => import('./components/card/balcony')) const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent')) -const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) const CustomChart = asyncComponent(() => import('./components/chart/custom-chart')) const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline')) const Voucher = asyncComponent(() => import('./components/module/voucher')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) +const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) const MkInterfaces = asyncComponent(() => import('@/tabviews/custom/components/interfaces')) class CustomPage extends Component { @@ -172,9 +172,15 @@ }) } + let popview = 'CustomPage' + + if (config.version === 2.0) { + popview = 'popview' + } + config.interfaces = this.formatInterSetting(config.interfaces, regs) - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces) + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview) // 鑾峰彇涓绘悳绱㈡潯浠� let mainSearch = [] @@ -282,7 +288,7 @@ } } - filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces) => { + filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview) => { return components.filter(item => { item.$pageId = pageId @@ -368,7 +374,7 @@ item.subtabs = item.subtabs.map(tab => { tab.$pageId = pageId - tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces) + tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview) return tab }) @@ -381,7 +387,7 @@ return false } - item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces) + item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview) return true } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { @@ -422,15 +428,12 @@ let statFields = [] let getCols = (cols) => { return cols.filter(col => { - if (item.subtype !== 'editable') { - if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { - return false - } else if (col.Hide === 'true') { - return false - } - } else if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { - col.Hide = 'true' + if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { + return false + } else if (col.Hide === 'true') { + return false } + if (col.type === 'number') { if (col.sum === 'true' && !statFields.includes(col.field)) { statFields.push(col) @@ -492,18 +495,16 @@ } // 鏉冮檺杩囨护 - let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 寮圭獥鏍囩鎸夐挳Id if (item.action && item.action.length > 0) { item.action = item.action.filter(cell => { - if (item.hidden === 'true') return false + if (cell.hidden === 'true') return false cell.logLabel = item.$menuname + '-' + cell.label cell.ContainerId = this.state.ContainerId cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID - cell.$tabId = tabId - cell.$view = 'CustomPage' + cell.$view = popview cell.$toolbtn = true if (!mutil && cell.syncComponentId === item.setting.supModule) { @@ -542,8 +543,7 @@ cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID - cell.$tabId = tabId - cell.$view = 'CustomPage' + cell.$view = popview if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' @@ -583,8 +583,7 @@ cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID - cell.$tabId = tabId - cell.$view = 'CustomPage' + cell.$view = popview if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' @@ -629,8 +628,7 @@ cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID - cell.$tabId = tabId - cell.$view = 'CustomPage' + cell.$view = popview if (cell.syncComponentId === item.wrap.supModule) { cell.syncComponentId = '' @@ -665,8 +663,7 @@ cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : '' cell.$menuId = item.uuid cell.$MenuID = this.props.MenuID - cell.$tabId = tabId - cell.$view = 'CustomPage' + cell.$view = popview if (cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' @@ -1251,7 +1248,7 @@ <Row className="component-wrap">{this.getComponents()}</Row> {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null} {config && window.GLOB.breakpoint ? <DebugTable /> : null} - {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} + {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null} {!window.GLOB.mkHS && config ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null} {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} </div> -- Gitblit v1.8.0