From 55bf797dcc730b37bc691ebab2b51ff9db8ed245 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周二, 06 5月 2025 17:37:23 +0800 Subject: [PATCH] 修改代码样式 --- HIAWms/web/src/components/Table/components/pagination.vue | 88 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-) diff --git a/HIAWms/web/src/components/Table/components/pagination.vue b/HIAWms/web/src/components/Table/components/pagination.vue new file mode 100644 index 0000000..68f6dca --- /dev/null +++ b/HIAWms/web/src/components/Table/components/pagination.vue @@ -0,0 +1,88 @@ +<template> + <div v-if="!isHidePagination" class="pagination-content"> + <span class="info"> + {{ _t('鍏�') + totalCount + _t('鏉¤褰�') }} + {{ _t('褰撳墠绗�') + pageNum + _t('椤�') }} + {{ + _t('鍏�') + + (totalCount ? Math.ceil(totalCount / (pageSize || 1)) : 1) + + _t('椤�') + }} + {{ _t('姣忛〉') + (params.MaxResultCount || pageSize) + _t('鏉¤褰�') }} + </span> + <div class="pagination"> + <div class="information-pagination"> + <el-pagination + layout="prev, pager, next" + :total="Number(totalCount)" + size="small" + v-model:current-page="pageNum" + :page-size="params.MaxResultCount || pageSize" + @current-change="onCurrentChange" + /> + </div> + <div class="numb"> + {{ _t('绗�') }} + <el-input-number + @change="onChange" + :min="1" + :controls="false" + :max="max" + v-model="pageNum" + controls-position="right" + style="width: 58px; height: 30px" + /> + {{ _t('椤�') }} + </div> + </div> + </div> +</template> + +<script setup lang="ts"> +import { computed, nextTick, ref, reactive } from 'vue' +import type { ParamsItem, TablePropsItemType } from '../index.d' +import { useVModel } from '@vueuse/core' +import { _t } from '@/libs/Language/Language' + +interface paginationPropsType extends TablePropsItemType { + tableRef: Record<string, any> + pageNum: number + totalCount: number +} + +const props = defineProps<paginationPropsType>() + +const emit = defineEmits(['currentChange', 'change']) + +const params = computed<ParamsItem>(() => { + return props.params || {} +}) + +const pageNum = useVModel(props, 'pageNum', emit) +const totalCount = computed(() => { + return props.totalCount +}) + +const onChange = () => { + emit('change', Number(pageNum.value)) +} + +const max = computed(() => { + const total = props.url ? totalCount.value : props.total + const pageSize = props.pageSize || params.value.MaxResultCount + if (total && pageSize) { + return Math.ceil(total / pageSize) + } + return 1 +}) + +const onCurrentChange = (current: number) => { + emit('currentChange', current) +} +</script> +<style lang="scss"> +@import url('../index.scss'); +</style> +<style lang="scss" scoped> +@import url('../index.module.scss'); +</style> -- Gitblit v1.9.3