提交 747b0e07 编写于 作者: doc_wei's avatar doc_wei

树结构更新

上级 d3ec1f84
......@@ -124,7 +124,9 @@
a.id,
a.company_name title,
a.p_id parentId,
CASE a.p_id WHEN '0' THEN false ELSE true END isLast
CASE a.p_id WHEN '0' THEN false ELSE true END isLast,
'[{"type": "0", "isChecked": "0"}]' checkArr,
CASE a.p_id WHEN '0' THEN '1' ELSE '2' END level
FROM
company_mation a
ORDER BY a.p_id ASC
......
......@@ -772,6 +772,7 @@
<property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required,num" var="分页参数,第几页"/>
<property id="departmentName" name="departmentName" ref="" var="部门名称"/>
<property id="companyId" name="companyId" ref="" var="公司id"/>
</url>
<url id="companydepartment002" path="/post/CompanyDepartmentController/insertCompanyDepartmentMation" val="添加公司部门信息信息" allUse="1">
</url>
......
var rowId = "";
var companyId = "";
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -17,20 +19,28 @@ layui.config({
elem: "#demoTree1", //绑定元素
url: reqBasePath + 'companymation007', //异步接口
dataStyle: 'layuiStyle',
done: function(){
initLoatTable();//初始化加载表格
if(!isNull($("#demoTree1 li").eq(0))){
$("#demoTree1 li").eq(0).children('div').click();
}
}
});
//单击节点 监听事件
dtree.on("node('demoTree1')" ,function(param){
layer.msg(JSON.stringify(param));
companyId = param.nodeId;
loadTable();
});
function initLoatTable(){
//表格渲染
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: reqBasePath + 'companydepartment001',
where:{departmentName: $("#departmentName").val()},
where:{departmentName: $("#departmentName").val(), companyId: companyId},
even:true, //隔行变色
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
......@@ -38,7 +48,7 @@ layui.config({
cols: [[
{ title: '序号', type: 'numbers'},
{ field: 'departmentName', title: '部门名称', width: 180 },
{ field: 'departmentDesc', title: '部门简介', width: 180 },
{ field: 'departmentDesc', title: '部门简介', width: 400 },
{ field: 'userNum', title: '员工数', width: 180 },
{ field: 'createTime', title: '创建时间', width: 180 },
{ title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
......@@ -54,6 +64,7 @@ layui.config({
edit(data);
}
});
}
//搜索表单
form.render();
......@@ -121,7 +132,7 @@ layui.config({
});
function loadTable(){
table.reload("messageTable", {where:{departmentName: $("#departmentName").val()}});
table.reload("messageTable", {where:{departmentName: $("#departmentName").val(), companyId: companyId}});
}
exports('companydepartmentlist', {});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册