From 52e36204a3ca4c7ed98c9861b2ff25bbf985232f Mon Sep 17 00:00:00 2001
From: zxyroyy <1442470094@qq.com>
Date: Fri, 26 Jun 2026 16:40:44 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E6=AD=A5=EF=BC=9A=E5=AF=B9?=
=?UTF-8?q?=E5=90=84=E7=B1=BB=E8=BF=9B=E8=A1=8C=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DisasterChainPointComponent.vue | 39 ++++++++++++++-----
1 file changed, 30 insertions(+), 9 deletions(-)
diff --git a/src/component/rain-earthquake/DisasterChainPointComponent.vue b/src/component/rain-earthquake/DisasterChainPointComponent.vue
index dd91de2..670a27a 100644
--- a/src/component/rain-earthquake/DisasterChainPointComponent.vue
+++ b/src/component/rain-earthquake/DisasterChainPointComponent.vue
@@ -23,9 +23,10 @@
{
+ if (!conditions.value.tableData) {
+ return props.tableDataList;
+ }
+ const keyword = conditions.value.tableData.toLowerCase();
+ return props.tableDataList.filter(item => {
+ // 遍历所有列,检查是否包含关键词
+ return props.tableColumns.some(col => {
+ const value = item[col.key as keyof typeof item];
+ if (value === undefined || value === null) return false;
+ return String(value).toLowerCase().includes(keyword);
+ });
+ });
+ });
+
// 分页后的数据
const paginatedData = computed(() => {
const start = (props.pageOption.currentPage - 1) * props.pageOption.pageSize;
const end = start + props.pageOption.pageSize;
- return props.tableDataList.slice(start, end);
+ return filteredData.value.slice(start, end);
});
// 是否显示分页
@@ -164,11 +181,15 @@
// 监听搜索条件变化
watch(
- conditions,
- () => {
- emits('changeConditions', conditions.value);
- },
- { deep: true }
+ conditions,
+ (newConditions) => {
+ emits('changeConditions', newConditions);
+ // 搜索条件变化时,重置到第一页
+ if (newConditions.tableData !== conditions.value.tableData) {
+ emits('changeCurrentPage', 1);
+ }
+ },
+ { deep: true }
);