caipin 5 роки тому
батько
коміт
d41bab6d46
3 змінених файлів з 54 додано та 5 видалено
  1. 6 2
      Gruntfile.js
  2. 44 0
      global/js/cloud/page.js
  3. 4 3
      views/cloud/curing.html

+ 6 - 2
Gruntfile.js

@@ -7,11 +7,15 @@ module.exports = function(grunt) {
     
     	concat: {//任务名称
             curing: {
-                src: ['global/js/cloud/curing.js','global/js/cloud/curingFN.js','global/js/cloud/curingHtml.js'],
+                src: ['global/js/cloud/curing.js','global/js/cloud/curingFN.js','global/js/cloud/curingHtml.js',
+                		'global/js/cloud/page.js','global/js/tools.js','global/js/columnShow/columnShow.js',
+                		'global/js/contacts/buildHtml.js'],
                 dest: 'global/js/cloud/curing.concat.js'
             },
             build:{
-                src: ['global/js/cloud/build.js','global/js/cloud/buildFN.js','global/js/cloud/buildHtml.js'],
+                src: ['global/js/cloud/build.js','global/js/cloud/buildFN.js','global/js/cloud/buildHtml.js',
+            		'global/js/cloud/page.js','global/js/tools.js','global/js/columnShow/columnShow.js',
+            		'global/js/contacts/buildHtml.js'],
                 dest: 'global/js/cloud/build.concat.js'
             },
         },

+ 44 - 0
global/js/cloud/page.js

@@ -0,0 +1,44 @@
+//构建养护用户分页
+function fnPage(data){
+    var html='<ul  class="pagination pagination-sm">';
+    if( data.previousPage == 0) {
+        html+='<li class="page-item disabled"><span class="page-link" aria-label="Previous"> <span aria-hidden="true"><i class="fal fa-chevron-left"></i></span> </span> </li>';
+    }else{
+        html+='<li class="page-item "> <a' +
+            ' parameter="'+ data.parameter+'" currentPage="'+ data.previousPage +'" class="page-link" href="javascript:void(0)" aria-label="Previous"> <span aria-hidden="true"><i class="fal fa-chevron-left"></i></span> </a> </li>';
+    }
+
+    if( data.currentPage>=data.pageWidth ) {
+    	html+='<li class="page-item">'+
+    		'<a parameter="'+data.parameter+'" currentPage="1" class="page-link" href="javascript:void(0)">1</a></li><li class="page-item "><span ><span aria-hidden="true">...</span></span></li>';
+    }
+    
+    for (i = data.startPage; i <= data.endPage; i++) {
+        if(data.currentPage == i){
+            html+='<li class="page-item active" aria-current="page"> <span class="page-link"> ' +
+                ''+ i +'<span class="sr-only">(current)</span> </span> </li>';
+        }else{
+            html+='<li class="page-item">' +
+                ' <a parameter="'+data.parameter+'" currentPage="'+i+'" class="page-link" href="javascript:void(0)">' +
+                ''+i+'</a> ' +
+                '</li>';
+        }
+    }
+
+    if( data.totalPage >data.pageWidth && data.totalPage!= data.currentPage ) {
+    	html+='<li class="page-item "><span><span aria-hidden="true">...</span></span></li>';
+    }
+    
+    
+    if( data.nextPage == data.currentPage||data.totalPage==0) {
+        html+='<li class="page-item disabled"> <span class="page-link"  aria-label="Next"> <span aria-hidden="true"><i class="fal fa-chevron-right"></i></span> </span> </li>';
+    }else{
+        html+='<li class="page-item"> <a ' +
+            'parameter="'+ data.parameter +'" currentPage="'+ data.nextPage +'" class="page-link" href="#" aria-label="Next"  > <span aria-hidden="true"><i class="fal fa-chevron-right"></i></span> </a> </li>';
+    }
+    html+='</ul>';
+    
+    
+    $('div[pageDetail]').html(html);
+    $('div[page]').show();
+}

+ 4 - 3
views/cloud/curing.html

@@ -1,15 +1,16 @@
 <% include ../header.html %>
-<script src="<%= WEB_SITE_GLOBAL %>js/pagination/page.js"></script>
-<script src="<%= WEB_SITE_GLOBAL %>js/tools.js"></script>
+
 <script src="<%= WEB_SITE_GLOBAL %>js/jquery-3.4.1.min.js"></script>
 
 
+<script src="<%= WEB_SITE_GLOBAL %>js/tools.js"></script>
+
+<script src="<%= WEB_SITE_GLOBAL %>js/cloud/page.js"></script>
 <script src="<%= WEB_SITE_GLOBAL %>js/cloud/curing.js"></script>
 <script src="<%= WEB_SITE_GLOBAL %>js/cloud/curingFN.js"></script>
 <script src="<%= WEB_SITE_GLOBAL %>js/cloud/curingHtml.js"></script>
 
 
-<script src="<%= WEB_SITE_GLOBAL %>js/contacts/client.js"></script>
 <script src="<%= WEB_SITE_GLOBAL %>js/contacts/buildHtml.js"></script>