From 5e1d4d5155c57c43739d61914e2d29a64f9bb683 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 八月 2023 17:40:38 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/custom/components/table/normal-table/index.jsx | 90 +++++--------------------------------------- 1 files changed, 11 insertions(+), 79 deletions(-) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index e2aac93..63b75d4 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -87,7 +87,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -180,7 +180,6 @@ pageIndex: 1 }, () => { this.loadmaindata(true, 'true', '', 'timer') - this.getStatFieldsValue() }) }) } @@ -207,12 +206,12 @@ } initExec = () => { - const { config, setting } = this.state + const { config, setting, BID } = this.state if (config.$cache) { if (config.$time && !setting.laypage) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadmaindata(false, 'true', '', 'init') @@ -247,7 +246,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: res.data.map((item, index) => { @@ -278,14 +277,12 @@ if (config.setting.onload === 'true') { setTimeout(() => { this.loadmaindata(false, 'true', '', 'init') - this.getStatFieldsValue() }, config.setting.delay || 0) } } } else if (config.setting.onload === 'true') { setTimeout(() => { this.loadmaindata() - this.getStatFieldsValue() }, config.setting.delay || 0) } } @@ -300,7 +297,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -399,7 +396,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { @@ -524,6 +521,11 @@ async loadmainLinedata (id) { const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state + if (config.forbidLine) { + this.reloadtable() + return + } + let searches = fromJS(search).toJS() if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢 let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] @@ -639,72 +641,6 @@ } /** - * @description 鑾峰彇鍚堣瀛楁鍊� - */ - getStatFieldsValue = () => { - const { setting, config, search, BID, orderBy } = this.state - - if (setting.supModule && !BID && setting.supKey !== 'false') { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� - this.setState({ - statFValue: [] - }) - return - } - - if (config.statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return - - let searches = fromJS(search).toJS() - if (config.setting.useMSearch) { // 涓昏〃鎼滅储鏉′欢 - let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || [] - let keys = config.$s_keys || [] - mainSearch.forEach(item => { - if (keys.includes(item.key.toLowerCase())) return - - searches.push(item) - }) - } - - if (config.$s_req && searches.filter(item => item.required && item.value === '').length > 0) { - return - } - - let _orderBy = orderBy || setting.order - let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID) - - Api.genericInterface(param).then(res => { - if (res.status) { - let _data = res.data[0] - let values = [] - - if (_data) { - config.statFields.forEach(item => { - if (_data[item.field] || _data[item.field] === 0) { - let val = +_data[item.field] - if (isNaN(val)) { - val = 0 - } - val = val.toFixed(item.decimal) - values.push({label: item.label, value: val}) - } - }) - } - this.setState({ - statFValue: values - }) - } else { - this.setState({ - statFValue: [] - }) - notification.error({ - top: 92, - message: res.message, - duration: 10 - }) - } - }) - } - - /** * @description 鎼滅储鏉′欢鏀瑰彉鏃讹紝閲嶇疆琛ㄦ牸鏁版嵁 * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� */ @@ -714,7 +650,6 @@ search: searches }, () => { this.loadmaindata(true, 'true') - this.getStatFieldsValue() }) } @@ -748,11 +683,9 @@ pageIndex: 1 }, () => { this.loadmaindata(true, 'true', id) - this.getStatFieldsValue() }) } else { this.loadmaindata(true, 'false', id) - this.getStatFieldsValue() } } @@ -805,7 +738,6 @@ BData: data }, () => { this.loadmaindata(true, 'true') - this.getStatFieldsValue() }) } } -- Gitblit v1.8.0