Commit e8209777a3f7d0dcc486d00a404edd97c2db049c

Authored by ww
1 parent 3ab7d514

fix: 修复组态导入时图表组件未渲染示例

@@ -378,17 +378,15 @@ @@ -378,17 +378,15 @@
378 /** 378 /**
379 * @description 初始化图表 379 * @description 初始化图表
380 */ 380 */
381 - // const openFileHandle = EditorUi.prototype.openFileHandle  
382 - // EditorUi.prototype.openFileHandle = function () {  
383 - // console.log('enter open file')  
384 - // try {  
385 - // openFileHandle.apply(this, arguments)  
386 - // } finally {  
387 - // console.log('openFileHandle')  
388 - // const graph = this.editor.graph  
389 - // Sidebar.prototype.initChartInstance(graph)  
390 - // }  
391 - // } 381 + const openFileHandle = EditorUi.prototype.openFileHandle
  382 + EditorUi.prototype.openFileHandle = function () {
  383 + try {
  384 + openFileHandle.apply(this, arguments)
  385 + } finally {
  386 + const graph = this.editor.graph
  387 + Sidebar.prototype.initChartInstance(graph)
  388 + }
  389 + }
392 390
393 /** 391 /**
394 * @description 实例化 echarts 392 * @description 实例化 echarts
@@ -416,7 +414,6 @@ @@ -416,7 +414,6 @@
416 // EditorUi.prototype.selectPage = function () { 414 // EditorUi.prototype.selectPage = function () {
417 // try { 415 // try {
418 // selectPage.apply(this, arguments) 416 // selectPage.apply(this, arguments)
419 -  
420 // } finally { 417 // } finally {
421 // Sidebar.prototype.chartsInstanceMapping.clear() 418 // Sidebar.prototype.chartsInstanceMapping.clear()
422 // const graph = this.editor.graph 419 // const graph = this.editor.graph
@@ -948,9 +945,3 @@ function getFlowmeterType() { @@ -948,9 +945,3 @@ function getFlowmeterType() {
948 CIRCLE: type.CIRCLE 945 CIRCLE: type.CIRCLE
949 } 946 }
950 } 947 }
951 -  
952 -  
953 -function getComponentType() {  
954 - const componentType = Sidebar.prototype.enumComponentType  
955 - return  
956 -}