Ver código fonte

优化分页组件

wuxw 6 anos atrás
pai
commit
34b3337f55

+ 2 - 2
WebService/src/main/resources/components/paginationPackage/pagination.html

@@ -1,4 +1,4 @@
-<nav aria-label="Page navigation example">
+<nav aria-label="Page navigation example" v-if="paginationInfo.total != 0">
     <ul class="pagination justify-content-end">
         <li class="page-item" v-bind:class="{disabled:paginationInfo.currentPage == 1}">
             <a class="page-link" v-on:click="current(1)"> « </a>
@@ -15,6 +15,6 @@
         <li class="page-item" v-bind:class="{disabled:paginationInfo.currentPage == paginationInfo.total}">
             <a class="page-link" v-on:click="current(paginationInfo.total)"> » </a>
         </li>
-        <span class="total" style="line-height: 30px;margin-left: 10px;">共 {{paginationInfo.total}} 条</span>
+        <span class="total" style="line-height: 30px;margin-left: 10px;" v-if="paginationInfo.dataCount != 0">共 {{paginationInfo.dataCount}} 条</span>
     </ul>
 </nav>

+ 4 - 1
WebService/src/main/resources/components/paginationPackage/pagination.js

@@ -5,7 +5,8 @@
     vc.extends({
         data: {
             paginationInfo: {
-                total: 0,
+                total:0,
+                dataCount: 0,
                 currentPage: 1,
                 pageList: []
             }
@@ -13,12 +14,14 @@
         _initEvent: function () {
             vc.component.$on('pagination_info_event', function (_paginationInfo) {
                 vc.component.paginationInfo.total = _paginationInfo.total;
+                vc.component.paginationInfo.dataCount = _paginationInfo.dataCount;
                 vc.component.paginationInfo.currentPage = _paginationInfo.currentPage;
                 vc.component._freshPageList();
             });
 
             vc.on('pagination', 'init', function (_paginationInfo) {
                 vc.component.paginationInfo.total = _paginationInfo.total;
+                vc.component.paginationInfo.dataCount = _paginationInfo.dataCount;
                 vc.component.paginationInfo.currentPage = _paginationInfo.currentPage;
                 vc.component._freshPageList();
             });

+ 1 - 0
WebService/src/main/resources/components/serviceRegisterPackage/serviceRegister-manage/serviceRegisterManage.js

@@ -58,6 +58,7 @@
                         vc.component.serviceRegisterManageInfo.serviceRegisters = _serviceRegisterManageInfo.serviceRegisters;
                         vc.emit('pagination', 'init', {
                             total: vc.component.serviceRegisterManageInfo.records,
+                            dataCount: vc.component.serviceRegisterManageInfo.total,
                             currentPage: _page
                         });
                     }, function (errInfo, error) {