From 46849dea63f8a3e5e4a758c9c065479e116b8095 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 31 七月 2023 13:22:47 +0800 Subject: [PATCH] 2023-07-31 --- src/tabviews/custom/components/iframe/index.jsx | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/iframe/index.jsx b/src/tabviews/custom/components/iframe/index.jsx index 02c9a4d..ff983aa 100644 --- a/src/tabviews/custom/components/iframe/index.jsx +++ b/src/tabviews/custom/components/iframe/index.jsx @@ -43,6 +43,8 @@ } if (_config.wrap.datatype === 'dynamic') { + _config.setting.onload = _config.setting.sync === 'true' ? 'false' : 'true' + if (_config.setting.sync === 'true' && window.GLOB.SyncData.has(_config.dataName)) { _data = window.GLOB.SyncData.get(_config.dataName) || [] _data = _data[0] || {$$empty: true} @@ -68,13 +70,7 @@ data: _data, BID: BID || '', config: _config, - arr_field: _config.columns.map(col => col.field).join(','), - }, () => { - if (_config.wrap.datatype === 'dynamic' && config.setting.sync !== 'true' && _config.setting.onload === 'true') { - setTimeout(() => { - this.loadData() - }, _config.setting.delay || 0) - } + arr_field: _config.columns.map(col => col.field).join(',') }) } @@ -98,6 +94,8 @@ node && node.select && node.select() }, 200) } + + this.initExec() } shouldComponentUpdate (nextProps, nextState) { @@ -118,6 +116,16 @@ MKEmitter.removeListener('transferSyncData', this.transferSyncData) } + initExec = () => { + const { config } = this.state + + if (config.wrap.datatype === 'dynamic' && config.setting.onload === 'true') { + setTimeout(() => { + this.loadData() + }, config.setting.delay || 0) + } + } + transferSyncData = (syncId) => { const { config } = this.state -- Gitblit v1.8.0