Преглед изворни кода

feat(thermal): one-click start dialog gains thermal_mode selector

PlanDetail preflight dialog now lets the engineer pick off/steady/coupled before confirming start; thermal_mode flows to start-simulation API. TaskManager form already had it. vue-tsc 0 errors.
carlin пре 18 часа
родитељ
комит
4f81c091fc
1 измењених фајлова са 25 додато и 1 уклоњено
  1. 25 1
      web/frontend/src/views/PlanDetail.vue

+ 25 - 1
web/frontend/src/views/PlanDetail.vue

@@ -543,6 +543,15 @@
             </el-button>
           </div>
         </div>
+        <el-divider />
+        <div class="thermal-mode-row">
+          <span class="thermal-mode-label">热仿真模式</span>
+          <el-radio-group v-model="thermalMode" size="small">
+            <el-radio value="off">仅电磁(最快)</el-radio>
+            <el-radio value="steady">电磁+稳态热(默认)</el-radio>
+            <el-radio value="coupled">磁热耦合(精算)</el-radio>
+          </el-radio-group>
+        </div>
         <el-alert v-if="!preflight.ok" type="error" :closable="false" style="margin-top: 12px">
           存在未通过的检查项,请先处理后再启动仿真。
         </el-alert>
@@ -1141,6 +1150,9 @@ function preflightMessage(c: any): string {
   }
 }
 
+// P6: task-level thermal mode (off/steady/coupled), chosen at one-click start.
+const thermalMode = ref('steady')
+
 const startSimulation = async () => {
   // Run the pre-flight checklist first; the start button in the dialog is
   // disabled while any check has status 'fail'.
@@ -1160,7 +1172,9 @@ const confirmStartSimulation = async () => {
   showPreflight.value = false
   starting.value = true
   try {
-    await api.post(`/plans/${planId.value}/start-simulation`)
+    await api.post(`/plans/${planId.value}/start-simulation`, {
+      thermal_mode: thermalMode.value,
+    })
     ElMessage.success('仿真已启动')
     isRunning.value = true
     activeTab.value = 'overview'
@@ -1606,6 +1620,16 @@ watch(activeTab, (tab) => {
   flex-direction: column;
   gap: var(--space-2);
 }
+.thermal-mode-row {
+  display: flex;
+  align-items: center;
+  gap: var(--space-3);
+}
+.thermal-mode-label {
+  font-size: 13px;
+  color: var(--color-text-secondary);
+  font-weight: 500;
+}
 .preflight-item {
   display: flex;
   align-items: flex-start;