From ebefc6c7612ef539b4c4f51305015f3a44fc26c8 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期一, 14 十月 2024 16:30:24 +0800
Subject: [PATCH] 模型运行

---
 src/views/model/mpk/file/MpkRun.vue |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/views/model/mpk/file/MpkRun.vue b/src/views/model/mpk/file/MpkRun.vue
index 3f44537..6b0111b 100644
--- a/src/views/model/mpk/file/MpkRun.vue
+++ b/src/views/model/mpk/file/MpkRun.vue
@@ -141,6 +141,16 @@
      formData.datas[i] = '[[]]'
     }
     hasModel.value = mpk.modelMethods[0].model === 1
+
+    // 回显参数
+    if (mpk.modelMethods[0].methodSettings && mpk.modelMethods[0].methodSettings.length > 0) {
+      formData.modelSettings = mpk.modelMethods[0].methodSettings.map(e => {
+        return {
+          settingKey: e.settingKey,
+          settingValue: e.value
+        }
+      })
+    }
   }
   defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
@@ -164,10 +174,22 @@
   }
   const methodChange = function (value) {
     formData.datas = []
-    for (let i = 0 ; i < methodList.value.find(e => e.methodName === value)?.dataLength ; i++) {
+    var method = methodList.value.find(e => e.methodName === value);
+    for (let i = 0 ; i < method?.dataLength ; i++) {
       formData.datas[i] = '[[]]'
     }
-    hasModel.value = methodList.value.find(e => e.methodName === value)?.model === 1
+    hasModel.value = method?.model === 1
+    // 回显参数
+    if (method.methodSettings && method.methodSettings.length > 0) {
+      formData.modelSettings = method.methodSettings.map(e => {
+        return {
+          settingKey: e.settingKey,
+          settingValue: e.value
+        }
+      })
+    }else {
+      formData.modelSettings = []
+    }
   }
 
   const fileList = ref([]) // 文件列表

--
Gitblit v1.9.3