99 lines
4.4 KiB
Plaintext
99 lines
4.4 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
<%@ include file="/webpage/include/taglib.jsp"%>
|
|
<html>
|
|
<head>
|
|
<title>机构管理</title>
|
|
<meta name="decorator" content="default"/>
|
|
<%@include file="/webpage/include/treetable.jsp" %>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var tpl = $("#treeTableTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
var data = ${fns:toJson(list)}, rootId = "${not empty office.parent.id ? office.parent.id : '0'}";
|
|
// alert("rootId="+rootId);
|
|
addRow("#treeTableList", tpl, data, rootId, true);
|
|
$("#treeTable").treeTable({expandLevel : 5});
|
|
});
|
|
function addRow(list, tpl, data, pid, root){
|
|
for (var i=0; i<data.length; i++){
|
|
var row = data[i];
|
|
// alert("row.parentId="+(${fns:jsGetVal('row.parentId')}));
|
|
if ((${fns:jsGetVal('row.parentId')}) == pid){
|
|
$(list).append(Mustache.render(tpl, {
|
|
dict: {
|
|
type: getDictLabel(${fns:toJson(fns:getDictList('sys_office_type'))}, row.type)
|
|
}, pid: (root?0:pid), row: row
|
|
}));
|
|
addRow(list, tpl, data, row.id);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
function refresh(){//刷新或者排序,页码不清零
|
|
|
|
window.location="${ctx}/sys/office/list";
|
|
}
|
|
</script>
|
|
<script type="text/javascript">
|
|
window.onload= loadRefresh;
|
|
function loadRefresh(){
|
|
//删除之后刷新树
|
|
parent.refreshTree();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<sys:message content="${message}"/>
|
|
|
|
<!-- 工具栏 -->
|
|
<div class="wrapper wrapper-list-content">
|
|
<div class="col-sm-12" style="padding-bottom:5px">
|
|
<div class="pull-right">
|
|
<shiro:hasPermission name="sys:office:add">
|
|
<table:addRow url="${ctx}/sys/office/form?selectPid=${office.selectPid}&parent.id=${office.id}" title="机构" width="800px" height="450px" target="officeContent"></table:addRow><!-- 增加按钮 -->
|
|
</shiro:hasPermission>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table id="treeTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable" style="width: 100%">
|
|
<thead><tr><th><nobr>机构名称</nobr>
|
|
</th>
|
|
<th style="width: 18%"><nobr>归属区域</nobr></th>
|
|
<th style="width: 18%"><nobr>机构编码</nobr></th>
|
|
<th style="width: 18%"><nobr>机构类型</nobr></th>
|
|
<shiro:hasPermission name="sys:office:edit">
|
|
<th style="width: 55px;">操作</th></shiro:hasPermission></tr></thead>
|
|
<tbody id="treeTableList"></tbody>
|
|
<!-- <input type="text" name="selectPid" id="selectPid" value=""/> -->
|
|
</table>
|
|
<%-- <shiro:hasPermission name="sys:office:view"> --%>
|
|
<%-- <a href="###" onclick="openDialogView('查看机构', '${ctx}/sys/office/form?id={{row.id}}','800px', '620px')" class="btn btn-info btn-xs" ><i class="fa fa-search-plus"></i> </a> --%>
|
|
<%-- </shiro:hasPermission> --%>
|
|
|
|
<script type="text/template" id="treeTableTpl">
|
|
<tr id="{{row.id}}" pId="{{pid}}">
|
|
<td class="query-datatable-nowrap"><a href="###" onclick="openDialogView('查看机构', '${ctx}/sys/office/form?id={{row.id}}','800px', '450px')">
|
|
<label class="query-datatable-nowrap td-fixed-width-250" title="{{row.name}}">
|
|
{{row.name}}</label></a></td>
|
|
<td class="query-datatable-nowrap">
|
|
{{row.area.name}}</td>
|
|
<td class="query-datatable-nowrap">
|
|
<label class="query-datatable-nowrap td-fixed-width-150" title="{{row.code}}">{{row.code}}</label></td>
|
|
<td class="query-datatable-nowrap">{{dict.type}}</td>
|
|
<td class="query-datatable-nowrap">
|
|
<shiro:hasPermission name="sys:office:edit">
|
|
<a href="###" title="修改" onclick="openDialog('修改机构', '${ctx}/sys/office/form?id={{row.id}}&selectPid=${office.selectPid}','800px', '450px', 'officeContent')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> </a>
|
|
</shiro:hasPermission>
|
|
<shiro:hasPermission name="sys:office:del">
|
|
<a href="${ctx}/sys/office/delete?id={{row.id}}&selectPid=${office.selectPid}" title="删除" onclick="return confirmx('要删除该机构及所有子机构项吗?', this.href)" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> </a>
|
|
</shiro:hasPermission>
|
|
<shiro:hasPermission name="sys:office:add">
|
|
<a href="###" title="添加下级机构" onclick="openDialog('添加下级机构', '${ctx}/sys/office/form?parent.id={{row.id}}&selectPid=${office.selectPid}','800px', '450px', 'officeContent')" class="btn btn-primary btn-xs"><i class="fa fa-plus"></i> </a>
|
|
</shiro:hasPermission>
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
|
|
</body>
|
|
</html> |