Browse Source

公海客户修改分页配置

lm 1 month ago
parent
commit
72aba88420

+ 8 - 3
src/baseComponents/Pagination.vue

@@ -1,7 +1,8 @@
 <template>
     <div class="page_pagination" v-if="!(hidePagination)">
-        <slot name="paginationDesc"></slot>
-
+        <div class="pagination_desc">
+            <slot name="paginationDesc"></slot>
+        </div>
         <el-pagination 
         :hide-on-single-page="props.hidesinglePage"
         :current-page="props.currentPage" 
@@ -53,5 +54,9 @@ const emit = defineEmits(['paginationChange'])
 
 
 <style lang="scss" scoped>
-
+.pagination_desc{
+  flex:1 1;
+  color: #666;
+  font-size: 14px;
+}
 </style>

+ 14 - 2
src/baseComponents/Table.vue

@@ -41,13 +41,16 @@
         </el-table>
 
         <div class="page_pagination" v-if="!(hidePagination)">
-          <!-- background layout="sizes, prev, pager, next"  -->
+          <div class="pagination_desc">
+            <slot name="paginationDesc"></slot>
+          </div>
           <el-pagination 
             :hide-on-single-page="props.hidesinglePage"
             :current-page="props.currentPage" 
             :page-size="props.pageSize" 
             :page-sizes="[20, 50, 100]" 
-            background layout="prev, pager, next" 
+            background 
+            :layout="(showPageSize ? 'sizes,' : '') +  'prev, pager, next'" 
             :total="Number(props.totalNum)" 
             @current-change="(val)=>emit('paginationChange',{type:'currentPage',val})" 
             @size-change="(val)=>emit('paginationChange',{type:'pageSize',val})" />
@@ -80,6 +83,10 @@ const props = defineProps({
     type:Number,
     default:1
   },
+  showPageSize:{
+    type:Boolean,
+    default:false
+  },
   pageSize:{
     type:Number,
     default:20
@@ -179,5 +186,10 @@ const HandleTableRowClassName = ({row,rowIndex}) => {
   }
 }
 
+.pagination_desc{
+  flex:1 1;
+  color: #666;
+  font-size: 14px;
+}
 
 </style>

+ 5 - 2
src/views/highSeasCustomer/highSeasCustomerDetail/index.vue

@@ -54,7 +54,7 @@
                 :showPageSize="true"
                 @paginationChange="HandleLogPaginationChange">
                 <template #paginationDesc>
-                    <span style="flex: 1 1;color: #666666;">共 {{totalNum}} 条数据</span>
+                    <span>共 {{totalNum}} 条数据</span>
                 </template>
             </Pagination>
             <template #close>
@@ -92,7 +92,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, computed, onMounted } from 'vue';
+import { ref, computed, onMounted, onUnmounted } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 
 import TopBackNav from '@/baseComponents/TopBackNav.vue';
@@ -436,6 +436,9 @@ onMounted(async ()=>{
     // 获取学校的基础信息
     customerBaseMsg.value = JSON.parse(sessionStorage.getItem('customerMsg') || '{}')    
 })
+onUnmounted(()=>{
+   sessionStorage.removeItem('customerMsg') 
+})
 
 </script>
 

+ 17 - 1
src/views/highSeasCustomer/index.vue

@@ -14,7 +14,8 @@
             </div>
             <FormSearchGroup :searchList="formSearchList" @searchChange="HandleSearchChange"></FormSearchGroup>
             <Table :tableColumns="publicSeasTableColumns" :tableData="tableData" 
-                :currentPage="currentPage" :pageSize="pageSize" :totalNum="totalNum">
+                :currentPage="currentPage" :pageSize="pageSize" :totalNum="totalNum"
+                :showPageSize="true" @paginationChange="HandlePaginationChange">
 
                 <template #num="{row,currentIndex}">
                     {{ currentIndex + pageSize * (currentPage - 1) }}
@@ -28,6 +29,10 @@
                         <span class="el_button_delete" @click="OpenDeleteDialog(row)">删除</span>
                     </div>
                 </template>
+
+                <template #paginationDesc>
+                    <span>共 {{ totalNum }} 条数据</span>
+                </template>
             </Table>
         </div>
 
@@ -209,6 +214,17 @@ const totalNum = ref(0)
 // 表格数据
 const tableData = ref([])
 
+
+const HandlePaginationChange = async (params)=>{
+    const {type,val} = params
+    if(type == 'currentPage'){
+        currentPage.value = val
+    }else if(type == 'pageSize'){
+        pageSize.value = val
+    }
+    await GetTableData()
+}
+
 const GetTableData = async ()=>{
     let params = {
         queryStr: searchParams.value.queryStr,