From ebc552900444d25b1158bf53d07f24c9ee36cc75 Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期一, 20 一月 2025 14:40:57 +0800
Subject: [PATCH] 预警配置

---
 src/views/model/mpk/file/MpkRun.vue |   27 +++++++++++++++++++++++++--
 1 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 d3ff1c9..104377d 100644
--- a/src/views/model/mpk/file/MpkRun.vue
+++ b/src/views/model/mpk/file/MpkRun.vue
@@ -36,7 +36,7 @@
       <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="/template/模型参数导入模板.xlsx" download="模型参数导入模板.xlsx" style="text-decoration: none;" type="primary" size="small" link>模板下载</el-button>
+          <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
@@ -90,7 +90,7 @@
           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">
@@ -99,6 +99,7 @@
               @click="deleteRow(scope.$index)"
               key="danger"
               type="danger"
+              :disabled="scope.row.settingKey === 'pyFile'"
               link
             >删除</el-button>
           </template>
@@ -116,6 +117,7 @@
   import * as MpkApi from '@/api/model/mpk/mpk'
   import {FormRules} from "element-plus";
   import {getAccessToken, getTenantId} from "@/utils/auth";
+  const staticDir = ref(import.meta.env.VITE_STATIC_DIR)
 
   const { t } = useI18n() // 国际化
   const message = useMessage() // 消息弹窗
@@ -170,6 +172,9 @@
     ],
     className: [
       {required: true, message: '全类名不能为空', trigger: 'blur'}
+    ],
+    model: [
+      {required: true, message: 'model不能为空', trigger: 'blur'}
     ]
   })
 
@@ -255,6 +260,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