From de2be8bb72ce7afb089519ea6c00bd1283a582d5 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期五, 11 十月 2024 08:49:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/model/mpk/project/ProjectPackageHistory.vue |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/views/model/mpk/project/ProjectPackageHistory.vue b/src/views/model/mpk/project/ProjectPackageHistory.vue
index b276e16..94a0451 100644
--- a/src/views/model/mpk/project/ProjectPackageHistory.vue
+++ b/src/views/model/mpk/project/ProjectPackageHistory.vue
@@ -67,6 +67,14 @@
             <Icon icon="ep:link"/>
             查看关联模型
           </el-button>
+          <el-button
+            link
+            type="primary"
+            @click="publish(scope.row.id,scope.row.version)"
+          >
+            <Icon icon="ep:upload"/>
+            发布
+          </el-button>
         </template>
       </el-table-column>
 
@@ -74,8 +82,8 @@
     <!-- 分页 -->
     <Pagination
       :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
+      v-model:page="queryParams.page"
+      v-model:limit="queryParams.limit"
       @pagination="getList"
     />
   </ContentWrap>
@@ -88,6 +96,7 @@
   import * as ProjectApi from '@/api/model/mpk/project'
   import {dateFormatter} from '@/utils/formatTime'
   import PackageModel from './ProjectPackageModelDialog.vue'
+  import * as MpkApi from "@/api/model/mpk/mpk";
 
   defineOptions({name: 'ProjectPackageHistory'})
 
@@ -99,8 +108,8 @@
   const total = ref(0) // 列表的总页数
   const list = ref([]) // 列表的数据
   const queryParams = reactive({
-    pageNo: 1,
-    pageSize: 10,
+    page: 1,
+    limit: 10,
     projectId: route.params.projectId,
     startTime: undefined,
     endTime: undefined,
@@ -120,9 +129,13 @@
     }
   }
 
+  watch(() => queryParams.projectId, (newVal, oldVal) => {
+    handleQuery()
+  })
+
   /** 搜索按钮操作 */
   const handleQuery = () => {
-    queryParams.pageNo = 1
+    queryParams.page = 1
     getList()
   }
 
@@ -146,6 +159,17 @@
     packageModelRef.value.open('package',id)
   }
 
+  // 发布
+  const publish = async (historyId,version) => {
+    // 发布的二次确认
+    await message.confirm('确认发布 ' + projectList.value.find(e => e.id === queryParams.projectId).projectName + '【' + version + '】')
+
+    // 发布
+    await MpkApi.publish({historyId,projectId: queryParams.projectId})
+
+    message.success('发布成功');
+  }
+
   /** 初始化 **/
   onMounted(async () => {
     await getList()

--
Gitblit v1.9.3