diff --git a/frontend/src/api/modules/case-management/featureCase.ts b/frontend/src/api/modules/case-management/featureCase.ts index 227a62e75b..40581b168e 100644 --- a/frontend/src/api/modules/case-management/featureCase.ts +++ b/frontend/src/api/modules/case-management/featureCase.ts @@ -1,6 +1,7 @@ import MSR from '@/api/http/index'; import { AddDemandUrl, + AddDependOnRelationUrl, BatchAssociationDemandUrl, BatchCopyCaseUrl, BatchDeleteCaseUrl, @@ -21,12 +22,17 @@ import { DownloadFileUrl, FollowerCaseUrl, GetAssociatedFilePageUrl, + GetAssociationPublicCaseModuleCountUrl, + GetAssociationPublicCasePageUrl, + GetAssociationPublicModuleTreeUrl, GetCaseListUrl, GetCaseModulesCountUrl, GetCaseModuleTreeUrl, GetCommentListUrl, GetDefaultTemplateFieldsUrl, GetDemandListUrl, + GetDependOnPageUrl, + GetDependOnRelationUrl, GetDetailCaseReviewUrl, GetFileIsUpdateUrl, GetRecycleCaseListUrl, @@ -67,8 +73,8 @@ import type { import type { CommonList, MoveModules, TableQueryParams } from '@/models/common'; import type { UserListItem } from '@/models/setting/user'; // 获取模块树 -export function getCaseModuleTree(projectId: string) { - return MSR.get({ url: `${GetCaseModuleTreeUrl}/${projectId}` }); +export function getCaseModuleTree(params: TableQueryParams) { + return MSR.get({ url: `${GetCaseModuleTreeUrl}/${params.projectId}` }); } // 创建模块树 @@ -157,7 +163,7 @@ export function getRecycleModulesCounts(data: CaseModuleQueryParams) { return MSR.post({ url: GetRecycleCaseModulesCountUrl, data }); } // 获取全部用例模块数量 -export function getCaseModulesCounts(data: CaseModuleQueryParams) { +export function getCaseModulesCounts(data: TableQueryParams) { return MSR.post({ url: GetCaseModulesCountUrl, data }); } // 批量恢复回收站用例表 @@ -276,4 +282,31 @@ export function getReviewerList(projectId: string, keyword: string) { return MSR.get({ url: `${GetReviewerListUrl}/${projectId}`, params: { keyword } }); } +// 用例接口用例分页列表 +export function getPublicLinkCaseList(data: TableQueryParams) { + return MSR.post>({ url: GetAssociationPublicCasePageUrl, data }); +} + +// 获取用例详情接口用例模块数量 +export function getPublicLinkCaseModulesCounts(data: TableQueryParams) { + return MSR.post({ url: GetAssociationPublicCaseModuleCountUrl, data }); +} + +// 获取关联用例接口模块树 +export function getPublicLinkModuleTree(data: TableQueryParams) { + return MSR.post({ url: `${GetAssociationPublicModuleTreeUrl}`, data }); +} + +// 获取前后置用例 +export function getDependOnCase(data: TableQueryParams) { + return MSR.post>({ url: `${GetDependOnPageUrl}`, data }); +} +// 用例管理-功能用例-用例详情-前后置关系 +export function getPrepositionRelation(data: TableQueryParams) { + return MSR.post>({ url: `${GetDependOnRelationUrl}`, data }); +} +// 添加前后置关系 +export function addPrepositionRelation(data: TableQueryParams) { + return MSR.post({ url: `${AddDependOnRelationUrl}`, data }); +} export default {}; diff --git a/frontend/src/api/requrls/case-management/featureCase.ts b/frontend/src/api/requrls/case-management/featureCase.ts index d6cd0b4bb3..5afd8acba4 100644 --- a/frontend/src/api/requrls/case-management/featureCase.ts +++ b/frontend/src/api/requrls/case-management/featureCase.ts @@ -102,5 +102,15 @@ export const DeleteCommentItemUrl = '/functional/case/comment/delete'; export const GetDetailCaseReviewUrl = '/functional/case/review/page'; // 获取有权限的评审人 export const GetReviewerListUrl = '/case/review/user-option'; - -export default {}; +// 获取用例详情弹窗关联用例接口用例 +export const GetAssociationPublicCasePageUrl = '/functional/case/test/associate/case/page'; +// 获取接口测试接口模块数量 +export const GetAssociationPublicCaseModuleCountUrl = '/functional/case/test/associate/case/module/count'; +// 获取用例详情接口模块树 +export const GetAssociationPublicModuleTreeUrl = '/functional/case/test/associate/case/module/tree'; +// 获取前后置用例列表 +export const GetDependOnPageUrl = '/functional/case/relationship/page'; +// 用例管理-功能用例-用例详情-前后置关系 +export const GetDependOnRelationUrl = '/functional/case/relationship/relate/page'; +// 添加前后置关系 +export const AddDependOnRelationUrl = '/functional/case/relationship/add'; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/addAttachment.vue b/frontend/src/components/business/ms-add-attachment/index.vue similarity index 100% rename from frontend/src/views/case-management/caseManagementFeature/components/addAttachment.vue rename to frontend/src/components/business/ms-add-attachment/index.vue diff --git a/frontend/src/components/business/ms-case-associate/index.vue b/frontend/src/components/business/ms-case-associate/index.vue index 05239a5639..00315b64ea 100644 --- a/frontend/src/components/business/ms-case-associate/index.vue +++ b/frontend/src/components/business/ms-case-associate/index.vue @@ -5,6 +5,7 @@ :width="1200" :footer="false" no-content-padding + unmount-on-close > diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDependency/preAndPostCaseDrawer.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDependency/preAndPostCaseDrawer.vue index caddb034cd..e7b5be5504 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDependency/preAndPostCaseDrawer.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDependency/preAndPostCaseDrawer.vue @@ -12,14 +12,15 @@
{{ t('caseManagement.featureCase.allCase') }}
-
({{ allFileCount }})
+
({{ modulesCount['all'] }})
@@ -46,7 +51,7 @@
{{ activeFolderName }}
-
({{ activeFolderName }})
+
({{ modulesCount[activeFolder] }})
- + {{ t('caseManagement.featureCase.preCase') }} @@ -26,7 +26,7 @@ >
- + @@ -39,20 +39,7 @@
- - - - - + @@ -65,16 +52,21 @@ import useTable from '@/components/pure/ms-table/useTable'; import PreAndPostCaseDrawer from './preAndPostCaseDrawer.vue'; - import { getRecycleListRequest } from '@/api/modules/case-management/featureCase'; + import { getDependOnCase } from '@/api/modules/case-management/featureCase'; import { useI18n } from '@/hooks/useI18n'; + import { useAppStore } from '@/store'; - import { TableKeyEnum } from '@/enums/tableEnum'; + const appStore = useAppStore(); export type types = 'preposition' | 'postPosition'; + const currentProjectId = computed(() => appStore.currentProjectId); const showType = ref('preposition'); const { t } = useI18n(); const keyword = ref(''); + const props = defineProps<{ + caseId: string; + }>(); const columns: MsTableColumn = [ { @@ -84,7 +76,6 @@ showInTable: true, showTooltip: true, ellipsis: true, - showDrag: false, }, { title: 'caseManagement.featureCase.tableColumnName', @@ -94,7 +85,6 @@ showTooltip: true, width: 300, ellipsis: true, - showDrag: false, }, { title: 'caseManagement.featureCase.tableColumnVersion', @@ -104,7 +94,6 @@ showTooltip: true, width: 300, ellipsis: true, - showDrag: false, }, { title: 'caseManagement.featureCase.tableColumnCreateUser', @@ -114,7 +103,6 @@ showTooltip: true, width: 300, ellipsis: true, - showDrag: false, }, { title: 'caseManagement.featureCase.tableColumnActions', @@ -123,47 +111,29 @@ fixed: 'right', width: 140, showInTable: true, - showDrag: false, }, ]; - const { - propsRes: prePropsRes, - propsEvent: preTableEvent, - loadList: loadPreList, - setLoadListParams: setPreListParams, - } = useTable(getRecycleListRequest, { + const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getDependOnCase, { columns, - tableKey: TableKeyEnum.CASE_MANAGEMENT_TAB_DEPENDENCY_PRE_CASE, - scroll: { x: '100%' }, - heightUsed: 340, - enableDrag: true, - }); - - const { - propsRes: postPropsRes, - propsEvent: postTableEvent, - loadList: loadPostList, - setLoadListParams: setPostListParams, - } = useTable(getRecycleListRequest, { - columns, - tableKey: TableKeyEnum.CASE_MANAGEMENT_TAB_DEPENDENCY_POST_CASE, scroll: { x: '100%' }, heightUsed: 340, + selectable: false, + noDisable: true, + showSetting: false, enableDrag: true, }); // 取消依赖 function cancelDependency(record: any) {} - function getFetch() { - if (showType.value === 'preposition') { - setPreListParams({ keyword: keyword.value }); - loadPreList(); - } else { - setPostListParams({ keyword: keyword.value }); - loadPostList(); - } + function getParams() { + setLoadListParams({ + projectId: currentProjectId.value, + keyword: keyword.value, + type: showType.value === 'preposition' ? 'PRE' : 'POST', + id: props.caseId, + }); } const showDrawer = ref(false); @@ -176,12 +146,16 @@ watch( () => showType.value, - (val) => { - if (val) { - getFetch(); - } + () => { + getParams(); + loadList(); } ); + + onBeforeMount(() => { + getParams(); + loadList(); + }); diff --git a/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue b/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue index d7255eb8ae..f1c2a12794 100644 --- a/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue +++ b/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue @@ -1,16 +1,18 @@