feat(M08-B): 补联调筛选清除
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
:prefix-icon="Search"
|
||||
: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">
|
||||
<template #reference>
|
||||
<el-button :icon="ListChecks" :disabled="filteredChecklist.length === 0">
|
||||
@@ -354,7 +357,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
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';
|
||||
|
||||
type FieldStatus = 'PENDING' | 'PASS' | 'BLOCKED' | 'SKIP';
|
||||
@@ -470,6 +473,14 @@ const filteredChecklist = computed(() => checklist.filter((item) => {
|
||||
|| owner === ownerFilter.value;
|
||||
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) {
|
||||
const keyword = keywordFilter.value.trim().toLowerCase();
|
||||
if (!keyword) return true;
|
||||
@@ -696,6 +707,13 @@ function resetDraft() {
|
||||
persistDraft();
|
||||
}
|
||||
|
||||
function clearHandoffFilters() {
|
||||
category.value = '\u5168\u90e8';
|
||||
statusFilter.value = 'ALL';
|
||||
ownerFilter.value = 'ALL';
|
||||
keywordFilter.value = '';
|
||||
}
|
||||
|
||||
function applyBulkMark() {
|
||||
for (const item of filteredChecklist.value) {
|
||||
draft[item.id].status = bulkForm.status;
|
||||
|
||||
Reference in New Issue
Block a user