tangjunhao 5 місяців тому
батько
коміт
4cdb2a70a4

BIN
src/assets/flowimg/xkfx.png


BIN
src/assets/flowimg/youhq.png


BIN
src/assets/flowimg/youhwt.png


+ 14 - 0
src/style/index.css

@@ -333,6 +333,10 @@ overflow: hidden;
     overflow: auto;
     width: 100%;
   }
+  .right_container {
+    flex: 1;
+    overflow: auto; /* 可选:让内容可以滚动 */
+  }
   .main_model{
     width: 100%;
     height:calc(100vh - 154px) ;
@@ -851,4 +855,14 @@ width: 150px;
 }
 .footerp .pythfoter .el-textarea__inner{
   min-height: 60px!important;
+}
+
+/* 控制 tooltip 内容的最大宽度和换行 */
+.el-tooltip__popper {
+  max-width: 300px !important; /* 设置最大宽度 */
+}
+
+.el-tooltip__content {
+  white-space: normal !important;  /* 允许换行 */
+  word-break: break-word;  /* 防止长词汇不换行 */
 }

+ 11 - 0
src/views/echart/optimize_monitor.vue

@@ -370,6 +370,17 @@ const linechart = () => {
       borderColor: "rgba(147, 235, 248, .8)",
       textStyle: {
         color: "#FFF"
+      },
+      formatter: function (params) {
+        let maxShow = 10;
+        let result = params[0].axisValue + '<br/>';
+        for (let i = 0; i < Math.min(params.length, maxShow); i++) {
+          result += `${params[i].marker}${params[i].seriesName}: ${params[i].data}<br/>`;
+        }
+        if (params.length > maxShow) {
+          result += '...更多';
+        }
+        return result;
       }
     },
     legend: {

+ 2 - 2
src/views/echart/tablelist.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="classtable" style="width:100%; height: 100%;">
+  <div class="classtable" style="width:100%; height: 100%; overflow: auto;">
     <div v-show="tableshow">
     <el-table :data="tabledataliebiao"
     border
@@ -8,7 +8,7 @@
     
     <el-table-column type="index" label="编号" width="100"></el-table-column>
       <el-table-column v-for="(header, index) in visibleHeaders" :key="index" :prop="header.prop" show-overflow-tooltip
-        :label="header.label" >
+        :label="header.label" min-width="200">
       </el-table-column>
     </el-table>
     </div>

+ 38 - 44
src/views/home.vue

@@ -39,6 +39,10 @@
                       <span>{{ f4ce }}</span>
                       <el-select v-model="f4ce" class="no-border headersele" :suffix-icon="CaretBottom">
                         <el-option v-for="item in optiongroup1" :key="item.value" :label="item.label" :value="item.value">
+                          <div style="display: flex; align-items: center;">
+                            <img :src="getflowImgPath(item.img)" style="width: 20px; height: 20px; margin-right: 10px;" />
+                            <span>{{ item.label }}</span>
+                          </div>
                         </el-option>
                       </el-select>
                     </div>
@@ -46,10 +50,12 @@
                       <el-image :src="getImgPath('tow2.png')" fit="cover" />
                       <span>{{ modelban }}</span>
                       <el-select v-model="modelban" class="no-border headersele" :suffix-icon="CaretBottom">
-                        <el-option-group v-for="group in optiongroup" :key="group.label" :label="group.label">
-                          <el-option v-for="item in group.options" :key="item.value" :label="item.label"
-                            :value="item.value" />
-                        </el-option-group>
+                        <el-option v-for="item in optiongroup" :key="item.value" :label="item.label" :value="item.value">
+                          <div style="display: flex; align-items: center;">
+                            <img :src="getflowImgPath(item.img)" style="width: 20px; height: 20px; margin-right: 10px;" />
+                            <span>{{ item.label }}</span>
+                          </div>
+                        </el-option>
                       </el-select>
                     </div>
                     <div class="item2 margr" @click="clickgeometry($event, index, 'Role-' + '2', undmodel)">
@@ -1140,7 +1146,7 @@
 
             <template #header="{ titleId, titleClass }">
               <div class="my-header ">
-                <el-image :src="getImgPath('t2.png')" fit="contain"></el-image>
+                <!-- <el-image :src="getImgPath('t2.png')" fit="contain"></el-image> -->
                 <h4 :id="titleId" :class="titleClass">优化算法:</h4>
               </div>
             </template>
@@ -1308,7 +1314,7 @@
             <!--left菜单栏  -->
             <Sidebar ref="Sidebarref" />
             <!-- 放图形 -->
-            <div class="main_container">
+            <div class="right_container">
               <div class="main_model">
                 <div class="jindutiao" v-show="progressshow">
                   <span style="width: 150px;">运行进度</span>
@@ -1697,7 +1703,7 @@ let f4ce = ref("优化问题组件");
 let modelban = ref("学科分析组件");
 let undmodel=ref('优化器组件');
 let optiongroup1 = ref([
-  { label: '优化问题', value: '优化问题' }
+  { label: '优化问题', value: '优化问题',img:'wen.png' }
 ])
 let options4 = ref([
   { label: '进化优化器', value: '进化优化器', icon:xuek10 },
@@ -2143,39 +2149,23 @@ let tasklist = ref([
   { label: '噪声', value: '噪声' },
 ])
 
-const optiongroup = [
-  {
-    label: '大飞机',
-    options: [
-      {
-        value: '气动优化',
-        label: '气动优化',
-      },
-      {
-        value: '气弹优化',
-        label: '气弹优化',
-      },
-    ],
-  },
-  {
-    label: '直升机',
-    options: [
-      {
-        value: '气动优化1',
-        label: '气动优化',
-      },
-      {
-        value: '气弹优化2',
-        label: '气弹优化',
-      },
-      {
-        value: '气动噪声优化',
-        label: '气动噪声优化',
-      },
-
-    ],
-  },
-]
+const optiongroup =  ref([
+  { label: 'CST', value: 'CST', img:'xuek0.png' },
+  { label: 'FFD', value: 'FFD', img:'ffd.png' },
+  { label: 'Xfoil', value: 'Xfoil', img:'xuek9.png' },
+  { label: 'ADflow', value: 'ADflow', img:'ADflow.png' },
+  { label: 'TACS', value: 'TACS', img:'TACS.png' },
+  { label: 'CATIA', value: 'CATIA', img:'xuek1.png' },
+  { label: 'Python', value: 'Python', img:'xuek8.png' },
+  { label: 'Excel', value: 'Excel', img:'xuek2.png' },
+  { label: 'Feko', value: 'Feko', img:'xuek3.png' },
+  { label: 'Fluent', value: 'Fluent', img:'xuek4.png' },
+  { label: 'HCFD', value: 'HCFD', img:'xuek5.png' },
+  { label: 'Matlab', value: 'Matlab', img:'xuek6.png' },
+  { label: 'Nastran', value: 'Nastran', img:'xuek7.png' },
+  { label: 'FUM to FEM', value: 'FSI', img:'fsi.png' },
+  { label: 'Flight', value: 'Flight', img:'flight.png' },
+])
 const eloptimize = ref([])
 const tableData = ref([])
 const designtable = ref([])
@@ -2212,6 +2202,10 @@ let num = ref(1)
 const getImgPath = (url) => {
   return new URL(`../assets/img/${url}`, import.meta.url).href
 }
+const getflowImgPath = (url) => {
+  return new URL(`../assets/flowimg/${url}`, import.meta.url).href
+}
+
 onMounted(() => {
   //console.log( Sidebarref.value.datatree);
 
@@ -2940,7 +2934,7 @@ const runok = () => {
       })
     })
     .catch((err) => {
-      ElMessage.error(err.returnMsg)
+      ElMessage.error('运行失败')
     })
 }
 const tableKey = ref(0);
@@ -4419,7 +4413,7 @@ const lbjkheaderCellClassName = ({ columnIndex }) => {
   font-family: 'Microsoft YaHei';
   font-size: 16px;
   color: rgba(51, 51, 51, 1);
-  line-height: 24px;
+  /* line-height: 24px; */
   text-align: left;
   font-style: normal;
   text-transform: none;
@@ -4442,7 +4436,7 @@ color: rgba(51, 51, 51, 0.8);
 }
 
 .custom-tree1>.el-tree-node>.el-tree-node__content>div img {
-  display: none;
+  /* display: none; */
   /* 隐藏一级节点复选框 */
 }
 
@@ -4578,7 +4572,7 @@ color: #2267B1;
 
 .classtable .el-table th .cell {
  /* background: #fff; */
- /* line-height: 31px; */
+ line-height: 31px;
 }
 
 .classtable .el-table td.el-table__cell, .classtable .el-table th.el-table__cell{

+ 7 - 6
src/views/titlecomponent/ADflow.vue

@@ -751,6 +751,7 @@ const getadflowsave = (id,nowid) => {
         message: '保存成功',
         type: "success"
       })
+      getadflow(pid.value, wid.value);
     })
     .catch((err) => {
       ElMessage.error('保存失败')
@@ -38444,13 +38445,13 @@ const getUploadStatus = (newValue) => {
 const fileDel = () => {
 }
 
-onMounted(() => {
-  emitter.on("requestGetadid", getadflow); // 监听事件
-});
+// onMounted(() => {
+//   emitter.on("requestGetadid", getadflow); // 监听事件
+// });
 
-onUnmounted(() => {
-  emitter.off("requestGetadid", getadflow); // 解绑事件
-});
+// onUnmounted(() => {
+//   emitter.off("requestGetadid", getadflow); // 解绑事件
+// });
 
 
 

+ 14 - 9
src/views/titlecomponent/Xfoil.vue

@@ -323,8 +323,7 @@ const getxfoil = (id,nowid) => {
   if(nowid){
     wid.value = nowid;
   }
-  
-  console.log('pid-1:',pid.value)
+  // console.log('pid-1:',pid.value)
   const params = {
     transCode: "MDO0046",
     pid: pid.value,
@@ -379,7 +378,8 @@ const getxfoilsave = (id,nowid) => {
     ElMessage({
         message: '保存成功',
         type: 'success',
-      })
+      }),
+    getxfoil(pid.value,wid.value)
   })
   .catch((err) => {
       ElMessage.error('保存失败')
@@ -387,13 +387,18 @@ const getxfoilsave = (id,nowid) => {
 }
 
 
-onMounted(() => {
-  emitter.on("requestGetxfid", getxfoil); // 监听事件
-});
+// const transmitxfid = (data) =>{
+//   emitter.emit("xfidFromxfoil", xfid);
+//   console.log('transmitxfid:',xfid.value);
+// }
 
-onUnmounted(() => {
-  emitter.off("requestGetxfid", getxfoil); // 解绑事件
-});
+// onMounted(() => {
+//   emitter.on("requestGetxfid", transmitxfid); // 监听事件
+// });
+
+// onUnmounted(() => {
+//   emitter.off("requestGetxfid", transmitxfid); // 解绑事件
+// });
 
 
 

+ 48 - 14
src/views/titlecomponent/csts.vue

@@ -145,26 +145,60 @@ const headerCellClassName = ({columnIndex}) => {
 
 
 // cst阶数改变
+// const clickblur = () => {
+//   tablecstHeaders.value = []
+//   let num = Number(cstn.value)
+//   if (!num) return; // 直接返回,避免冗余的 `if`
+
+//   // 生成表头
+//   tablecstHeaders.value = Array.from({ length: num + 1 }, (_, i) => ({
+//     label: `X${i + 1}`,
+//     prop: `X${i + 1}`
+//   }))
+
+//   // 更新表格数据
+//   tableDatacst.value = tableDatacst.value.map(item => {
+//     let newItem = { ...item }
+//     tablecstHeaders.value.forEach(col => {
+//       newItem[col.prop] = null
+//     })
+//     return newItem
+//   })
+// }
 const clickblur = () => {
-  tablecstHeaders.value = []
-  let num = Number(cstn.value)
-  if (!num) return; // 直接返回,避免冗余的 `if`
+  let num = Number(cstn.value);
+  if (!num) return;
 
-  // 生成表头
-  tablecstHeaders.value = Array.from({ length: num + 1 }, (_, i) => ({
+  // 构造新的表头
+  const newHeaders = Array.from({ length: num + 1 }, (_, i) => ({
     label: `X${i + 1}`,
     prop: `X${i + 1}`
-  }))
+  }));
 
-  // 更新表格数据
+  // 对每一行数据进行处理
   tableDatacst.value = tableDatacst.value.map(item => {
-    let newItem = { ...item }
-    tablecstHeaders.value.forEach(col => {
-      newItem[col.prop] = null
-    })
-    return newItem
-  })
-}
+    let newItem = { ...item };
+
+    // 添加新增的列
+    newHeaders.forEach(header => {
+      if (!(header.prop in newItem)) {
+        newItem[header.prop] = null;
+      }
+    });
+
+    // 删除多余的列
+    Object.keys(newItem).forEach(key => {
+      if (key.startsWith("X") && !newHeaders.find(h => h.prop === key)) {
+        delete newItem[key];
+      }
+    });
+
+    return newItem;
+  });
+
+  // 最后更新表头
+  tablecstHeaders.value = newHeaders;
+};
 
 // 获取upperb和lowerb
 const getupperlower = () => {

+ 10 - 10
src/views/vuetree/Sidebar.vue

@@ -12,7 +12,7 @@ import emitter from "@/utils/emitter";
 const datatree = ref([
     {
       id:1,
-      label: '工程',
+      label: '工程管理',
       img:gc,
       //children:[]
       children: [
@@ -51,7 +51,7 @@ const datatree = ref([
     {
       id:2,
       label: '优化问题组件',
-      img:'',
+      img:'youhwt.png',
       children: [
         {
           id:'2-1',
@@ -65,7 +65,7 @@ const datatree = ref([
     {
       id:3,
       label: '学科分析组件',
-      img:'',
+      img:'xkfx.png',
       children: [
       {
           id:'3-01',
@@ -146,7 +146,7 @@ const datatree = ref([
           id:'3-4',
           label: 'Fluent',
           img:'xuek4.png',
-         
+          name:'Fluent'
         },
         {
           id:'3-5',
@@ -185,7 +185,7 @@ const datatree = ref([
     {
       id:4,
       label: '优化器组件',
-      img:'',
+      img:'youhq.png',
       children: [
         {
           id:'4-1',
@@ -367,9 +367,9 @@ const stopDrag = () => {
     <el-tree :data="datatree"  class="custom-tree" ref="cgtree"  default-expand-all  :props="defaultProps" @node-click="handleNodeClick"  >
       <template #default="{ node, data }">
           <!-- <div   @dragstart="onDragStart($event, 'default',data.id)"  :draggable="true" > -->
-          <div>
+          <div style="display: flex;align-items: center;">
             <img :src="data.img" class="custom-image" />
-            <span class="custom-text"> {{ node.label }}  </span>
+            <span class="custom-text" style="height: 100%;"> {{ node.label }}  </span>
           </div>
         </template>
     </el-tree>
@@ -381,9 +381,9 @@ const stopDrag = () => {
   >
     <el-tree :data="datatree1"  class="custom-tree1" default-expand-all  :props="defaultProps" @node-click="handleNodeClick">
      <template #default="{ node, data }">
-          <div  @dragstart="onDragStart($event, 'default',data.id)" :draggable="true" >
+          <div  style="display: flex;align-items: center;" @dragstart="onDragStart($event, 'default',data.id)" :draggable="true" >
             <img :src="getImgPath(data.img)" class="custom-image" />
-            <span class="custom-text">
+            <span class="custom-text" style="height: 100%;">
               {{ node.label }} 
             </span>
           </div>
@@ -406,7 +406,7 @@ const stopDrag = () => {
   }
   .el-tree-node img{
     width: 24px;
-    margin-top: -8px;
+    /* margin-top: -8px; */
 
   }
 </style>

+ 34 - 36
src/views/vuetree/index.vue

@@ -3,7 +3,7 @@
     class="basic-flow" 
     style="background-image: url('src/assets/flowimg/surromdao.png'); background-position: center; background-repeat: no-repeat;"
     :default-viewport="{ zoom: 1.5 }" :min-zoom="0.2" :max-zoom="2.5" @drop="onDrop1"
-    @node-contextmenu="logEvent('contextmenu', $event)" 
+    @node-contextmenu="onNodeContextMenu" 
     @dragover="onDragOver" @dragleave="onDragLeave" @edge-click="onEdgeClick" @node-double-click="onNodeDoubleClick" 
     @node-click="onNodeClick" @edge-double-click="onEdgeDoubleClick">
 
@@ -67,7 +67,7 @@
       <div style="margin-top: 20px;padding: 20px;">
         <el-form :model="changeName" label-width="100px" class="demo-ruleForm">
         <el-form-item label="新名称:" prop="name">
-          <el-input v-model="changeName.name" placeholder="请输入名称"></el-input>
+          <el-input v-model="changeName.name" placeholder="请输入名称" maxlength="20"></el-input>
         </el-form-item>
         
         </el-form>
@@ -300,6 +300,7 @@ let pid=ref('');
 let newroter=ref();
 let vueflowimg=ref('');
 const shopShow = ref(false);
+// 选中节点
 let noid = ref([]);
 let Edgeid = ref();
 let seledge=ref(null);
@@ -669,11 +670,8 @@ const confirmselection=()=>{
   console.log('xuanzhongshuju:',checkedData);
   console.log('seledge:',seledge.value);
   seledge.value.label=checkedData.join('\n');
-  if(datacontent.value === '4') {
-    dataFlowsave();
-  }else if(datacontent.value === '3') {
-    dataFlowsave2();
-  }
+  // 保存数据流
+  dataFlowsave();
   
   dataflowshow.value = false;
 }
@@ -685,10 +683,12 @@ const adid = ref('')
 // 监听组件xfoil返回的xfid
 const handleXfid = (xfidFromB) => {
   xfid.value = xfidFromB.value;
+  noid.value.data.xfid = xfid.value;
 };
 
 const handleAdid = (adidFromB) => {
   adid.value = adidFromB.value;
+  noid.value.data.adid = adid.value;
 }
 
 
@@ -716,8 +716,9 @@ function onEdgeDoubleClick(e) {
     dataflowshow.value = true;
   }else if( qidian === 'ADflow' && youhualist.includes(zhongdian) ) {
     datacontent.value = '3';
-    emitter.emit('requestGetadid',pid.value);
-    console.log('adid:',adid.value)
+    // emitter.emit('requestGetadid',pid.value);
+    adid.value = e.edge.sourceNode.data.adid;
+    // console.log('adid:',adid.value)
     if(adid.value) {
       querydataFlow(adid);
       dataflowshow.value = true;
@@ -726,8 +727,9 @@ function onEdgeDoubleClick(e) {
     }
   }else if ( qidian === 'Xfoil' && youhualist.includes(zhongdian) ) {
     datacontent.value = '4';
-    emitter.emit('requestGetxfid',pid.value);
-    console.log('xfid:',xfid.value)
+    // emitter.emit('requestGetxfid',pid.value);
+    xfid.value = e.edge.sourceNode.data.xfid;
+    // console.log('xfid:',xfid.value)
     if(xfid.value) {
       querydataFlow(xfid);
       dataflowshow.value = true;
@@ -765,35 +767,24 @@ const querydataFlow = (comid) => {
 }
 
 const dataFlowsave = () => {
+  let stringArray = '';
+  if(datacontent.value === '3'){
+    stringArray = convertToStringArray([],ADflowyouhuatable.value);
+  }else if(datacontent.value === '4'){
+    stringArray = convertToStringArray([],Xfoilyouhuatable.value);
+  }
   const params = {
     transCode: "MDO0053",
-    paramstr: convertToStringArray([],Xfoilyouhuatable.value),
-  };
-  request(params).then((res) => {
-    ElMessage({
-        message: res.returnMsg,
-        type: 'success',
-      })
-  })
-  .catch((err) => {
-      ElMessage.error(err.returnMsg)
-  })
-}
-
-const dataFlowsave2 = () => {
-  console.log('ADflowyouhuatable:',ADflowyouhuatable.value);
-  const params = {
-    transCode: "MDO0053",
-    paramstr: convertToStringArray([],ADflowyouhuatable.value),
+    paramstr: stringArray,
   };
   request(params).then((res) => {
     ElMessage({
-        message: res.returnMsg,
+        message: '数据流保存成功',
         type: 'success',
       })
   })
   .catch((err) => {
-      ElMessage.error(err.returnMsg)
+      ElMessage.error('数据流保存失败')
   })
 }
 
@@ -819,11 +810,6 @@ const convertToStringArray = (result, Data) => {
   return result;
 }
 
-
-function logEvent(name, event) {
-  console.log(2222)
-}
-
 // 右键更改名字
 // const onContextMenu = (e) => {
 //       e.preventDefault();  // 阻止浏览器默认的右键菜单
@@ -1159,6 +1145,12 @@ function toggleDarkMode() {
 
 
 }
+
+// 禁用右键菜单的函数
+const onNodeContextMenu1 = (event) => {
+  event.preventDefault();
+};
+
 onMounted(() => {
   setTimeout(function() {
     getroter();
@@ -1176,6 +1168,8 @@ onMounted(() => {
     });
   }
 
+  document.addEventListener('contextmenu', onNodeContextMenu1);
+
   emitter.on("xfidFromxfoil", handleXfid);
   emitter.on("adidFromadflow", handleAdid);
 });
@@ -1197,6 +1191,10 @@ const cleanEdgeselect = () => {
   
 } 
 
+// 在组件销毁前移除右键菜单禁用
+onBeforeUnmount(() => {
+  document.removeEventListener('contextmenu', onNodeContextMenu1);
+});
 
 onUnmounted(() => {
   emitter.off('child2Data');