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 }
);