feat(测试计划): 测试规划-关联用例弹窗高级搜索增加所属测试计划查询

--story=1017296 --user=吕梦园
https://www.tapd.cn/55049933/prong/tasks/view/1155049933001017296
This commit is contained in:
teukkk 2024-12-10 14:36:45 +08:00 committed by Craftsman
parent 0af9b6ed6d
commit 270af8ace5
14 changed files with 95 additions and 7 deletions

View File

@ -66,6 +66,7 @@ import {
GetTestPlanDetailUrl,
GetTestPlanExecutorOptionsUrl,
GetTestPlanListUrl,
GetTestPlanListWithoutPageUrl,
GetTestPlanModuleCountUrl,
GetTestPlanModuleUrl,
GetTestPlanUsersUrl,
@ -136,6 +137,7 @@ import type {
TestPlanBaseParams,
TestPlanDetail,
TestPlanItem,
TestPlanWithoutPageItem,
UseCountType,
} from '@/models/testPlan/testPlan';
@ -179,6 +181,11 @@ export function getTestPlanList(data: TableQueryParams) {
return MSR.post<CommonList<TestPlanItem>>({ url: GetTestPlanListUrl, data });
}
// 获取计划列表(无分页)
export function getTestPlanListWithoutPage(projectId: string) {
return MSR.get<TestPlanWithoutPageItem[]>({ url: `${GetTestPlanListWithoutPageUrl}/${projectId}` });
}
// 创建测试计划
export function addTestPlan(data: AddTestPlanParams) {
return MSR.post({ url: AddTestPlanUrl, data });

View File

@ -12,6 +12,8 @@ export const DeleteTestPlanModuleUrl = '/test-plan/module/delete';
export const GetTestPlanModuleCountUrl = '/test-plan/module/count';
// 测试计划列表
export const GetTestPlanListUrl = '/test-plan/page';
// 测试计划列表 (无分页)
export const GetTestPlanListWithoutPageUrl = '/test-plan/test-plan-list';
// 创建测试计划
export const AddTestPlanUrl = '/test-plan/add';
// 功能用例列表

View File

@ -55,6 +55,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { TableData } from '@arco-design/web-vue';
import { type SelectOptionData } from '@arco-design/web-vue';
import { FilterFormItem, FilterResult } from '@/components/pure/ms-advance-filter/type';
import MsButton from '@/components/pure/ms-button/index.vue';
@ -112,6 +113,7 @@
isAdvancedSearchMode?: boolean;
moduleTree: MsTreeNodeData[];
modulesCount: Record<string, any>;
testPlanList: SelectOptionData[];
}>();
const emit = defineEmits<{
@ -367,7 +369,7 @@
{
title: 'case.apiParamsChange',
dataIndex: 'apiChange',
type: FilterType.BOOLEAN,
type: FilterType.SELECT_EQUAL,
selectProps: {
options: [
{ label: t('case.withoutChanges'), value: false },
@ -398,6 +400,14 @@
options: lastReportStatusListOptions.value,
},
},
{
title: 'ms.taskCenter.taskBelongTestPlan',
dataIndex: 'belongTestPlan',
type: FilterType.SELECT_EQUAL,
selectProps: {
options: props.testPlanList,
},
},
{
title: 'case.caseEnvironment',
dataIndex: 'environmentName',

View File

@ -40,6 +40,8 @@
</template>
<script setup lang="ts">
import { type SelectOptionData } from '@arco-design/web-vue';
import { FilterFormItem, FilterResult } from '@/components/pure/ms-advance-filter/type';
import MsButton from '@/components/pure/ms-button/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
@ -89,6 +91,7 @@
protocols: string[];
moduleTree: MsTreeNodeData[];
modulesCount: Record<string, any>;
testPlanList: SelectOptionData[];
}>();
const emit = defineEmits<{
@ -336,6 +339,14 @@
precision: 0,
},
},
{
title: 'ms.taskCenter.taskBelongTestPlan',
dataIndex: 'belongTestPlan',
type: FilterType.SELECT_EQUAL,
selectProps: {
options: props.testPlanList,
},
},
{
title: 'common.tag',
dataIndex: 'tags',

View File

@ -55,6 +55,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { type SelectOptionData } from '@arco-design/web-vue';
import { getFilterCustomFields } from '@/components/pure/ms-advance-filter';
import { FilterFormItem, FilterResult } from '@/components/pure/ms-advance-filter/type';
@ -104,6 +105,7 @@
getPageApiType: keyof typeof CasePageApiTypeEnum; // Api
extraTableParams?: TableQueryParams; //
isAdvancedSearchMode?: boolean;
testPlanList: SelectOptionData[];
}>();
const emit = defineEmits<{
@ -378,6 +380,14 @@
dataIndex: 'attachment',
type: FilterType.INPUT,
},
{
title: 'ms.taskCenter.taskBelongTestPlan',
dataIndex: 'belongTestPlan',
type: FilterType.SELECT_EQUAL,
selectProps: {
options: props.testPlanList,
},
},
{
title: 'common.creator',
dataIndex: 'createUser',

View File

@ -202,6 +202,7 @@
:keyword="keyword"
:module-tree="moduleTree"
:modules-count="modulesCount"
:test-plan-list="testPlanList"
@get-module-count="initModulesCount"
@refresh="loadCaseList"
>
@ -228,6 +229,7 @@
:protocols="selectedProtocols"
:module-tree="moduleTree"
:modules-count="modulesCount"
:test-plan-list="testPlanList"
@get-module-count="initModulesCount"
>
<TotalCount :total-count="totalCount" />
@ -253,6 +255,7 @@
:protocols="selectedProtocols"
:module-tree="moduleTree"
:modules-count="modulesCount"
:test-plan-list="testPlanList"
@get-module-count="initModulesCount"
>
<TotalCount :total-count="totalCount" />
@ -277,6 +280,7 @@
:total-count="totalCount"
:is-advanced-search-mode="isAdvancedSearchMode"
:all-protocol-list="allProtocolList"
:test-plan-list="testPlanList"
@get-module-count="initModulesCount"
@refresh="loadCaseList"
>
@ -374,6 +378,7 @@
import TotalCount from './totalCount.vue';
import { getAssociatedProjectOptions } from '@/api/modules/case-management/featureCase';
import { getTestPlanListWithoutPage } from '@/api/modules/test-plan/testPlan';
import { useI18n } from '@/hooks/useI18n';
import useVisit from '@/hooks/useVisit';
import useAppStore from '@/store/modules/app';
@ -803,6 +808,25 @@
msAdvanceFilterRef.value?.clearFilter();
}
});
const testPlanList = ref<SelectOptionData[]>([]);
async function getTestPlanList() {
try {
const res = await getTestPlanListWithoutPage(innerProject.value);
testPlanList.value = res.map((item) => ({ value: item.id, label: `[${item.num}] ${item.name}` }));
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
}
watch(
() => innerProject.value,
() => {
getTestPlanList();
},
{ immediate: true }
);
</script>
<style scoped lang="less">

View File

@ -77,6 +77,7 @@
import { getPublicLinkCaseListMap } from './utils/page';
import { casePriorityOptions } from '@/views/api-test/components/config';
import { scenarioStatusOptions } from '@/views/api-test/scenario/components/config';
import type { SelectOptionData } from '@arco-design/web-vue';
const { t } = useI18n();
const { openNewPage } = useOpenNewPage();
@ -94,6 +95,7 @@
moduleTree: MsTreeNodeData[];
modulesCount: Record<string, any>;
isAdvancedSearchMode?: boolean;
testPlanList: SelectOptionData[];
}>();
const emit = defineEmits<{
@ -364,6 +366,14 @@
precision: 0,
},
},
{
title: 'ms.taskCenter.taskBelongTestPlan',
dataIndex: 'belongTestPlan',
type: FilterType.SELECT_EQUAL,
selectProps: {
options: props.testPlanList,
},
},
{
title: 'common.creator',
dataIndex: 'createUser',

View File

@ -115,7 +115,7 @@
}"
/>
<MsSelect
v-else-if="item.type === FilterType.SELECT || item.type === FilterType.BOOLEAN"
v-else-if="item.type === FilterType.SELECT || item.type === FilterType.SELECT_EQUAL"
v-model:model-value="item.value"
allow-clear
allow-search

View File

@ -37,7 +37,7 @@ export const operatorOptionsMap: Record<string, { value: string; label: string }
[FilterType.NUMBER]: [GT, LT, EQUAL, EMPTY, NOT_EMPTY],
[FilterType.SELECT]: COMMON_SELECTION_OPERATORS,
[FilterType.CASCADER]: COMMON_SELECTION_OPERATORS,
[FilterType.BOOLEAN]: [EQUAL],
[FilterType.SELECT_EQUAL]: [EQUAL],
[FilterType.MEMBER]: COMMON_SELECTION_OPERATORS,
[FilterType.TAGS_INPUT]: [EMPTY, CONTAINS, NO_CONTAINS, COUNT_LT, COUNT_GT],
[FilterType.TREE_SELECT]: [BELONG_TO, NOT_BELONG_TO],

View File

@ -23,7 +23,7 @@ export enum FilterType {
TAGS_INPUT = 'TagsInput',
TREE_SELECT = 'TreeSelect',
TEXTAREA = 'textArea',
BOOLEAN = 'boolean',
SELECT_EQUAL = 'SelectEqual',
CASCADER = 'Cascader',
}

View File

@ -99,6 +99,20 @@ export interface TestPlanDetail extends AddTestPlanParams {
apiCaseCount?: number;
apiScenarioCount?: number;
}
// 计划列表(不分页)
export interface TestPlanWithoutPageItem {
id: string;
num: number;
groupId: string;
projectId: string;
moduleId: string;
name: string;
status: planStatusType;
type: keyof typeof testPlanTypeEnum;
tags: string[] | { id: string; name: string }[];
createUser: string;
createTime: string;
}
// 计划分页
export interface TestPlanItem {

View File

@ -757,7 +757,7 @@
{
title: 'case.apiParamsChange',
dataIndex: 'apiChange',
type: FilterType.BOOLEAN,
type: FilterType.SELECT_EQUAL,
selectProps: {
options: [
{ label: t('case.withoutChanges'), value: false },

View File

@ -496,7 +496,7 @@
{
title: 'common.status',
dataIndex: 'enable',
type: FilterType.BOOLEAN,
type: FilterType.SELECT_EQUAL,
selectProps: {
options: [
{ label: t('system.config.email.close'), value: false },

View File

@ -563,7 +563,7 @@
{
title: 'case.apiParamsChange',
dataIndex: 'apiChange',
type: FilterType.BOOLEAN,
type: FilterType.SELECT_EQUAL,
selectProps: {
options: [
{ label: t('case.withoutChanges'), value: false },