fix(测试计划&接口测试): 修改测试计划参数问题和报告切换不生效问题_紧急

This commit is contained in:
xinxin.wu 2024-05-20 17:33:09 +08:00 committed by Craftsman
parent e51c44db3c
commit 10b1489afa
7 changed files with 40 additions and 13 deletions

View File

@ -354,7 +354,7 @@
( (
e: 'filterChange', e: 'filterChange',
dataIndex: string, dataIndex: string,
value: string[] | (string | number)[] | undefined, value: string[] | (string | number | boolean)[] | undefined,
isCustomParam: boolean isCustomParam: boolean
): void; ): void;
(e: 'resetFilter', filterValue: Record<string, any>): void; (e: 'resetFilter', filterValue: Record<string, any>): void;
@ -645,7 +645,7 @@
}); });
const handleFilterConfirm = ( const handleFilterConfirm = (
value: string[] | (string | number)[] | undefined, value: string[] | (string | number | boolean)[] | undefined,
dataIndex: string, dataIndex: string,
isCustomParam: boolean isCustomParam: boolean
) => { ) => {

View File

@ -103,7 +103,7 @@
} }
); );
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'handleConfirm', value: (string | number)[] | string[] | undefined): void; (e: 'handleConfirm', value: (string | number | boolean)[] | string[] | undefined): void;
}>(); }>();
const visible = ref(false); const visible = ref(false);

View File

@ -116,7 +116,7 @@
loadList(); loadList();
} }
function filterChange(dataIndex: string, value: string[] | (string | number)[] | undefined) { function filterChange(dataIndex: string, value: string[] | (string | number | boolean)[] | undefined) {
loadHistory(value as string[]); loadHistory(value as string[]);
} }

View File

@ -30,6 +30,7 @@
:action-config="tableBatchActions" :action-config="tableBatchActions"
v-on="propsEvent" v-on="propsEvent"
@batch-action="handleTableBatch" @batch-action="handleTableBatch"
@filter-change="filterChange"
> >
<template #name="{ record, rowIndex }"> <template #name="{ record, rowIndex }">
<div <div
@ -273,11 +274,28 @@
rename rename
); );
function initData() { const typeFilter = computed(() => {
if (showType.value === 'All') {
return [];
}
return showType.value === 'INDEPENDENT' ? [false] : [true];
});
function initData(dataIndex?: string, value?: string[] | (string | number | boolean)[] | undefined) {
const filterParams = {
...propsRes.value.filter,
};
if (dataIndex && value) {
filterParams[dataIndex] = value;
}
setLoadListParams({ setLoadListParams({
keyword: keyword.value, keyword: keyword.value,
projectId: appStore.currentProjectId, projectId: appStore.currentProjectId,
moduleType: props.moduleType, moduleType: props.moduleType,
filter: {
integrated: typeFilter.value,
...filterParams,
},
}); });
loadList(); loadList();
} }
@ -376,6 +394,10 @@
initData(); initData();
} }
function filterChange(dataIndex: string, value: string[] | (string | number | boolean)[] | undefined) {
initData(dataIndex, value);
}
/** /**
* 报告详情 showReportDetail * 报告详情 showReportDetail
*/ */

View File

@ -59,8 +59,8 @@
:bug-columns="columns" :bug-columns="columns"
:load-bug-list-api="associatedBugPage" :load-bug-list-api="associatedBugPage"
:load-params="{ :load-params="{
testPlanCaseId: route.query.testPlanCaseId,
caseId: props.caseId, caseId: props.caseId,
testPlanCaseId: props.testPlanCaseId,
}" }"
@link="emit('link')" @link="emit('link')"
@new="emit('new')" @new="emit('new')"
@ -93,7 +93,7 @@
const appStore = useAppStore(); const appStore = useAppStore();
const props = defineProps<{ const props = defineProps<{
caseId: string; caseId: string;
testPlanId: string; testPlanCaseId: string;
}>(); }>();
const keyword = ref<string>(''); const keyword = ref<string>('');

View File

@ -57,6 +57,7 @@
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps<{ const props = defineProps<{
caseId: string; caseId: string;
testPlanCaseId: string;
}>(); }>();
const executeHistoryList = ref<ExecuteHistoryItem[]>([]); const executeHistoryList = ref<ExecuteHistoryItem[]>([]);
@ -69,7 +70,7 @@
try { try {
executeHistoryList.value = await executeHistory({ executeHistoryList.value = await executeHistory({
caseId: props.caseId, caseId: props.caseId,
id: route.query.testPlanCaseId as string, id: props.testPlanCaseId,
testPlanId: route.query.id as string, testPlanId: route.query.id as string,
}); });
} catch (error) { } catch (error) {

View File

@ -162,11 +162,15 @@
v-if="activeTab === 'defectList'" v-if="activeTab === 'defectList'"
ref="bugRef" ref="bugRef"
:case-id="activeCaseId" :case-id="activeCaseId"
:test-plan-id="route.query.id as string" :test-plan-case-id="activeId"
@link="linkDefect" @link="linkDefect"
@new="addBug" @new="addBug"
/> />
<ExecutionHistory v-if="activeTab === 'executionHistory'" :case-id="activeCaseId" /> <ExecutionHistory
v-if="activeTab === 'executionHistory'"
:case-id="activeCaseId"
:test-plan-case-id="activeId"
/>
</div> </div>
</a-spin> </a-spin>
</div> </div>
@ -181,8 +185,8 @@
<AddDefectDrawer <AddDefectDrawer
v-model:visible="showDrawer" v-model:visible="showDrawer"
:case-id="activeCaseId" :case-id="activeCaseId"
::extra-params="{ :extra-params="{
testPlanCaseId: route.query.testPlanCaseId, testPlanCaseId: activeId,
caseId: activeCaseId, caseId: activeCaseId,
testPlanId:route.query.id as string, testPlanId:route.query.id as string,
}" }"
@ -505,7 +509,7 @@
...params, ...params,
caseId: activeCaseId.value, caseId: activeCaseId.value,
testPlanId: route.query.id as string, testPlanId: route.query.id as string,
testPlanCaseId: route.query.testPlanCaseId as string, testPlanCaseId: activeId.value,
}); });
Message.success(t('caseManagement.featureCase.associatedSuccess')); Message.success(t('caseManagement.featureCase.associatedSuccess'));
showLinkDrawer.value = false; showLinkDrawer.value = false;