|
244 | 244 | :items="[]"
|
245 | 245 | :hide-no-data="false"
|
246 | 246 | ref="filterIndustryTypeSelect"
|
| 247 | + @update:search="industryTypeSearchText = $event" |
247 | 248 | >
|
248 | 249 | <template v-slot:no-data>
|
249 | 250 | <div class="tw-p-4 tw-max-w-md">
|
250 | 251 | <div class="tw-text-sm tw-text-gray-600 tw-mb-2">点击选择类型:</div>
|
251 | 252 | <div class="tw-flex tw-flex-wrap tw-gap-2">
|
252 | 253 | <v-chip
|
253 |
| - v-for="item in industryTypeOptions" |
| 254 | + v-for="item in filteredIndustryTypeOptions" |
254 | 255 | :key="item"
|
255 | 256 | variant="outlined"
|
256 | 257 | color="green"
|
|
284 | 285 | :items="[]"
|
285 | 286 | :hide-no-data="false"
|
286 | 287 | ref="filterPayTypeSelect"
|
| 288 | + @update:search="payTypeSearchText = $event" |
287 | 289 | >
|
288 | 290 | <template v-slot:no-data>
|
289 | 291 | <div class="tw-p-4 tw-max-w-md">
|
290 | 292 | <div class="tw-text-sm tw-text-gray-600 tw-mb-2">点击选择支付方式:</div>
|
291 | 293 | <div class="tw-flex tw-flex-wrap tw-gap-2">
|
292 | 294 | <v-chip
|
293 |
| - v-for="item in payTypeOptions" |
| 295 | + v-for="item in filteredPayTypeOptions" |
294 | 296 | :key="item"
|
295 | 297 | variant="outlined"
|
296 | 298 | color="blue"
|
|
488 | 490 | :items="[]"
|
489 | 491 | :hide-no-data="false"
|
490 | 492 | ref="batchIndustryTypeSelect"
|
| 493 | + @update:search="batchIndustryTypeSearchText = $event" |
491 | 494 | >
|
492 | 495 | <template v-slot:no-data>
|
493 | 496 | <div class="tw-p-4 tw-max-w-md">
|
494 | 497 | <div class="tw-text-sm tw-text-gray-600 tw-mb-2">点击选择类型:</div>
|
495 | 498 | <div class="tw-flex tw-flex-wrap tw-gap-2">
|
496 | 499 | <v-chip
|
497 |
| - v-for="item in industryTypeOptions" |
| 500 | + v-for="item in filteredBatchIndustryTypeOptions" |
498 | 501 | :key="item"
|
499 | 502 | variant="outlined"
|
500 | 503 | color="green"
|
|
529 | 532 | :items="[]"
|
530 | 533 | :hide-no-data="false"
|
531 | 534 | ref="batchPayTypeSelect"
|
| 535 | + @update:search="batchPayTypeSearchText = $event" |
532 | 536 | >
|
533 | 537 | <template v-slot:no-data>
|
534 | 538 | <div class="tw-p-4 tw-max-w-md">
|
535 | 539 | <div class="tw-text-sm tw-text-gray-600 tw-mb-2">点击选择支付方式:</div>
|
536 | 540 | <div class="tw-flex tw-flex-wrap tw-gap-2">
|
537 | 541 | <v-chip
|
538 |
| - v-for="item in payTypeOptions" |
| 542 | + v-for="item in filteredBatchPayTypeOptions" |
539 | 543 | :key="item"
|
540 | 544 | variant="outlined"
|
541 | 545 | color="blue"
|
@@ -619,6 +623,7 @@ import FlowCustomImportDialog from "~/components/dialog/FlowCustomImport.vue";
|
619 | 623 | import { dateFormater } from "@/utils/common";
|
620 | 624 |
|
621 | 625 | import { getIndustryType, getPayType } from "~/utils/apis";
|
| 626 | +import { computed } from "vue"; |
622 | 627 |
|
623 | 628 | const flowQuery = ref<FlowQuery>({
|
624 | 629 | pageNum: 1,
|
@@ -1463,6 +1468,49 @@ const selectBatchPayType = (item: string) => {
|
1463 | 1468 | batchPayTypeSelect.value.blur();
|
1464 | 1469 | }
|
1465 | 1470 | };
|
| 1471 | +
|
| 1472 | +// 添加筛选相关的响应式变量 |
| 1473 | +const industryTypeSearchText = ref(""); |
| 1474 | +const payTypeSearchText = ref(""); |
| 1475 | +const batchIndustryTypeSearchText = ref(""); |
| 1476 | +const batchPayTypeSearchText = ref(""); |
| 1477 | +
|
| 1478 | +// 计算属性:筛选后的选项 |
| 1479 | +const filteredIndustryTypeOptions = computed(() => { |
| 1480 | + if (!industryTypeSearchText.value) { |
| 1481 | + return industryTypeOptions.value; |
| 1482 | + } |
| 1483 | + return industryTypeOptions.value.filter(item => |
| 1484 | + item.toLowerCase().includes(industryTypeSearchText.value.toLowerCase()) |
| 1485 | + ); |
| 1486 | +}); |
| 1487 | +
|
| 1488 | +const filteredPayTypeOptions = computed(() => { |
| 1489 | + if (!payTypeSearchText.value) { |
| 1490 | + return payTypeOptions.value; |
| 1491 | + } |
| 1492 | + return payTypeOptions.value.filter(item => |
| 1493 | + item.toLowerCase().includes(payTypeSearchText.value.toLowerCase()) |
| 1494 | + ); |
| 1495 | +}); |
| 1496 | +
|
| 1497 | +const filteredBatchIndustryTypeOptions = computed(() => { |
| 1498 | + if (!batchIndustryTypeSearchText.value) { |
| 1499 | + return industryTypeOptions.value; |
| 1500 | + } |
| 1501 | + return industryTypeOptions.value.filter(item => |
| 1502 | + item.toLowerCase().includes(batchIndustryTypeSearchText.value.toLowerCase()) |
| 1503 | + ); |
| 1504 | +}); |
| 1505 | +
|
| 1506 | +const filteredBatchPayTypeOptions = computed(() => { |
| 1507 | + if (!batchPayTypeSearchText.value) { |
| 1508 | + return payTypeOptions.value; |
| 1509 | + } |
| 1510 | + return payTypeOptions.value.filter(item => |
| 1511 | + item.toLowerCase().includes(batchPayTypeSearchText.value.toLowerCase()) |
| 1512 | + ); |
| 1513 | +}); |
1466 | 1514 | </script>
|
1467 | 1515 |
|
1468 | 1516 | <style scoped>
|
|
0 commit comments