From 0454b0e247c46f733ebfb5b751de6c1b6881605d Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期四, 12 十二月 2024 11:13:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/model/mpk/project/index.vue | 14 ++++++++------ src/api/model/mpk/project.ts | 4 ++-- src/views/model/mpk/project/ProjectPackage.vue | 4 +--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api/model/mpk/project.ts b/src/api/model/mpk/project.ts index 514b05b..fe1b84e 100644 --- a/src/api/model/mpk/project.ts +++ b/src/api/model/mpk/project.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' -export const getPage = async (params: PageParam) => { +export const getPage = async (params) => { return await request.get({ url: '/model/mpk/project/page', params }) } @@ -28,6 +28,6 @@ return request.get({ url: '/model/mpk/project/list'}) } -export const getProjectModel = async (params: PageParam) => { +export const getProjectModel = async (params) => { return await request.get({ url: '/model/mpk/project/getProjectModel', params }) } diff --git a/src/views/model/mpk/project/ProjectPackage.vue b/src/views/model/mpk/project/ProjectPackage.vue index 3034300..8a48684 100644 --- a/src/views/model/mpk/project/ProjectPackage.vue +++ b/src/views/model/mpk/project/ProjectPackage.vue @@ -57,17 +57,15 @@ projectId: undefined, projectName: undefined, projectCode: undefined, - ids: undefined, version: undefined, }) /** 打开弹窗 */ - const open = async (projectId,projectName,projectCode,ids) => { + const open = async (projectId,projectName,projectCode) => { dialogVisible.value = true formData.projectId = projectId formData.projectName = projectName formData.projectCode = projectCode - formData.ids = ids formData.log = undefined formData.version = 'V' } 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