From 8190d6e5ac14616d85e3992169ecef6d99d03b76 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 十一月 2020 15:29:57 +0800 Subject: [PATCH] 2020-11-13 --- src/tabviews/commontable/index.jsx | 92 +++++++++++++++++++--------------------------- 1 files changed, 38 insertions(+), 54 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 52c0e90..6b8431d 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -28,9 +28,6 @@ const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent')) const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent')) -// 鑷畾涔夋爣绛� -const SecretKeyTable = asyncSpinComponent(() => import('./secretKeyTable')) - const { TabPane } = Tabs const { TreeNode } = Tree const { Paragraph } = Typography @@ -142,18 +139,6 @@ } // 鍘婚櫎绌鸿鏍囩 config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0) - - // HS涓嬭嚜瀹氫箟澶勭悊鐨勬爣绛� - if (this.props.menuType === 'HS') { - config.tabgroups.forEach(group => { - group.sublist = group.sublist.map(tab => { - if (tab.linkTab === '1586577325055l2ng7t75g7i4ek2ng8o') { - tab.type = 'SecretKeyTable' - } - return tab - }) - }) - } // 瑙嗗浘鏉冮檺 config.charts = config.charts.filter(item => { @@ -504,6 +489,15 @@ const { setting, arr_field, BIDs, search, orderBy, BID, pageIndex, pageSize } = this.state let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0)) + this.setState({ + selectedData: [], + BIDs: { + ...BIDs, + mainTable: '', + mainTabledata: '' + } + }) + if (requireFields.length > 0) { let labels = requireFields.map(item => item.label) labels = Array.from(new Set(labels)) @@ -523,6 +517,10 @@ let _orderBy = orderBy || setting.order let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager) + if (param.func === 'sPC_Get_TableData') { + param.menuname = this.props.MenuName || '' + } + let result = await Api.genericInterface(param) if (result.status) { this.setState({ @@ -531,14 +529,8 @@ return item }), total: result.total, - selectedData: [], loading: false, - pickup: false, - BIDs: { - ...BIDs, - mainTable: '', - mainTabledata: '' - } + pickup: false }) } else { this.setState({ @@ -567,6 +559,10 @@ let _orderBy = orderBy || setting.order let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager) + + if (param.func === 'sPC_Get_TableData') { + param.menuname = this.props.MenuName || '' + } Api.genericInterface(param).then(res => { if (res.status) { @@ -833,11 +829,7 @@ UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) { - if (nextProps.refreshTab.position === 'grid') { - this.reloadtable() - } else if (nextProps.refreshTab.position === 'view') { - this.reloadview() - } + this.reloadview() this.props.refreshTabView('') } else if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] @@ -870,7 +862,7 @@ } render() { - const { menuType } = this.props + const { menuType, MenuName } = this.props const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state return ( @@ -905,6 +897,7 @@ BID={BID} setting={setting} actions={actions} + MenuName={MenuName} dict={this.state.dict} MenuID={this.props.MenuID} selectedData={selectedData} @@ -918,9 +911,9 @@ {this.props.menuType !== 'HS' ? <SettingComponent config={config} columns={columns} + MenuName={MenuName} dict={this.state.dict} MenuID={this.props.MenuID} - MenuName={this.props.MenuName} permAction={this.props.permAction} permRoles={this.props.permRoles} userConfig={this.state.userConfig} @@ -936,6 +929,7 @@ config={config} setting={setting} columns={columns} + MenuName={MenuName} pageSize={pageSize} dict={this.state.dict} data={this.state.data} @@ -960,6 +954,7 @@ BID={BID} plot={item} config={config} + MenuName={MenuName} tableId="mainTable" data={this.state.data} MenuID={this.props.MenuID} @@ -979,6 +974,7 @@ BID={BID} plot={item} config={config} + MenuName={MenuName} data={this.state.data} getexceloutparam={this.getexceloutparam} loading={this.state.loading} @@ -999,31 +995,19 @@ {_tab.label} </span> } key={_tab.uuid}> - {_tab.type === 'SubTable' ? - <SubTable - Tab={_tab} - MenuID={_tab.linkTab} - mainSearch={_tab.searchPass === 'true' ? search : null} - userConfig={userConfig ? userConfig[_tab.uuid] : null} - SupMenuID={this.props.MenuID} - refreshtabs={this.state.refreshtabs} - ContainerId={this.state.ContainerId} - BID={this.state.BIDs[_tab.supMenu] || ''} - BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} - handleTableId={this.handleTableId} - handleMainTable={(type) => this.handleMainTable(type, _tab)} - /> : null} - {_tab.type === 'SecretKeyTable' ? - <SecretKeyTable - Tab={_tab} - MenuID={_tab.linkTab} - SupMenuID={this.props.MenuID} - refreshtabs={this.state.refreshtabs} - ContainerId={this.state.ContainerId} - BID={this.state.BIDs[_tab.supMenu] || ''} - BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} - handleMainTable={(type) => this.handleMainTable(type, _tab)} - /> : null} + <SubTable + Tab={_tab} + MenuID={_tab.linkTab} + mainSearch={_tab.searchPass === 'true' ? search : null} + userConfig={userConfig ? userConfig[_tab.uuid] : null} + SupMenuID={this.props.MenuID} + refreshtabs={this.state.refreshtabs} + ContainerId={this.state.ContainerId} + BID={this.state.BIDs[_tab.supMenu] || ''} + BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} + handleTableId={this.handleTableId} + handleMainTable={(type) => this.handleMainTable(type, _tab)} + /> </TabPane> ) })} -- Gitblit v1.8.0