📄 index.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@ taglib uri="/WEB-INF/htxx-tag.tld" prefix="hxtg"%>
<html>
<head>
<title>部门信息</title>
<hxtg:head></hxtg:head>
<script type='text/javascript' src='../dwr/engine.js'></script>
<script type='text/javascript' src='../dwr/util.js'></script>
<script type='text/javascript' src='../hxtg/public/dwr/util.js'></script>
<script type='text/javascript' src='../dwr/interface/DepartmentBus.js'></script>
</head>
<body onload="init()">
<div id="listDiv">
<hxtg:title text="部门信息列表">
<hxtg:titleitem><hxtg:button text="添加" onclick="add()"/></hxtg:titleitem>
</hxtg:title>
<hxtg:table>
<hxtg:thead>
<hxtg:theaditem text="序号" width="10%"></hxtg:theaditem>
<hxtg:theaditem text="部门名称"></hxtg:theaditem>
<hxtg:theaditem text="操作" width="10%"></hxtg:theaditem>
</hxtg:thead>
<hxtg:tbody>
<hxtg:tr>
<hxtg:td><hxtg:item id="rownum"/></hxtg:td>
<hxtg:td><hxtg:item id="departmentName"/></hxtg:td>
<hxtg:td>
<hxtg:button id="edit" onclick="edit(this.id)" text="编辑" type="edit"></hxtg:button>
<hxtg:button id="delete" onclick="del(this.id)" text="删除" type="del"></hxtg:button>
</hxtg:td>
</hxtg:tr>
</hxtg:tbody>
</hxtg:table>
<hxtg:tfoot tbody="tbody" action="init"></hxtg:tfoot>
</div>
<p></p>
<div id="singleDiv" style="visibility:hidden;position:absolute;width:100%;height:680px;overflow:hidden">
<iframe id="iframe1" name="iframe1" width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0"></iframe>
</div>
</body>
<script type="text/javascript">
function init(condition){
dwr.util.useLoadingMessage("查询部门信息");
if(condition){condition=iniCondition;}
DepartmentBus.findDepartment(condition,function(resultset){fillResult("tbody",resultset)});
}
function setSrc(func){
var timeout = 1000;
if(!$("iframe1").src){$("iframe1").src="department.jsp";}
else{timeout = 50;}
window.setTimeout(func,timeout);
}
function add(){
$("listDiv").style.display="none";
setSrc(function(){
var win = ifrwindow($("iframe1"));
if(win===null){return;}
win.add();
$("singleDiv").style.visibility="visible";
});
}
function edit(eleid){
$("listDiv").style.display="none";
setSrc(function(){
setCurrent(eleid);
var id = getCurObj().departmentId;
var win = ifrwindow($("iframe1"));
if(!win||win===null){return;}
win.edit(id);
$("singleDiv").style.visibility="visible";
});
}
function del(eleid){
delObj(eleid,"tbody",function(obj){
if(confirm("是否确定删除'"+obj.departmentName+"'?")){
DepartmentBus.deleteDepartment(obj.departmentId);
init();
return true;}});
}
function goback(){
$("listDiv").style.display="";
$("singleDiv").style.visibility="hidden";
}
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -