<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<title>industryList.html</title>
|
|
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
<meta http-equiv="description" content="this is my page">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
[@static_file /]
|
<script type="text/javascript">
|
var up_id = 0;
|
$(document).ready(function(){
|
$("#content").css({"height":$(document).height()*0.97});
|
var options = {
|
url : 'industryListJson.html',
|
singleSelect : true,
|
toolbar:'#tb',
|
border:true,
|
pagination:true,
|
pageSize:5,
|
pageList:[5,10,15,20],
|
fit:true,
|
queryParams : {
|
},
|
columns : [[
|
{field:'checkbox',title:"选择",checkbox:true},
|
{field:'ID',title:"ID",width:5,hidden:true},
|
{field:'SN',title:"顺序号",width:100,sortable:true},
|
{field:'INDUSTRY_NAME',title:"行业名称",width:100,sortable:true},
|
{field:'STATUS',title:"状态",width:100,sortable:true,
|
formatter: function(value,row,index){
|
if (row.STATUS == "1"){
|
return "在用";
|
} else if(row.STATUS == "2") {
|
return "禁用";
|
} else{
|
return "";
|
}
|
}
|
}
|
]]
|
};
|
|
$("#industryList").datagrid(initOptions(options));
|
|
$('#industryTree').tree({
|
url:'industryTree.html',
|
method:'get',
|
onBeforeExpand:function(node,param){
|
$('#industryTree').tree('options').url = "industryTree.html?Id="+node.id;
|
},
|
onClick: function(node){
|
up_id = node.id;
|
reloadDataGrid("industryList",{up_id:up_id});
|
}
|
});
|
});
|
|
function add(){
|
window.top.openDialog(0,50,50,'地址添加',$.http.getAbsoluteUrl('addIndustry.html?up_id='+up_id),{
|
buttons:[{text:"提交",iconCls:'icon-add',_handler:"_onFormSubmit()"},{text:"关闭",_handler:"closeWin()"}]
|
});
|
return false;
|
}
|
|
function modify(){
|
var row = $("#industryList").datagrid("getSelected");
|
if(row == null){alert("请选择要修改的数据");return false;}
|
window.top.openDialog(0,50,50,'修改功能',$.http.getAbsoluteUrl('addIndustry.html?id='+row.ID),{
|
buttons:[{text:"提交",iconCls:'icon-add',_handler:"_onFormSubmit()"},{text:"关闭",_handler:"closeWin()"}]
|
});
|
}
|
|
function disable(){
|
var row = $("#industryList").datagrid("getSelected");
|
if(row == null){alert("请选择要禁用的地址");return false;}
|
if(row.ADDRESS_STATUS == 2){alert("禁用失败,地址已处于禁用中");return false;}
|
if(!confirm('确定要禁用该地址吗?')) return false;
|
$.get("disable.html",{id:row.ID},function(data){
|
if(data == "1"){
|
alert('禁用成功!');
|
reloadDataGrid("industryList",{});
|
removeTreeNode("industryTree",row.ID);
|
} else {
|
alert('禁用失败,请重试!');
|
}
|
});
|
}
|
|
function able(){
|
var row = $("#industryList").datagrid("getSelected");
|
if(row == null){alert("请选择要启用的地址");return false;}
|
if(row.ADDRESS_STATUS == 1){alert("启用失败,地址已处于启用中");return false;}
|
if(!confirm('确定要启用该地址吗?')) return false;
|
$.get("able.html",{id:row.ID},function(data){
|
if(data == "1"){
|
alert('启用成功!');
|
reloadDataGrid("industryList",{});
|
reloadTree("industryTree");
|
} else {
|
alert('启用失败,状态已处于启用中!');
|
}
|
});
|
}
|
|
function del(){
|
var row = $("#industryList").datagrid("getSelected");
|
if(row == null){alert("请选择要删除的数据");return false;}
|
if(!confirm('确定要删除该数据吗?')) return false;
|
$.get("del.html", {id:row.ID},function(data){
|
if(data == "1"){
|
alert("该地址下存在正在使用的地址,不允许删除!");
|
} else {
|
reloadDataGrid("industryList",{up_id:up_id});
|
removeTreeNode("industryTree",row.ID);
|
alert('删除成功!');
|
}
|
});
|
}
|
</script>
|
</head>
|
|
<body>
|
<div style="float:left;width:15%">
|
<ul id="industryTree" class="easyui-tree"></ul>
|
</div>
|
<div id="content" style="float:right;width:85%" >
|
<div id="tb">
|
<a href="####" onclick="return add();" class="easyui-linkbutton" plain="true" data-options="iconCls:'icon-add'">添加</a>
|
<a href="####" onclick="return modify();" class="easyui-linkbutton" plain="true" data-options="iconCls:'icon-edit'">修改</a>
|
<a href="####" onclick="return disable()" class="easyui-linkbutton" plain="true" data-options="iconCls:'icon-remove'">禁用</a>
|
<a href="####" onclick="return able()" class="easyui-linkbutton" plain="true" data-options="iconCls:'icon-ok'">启用</a>
|
</div>
|
<table id="industryList"></table>
|
</div>
|
</body>
|
</html>
|