From 6078bcb4f5fdd7782b2f476d47b9299bdabb9389 Mon Sep 17 00:00:00 2001 From: baiqi Date: Fri, 8 Nov 2024 16:19:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0-=E6=88=91=E7=9A=84=E5=88=9B=E5=BB=BA&?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=85=B3=E6=B3=A8=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/workbench.ts | 54 ++++++++++++++++ frontend/src/api/requrls/workbench.ts | 7 +++ .../views/api-test/scenario/detail/index.vue | 2 +- .../workbench/components/apiCaseTable.vue | 22 +++++-- .../views/workbench/components/bugTable.vue | 19 ++++-- .../workbench/components/caseReviewTable.vue | 21 +++++-- .../components/scenarioCaseTable.vue | 16 +++-- .../workbench/components/testCaseTable.vue | 62 ++++++++++++------- .../workbench/components/testPlanTable.vue | 30 ++++++--- .../src/views/workbench/myCreated/index.vue | 54 +++++++++++++--- .../src/views/workbench/myFollowed/index.vue | 53 +++++++++++++--- frontend/src/views/workbench/myToDo/index.vue | 25 ++++++-- 12 files changed, 293 insertions(+), 72 deletions(-) create mode 100644 frontend/src/api/modules/workbench.ts create mode 100644 frontend/src/api/requrls/workbench.ts diff --git a/frontend/src/api/modules/workbench.ts b/frontend/src/api/modules/workbench.ts new file mode 100644 index 0000000000..328c67fa65 --- /dev/null +++ b/frontend/src/api/modules/workbench.ts @@ -0,0 +1,54 @@ +import MSR from '@/api/http/index'; + +import type { ApiCaseDetail } from '@/models/apiTest/management'; +import type { ApiScenarioTableItem } from '@/models/apiTest/scenario'; +import type { BugListItem } from '@/models/bug-management'; +import type { ReviewItem } from '@/models/caseManagement/caseReview'; +import type { CaseManagementTable } from '@/models/caseManagement/featureCase'; +import type { CommonList, TableQueryParams } from '@/models/common'; +import type { PassRateCountDetail, TestPlanItem } from '@/models/testPlan/testPlan'; + +import { + WorkbenchApiCaseListUrl, + WorkbenchBugListUrl, + WorkbenchCaseListUrl, + WorkbenchReviewListUrl, + WorkbenchScenarioListUrl, + WorkbenchTestPlanListUrl, + WorkbenchTestPlanStatisticUrl, +} from '../requrls/workbench'; + +// 我的-场景列表 +export function workbenchScenarioList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchScenarioListUrl, data }); +} + +// 我的-用例评审列表 +export function workbenchReviewList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchReviewListUrl, data }); +} + +// 我的-测试计划列表 +export function workbenchTestPlanList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchTestPlanListUrl, data }); +} + +// 我的-测试计划统计 +export function workbenchTestPlanStatistic(data: string[]) { + return MSR.post({ url: WorkbenchTestPlanStatisticUrl, data }); +} + +// 我的-用例列表 +export function workbenchCaseList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchCaseListUrl, data }); +} + +// 我的-缺陷列表 +export function workbenchBugList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchBugListUrl, data }); +} + +// 我的-接口用例列表 +export function workbenchApiCaseList(data: TableQueryParams) { + return MSR.post>({ url: WorkbenchApiCaseListUrl, data }); +} diff --git a/frontend/src/api/requrls/workbench.ts b/frontend/src/api/requrls/workbench.ts new file mode 100644 index 0000000000..0b2b9f0f77 --- /dev/null +++ b/frontend/src/api/requrls/workbench.ts @@ -0,0 +1,7 @@ +export const WorkbenchScenarioListUrl = '/dashboard/my/scenario/page'; // 工作台-我的-场景列表 +export const WorkbenchReviewListUrl = '/dashboard/my/review/page'; // 工作台-我的-用例评审列表 +export const WorkbenchTestPlanListUrl = '/dashboard/my/plan/page'; // 工作台-我的-测试计划列表 +export const WorkbenchTestPlanStatisticUrl = '/dashboard/my/plan/statistics'; // 工作台-我的-测试计划统计 +export const WorkbenchCaseListUrl = '/dashboard/my/functional/page'; // 工作台-我的-用例列表 +export const WorkbenchBugListUrl = '/dashboard/my/bug/page'; // 工作台-我的-缺陷列表 +export const WorkbenchApiCaseListUrl = '/dashboard/my/api/page'; // 工作台-我的-接口用例列表 diff --git a/frontend/src/views/api-test/scenario/detail/index.vue b/frontend/src/views/api-test/scenario/detail/index.vue index d9b09bd0a2..978c42d4e0 100644 --- a/frontend/src/views/api-test/scenario/detail/index.vue +++ b/frontend/src/views/api-test/scenario/detail/index.vue @@ -208,7 +208,7 @@ followLoading.value = true; await followScenario(scenario.value.id || ''); scenario.value.follow = !scenario.value.follow; - Message.success(scenario.value.follow ? t('common.unFollowSuccess') : t('common.followSuccess')); + Message.success(scenario.value.follow ? t('common.followSuccess') : t('common.unFollowSuccess')); emit('updateFollow'); } catch (error) { // eslint-disable-next-line no-console diff --git a/frontend/src/views/workbench/components/apiCaseTable.vue b/frontend/src/views/workbench/components/apiCaseTable.vue index 79c30562ae..3d0259e501 100644 --- a/frontend/src/views/workbench/components/apiCaseTable.vue +++ b/frontend/src/views/workbench/components/apiCaseTable.vue @@ -70,7 +70,7 @@ import caseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; - import { getCasePage } from '@/api/modules/api-test/management'; + import { workbenchApiCaseList } from '@/api/modules/workbench'; import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage'; @@ -84,6 +84,7 @@ const props = defineProps<{ project: string; type: 'my_follow' | 'my_create'; + refreshId: string; }>(); const { t } = useI18n(); @@ -109,7 +110,7 @@ sorter: true, }, fixed: 'left', - width: 150, + width: 100, columnSelectorDisabled: true, }, { @@ -120,6 +121,7 @@ sortDirections: ['ascend', 'descend'], sorter: true, }, + fixed: 'left', width: 180, columnSelectorDisabled: true, }, @@ -146,7 +148,7 @@ options: caseStatusOptions, filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_STATUS, }, - width: 150, + width: 100, showDrag: true, }, { @@ -158,7 +160,7 @@ filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_LAST_EXECUTE_STATUS, }, showInTable: false, - width: 150, + width: 100, showDrag: true, }, { @@ -174,7 +176,8 @@ slotName: 'createName', dataIndex: 'createUser', showInTable: true, - width: 180, + showTooltip: true, + width: 150, }, { title: 'case.tableColumnCreateTime', @@ -183,7 +186,7 @@ width: 180, }, ]; - const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getCasePage, { + const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(workbenchApiCaseList, { columns, scroll: { x: '100%' }, showSetting: false, @@ -219,6 +222,13 @@ loadList(); } + watch( + () => props.refreshId, + () => { + init(); + } + ); + onBeforeMount(() => { init(); }); diff --git a/frontend/src/views/workbench/components/bugTable.vue b/frontend/src/views/workbench/components/bugTable.vue index c144d2bbb4..19a0c63e4f 100644 --- a/frontend/src/views/workbench/components/bugTable.vue +++ b/frontend/src/views/workbench/components/bugTable.vue @@ -43,7 +43,8 @@ import { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; - import { getBugList, getCustomFieldHeader, getCustomOptionHeader } from '@/api/modules/bug-management'; + import { getCustomFieldHeader, getCustomOptionHeader } from '@/api/modules/bug-management'; + import { workbenchBugList } from '@/api/modules/workbench'; import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage'; import useAppStore from '@/store/modules/app'; @@ -57,6 +58,7 @@ const props = defineProps<{ project: string; type: 'my_follow' | 'my_create' | 'my_todo'; + refreshId: string; }>(); const appStore = useAppStore(); @@ -75,7 +77,8 @@ { title: 'bugManagement.bugName', dataIndex: 'title', - width: 250, + width: 180, + fixed: 'left', showTooltip: true, showInTable: true, }, @@ -189,9 +192,10 @@ await initFilterOptions(); const { propsRes, propsEvent, setLoadListParams, loadList } = useTable( - getBugList, + workbenchBugList, { columns, + scroll: { x: '100%' }, selectable: false, noDisable: false, showSetting: false, @@ -219,7 +223,7 @@ }; function handleShowDetail(id: number) { - openNewPage(BugManagementRouteEnum.BUG_MANAGEMENT_DETAIL, { id, pId: props.project }); + openNewPage(BugManagementRouteEnum.BUG_MANAGEMENT_INDEX, { id, pId: props.project }); } function goBugList() { @@ -236,6 +240,13 @@ loadList(); } + watch( + () => props.refreshId, + () => { + init(); + } + ); + onBeforeMount(() => { init(); }); diff --git a/frontend/src/views/workbench/components/caseReviewTable.vue b/frontend/src/views/workbench/components/caseReviewTable.vue index 47c421e475..e1c6a9d903 100644 --- a/frontend/src/views/workbench/components/caseReviewTable.vue +++ b/frontend/src/views/workbench/components/caseReviewTable.vue @@ -68,7 +68,7 @@ import MsStatusTag from '@/components/business/ms-status-tag/index.vue'; import passRateLine from '@/views/case-management/caseReview/components/passRateLine.vue'; - import { getReviewList } from '@/api/modules/case-management/caseReview'; + import { workbenchReviewList } from '@/api/modules/workbench'; import { reviewStatusMap } from '@/config/caseManagement'; import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage'; @@ -80,6 +80,7 @@ const props = defineProps<{ project: string; type: 'my_follow' | 'my_create' | 'my_todo'; + refreshId: string; }>(); const { t } = useI18n(); @@ -104,7 +105,6 @@ sortDirections: ['ascend', 'descend'], sorter: true, }, - showTooltip: true, width: 100, }, { @@ -114,8 +114,9 @@ sortDirections: ['ascend', 'descend'], sorter: true, }, + fixed: 'left', showTooltip: true, - width: 200, + width: 180, }, { title: 'caseManagement.caseReview.status', @@ -126,7 +127,7 @@ filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_REVIEW_STATUS, }, showDrag: true, - width: 150, + width: 100, }, { title: 'caseManagement.caseReview.passRate', @@ -139,7 +140,7 @@ title: 'caseManagement.caseReview.caseCount', dataIndex: 'caseCount', showDrag: true, - width: 100, + width: 80, }, { title: 'caseManagement.caseReview.type', @@ -155,8 +156,9 @@ }, ]; - const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getReviewList, { + const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(workbenchReviewList, { columns, + scroll: { x: '100%' }, showSetting: false, selectable: false, showSelectAll: false, @@ -181,6 +183,13 @@ loadList(); } + watch( + () => props.refreshId, + () => { + init(); + } + ); + onBeforeMount(() => { init(); }); diff --git a/frontend/src/views/workbench/components/scenarioCaseTable.vue b/frontend/src/views/workbench/components/scenarioCaseTable.vue index 878d550a88..c9105029c8 100644 --- a/frontend/src/views/workbench/components/scenarioCaseTable.vue +++ b/frontend/src/views/workbench/components/scenarioCaseTable.vue @@ -76,7 +76,7 @@ import caseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; - import { getScenarioPage } from '@/api/modules/api-test/scenario'; + import { workbenchScenarioList } from '@/api/modules/workbench'; import { useI18n } from '@/hooks/useI18n'; import useOpenNewPage from '@/hooks/useOpenNewPage'; import { characterLimit } from '@/utils'; @@ -92,6 +92,7 @@ const props = defineProps<{ project: string; type: 'my_follow' | 'my_create'; + refreshId: string; }>(); const { t } = useI18n(); @@ -127,8 +128,7 @@ sorter: true, }, fixed: 'left', - width: 140, - showTooltip: false, + width: 100, columnSelectorDisabled: true, }, { @@ -139,6 +139,7 @@ sortDirections: ['ascend', 'descend'], sorter: true, }, + fixed: 'left', width: 134, showTooltip: true, columnSelectorDisabled: true, @@ -214,7 +215,7 @@ }, ]; const { propsRes, propsEvent, loadList, setLoadListParams } = useTable( - getScenarioPage, + workbenchScenarioList, { columns, scroll: { x: '100%' }, @@ -258,6 +259,13 @@ loadList(); } + watch( + () => props.refreshId, + () => { + init(); + } + ); + onBeforeMount(() => { init(); }); diff --git a/frontend/src/views/workbench/components/testCaseTable.vue b/frontend/src/views/workbench/components/testCaseTable.vue index a5844fc9aa..0a0b42248a 100644 --- a/frontend/src/views/workbench/components/testCaseTable.vue +++ b/frontend/src/views/workbench/components/testCaseTable.vue @@ -7,9 +7,11 @@ diff --git a/frontend/src/views/workbench/myCreated/index.vue b/frontend/src/views/workbench/myCreated/index.vue index 0fa3ccec6c..4bcf918703 100644 --- a/frontend/src/views/workbench/myCreated/index.vue +++ b/frontend/src/views/workbench/myCreated/index.vue @@ -1,7 +1,12 @@ @@ -48,6 +84,7 @@ import { useI18n } from '@/hooks/useI18n'; import useAppStore from '@/store/modules/app'; + import { getGenerateId } from '@/utils'; import { FeatureEnum } from '@/enums/workbenchEnum'; @@ -61,6 +98,7 @@ value: key as FeatureEnum, })); const featureAll = ref(true); + const refreshId = ref(''); function handleFeatureAllChange(val: boolean | (string | number | boolean)[]) { features.value = val ? featureOptions.map((item) => item.value) : []; @@ -73,7 +111,7 @@ } function handleRefresh() { - console.log('refresh'); + refreshId.value = getGenerateId(); } diff --git a/frontend/src/views/workbench/myFollowed/index.vue b/frontend/src/views/workbench/myFollowed/index.vue index e2b829bbd8..63503eaa26 100644 --- a/frontend/src/views/workbench/myFollowed/index.vue +++ b/frontend/src/views/workbench/myFollowed/index.vue @@ -1,7 +1,12 @@ @@ -48,6 +83,7 @@ import { useI18n } from '@/hooks/useI18n'; import useAppStore from '@/store/modules/app'; + import { getGenerateId } from '@/utils'; import { FeatureEnum } from '@/enums/workbenchEnum'; @@ -61,6 +97,7 @@ value: key as FeatureEnum, })); const featureAll = ref(true); + const refreshId = ref(''); function handleFeatureAllChange(val: boolean | (string | number | boolean)[]) { features.value = val ? featureOptions.map((item) => item.value) : []; @@ -73,7 +110,7 @@ } function handleRefresh() { - console.log('refresh'); + refreshId.value = getGenerateId(); } diff --git a/frontend/src/views/workbench/myToDo/index.vue b/frontend/src/views/workbench/myToDo/index.vue index 9d18484acf..acbdf81559 100644 --- a/frontend/src/views/workbench/myToDo/index.vue +++ b/frontend/src/views/workbench/myToDo/index.vue @@ -27,9 +27,24 @@ - - - + + + @@ -42,6 +57,7 @@ import { useI18n } from '@/hooks/useI18n'; import useAppStore from '@/store/modules/app'; + import { getGenerateId } from '@/utils'; import { FeatureEnum } from '@/enums/workbenchEnum'; @@ -55,6 +71,7 @@ value: key as FeatureEnum, })); const featureAll = ref(true); + const refreshId = ref(''); function handleFeatureAllChange(val: boolean | (string | number | boolean)[]) { features.value = val ? featureOptions.map((item) => item.value) : []; @@ -67,7 +84,7 @@ } function handleRefresh() { - console.log('refresh'); + refreshId.value = getGenerateId(); }