From d5207d8eaff6188ae0d79c07de17d0b8dbaed65a Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期一, 06 一月 2025 11:45:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/model/mpk/file/MpkRun.vue |   92 +++++++++++++++++++++++++++++----------------
 1 files changed, 59 insertions(+), 33 deletions(-)

diff --git a/src/views/model/mpk/file/MpkRun.vue b/src/views/model/mpk/file/MpkRun.vue
index a99ae2b..2b9039c 100644
--- a/src/views/model/mpk/file/MpkRun.vue
+++ b/src/views/model/mpk/file/MpkRun.vue
@@ -34,28 +34,24 @@
         </el-col>
       </el-row>
       <el-divider content-position="left">模型参数信息</el-divider>
-      <el-row :gutter="20">
-        <el-col :span="2" style="margin-bottom: 10px;margin-left: 20px">
-          <el-button tag="a" :href="staticDir + '/template/模型参数导入模板.xlsx'" download="模型参数导入模板.xlsx" style="text-decoration: none;" type="primary" size="small" link>模板下载</el-button>
-        </el-col>
-        <el-col :span="2" style="margin-bottom: 10px;">
-          <el-upload
-            ref="uploadRef"
-            v-model:file-list="fileList"
-            :show-file-list="false"
-            :action="importUrl"
-            :auto-upload="true"
-            :disabled="formLoading"
-            :before-upload="beforeUpload"
-            :headers="uploadHeaders"
-            :on-error="submitFormError"
-            :on-success="submitFormSuccess"
-            accept=".xlsx"
-          >
-            <el-button type="primary" size="small" link>参数导入</el-button>
-          </el-upload>
-        </el-col>
-      </el-row>
+      <div style="display:flex;flex-direction: row;align-items: center;margin-bottom: 6px">
+        <el-button tag="a" :href="staticDir + '/template/模型参数导入模板.xlsx'" download="模型参数导入模板.xlsx" style="text-decoration: none;" type="primary" size="small" link>模板下载</el-button>
+        <el-upload
+          ref="uploadRef"
+          v-model:file-list="fileList"
+          :show-file-list="false"
+          :action="importUrl"
+          :auto-upload="true"
+          :disabled="formLoading"
+          :before-upload="beforeUpload"
+          :headers="uploadHeaders"
+          :on-error="submitFormError"
+          :on-success="submitFormSuccess"
+          accept=".xlsx"
+        >
+          <el-button type="primary" size="small" link>参数导入</el-button>
+        </el-upload>
+      </div>
       <el-row v-for="(item,index) in datas" :key="index" :gutter="20">
         <el-col :span="24">
           <el-form-item :label="'参数_' + (index)" required style="width: 100%">
@@ -87,22 +83,31 @@
         </el-table-column>
         <el-table-column
           prop=""
+          label="参数名称"
+          align="center">
+          <template #default="scope">
+            <el-input size="small" v-model="scope.row.name" :disabled="true" maxlength="50" clearable />
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop=""
           label="参数value"
           align="center">
           <template #default="scope">
-            <el-input size="small" v-model="scope.row.settingValue" maxlength="50" clearable />
+            <el-input size="small" v-model="scope.row.settingValue" :disabled="scope.row.settingKey === 'pyFile'" maxlength="50" clearable />
           </template>
         </el-table-column>
-        <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100">
-          <template #default="scope">
-            <el-button
-              @click="deleteRow(scope.$index)"
-              key="danger"
-              type="danger"
-              link
-            >删除</el-button>
-          </template>
-        </el-table-column>
+<!--        <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100">-->
+<!--          <template #default="scope">-->
+<!--            <el-button-->
+<!--              @click="deleteRow(scope.$index)"-->
+<!--              key="danger"-->
+<!--              type="danger"-->
+<!--              :disabled="scope.row.settingKey === 'pyFile'"-->
+<!--              link-->
+<!--            >删除</el-button>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
       </el-table>
       <el-divider content-position="left">模型运行结果</el-divider>
       <el-input v-model="modelRunResult" placeholder="" rows="4" type="textarea" />
@@ -171,6 +176,9 @@
     ],
     className: [
       {required: true, message: '全类名不能为空', trigger: 'blur'}
+    ],
+    model: [
+      {required: true, message: 'model不能为空', trigger: 'blur'}
     ]
   })
 
@@ -256,6 +264,24 @@
     if (!formRef) return
     const valid = await formRef.value.validate()
     if (!valid) return
+
+    if (hasModel.value) {
+      debugger
+      if (!formData.model || formData.model === '') {
+        message.error("model为必填项!")
+        return
+      }
+
+      try {
+        JSON.parse(formData.model)
+      } catch (e) {
+        message.error("model参数异常!")
+        return
+      }
+
+    }
+
+
     // 提交请求
     modelRunloading.value = true
     try {

--
Gitblit v1.9.3