Browse Source

10.25 修改折线静态显示

liuqiao 1 năm trước cách đây
mục cha
commit
7640165e6f

+ 17 - 6
src/views/index/HCFDLab/echartsHFCD.vue

@@ -23,6 +23,7 @@ export default {
       convergeDate: { title: "hcfd", VARIABLES: [], value: [] },
     numlist:[],
     s1:'',
+    keyactive:'',
     option:{
         title: {
           text: "HCFD",
@@ -168,6 +169,7 @@ export default {
   },
     // websocket
     getwebsocket() {
+
      // 初始化weosocket
       this.$emit('statechange','1');
      this.numlist=[];
@@ -182,12 +184,20 @@ export default {
       this.websock.onclose = this.websocketclose;
     },
     websocketonopen(e) {
-          
+         this.keyactive =sessionStorage.getItem("keyactive");
       //连接建立之后执行send方法发送数据this.newlog();
       // if(this.lsolverState=='1'||this.numzhexian=='1'){
-           this.getlog();
-           this.historydata()
+         //  this.getlog();
+         // this.historydata()
             // }
+            if( this.keyactive =='four44-0'){
+              console.log(4444)
+                    this.historydata()
+            }else{
+              console.log(55555)
+               this.getlog();
+                this.historydata()
+            }
       
     },
     websocketonerror() {
@@ -201,13 +211,14 @@ export default {
             const redata = JSON.parse(e.data);
             if(typeof redata==='object'&& redata){
             
+              console.log(redata);
               if(redata.type == "log"){
                     // this.$emit('statechange','1');redata.stats+
-                  let newoldSolver=redata.stats+redata.value;
-                
-                 this.$emit('getthislog',redata.value,newoldSolver);
+                let newoldSolver=redata.stats+redata.value;
+                this.$emit('getthislog',redata.value,newoldSolver);
               }
             if (redata.type == "iter") {
+              
                this.convergeDateLoad(redata.value);
                //获取运行多少步了
                 const lines = redata.value;

+ 9 - 0
src/views/index/HCFDLab/index.vue

@@ -4753,6 +4753,7 @@ export default {
 
   data() {
     return {
+      funbool:true,
    objmesh:{
     strResultFormat:".vtk",
     surfParam:{
@@ -6251,6 +6252,12 @@ export default {
       // document.querySelector('.el-dialog').style.left='265px';
       //  console.log(typeof this.styX.left);
       console.log(key);
+      if(key=='four44-0'){
+           sessionStorage.setItem('keyactive',"four44-0");
+      }else{
+         sessionStorage.setItem('keyactive',"");
+      }
+   
       // console.log(document.querySelector('.el-dialog').style.left)
       switch (key) {
         case "info1-0":
@@ -6331,8 +6338,10 @@ export default {
           break;
         case "four44-0":
           this.$parent.fun();
+           
           break;
         case "four410":
+          this.funbool=true;
           this.hcfdrun();
 
           break;

+ 30 - 20
src/views/index/index.vue

@@ -806,34 +806,44 @@ export default {
     fun() {
       this.logs = "";
       this.newlog = "";
-      if (this.statecustom == "1") {
-        Message({
-          type: "warning",
-          message: "运行中不能点击",
-        });
-      } else {
-        if (this.state == "1") {
-          this.$refs.monitor.getwebsocket();
-        } else {
-          this.$refs.hcfd.hcfdrun();
-        }
-        this.$refs.monitor.container_show = true;
+      let funbool= this.$refs.hcfd.funbool;
+      console.log(funbool);
+      if(funbool==true){
+       this.$refs.hcfd.funbool=false;
+        this.$refs.monitor.getwebsocket();
+      }
+         this.$refs.monitor.container_show = true;
         this.monitorHCFD = this.$refs.monitor.container_show;
         this.$refs.TFileStream.imgtupian = false;
-      }
+      // if (this.statecustom == "1") {
+      //   Message({
+      //     type: "warning",
+      //     message: "运行中不能点击",
+      //   });
+      // } else {
+        // if (this.state == "1") {
+        //   //this.$refs.monitor.getwebsocket();
+        // } else {
+        //  // this.$refs.hcfd.hcfdrun();
+        // }
+        // this.$refs.monitor.container_show = true;
+        // this.monitorHCFD = this.$refs.monitor.container_show;
+        // this.$refs.TFileStream.imgtupian = false;
+      // }
     },
     funagain() {
-      if (this.statecustom == "1") {
-        Message({
-          type: "warning",
-          message: "运行中不能点击",
-        });
-      } else {
+      // if (this.statecustom == "1") {
+      //   Message({
+      //     type: "warning",
+      //     message: "运行中不能点击",
+      //   });
+      // } else {
+
         this.$refs.monitor.getwebsocket();
         this.$refs.monitor.container_show = true;
         this.monitorHCFD = this.$refs.monitor.container_show;
         this.$refs.TFileStream.imgtupian = false;
-      }
+      // }
     },
     // 工具栏的显示隐藏
     changehcfd(pare) {