Browse Source

4.22修改加载图片成功

liuqiao 2 years ago
parent
commit
321e053ee0

+ 1 - 1
src/views/index/HCFDLab/echartsHFCD.vue

@@ -285,6 +285,6 @@ export default {
 </script>
 <style>
 .x-bar{
-  margin-top: 120px;
+  /* margin-top: 120px; */
 }
 </style>

+ 4 - 2
src/views/index/compoents/TFileStreamhcfd.vue

@@ -33,9 +33,11 @@ export default {
     },
     methods:{
       fetchData(imgs) {
-            console.log(33333);
-              console.log(imgs.img);
+            // console.log(33333);
+            //   console.log(imgs.img);
       this.loadingend(this.loadingopen());
+    // console.log(333333)
+    //    console.log(imgs.img);
           this.imgsrc = imgs.img;
       
      

+ 12 - 10
src/views/index/index.vue

@@ -472,7 +472,10 @@ methods:{
           this.solverConfigid=res.solverConfigid;
          let data= JSON.parse(this.objopp);
           this.numsteps=data.nmlParam.steps;
-             that.startimg("init",'loaddata');
+            setTimeout(function(){
+            that.initWebSocket();
+        },1000)
+           
            })   
         }else if(val=='FEMLab(结构力学)'){
              this.$nextTick(()=>{
@@ -607,7 +610,7 @@ let params = {
       request(params)
         .then((res) => {
             console.log(res);
-            that.initWebSocket();
+            // that.initWebSocket();
         })
         .catch((err) => {
               
@@ -626,23 +629,22 @@ let params = {
         this.websock.onclose = this.websocketclose;
       },
       websocketonopen(e){ //连接建立之后执行send方法发送数据
-
+        this.startimg("init",'loaddata');
         
       },
       websocketonerror(){//连接建立失败重连
               this.websock.close() 
       },
       websocketonmessage(e){ //数据接收
-        //   this.loadingopen();
-             this.$refs.monitor.hiden();
-         console.log(e);
+          this.loadingopen();
+          //  this.$refs.monitor.container_show=true;
+
         try{
             const redata = JSON.parse(e.data);   
-            console.log(redata);
-            console.log(redata.img)
-
-              this.$refs.TFileStream.imgtupian=true;
+            console.log(redata); 
+          this.$refs.TFileStream.imgtupian=true;
               this.$refs.TFileStream.fetchData(redata);
+               that.$refs.monitor.container_show=false;
          
         return true;       
         }catch(error){