Commit a24669a2db88e12c5749017e8d09631c8c04c07f

Authored by ww
1 parent db6541f2

fix: fix switch page can not get content data

@@ -12467,14 +12467,14 @@ class HandleDataSource { @@ -12467,14 +12467,14 @@ class HandleDataSource {
12467 * @description 普通数据源绑定列表 12467 * @description 普通数据源绑定列表
12468 */ 12468 */
12469 get commonDataSourceBindList() { 12469 get commonDataSourceBindList() {
12470 - return this.DispatchInstance.contentData.dataSources.filter(item => !item.additional) 12470 + return this.DispatchInstance.contentData?.dataSources?.filter(item => !item.additional) || []
12471 } 12471 }
12472 12472
12473 /** 12473 /**
12474 * @description 图表数据源绑定列表 12474 * @description 图表数据源绑定列表
12475 */ 12475 */
12476 get chartDataSourceBindList() { 12476 get chartDataSourceBindList() {
12477 - return this.DispatchInstance.contentData.dataSources.filter(item => item.additional) 12477 + return this.DispatchInstance.contentData?.dataSources?.filter(item => item.additional) || []
12478 } 12478 }
12479 12479
12480 get cmdIdMapping() { 12480 get cmdIdMapping() {
@@ -12802,6 +12802,7 @@ class HandleDataSource { @@ -12802,6 +12802,7 @@ class HandleDataSource {
12802 let interval 12802 let interval
12803 // TODO 清除定时器 12803 // TODO 清除定时器
12804 function autoMove() { 12804 function autoMove() {
  12805 + if (seriesValue.length <= 5) return
12805 interval = setInterval(() => { 12806 interval = setInterval(() => {
12806 if (Number(chartOption.dataZoom[0].endValue) === seriesValue.length - 1) { 12807 if (Number(chartOption.dataZoom[0].endValue) === seriesValue.length - 1) {
12807 chartOption.dataZoom[0].endValue = 4 12808 chartOption.dataZoom[0].endValue = 4
@@ -12810,9 +12811,13 @@ class HandleDataSource { @@ -12810,9 +12811,13 @@ class HandleDataSource {
12810 chartOption.dataZoom[0].endValue = chartOption.dataZoom[0].endValue + 1 12811 chartOption.dataZoom[0].endValue = chartOption.dataZoom[0].endValue + 1
12811 chartOption.dataZoom[0].startValue = chartOption.dataZoom[0].startValue + 1 12812 chartOption.dataZoom[0].startValue = chartOption.dataZoom[0].startValue + 1
12812 } 12813 }
12813 -  
12814 - if (!instance) clearInterval(interval) 12814 + console.log('has exist interval')
  12815 + if (!chartInstanceMap.has(chartInstanceId)) {
  12816 + clearInterval(interval)
  12817 + return
  12818 + }
12815 instance && instance.setOption(chartOption) 12819 instance && instance.setOption(chartOption)
  12820 +
12816 }, 2000); 12821 }, 2000);
12817 } 12822 }
12818 12823
@@ -13275,7 +13280,8 @@ class HandleDynamicEffect { @@ -13275,7 +13280,8 @@ class HandleDynamicEffect {
13275 deg += 20 13280 deg += 20
13276 let style = node.getStyle() 13281 let style = node.getStyle()
13277 const reg = /rotation=(-?)\w+(;?)/g 13282 const reg = /rotation=(-?)\w+(;?)/g
13278 - style = style.replace(reg, `rotation=${deg}`) 13283 + style = style.replace(reg, '')
  13284 + style += `rotation=${deg}`
13279 node.setStyle(style) 13285 node.setStyle(style)
13280 this.graph.updateCellStyles(style, node) 13286 this.graph.updateCellStyles(style, node)
13281 } 13287 }
@@ -13442,6 +13448,10 @@ class UpdateQueue { @@ -13442,6 +13448,10 @@ class UpdateQueue {
13442 window.timeMap = this.timeQueue 13448 window.timeMap = this.timeQueue
13443 } 13449 }
13444 13450
  13451 + /**
  13452 + * @description 创建更新队列
  13453 + * @param {number} time
  13454 + */
13445 createUpdateQueue(time) { 13455 createUpdateQueue(time) {
13446 const callback = () => { 13456 const callback = () => {
13447 this.graph.getModel().beginUpdate() 13457 this.graph.getModel().beginUpdate()
@@ -13460,6 +13470,11 @@ class UpdateQueue { @@ -13460,6 +13470,11 @@ class UpdateQueue {
13460 this.timeQueue.set(time, cleanFn) 13470 this.timeQueue.set(time, cleanFn)
13461 } 13471 }
13462 13472
  13473 + createIntervalQueue(time, callback) {
  13474 + const cleanFn = RAFSetInterval(callback, time)
  13475 + this.timeQueue.set(time, cleanFn)
  13476 + }
  13477 +
13463 /** 13478 /**
13464 * @description 持续更新 13479 * @description 持续更新
13465 * @param cell 更新cell 13480 * @param cell 更新cell
@@ -13472,7 +13487,7 @@ class UpdateQueue { @@ -13472,7 +13487,7 @@ class UpdateQueue {
13472 this.updateQueueMapping.set(time, []) 13487 this.updateQueueMapping.set(time, [])
13473 } 13488 }
13474 if (!this.timeQueue.get(time)) { 13489 if (!this.timeQueue.get(time)) {
13475 - this.createUpdateQueue(time, fn) 13490 + this.createUpdateQueue(time)
13476 } 13491 }
13477 if (this.updateQueueMapping.get(time).find(item => item.key === key)) { 13492 if (this.updateQueueMapping.get(time).find(item => item.key === key)) {
13478 return 13493 return