修复排序功能

This commit is contained in:
chiguangxu
2018-03-19 16:55:26 +08:00
parent ee297945b9
commit 117614311d
5 changed files with 58 additions and 6 deletions

View File

@@ -68,7 +68,16 @@
<if test="dobeginDate!=null and dobeginDate!='' and doendDate!=null and doendDate!=''">
AND r.edit_time between #{dobeginDate} and #{doendDate}
</if>
order by r.create_time desc
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.create_time desc
</otherwise>
</choose>
</select>
<!-- 根据来函号查询 -->
<select id="getRequestInfoByRequestNumber" parameterType="java.lang.String" resultMap="BaseResultMap">

View File

@@ -10,10 +10,15 @@
$(document).ready(function() {
var orderBy = $("#${id}").val().split(" ");
$(".sort-column").each(function(){
if ($(this).hasClass(orderBy[0])){
orderBy[1] = orderBy[1]&&orderBy[1].toUpperCase()=="DESC"?"down":"up";
$(this).html($(this).html()+" <i class=\"icon icon-arrow-"+orderBy[1]+"\"></i>");
$(this).html($(this).html()+" <i class=\"sort-icon-"+orderBy[1]+"\"></i>");
}else {
$(this).html($(this).html()+" <i class=\"sort-icon\"></i>");
}
});
$(".sort-column").click(function(){
var order = $(this).attr("class").split(" ");
@@ -23,10 +28,11 @@
}
if (order == sort[0]){
sort = (sort[1]&&sort[1].toUpperCase()=="DESC"?"ASC":"DESC");
$("#${id}").val(order+" DESC"!=order+" "+sort?"":order+" "+sort);
$("#${id}").val(order+" "+sort);
}else{
$("#${id}").val(order+" ASC");
}
${callback}
});
});

View File

@@ -37,6 +37,8 @@
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${requestInfo.isFilterAction }"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
@@ -180,11 +182,12 @@
<th><spring:message code="content"></spring:message></th>
<th><spring:message code="special_task"></spring:message></th>
<th><spring:message code="creator"/></th>
<th><spring:message code="create_time"/></th>
<th class="sort-column createTime"><spring:message code="create_time"/></th>
<th><spring:message code="editor"/></th>
<th><spring:message code="edit_time"/></th>
<th class="sort-column editTime"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"></spring:message></th>
<th><spring:message code="audit_time"></spring:message></th>
<th class="sort-column auditTime"><spring:message code="audit_time"></spring:message></th>
</tr>
</thead>
<tbody>

View File

@@ -21574,5 +21574,39 @@ Color library demo
margin-right: 3px;
}
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ*/
.sort-column {
cursor: pointer;
}
.sort-column i {
top: 2px;
position: relative;
display: inline-table;
}
.sort-icon {
width: 9px;
height: 13px;
background-image: url('../img/bee.png');
background-position: -232px -59px;
}
.sort-icon-down {
width: 9px;
height: 12px;
background-image: url('../img/bee.png');
background-position: -232px -73px;
}
.sort-icon-up {
width: 9px;
height: 13px;
background-image: url('../img/bee.png');
background-position: -232px -86px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB