From cdd5b449130ea4d7223fde4f414a11a7d0c33d6d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 三月 2024 17:52:16 +0800 Subject: [PATCH] 2024-03-07 --- src/tabviews/custom/components/share/tabtransfer/index.jsx | 31 +++++++++++++++++++++++-------- 1 files changed, 23 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..2523935 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, BID).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,11 +163,15 @@ 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 (/灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(result.message)) { + result.message = result.message + '璇锋鏌ュ瓧娈甸泦' + } if (result.ErrCode === 'N') { Modal.error({ title: result.message, -- Gitblit v1.8.0