| | |
| | | } |
| | | |
| | | config.$cache = config.cacheLocal === 'true' |
| | | config.$time = config.localCacheTime || 0 |
| | | |
| | | let initInters = [] |
| | | |
| | | config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.MenuName, MenuID, MenuID) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.$time, config.MenuName, MenuID, MenuID) |
| | | |
| | | let params = [] |
| | | let BID = param.$BID || '' |
| | |
| | | } |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName, searchId, syncId) => { |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, searchId, syncId) => { |
| | | return components.filter(item => { |
| | | item.$pageId = pageId |
| | | item.$cache = cache |
| | | item.$time = time |
| | | item.$searchId = searchId |
| | | item.$syncId = syncId |
| | | |
| | |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.$pageId = pageId |
| | | tab.$cache = cache |
| | | tab.$time = time |
| | | |
| | | let _searchId = searchId |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName, _searchId, tab.uuid) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, _searchId, tab.uuid) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName, searchId, syncId) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, searchId, syncId) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) { |
| | |
| | | |
| | | this.setState({loading: true, loadingview: false}) |
| | | |
| | | if (config.$cache && config.$time) { |
| | | Api.getLCacheConfig(params[0].uuid, config.$time).then(res => { |
| | | if (!res) { |
| | | this.getMainData(param, params, config.MenuID) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.getMainData(param, params, config.MenuID) |
| | | } |
| | | } |
| | | |
| | | getMainData = (param, params, MenuID) => { |
| | | Api.genericInterface(param).then(result => { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | window.GLOB.SyncData.set(item.name, _data) |
| | | }) |
| | | |
| | | MKEmitter.emit('transferSyncData', config.MenuID) |
| | | MKEmitter.emit('transferSyncData', MenuID) |
| | | } else { |
| | | MKEmitter.emit('transferSyncData', config.MenuID) |
| | | MKEmitter.emit('transferSyncData', MenuID) |
| | | |
| | | if (!result.message) return |
| | | if (result.ErrCode === 'N') { |