From 7261f1dade2c6a95653f10d2ddebe23455c61f53 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 16 一月 2025 14:49:28 +0800 Subject: [PATCH] 首页待办优化 --- src/views/components/noticeTable.vue | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/views/components/noticeTable.vue b/src/views/components/noticeTable.vue index 4789ab9..c7ecb2a 100644 --- a/src/views/components/noticeTable.vue +++ b/src/views/components/noticeTable.vue @@ -20,6 +20,7 @@ </div> </div> <el-table + v-loading="tableLoading" :data="tableData" :header-cell-style="{ background: '#F5F7FC', @@ -69,12 +70,12 @@ <div style="width: 100%;display: flex;flex-direction: row-reverse;align-items: center"> <pagination style="width: 100%" - v-show="total >= 0" + v-show="total > 0" :page-sizes="[4]" :limit="queryParams.pageSize" - :page="queryParams.pageNum" + :page="queryParams.currentPage" :total="total" - @pagination="getList" + @pagination="pageChange" /> </div> </div> @@ -86,10 +87,11 @@ export default { data() { return { + tableLoading: false, currentTab: "process", total: 0, queryParams: { - pageNum: 1, + currentPage: 1, pageSize: 4, }, tableData: [], @@ -164,21 +166,26 @@ this.getList(); }, methods: { + pageChange(data) { + this.queryParams.currentPage = data.page + this.getList() + }, async getList() { var resp; - this.total = 0; - this.tableData = []; + this.tableLoading = true if (this.currentTab == "process") { resp = await getProjectProcessTodo(this.queryParams); if (resp.code === 200) { this.total = resp.total; this.tableData = resp.taskList; + this.tableLoading = false } } else { resp = await getProjectPlanToDoList(this.queryParams); if (resp.code === 200) { this.total = resp.total; this.tableData = resp.data; + this.tableLoading = false } } }, -- Gitblit v1.8.0