From c33cbe5fdb6a625c0e97dabfef44e674c899814b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E5=87=AF?= <2448379534@qq.com> Date: Thu, 25 Jun 2026 10:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/BasicTable/index.vue | 23 ++++++++++++------- .../ZhiWuYuanDetailTable.vue | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/BasicTable/index.vue b/frontend/src/components/BasicTable/index.vue index 20dde34a..fd80120a 100644 --- a/frontend/src/components/BasicTable/index.vue +++ b/frontend/src/components/BasicTable/index.vue @@ -236,20 +236,27 @@ const getList = async (filter?: Record) => { }; const handleTableChange = (pag: any, filters: any, sorter: any) => { - page.value = pag.current; - size.value = pag.pageSize; - if (sorter && sorter.field) { + // 判断是否是排序操作:sorter 有 field 且 order 发生了变化 + const isSortChange = sorter && sorter.field && sorter.order !== undefined; + + if (isSortChange) { + // 排序操作:重置到第1页 internalSort.value = { field: sorter.field, order: sorter.order }; - page.value = 1; // 排序时重置到第一页 - getList(); + page.value = 1; emit('sort-change', { field: sorter.field, order: sorter.order }); - } else { - // 清除排序 + } else if (sorter && sorter.field && !sorter.order) { + // 取消排序:也重置到第1页 internalSort.value = { field: '', order: null }; page.value = 1; - getList(); emit('sort-change', { field: '', order: null }); } + + // 分页操作:直接使用传入的页码 + page.value = pag.current; + size.value = pag.pageSize; + + // 统一请求数据 + getList(); }; const handleRowClick = (record: any) => { emit('row-click', record); diff --git a/frontend/src/modules/ZhenXiZhiWuYuanMod/ZhiWuYuanJianSheJiJieRuQingKuangBar/ZhiWuYuanDetailTable.vue b/frontend/src/modules/ZhenXiZhiWuYuanMod/ZhiWuYuanJianSheJiJieRuQingKuangBar/ZhiWuYuanDetailTable.vue index 4c679be4..5926aaf0 100644 --- a/frontend/src/modules/ZhenXiZhiWuYuanMod/ZhiWuYuanJianSheJiJieRuQingKuangBar/ZhiWuYuanDetailTable.vue +++ b/frontend/src/modules/ZhenXiZhiWuYuanMod/ZhiWuYuanJianSheJiJieRuQingKuangBar/ZhiWuYuanDetailTable.vue @@ -155,7 +155,7 @@ const columns = [ title: '开工日期', dataIndex: 'ststdt', width: 120, - ellipsis: true + ellipsis: true, }, { key: 'jcdt',