1、JSP页面
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<title>掌机查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript">
function show()
{
document.getElementById("signs1").style.display = "block";
document.getElementById("signs2").style.display = "none";
document.getElementById("tiaojian").style.display = "block";
}
function hidden()
{
document.getElementById("signs2").style.display = "block";
document.getElementById("signs1").style.display = "none";
document.getElementById("tiaojian").style.display = "none";
}
$(document).ready(function(){
$("#yingyong").onclick(getTerminals);
});
function getTerminals(){
var terminalareahtml = "";
var typeObj = eval("document.all.typeId");
var softObj = eval("document.all.softwareId");
var providerObj = eval("document.all.providerId");
var typeId = typeObj.options[typeObj.selectedIndex].value;
var softwareId = softObj.options[softObj.selectedIndex].value;
var providerId = providerObj.options[providerObj.selectedIndex].value;
alert(typeId+softwareId+providerId);
if(typeId != 0 || softId != 0 || providerId != 0){
$.ajax({
async: false,
cache: true,
type: 'post',
dataType : "json",
url: "getTerminals_ByIds", //请求的action路径
data: "typeId=" + typeId + "&softwareId=" + softwareId + "&providerId=" + providerId,
success:function(data){ //请求成功后处理函数。
setJSON = eval("("+data.result+")"); //把后台封装好的简单Json格式赋给对象
},
error:function(data){
alert("获取信息异常");
}
});
$("#terminalsarea").html("");
for(var i=0;i<setJSON.length;i++){
var html =
" <tr style='height: 25px; background-color: #F5F5F5;'>"
+" <td> "+ setJSON[i].id + "</td>"
+" <td>"+ setJSON[i].no + "</td>"
+" <td>"+ setJSON[i].terminalType.name + "</td>"
+" <td>"+ setJSON[i].hardVersion + "</td>"
+" <td>"+ setJSON[i].softwareId + "</td>"
+" <td>"+ setJSON[i].unitId + "</td>"
+" <td>"+ setJSON[i].operatorId + "</td>"
+" <td>"+ setJSON[i].memo + "</td>"
+" </tr>";
terminalareahtml += html;
}
$("#terminalsarea").html(terminalareahtml);
}else{
div.innerHTML = "";
}
}
</script>
</head>
<body class="contentBody" onload="changeParentPageNo()">
<!-- 过滤器 -->
<table width="90%" cellpadding="5" align="center" style="border:#999 1px solid;">
<tr>
<td style="padding-right:0px;" width="30px"><hr width="100%" /></td>
<td style="padding-left:0px; padding-right:0px;" width="10px">
<button type="button" onclick="hidden()" id="signs1" style="display:none; background: none; border: 0;">
<img src="images/signs1.jpg" height="8" width="10" />
</button>
<button type="button" onclick="show()" id="signs2" style="display:block; background: none; border: 0;">
<img src="images/signs2.jpg" height="10" width="8" />
</button>
</td>
<td style="padding-left:0px; padding-right:0px;" width="40px" align="left">过滤器</td>
<td style="padding-left:0px;"><hr width="100%" /></td>
</tr>
<tr id="tiaojian" style="display:none;">
<td colspan="4" style="text-align:left;">
<table width="80%" cellpadding="0" align="left"
style="border:#999 0px solid;">
<tr>
<td width="15%">
<input type="checkbox" checked="checked" name="typetiaojian" disabled="disabled">选择类型</td>
<td width="20%">
<select id="typeId" name="typeId"style="width:150px; display:block;" >
<option value="0">不限</option>
<s:iterator value="types" var="type">
<option value="${type.id }">${type.name }</option>
</s:iterator>
</select></td>
<td width="15%">
<input type="checkbox" checked="checked" name="softtiaojian" disabled="disabled">选择软件</td>
<td width="20%">
<select id="softwareId" name="softwareId" style="width:150px; display:block;" >
<option value="0">不限</option>
<s:iterator value="softwares" var="software">
<option value="${software.id }">${software.versionName }</option>
</s:iterator>
</select></td>
</tr>
<tr>
<td>
<input type="checkbox" checked="checked" name="providertiaojian" disabled="disabled">选择厂商</td>
<td>
<select id="providerId" name="providerId" style="width:150px; display:block;" >
<option value="0">不限</option>
<s:iterator value="providers" var="provider">
<option value="${provider.id }">${provider.name }</option>
</s:iterator>
</select></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="4" align="left">
<input type="button" id="yingyong" style="height: 18px; width: 50px;" value="应用" onclick="getTerminals()">
<input type="button" style="height: 18px; width: 50px;" value="取消" onclick="hidden()">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- 掌机列表 -->
<table width="90%" cellspacing="1" cellpadding="5" border="1"
align="center" id="tableSort"
style="background-color: whitesmoke; border-collapse: collapse">
<caption>
<span style="float: left;text-align: left;margin:10px 0;">
<img src="images/sitemap.gif" >
<a href="equipment/getAllTerminals">掌机列表</a>
</span>
</caption>
<tr style="height: 25px; background-color: #CCCCCC;">
<th onclick="$.sortTable.sort('tableSort',0)"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
掌机ID<span class="tableSort">↓</span>
</th>
<th onclick="$.sortTable.sort('tableSort',1)"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
掌机编号<span class="tableSort">↓</span>
</th>
<th onclick="$.sortTable.sort('tableSort',2)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
掌机类型<span class="tableSort">↓</span></th>
<th onclick="$.sortTable.sort('tableSort',3)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
硬件版本<span class="tableSort">↓</span></th>
<th onclick="$.sortTable.sort('tableSort',4)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
软件版本<span class="tableSort">↓</span></th>
<th onclick="$.sortTable.sort('tableSort',5)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
所属单位<span class="tableSort">↓</span></th>
<th onclick="$.sortTable.sort('tableSort',6)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
操作员ID<span class="tableSort">↓</span></th>
<th onclick="$.sortTable.sort('tableSort',7)" style="cursor: pointer;"
onmouseover="sortOver(this)" onmouseout="sortOut(this)" style="cursor: pointer;">
备注<span class="tableSort">↓</span></th>
</tr>
<tbody id="terminalsarea">
<s:iterator value="terminals" var="terminal">
<tr style="height: 25px; background-color: #F5F5F5;">
<td>${terminal.id}</td>
<td>${terminal.no}</td>
<td>${terminal.terminalType.name}</td>
<td>${terminal.hardVersion}</td>
<td>${terminal.softwareId}</td>
<td>${terminal.unitId}</td>
<td>${terminal.operatorId}</td>
<td>${terminal.memo}</td>
</tr>
</s:iterator>
</tbody>
</table>
</body>
</html>