From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 24 一月 2025 11:10:32 +0800 Subject: [PATCH] 2025-01-24 --- src/tabviews/custom/components/share/tabtransfer/index.jsx | 58 ++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 9157f43..0a67c42 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -50,9 +50,16 @@ UNSAFE_componentWillMount () { let _config = fromJS(this.props.config).toJS() + let BID = '' + let BData = window.GLOB.CacheData.get(_config.$pageId) + + if (BData) { + BID = BData.$BID || '' + } + let params = [] if (_config.type !== 'group') { - _config.components = this.formatSetting(_config.components, params) + _config.components = this.formatSetting(_config.components, params, BID) } else { let delay = 110 _config.components.forEach(item => { @@ -68,17 +75,17 @@ config: _config }, () => { if (params.length > 0) { - this.loadmaindata(params) + this.loadmaindata(params, BID) } }) } - formatSetting = (components, params) => { + formatSetting = (components, params, BID) => { let delay = 110 return components.map(item => { if (item.type === 'tabs') return item if (item.type === 'group') { - item.components = this.formatSetting(item.components, params) + item.components = this.formatSetting(item.components, params, BID) return item } @@ -102,7 +109,18 @@ item.setting.sync = 'false' item.setting.onload = 'false' } else { - params.push(getStructDefaultParam(item, searchlist, params.length === 0)) + let backend = false + if (window.backend && params.length === 0 && window.GLOB.CacheData.has('sql_' + item.uuid)) { + backend = true + } else if (window.backend && params[0] && params[0].exps) { + backend = true + } + + if (backend && !window.GLOB.CacheData.has('sql_' + item.uuid)) { + item.setting.sync = 'false' + } else { + params.push(getStructDefaultParam(item, searchlist, params.length === 0, BID)) + } } } @@ -116,20 +134,18 @@ /** * @description 涓昏〃鏁版嵁鍔犺浇 */ - loadmaindata = (params) => { + loadmaindata = (params, BID) => { const { config } = this.state - let BID = '' - let BData = window.GLOB.CacheData.get(config.$pageId) - - if (BData) { - BID = BData.$BID || '' - } let param = getStructuredParams(params, config, BID) if (config.$cache && config.$time) { - Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { - if (!res) { + let uuid = params[0].uuid || '' + if (params[0].id) { + uuid = window.GLOB.CacheData.get('first_' + params[0].id) || '' + } + Api.getLCacheConfig(uuid, config.$time, BID).then(res => { + if (!res.valid) { this.getMainData(param, params, config.uuid) } }) @@ -156,11 +172,11 @@ } params.forEach((item) => { - let _data = result[item.name] || '' + let _data = result[item.dataName] || '' if (_data && !Array.isArray(_data)) { _data = [_data] } - window.GLOB.SyncData.set(item.name, _data) + window.GLOB.SyncData.set(item.dataName, _data) }) MKEmitter.emit('transferSyncData', tabId) @@ -168,6 +184,10 @@ 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, @@ -290,9 +310,7 @@ ) } else if (item.type === 'group' && item.subtype === 'normalgroup') { return ( - <Col span={item.width} style={style} key={item.uuid}> - <NormalGroup config={item}/> - </Col> + <NormalGroup config={item} style={style} key={item.uuid}/> ) } else if (item.type === 'form' && item.subtype === 'simpleform') { return ( @@ -384,7 +402,7 @@ } return ( - <Row className="component-wrap" id={'anchor' + config.uuid} gutter={8}>{this.getComponents(config.components)}</Row> + <Row className="component-wrap" id={'anchor' + config.uuid}>{this.getComponents(config.components)}</Row> ) } } -- Gitblit v1.8.0