瀏覽代碼

诊断依据,版本维护添加每页条数选择

zhouna 5 年之前
父節點
當前提交
8591c8b7de
共有 3 個文件被更改,包括 53 次插入31 次删除
  1. 18 18
      src/components/diagBase/DiagBase.vue
  2. 12 4
      src/components/diagBase/QuestionWords.vue
  3. 23 9
      src/components/icss/VersionInfo.vue

+ 18 - 18
src/components/diagBase/DiagBase.vue

@@ -75,34 +75,24 @@
                 </el-table-column>
             </el-table>
         <div class="pagination">
-            <el-pagination v-if="total>pageSize"
-                       :current-page.sync="currentPage"
+            <el-pagination :current-page.sync="currentPage"
                        @current-change="currentChange"
                        background
                        :page-size="pageSize"
-                       layout="total,prev, pager, next, jumper"
+                       :page-sizes="pageSizeArr"
+                       @size-change="handleSizeChange"
+                       :layout="pageLayout"
                        :total="total">
             </el-pagination>
         </div>
-        
         </div>
-       <!--  <div class="pagination">
-           <el-pagination v-if="total>pageSize"
-                      :current-page.sync="currentPage"
-                      @current-change="currentChange"
-                      background
-                      :page-size="pageSize"
-                      layout="total,prev, pager, next, jumper"
-                      :total="total">
-           </el-pagination>
-       </div> -->
-        
     </div>
 </template>
 
 <script>
 import api from '@api/diagBase.js';
 import apis from '@api/icss.js';
+import config from '@api/config.js';
 
 export default {
     name: 'diagBase',
@@ -117,7 +107,9 @@ export default {
                 hasQuestion: '', //有无问题词
             },
             currentPage: 1,
-            pageSize: 10,
+          pageSize: config.pageSize,
+          pageSizeArr:config.pageSizeArr,
+          pageLayout:config.pageLayout,
             total: 0,
             modifier: '',
         }
@@ -146,6 +138,10 @@ export default {
     })
   },
     methods: {
+      handleSizeChange(val){
+        this.pageSize = val;
+        this.getDataList();
+      },
         getDropList() {
           return apis.getKnowledgeEnums().then((res) =>{
               if(res.data.code === '0') {
@@ -171,8 +167,10 @@ export default {
         addDiagBase() {
           const pam = this.searched ? {
             currentPage: this.currentPage,
+            pageSize:this.pageSize,
             filter: this.filter
-          } : {currentPage: this.currentPage};
+          } : {currentPage: this.currentPage,
+            pageSize:this.pageSize};
           this.$router.push({name: 'AddDiagBase', params: pam});
         },
         verifyAllData() {
@@ -206,8 +204,10 @@ export default {
                     const item = Object.assign({},row,data);
                     const pam = this.searched ? {
                       currentPage: this.currentPage,
+                      pageSize:this.pageSize,
                       filter: this.filter
-                    } : {currentPage: this.currentPage};
+                    } : {currentPage: this.currentPage,
+                      pageSize:this.pageSize};
                     if(type == 'modify') {
                       this.$router.push({
                         name: 'AddDiagBase',

+ 12 - 4
src/components/diagBase/QuestionWords.vue

@@ -64,12 +64,13 @@
                 </el-table-column>
             </el-table>
         <div class="pagination">
-            <el-pagination v-if="total>pageSize"
-                       :current-page.sync="currentPage"
+            <el-pagination :current-page.sync="currentPage"
                        @current-change="currentChange"
                        background
                        :page-size="pageSize"
-                       layout="total,prev, pager, next, jumper"
+                       :page-sizes="pageSizeArr"
+                       @size-change="handleSizeChange"
+                       :layout="pageLayout"
                        :total="total">
             </el-pagination>
         </div>
@@ -82,6 +83,7 @@
 import api from '@api/diagBase.js';
 import apis from '@api/icss.js';
 import utils from '@api/utils.js';
+import config from '@api/config.js';
 
 export default {
     name: 'QuestionWords',
@@ -100,7 +102,9 @@ export default {
                 type:""
             },
             currentPage: 1,
-            pageSize: 10,
+            pageSize: config.pageSize,
+            pageSizeArr:config.pageSizeArr,
+            pageLayout:config.pageLayout,
             total: 0,
         }
     },
@@ -125,6 +129,10 @@ export default {
     })
   },
     methods: {
+      handleSizeChange(val){
+        this.pageSize = val;
+        this.getDataList();
+      },
         getValue(val) {
             // console.log('changeVal', val, this.filter.tagAdscription)
         },

+ 23 - 9
src/components/icss/VersionInfo.vue

@@ -74,12 +74,13 @@
                     </template>
                 </el-table-column>
             </el-table>
-            <el-pagination v-if="total>pageSize"
-                           :current-page.sync="currentPage"
+            <el-pagination :current-page.sync="currentPage"
                            @current-change="currentChange"
                            background
                            :page-size="pageSize"
-                           layout="total,prev, pager, next, jumper"
+                           :page-sizes="pageSizeArr"
+                           @size-change="handleSizeChange"
+                           :layout="pageLayout"
                            :total="total">
             </el-pagination>
         </div>
@@ -89,6 +90,7 @@
 
 <script>
   import api from '@api/icss.js';
+  import config from '@api/config.js';
 
   export default {
     name: 'VersionInfo',
@@ -97,7 +99,9 @@
         list: [],
         cacheData: {},
         currentPage: 1,
-        pageSize: 10,
+        pageSize: config.pageSize,
+        pageSizeArr:config.pageSizeArr,
+        pageLayout:config.pageLayout,
         total: 0,
         searched: false,
         filter: {
@@ -110,9 +114,11 @@
       }
     },
     created() {
-      this.getDataList();
-      let typeList = JSON.parse(localStorage.getItem("knowledgeEnumsData"));
-      this.typeList = typeList.productTypeEnum;
+      this.$nextTick(()=>{
+        this.getDataList();
+        let typeList = JSON.parse(localStorage.getItem("knowledgeEnumsData"));
+        this.typeList = typeList.productTypeEnum;
+    })
     },
     watch: {
       'filter': {
@@ -129,6 +135,10 @@
       })
     },
     methods: {
+      handleSizeChange(val){
+        this.pageSize = val;
+        this.getDataList();
+      },
       getProdType(item){
         let name = "";
         let type = item.productType;
@@ -143,8 +153,10 @@
         // 添加版本信息
         const pam = this.searched ? {
           currentPage: this.currentPage,
+          pageSize:this.pageSize,
           filter: this.filter
-        } : {currentPage: this.currentPage};
+        } : {currentPage: this.currentPage,
+          pageSize:this.pageSize};
         this.$router.push({
           name:'AddVersion',
           params: pam
@@ -153,8 +165,10 @@
       toEditVersion(row,flag){
         const pam = this.searched ? {
           currentPage: this.currentPage,
+          pageSize:this.pageSize,
           filter: this.filter
-        } : {currentPage: this.currentPage};
+        } : {currentPage: this.currentPage,
+          pageSize:this.pageSize};
         this.$router.push({
           name:'AddVersion',
           params: Object.assign(pam, {info: row, copy: flag})