main
kgdxpr 6 months ago
parent 2fe47d623a
commit e60f768399

@ -0,0 +1,261 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>职工信息管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../../static/css/font.css">
<link rel="stylesheet" href="../../static/css/weadmin.css">
<link rel="stylesheet" href="../../lib/ztree/zTreeStyle.css">
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.inline {
display: inline-block;
vertical-align: top;
}
.layui-table-body {
/*max-height: 400px;*/
overflow-y: auto;
}
#searchTxt {
width: 180px;
border: 1px solid #dedede;
border-radius: 3px;
height: 37px;
padding-left: 13px;
vertical-align: top;
}
#search {
border: none;
margin-left: 12px;
}
#iconDel {
position: absolute;
right: 92px;
top: 10px;
display: none;
}
.aaa {
background-color: #FBFBFB;
border: 1px solid #e6e6e6;
color: #C9C9C9;
cursor: not-allowed;
opacity: 1;
}
</style>
</head>
<body>
<div class="weadmin-body">
<table border=0 align=left width="100%">
<tr>
<td align=left valign=top style="BORDER-RIGHT: #999999 1px dashed;width:170px" id="first_td">
<div class="selectModel" id="treeDiv">
<div class='pc_selectModel_tree'>
<div class='ztree' id='mytree'></div>
</div>
</div>
</td>
<td align=left valign=top style="padding-left:10px">
<div class="layui-form-item">
<table class="layui-table" lay-filter="demo" id="idTest"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="res">配置资源</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="resetpwd">重置密码</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="unBind">微信解绑</a>
</script>
</div>
</td>
</tr>
</table>
</div>
<script src="../../lib/layui/layui.js"></script>
<script src="../../lib/jquery-3.6.0.min.js"></script>
<script src="../../lib/ztree/jquery.ztree.core-3.5.min.js"></script>
<script>
layui.extend({
admin: '{/}../../static/js/admin'
});
layui.use(['form', 'jquery', 'admin', 'table', 'laytpl'], function () {
var form = layui.form,
$ = layui.jquery,
admin = layui.admin,
table = layui.table,
laytpl = layui.laytpl;
var org_id = "";
var area_id = GetQueryString('area_id');
var org_type_id = GetQueryString('org_type_id');//单位类型iD
var setting1 = {
view: {
selectedMulti: false
},
data: {
simpleData: {
enable: true,
idKey: "org_id",
pIdKey: "parent_id",
rootPId: 0
}
},
callback: {
onClick: zTreeOnClick,
}
};
$.ajax({
type: "GET",
async: false,
url: '/dsBase/organization/getOrgTreeByBureauId?bureau_id=0E0B7FED-AB9B-417E-8BA5-521DACAC5E78',
dataType: "json",
success: function (data) {
if (data.code == 0) {
for (var i = 0; i < data.data.length; i++) {
data.data[i].name = data.data[i].org_name;
}
var zNodes = data.data;
var jquery = window.$.fn.zTree;
jquery.init($("#mytree"), setting1, zNodes);
var treeObj = jquery.getZTreeObj("mytree");
$("#dep_id").val(org_id);
var parentNode = "";
if ($("#click_id").val() !== "") {
getTeaList($("#click_id").val());
parentNode = treeObj.getNodeByParam("org_id", $("#click_id").val());// 选中指定节点
} else {
parentNode = treeObj.getNodeByParam("org_id", $("#dep_id").val());// 选中指定节点
getTeaList(org_id);
}
treeObj.selectNode(parentNode);
treeObj.expandAll(true);
}
}
});
$("#treeDiv").height($(window).height() - 80);
// 点击区划树
function zTreeOnClick(event, treeId, treeNode) {
console.log(treeNode.org_id);
$("#dep_id").val(treeNode.org_id);
$("#click_id").val(treeNode.org_id);
getTeaList(treeNode.org_id);
}
// org_id获取列表
function getTeaList(id) {
// 教师列表渲染
table.render({
elem: '#idTest'
, url: '/dsBase/teacher/getTeacherListByOrgId'
, where: {
org_id: id,
person_name: $("#searchTxt").val()
}
, cols: [[
{ type: 'checkbox', fixed: 'left', align: 'center' }
, { field: '', title: '序号', align: 'center', type: 'numbers', width: 80, fixed: true }
, { field: 'person_name', title: '职工姓名', align: 'center' }
, { field: 'xb', title: '性别', align: 'center' }
, { field: 'login_name', title: '登录名', align: 'center' }
, { field: 'original_pwd', title: '初始密码', align: 'center' }
, { fixed: 'right', title: '操作', toolbar: '#barDemo', align: 'center', width: 400, fixed: 'right' }
]]
, page: true
, done: function () {
$("[data-field='xb']").children().each(function () {
if ($(this).text() == '1') {
$(this).text("男")
} else if ($(this).text() == '2') {
$(this).text("女")
}
})
$(".aaa").hover(function () {
$(this).css('color', '#C9C9C9')
}, function () {
})
}
});
}
table.on('tool(demo)', function (obj) {
var data = obj.data;
if (obj.event === 'del') {
layer.confirm('确定删除 ' + data.person_name + ' 吗?', { icon: 0 }, function (index) {
del(data.person_id);
});
}
});
// 表格重载
window.reloadtable = function () {
console.log("sel1=" + $("#sel1").val())
table.reload('idTest', {
where: {
org_id: $("#sel1").val(),
person_name: $("#searchTxt").val()
}
, page: {
curr: 1
}
});
}
$(window).resize(function () {
console.log(window.height);
console.log(window.innerWidth);
$(".layui-table-view").css('width', window.innerWidth - 235);
$(".layui-table-view").height(window.height)
})
})
</script>
</body>
</html>
Loading…
Cancel
Save