Commit b63786bb84889680b5c7175867b6ba09f37f97b5

Authored by xp.Huang
2 parents 417e64f3 e8209777

Merge branch 'fix/DEFECT-1367' into 'main_dev'

fix: 修复组态导入时页面title变更为文件名

See merge request yunteng/thingskit-scada!80
@@ -3092,10 +3092,12 @@ App.prototype.loadFileSystemEntry = function (fileHandle, success, error) { @@ -3092,10 +3092,12 @@ App.prototype.loadFileSystemEntry = function (fileHandle, success, error) {
3092 if (file.type == 'image/png') { 3092 if (file.type == 'image/png') {
3093 data = this.extractGraphModelFromPng(data); 3093 data = this.extractGraphModelFromPng(data);
3094 } 3094 }
3095 -  
3096 - success(new LocalFile(this, data, file.name, null, fileHandle, file)); 3095 + // TODO thingskit 修复导入组态时页面title变更为文件名
  3096 + // success(new LocalFile(this, data, file.name, null, fileHandle, file));
  3097 + success(new LocalFile(this, data, Editor.configurationName, null, fileHandle, file));
3097 } else { 3098 } else {
3098 - this.openFileHandle(e.target.result, file.name, file, false, fileHandle); 3099 + // this.openFileHandle(e.target.result, file.name, file, false, fileHandle);
  3100 + this.openFileHandle(e.target.result, Editor.configurationName, file, false, fileHandle);
3099 } 3101 }
3100 } catch (e) { 3102 } catch (e) {
3101 error(e); 3103 error(e);
@@ -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 -}