feat(M08-B): 补联调筛选清除
This commit is contained in:
@@ -38,6 +38,9 @@
|
|||||||
:prefix-icon="Search"
|
:prefix-icon="Search"
|
||||||
:placeholder="'\u641c\u7d22\u68c0\u67e5\u9879/\u8d1f\u8d23\u4eba/\u8bc1\u636e'"
|
:placeholder="'\u641c\u7d22\u68c0\u67e5\u9879/\u8d1f\u8d23\u4eba/\u8bc1\u636e'"
|
||||||
/>
|
/>
|
||||||
|
<el-button :icon="FilterX" :disabled="!hasActiveFilters" @click="clearHandoffFilters">
|
||||||
|
\u6e05\u9664\u7b5b\u9009
|
||||||
|
</el-button>
|
||||||
<el-popover trigger="click" width="360">
|
<el-popover trigger="click" width="360">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button :icon="ListChecks" :disabled="filteredChecklist.length === 0">
|
<el-button :icon="ListChecks" :disabled="filteredChecklist.length === 0">
|
||||||
@@ -354,7 +357,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, reactive, ref } from 'vue';
|
import { computed, reactive, ref } from 'vue';
|
||||||
import { Check, Copy, Download, FileDown, FileUp, ListChecks, RotateCcw, Search } from '@lucide/vue';
|
import { Check, Copy, Download, FileDown, FileUp, FilterX, ListChecks, RotateCcw, Search } from '@lucide/vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
type FieldStatus = 'PENDING' | 'PASS' | 'BLOCKED' | 'SKIP';
|
type FieldStatus = 'PENDING' | 'PASS' | 'BLOCKED' | 'SKIP';
|
||||||
@@ -470,6 +473,14 @@ const filteredChecklist = computed(() => checklist.filter((item) => {
|
|||||||
|| owner === ownerFilter.value;
|
|| owner === ownerFilter.value;
|
||||||
return categoryMatched && statusMatched && ownerMatched && matchesKeyword(item);
|
return categoryMatched && statusMatched && ownerMatched && matchesKeyword(item);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const hasActiveFilters = computed(() => (
|
||||||
|
category.value !== '\u5168\u90e8'
|
||||||
|
|| statusFilter.value !== 'ALL'
|
||||||
|
|| ownerFilter.value !== 'ALL'
|
||||||
|
|| keywordFilter.value.trim() !== ''
|
||||||
|
));
|
||||||
|
|
||||||
function matchesKeyword(item: HandoffItem) {
|
function matchesKeyword(item: HandoffItem) {
|
||||||
const keyword = keywordFilter.value.trim().toLowerCase();
|
const keyword = keywordFilter.value.trim().toLowerCase();
|
||||||
if (!keyword) return true;
|
if (!keyword) return true;
|
||||||
@@ -696,6 +707,13 @@ function resetDraft() {
|
|||||||
persistDraft();
|
persistDraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearHandoffFilters() {
|
||||||
|
category.value = '\u5168\u90e8';
|
||||||
|
statusFilter.value = 'ALL';
|
||||||
|
ownerFilter.value = 'ALL';
|
||||||
|
keywordFilter.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
function applyBulkMark() {
|
function applyBulkMark() {
|
||||||
for (const item of filteredChecklist.value) {
|
for (const item of filteredChecklist.value) {
|
||||||
draft[item.id].status = bulkForm.status;
|
draft[item.id].status = bulkForm.status;
|
||||||
|
|||||||
@@ -340,6 +340,10 @@ for (const pattern of [
|
|||||||
'ownerFilter',
|
'ownerFilter',
|
||||||
'keywordFilter',
|
'keywordFilter',
|
||||||
'matchesKeyword',
|
'matchesKeyword',
|
||||||
|
'FilterX',
|
||||||
|
'hasActiveFilters',
|
||||||
|
'clearHandoffFilters',
|
||||||
|
'\\u6e05\\u9664\\u7b5b\\u9009',
|
||||||
'ownerOptions',
|
'ownerOptions',
|
||||||
'ownerProgress',
|
'ownerProgress',
|
||||||
'copyOwnerSummary',
|
'copyOwnerSummary',
|
||||||
|
|||||||
Reference in New Issue
Block a user