From 53b68578c161561700bd77759629daa1608e05ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 八月 2023 23:43:05 +0800 Subject: [PATCH] 2023-08-23 --- src/tabviews/custom/components/chart/antv-scatter/index.jsx | 14 +- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 14 +- src/tabviews/custom/components/code/sand-box/index.jsx | 14 +- src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 14 +- src/tabviews/custom/components/tree/antd-tree/index.jsx | 14 +- src/tabviews/custom/components/card/double-data-card/index.jsx | 8 src/tabviews/custom/components/chart/antv-G6/index.jsx | 14 +- src/menu/datasource/index.jsx | 45 +++--- src/tabviews/custom/components/carousel/data-card/index.jsx | 12 src/api/index.js | 19 ++ src/tabviews/custom/components/calendar/index.jsx | 8 src/tabviews/custom/components/chart/custom-chart/index.jsx | 14 +- src/tabviews/custom/components/card/data-card/index.jsx | 12 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 69 ++++----- src/tabviews/custom/components/card/table-card/index.jsx | 12 src/tabviews/custom/components/card/prop-card/index.jsx | 16 +- src/tabviews/custom/components/share/tabtransfer/index.jsx | 2 src/templates/zshare/formconfig.jsx | 2 src/tabviews/custom/components/table/normal-table/index.jsx | 12 src/tabviews/custom/components/chart/antv-pie/index.jsx | 14 +- src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 12 src/tabviews/custom/components/carousel/prop-card/index.jsx | 12 src/tabviews/custom/index.jsx | 6 src/tabviews/custom/components/card/balcony/index.jsx | 12 25 files changed, 187 insertions(+), 186 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index abcfa0b..e01aca6 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -7,6 +7,7 @@ import moment from 'moment' import Utils from '@/utils/utils.js' +import MKEmitter from '@/utils/events.js' import CacheUtils from './cacheutils' window.GLOB.IndexDB = null @@ -329,21 +330,21 @@ CacheUtils.delIndexDBCacheConfig(date, type) } - writeCacheConfig (menuid, data) { + writeCacheConfig (menuid, data, BID = '', id = '') { if (!menuid) return let date = moment().format('YYYY-MM-DD HH:mm:ss') let _data = data ? JSON.stringify(data) : '' let userid = sessionStorage.getItem('UserID') || '' - CacheUtils.writeCacheInIndexDB({menuid: md5(menuid + userid), CreateDate: date, LongParam: _data}) + CacheUtils.writeCacheInIndexDB({menuid: md5(menuid + userid + BID + id), BID: BID, id: id, CreateDate: date, LongParam: _data}) } - getLCacheConfig (menuid, minutes) { + getLCacheConfig (menuid, minutes, BID = '', id = '') { return new Promise((resolve, reject) => { let limit = minutes ? moment().subtract(minutes, 'minutes').format('YYYY-MM-DD HH:mm:ss') : '' let userid = sessionStorage.getItem('UserID') || '' - CacheUtils.getIndexDBCacheConfig(md5(menuid + userid)).then(res => { + CacheUtils.getIndexDBCacheConfig(md5(menuid + userid + BID + id)).then(res => { if (res && res.LongParam) { resolve({data: JSON.parse(res.LongParam), valid: !limit || res.CreateDate > limit}) } else { @@ -369,6 +370,11 @@ let param = { func: 's_get_app_version', modifydate: msg.createDate + } + + if (window.GLOB.initVersion && sessionStorage.getItem('visitorUserID')) { + param.userid = sessionStorage.getItem('visitorUserID') + param.LoginUID = sessionStorage.getItem('visitorLoginUID') } param.TypeCharOne = '' @@ -413,6 +419,7 @@ let clear = false let _appkey = window.GLOB.appkey.substr(-10) let reg = new RegExp(_appkey + '$', 'i') + let reHome = list.includes('home_page_id') list.forEach(mid => { if (reg.test(mid)) { @@ -424,6 +431,10 @@ } CacheUtils.delIndexDBConfig(list) this.delCacheConfig('all') + + if (reHome) { + MKEmitter.emit('reloadMenuView', 'home_page_id') + } } CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime}) diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index c9f7736..9b72d05 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -271,7 +271,7 @@ key: 'dataSource', label: '鏁版嵁婧�', initVal: card.dataSource || '', - placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆�', + placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�粿BID@銆�', required: true, }, { diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx index 75faaeb..dfa48d8 100644 --- a/src/menu/datasource/index.jsx +++ b/src/menu/datasource/index.jsx @@ -100,39 +100,36 @@ }) } } else { - let _search = null - let filterComponent = (box) => { + let filterComponent = (box, mainSearch) => { box.components.forEach(item => { - if (_search) return - - if (item.type === 'search') { - box.slist = [...box.slist, item.search] - } else if (item.uuid === config.uuid) { - _search = box.slist.pop() + if (item.type !== 'search') return + mainSearch = item.search + }) + let has = false + box.components.forEach(item => { + if (item.uuid === config.uuid) { + has = true } else if (item.type === 'group') { item.components.forEach(m => { if (m.uuid !== config.uuid) return - _search = box.slist.pop() - }) - } else if (item.type === 'tabs') { - item.subtabs.forEach(tab => { - tab.slist = [...box.slist] - filterComponent(tab) + has = true }) } }) - } - menu.slist = [] - filterComponent(menu) - if (_search) { - search = _search - } else { - menu.components.forEach(item => { - if (item.type !== 'search') return - search = item.search - }) + if (has) { + search = mainSearch || [] + } else { + box.components.forEach(item => { + if (item.type !== 'tabs') return + + item.subtabs.forEach(tab => { + filterComponent(tab, mainSearch) + }) + }) + } } + filterComponent(menu, null) } this.setState({ diff --git a/src/tabviews/custom/components/calendar/index.jsx b/src/tabviews/custom/components/calendar/index.jsx index 051b672..764dd9b 100644 --- a/src/tabviews/custom/components/calendar/index.jsx +++ b/src/tabviews/custom/components/calendar/index.jsx @@ -100,11 +100,11 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -128,7 +128,7 @@ this.setState({data: _data}) }) } else { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = [] @@ -243,7 +243,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } let data = [] diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index e3cc44f..8378215 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -55,7 +55,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -171,12 +171,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -193,7 +193,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data[0] || {$$empty: true} @@ -226,7 +226,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data[0] || {$$empty: true} @@ -389,7 +389,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (!result.data || !result.data[0]) { diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 0360c81..084a03c 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -157,7 +157,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -252,14 +252,14 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state this.loaded && this.prevCheck() if (config.$cache) { if (config.$time && !config.setting.laypage) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('', 'init') @@ -287,7 +287,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data.map((item, index) => { @@ -331,7 +331,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -762,7 +762,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index 9dea605..8d1d2d2 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -243,7 +243,7 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { let getData = (res) => { @@ -286,7 +286,7 @@ } if (config.$time && !config.setting.laypage) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid) { setTimeout(() => { this.loadData('', 'init') @@ -298,7 +298,7 @@ this.setState({data: getData(res.data)}) }) } else { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: getData(res.data)}) @@ -608,7 +608,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index f8dcefe..3f6d02c 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -55,7 +55,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -172,13 +172,13 @@ } initExec = () => { - const { config, selected, data } = this.state + const { config, selected, data, BID } = this.state if (config.wrap.datatype === 'dynamic') { if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -208,7 +208,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data[0] || {$$empty: true} @@ -276,12 +276,12 @@ } if (config.$cache && config.$time && config.wrap.autoExec) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (res.valid) return this.autoExec() - Api.writeCacheConfig(config.uuid, []) + Api.writeCacheConfig(config.uuid, [], BID) }) } else { this.autoExec() @@ -299,7 +299,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data[0] || {$$empty: true} @@ -533,7 +533,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (!result.data || !result.data[0]) { diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index 74582e6..f131f2c 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -74,7 +74,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -154,12 +154,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time && !config.setting.laypage) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -180,7 +180,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data.map((item, index) => { @@ -217,7 +217,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -374,7 +374,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } let data = [] diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 8740cfd..dcdd491 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -56,7 +56,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -141,12 +141,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -170,7 +170,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data.map((item, index) => { @@ -212,7 +212,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -354,7 +354,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } let data = result.data.map((item, index) => { diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index dcbb04b..273c51a 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -55,7 +55,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -139,13 +139,13 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.wrap.datatype === 'dynamic') { if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -164,7 +164,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return let _data = res.data[0] || {$$empty: true} @@ -204,7 +204,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data[0] || {$$empty: true} @@ -356,7 +356,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (!result.data || !result.data[0]) { diff --git a/src/tabviews/custom/components/chart/antv-G6/index.jsx b/src/tabviews/custom/components/chart/antv-G6/index.jsx index ad28222..9fdeb1e 100644 --- a/src/tabviews/custom/components/chart/antv-G6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-G6/index.jsx @@ -837,7 +837,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -1024,12 +1024,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -1046,7 +1046,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -1072,14 +1072,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } if (!is(fromJS(this.data), fromJS(_data))) { @@ -1154,7 +1154,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 00c7926..7f2b2cf 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -328,7 +328,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -398,12 +398,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -420,7 +420,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -446,14 +446,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } this.data = _data @@ -581,7 +581,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index 5274412..68babea 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -91,7 +91,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -168,12 +168,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -198,7 +198,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -232,14 +232,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } if (config.subtype !== 'ratioboard') { @@ -340,7 +340,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index a8bb8d5..3605b32 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -76,7 +76,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -140,12 +140,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -162,7 +162,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -188,14 +188,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } this.data = _data @@ -297,7 +297,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index dffbc8d..f4751c8 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -68,7 +68,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -136,12 +136,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -160,7 +160,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -188,14 +188,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } this.data = _data @@ -327,7 +327,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx index d505a48..1fcd7c8 100644 --- a/src/tabviews/custom/components/chart/custom-chart/index.jsx +++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx @@ -57,7 +57,7 @@ this.data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID) } _config.setting.sync = 'false' @@ -125,12 +125,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -149,7 +149,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.data = res.data @@ -177,14 +177,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } if (!is(fromJS(this.data), fromJS(_data))) { @@ -320,7 +320,7 @@ let result = await Api.genericInterface(param) if (result.status) { if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.loaded = true diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index b27d86c..d5b40b7 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -48,7 +48,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -106,13 +106,13 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.wrap.datatype !== 'static') { if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -130,7 +130,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: res.data}, () => { @@ -160,14 +160,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } if (!is(fromJS(this.state.data), fromJS(_data))) { @@ -243,7 +243,7 @@ this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (!is(fromJS(this.state.data), fromJS(_data))) { diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index acda596..a4f5005 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -128,7 +128,7 @@ let param = getStructuredParams(params, config, BID) if (config.$cache && config.$time) { - Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { + Api.getLCacheConfig(params[0].uuid, config.$time, BID).then(res => { if (!res.valid) { this.getMainData(param, params, config.uuid) } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index e2aac93..9ce05a8 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -87,7 +87,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -207,12 +207,12 @@ } initExec = () => { - const { config, setting } = this.state + const { config, setting, BID } = this.state if (config.$cache) { if (config.$time && !setting.laypage) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadmaindata(false, 'true', '', 'init') @@ -247,7 +247,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: res.data.map((item, index) => { @@ -300,7 +300,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -399,7 +399,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index e915def..9801617 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -59,7 +59,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -149,12 +149,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -174,7 +174,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: res.data.map((item, index) => { @@ -210,7 +210,7 @@ let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } _data = _data.map((item, index) => { @@ -353,7 +353,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } let data = result.data.map((item, index) => { diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 6aad5fb..721d876 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -60,7 +60,7 @@ _data = window.GLOB.SyncData.get(_config.dataName) || [] if (_config.$cache) { - Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID) } _config.setting.sync = 'false' @@ -129,12 +129,12 @@ } initExec = () => { - const { config } = this.state + const { config, BID } = this.state if (config.$cache) { if (config.$time) { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, config.$time).then(res => { + Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => { if (!res.valid && config.setting.onload === 'true') { setTimeout(() => { this.loadData('init') @@ -152,7 +152,7 @@ } } else { if (!this.loaded) { - Api.getLCacheConfig(config.uuid, 0).then(res => { + Api.getLCacheConfig(config.uuid, 0, BID).then(res => { if (!res.data || this.loaded) return this.setState({data: res.data}, () => { @@ -179,14 +179,14 @@ } transferSyncData = (syncId) => { - const { config } = this.state + const { config, BID } = this.state if (config.$syncId !== syncId) return let _data = window.GLOB.SyncData.get(config.dataName) || [] if (config.$cache) { - Api.writeCacheConfig(config.uuid, fromJS(_data).toJS()) + Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID) } this.loaded = true @@ -304,7 +304,7 @@ if (result.status) { this.loaded = true if (config.$cache && type === 'init') { - Api.writeCacheConfig(config.uuid, result.data || []) + Api.writeCacheConfig(config.uuid, result.data || [], BID) } this.setState({ diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 8cf3efe..fbdce49 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -1151,13 +1151,13 @@ * @description 涓昏〃鏁版嵁鍔犺浇 */ loadmaindata = (params) => { - const { config } = this.state - let param = getStructuredParams(params, config, this.state.BID || '') + const { config, BID } = this.state + let param = getStructuredParams(params, config, BID || '') this.setState({loading: true, loadingview: false}) if (config.$cache && config.$time) { - Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { + Api.getLCacheConfig(params[0].uuid, config.$time, BID).then(res => { if (!res.valid) { this.getMainData(param, params, config.MenuID) } else { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index a99543e..a262c40 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -300,54 +300,47 @@ searches = search } else { - let search = [] - + searches = fromJS(config.search || []).toJS() + if (config.setting && config.setting.useMSearch === 'true' && window.GLOB.customMenu) { let menu = fromJS(window.GLOB.customMenu).toJS() - let _search = null - let filterComponent = (box) => { + let filterComponent = (box, mainSearch) => { box.components.forEach(item => { - if (_search) return - - if (item.type === 'search') { - box.slist = [...box.slist, item.search] - } else if (item.uuid === config.uuid) { - _search = box.slist.pop() + if (item.type !== 'search') return + mainSearch = item.search + }) + let has = false + box.components.forEach(item => { + if (item.uuid === config.uuid) { + has = true } else if (item.type === 'group') { item.components.forEach(m => { if (m.uuid !== config.uuid) return - _search = box.slist.pop() - }) - } else if (item.type === 'tabs') { - item.subtabs.forEach(tab => { - tab.slist = [...box.slist] - filterComponent(tab) + has = true }) } }) - } - menu.slist = [] - filterComponent(menu) - - if (_search) { - search = _search - } else { - menu.components.forEach(item => { - if (item.type !== 'search') return - search = item.search - }) - } - } - - searches = fromJS(config.search || []).toJS() - - if (search.length > 0) { - let keys = searches.map(item => (item.field ? item.field.toLowerCase() : '')) - search.forEach(item => { - if (item.field && !keys.includes(item.field.toLowerCase())) { - searches.push(item) + + if (has) { + if (mainSearch) { + let keys = searches.map(item => (item.field ? item.field.toLowerCase() : '')) + mainSearch.forEach(item => { + if (item.field && !keys.includes(item.field.toLowerCase())) { + searches.push(item) + } + }) + } + } else { + box.components.forEach(item => { + if (item.type !== 'tabs') return + + item.subtabs.forEach(tab => { + filterComponent(tab, mainSearch) + }) + }) } - }) + } + filterComponent(menu, null) } } diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 313c909..db78cd8 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2924,7 +2924,7 @@ key: 'dataSource', label: '鏁版嵁婧�', initVal: card.dataSource || '', - placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆�', + placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�硷細@ID@銆丂BID@銆�', required: true, readonly: false }, -- Gitblit v1.8.0