فهرست منبع

418python、mathfunc修改

tangjunhao 4 ماه پیش
والد
کامیت
fb6037f661

BIN
src/assets/img/jiegoucanshu.png


+ 1 - 1
src/components/PythonEditor/index.vue

@@ -55,7 +55,7 @@ onMounted(() => {
       emit('change', getEditorValue())
     })
 
-    // console.log('[MonacoEdit]初始化完成')
+    console.log('[MonacoEdit]初始化完成')
   }
 
   // 使用 ResizeObserver 监听尺寸变化

+ 15 - 2
src/views/home.vue

@@ -2624,6 +2624,7 @@ const intxfoiladflow = (nowid) => {
 // Python窗口初始化
 const initPython = (nowid) => {
   console.log('Pythonchushihua');
+  pythoneditorshow.value = true; // 显示编辑器
   pythonwid.value = nowid;
   const param = {
     transCode: 'MDO0036',
@@ -2638,7 +2639,7 @@ const initPython = (nowid) => {
     if (res.ptython) {
       console.log('Python内容:', res.ptython);
       textarea1.value = res.ptython;
-      pythoneditorshow.value = true; // 显示编辑器
+      
     }
   }).catch((err) => {
     console.error('Python内容初始化失败');
@@ -2648,6 +2649,7 @@ const initPython = (nowid) => {
 // Python确认按钮提交
 const pythonSubmit = () => {
   console.log('Python确认按钮提交');
+  pythoneditorshow.value = false; // 隐藏编辑器
   const param = {
     transCode:'MDO0037',
     pid: pid.value,
@@ -2664,7 +2666,18 @@ const pythonSubmit = () => {
   });
 }
 
-let newtextarea1 = ref('')
+let newtextarea1 = ref(`import os
+import numpy as np
+from surromdao.solver import BaseSolver
+
+class Branin(BaseSolver):
+    def __init__(self, filename=os.path):
+        super().__init__(filename)
+    
+    def compute(self, xdict):
+        x = np.zeros(2)
+        # x[0] = xdict['x1']
+        # x[1] = xdict['x2']`);
 // python处理编辑器内容变化的方法
 const handleEditorChange = (value) => {
   // console.log('Editor content changed in parent component:', value);

+ 11 - 1
src/views/titlecomponent/MathFunc.vue

@@ -259,7 +259,17 @@ const getmathfuncAssign = (data) => {
   outParams.value = data.outParams;
 }
 
-let newequation = ref();
+let newequation = ref(`import os
+import numpy as np
+from surromdao.solver import BaseSolver
+
+class Branin(BaseSolver):
+    def __init__(self, filename=os.path):
+        super().__init__(filename)
+
+    def compute(self, xdict):
+        x = np.zeros(2)
+        # x[1] = x[2]`);
 let updateEquation = (value) => {
   // console.log('updateEquation:', value);
   newequation.value = value;

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

@@ -8,6 +8,7 @@
         :class="{ active: currentTab2 === index }"
         @click="selectTab2(index)"
       >
+         <img :src="tab.imgSrc" style="width: 22px;"/>
         {{ tab.name }}
       </li>
     </ul>
@@ -219,6 +220,11 @@ import cloudChart from "../threejsView/index.vue" // 云图
 import { request, uploadFile } from "@/utils/request"
 import emitter from "@/utils/emitter"
 
+import meshFile from "@/assets/img/meshFile.png";
+import jiegoucanshu from "@/assets/img/jiegoucanshu.png";
+import configParams from "@/assets/img/configParams.png";
+import analysisParams from "@/assets/img/analysisParams.png";
+
 let fid = ref()
 let formLabelWidth1 = ref(170)
 let formLabelWidth120 = ref(120)
@@ -230,10 +236,10 @@ let wid = ref();
 let tacsid = ref();
 
 let tabslist2= ref([
-  { id: '0', name: '网格文件' },
-  { id: '1', name: '结构参数' },
-  { id: '2', name: '设置参数' },
-  { id: '3', name: '分析参数' },
+  { id: '0', name: '网格文件' ,imgSrc:meshFile},
+  { id: '1', name: '结构参数' ,imgSrc:jiegoucanshu},
+  { id: '2', name: '设置参数' ,imgSrc:configParams},
+  { id: '3', name: '分析参数' ,imgSrc:analysisParams},
 
 ])