Commit edad816cca127aa89328f4e8a5496daeed6456e3
1 parent
38faf704
fix: not regain get contentAllCell on switch page
Showing
2 changed files
with
22 additions
and
6 deletions
... | ... | @@ -590,7 +590,11 @@ |
590 | 590 | </div> |
591 | 591 | <script> |
592 | 592 | var timeInterval = setInterval(() => { |
593 | - if (!echarts) return | |
593 | + try { | |
594 | + if (!echarts) return | |
595 | + } catch (error) { | |
596 | + | |
597 | + } | |
594 | 598 | clearInterval(timeInterval) |
595 | 599 | timeInterval = null |
596 | 600 | var chartDom | ... | ... |
... | ... | @@ -13286,6 +13286,10 @@ class HandleDataSource { |
13286 | 13286 | return Sidebar.prototype.enumComponentType |
13287 | 13287 | } |
13288 | 13288 | |
13289 | + get contentAllCell() { | |
13290 | + return this.graph.getDefaultParent().children || [] | |
13291 | + } | |
13292 | + | |
13289 | 13293 | /** |
13290 | 13294 | * @description 生成普通数据源绑定映射关系 |
13291 | 13295 | * @param dataSources |
... | ... | @@ -13750,7 +13754,7 @@ class HandleDataSource { |
13750 | 13754 | */ |
13751 | 13755 | getNodeByCmdId(subscriptionId) { |
13752 | 13756 | const nodeId = this.getNodeIdByCmdId(subscriptionId) |
13753 | - return this.DispatchInstance.contentAllCell.find(item => item.id === nodeId) | |
13757 | + return this.contentAllCell.find(item => item.id === nodeId) | |
13754 | 13758 | } |
13755 | 13759 | |
13756 | 13760 | getComponentType(node) { |
... | ... | @@ -13831,6 +13835,10 @@ class HandleDataInteraction { |
13831 | 13835 | return DispatchCenter.instance.contentData |
13832 | 13836 | } |
13833 | 13837 | |
13838 | + get contentAllCell() { | |
13839 | + return this.graph.getDefaultParent().children || [] | |
13840 | + } | |
13841 | + | |
13834 | 13842 | /** |
13835 | 13843 | * @description 事件映射 |
13836 | 13844 | */ |
... | ... | @@ -14031,7 +14039,7 @@ class HandleDataInteraction { |
14031 | 14039 | const { SWITCH_STATE_ENABLED, SWITCH_STATE_NONE, SWITCH_STATE_CLOSE } = Sidebar.prototype.enumComponentTypeValue |
14032 | 14040 | const { COMPONENT_TYPE } = Sidebar.prototype.enumCellBasicAttribute |
14033 | 14041 | const contentData = this.contentData |
14034 | - const currentNode = this.DispatchInstance.contentAllCell.find(item => item.id === nodeId) | |
14042 | + const currentNode = this.contentAllCell.find(item => item.id === nodeId) | |
14035 | 14043 | |
14036 | 14044 | const enumConst = { |
14037 | 14045 | VALUE: 'value', |
... | ... | @@ -14353,6 +14361,10 @@ class HandleDynamicEffect { |
14353 | 14361 | return this.DispatchInstance.updateQueueInstance.delUpdateFn.bind(this.DispatchInstance.updateQueueInstance) |
14354 | 14362 | } |
14355 | 14363 | |
14364 | + get contentAllCell() { | |
14365 | + return this.graph.getDefaultParent().children || [] | |
14366 | + } | |
14367 | + | |
14356 | 14368 | /** |
14357 | 14369 | * @description 筛选出视频数据源 |
14358 | 14370 | */ |
... | ... | @@ -14368,7 +14380,7 @@ class HandleDynamicEffect { |
14368 | 14380 | getEnableActList() { |
14369 | 14381 | const { act = [] } = this.DispatchInstance.contentData |
14370 | 14382 | // 过滤页面中没有的节点及未开启动效的节点 |
14371 | - this.enableActList = act.filter(item => this.DispatchInstance.contentAllCell.find(each => each.id === item.id) && item.enabled) | |
14383 | + this.enableActList = act.filter(item => this.contentAllCell.find(each => each.id === item.id) && item.enabled) | |
14372 | 14384 | // this.enableActList = act.filter(item => item.enabled) |
14373 | 14385 | } |
14374 | 14386 | |
... | ... | @@ -14676,7 +14688,7 @@ class HandleDynamicEffect { |
14676 | 14688 | * @description 获取cell 通过cell id |
14677 | 14689 | */ |
14678 | 14690 | getCellByCellId(id) { |
14679 | - const allCell = this.DispatchInstance.contentAllCell || [] | |
14691 | + const allCell = this.contentAllCell || [] | |
14680 | 14692 | return allCell.find(item => item.id === id) |
14681 | 14693 | } |
14682 | 14694 | |
... | ... | @@ -14742,7 +14754,7 @@ class HandleDynamicEffect { |
14742 | 14754 | */ |
14743 | 14755 | getNodeByCmdId(subscriptionId) { |
14744 | 14756 | const nodeId = this.getNodeIdByCmdId(subscriptionId) |
14745 | - return this.DispatchInstance.contentAllCell.find(item => item.id === nodeId) | |
14757 | + return this.contentAllCell.find(item => item.id === nodeId) | |
14746 | 14758 | } |
14747 | 14759 | |
14748 | 14760 | /** | ... | ... |