Bläddra i källkod

接口修改,界面修改

tangjunhao 7 månader sedan
förälder
incheckning
184886710e

+ 1 - 1
src/views/components/fileuploads.vue

@@ -165,7 +165,7 @@ const  initWebUploader=()=>{
                data.chunks=file.chunks;
                data.bfid=uuid.value;
                data.fileName=fileName.value;
-            //    data.pid=v_this.projectId;
+              //  data.fid=v_this.projectId;
             //    data.solverType=v_this.solverType;
             //    data.md5=v_this.md5;
             //    data.uploadFlag=2;//1 普通 2覆盖 3续传

+ 102 - 10
src/views/home.vue

@@ -1022,6 +1022,42 @@
               </div>
             </template>
           </el-dialog> -->
+          <!-- 列表 -->
+          <el-dialog v-model="dialog.listdialog" align-center :modal="false" :close-on-click-modal="false"
+            :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
+            :before-close="handleClose" width="500" class="dialog_class bgcolor tianjia sel" style="max-height: 70%;">
+
+            <template #header="{ titleId, titleClass }">
+              <div class="my-header ">
+                <h4 :id="titleId" :class="titleClass">列表</h4>
+              </div>
+            </template>
+            <div>
+              <el-form>
+                <el-form-item label="设计集:" >
+                  <el-select v-model="listval" :suffix-icon="CaretBottom" placeholder="请选择">
+                    <el-option v-for="item in listoptions" :key="item.value" :label="item.label" :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="选择要在表中显示的一个或者多个变量和响应" >
+                </el-form-item>
+                <el-card shadow="hover" style="width: 100%">
+                  <el-checkbox-group v-model="Listcheckboxvalue">
+                    <el-checkbox v-for="item in Listcheckbox" :key="item.value" :label="item.value" style="display: block">{{ item.label }}</el-checkbox>
+                  </el-checkbox-group>
+                </el-card>
+              </el-form>
+            </div>
+            <template #footer>
+              <div class="dialog-footer">
+                <el-button @click="dialog.listdialog = false">取消</el-button>
+                <el-button type="primary" @click="dialog.listdialog = false">
+                  确定
+                </el-button>
+              </div>
+            </template>
+          </el-dialog>
           <!-- 查看报告 -->
           <el-dialog v-model="dialog.lookover" align-center :modal="false" :close-on-click-modal="false"
             :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
@@ -1141,7 +1177,7 @@
               </el-tab-pane>
               <!-- FFD -->
               <el-tab-pane label="FFD" name="FFD">
-               <ffds/>
+               <ffds ref="Ffdref"/>
               </el-tab-pane>
             </el-tabs>
               </el-form>
@@ -2062,7 +2098,7 @@ let question = ref([
  
   { url: 'kk6.png', titlie: "横条图" },
   { url: 'kk7.png', titlie: "雷达图" },
-  { url: 'kk8.png', titlie: "Pareto" },
+  { url: 'kk8.png', titlie: "帕雷托图" },
   { url: 'kk9.png', titlie: "云图" },
   { url: 'kk10.png', titlie: "查看报告" },
   { url: 'kk11.png', titlie: "导出报告" },
@@ -2173,6 +2209,25 @@ let addlist8 = ref([
   { label: 'YES', value: 'YES' },
   { label: 'NO', value: 'NO' },
 ])
+
+let listval = ref('全部设计')
+let listoptions = ref([
+  { label: '全部设计', value: '全部设计' },
+  { label: '可行设计', value: '可行设计' },
+  { label: '不可行设计', value: '不可行设计' },
+  { label: '非错误设计', value: '非错误设计' },
+  { label: '最佳设计', value: '最佳设计' },
+  { label: '改进设计', value: '改进设计' },
+  { label: '错误设计', value: '错误设计' },
+])
+let Listcheckboxvalue = ref([])
+let Listcheckbox = ref([
+  {label:'x1',value:'x1'},
+  {label:'x2',value:'x2'},
+  {label:'x3',value:'x3'},
+  {label:'x4',value:'x4'},
+])
+
 let dialog = ref({
   newdialog: false,
   setdialog: false,
@@ -2200,7 +2255,8 @@ let dialog = ref({
   task: false,
   guanli: false,
   optgroup:false,
-  Pythonshow:false
+  Pythonshow:false,
+  listdialog:false,
 })
 
 // let columns=ref[{
@@ -2377,11 +2433,12 @@ const optimizerfalse = (val) => {
   console.log(val);
   if (val == '优化器') {
     // dialog.value.optimizer = true;
-    // activeadf.value='代理优化器';
+    activeadf.value='代理优化器';
     initoptimize();
     dialog.value.optgroup = true;
   } else if (val == '参数化') {
-    activeadf.value='CST'
+    activeadf.value='CST';
+    initcstffds();
     dialog.value.cstffd = true;
   }else if (val == '气动分析') {
     activeadf.value='Xfoil'
@@ -2438,7 +2495,7 @@ const optimizerfalse = (val) => {
     nextTick(() => {
       // 确保 ref 已经初始化
       if (Ffdref.value) {
-        Ffdref.value.getffd(pid.value);
+        Ffdref.value.getffds(pid.value);
       }
     });
   }
@@ -2450,9 +2507,6 @@ const optimizerfalse = (val) => {
   }else if(val == 'Xfiol'){
   //  activeadf.value='Xfiol';
    dialog.value.Xfiol = true;
-  }else if(val == 'FFD'){
-   activeadf.value='FFD';
-    dialog.value.cstffd = true;
   }else if(val == 'TACS'){
     dialog.value.Taxs = true;
   }else if(val == '模版'){
@@ -2498,6 +2552,11 @@ const initoptimize = () => {
     console.log('1:', res1.checked);
     console.log('2:', res2.checked);
     console.log('3:', res3.checked);
+
+    Joptimizeref.value.getoptimizeAssign(res1);
+
+
+
     
     // 根据返回值来设置 activeadf
     if (res1.checked === 1) {
@@ -2513,6 +2572,35 @@ const initoptimize = () => {
   });
 }
 
+// CST/FFD窗口初始化
+const initcstffds = () => {
+  const params1 = {
+    transCode:'MDO0040',
+    pid: pid.value,
+  }
+  const params2 = {
+    transCode:'MDO0043',
+    pid: pid.value,
+  }
+  Promise.all([
+    request(params1),
+    request(params2),
+  ]).then(([res1, res2]) => {
+    console.log('1:', res1.checked);
+    console.log('2:', res2.checked);
+    
+    // 根据返回值来设置 activeadf
+    if (res1.checked === 1) {
+      activeadf.value = 'CST';
+    } else if (res2.checked === 1) {
+      activeadf.value = 'FFD';
+    }
+    console.log('Updated activeadf:', activeadf.value);
+  }).catch((err) => {
+    console.error('请求失败:', err);
+  });
+}
+
 // Python窗口初始化
 const initPython = () => {
   console.log('Pythonchushihua');
@@ -2618,6 +2706,10 @@ const dialogbolen = () => {
     case "曲线监控":
       ifjiankong()
       curveLine();
+    case "列表":
+      echatsfunc();
+      dialog.value.listdialog = true;
+      break;
     case "面积图":
       echatsfunc();
       break;
@@ -2638,7 +2730,7 @@ const dialogbolen = () => {
       //logsget();
       echatsfunc();
       break;
-      case "查看报告":
+    case "查看报告":
       echatsfunc();
       dialog.value.lookover = true;
       break;

+ 30 - 15
src/views/titlecomponent/Joptimize.vue

@@ -117,22 +117,22 @@ const getoptimize = (id) => {
 
       if (res.hasOwnProperty('eid')) {
 
-        eid.value = res.eid;
-        youhua.value.algorithm = res.algorithm
-        youhua.value.popsize = Number(res.popsize); // 将id属性转换为数字
-        youhua.value.epoch = Number(res.epoch);
-        youhua.value.probcrossover = Number(res.probcrossover);
-        youhua.value.probmut = Number(res.probmut);
-        youhua.value.probscale = Number(res.probscale);
-        youhua.value.proboperator = res.proboperator;
-        youhua.value.strategy = res.strategy;
-        youhua.value.operator = res.operator;
-        youhua.value.gpu = res.gpu;
-
-        // youhua=res;
+        // eid.value = res.eid;
+        // youhua.value.algorithm = res.algorithm
+        // youhua.value.popsize = Number(res.popsize); 
+        // youhua.value.epoch = Number(res.epoch);
+        // youhua.value.probcrossover = Number(res.probcrossover);
+        // youhua.value.probmut = Number(res.probmut);
+        // youhua.value.probscale = Number(res.probscale);
+        // youhua.value.proboperator = res.proboperator;
+        // youhua.value.strategy = res.strategy;
+        // youhua.value.operator = res.operator;
+        // youhua.value.gpu = res.gpu;
+
+        getoptimizeAssign(res);
 
       } else {
-        //  youhua=res;
+
       }
 
     })
@@ -140,6 +140,21 @@ const getoptimize = (id) => {
       ElMessage.error(err.returnMsg)
     })
 }
+
+const getoptimizeAssign = (data) => {
+  eid.value = data.eid;
+  youhua.value.algorithm = data.algorithm
+  youhua.value.popsize = Number(data.popsize); // 将id属性转换为数字
+  youhua.value.epoch = Number(data.epoch);
+  youhua.value.probcrossover = Number(data.probcrossover);
+  youhua.value.probmut = Number(data.probmut);
+  youhua.value.probscale = Number(data.probscale);
+  youhua.value.proboperator = data.proboperator;
+  youhua.value.strategy = data.strategy;
+  youhua.value.operator = data.operator;
+  youhua.value.gpu = data.gpu;
+}
+
 //进化优化器 添加保存
 const getaddsave = () => {
   const params = {
@@ -170,7 +185,7 @@ const getaddsave = () => {
       ElMessage.error(err.returnMsg)
     })
 }
-defineExpose({getoptimize,getaddsave});
+defineExpose({getoptimize,getoptimizeAssign,getaddsave});
 </script>
 
 

+ 2 - 0
src/views/titlecomponent/csts.vue

@@ -198,6 +198,8 @@ const getcst = (id) => {
         // upperb.value = res.upperb;
         // lowerb.value = res.lowerb;
 
+        clickblur(); 
+
         // 解析 upperb 和 lowerb
         let upperbValues = res.upperb ? res.upperb.split(",") : [];
         let lowerbValues = res.lowerb ? res.lowerb.split(",") : [];

+ 6 - 32
src/views/titlecomponent/ffds.vue

@@ -19,34 +19,6 @@
           />
         </template>
         </el-input>
-      <el-form-item label="FFD包围盒:" :label-width="formLabelWidth1" style="align-items: center;">
-        <el-row align="middle" :gutter="20">
-          <el-col :span="22">
-            <el-input
-              v-model="ffdvalue.fname"
-              :max="20"
-              controls-position="right"
-              @keydown.enter="keydownenter"
-            />
-          </el-col>
-          <el-col :span="2">
-            <el-upload
-            class="upload-demo"
-            action="your-upload-api-endpoint"  
-            :on-success="handleUploadSuccess"
-            :on-error="handleUploadError"
-            :show-file-list="false"
-            >
-            <img 
-            src="" 
-            alt="Button Image" 
-            style="width: 40px; height: 40px; cursor: pointer;"
-            @click="handleUploadClick" 
-            />
-            </el-upload>
-          </el-col>
-        </el-row>
-        
       </el-form-item>
       <el-form-item label="参考坐标系:" :label-width="formLabelWidth1">
         <el-radio-group v-model="order">
@@ -192,7 +164,8 @@ const generateVars = () => {
 const initializeTableFromVars = () => {
   if (!vars.value) return; 
 
-  const values = vars.value.split(','); 
+  const values = vars.value.split(',');
+  console.log('ffdchaxun',values); 
 
   let index = 0; 
 
@@ -210,7 +183,7 @@ const initializeTableFromVars = () => {
 
 
 // ffd查询
-const getffd = (id) => {
+const getffds = (id) => {
   pid.value = id;
   const params = {
     transCode: "MDO0043",
@@ -218,13 +191,14 @@ const getffd = (id) => {
   };
   request(params).then((res) => {
     if (res.hasOwnProperty("ffdid")) {
-      ffdid.value = res.ffd;
+      ffdid.value = res.ffdid;
       ffdvalue.value.fname = res.fname;
       ffdvalue.value.nx = res.nx;
       ffdvalue.value.ny = res.ny;
       ffdvalue.value.nz = res.nz;
       order.value = Number(res.order);
       vars.value = res.vars;
+      generateTable();
       initializeTableFromVars();
     }
   })
@@ -260,7 +234,7 @@ const getffdsave = () => {
     });
 };
 
-defineExpose({ getffd, getffdsave });
+defineExpose({ getffds, getffdsave });
 
 </script>