Browse Source

优化下写法

cxmo 1 year ago
parent
commit
4a2867309e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/views/chartFrame_manage/frameEditor.vue

+ 3 - 2
src/views/chartFrame_manage/frameEditor.vue

@@ -141,13 +141,14 @@ export default {
                 this.frameDetail.FrameworkImg = Data.ResourceUrl||''
             }
             //获取框架节点和内容
+            const Nodes = this.$refs.container.getContentNodes() //与frameDetail.Nodes的结构不同
             this.frameDetail.FrameworkContent = JSON.stringify(this.$refs.container.graph.toJSON())
             if(this.frameId){
                 //edit
                 chartFrameInterface.editFrame({
                     ...this.frameDetail,
                     ChartFrameworkId:Number(this.frameId),
-                    Nodes:this.$refs.container.getContentNodes(),//与frameDetail.Nodes的结构不同
+                    Nodes,
                 }).then(res=>{
                     this.lockLoding.close();
                     if(res.Ret!==200) return 
@@ -157,7 +158,7 @@ export default {
                 //add 
                 chartFrameInterface.addFrame({
                     ...this.frameDetail,
-                    Nodes:this.$refs.container.getContentNodes(),//与frameDetail.Nodes的结构不同
+                    Nodes,
                 }).then(res=>{
                     this.lockLoding.close();
                     if(res.Ret!==200) return