From dc258e4600bea2fba1e25054d163a2f4b1326a85 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 08 八月 2023 10:23:38 +0800 Subject: [PATCH] 2023-08-08 --- src/tabviews/custom/components/share/tabtransfer/index.jsx | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 8ef2320..acda596 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -50,14 +50,9 @@ UNSAFE_componentWillMount () { let _config = fromJS(this.props.config).toJS() + let params = [] if (_config.type !== 'group') { - let params = [] - _config.components = this.formatSetting(_config.components, params) - - if (params.length > 0) { - this.loadmaindata(params) - } } else { let delay = 110 _config.components.forEach(item => { @@ -71,6 +66,10 @@ this.setState({ config: _config + }, () => { + if (params.length > 0) { + this.loadmaindata(params) + } }) } @@ -128,6 +127,18 @@ let param = getStructuredParams(params, config, BID) + if (config.$cache && config.$time) { + Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { + if (!res.valid) { + this.getMainData(param, params, config.uuid) + } + }) + } else { + this.getMainData(param, params, config.uuid) + } + } + + getMainData = (param, params, tabId) => { Api.genericInterface(param).then(result => { if (result.status) { if (result.message) { @@ -152,9 +163,9 @@ window.GLOB.SyncData.set(item.name, _data) }) - MKEmitter.emit('transferSyncData', config.uuid) + MKEmitter.emit('transferSyncData', tabId) } else { - MKEmitter.emit('transferSyncData', config.uuid) + MKEmitter.emit('transferSyncData', tabId) if (!result.message) return if (result.ErrCode === 'N') { -- Gitblit v1.8.0