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/index.vue | 4 +- src/views/model/mpk/project/ProjectForm.vue | 9 +++- src/views/model/mpk/project/ProjectPackageHistory.vue | 34 ++++++++++++++-- src/views/model/mpk/file/MpkGeneratorHistory.vue | 4 +- src/views/data/ind/item/index.vue | 2 src/views/model/mpk/file/index.vue | 4 +- src/api/model/mpk/mpk.ts | 4 ++ src/views/model/mpk/icon/index.vue | 6 +- 8 files changed, 49 insertions(+), 18 deletions(-) diff --git a/src/api/model/mpk/mpk.ts b/src/api/model/mpk/mpk.ts index d522b30..8ed80db 100644 --- a/src/api/model/mpk/mpk.ts +++ b/src/api/model/mpk/mpk.ts @@ -45,3 +45,7 @@ export const list = () => { return request.get({ url: '/model/mpk/file/list'}) } + +export const publish = (params) => { + return request.post({ url: '/model/mpk/file/publish', data: params}) +} diff --git a/src/views/data/ind/item/index.vue b/src/views/data/ind/item/index.vue index e80c331..b56ed54 100644 --- a/src/views/data/ind/item/index.vue +++ b/src/views/data/ind/item/index.vue @@ -114,7 +114,7 @@ import * as ItemApi from '@/api/data/ind/item/item' import * as CategoryApi from "@/api/data/ind/category"; - defineOptions({ name: 'IndDataSet' }) + defineOptions({ name: 'IndItem' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 diff --git a/src/views/model/mpk/file/MpkGeneratorHistory.vue b/src/views/model/mpk/file/MpkGeneratorHistory.vue index 35cdee8..bd10a0e 100644 --- a/src/views/model/mpk/file/MpkGeneratorHistory.vue +++ b/src/views/model/mpk/file/MpkGeneratorHistory.vue @@ -47,7 +47,7 @@ </el-table> <!-- 分页 --> <Pagination - v-model:limit="queryParams.pageSize" + v-model:limit="queryParams.limit" v-model:page="queryParams.page" :total="total" @pagination="getList" @@ -72,7 +72,7 @@ const list = ref([]) // 字典表格数据 const queryParams = reactive({ page: 1, - pageSize: 10, + limit: 10, mdkId: '', startTime: undefined, endTime: undefined, diff --git a/src/views/model/mpk/file/index.vue b/src/views/model/mpk/file/index.vue index ef9ef10..8e98f7f 100644 --- a/src/views/model/mpk/file/index.vue +++ b/src/views/model/mpk/file/index.vue @@ -108,7 +108,7 @@ </el-table> <!-- 分页 --> <Pagination - v-model:limit="queryParams.pageSize" + v-model:limit="queryParams.limit" v-model:page="queryParams.page" :total="total" @pagination="getList" @@ -146,7 +146,7 @@ const list = ref([]) // 字典表格数据 const queryParams = reactive({ page: 1, - pageSize: 10, + limit: 10, pyName: '', label: '' }) diff --git a/src/views/model/mpk/icon/index.vue b/src/views/model/mpk/icon/index.vue index ca3c041..8d0f95f 100644 --- a/src/views/model/mpk/icon/index.vue +++ b/src/views/model/mpk/icon/index.vue @@ -75,7 +75,7 @@ <!-- 分页 --> <Pagination v-model:limit="queryParams.pageSize" - v-model:page="queryParams.page" + v-model:page="queryParams.pageNo" :total="total" @pagination="getList" /> @@ -98,7 +98,7 @@ const total = ref(0) // 列表的总页数 const list = ref([]) // 字典表格数据 const queryParams = reactive({ - page: 1, + pageNo: 1, pageSize: 10, iconName: '' }) @@ -122,7 +122,7 @@ /** 重置按钮操作 */ const resetQuery = () => { - queryParams.page = 1 + queryParams.pageNo = 1 queryFormRef.value.resetFields() handleQuery() } diff --git a/src/views/model/mpk/project/ProjectForm.vue b/src/views/model/mpk/project/ProjectForm.vue index 3f8f5be..d6937f7 100644 --- a/src/views/model/mpk/project/ProjectForm.vue +++ b/src/views/model/mpk/project/ProjectForm.vue @@ -56,6 +56,7 @@ id: undefined, projectName: undefined, projectCode: undefined, + models: undefined, }) @@ -106,9 +107,11 @@ const data = { ...formData.value } - data.models = data.models.map(e => { - return {id: e} - }) + if (data.models && data.models.length > 0) { + data.models = data.models.map(e => { + return {id: e} + }) + } if (formType.value === 'create') { await ProjectApi.createProject(data) message.success(t('common.createSuccess')) 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() diff --git a/src/views/model/mpk/project/index.vue b/src/views/model/mpk/project/index.vue index eb1aa63..e7d90ba 100644 --- a/src/views/model/mpk/project/index.vue +++ b/src/views/model/mpk/project/index.vue @@ -115,7 +115,7 @@ </el-table> <!-- 分页 --> <Pagination - v-model:limit="queryParams.pageSize" + v-model:limit="queryParams.limit" v-model:page="queryParams.page" :total="total" @pagination="getList" @@ -144,7 +144,7 @@ const list = ref([]) // 字典表格数据 const queryParams = reactive({ page: 1, - pageSize: 10, + limit: 10, projectName: '', projectCode: '' }) -- Gitblit v1.9.3