From 71e3da644eca32a5aa40503e903efb0640748093 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 七月 2023 17:00:59 +0800 Subject: [PATCH] 2023-07-21 --- src/tabviews/commontable/index.jsx | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index f9887fb..4945a41 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -22,8 +22,8 @@ const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable')) const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent')) const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent')) -const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) -const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) +// const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) +// const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) const { TabPane } = Tabs @@ -63,7 +63,6 @@ statFields: [], // 鍚堣瀛楁 statFValue: [], // 鍚堣鍊� absFields: [], // 缁濆鍊煎瓧娈� - hasReqFields: false, autoMatic: null, visible: false } @@ -209,19 +208,13 @@ chartId = config.charts[0] ? config.charts[0].uuid : '' } - config.search = Utils.initSearchVal(config.search) + Utils.initSearchVal(config) // 瀛楁閫忚鍙婂繀濉爣蹇� - let hasReqFields = false config.search = config.search.map(item => { if (['text', 'select', 'link'].includes(item.type) && param && param.$searchkey === item.field) { item.initval = param.$searchval } - - if (item.required) { - hasReqFields = true - } - return item }) @@ -263,10 +256,8 @@ } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 - config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*') - config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/') - config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*') - config.setting.customScript = config.setting.customScript.replace(/@\$/ig, '*/') + config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/') + config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/') } else { config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '') config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '') @@ -454,6 +445,7 @@ searchRatio: config.setting.searchRatio || '', searchLwidth: config.setting.searchLwidth, borderRadius: config.setting.borderRadius, + resetContrl: config.setting.resetContrl, } this.setState({ @@ -470,8 +462,7 @@ columns: _columns, arr_field: _arrField.join(','), BID: param && param.$BID ? param.$BID : '', - search: Utils.initMainSearch(config.search), - hasReqFields + search: Utils.initMainSearch(config.search) }, () => { if (config.setting.onload !== 'false') { // 鍒濆鍖栧彲鍔犺浇 this.loadData() @@ -539,14 +530,14 @@ loadData = (id) => { const { MenuID } = this.props - const { setting, search, hasReqFields, ContainerId } = this.state + const { setting, search, config, ContainerId } = this.state this.setState({ selectedData: [] }) MKEmitter.emit('changeTableLine', ContainerId, MenuID, '', '') - if (hasReqFields) { + if (config.$s_req) { let requireFields = search.filter(item => item.required && item.value === '') if (requireFields.length > 0) { @@ -1005,12 +996,12 @@ render() { const { MenuID } = this.props - const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts, autoMatic } = this.state + const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts } = this.state return ( <div className="commontable" id={this.state.ContainerId}> {loadingview ? <Spin size="large" /> : null} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } {setting && config.charts ? <Row className="chart-view" gutter={16}> @@ -1143,8 +1134,8 @@ </Tabs>)) } {setting && window.GLOB.breakpoint ? <DebugTable /> : null} - {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} - {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null} + {/* {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} */} + {/* {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null} */} {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null} {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} </div> -- Gitblit v1.8.0