liuqiao 2 năm trước cách đây
mục cha
commit
6087743aa9
3 tập tin đã thay đổi với 117 bổ sung216 xóa
  1. 12 25
      src/views/index/HCFDLab/echartsHFCD.vue
  2. 93 177
      src/views/index/HCFDLab/index.vue
  3. 12 14
      src/views/index/index.vue

+ 12 - 25
src/views/index/HCFDLab/echartsHFCD.vue

@@ -15,7 +15,7 @@ import { request } from "@/utils/request";
 export default {
   data() {
     return {
-       container_show:false,
+       container_show:true,
       chart: null,
       convergeDate: { title: "hcfd", VARIABLES: [], value: [] },
     numlist:[],
@@ -43,7 +43,7 @@ export default {
     });
     let _this = this;
    // this.getwebsocket();
-
+  this.timedata('2022-10-27 15:59:50', '2022-10-27 16:00:15',53)
   },
   methods: {
       hiden(){
@@ -59,7 +59,8 @@ export default {
  var date1 = new Date(d1);   //开始时间  
             var date2 = new Date(d2);    //结束时间  
              var cydata=(date2.getTime() - new Date(date1).getTime())/s1*(Number(this.nmlsteps)-s1);
-           // var Milliseconds = date2.getTime() - new Date(date1).getTime();   //时间差的毫秒数       
+           //var Milliseconds = date2.getTime() - new Date(date1).getTime();   //时间差的毫秒数       
+               console.log(Milliseconds)
             var Milliseconds = cydata;
             //计算出相差天数  
             var days = Math.floor(Milliseconds / (24 * 3600 * 1000))
@@ -84,6 +85,7 @@ export default {
             }; 
           //console.log(ResultJson)
             let year=ResultJson.days.days+'天'+ this.p(ResultJson.days.hours)+':'+ this.p(ResultJson.days.minutes)+':'+ this.p(ResultJson.days.seconds)
+            console.log(year);
            this.$emit('restimeyear',year);
             return year;
 
@@ -92,7 +94,7 @@ export default {
 		return s < 10 ? '0' + s: s;
 	},
     // 获取求解日志
-  newlog(){
+  getlog(){
          let params = {
             transCode: "C00006",
             pid: this.projectId,
@@ -134,7 +136,7 @@ export default {
           
       //连接建立之后执行send方法发送数据this.newlog();
       // if(this.lsolverState=='1'||this.numzhexian=='1'){
-           this.newlog();
+           this.getlog();
            //this.historydata()
             // }
     },
@@ -146,7 +148,6 @@ export default {
       //数据接收
    try{
             const redata = JSON.parse(e.data);
-            console.log(redata);
             if(typeof redata==='object'&& redata){
               if(redata.type == "log"){
                  this.$emit('getthislog',redata.stats+redata.value);
@@ -161,9 +162,11 @@ export default {
               const onelines = kgReplace(lines.trim()).split(" ")
                 .map((str) => str.trim());
               this.s1= onelines.slice(1,2).map((str) => Number(str));
+               console.log(this.s1);
           
             }
                this.timedata(redata.startTime,redata.time,this.s1[0]);
+               console.log(this.s1[0])
             
             }
               }
@@ -236,9 +239,9 @@ export default {
           enabled:false,
         },
         chart: {
-          plotBackgroundColor: "rgba(0,0,0,0)",
+          plotBackgroundColor: "rgba(255,255,255,0)",
           // borderWidth: 1,
-          backgroundColor: "rgba(0,0,0,0)",
+          backgroundColor: "rgba(255,255,255,0)",
         },
         yAxis: {},
         xAxis: {},
@@ -261,24 +264,9 @@ export default {
                   layout: "horizontal",
                   align: "center",
                   verticalAlign: "bottom",
+                  itemStyle:{'color':"#fff" }
                 },
         series: [
-        //   {
-           // name: "随机数据",
-            // data: (function () {
-            //   // 生成随机值
-            //   var data = [],
-            //     time = new Date().getTime(),
-            //     i;
-            //   for (i = -19; i <= 0; i += 1) {
-            //     data.push({
-            //       x: time + i * 1000,
-            //       y: Math.random(),
-            //     });
-            //   }
-            //   return data;
-            // })(),
-        //   },
         ],
       }
        for (var i in _this.convergeDate.VARIABLES) {
@@ -294,7 +282,6 @@ export default {
         }
       option.title.text=this.name;
       _this.chart = Highcharts.chart("container", option);
-      // console.log(_this.chart.series)
     },
   },
 };

+ 93 - 177
src/views/index/HCFDLab/index.vue

@@ -129,7 +129,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="info"  @click="dialog.scale_visiable = false">{{ $t("HCFD.file.cancel")}}</el-button>
-        <el-button type="primary" @click="dialog.scale_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.scale_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -184,7 +184,7 @@
         <el-button type="info"  @click="dialog.translation_visiable = false"
           > {{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.translation_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.translation_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -238,7 +238,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="info"  @click="dialog.rotation_visiable = false">{{ $t("HCFD.file.cancel")}}</el-button>
-        <el-button type="primary" @click="dialog.rotation_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.rotation_visiable = false"
           >{{ $t("HCFD.file.ok")}} </el-button
         >
       </div>
@@ -287,7 +287,7 @@
           @click="referencevisiable((dialog.type_visiable  = false))"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.type_visiable  = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.type_visiable  = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -341,7 +341,7 @@
           @click="referencevisiable((dialog.parallel_visiable  = false))"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.parallel_visiable  = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.parallel_visiable  = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -385,7 +385,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="info"  @click="dialog. equation_visiable = false"> {{ $t("HCFD.file.cancel")}}  </el-button>
-        <el-button type="primary" @click="dialog.equation_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.equation_visiable = false"
           >{{ $t("HCFD.file.ok")}} </el-button
         >
       </div>
@@ -455,7 +455,7 @@
           @click="dialog.inviscid_visiable= false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.inviscid_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.inviscid_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -647,7 +647,7 @@
           @click="dialog.dynamic_visiable  = false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.dynamic_visiable   = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.dynamic_visiable   = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -717,7 +717,7 @@
           @click="dialog.nonitertial_visiable  = false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.nonitertial_visiable   = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.nonitertial_visiable   = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -788,7 +788,7 @@
         <el-button type="info"  @click="referencevisiable((dialog.fluxrc_visiable = false))"
           > {{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.fluxrc_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.fluxrc_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -870,7 +870,7 @@
         <el-button type="info"  @click="referencevisiable((dialog.time_visiable = false))"
           >{{ $t("HCFD.file.cancel")}}  </el-button
         >
-        <el-button type="primary" @click="dialog.time_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.time_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -963,7 +963,7 @@
          @click="dialog.border_visiable = false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.border_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.border_visiable = false"
           >{{ $t("HCFD.file.ok")}} </el-button
         >
       </div>
@@ -1059,7 +1059,7 @@
          @click="dialog.reference_visiable = false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.reference_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.reference_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -1112,7 +1112,7 @@
         <el-button type="info"  @click="referencevisiable((dialog.xian_visiable = false))"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.xian_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.xian_visiable = false"
           >{{ $t("HCFD.file.ok")}} </el-button
         >
       </div>
@@ -1232,7 +1232,7 @@
           @click="dialog.initialization_visiable = false"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.initialization_visiable  = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.initialization_visiable  = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -1409,7 +1409,7 @@
           @click="referencevisiable(dialog.boundaryo_visiable = false)"
           >{{ $t("HCFD.file.cancel")}} </el-button
         >
-        <el-button type="primary" @click="dialog.boundaryo_visiable = false"
+        <el-button type="primary" @click="hcfdparam(); dialog.boundaryo_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -1872,7 +1872,17 @@ export default {
     echartsHFCD,
     TFileStream,},
     // websocket,},
-    props:["objopp","pid", "exLoading"],
+    props:{
+      objopp:String,
+      pid:String,
+      elodingfalse:{
+          type:Boolean,
+          default(){
+            return false
+          }
+        }
+    },
+
   data() {
     return {
       checked:false,
@@ -2124,7 +2134,6 @@ export default {
       newload: true,
       runMonitor: true,
       contourLevel: 3,
-      //exLoading:"hidden",
 
       form: {
         u_freestream: "",
@@ -2486,6 +2495,7 @@ export default {
 
      this.init();
   },    
+
   //  destroyed() {
   //     this.websock.close() //离开路由之后断开websocket连接
   //   },
@@ -2507,10 +2517,10 @@ hcfdparam(){
         }
         request(params)
           .then((res) => { 
-          Message({
-                  type: "success",
-                  message: "参数上传,成功",
-                });
+          // Message({
+          //         type: "success",
+          //         message: "参数上传,成功",
+          //       });
          })
           .catch((err) => {
           })
@@ -2580,8 +2590,6 @@ hcfdparam(){
      * 更新配置 并求解
      */
     async hcfdrun() {
-      console.log(1111)
-
       if (this.solverState == "2") {
         //上次求解完成
         MessageBox.confirm(
@@ -2595,32 +2603,31 @@ hcfdparam(){
         )
           .then(() => {
             MessageBox.close();
-            this.exLoading='visible';
-             
+             this.$emit("exlodingfalse",true)
             this.isSolverEnd = false;
             this.hcfdExe();
             let _this = this;
             let isStop = false;
-              if (!isStop && !_this.isSolverEnd) {
+              // if (!isStop && !_this.isSolverEnd) {
               this.$parent.fun();
-              }
+              // }
        
           })
           .catch(() => {
             Message.info("已取消!");
             MessageBox.close();
-            this.exLoading='hidden';
+        this.$emit("exlodingfalse",false)
           });
       } else {
-        this.exLoading='visible';
+          this.$emit("exlodingfalse",true)
         this.isSolverEnd = false;
         this.hcfdExe();
         let _this = this;
         let isStop = false;
-          if (!isStop && !_this.isSolverEnd) {
+          // if (!isStop && !_this.isSolverEnd) {
             isStop = true;
              this.$parent.fun();
-          }
+          // }
       }
     },
     // 求解的日志
@@ -2641,27 +2648,27 @@ hcfdparam(){
             });
   },
    handleClick(tab, event) {
-    if(this.activeName=='five'){
-      let params = {
-        transCode: "A00107",
-        projectId: this.project.projectId,
-      };
-       request(params)
-        .then((res) => {
-            this.lsolverState=res.solverState;
-        } )
-          if(this.lsolverState=='2'){
-              this.resultdata();
-          }else{
-        Message({
-                    type: "warning",
-                    message: "求解未完成,请完成求解",
-                  });
-          }
-    }else{
+  //   if(this.activeName=='five'){
+  //     let params = {
+  //       transCode: "A00107",
+  //       projectId: this.project.projectId,
+  //     };
+  //      request(params)
+  //       .then((res) => {
+  //           this.lsolverState=res.solverState;
+  //       } )
+  //         if(this.lsolverState=='2'){
+  //            // this.resultdata();
+  //         }else{
+  //       Message({
+  //                   type: "warning",
+  //                   message: "求解未完成,请完成求解",
+  //                 });
+  //         }
+  //   }else{
 
-    }
-   this.activecleer();
+  //   }
+  //  this.activecleer();
         },
         activecleer(){
           this.active=11;
@@ -2744,10 +2751,8 @@ this.styX.left=e.clientX+'px';
        this.hcfdrun(true);
        break;
         case 'four4-3':
-        this.getbtnmonitor();
        break;
         case 'four4-4':
-      this.showresource();
        break;
        case 'five-0':
          this.dialog.SurfaceGrid_visiable = true;
@@ -3000,132 +3005,44 @@ this.styX.left=e.clientX+'px';
         })
         .catch((err) => {});
     },
-    //获取计算结果文件 并缓存
-    async gethcfdsolverfiles() {
-      let params = {
-        transCode: "A00109",
-        projectId: this.project.projectId,
-      };
-      await request(params)
-        .then((res) => {
-          this.project.solverfiles = res.files;
-        })
-        .catch((err) => {});
-      this.project.solverfiles.forEach((solverfile) => {
-        let url = solverfile.filepath;
-        if (
-          url.indexOf("volume_timestep") > 1 ||
-          url.indexOf("boundary_timestep") > 1 ||
-          url.indexOf("converge.dat") > 1
-        ) {
-          let names = url.split("/");
-          let name = names[names.length - 1];
-          let loadOj3 = {
-            type: 2,
-            filename: name,
-            percentage: 0,
-          };
-          this.loadObjs.push(loadOj3);
-          this.$refs.filesload.load(url);
-        }
-        if (url.indexOf("volume_timestep") > 1) {
-          this.project.solverVolumUrls.push(url);
-        }
-        if (url.indexOf("boundary_timestep") > 1) {
-          this.project.solverBoundaryUrls.push(url);
-        }
-        if (url.indexOf("converge.dat") > 1) {
-          this.project.converge = url;
-        }
-      });
-      this.project.solverVolumUrls.forEach((url) => {
-        let step = url.split("volume_timestep")[1].split(".da")[0];
-        this.bStep=step;
-        this.volumStep.push(step);
-        let newArr = [...new Set(this.volumStep)]; //去重
-        this.volumStep = newArr;
-      });
-      this.project.solverBoundaryUrls.forEach((url) => {
-        let step = url.split("boundary_timestep")[1].split(".da")[0];
-        this.vStep=step;
-        this.boundaryStep.push(step);
-        let newArr = [...new Set(this.boundaryStep)]; //去重
-        this.boundaryStep = newArr;
-      });
-    },
     /**
      * 更新配置 并求解
      */
-    //日志
-    getthislog(log){
-   this.newlog = log+"\n"+this.newlog;
-    this.logs=this.newlog;
-     if ( this.logs.indexOf("Solver end") >= 0) {
-               this.exLoading='hidden';
-                  this.isSolverEnd = true;
-      }
-    },
-    // 剩余时间
-    restimeyear(time){
-      this.restime=time;
-    },
-    //求解
-    // hcfdExe() {
-    //   var _this = this;
-    //   let params = {
-    //     transCode: "A00105",
-    //     projectId: this.project.projectId,
-    //     lesseeId:this.$store.getters.lesseeId,
-    //     userName:this.$store.getters.name
-    //   };
-    //   request(params)
-    //     .then((res) => {
-    //     })
-    //     .catch((err) => {
-    //       //  console.log("hcfdExe" + err);
-    //       setTimeout(function () {
-    //         _this.$refs.loading.visiable = false;
-    //       }, 4000);
+//选择step
+bStepChange(val){
+  this.bStep=val;
+   if(this.bStep==0){
+    Message({
+            type: "warning",
+            message: "请选择setp有效值",
+          });
+  }else{
+      this.showboundary();
+  }
 
-    //       if (err.returnCode == "EB8100017") {
-    //         //资源未分配
-        
-    //         MessageBox.confirm("你还未分配资源?", "提示", {
-    //           confirmButtonText: "分配资源",
-    //           cancelButtonText: "取消",
-    //           type: "warning",
-    //         })
-    //           .then(() => {
-    //             // const errUril = Caegw_ProUrl +"?projectId="+_this.project.projectId;
-    //             let errUril =
-    //               // window.location.protocol +
-    //               // "//" +
-    //               // window.location.host +
-    //               // "/" +
-    //               _this.$store.getters.proUrl +
-    //               "?projectId=" +
-    //               _this.project.projectId;
-    //             let params2 = {
-    //               transCode: "A00118",
-    //               lesseeId: _this.$store.getters.lesseeId
-    //             };
-    //             request(params2)
-    //               .then((res) => {
-    //                 window.location.href =
-    //                   errUril + "&authCode=" + res.authCode;
-    //               })
-    //               .catch((err) => {});
-    //           })
-    //           .catch(() => {
-    //             _this.$refs.loading.visiable = false;
-    //             Message({
-    //               type: "info",
-    //               message: "已取消",
-    //             });
-    //           });
-    //       }
-    //     });
-    // },
+},
+//选择step
+vStepChange(val){
+  this.vStep=val;
+    if(val==0){
+    Message({
+            type: "warning",
+            message: "请选择setp有效值",
+          });
+  }else{
+this.Volumeshow();
+}
+},
+// 表面加载
+SurfaceChange(value){// 选择色条个数
+  this.Surfacenum=value;
+
+},
+// 体积
+VolumenumChange(value){// 选择色条个数
+  this.Volumenum=value;
+
+},
     async reUpload() {
       this.$refs.mapbc.uploader.upload();
       this.$refs.ugrid.uploader.upload();
@@ -3466,7 +3383,6 @@ if(val==true){
       this.$refs.monitor.hiden();
       if (!this.showSurfaceflag) {
         if (this.project.solverfiles.length == 0) {
-          await this.gethcfdsolverfiles();
         }
         let burl;
        

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

@@ -7,7 +7,7 @@
                     
              </div> -->
         <div v-if="value2=='HCFDLab'">
-        <hcfd ref="hcfd" :objopp="objopp" :pid="pid" @fun="fun()" :exLoading="exLoading"></hcfd>
+        <hcfd ref="hcfd" :objopp="objopp" :pid="pid" @fun="fun()" :elodingfalse="elodingfalse" @exlodingfalse="exlodingfalse"></hcfd>
         </div>
           <div v-else-if="value2=='FEMLab(结构力学)'||value2=='FEMLab(结构力学)版本2'">
         <fem ref="fem" :femnum="femnum" ></fem>
@@ -97,27 +97,21 @@
   </el-tabs>
        </div>
    </transition>
-
     <div class="right lbg_color2 ">
-
         <div class="part-panel-collapse-handle lbg_color3" @click="showtrue=!showtrue">
             <i class="el-icon-arrow-left"></i>
   </div>
   <el-container class="beij-container">
 <el-container>
    <el-main ref="main3d" :class="headMenu_2Show?'maxh400':'maxh221'" style="padding:0">
-    <echartsHFCD ref="monitor"   @getthislog='getthislog' @restimeyear='restimeyear'  :projectId='pid'></echartsHFCD>
-             <h1>我是主题
-
-      </h1>
+    <echartsHFCD ref="monitor"  @getthislog='getthislog' @restimeyear='restimeyear'  :projectId='pid'></echartsHFCD>
    </el-main>
     <div class="footerTitle">
             <div>{{ $t("FEM.other.console") }}
-                    <p class="restime" :style="{ visibility: exLoading}" style="  margin-left: 50px; font-size:14px">剩余时长:{{restime}}</p>
+                    <p class="restime" v-show="elodingfalse"  style="  margin-left: 50px; font-size:14px">剩余时长:{{restime}}</p>
             </div>
-    
             <div>
-              <li  class="exloadbox" :style="{ visibility: exLoading}" >
+              <li  class="exloadbox" v-show="elodingfalse"  >
                 <span>正在求解中</span>
                 <i class="el-icon-loading"></i>
               </li>
@@ -176,7 +170,7 @@ export default {
          restime:'',
         footerShow:true,
         headMenu_2Show:false,
-         exLoading:"hidden",
+         elodingfalse:false,
         logs: "欢迎来到HCFD",
          newlog:'',
       data: [{
@@ -225,7 +219,6 @@ export default {
       activeName1:'first',
       objopp:'',
       femnum:'',
-        exLoading:"hidden",
         tab:[
             {index:0,name:"几何建模"},
             {index:1,name:"网格划分"},
@@ -335,6 +328,10 @@ mounted(){
 
 },
 methods:{
+  exlodingfalse(res){
+    console.log(res);
+    this.elodingfalse=res;
+  },
     handleNodeClick(data) {
         console.log(data);
       },
@@ -388,6 +385,7 @@ methods:{
       // 调用求解过程日志
       fun(){
             this.$refs.monitor.getwebsocket(); 
+           this.$refs.monitor.container_show=true;
       },
 
  // 日志的文本框
@@ -404,8 +402,8 @@ methods:{
     getthislog(log){
    this.newlog = log+"\n"+this.newlog;
     this.logs=this.newlog;
-     if ( this.logs.indexOf("Solver end") >= 0) {
-               this.exLoading='hidden';
+     if ( this.logs.indexOf("newSolver end") >= 0) {
+               this.elodingfalse=false;
                   this.isSolverEnd = true;
       }
     },