|
@@ -2624,6 +2624,7 @@ const intxfoiladflow = (nowid) => {
|
|
// Python窗口初始化
|
|
// Python窗口初始化
|
|
const initPython = (nowid) => {
|
|
const initPython = (nowid) => {
|
|
console.log('Pythonchushihua');
|
|
console.log('Pythonchushihua');
|
|
|
|
+ pythoneditorshow.value = true; // 显示编辑器
|
|
pythonwid.value = nowid;
|
|
pythonwid.value = nowid;
|
|
const param = {
|
|
const param = {
|
|
transCode: 'MDO0036',
|
|
transCode: 'MDO0036',
|
|
@@ -2638,7 +2639,7 @@ const initPython = (nowid) => {
|
|
if (res.ptython) {
|
|
if (res.ptython) {
|
|
console.log('Python内容:', res.ptython);
|
|
console.log('Python内容:', res.ptython);
|
|
textarea1.value = res.ptython;
|
|
textarea1.value = res.ptython;
|
|
- pythoneditorshow.value = true; // 显示编辑器
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
console.error('Python内容初始化失败');
|
|
console.error('Python内容初始化失败');
|
|
@@ -2648,6 +2649,7 @@ const initPython = (nowid) => {
|
|
// Python确认按钮提交
|
|
// Python确认按钮提交
|
|
const pythonSubmit = () => {
|
|
const pythonSubmit = () => {
|
|
console.log('Python确认按钮提交');
|
|
console.log('Python确认按钮提交');
|
|
|
|
+ pythoneditorshow.value = false; // 隐藏编辑器
|
|
const param = {
|
|
const param = {
|
|
transCode:'MDO0037',
|
|
transCode:'MDO0037',
|
|
pid: pid.value,
|
|
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处理编辑器内容变化的方法
|
|
// python处理编辑器内容变化的方法
|
|
const handleEditorChange = (value) => {
|
|
const handleEditorChange = (value) => {
|
|
// console.log('Editor content changed in parent component:', value);
|
|
// console.log('Editor content changed in parent component:', value);
|