From 527efb36f35b471710e445972673abff45bacdac Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期五, 12 九月 2025 17:36:09 +0800 Subject: [PATCH] 401跳转登录 --- laboratory/src/components/Table/index.vue | 35 ++++++++++++++++++++++++++++++----- 1 files changed, 30 insertions(+), 5 deletions(-) diff --git a/laboratory/src/components/Table/index.vue b/laboratory/src/components/Table/index.vue index ddc06cf..50ec0e0 100644 --- a/laboratory/src/components/Table/index.vue +++ b/laboratory/src/components/Table/index.vue @@ -1,15 +1,23 @@ <template> <div class="table-container"> - <el-table border v-bind="$attrs" v-on="$listeners" :height="height"> + <el-table ref="elTable" border v-bind="$attrs" v-on="$listeners" :height="height"> <slot></slot> </el-table> <div v-if="total > 0"> - <el-pagination layout="slot, prev, pager, next, sizes, jumper" :page-size="queryForm.pageSize" - :current-page="queryForm.pageNum" :total="total" @current-change="handleCurrentChange" - @size-change="handleSizeChange" class="pagination"> + <el-pagination v-if="!disAblePagination" layout="slot, prev, pager, next, sizes, jumper" + :page-size="queryForm.pageSize" :current-page="queryForm.pageNum" + :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" class="pagination"> <div class="pagination-info">第 {{ (queryForm.pageNum == 1) ? 1 : (queryForm.pageNum - 1) * queryForm.pageSize + 1 }}-{{ queryForm.pageNum * queryForm.pageSize }} 条/总共 {{ total }} 条</div> + </el-pagination> + + <el-pagination v-else layout="slot, prev, pager, next, jumper" + :page-size="15" :current-page="queryForm.pageNum" + :total="total" @current-change="handleCurrentChange" class="pagination"> + <div class="pagination-info">第 {{ (queryForm.pageNum == 1) ? 1 : (queryForm.pageNum - 1) * + 15 + 1 }}-{{ + queryForm.pageNum * 15 }} 条/总共 {{ total }} 条</div> </el-pagination> </div> </div> @@ -36,17 +44,34 @@ } } }, + disAblePagination: { + type: Boolean, + default: false + }, height: { type: Number, default: () => Vue.prototype.$baseTableHeight() } }, methods: { + toggleRowSelection(row, selected) { + this.$refs.elTable.toggleRowSelection(row, selected) + this.$forceUpdate() + }, + clearSelection() { + this.$refs.elTable.clearSelection() + this.$forceUpdate() + }, handleCurrentChange(page) { this.$emit('handleCurrentChange', page) }, handleSizeChange(size) { - this.$emit('handleSizeChange', size) + if (this.disAblePagination) { + return + } else { + this.$emit('handleSizeChange', size) + } + } } } -- Gitblit v1.7.1