feat(通用功能): 给所有表格的筛选加重置和确定按钮以及初始化筛选值

This commit is contained in:
guoyuqi 2024-03-29 14:32:32 +08:00 committed by 刘瑞斌
parent 7e36fc34d9
commit 41d8e2a58e
17 changed files with 389 additions and 80 deletions

View File

@ -922,3 +922,10 @@
text-align: center;
background: var(--color-text-brand);
}
.filter-button {
display: flex;
justify-content: space-between;
flex-direction: row;
margin: 12px;
}

View File

@ -41,7 +41,7 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="methodFilters" direction="vertical" size="small">
<a-checkbox v-for="key of RequestMethods" :key="key" :value="key">
<apiMethodName :method="key" />
@ -49,10 +49,10 @@
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetMethodFilter">
<a-button size="mini" class="mr-[8px]" @click="resetMethodFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
@ -72,7 +72,7 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(RequestDefinitionStatus)" :key="val" :value="val">
<apiStatus :status="val" />
@ -80,10 +80,10 @@
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetStatusFilter">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
@ -829,13 +829,13 @@
}
function resetMethodFilter() {
methodFilters.value = Object.keys(RequestMethods);
methodFilters.value = [];
methodFilterVisible.value = false;
loadApiList();
}
function resetStatusFilter() {
statusFilters.value = Object.keys(RequestDefinitionStatus);
statusFilters.value = [];
statusFilterVisible.value = false;
loadApiList();
}
@ -927,10 +927,4 @@
}
}
}
.filter-button {
display: flex;
justify-content: space-between;
flex-direction: row;
margin: 12px;
}
</style>

View File

@ -68,13 +68,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="caseFilters" direction="vertical" size="small">
<a-checkbox v-for="item of caseLevelList" :key="item.text" :value="item.text">
<caseLevel :case-level="item.text" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetCaseFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -109,13 +117,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(RequestDefinitionStatus)" :key="val" :value="val">
<apiStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -136,13 +152,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="lastReportStatusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of lastReportStatusList" :key="val" :value="val">
<ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetLastReportStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -623,7 +647,6 @@
async function getCaseLevelFields() {
const result = await getCaseDefaultFields(appStore.currentProjectId);
caseLevelFields.value = result.customFields.find((item: any) => item.internal && item.fieldName === '用例等级');
caseFilters.value = caseLevelFields.value?.options.map((item: any) => item.text);
}
onBeforeMount(() => {
@ -633,10 +656,31 @@
function handleFilterHidden(val: boolean) {
if (!val) {
caseFilterVisible.value = false;
statusFilterVisible.value = false;
lastReportStatusFilterVisible.value = false;
loadCaseList();
}
}
function resetCaseFilter() {
caseFilters.value = [];
caseFilterVisible.value = false;
loadCaseList();
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusFilters.value = [];
loadCaseList();
}
function resetLastReportStatusFilter() {
lastReportStatusFilterVisible.value = false;
lastReportStatusFilters.value = [];
loadCaseList();
}
watch(
() => props.activeModule,
() => {

View File

@ -19,13 +19,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="typeFilter" direction="vertical" size="small">
<a-checkbox v-for="val of typeOptions" :key="val.value" :value="val.value">
<span>{{ t(val.label) }}</span>
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetTypeFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -49,10 +57,9 @@
import useAppStore from '@/store/modules/app';
import { hasAnyPermission } from '@/utils/permission';
import { ChangeHistoryStatusFilters } from '@/enums/apiEnum';
import { TableKeyEnum } from '@/enums/tableEnum';
const typeFilter = ref(Object.keys(ChangeHistoryStatusFilters));
const typeFilter = ref<string[]>([]);
const statusFilterVisible = ref(false);
@ -141,17 +148,24 @@
projectId: appStore.currentProjectId,
sourceId: props.sourceId,
modules: ['API_TEST_MANAGEMENT_CASE'],
types: typeFilter.value.length === Object.keys(ChangeHistoryStatusFilters).length ? undefined : typeFilter.value,
types: typeFilter.value,
});
loadList();
}
function handleFilterHidden(val: boolean) {
if (!val) {
statusFilterVisible.value = false;
loadHistory();
}
}
function resetTypeFilter() {
typeFilter.value = [];
statusFilterVisible.value = false;
loadHistory();
}
onBeforeMount(() => {
if (hasAnyPermission(['PROJECT_API_DEFINITION_CASE:READ', 'PROJECT_API_DEFINITION_CASE:READ+UPDATE'])) {
loadHistory();

View File

@ -26,7 +26,7 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="triggerModeListFilters" direction="vertical" size="small">
<a-checkbox v-for="(key, value) of TriggerModeLabel" :key="key" :value="value">
<div class="font-medium">{{ t(key) }}</div>
@ -34,10 +34,10 @@
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetModeFilter">
<a-button size="mini" class="mr-[8px]" @click="resetModeFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
@ -57,7 +57,7 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of statusList" :key="val" :value="val">
<ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="val" />
@ -65,10 +65,10 @@
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetStatusFilter">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
@ -232,13 +232,13 @@
}
function resetModeFilter() {
triggerModeListFilters.value = Object.keys(TriggerModeLabel);
triggerModeListFilters.value = [];
triggerModeFilterVisible.value = false;
loadExecuteList();
}
function resetStatusFilter() {
statusFilters.value = Object.keys(ReportStatus[ReportEnum.API_REPORT]);
statusFilters.value = [];
statusFilterVisible.value = false;
loadExecuteList();
}
@ -273,10 +273,4 @@
flex-direction: row;
margin-bottom: 21px;
}
.filter-button {
display: flex;
justify-content: space-between;
flex-direction: row;
margin: 12px;
}
</style>

View File

@ -39,13 +39,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="methodFilters" direction="vertical" size="small">
<a-checkbox v-for="key of RequestMethods" :key="key" :value="key">
<apiMethodName :method="key" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetMethodFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -62,13 +70,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(RequestDefinitionStatus)" :key="val" :value="val">
<apiStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -304,9 +320,23 @@
function handleFilterHidden(val: boolean) {
if (!val) {
loadApiList();
methodFilterVisible.value = false;
statusFilterVisible.value = false;
}
}
function resetMethodFilter() {
methodFilters.value = [];
methodFilterVisible.value = false;
loadApiList();
}
function resetStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
loadApiList();
}
onBeforeMount(() => {
loadApiList();
});

View File

@ -27,21 +27,32 @@
@selected-change="handleTableSelect"
@batch-action="handleTableBatch"
>
<template #caseLevel="{ record }">
<span class="text-[var(--color-text-2)]"> <caseLevel :case-level="record.priority" /></span>
</template>
<template #caseLevelFilter="{ columnConfig }">
<a-trigger v-model:popup-visible="caseFilterVisible" trigger="click" @popup-visible-change="handleFilterHidden">
<MsButton type="text" class="arco-btn-text--secondary ml-[10px]" @click="caseFilterVisible = true">
<MsButton type="text" class="arco-btn-text--secondary" @click="caseFilterVisible = true">
{{ t(columnConfig.title as string) }}
<icon-down :class="caseFilterVisible ? 'text-[rgb(var(--primary-5))]' : ''" />
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="caseFilters" direction="vertical" size="small">
<a-checkbox v-for="item of caseLevelList" :key="item.text" :value="item.text">
<caseLevel :case-level="item.text" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetCaseFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -58,19 +69,27 @@
trigger="click"
@popup-visible-change="handleFilterHidden"
>
<MsButton type="text" class="arco-btn-text--secondary ml-[10px]" @click="statusFilterVisible = true">
<MsButton type="text" class="arco-btn-text--secondary" @click="statusFilterVisible = true">
{{ t(columnConfig.title as string) }}
<icon-down :class="statusFilterVisible ? 'text-[rgb(var(--primary-5))]' : ''" />
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(RequestDefinitionStatus)" :key="val" :value="val">
<apiStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -81,23 +100,27 @@
trigger="click"
@popup-visible-change="handleFilterHidden"
>
<MsButton
type="text"
class="arco-btn-text--secondary ml-[10px]"
@click="lastReportStatusFilterVisible = true"
>
<MsButton type="text" class="arco-btn-text--secondary" @click="lastReportStatusFilterVisible = true">
{{ t(columnConfig.title as string) }}
<icon-down :class="lastReportStatusFilterVisible ? 'text-[rgb(var(--primary-5))]' : ''" />
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="lastReportStatusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of lastReportStatusList" :key="val" :value="val">
<ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetLastReportStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -171,6 +194,7 @@
import useModal from '@/hooks/useModal';
import useTableStore from '@/hooks/useTableStore';
import useAppStore from '@/store/modules/app';
import { hasAnyPermission } from '@/utils/permission';
import { ApiCaseBatchParams, ApiCaseDetail } from '@/models/apiTest/management';
import { RequestDefinitionStatus } from '@/enums/apiEnum';
@ -374,21 +398,16 @@
};
const statusFilterVisible = ref(false);
const statusFilters = ref(Object.keys(RequestDefinitionStatus));
const defaultStatusFiltersLength = ref(Object.keys(RequestDefinitionStatus)).value.length;
const statusFilters = ref<string[]>([]);
const caseLevelFields = ref<Record<string, any>>({});
const caseFilterVisible = ref(false);
const caseFilters = ref<string[]>([]);
const defaultCaseFilters = ref<string[]>([]);
const caseLevelList = computed(() => {
return caseLevelFields.value?.options || [];
});
const lastReportStatusFilterVisible = ref(false);
const lastReportStatusList = computed(() => {
return Object.keys(ReportStatus[ReportEnum.API_REPORT]);
});
const defaultLastReportStatusLength = ref(Object.keys(ReportStatus[ReportEnum.API_REPORT])).value.length;
const lastReportStatusFilters = ref<string[]>(Object.keys(ReportStatus[ReportEnum.API_REPORT]));
const lastReportStatusList = ref<string[]>(Object.keys(ReportStatus[ReportEnum.API_REPORT]));
const lastReportStatusFilters = ref<string[]>([]);
const moduleIds = computed(() => {
return props.activeModule === 'all' ? [] : [props.activeModule];
@ -401,10 +420,9 @@
moduleIds: moduleIds.value,
protocol: props.protocol,
filter: {
status: statusFilters.value.length === defaultStatusFiltersLength ? [] : statusFilters.value,
priority: caseFilters.value.length === defaultCaseFilters.value.length ? [] : caseFilters.value,
lastReportStatus:
lastReportStatusFilters.value.length === defaultLastReportStatusLength ? [] : lastReportStatusFilters.value,
status: statusFilters.value,
priority: caseFilters.value,
lastReportStatus: lastReportStatusFilters.value,
},
};
setLoadListParams(params);
@ -419,8 +437,6 @@
async function getCaseLevelFields() {
const result = await getCaseDefaultFields(appStore.currentProjectId);
caseLevelFields.value = result.customFields.find((item: any) => item.internal && item.fieldName === '用例等级');
caseFilters.value = caseLevelFields.value?.options.map((item: any) => item.text);
defaultCaseFilters.value = caseLevelFields.value?.options.map((item: any) => item.text);
}
onBeforeMount(() => {
@ -430,10 +446,31 @@
function handleFilterHidden(val: boolean) {
if (!val) {
caseFilterVisible.value = false;
statusFilterVisible.value = false;
lastReportStatusFilterVisible.value = false;
loadCaseList();
}
}
function resetCaseFilter() {
caseFilters.value = [];
caseFilterVisible.value = false;
loadCaseList();
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusFilters.value = [];
loadCaseList();
}
function resetLastReportStatusFilter() {
lastReportStatusFilterVisible.value = false;
lastReportStatusFilters.value = [];
loadCaseList();
}
watch(
() => props.activeModule,
() => {

View File

@ -53,13 +53,21 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="triggerModeListFilters" direction="vertical" size="small">
<a-checkbox v-for="(key, value) of TriggerModeLabel" :key="key" :value="value">
<div class="font-medium">{{ t(key) }}</div>
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetTriggerModeFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -79,13 +87,21 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusListFilters" direction="vertical" size="small">
<a-checkbox v-for="key of statusFilters" :key="key" :value="key">
<ExecutionStatus :module-type="props.moduleType" :status="key" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -384,10 +400,24 @@
function handleFilterHidden(val: boolean) {
if (!val) {
triggerModeFilterVisible.value = false;
statusFilterVisible.value = false;
initData();
}
}
function resetTriggerModeFilter() {
triggerModeFilterVisible.value = false;
triggerModeListFilters.value = [];
initData();
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusListFilters.value = [];
initData();
}
function changeShowType(val: string | number | boolean) {
showType.value = val as ReportShowType;
initData();

View File

@ -35,13 +35,21 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="triggerModeListFilters" direction="vertical" size="small">
<a-checkbox v-for="(key, value) of TriggerModeLabel" :key="key" :value="value">
<div class="font-medium">{{ t(key) }}</div>
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetTriggerModeFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -58,13 +66,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(ExecuteStatusFilters)" :key="val" :value="val">
<executeStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -207,10 +223,24 @@
function handleFilterHidden(val: boolean) {
if (!val) {
triggerModeFilterVisible.value = false;
statusFilterVisible.value = false;
loadExecuteHistoryList();
}
}
function resetTriggerModeFilter() {
triggerModeFilterVisible.value = false;
triggerModeListFilters.value = [];
loadExecuteHistoryList();
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusFilters.value = [];
loadExecuteHistoryList();
}
function showResult(record: ExecuteHistoryItem) {}
onBeforeMount(() => {

View File

@ -42,13 +42,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(ApiScenarioStatus)" :key="val" :value="val">
<apiStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -115,6 +123,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetLastReportStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -642,10 +658,24 @@
function handleFilterHidden(val: boolean) {
if (!val) {
lastReportStatusFilterVisible.value = false;
statusFilterVisible.value = false;
loadScenarioList(false);
}
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusFilters.value = [];
loadScenarioList();
}
function resetLastReportStatusFilter() {
lastReportStatusFilterVisible.value = false;
lastReportStatusListFilters.value = [];
loadScenarioList();
}
async function handleStatusChange(record: ApiScenarioUpdateDTO) {
try {
await updateScenario({

View File

@ -150,7 +150,7 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="key of Object.keys(statusIconMap)" :key="key" :value="key">
<MsIcon
@ -162,6 +162,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetReviewStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -1259,7 +1267,6 @@
caseLevelFields.value = result.customFields.find(
(item: any) => item.internal && (item.fieldName === 'Case Priority' || item.fieldName === '用例等级')
);
caseFilters.value = caseLevelFields.value.options.map((item: any) => item.value);
fullColumns = [
...columns.slice(0, columns.length - 1),
...customFieldsColumns,
@ -1536,9 +1543,16 @@
function handleFilterHidden(val: boolean) {
if (!val) {
initData();
statusFilterVisible.value = false;
}
}
function resetReviewStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
initData();
}
//
onBeforeMount(async () => {
try {

View File

@ -194,7 +194,7 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="key of Object.keys(statusIconMap)" :key="key" :value="key">
<MsIcon
@ -206,6 +206,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetReviewStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -302,7 +310,7 @@
import { characterLimit, findNodeByKey, findNodePathByKey, mapTree } from '@/utils';
import { hasAnyPermission } from '@/utils/permission';
import type { BatchMoveOrCopyType, CaseManagementTable, CustomAttributes } from '@/models/caseManagement/featureCase';
import type { CaseManagementTable, CustomAttributes } from '@/models/caseManagement/featureCase';
import type { ModuleTreeNode, TableQueryParams } from '@/models/common';
import { TableKeyEnum } from '@/enums/tableEnum';
@ -896,7 +904,6 @@
};
});
caseLevelFields.value = result.customFields.find((item: any) => item.internal && item.fieldName === '用例等级');
caseFilters.value = caseLevelFields.value.options.map((item: any) => item.value);
fullColumns = [
...columns.slice(0, columns.length - 1),
...customFieldsColumns,
@ -1041,13 +1048,20 @@
function handleFilterHidden(val: boolean) {
if (!val) {
initRecycleList();
statusFilterVisible.value = false;
}
}
onMounted(async () => {
getRecycleModules();
await initFilter();
function resetReviewStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
initRecycleList();
}
onMounted(async () => {
await getRecycleModules();
await initFilter();
await initRecycleList();
});
await getDefaultFields();
</script>

View File

@ -8,7 +8,7 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="innerStatusFilters" direction="vertical" size="small">
<a-checkbox
v-for="(item, index) of props.list"
@ -19,13 +19,20 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useVModel } from '@vueuse/core';
import { useI18n } from '@/hooks/useI18n';
@ -54,6 +61,11 @@
emit('search');
}
}
function resetFilter() {
innerStatusFilters.value = [];
innerVisible.value = false;
emit('search');
}
</script>
<style scoped></style>

View File

@ -46,7 +46,7 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="key of Object.keys(reviewResultMap)" :key="key" :value="key">
<a-tag
@ -59,6 +59,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetReviewStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -488,9 +496,16 @@
function handleFilterHidden(val: boolean) {
if (!val) {
searchCase();
statusFilterVisible.value = false;
}
}
function resetReviewStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
searchCase();
}
onBeforeMount(() => {
searchCase();
});

View File

@ -41,7 +41,7 @@
</a-button>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="key of Object.keys(reviewStatusMap)" :key="key" :value="key">
<a-tag
@ -54,6 +54,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -549,6 +557,12 @@
}
}
function resetStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
searchReview();
}
const batchParams = ref<BatchActionQueryParams>({
selectedIds: [],
selectAll: false,

View File

@ -53,13 +53,21 @@
</MsButton>
<template #content>
<div class="arco-table-filters-content">
<div class="flex items-center justify-center px-[6px] py-[2px]">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="statusFilters" direction="vertical" size="small">
<a-checkbox v-for="val of Object.values(CommonScriptStatusEnum)" :key="val" :value="val">
<commonScriptStatus :status="val" />
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -264,10 +272,17 @@
function handleFilterHidden(val: boolean) {
if (!val) {
statusFilterVisible.value = false;
initData();
}
}
function resetStatusFilter() {
statusFilters.value = [];
statusFilterVisible.value = false;
initData();
}
function deleteScript(record: CommonScriptItem) {
openModal({
type: 'error',

View File

@ -42,6 +42,14 @@
</a-checkbox>
</a-checkbox-group>
</div>
<div class="filter-button">
<a-button size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button type="primary" size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div>
</template>
</a-trigger>
@ -391,10 +399,17 @@
function handleFilterHidden(val: boolean) {
if (!val) {
statusFilterVisible.value = false;
searchPlan();
}
}
function resetStatusFilter() {
statusFilterVisible.value = false;
statusFilters.value = [];
searchPlan();
}
onMounted(() => {
setProps({ data });
});