From 6ae0fcef149ddbe614746023a58a3885b3ac4bde Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 25 三月 2025 11:31:04 +0800 Subject: [PATCH] Merge branch 'dev' --- src/views/components/tidingsTable.vue | 55 ++++++++++++++++++++++--------------------------------- 1 files changed, 22 insertions(+), 33 deletions(-) diff --git a/src/views/components/tidingsTable.vue b/src/views/components/tidingsTable.vue index 8c88212..067a28b 100644 --- a/src/views/components/tidingsTable.vue +++ b/src/views/components/tidingsTable.vue @@ -26,6 +26,7 @@ }" min-height="280" max-height="280" + v-loading="tableLoading" > <el-table-column v-for="column in currentTableHeaders" @@ -34,12 +35,13 @@ :label="column.label" :min-width="column.minWidth" :prop="column.prop" + :show-overflow-tooltip="column.showOverflowTooltip" > <template v-if="column.slot === 'sort'" #default="scope"> <div :class=" getSortClass( - (queryParams.pageNum - 1) * + (queryParams.currentPage - 1) * queryParams.pageSize + scope.$index + 1 @@ -48,7 +50,7 @@ class="sort" > <span>{{ - (queryParams.pageNum - 1) * queryParams.pageSize + + (queryParams.currentPage - 1) * queryParams.pageSize + scope.$index + 1 }}</span> @@ -82,9 +84,9 @@ v-show="total >= 0" :page-sizes="[4]" :limit="queryParams.pageSize" - :page="queryParams.pageNum" + :page="queryParams.currentPage" :total="total" - @pagination="getList" + @pagination="getMessageCountFun" /> </div> </div> @@ -97,15 +99,16 @@ name: "Index", data() { return { + tableLoading: false, total: 0, queryParams: { - pageNum: 1, + currentPage: 1, pageSize: 4 }, tableData: [], tabs: [ // { id: 'process', label: '閫氱煡鍏憡', num: '2' }, - { id: 'review', label: '瀹℃牳娑堟伅', num: '6' } + { id: 'review', label: '瀹℃牳娑堟伅', num: '' } // { id: 'supervision', label: '鐫e姙娑堟伅', num: '9' }, // { id: 'progress', label: '杩涘害娑堟伅', num: '7' } ], @@ -113,9 +116,8 @@ //閰嶇疆琛ㄦ牸琛ㄥご鏁版嵁 currentTableHeaders: [ { label: '#', prop: 'index', minWidth: 50, align: 'center', slot: 'sort' }, - { label: '瀹℃壒鐜妭', prop: 'taskDefinitionKey', minWidth: 150, align: 'left' }, - { label: '鍐呭', prop: 'content', minWidth: 300, align: 'left' }, - { label: '鏃堕棿', prop: 'createTime', minWidth: 143, align: 'left' } + { label: '娑堟伅鍐呭', prop: 'content', minWidth: 300, align: 'left', showOverflowTooltip: true }, + { label: '鏃堕棿', prop: 'gmtCreate', minWidth: 143, align: 'left' } ] } }, @@ -125,35 +127,22 @@ }, created() { this.currentTabId = this.tabs[0].id; // 榛樿閫変腑鐨則ab鐨刬d - this.getList(); - this.getMessageCountFun(); + + this.getMessageCountFun({page: 1}); }, methods: { - - async getList() { - const resp = await getMessage(this.queryParams); - if (resp.code === 200) { - this.total = resp.total; - this.tableData = resp.rows; - } + async getMessageCountFun(data) { + this.queryParams.currentPage = data.page + this.tableLoading = true + await getMessageCount(this.queryParams).then(res => { + this.tableData = res.data + this.total = res.total + this.tableLoading = false + }); }, - - async getMessageCountFun() { - const resp = await getMessageCount(); - if (resp.code === 200) { - this.tabs = this.tabs.map((tab) => { - if (tab.label === '瀹℃牳娑堟伅') { - tab.num = resp.data.auditCount; - } - return tab; - }); - } - }, - - switchTab(tabId) { - currentTabId = tabId; + this.currentTabId = tabId; }, getSortClass(index) { -- Gitblit v1.8.0