caipin 5 年之前
父節點
當前提交
c38443c666
共有 2 個文件被更改,包括 35 次插入57 次删除
  1. 4 56
      app/service/cloudEditionService.js
  2. 31 1
      views/cloud/curing.html

+ 4 - 56
app/service/cloudEditionService.js

@@ -92,7 +92,6 @@ var cloudService={
         
         //console.log(compilationList);
         
-        
         //数据组合--cld客户数据
         var cid=[];
         curingCloudList.forEach(function(v,i){
@@ -143,7 +142,6 @@ var cloudService={
             			break;
             		}
             	}
-            
             }
             
         });
@@ -157,60 +155,6 @@ var cloudService={
         
         
         return {curingList:curingCloudList,pageData:pageData};
-        
-        
-        
-        
-        
-    	
-    	//获得本地用户
-    	/*var limit=12;
-        var offset=0;
-        if(page!=1){
-            var pg=page-1;
-            offset=pg*limit;
-        }
-
-        var option={offset: offset,
-            limit: limit,
-            raw:true,
-            order:[['id','desc']]};
-        if(hash.isExistence(compilation_id)){
-            option.where={compilation_id: compilation_id};
-        }
-
-        var curingList = await models.cloud_curing.findAll(option);
-        var parameter='?compilation_id='+compilation_id;
-        //分页计算
-        var pageData = await getPage(models.cloud_curing,option.where,page,limit,parameter);
-        
-        
-        //数据组合--cld客户数据
-        var cid=[];
-        curingList.forEach(function(v,i){
-            cid.push(v.client_id);
-        });
-        var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
-        var clientList = await models.CLD_client.findAllInCid(cid,attributes);
-
-        
-        //组合页面需要展示的数据
-        curingList.forEach(function(v,i){
-            curingList[i].clientInfo={};
-            clientList.forEach(function(clientVal,clientI){
-                if(v.client_id==clientVal.cid){
-                    curingList[i].clientInfo=clientVal;
-                }
-            });
-
-            curingList[i].addtime=moment.unix(v.addtime).format('YYYY-MM-DD HH:mm');
-            curingList[i].id=hash.hashEncode(v.id.toString());
-            curingList[i].client_id=hash.hashEncode(v.client_id.toString());
-            curingList[i].sso_id=v.sso_id;
-        });
-        //curingList['pageData']=pageData;
-
-        return {curingList:curingList,pageData:pageData};*/
     },
 
     //获得本地编办列表
@@ -537,6 +481,10 @@ var getPage= async function(modelsTable,where,currentPage,pageSize,parameter,tot
     }
     var totalPage = (totalCount % pageSize) == 0 ? total : total + 1;
 
+    //开始页数
+    //var startPage=
+    //结束页数
+    
     var page={
         'currentPage':currentPage,  //当前页
         'previousPage':currentPage!=0?currentPage-1:currentPage,    //上一页

+ 31 - 1
views/cloud/curing.html

@@ -176,7 +176,19 @@
                                             </li>
                                             <% }; %>
 
-                                            <% for (i = 1; i <= pageData.totalPage; i++) {  %>
+						<% if( pageData.currentPage>=3 ) {  %>
+								
+	  							<li class="page-item">
+                                   <a parameter="<%= pageData.parameter %>" currentPage="1" class="page-link" href="javascript:void(0)">1</a>
+                                </li>
+	  							<li class="page-item disabled">
+	                                                <span class="page-link" aria-label="Previous">
+	                                                    <span aria-hidden="true">...</span>
+	                                                </span>
+	                             </li>
+ 						<% }; %>
+
+                                            <% for (i = 1; i <= 10; i++) {  %>
                                                 <% if( pageData.currentPage == i) {  %>
                                                 <li class="page-item active" aria-current="page">
                                                     <span class="page-link">
@@ -190,6 +202,24 @@
                                                 <% }; %>
                                             <% }; %>
 
+<% if( pageData.currentPage<3 && pageData.totalPage>5 ) {  %>
+<li class="page-item">
+     <a parameter="<%= pageData.parameter %>" currentPage="4" class="page-link" href="javascript:void(0)">4</a>
+</li>
+<li class="page-item">
+     <a parameter="<%= pageData.parameter %>" currentPage="5" class="page-link" href="javascript:void(0)">5</a>
+</li>
+
+<% }; %>
+
+ 											<% if( pageData.totalPage >3 && pageData.totalPage!= pageData.currentPage ) {  %>
+												<li class="page-item disabled">
+	                                                <span class="page-link" aria-label="Previous">
+	                                                    <span aria-hidden="true">...</span>
+	                                                </span>
+	                                            </li>
+											  <% }; %>
+
                                             <% if( pageData.currentPage == pageData.nextPage) {  %>
                                             <li class="page-item disabled">
                                                 <span class="page-link"  aria-label="Next">