From ccbd330b46d2bddcf0228fd834bb82d482de3613 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 18 十月 2021 10:15:14 +0800 Subject: [PATCH] 2021-10-18 --- src/tabviews/commontable/index.jsx | 36 +++++++++++++++++++++++++----------- 1 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index d139bbc..5e6d483 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -75,11 +75,11 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { permAction, permMenus, param, MenuName } = this.props + const { permAction, permMenus, param, MenuName, MenuID } = this.props let _param = { func: 'sPC_Get_LongParam', - MenuID: this.props.MenuID + MenuID: MenuID } let result = await Api.getCacheConfig(_param) @@ -89,7 +89,7 @@ try { // 閰嶇疆淇℃伅瑙f瀽 config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) - config.MenuID = this.props.MenuID + config.MenuID = MenuID config.MenuName = MenuName config.setting.MenuName = MenuName config.setting.$name = MenuName @@ -160,7 +160,21 @@ if (this.props.menuType !== 'HS') { config.action = config.action.filter(item => permAction[item.uuid]) config.tabgroups.forEach(group => { - group.sublist = group.sublist.filter(tab => permAction[tab.linkTab]) + group.sublist = group.sublist.filter(tab => { + if (tab.supMenu === 'mainTable') { + tab.supMenu = MenuID + } + return permAction[tab.linkTab] + }) + }) + } else { + config.tabgroups.forEach(group => { + group.sublist = group.sublist.map(tab => { + if (tab.supMenu === 'mainTable') { + tab.supMenu = MenuID + } + return tab + }) }) } // 鍘婚櫎绌鸿鏍囩 @@ -1068,7 +1082,7 @@ } render() { - const { menuType } = this.props + const { menuType, MenuID } = this.props const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts, autoMatic } = this.state return ( @@ -1098,7 +1112,7 @@ actions={actions} columns={columns} dict={this.state.dict} - MenuID={this.props.MenuID} + MenuID={MenuID} selectedData={selectedData} ContainerId={this.state.ContainerId} /> @@ -1108,7 +1122,8 @@ <Switch title="鏀惰捣" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> : null } <MainTable - tableId="mainTable" + MenuID={MenuID} + tableId={MenuID} pickup={pickup} setting={setting} columns={columns} @@ -1116,7 +1131,6 @@ dict={this.state.dict} data={this.state.data} total={this.state.total} - MenuID={this.props.MenuID} loading={this.state.loading} statFValue={this.state.statFValue} ContainerId={this.state.ContainerId} @@ -1133,11 +1147,11 @@ <CardComponent BID={BID} plot={item} + MenuID={MenuID} config={config} + tableId={MenuID} columns={columns} - tableId="mainTable" data={this.state.data} - MenuID={this.props.MenuID} loading={this.state.loading} ContainerId={this.state.ContainerId} handleTableId={this.handleTableId} @@ -1171,9 +1185,9 @@ } key={_tab.uuid}> <SubTable Tab={_tab} + SupMenuID={MenuID} MenuID={_tab.linkTab} mainSearch={_tab.searchPass === 'true' ? search : null} - SupMenuID={this.props.MenuID} ContainerId={this.state.ContainerId} BID={this.state.BIDs[_tab.supMenu] || ''} BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} -- Gitblit v1.8.0