From 6b699dc5a69457d76577d17903d54011a6561d97 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 八月 2023 11:48:47 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/components/tree/antd-tree/index.jsx | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 3046ea7..6aad5fb 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -77,8 +77,7 @@ selected: _config.wrap.selected === 'true', config: _config, data: _data, - BID: BID || '', - arr_field: _config.columns.map(col => col.field).join(',') + BID: BID || '' }) } @@ -105,7 +104,7 @@ if (config.timer) { this.timer = new TimerTask() this.timer.init(config.uuid, config.timer, config.timerRepeats, () => { - this.loadData(true) + this.loadData('timer') }) } @@ -136,15 +135,15 @@ if (config.$time) { if (!this.loaded) { Api.getLCacheConfig(config.uuid, config.$time).then(res => { - if (!res && config.setting.onload === 'true') { + if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { - this.loadData() + this.loadData('init') }, config.setting.delay || 0) } - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.handleData() }) }) @@ -154,9 +153,9 @@ } else { if (!this.loaded) { Api.getLCacheConfig(config.uuid, 0).then(res => { - if (!res || this.loaded) return + if (!res.data || this.loaded) return - this.setState({data: res}, () => { + this.setState({data: res.data}, () => { this.handleData() }) }) @@ -164,7 +163,7 @@ if (config.setting.onload === 'true') { setTimeout(() => { - this.loadData() + this.loadData('init') }, config.setting.delay || 0) } else if (this.loaded) { this.handleData() @@ -234,7 +233,7 @@ * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁� */ queryModuleParam = (menuId, callback) => { - const { arr_field, config } = this.state + const { config } = this.state if (config.uuid !== menuId) return @@ -244,10 +243,8 @@ } callback({ - arr_field: arr_field, orderBy: config.setting.order || '', - search: searches, - menuName: config.name + search: searches }) } @@ -272,8 +269,8 @@ /** * @description 鏁版嵁鍔犺浇 */ - async loadData (hastimer) { - const { config, arr_field, BID } = this.state + async loadData (type) { + const { config, BID } = this.state if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� this.setState({ @@ -294,19 +291,19 @@ return } - if (!hastimer) { + if (type !== 'timer') { this.setState({ loading: true }) } let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID) + let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, '', '', BID) let result = await Api.genericInterface(param) if (result.status) { this.loaded = true - if (config.$cache && config.setting.onload !== 'false') { + if (config.$cache && type === 'init') { Api.writeCacheConfig(config.uuid, result.data || []) } -- Gitblit v1.8.0