liuqiao před 2 roky
rodič
revize
28e3a1f723

+ 39 - 21
src/views/index/HCFDLab/addtabs.vue

@@ -13,7 +13,7 @@
                         ></el-checkbox>
                         <el-checkbox
                           label="Sectional plane"
-                           v-model="ruleForm.sectional_pLane_state"
+                           v-model="ruleForm.sectional_plane_state"
                         ></el-checkbox>
                </div>
                     </div>  
@@ -35,19 +35,19 @@
       <div class="yiinpu heigeinput">
     <el-form-item label="X" :label-width="formLabelWidth4">
       <el-input v-model="ruleForm.position_x" autocomplete="off"></el-input>
-         <span style="width:120px">Xrange:{{ruleForm.xrange}}</span>
+         <span style="width:120px">Xrange:{{range.xrange}}</span>
     </el-form-item>
  </div>
   <div class="yiinpu heigeinput">
     <el-form-item label="Y" :label-width="formLabelWidth4">
       <el-input v-model="ruleForm.position_y" autocomplete="off"></el-input>
-         <span style="width:120px">Yrange:{{ruleForm.yrange}}</span>
+         <span style="width:120px">Yrange:{{range.yrange}}</span>
     </el-form-item>
  </div>
   <div class="yiinpu heigeinput">
     <el-form-item label="Z" :label-width="formLabelWidth4">
       <el-input v-model="ruleForm.position_z" autocomplete="off"></el-input>
-         <span style="width:120px">Zrange:{{ruleForm.zrange}}</span>
+         <span style="width:120px">Zrange:{{range.zrange}}</span>
     </el-form-item>
  </div>
       <div class="line">
@@ -68,9 +68,9 @@
               <el-select  v-model="ruleForm.variableName"  placeholder="请选择">
           <el-option
             v-for="item in variableNamearr1"
-            :key="item.value"
-            :label="item.name"
-            :value="item.value"
+            :key="item"
+            :label="item"
+            :value="item"
             >
           </el-option>
         </el-select>
@@ -104,16 +104,28 @@ export default {
           }
           
         },
-  variableNamearr:{
-          type: Array,
-          default () {
-            return {}
-          }
+        //  variableNamearr1:{
+        //   type: String,
+        //   default () {
+        //     return {}
+        //   }
           
-        },
+        // },
+  // variableNamearr1:{
+  //         type: Array,
+  //         default () {
+  //           return {}
+  //         }
+          
+  //       },
   },
         data(){
             return{
+              range:{
+                xrange:'0.0',
+                yrange:'0.0',
+                zrange:'0.0',
+                },
                 // ruleForm:{
                 // fw:'1',
                 // slicecheck:'Solid',
@@ -128,7 +140,7 @@ export default {
                 // secheck:'',
                 
                 // },
-                variableNamearr1:[],
+                variableNamearr1:['r','u','ma'],
                   formLabelWidth: '60px',
                     formLabelWidth2:'73px',
                     formLabelWidth4:'37px',
@@ -136,18 +148,24 @@ export default {
                     formLabelWidth6:'120px',
                     formLabelWidth7:'170px',
                      conlist:[
-            {value:'0', name: "line" },
-            {value:'1', name: "Contour"},
+            {value:'line', name: "line" },
+            {value:'contour', name: "contour"},
           ],
           con:'0',
             }
         },
+        created() {
+      
+         },
         methods:{
-          getarrs(arr){
-              this.variableNamearr1=arr;
-       
-            //
-          }
+      
+        
+              getarrs(arr){
+                  this.variableNamearr1=arr;
+          
+                
+              }
+              
         }
        
 }

+ 82 - 67
src/views/index/HCFDLab/index.vue

@@ -1766,7 +1766,7 @@
         <el-button   @click="dialog.SurfaceGrid_visiable = false"
           >{{ $t("HCFD.file.cancel")}}  </el-button
         >
-        <el-button type="primary" @click="bStepok('','ResultImport','');dialog.SurfaceGrid_visiable = false"
+        <el-button type="primary" @click="bStepok('','ResultImport','','');dialog.SurfaceGrid_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -1848,7 +1848,7 @@
         <el-button   @click="dialog.VolumeGrid_visiable = false"
           >{{ $t("HCFD.file.cancel")}}</el-button
         >
-        <el-button type="primary" @click="bStepok('','ResultImport',''); dialog.VolumeGrid_visiable = false"
+        <el-button type="primary" @click="bStepok('','ResultImport','',''); dialog.VolumeGrid_visiable = false"
           >{{ $t("HCFD.file.ok")}}</el-button
         >
       </div>
@@ -2166,18 +2166,18 @@
    <div class="heigeinput">
       <div class="listbtn"> 
        <el-button plain class="anniu"  @click="addTab(editableTabsValue) ">添加</el-button>
-         <el-button plain class="anniu"  @tab-remove="removeTab">updata</el-button>
+         <el-button plain class="anniu"  @click="updata()">updata</el-button>
         <el-button plain class="anniu"  @click="removeclear(editableTabsValue)">清除</el-button>
       </div>
      <el-tabs v-model="editableTabsValue" type="card" closable @tab-remove="removeTab" @tab-click="handletabclick" >
   <el-tab-pane
-    v-for="item in editableTabs"
-    :key="item.name"
-    :label="item.title"
-    :name="item.name"
+    v-for="ruleForm in editableTabs"
+    :key="ruleForm.index"
+    :label="ruleForm.index"
+    :name="ruleForm.index"
   >
     <!-- {{item.content}}:is=item.content   -->
-     <Addtabs ref="addtabs" :variableNamearr="variableNamearr"  :ruleForm="item.ruleForm"></Addtabs>
+     <Addtabs ref="addtabs"  :variableNamearr1="variableNamearr"  :ruleForm="ruleForm"></Addtabs>
   </el-tab-pane>
 </el-tabs>
 
@@ -2819,6 +2819,7 @@ export default {
   data() {
     return {
       // 云图参数
+     
          isVolume:"",
         outlineobj:{
        scalarName:'',
@@ -3612,16 +3613,13 @@ pointclick(){
  addTab(targetName) {
    this.target= targetName;
         let newTabName = ++this.tabIndex + '';
-      //   console.log(newTabName);
-       this.bStepok('',"SliceDisplayAdd",newTabName)
-  let dataslicedisplay=JSON.parse(sessionStorage.getItem("dataslicedisplay"));
-   let data=JSON.parse(dataslicedisplay);
+       this.bStepok('',"SliceDisplayAdd",newTabName,'')
         this.editableTabs.push({
-          title:newTabName,
-          name: newTabName,
+          // title:newTabName,
+          // name: newTabName,
           // content:Addtabs,
-            ruleForm:{
-                index:1,
+            // ruleForm:{
+                index:newTabName,
                 type:"line", 
                 variableName:'r',
                 level:'',
@@ -3633,83 +3631,103 @@ pointclick(){
                 position_z:'',
                 scalar_value_state:false,
                 solid_state:true,
-                sectional_pLane_state:true,
+                sectional_plane_state:true,
                 sectional_contour_state:true,
-                xrange:'0.0',
-                yrange:'0.0',
-                zrange:'0.0',
                 areaRange:"",
-                },
-
-        });
-         
-   this.variableNamearr=data.variableName.split(",");
-   let that=this;
-   that.$nextTick(()=>{
-      //  setTimeout(function(){  
-     that.$refs.addtabs.variableNamearr1=this.variableNamearr;
-      //  },1000)
-      // 
-      //  console.log(this.$refs.addtabs.variableNamearr1);
-   })
-  
-     let arr=this.editableTabs;
-    for(var i = 0; i < arr.length; i++){
-      arr[i].ruleForm.xrange=data.xrange;
-      arr[i].ruleForm.yrange=data.yrange;
-      arr[i].ruleForm.zrange=data.zrange;
-      arr[i].ruleForm.position_x=data.position_x;
-      arr[i].ruleForm.position_y=data.position_y;
-      arr[i].ruleForm.position_z=data.position_z;
-      arr[i].ruleForm.areaRange=data.areaRange;
-   
-
-    }
+                // },
+        });         
+ 
         this.editableTabsValue = newTabName;
+        console.log( this.editableTabs);
       
       },
+//add的参数
+addparam(){
+    let dataslicedisplay=JSON.parse(sessionStorage.getItem("dataslicedisplay"));
+   let data=JSON.parse(dataslicedisplay);
+    let that=this;
+    that.variableNamearr=data.variableName.split(",");
+     let arr=this.editableTabs; 
+       that.$nextTick(()=>{
+    for(var i = 0; i < arr.length; i++){
+      arr[i].position_x=data.position_x;
+      arr[i].position_y=data.position_y;
+      arr[i].position_z=data.position_z;
+      arr[i].areaRange=data.areaRange;
+      that.$refs.addtabs[i].getarrs(this.variableNamearr);
+      that.$refs.addtabs[i].range.xrange=data.xrange;
+      that.$refs.addtabs[i].range.yrange=data.yrange;
+      that.$refs.addtabs[i].range.zrange=data.zrange;
+    }
+       })
+},
+      updata(){
+            this.bStepok('',"SliceDisplayUpdate",'','');
+            
+      },
+      //updata的参数
+updataparam(){
+  let updateparam=JSON.parse(sessionStorage.getItem("updateparam"));
+              let edarr=this.editableTabs;
+              let  updatadata=JSON.parse(updateparam);
+              let updatarr=updatadata.update_param;
+              
+              console.log(updatarr);
+              for(var i = 0; i < edarr.length; i++){
+                  for(var j = 0; j < updatarr.length; j++){
+                        edarr[i].normal_x=updatarr[j].normal_x;
+                        edarr[i].normal_y=updatarr[j].normal_y;
+                        edarr[i].normal_z=updatarr[j].normal_z;
+                        edarr[i].position_x=updatarr[j].position_x;
+                        edarr[i].position_y=updatarr[j].position_y;
+                        edarr[i].position_z=updatarr[j].position_z;
+                
+              }
+              }
+
+},
       // 参数的编辑
    
        //删除新增的tab
       removeclear(val){
-       
-        this.tabIndex=--this.tabIndex 
-         console.log(this.tabIndex);
+
          let tabs = this.editableTabs;
         let activeName = this.editableTabsValue;
         if (activeName === val) {
           tabs.forEach((tab, index) => {
-            if (tab.name === val) {
+            if (tab.index === val) {
               let nextTab = tabs[index + 1] || tabs[index - 1];
               if (nextTab) {
-                activeName = nextTab.name;
+                activeName =nextTab.index;
               }
             }
+
           });
         }
         this.editableTabsValue = activeName;
-        this.editableTabs = tabs.filter(tab => tab.name !== val);
+        this.editableTabs = tabs.filter(tab => tab.index !== val);
+        this.bStepok('',"SliceDisplayDel",val,'');
 
       },
       removeTab(targetName) {
          
-        this.tabIndex=--this.tabIndex 
          console.log(targetName);
         let tabs = this.editableTabs;
         let activeName = this.editableTabsValue;
         if (activeName === targetName) {
           tabs.forEach((tab, index) => {
-            if (tab.name === targetName) {
+            if (tab.index === targetName) {
               let nextTab = tabs[index + 1] || tabs[index - 1];
               if (nextTab) {
-                activeName = nextTab.name;
+                activeName = nextTab.index;
               }
             }
           });
         }
         
         this.editableTabsValue = activeName;
-        this.editableTabs = tabs.filter(tab => tab.name !== targetName);
+        this.editableTabs = tabs.filter(tab => tab.index !== targetName);
+         this.bStepok('',"SliceDisplayDel",targetName,'');
         
       },
    handletabclick(el){
@@ -3717,8 +3735,9 @@ pointclick(){
 
    },  
 liceOK(){
- 
-  console.log(this.editableTabs);
+  let paramJson=JSON.stringify(this.editableTabs)
+  this.bStepok('',"SliceDisplayApply",'',paramJson);
+  this.dialog.Slice_Surface= false;
 
 },
   changedesc1(val){
@@ -3936,13 +3955,13 @@ setpnum(){
 
 },
 // 获取轮廓数据
-bStepok(num,action,index){
+bStepok(num,action,index,paramJson){
   const params = {
         transCode: 'AFT001',
         pid:this.project.projectId,
         solverConfigId:this.solverConfigid,
         action:action,
-        paramJson:'',
+        paramJson:paramJson,
         step:this.bStep,
         scalarName:this.outlineobj.scalarName,
         level:num,
@@ -3965,14 +3984,14 @@ bStepok(num,action,index){
 },
 //level颜色的数据
 changeblur(){
- this.bStepok(this.outlineobj.level,'ContourDisplay','')
+ this.bStepok(this.outlineobj.level,'ContourDisplay','','')
 },
 vchangeblur(){
- this.bStepok(this.outlineobj.level,"LineDisplay",'')
+ this.bStepok(this.outlineobj.level,"LineDisplay",'','')
 },
 // 矢量的OK按钮
 vectorOK(){
- this.bStepok('',"VectorDisplay",'')
+ this.bStepok('',"VectorDisplay",'','')
 },
 // 获取轮廓数据
 outlinedata(){
@@ -5152,10 +5171,6 @@ html,body{
 }
 </style>
 <style lang="scss" scoped>
-.bkcolor3{
-  // background-color: rgba(255, 255, 255, 0.3);
-  // color:#333;
-}
  .activeOrange{
       background-color:rgba(255, 255, 255, 0.3);
       border:2px solid #fff;

+ 15 - 1
src/views/index/index.vue

@@ -685,7 +685,11 @@ let params = {
               this.websock.close() 
       },
       websocketonmessage(e){ //数据接收
-           this.loadingopen();
+      // setInterval(function(){
+        this.loadingopen();
+      // },3000)
+      //  clearInterval(test2);
+
           //  this.$refs.monitor.container_show=true;
 
         try{
@@ -726,11 +730,21 @@ let params = {
             }else{
               if(dataslicedisplay.msgType=='addPage_slice_param'){
                   sessionStorage.setItem("dataslicedisplay",JSON.stringify(redata.paramJson));
+                   this.$refs.hcfd.addparam();
               }
             
               
             }
             
+          }else if(redata.action=='SliceDisplayUpdate'){
+            let datadisplayupdate=JSON.parse(redata.paramJson);
+            console.log(datadisplayupdate)
+            if(datadisplayupdate==null||JSON.stringify(datadisplayupdate)=='{}'){
+            }else{
+                  sessionStorage.setItem("updateparam",JSON.stringify(redata.paramJson));
+                  this.$refs.hcfd.updataparam(); 
+            }
+            
           }
          
         return true;       

+ 1 - 1
vue.config.js

@@ -26,7 +26,7 @@ module.exports = {
     proxy: {
       '/api': {
         target:'http://192.168.0.43:8087/TransServlet',
-        //target:'http://192.168.0.43:8087/TransServlet',
+        //target:'http://192.168.0.103:8087/TransServlet',
       //  target: 'http://localhost:8081/', // 后端接口地址
         //  target: 'http://192.168.0.43:8081/',
         // target: 'http://192.168.0.43:8181/',