Pārlūkot izejas kodu

Merge branch 'master' of http://adicom-hxx.natapp1.cc/CQ_ADI/airoptweb

lichunyang 4 mēneši atpakaļ
vecāks
revīzija
34fe7bd320

+ 7 - 1
src/views/home.vue

@@ -1284,7 +1284,7 @@
             <template #footer>
               <div style="display: flex;justify-content: space-between;">
                 <div>
-                  <el-button v-show="MathFuncxinjian">新建</el-button>
+                  <el-button v-show="MathFuncxinjian" @click="mathfuncxinjian()">新建</el-button>
                 </div>
                 <div class="dialog-footer">
                   <el-button @click="dialog.MathFuncdialog = false">取消</el-button>
@@ -4324,6 +4324,12 @@ const getfsitosave = () => {
   }
 }
 
+const mathfuncxinjian = () => {
+  if(MathFuncref.value) {
+    MathFuncref.value.mathfuncnew();
+  }
+}
+
 // MathFunc保存
 const getmathfunctosave = () => {
   if (MathFuncref.value) {

+ 65 - 4
src/views/titlecomponent/MathFunc.vue

@@ -38,11 +38,11 @@
         </el-table>
     </div>
 
-      <div v-show="currentTab1 == '1'" style="margin-top: 10px">
+    <div v-show="currentTab1 == '1'" style="margin-top: 10px">
         <PythonEdit :value="equation" language="python" />
-      </div> 
+    </div> 
 
-      <div v-show="currentTab1 == '2'" class="eldesign classtable" style="margin-top: 10px">
+    <div v-show="currentTab1 == '2'" class="eldesign classtable" style="margin-top: 10px">
         <el-table :data="outParams" border style="width: 100%; height: 280px" :header-cell-class-name="headerCellClassName">
           <el-table-column type="index" width="70" label="编号" />
           <el-table-column prop="name" label="参数名称">
@@ -66,7 +66,36 @@
             </template>
           </el-table-column>
         </el-table>
+    </div>
+
+    <el-dialog v-model="xinjiandialog" 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"
+       width="400" class="dialog_class bgcolor colortext tianjia sel">
+      <template #header="{ titleId, titleClass }">
+        <div class="my-header ">
+          <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
+          <h4 :id="titleId" :class="titleClass">新建</h4>
+        </div>
+      </template>
+      <div style="margin-top: 20px;padding: 20px;">
+        <el-form>
+          <el-form-item label="code:" :label-width="formLabelWidth1">
+            <el-input v-model="code" maxlength="100"/>
+          </el-form-item>
+          <el-form-item label="参数名称:" :label-width="formLabelWidth1">
+            <el-input v-model="name" maxlength="100"/>
+          </el-form-item>
+        </el-form>
       </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="xinjiandialog = false">取消</el-button>
+          <el-button type="primary" @click="xinjiantablecolumn();xinjiandialog = false">
+            确定
+          </el-button>
+        </div>
+      </template>
+    </el-dialog>
 
   </div>
 </template>
@@ -74,6 +103,7 @@
 import { ref, onMounted, reactive, provide, nextTick } from "vue"
 import { ElMessage, ElButton, ElDialog, ElSelect } from "element-plus"
 import { request, uploadFile } from "@/utils/request"
+import emitter from "@/utils/emitter"
 
 import PythonEdit from '@/components/PythonEditor/index.vue'; 
 import configParams from "@/assets/img/configParams.png";
@@ -120,6 +150,34 @@ let outParams = ref([
   { code:'', name: "00", value: 0, flag: 1 },
 ])
 
+let xinjiandialog = ref(false)
+
+let formLabelWidth1 = ref(100)
+let code = ref('')
+let name = ref('')
+
+const mathfuncnew = () => {
+  // console.log('新建')
+  xinjiandialog.value = true;
+}
+
+let xinjiantablecolumn = () => {
+  // console.log('xinjiantablecolumn')
+  if(code.value && name.value){
+    if(currentTab1.value === 0){
+      inParams.value.push({ code: code.value, name: name.value, value: 0, flag: 1 });
+    }else if(currentTab1.value === 2){
+      outParams.value.push({ code: code.value, name: name.value, value: 0, flag: 1 });
+    }else {
+      return;
+    }
+    code.value = '';
+    name.value = '';
+  }else{
+    ElMessage.error('请输入code和参数名称')
+  }
+}
+
 let emit = defineEmits(['selectTab']);
 const selectTab1 = (index) => {
   // console.log('dayin',index);
@@ -179,9 +237,11 @@ const getmathfunc = (id,nowid) => {
   request(params).then((res) => {
     if (res.hasOwnProperty("mfcid")) {
       getmathfuncAssign(res);
+      emitter.emit("mfcidFromMathFunc", mfcid);
     }
   })
   .catch((err) => {
+      console.log('MathFunc初始化失败err:', err)
       ElMessage.error('MathFunc初始化失败')
     })
 }
@@ -214,12 +274,13 @@ const getmathfuncsave = (id,nowid) => {
         message: '保存成功',
         type: 'success',
       })
+      getmathfunc(pid.value, wid.value);
   })
   .catch((err) => {
       ElMessage.error('保存失败')
     })
 }
 
-defineExpose({ getmathfunc, getmathfuncAssign, getmathfuncsave })
+defineExpose({ getmathfunc, getmathfuncAssign, getmathfuncsave ,mathfuncnew})
 
 </script>

+ 4 - 1
src/views/titlecomponent/TACS.vue

@@ -215,6 +215,7 @@ import { Edit, CaretBottom } from "@element-plus/icons-vue"
 import fileUploads from '../components/fileuploads.vue'
 import cloudChart from "../threejsView/index.vue" // 云图
 import { request, uploadFile } from "@/utils/request"
+import emitter from "@/utils/emitter"
 
 let fid = ref()
 let formLabelWidth1 = ref(170)
@@ -435,6 +436,7 @@ const gettacs = (id,nowid) => {
   request(params).then((res) => {
     if (res.hasOwnProperty("tacsid")) {
       gettacsAssign(res);
+      emitter.emit('tacsidFromTACS', tacsid);
     }
   })
   .catch((err) => {
@@ -573,7 +575,8 @@ const gettacssave = (id,nowid) => {
     ElMessage({
         message: '保存成功',
         type: 'success',
-      })
+    })
+    gettacs(pid.value,wid.value);
   })
   .catch((err) => {
       ElMessage.error('保存失败')

+ 218 - 4
src/views/vuetree/index.vue

@@ -89,7 +89,7 @@
     <!-- 双击线段 -->
     <el-dialog v-model="dataflowshow" 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"
-             width="500" class="dialog_style bgcolor colortext tianjia sel">
+             width="500" class=" bgcolor colortext tianjia sel">
       <template #header="{ titleId, titleClass }">
         <div class="my-header ">
           <h4 :id="titleId" :class="titleClass">数据流</h4>
@@ -166,7 +166,7 @@
                 @change="handlecheckFlagchange"></el-checkbox>
               </template>
             </el-table-column>
-            <el-table-column prop="name" label="" ></el-table-column>
+            <el-table-column prop="name" label="" show-overflow-tooltip></el-table-column>
             <el-table-column prop="steamtype">
               <template #default="{ row }">
                 <el-select v-model="row.steamtype">
@@ -220,7 +220,143 @@
           </div>
           </el-card>
         </div>
-        
+        <div v-if="datacontent === '5'">
+          <el-card :shadow="none" style="min-height: 240px; max-height: 480px;">
+          <el-checkbox v-model="checkAll" 
+          :indeterminate="isIndeterminate"
+          @change="handlecheckAllchange">全选</el-checkbox>
+          <div class="eldesign classtable">
+            <el-table :data="ADflowMathfunctable" border :show-header="false">
+            <el-table-column
+              type="index"
+              label=""
+            ></el-table-column>
+            <el-table-column prop="steamflag" width="55">
+              <template #default="{ row }">
+                <el-checkbox
+                :false-label="0"
+                :true-label="1" 
+                v-model="row.steamflag" 
+                @change="handlecheckFlagchange"></el-checkbox>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="steamtype">
+              <template #default="{ row }">
+                <el-select v-model="row.steamtype">
+                  <el-option 
+                  v-for="item in steamtypeoptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            </el-table>
+          </div>
+          </el-card>
+        </div>
+        <div v-if="datacontent === '6'">
+          <el-card :shadow="none" style="min-height: 240px; max-height: 480px;">
+          <el-checkbox v-model="checkAll" 
+          :indeterminate="isIndeterminate"
+          @change="handlecheckAllchange">全选</el-checkbox>
+          <div class="eldesign classtable">
+            <el-table :data="TacsMathFunctable" border :show-header="false">
+            <el-table-column
+              type="index"
+              label=""
+            ></el-table-column>
+            <el-table-column prop="steamflag" width="55">
+              <template #default="{ row }">
+                <el-checkbox
+                :false-label="0"
+                :true-label="1" 
+                v-model="row.steamflag" 
+                @change="handlecheckFlagchange"></el-checkbox>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="steamtype">
+              <template #default="{ row }">
+                <el-select v-model="row.steamtype">
+                  <el-option 
+                  v-for="item in steamtypeoptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            </el-table>
+          </div>
+          </el-card>
+        </div>
+        <div v-if="datacontent === '7'">
+          <el-card :shadow="none" style="min-height: 240px; max-height: 480px;">
+          <el-checkbox v-model="checkAll" 
+          :indeterminate="isIndeterminate"
+          @change="handlecheckAllchange">全选</el-checkbox>
+          <div class="eldesign classtable">
+            <el-table :data="youhuaTACStable" border :show-header="false">
+            <el-table-column
+              type="index"
+              label=""
+            ></el-table-column>
+            <el-table-column prop="steamflag" width="55">
+              <template #default="{ row }">
+                <el-checkbox
+                :false-label="0"
+                :true-label="1" 
+                v-model="row.steamflag" 
+                @change="handlecheckFlagchange"></el-checkbox>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="" ></el-table-column>
+            </el-table>
+          </div>
+          </el-card>
+        </div>
+        <div v-if="datacontent === '8'">
+          <el-card :shadow="none" style="min-height: 240px; max-height: 480px;">
+          <el-checkbox v-model="checkAll" 
+          :indeterminate="isIndeterminate"
+          @change="handlecheckAllchange">全选</el-checkbox>
+          <div class="eldesign classtable">
+            <el-table :data="MathFuncyouhuatable" border :show-header="false">
+            <el-table-column
+              type="index"
+              label=""
+            ></el-table-column>
+            <el-table-column prop="steamflag" width="55">
+              <template #default="{ row }">
+                <el-checkbox
+                :false-label="0"
+                :true-label="1" 
+                v-model="row.steamflag" 
+                @change="handlecheckFlagchange"></el-checkbox>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="steamtype">
+              <template #default="{ row }">
+                <el-select v-model="row.steamtype">
+                  <el-option 
+                  v-for="item in steamtypeoptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            </el-table>
+          </div>
+          </el-card>
+        </div>
+
       </div>
       <template #footer>
         <div class="dialog-footer">
@@ -636,6 +772,10 @@ let youhuaCSTtable = ref([
   { name:'下表面CST参数(lower)', steamflag:1 }
 ])
 
+let youhuaTACStable = ref([
+  { name:'TACS参数', steamflag:1 }
+])
+
 let steamtypeoptions = ref([
   { label:'约束条件', value:1 },
   { label:'优化目标', value:2 }
@@ -648,6 +788,12 @@ let ADflowyouhuatable = ref([
   
 ])
 
+let ADflowMathfunctable = ref([])
+
+let TacsMathFunctable = ref([])
+
+let MathFuncyouhuatable = ref([])
+
 let Xfoilyouhuatable = ref([
   // { code:'', name:'升力系数Cl', comtype:2 , steamflag:1, steamtype:1 },
   // { code:'', name:'阻力系数Cd', comtype:2 , steamflag:1, steamtype:1 },
@@ -663,7 +809,11 @@ const dataTables = {
   '1': youhuaFFDtable,
   '2': youhuaCSTtable,
   '3': ADflowyouhuatable,
-  '4': Xfoilyouhuatable
+  '4': Xfoilyouhuatable,
+  '5': ADflowMathfunctable,
+  '6': TacsMathFunctable,
+  '7': youhuaTACStable,
+  '8': MathFuncyouhuatable,
 };
 
 const handlecheckFlagchange = () => {
@@ -700,6 +850,8 @@ const confirmselection=()=>{
 
 const xfid = ref('')
 const adid = ref('')
+const mfcid = ref('')
+const tacsid = ref('')
 // 监听组件xfoil返回的xfid
 const handleXfid = (xfidFromB) => {
   xfid.value = xfidFromB.value;
@@ -710,6 +862,15 @@ const handleAdid = (adidFromB) => {
   adid.value = adidFromB.value;
   noid.value.data.adid = adid.value;
 }
+const handleMfcid = (mfcidFromB) => {
+  mfcid.value = mfcidFromB.value;
+  noid.value.data.mfcid = mfcid.value;
+};
+
+const handleTacsid = (tacsidFromB) => {
+  tacsid.value = tacsidFromB.value;
+  noid.value.data.tacsid = tacsid.value;
+};
 
 
 let datacontent = ref('')
@@ -756,6 +917,36 @@ function onEdgeDoubleClick(e) {
     }else{
       ElMessage.error('Xfoil未初始化!')
     }
+  }else if ( qidian === 'ADflow' && zhongdian ==='MathFunc' ) {
+    datacontent.value = '5';
+    adid.value = e.edge.sourceNode.data.adid;
+    if(adid.value) {
+      querydataFlow(adid);
+      dataflowshow.value = true;
+    }else{
+      ElMessage.error('ADflow未初始化!')
+    }
+  }else if ( qidian === 'TACS' && zhongdian ==='MathFunc' ) {
+    datacontent.value = '6';
+    tacsid.value = e.edge.sourceNode.data.tacsid;
+    if(tacsid.value) {
+      querydataFlow(tacsid);
+      dataflowshow.value = true;
+    }else{
+      ElMessage.error('TACS未初始化!')
+    }
+  }else if( youhualist.includes(qidian) && zhongdian ==='TACS') {
+    datacontent.value = '7';
+    dataflowshow.value = true;
+  }else if( qidian ==='MathFunc' && youhualist.includes(zhongdian)) {
+    datacontent.value = '8';
+    mfcid.value = e.edge.sourceNode.data.mfcid;
+    if(mfcid.value) {
+      querydataFlow(mfcid);
+      dataflowshow.value = true;
+    }else{
+      ElMessage.error('MathFunc未初始化!')
+    }
   }
   console.log('leixing:',datacontent.value);
 
@@ -779,6 +970,18 @@ const querydataFlow = (comid) => {
       Xfoilyouhuatable.value = res.params;
       handlecheckFlagchange();
     }
+    if(datacontent.value === '5'){
+      ADflowMathfunctable.value = res.params;
+      handlecheckFlagchange();
+    }
+    if(datacontent.value === '6'){
+      TacsMathFunctable.value = res.params;
+      handlecheckFlagchange();
+    }
+    if(datacontent.value === '8'){
+      MathFuncyouhuatable.value = res.params;
+      handlecheckFlagchange();
+    }
     
   })
   .catch((err) => {
@@ -792,6 +995,12 @@ const dataFlowsave = () => {
     stringArray = convertToStringArray([],ADflowyouhuatable.value);
   }else if(datacontent.value === '4'){
     stringArray = convertToStringArray([],Xfoilyouhuatable.value);
+  }else if(datacontent.value === '5'){
+    stringArray = convertToStringArray([],ADflowMathfunctable.value);
+  }else if(datacontent.value === '6'){
+    stringArray = convertToStringArray([],TacsMathFunctable.value);
+  }else if(datacontent.value === '8'){
+    stringArray = convertToStringArray([],MathFuncyouhuatable.value);
   }else{
     return;
   }
@@ -1195,6 +1404,8 @@ onMounted(() => {
 
   emitter.on("xfidFromxfoil", handleXfid);
   emitter.on("adidFromadflow", handleAdid);
+  emitter.on("mfcidFromMathFunc", handleMfcid);
+  emitter.on("tacsidFromTACS", handleTacsid);
 });
 
 const cleanEdgeselect = () => {
@@ -1224,6 +1435,9 @@ onUnmounted(() => {
 
   emitter.off("xfidFromxfoil", handleXfid);
   emitter.off("adidFromadflow", handleAdid);
+  emitter.off("mfcidFromMathFunc", handleMfcid);
+  emitter.off("tacsidFromTACS", handleTacsid);
+
 });