用户列表选择,改为左树右表结构,增加组织机构树
This commit is contained in:
@@ -344,7 +344,7 @@ public class LoginController extends BaseController{
|
|||||||
CookieUtils.setCookie(response, "skinName_" + loginInfo.getId(), skinName);
|
CookieUtils.setCookie(response, "skinName_" + loginInfo.getId(), skinName);
|
||||||
return REDIRECT + adminPath + "/index";
|
return REDIRECT + adminPath + "/index";
|
||||||
}
|
}
|
||||||
return "modules/sys/sysSwitchSkin";
|
return "modules/sys/switchSkin";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,62 +1,79 @@
|
|||||||
<% layout('/layouts/default.html', {title: '用户选择', libs: ['dataGrid']}){ %>
|
<% layout('/layouts/default.html', {title: '用户选择', libs: ['layout', 'zTree', 'dataGrid']}){ %>
|
||||||
<div class="main-content">
|
<div class="ui-layout-west">
|
||||||
<div class="box box-main">
|
<div class="box box-main">
|
||||||
<div class="box-body">
|
<div class="box-header">
|
||||||
<#form:form id="searchForm" model="${empUser}" action="${ctx}/sys/empUser/listData" method="post" class="form-inline "
|
<div class="box-title">
|
||||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
<i class="fa icon-grid"></i> ${text('组织机构')}
|
||||||
<#form:hidden name="status" value="${isNotBlank(empUser.status) ? empUser.status : '0'}"/>
|
</div>
|
||||||
<#form:hidden name="isAll" value="${parameter.isAll}"/>
|
<div class="box-tools pull-right">
|
||||||
<div class="form-group">
|
<button type="button" class="btn btn-box-tool" id="btnExpand" title="${text('展开')}" style="display:none;"><i class="fa fa-chevron-up"></i></button>
|
||||||
<label class="control-label">${text('账号')}:</label>
|
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="${text('折叠')}"><i class="fa fa-chevron-down"></i></button>
|
||||||
<div class="control-inline">
|
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="${text('刷新')}"><i class="fa fa-refresh"></i></button>
|
||||||
<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ui-layout-content">
|
||||||
|
<div id="tree" class="ztree"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ui-layout-center">
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="box box-main">
|
||||||
|
<div class="box-body pb0">
|
||||||
|
<#form:form id="searchForm" model="${empUser}" action="${ctx}/sys/empUser/listData" method="post" class="form-inline "
|
||||||
|
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||||
|
<#form:hidden name="status" value="${isNotBlank(empUser.status) ? empUser.status : '0'}"/>
|
||||||
|
<#form:hidden name="isAll" value="${parameter.isAll}"/>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">${text('账号')}:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<#form:input path="loginCode" maxlength="100" class="form-control width-90"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="control-label">${text('昵称')}:</label>
|
||||||
<label class="control-label">${text('昵称')}:</label>
|
<div class="control-inline">
|
||||||
<div class="control-inline">
|
<#form:input path="userName" maxlength="100" class="form-control width-90"/>
|
||||||
<#form:input path="userName" maxlength="100" class="form-control width-90"/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="control-label">${text('姓名')}:</label>
|
||||||
<label class="control-label">${text('姓名')}:</label>
|
<div class="control-inline">
|
||||||
<div class="control-inline">
|
<#form:input path="refName" maxlength="100" class="form-control width-90"/>
|
||||||
<#form:input path="refName" maxlength="100" class="form-control width-90"/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="control-label">${text('机构')}:</label>
|
||||||
<label class="control-label">${text('机构')}:</label>
|
<div class="control-inline width-90">
|
||||||
<div class="control-inline width-90">
|
<#form:treeselect id="office" title="${text('机构选择')}"
|
||||||
<#form:treeselect id="office" title="${text('机构选择')}"
|
path="employee.office.officeCode" labelPath="employee.office.officeName"
|
||||||
path="employee.office.officeCode" labelPath="employee.office.officeName"
|
url="${ctx}/sys/office/treeData" btnClass="btn-sm" allowClear="true" canSelectParent="true"/>
|
||||||
url="${ctx}/sys/office/treeData" btnClass="btn-sm" allowClear="true" canSelectParent="true"/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="control-label">${text('公司')}:</label>
|
||||||
<label class="control-label">${text('公司')}:</label>
|
<div class="control-inline width-90">
|
||||||
<div class="control-inline width-90">
|
<#form:treeselect id="company" title="${text('公司选择')}"
|
||||||
<#form:treeselect id="company" title="${text('公司选择')}"
|
path="employee.company.companyCode" labelPath="employee.company.companyName"
|
||||||
path="employee.company.companyCode" labelPath="employee.company.companyName"
|
url="${ctx}/sys/company/treeData" btnClass="btn-sm" allowClear="true" canSelectParent="true"/>
|
||||||
url="${ctx}/sys/company/treeData" btnClass="btn-sm" allowClear="true" canSelectParent="true"/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="control-label">${text('手机')}:</label>
|
||||||
<label class="control-label">${text('手机')}:</label>
|
<div class="control-inline">
|
||||||
<div class="control-inline">
|
<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
|
||||||
<#form:input path="mobile" maxlength="100" class="form-control width-90"/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
</div>
|
||||||
</div>
|
</#form:form>
|
||||||
</#form:form>
|
<div class="col-xs-10 p0 pr10">
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-10 pr10">
|
|
||||||
<table id="dataGrid"></table>
|
<table id="dataGrid"></table>
|
||||||
<div id="dataGridPage"></div>
|
<div id="dataGridPage"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-2 pl0">
|
<div class="col-xs-2 p0">
|
||||||
<div id="selectData" class="tags-input"></div>
|
<div id="selectData" class="tags-input"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,6 +82,53 @@
|
|||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<script>
|
<script>
|
||||||
|
// 初始化布局
|
||||||
|
$('body').layout({
|
||||||
|
west__size: 200,
|
||||||
|
onresize_end: function(){
|
||||||
|
$('#dataGrid').dataGrid('resize');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//树结构初始化加载
|
||||||
|
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
|
||||||
|
callback:{onClick:function(event, treeId, treeNode){
|
||||||
|
tree.expandNode(treeNode);
|
||||||
|
//$('button[type=reset]').click();
|
||||||
|
$('#officeCode').val(treeNode.id);
|
||||||
|
$('#officeName').val(treeNode.name);
|
||||||
|
page(1);
|
||||||
|
}}
|
||||||
|
}, tree, loadTree = function(){
|
||||||
|
js.ajaxSubmit("${ctx}/sys/office/treeData?___t=" + new Date().getTime(),
|
||||||
|
{ctrlPermi:'${@Global.getConfig("user.adminCtrlPermi", "2")}'/*1拥有的权限 2管理的权限*/}, function(data){
|
||||||
|
tree = $.fn.zTree.init($("#tree"), setting, data);//.expandAll(true);
|
||||||
|
// 展开第一级节点
|
||||||
|
var nodes = tree.getNodesByParam("level", 0);
|
||||||
|
for(var i=0; i<nodes.length; i++) {
|
||||||
|
tree.expandNode(nodes[i], true, false, false);
|
||||||
|
}
|
||||||
|
// 展开第二级节点
|
||||||
|
// nodes = tree.getNodesByParam("level", 1);
|
||||||
|
// for(var i=0; i<nodes.length; i++) {
|
||||||
|
// tree.expandNode(nodes[i], true, false, false);
|
||||||
|
// }
|
||||||
|
}, null, null, js.text('loading.message'));
|
||||||
|
};loadTree();
|
||||||
|
// 工具栏按钮绑定
|
||||||
|
$('#btnExpand').click(function(){
|
||||||
|
tree.expandAll(true);
|
||||||
|
$(this).hide();
|
||||||
|
$('#btnCollapse').show();
|
||||||
|
});
|
||||||
|
$('#btnCollapse').click(function(){
|
||||||
|
tree.expandAll(false);
|
||||||
|
$(this).hide();
|
||||||
|
$('#btnExpand').show();
|
||||||
|
});
|
||||||
|
$('#btnRefresh').click(function(){
|
||||||
|
loadTree();
|
||||||
|
});
|
||||||
|
// 加载用户列表
|
||||||
var selectData = ${isNotBlank(selectData!) ? selectData! : "{\}"},
|
var selectData = ${isNotBlank(selectData!) ? selectData! : "{\}"},
|
||||||
selectNum = 0, dataGrid = $('#dataGrid').dataGrid({
|
selectNum = 0, dataGrid = $('#dataGrid').dataGrid({
|
||||||
searchForm: $("#searchForm"),
|
searchForm: $("#searchForm"),
|
||||||
@@ -83,8 +147,9 @@ selectNum = 0, dataGrid = $('#dataGrid').dataGrid({
|
|||||||
return JSON.stringify(row);
|
return JSON.stringify(row);
|
||||||
}}
|
}}
|
||||||
],
|
],
|
||||||
|
// autoGridWidthFix: 100,
|
||||||
autoGridHeight: function(){
|
autoGridHeight: function(){
|
||||||
var height = $(window).height() - $('#searchForm').height() - $('#dataGridPage').height() - 75;
|
var height = $(window).height() - $('#searchForm').height() - $('#dataGridPage').height() - 70;
|
||||||
$('.tags-input').height($('.ui-jqgrid').height() - 10);
|
$('.tags-input').height($('.ui-jqgrid').height() - 10);
|
||||||
return height;
|
return height;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ selectNum = 0, dataGrid = $('#dataGrid').dataGrid({
|
|||||||
}}
|
}}
|
||||||
],
|
],
|
||||||
autoGridHeight: function(){
|
autoGridHeight: function(){
|
||||||
var height = $(window).height() - $('#searchForm').height() - $('#dataGridPage').height() - 75;
|
var height = $(window).height() - $('#searchForm').height() - $('#dataGridPage').height() - 74;
|
||||||
$('.tags-input').height($('.ui-jqgrid').height() - 10);
|
$('.tags-input').height($('.ui-jqgrid').height() - 10);
|
||||||
return height;
|
return height;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user