wangfumin 1 settimana fa
parent
commit
e8e6c9a723

+ 8 - 8
src/components/pc/Paging/index.vue

@@ -1,4 +1,4 @@
-<script setup lang="ts">
+<script setup>
 import { onMounted, ref, computed, watch } from 'vue'
 const emit = defineEmits(['maxPage', 'clickHandle', 'input'])
 const props = defineProps({
@@ -31,7 +31,7 @@ const props = defineProps({
     default: '#2d2d2d'
   }
 })
-const index = ref<number>(props.value)
+const index = ref(props.value)
 const maxPage = computed(() => {
   let val = Math.ceil(props.total / props.equable)
   emit('maxPage', val)
@@ -40,16 +40,16 @@ const maxPage = computed(() => {
 const pages = computed(() => {
   return getPageNumArr(props.length, index.value, maxPage.value)
 })
-const useUser = useUserStore()
-useUser.getInfo()
+// const useUser = useUserStore()
+// useUser.getInfo()
 // 监听过滤数据变化更新总数
-watch(index.value, (newVal: number) => {
+watch(index.value, (newVal) => {
   emit('input', newVal)
 })
-watch(props.current, (newVal: number) => {
+watch(props.current, (newVal) => {
   index.value = newVal
 })
-watch(props.total, (newVal: number) => {
+watch(props.total, (newVal) => {
   if (index.value > maxPage.value) {
     index.value = maxPage.value
     clickHandle(maxPage.value)
@@ -59,7 +59,7 @@ onMounted(() => {
   emit('maxPage', maxPage)
 })
 function clickHandle(indexs) {
-  if (indexs > 0 && indexs <= this.maxPage) {
+  if (indexs > 0 && indexs <= maxPage.value) {
     index.value = indexs
   }
   emit('clickHandle', index.value)

+ 8 - 1
src/views/pc/information/components/MemberTable.vue

@@ -110,11 +110,18 @@
           v-model:page-size="form.pageSize"
           :total="total"
           :page-sizes="[10, 20, 50, 100]"
-          layout="total, sizes, prev, pager, next, jumper"
+          layout="total, sizes, prev, pager, next, jumper" 
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           class="pagination"
         />
+
+        <Paging
+            v-if="total"
+            :total="total"
+            :current="form.pageNum"
+            @clickHandle="pageChange"
+          />
         
         <div v-if="total === 0 && !loading" class="no-data">
           <div class="no-data-img"></div>