liyangzheng 1 year ago
parent
commit
f9ea732d8a
3 changed files with 17 additions and 16 deletions
  1. 10 13
      src/components/Pagination/index.vue
  2. 1 1
      src/layout/indexCommon.vue
  3. 6 2
      src/views/search/index.vue

+ 10 - 13
src/components/Pagination/index.vue

@@ -1,16 +1,8 @@
 <template>
   <div :class="{ 'hidden': hidden }" class="pagination-container">
-    <el-pagination
-      :background="background"
-      v-model:current-page="currentPage"
-      v-model:page-size="pageSize"
-      :layout="layout"
-      :page-sizes="pageSizes"
-      :pager-count="pagerCount"
-      :total="total"
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-    />
+    <el-pagination :background="background" v-model:current-page="currentPage" 
+      :layout="layout"  :pager-count="pagerCount" :total="total" @size-change="handleSizeChange"
+      @current-change="handleCurrentChange" />
   </div>
 </template>
 
@@ -72,7 +64,7 @@ const pageSize = computed({
   get() {
     return props.limit
   },
-  set(val){
+  set(val) {
     emit('update:limit', val)
   }
 })
@@ -96,10 +88,15 @@ function handleCurrentChange(val) {
 
 <style scoped>
 .pagination-container {
+  width: auto;
   background: #fff;
-  padding: 32px 16px;
+  padding: 302px 16px;
 }
+
 .pagination-container.hidden {
   display: none;
 }
+.pagination-container .el-pagination{
+  right: 20px;
+}
 </style>

+ 1 - 1
src/layout/indexCommon.vue

@@ -355,7 +355,7 @@ const toSearch = async () => {
     keyword: searchText.value,
     isAsc: "asc",
     orderByColumn: "createTime",
-    pageSize: 3,
+    pageSize: 10,
     pageNum: 1,
   };
   const res = await flieSearch(query);

+ 6 - 2
src/views/search/index.vue

@@ -72,7 +72,9 @@
               </template>
             </el-table-column>
           </el-table>
-          <Pagination :total="total" :page="page" :limit="limit" @pagination="pagination"></Pagination>
+          <div class="pageBox">
+            <Pagination :total="total" :page="page" :limit="limit" @pagination="pagination"></Pagination>
+          </div>
         </div>
         <div v-else>
           <!-- 平铺 -->
@@ -193,6 +195,7 @@ const handleCurrentChange = (val) => {
   page.value = val;
 };
 const pagination = async (obj) => {
+  console.log(obj,'page');
   isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc");
   const query = {
     keyword: searchText.value,
@@ -249,7 +252,7 @@ const setIcon = (fileType) => {
 const setType = (fileType) => {
   switch (fileType) {
     case "doc":
-      return [".txt", ".ppt", ".pdf", ".docx", ".csv", ".wps", ".xls",'.pptxs'];
+      return [".txt", ".ppt", ".pdf", ".docx", ".csv", ".wps", ".xls", '.pptxs'];
       break;
     case "img":
       return [".png", ".jpg", ".jpeg"];
@@ -294,6 +297,7 @@ onBeforeRouteUpdate((to, from) => {
   height: calc(98vh - 48px - 8px - 32px - 8px);
   background-color: #fff;
   border-radius: 4px;
+  overflow: hidden;
 }
 
 .searchTitle {