From 631da1c7ec58ecea8dc906c019a2ef2867a2081e Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 14 十月 2024 09:10:12 +0800 Subject: [PATCH] 模型运行参数回显 模型方法参数设置bug修复 --- src/views/model/mpk/file/MpkRun.vue | 26 ++++++++++++++++++++++++-- src/views/model/mpk/file/SettingForm.vue | 1 + 2 files changed, 25 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([]) // 文件列表 diff --git a/src/views/model/mpk/file/SettingForm.vue b/src/views/model/mpk/file/SettingForm.vue index 4fb2e44..2ee4f85 100644 --- a/src/views/model/mpk/file/SettingForm.vue +++ b/src/views/model/mpk/file/SettingForm.vue @@ -199,6 +199,7 @@ for (let key in formData.value) { infoRef[key] = formData.value[key]; } + infoRef = undefined; }else { // 新增 methodSettingsRef.push({...formData.value}) -- Gitblit v1.9.3