From 6e78d5ae3ccf8c592ba6c698c2a6e90587d7a7f6 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 12 十二月 2024 13:20:55 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-ui-vue3

---
 src/views/model/mpk/project/index.vue |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/views/model/mpk/project/index.vue b/src/views/model/mpk/project/index.vue
index e7d90ba..7bc116d 100644
--- a/src/views/model/mpk/project/index.vue
+++ b/src/views/model/mpk/project/index.vue
@@ -133,6 +133,7 @@
   import ProjectForm from './ProjectForm.vue'
   import ProjectPackage from './ProjectPackage.vue'
   import RelevanceModel from './ProjectPackageModelDialog.vue'
+  import * as projectApi from "@/api/model/mpk/project";
 
   defineOptions({name: 'MpkProject'})
 
@@ -165,7 +166,7 @@
   const handleCommand = (command: string, row) => {
     switch (command) {
       case 'packageModel':
-        packageModel(row.id, row.projectName, row.projectCode, row.models)
+        packageModel(row.id, row.projectName, row.projectCode)
         break
       default:
         break
@@ -174,13 +175,14 @@
 
   //打包
   const projectPackageRef = ref();
-  const packageModel = (projectId, projectName, projectCode, models) => {
-    let ids = models.map(e => e.id);
-    if (ids && ids.length > 0) {
-      projectPackageRef.value.open(projectId, projectName, projectCode, ids.join(","));
-    } else {
+  const packageModel = async (projectId, projectName, projectCode) => {
+    //校验是否关联模型
+    const data = await projectApi.getProjectModel({page: 1, pageSize: 1, projectId: projectId})
+    if (data.total === 0) {
       message.error("请先为项目添加模型!")
+      return
     }
+    projectPackageRef.value.open(projectId, projectName, projectCode);
   }
 
   /** 搜索按钮操作 */

--
Gitblit v1.9.3