From 5ddf98c414751049696c34293d10ed63b7acab25 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Mon, 11 Dec 2023 10:43:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E8=AF=A6=E6=83=85=E7=BB=86?= =?UTF-8?q?=E8=8A=82=E5=AE=8C=E5=96=84&=E5=85=B3=E8=81=94=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=A1=B5=E9=9D=A2&=E6=8B=96=E6=8B=BD=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=BB=84=E4=BB=B6=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ms-case-associate/index.vue | 42 ++- .../src/components/pure/ms-drawer/index.vue | 13 +- .../components/pure/ms-upload/fileList.vue | 4 +- .../src/components/pure/ms-upload/index.vue | 8 +- frontend/src/enums/tableEnum.ts | 2 + .../src/models/caseManagement/featureCase.ts | 2 +- .../components/bug-detail-drawer.vue | 2 +- .../components/addStep.vue | 19 +- .../components/caseDetail.vue | 57 ++-- .../components/caseDetailDrawer.vue | 41 ++- .../components/caseTable.vue | 2 +- .../components/caseTemplateDetail.vue | 19 +- .../linkFile/associatedFileDrawer.vue | 273 +++++++++++++++ .../components/linkFile/fileTree.vue | 156 +++++++++ .../components/linkFile/linkFileTable.vue | 313 ++++++++++++++++++ .../components/linkFile/storageList.vue | 169 ++++++++++ .../tabContent/tabCase/tabCaseTable.vue | 172 ++++++++++ .../tabContent/tabChangeHistory.vue | 1 + .../tabContent/tabComment/tabCommentIndex.vue | 22 ++ .../tabContent/tabDemand/addDemandModal.vue | 3 +- .../tabDemand/associatedDemandTable.vue | 25 +- .../tabContent/tabDemand/demand.vue | 154 ++++++++- .../tabDemand/platformDemandDrawer.vue | 136 ++++++++ .../components/tabContent/tabDetail.vue | 84 +++-- .../caseManagementFeature/locale/en-US.ts | 8 + .../caseManagementFeature/locale/zh-CN.ts | 9 + .../case-management/caseReview/caseDetail.vue | 28 +- .../components/serviceList.vue | 9 +- 28 files changed, 1674 insertions(+), 99 deletions(-) create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/linkFile/associatedFileDrawer.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/linkFile/fileTree.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/linkFile/linkFileTable.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/linkFile/storageList.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue create mode 100644 frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/platformDemandDrawer.vue diff --git a/frontend/src/components/business/ms-case-associate/index.vue b/frontend/src/components/business/ms-case-associate/index.vue index c24410dc50..17ceda0a8f 100644 --- a/frontend/src/components/business/ms-case-associate/index.vue +++ b/frontend/src/components/business/ms-case-associate/index.vue @@ -6,9 +6,25 @@ :footer="false" no-content-padding > +
- +
+ + + {{ item }} + +
props.visible, (val) => { diff --git a/frontend/src/components/pure/ms-drawer/index.vue b/frontend/src/components/pure/ms-drawer/index.vue index 0ab971b7f9..56cc413ed6 100644 --- a/frontend/src/components/pure/ms-drawer/index.vue +++ b/frontend/src/components/pure/ms-drawer/index.vue @@ -16,10 +16,15 @@ > diff --git a/frontend/src/components/pure/ms-upload/fileList.vue b/frontend/src/components/pure/ms-upload/fileList.vue index d096501985..7e14563893 100644 --- a/frontend/src/components/pure/ms-upload/fileList.vue +++ b/frontend/src/components/pure/ms-upload/fileList.vue @@ -83,7 +83,7 @@ > {{ t('ms.upload.reUpload') }} - + {{ t(item.deleteContent) || t('ms.upload.delete') }} @@ -128,10 +128,12 @@ showTab?: boolean; // 是否显示tab handleDelete?: (item: MsFileItem) => void; handleReupload?: (item: MsFileItem) => void; + showDelete?: boolean; // 是否展示删除按钮 }>(), { mode: 'remote', showTab: true, + showDelete: true, } ); const emit = defineEmits<{ diff --git a/frontend/src/components/pure/ms-upload/index.vue b/frontend/src/components/pure/ms-upload/index.vue index 4e491e84a4..2f65ea6c10 100644 --- a/frontend/src/components/pure/ms-upload/index.vue +++ b/frontend/src/components/pure/ms-upload/index.vue @@ -139,7 +139,7 @@ const total = ref(''); // 总高度 const other = ref(''); // 被减去高度 - const showDropArea = ref(false); + const showDropArea = ref(!props.isAllScreen); watch( () => props.isAllScreen, @@ -209,8 +209,10 @@ } onMounted(() => { - disableDefaultEvents(); - init(); + if (props.isAllScreen) { + disableDefaultEvents(); + init(); + } }); onBeforeUnmount(() => { diff --git a/frontend/src/enums/tableEnum.ts b/frontend/src/enums/tableEnum.ts index 769aff9f1f..5221537cdb 100644 --- a/frontend/src/enums/tableEnum.ts +++ b/frontend/src/enums/tableEnum.ts @@ -43,6 +43,8 @@ export enum TableKeyEnum { CASE_MANAGEMENT_TAB_REVIEW = 'caseManagementTabCaseReview', CASE_MANAGEMENT_TAB_TEST_PLAN = 'caseManagementTabTestPlan', CASE_MANAGEMENT_TAB_CHANGE_HISTORY = 'caseManagementTabChangeHistory', + CASE_MANAGEMENT_TAB_CASE_TABLE = 'caseManagementTabCaseTable', + CASE_MANAGEMENT_TAB_DEMAND_PLATFORM = 'caseManagementTabDemandPlatformTable', } // 具有特殊功能的列 diff --git a/frontend/src/models/caseManagement/featureCase.ts b/frontend/src/models/caseManagement/featureCase.ts index 4399206a12..2ae8a93d56 100644 --- a/frontend/src/models/caseManagement/featureCase.ts +++ b/frontend/src/models/caseManagement/featureCase.ts @@ -159,7 +159,7 @@ export interface CreateCase { moduleId: string; versionId: string; tags: any; - customFields: Record; // 自定义字段集合 + customFields: CustomAttributes[] | Record; // 自定义字段集合 relateFileMetaIds: string[]; // 关联文件ID集合 [key: string]: any; } diff --git a/frontend/src/views/bug-management/components/bug-detail-drawer.vue b/frontend/src/views/bug-management/components/bug-detail-drawer.vue index 61a403c790..5d1da852ba 100644 --- a/frontend/src/views/bug-management/components/bug-detail-drawer.vue +++ b/frontend/src/views/bug-management/components/bug-detail-drawer.vue @@ -193,7 +193,7 @@ function loadedCase(detail: CaseManagementTable) { detailInfo.value = { ...detail }; - customFields.value = detailInfo.value.customFields; + customFields.value = detailInfo.value.customFields as CustomAttributes[]; } const moduleName = computed(() => { diff --git a/frontend/src/views/case-management/caseManagementFeature/components/addStep.vue b/frontend/src/views/case-management/caseManagementFeature/components/addStep.vue index 8f505300eb..c8b1a6f382 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/addStep.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/addStep.vue @@ -54,7 +54,7 @@ /> - + @@ -181,6 +181,7 @@ // 删除步骤 function deleteStep(record: StepList) { stepData.value = stepData.value.filter((item: any) => item.id !== record.id); + setProps({ data: stepData.value }); } // 步骤之前插入步骤 @@ -240,7 +241,7 @@ // 编辑步骤 function edit(record: StepList, type: string) { - if (!props.isDisabled) return; + if (props.isDisabled) return; if (type === 'step') { record.showStep = true; } else { @@ -250,7 +251,7 @@ // 失去焦点回调 function blurHandler(record: StepList, type: string) { - if (!props.isDisabled) return; + if (props.isDisabled) return; if (type === 'step') { record.showStep = false; } else { @@ -260,9 +261,7 @@ const tableRef = ref | null>(null); watchEffect(() => { - stepData.value = props.stepList; - setProps({ data: stepData.value }); - if (!props.isDisabled) { + if (props.isDisabled) { tableRef.value?.initColumn(templateFieldColumns.value.slice(0, templateFieldColumns.value.length - 1)); } else { tableRef.value?.initColumn(templateFieldColumns.value); @@ -273,10 +272,18 @@ () => stepData.value, (val) => { emit('update:stepList', val); + setProps({ data: stepData.value }); }, { deep: true } ); + watch( + () => props.stepList, + () => { + stepData.value = props.stepList; + } + ); + onMounted(() => { setProps({ data: stepData.value }); }); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseDetail.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseDetail.vue index 917bd082a1..41f8b55fc2 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseDetail.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseDetail.vue @@ -7,14 +7,21 @@ @save="saveHandler" @save-and-continue="saveHandler(true)" > - + @@ -49,22 +56,16 @@ fileList: [], }); - const versionOptions = ref([ - { - id: '1001', - name: '模板01', - }, - ]); - const title = ref(''); const loading = ref(false); const isEdit = computed(() => !!route.query.id); + const isFormReviewCase = computed(() => route.query.reviewId); const isContinueFlag = ref(false); const isShowTip = ref(true); const createSuccessId = ref(''); - async function save() { + async function save(isReview: boolean) { try { loading.value = true; if (route.params.mode === 'edit') { @@ -72,10 +73,26 @@ Message.success(t('caseManagement.featureCase.editSuccess')); } else { const res = await createCaseRequest(caseDetailInfo.value); + if (isReview) { + // TODO + // 创建并关联接口 + } createSuccessId.value = res.data.id; Message.success(route.params.mode === 'copy' ? t('ms.description.copySuccess') : t('common.addSuccess')); } - router.push({ name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, query: { ...route.query } }); + if (isReview) { + router.push({ + name: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL, + query: { + id: route.query.reviewId, + organizationId: route.query.organizationId, + projectId: route.query.projectId, + }, + }); + } else { + router.push({ name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, query: { ...route.query } }); + } + featureCaseStore.setIsAlreadySuccess(true); isShowTip.value = !getIsVisited(); if (isShowTip.value && !route.query.id) { @@ -97,7 +114,7 @@ const caseModuleDetailRef = ref(); // 保存 - function saveHandler(isContinue = false) { + function saveHandler(isContinue = false, isReview = false) { const { caseFormRef, formRef, fApi } = caseModuleDetailRef.value; isContinueFlag.value = isContinue; caseFormRef?.validate().then((res: any) => { @@ -106,7 +123,7 @@ if (valid === true) { formRef?.validate().then((result: any) => { if (!result) { - return save(); + return save(isReview); } }); } @@ -115,6 +132,9 @@ return scrollIntoView(document.querySelector('.arco-form-item-message'), { block: 'center' }); }); } + function cancelHandler() { + router.back(); + } watchEffect(() => { if (route.params.mode === 'edit') { @@ -124,7 +144,6 @@ } else { title.value = t('caseManagement.featureCase.creatingCase'); } - const gatewayAddress = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`; }); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue index e3fd9001cf..ed56d2ccce 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue @@ -107,12 +107,19 @@ >
- + + +
@@ -169,8 +176,10 @@ import MsDetailDrawer from '@/components/business/ms-detail-drawer/index.vue'; import SettingDrawer from './tabContent/settingDrawer.vue'; import TabDefect from './tabContent/tabBug/tabDefect.vue'; + import TabCaseTable from './tabContent/tabCase/tabCaseTable.vue'; import TabCaseReview from './tabContent/tabCaseReview.vue'; import TabChangeHistory from './tabContent/tabChangeHistory.vue'; + import TabComment from './tabContent/tabComment/tabCommentIndex.vue'; import TabDemand from './tabContent/tabDemand/demand.vue'; import TabDependency from './tabContent/tabDependency/tabDependency.vue'; import TabDetail from './tabContent/tabDetail.vue'; @@ -184,7 +193,12 @@ import useUserStore from '@/store/modules/user'; import { characterLimit, findNodeByKey } from '@/utils'; - import type { CaseManagementTable, CustomAttributes, TabItemType } from '@/models/caseManagement/featureCase'; + import type { + CaseManagementTable, + CreateCase, + CustomAttributes, + TabItemType, + } from '@/models/caseManagement/featureCase'; import { FormCreateKeyEnum } from '@/enums/formCreateEnum'; import { CaseManagementRouteEnum } from '@/enums/routeEnum'; @@ -237,13 +251,30 @@ break; } } + const initDetail: CreateCase = { + projectId: '', + templateId: '', + name: '', + prerequisite: '', // prerequisite + caseEditType: '', // 编辑模式:步骤模式/文本模式 + steps: '', + textDescription: '', + expectedResult: '', // 预期结果 + description: '', + publicCase: false, // 是否公共用例 + moduleId: '', + versionId: '', + tags: [], + customFields: [], // 自定义字段集合 + relateFileMetaIds: [], // 关联文件ID集合 + }; - const detailInfo = ref>({}); + const detailInfo = ref({ ...initDetail }); const customFields = ref([]); const caseLevels = ref(0); - function loadedCase(detail: CaseManagementTable) { + function loadedCase(detail: CreateCase) { detailInfo.value = { ...detail }; - customFields.value = detailInfo.value.customFields; + customFields.value = detailInfo.value.customFields as CustomAttributes[]; const caseLevelsValue = customFields.value.find((item) => item.fieldName === '用例等级')?.defaultValue; if (caseLevelsValue) { caseLevels.value = JSON.parse(caseLevelsValue).replaceAll('P', '') * 1; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue index cfc2b70aac..960d350115 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue @@ -804,7 +804,7 @@ activeCaseIndex.value = index; } - // 地址栏携带 id,自动打开资源池详情抽屉 + // 地址栏携带 id,自动打开用例详情抽屉 onMounted(() => { if (route.query.id) { showCaseDetail(route.query.id as string, 0); diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTemplateDetail.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTemplateDetail.vue index bae4d1ea99..256b678529 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseTemplateDetail.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTemplateDetail.vue @@ -45,7 +45,7 @@
- +
@@ -200,7 +200,13 @@ @change="handleChange" /> - + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/linkFile/fileTree.vue b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/fileTree.vue new file mode 100644 index 0000000000..3cf5a29d06 --- /dev/null +++ b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/fileTree.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/linkFile/linkFileTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/linkFileTable.vue new file mode 100644 index 0000000000..bc1a65ac79 --- /dev/null +++ b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/linkFileTable.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/linkFile/storageList.vue b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/storageList.vue new file mode 100644 index 0000000000..08f23dfaee --- /dev/null +++ b/frontend/src/views/case-management/caseManagementFeature/components/linkFile/storageList.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue new file mode 100644 index 0000000000..519ba3e384 --- /dev/null +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabCase/tabCaseTable.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue index 1a3d6afa22..c95e61099c 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabChangeHistory.vue @@ -76,6 +76,7 @@ import type { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; import MsFormItemSub from '@/components/business/ms-form-item-sub/index.vue'; + import MsRemoveButton from '@/components/business/ms-remove-button/MsRemoveButton.vue'; import { getRecycleListRequest } from '@/api/modules/case-management/featureCase'; import { useI18n } from '@/hooks/useI18n'; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue new file mode 100644 index 0000000000..a6cca8af8e --- /dev/null +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/addDemandModal.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/addDemandModal.vue index 761546fe9d..59457f3ff3 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/addDemandModal.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDemand/addDemandModal.vue @@ -43,7 +43,7 @@ @@ -169,21 +182,24 @@ import MsFileList from '@/components/pure/ms-upload/fileList.vue'; import type { MsFileItem } from '@/components/pure/ms-upload/types'; import AddStep from '../addStep.vue'; + import LinkFileDrawer from '../linkFile/associatedFileDrawer.vue'; import { deleteFileOrCancelAssociation, downloadFileRequest, + getAssociatedFileListUrl, transferFileRequest, updateCaseRequest, uploadOrAssociationFile, } from '@/api/modules/case-management/featureCase'; + import { getModules, getModulesCount } from '@/api/modules/project-management/fileManagement'; import { useI18n } from '@/hooks/useI18n'; import useAppStore from '@/store/modules/app'; import useFormCreateStore from '@/store/modules/form-create/form-create'; import { downloadByteFile, getGenerateId } from '@/utils'; import { scrollIntoView } from '@/utils/dom'; - import type { StepList } from '@/models/caseManagement/featureCase'; + import type { AssociatedList, CreateCase, StepList } from '@/models/caseManagement/featureCase'; import { FormCreateKeyEnum } from '@/enums/formCreateEnum'; import { convertToFile } from '../utils'; @@ -200,7 +216,7 @@ const props = withDefaults( defineProps<{ - form: Record; + form: CreateCase; allowEdit?: boolean; // 是否允许编辑 }>(), { @@ -516,6 +532,12 @@ } } ); + + // 处理关联文件 + function saveSelectAssociatedFile(fileData: AssociatedList[]) { + const fileResultList = fileData.map((fileInfo) => convertToFile(fileInfo)); + fileList.value.push(...fileResultList); + }