From eb9e4253e758a727e6b0d91d18ba0148298982a9 Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 2 Nov 2023 10:13:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3&=E9=83=A8=E5=88=86=E7=BB=84=E4=BB=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4&=E6=97=A0=E6=9D=83=E9=99=90=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A0=E9=99=90=E9=87=8D=E5=AE=9A=E5=90=91=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ms-detail-drawer/index.vue | 14 ++- .../src/components/pure/ms-button/index.vue | 4 +- .../components/pure/ms-description/index.vue | 15 ++- .../src/components/pure/ms-tag/ms-tag.vue | 9 +- frontend/src/models/projectManagement/file.ts | 3 +- frontend/src/router/guard/index.ts | 4 +- .../components/fileDetailDrawer.vue | 91 +++++++++++++------ .../fileManagement/components/rightBox.vue | 32 +++++-- 8 files changed, 120 insertions(+), 52 deletions(-) diff --git a/frontend/src/components/business/ms-detail-drawer/index.vue b/frontend/src/components/business/ms-detail-drawer/index.vue index df41f5e6ea..62f3da004c 100644 --- a/frontend/src/components/business/ms-detail-drawer/index.vue +++ b/frontend/src/components/business/ms-detail-drawer/index.vue @@ -129,11 +129,11 @@ // 当前查看的是否是总数据的第一条数据,用当前查看数据的下标是否等于0,且当前页码是否等于1 const activeDetailIsFirst = computed(() => activeDetailIndex.value === 0 && props.pagination?.current === 1); const activeDetailIsLast = computed( - // 当前查看的是否是总数据的最后一条数据,用当前页码*每页条数+当前查看的条数下标,是否等于总条数 + // 当前查看的是否是总数据的最后一条数据,用(当前页码-1)*每页条数+当前查看的条数下标,是否等于总条数 () => activeDetailIndex.value === props.tableData.length - 1 && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - props.pagination!.current * props.pagination!.pageSize + activeDetailIndex.value >= + (props.pagination!.current - 1) * props.pagination!.pageSize + (activeDetailIndex.value + 1) >= // eslint-disable-next-line @typescript-eslint/no-non-null-assertion props.pagination!.total ); @@ -158,6 +158,7 @@ activeDetailId.value = props.tableData[activeDetailIndex.value - 1].id; activeDetailIndex.value -= 1; } + initDetail(); } } @@ -181,13 +182,16 @@ activeDetailId.value = props.tableData[activeDetailIndex.value + 1].id; activeDetailIndex.value += 1; } + initDetail(); } } watch( - () => activeDetailId.value, - () => { - initDetail(); + () => innerVisible.value, + (val) => { + if (val) { + initDetail(); + } } ); diff --git a/frontend/src/components/pure/ms-button/index.vue b/frontend/src/components/pure/ms-button/index.vue index 5b078fa297..0a13eafbf0 100644 --- a/frontend/src/components/pure/ms-button/index.vue +++ b/frontend/src/components/pure/ms-button/index.vue @@ -1,11 +1,12 @@ @@ -15,6 +16,7 @@ type?: 'text' | 'icon' | 'button'; status?: 'primary' | 'danger' | 'secondary'; disabled?: boolean; + loading?: boolean; }>(), { type: 'text', diff --git a/frontend/src/components/pure/ms-description/index.vue b/frontend/src/components/pure/ms-description/index.vue index dbdf9720a0..3090ef0d03 100644 --- a/frontend/src/components/pure/ms-description/index.vue +++ b/frontend/src/components/pure/ms-description/index.vue @@ -22,11 +22,13 @@ diff --git a/frontend/src/models/projectManagement/file.ts b/frontend/src/models/projectManagement/file.ts index 18e89bfb62..fd5e6ea787 100644 --- a/frontend/src/models/projectManagement/file.ts +++ b/frontend/src/models/projectManagement/file.ts @@ -28,6 +28,7 @@ export interface FileDetail extends FileItem { projectId: string; moduleName: string; // 所属模块名 moduleId: string; + storage?: string; // 存储方式 createUser: string; createTime: number; } @@ -43,7 +44,7 @@ export interface UploadFileParams { export interface UpdateFileParams { id: string; name?: string; - tags?: string[]; + tags?: (string | number)[]; description?: string; moduleId?: string; } diff --git a/frontend/src/router/guard/index.ts b/frontend/src/router/guard/index.ts index ca76b5dbde..7f8613d3f9 100644 --- a/frontend/src/router/guard/index.ts +++ b/frontend/src/router/guard/index.ts @@ -28,7 +28,7 @@ function setupPageGuard(router: Router) { } switch (getRouteLevelByKey(to.name as PathMapRoute)) { case MENU_LEVEL[1]: // 组织级别的页面,需要给页面携带上组织 ID - if (!urlOrgId) { + if (urlOrgId === undefined) { to.query = { ...to.query, organizationId: appStore.currentOrgId, @@ -38,7 +38,7 @@ function setupPageGuard(router: Router) { } break; case MENU_LEVEL[2]: // 项目级别的页面,需要给页面携带上组织 ID和项目 ID - if (!urlOrgId && !urlProjectId) { + if (urlOrgId === undefined && urlProjectId === undefined) { to.query = { ...to.query, organizationId: appStore.currentOrgId, diff --git a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue index a69b5052f7..cd628145a4 100644 --- a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue +++ b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue @@ -16,7 +16,7 @@