From 2a3cc4e6cecfc6dab8b60adf93f7fde898ddc939 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 25 七月 2023 16:36:23 +0800 Subject: [PATCH] 2023-07-25 --- src/tabviews/custom/components/editor/braft-editor/index.jsx | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index 38f0382..ccef7cc 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/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} @@ -62,12 +64,6 @@ 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) - } }) } @@ -88,6 +84,8 @@ if (config.wrap.datatype === 'public') { MKEmitter.addListener('mkPublicData', this.mkPublicData) } + + this.initExec() } shouldComponentUpdate (nextProps, nextState) { @@ -105,6 +103,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