hn_cloud_web/czl-screen/pages/home/mainList.html

189 lines
7.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="../../layui/css/layui.css">
<link rel="stylesheet" href="../../css/mainList.css">
<style type="text/css">
.table-bordered,
.table-bordered>tbody>tr>td,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>td,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>thead>tr>th {
border: 0px solid #ddd;
}
th {
text-align: center;
}
</style>
</head>
<body>
<div class="figure">
<div class="figures">
<div style="padding-top: 5%;">
<img src="../../img/home/name.png" style="margin-left: 20%; margin-top: -2%;">
<span style="font-size: 18px;color: #ffffff;">形象进度</span>
</div>
</div>
</div>
<div class="time">2023-10-1011:15:18</div>
<div class="tou">
<div class="head centers">
线路承载力看板
</div>
<div class="main">
<div style="height: 7%;width: 100%;margin-top: 2%;">
<input id="username" type="text" class="form-control" placeholder="用户名"
style="border: 1px solid #1B6098;width: 9%;float:left;height: 35px;">
<select class="form-control " id="status"
style="width: 9%;float:left;border: 1px solid #1B6098;background-color: transparent;height: 35px;margin-left: 5px;">
</select>
<select class="form-control " id="status"
style="width: 9%;float:left;border: 1px solid #1B6098;background-color: transparent;height: 35px;margin-left: 5px;">
</select>
<input id="username" type="text" class="form-control" placeholder="用户名"
style="border: 1px solid #1B6098;width: 9%;float:left;height: 35px;margin-left: 5px;">
<input id="username" type="text" class="form-control" placeholder="用户名"
style="border: 1px solid #1B6098;width: 9%;float:left;height: 35px;margin-left: 5px;">
<button class="layui-btn " onclick="location.href='addUser.html'"
style="width: 5%;float:left;height: 35px;margin-left: 5px;background-color: #099EF1;">
添加
</button>
<button class="layui-btn " onclick="location.href='addUser.html'"
style="width: 5%;float:left;height: 35px;margin-left: 5px;background-color: transparent;border: 1px solid #1B6098;">
添加
</button>
<button class="layui-btn " onclick="location.href='addUser.html'"
style="width: 5%;float:left;height: 35px;margin-left: 5px;background-color: transparent;border: 1px solid #1B6098;">
添加
</button>
</div>
<div style="height: 85%;width: 100%;">
<div class="widget-body no-padding">
<table id="dt-table" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr style="border: 1px solid #1B509C;background-color: #0A2559;color: #ffffff;">
<th>username</th>
<th>昵称</th>
<th>手机号</th>
<th>邮箱</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../js/publicJs.js"></script>
<script type="text/javascript" src="../../js/libs/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jq.js"></script>
<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/dict.js"></script>
<script type="text/javascript">
layui.use(['layer'], function () {
var layer = layui.layer;
});
var userStatus = showDictSelect("status", "userStatus", true);
var pers = checkPermission();
var example;
function init() {
example =
$('#dt-table').DataTable({
"searching": false,
"processing": false,
"serverSide": true,
"language": {
"url": contentPath + "/js/plugin/datatables/Chinese.lang"
},
"ajax": {
"url": ctxPath + "/users",
"type": "get",
"data": function (d) {
d.username = $('#username').val();
d.nickname = $('#nickname').val();
d.status = $('#status').val();
},
"error": function (xhr, textStatus, errorThrown) {
var msg = xhr.responseText;
console.log(msg);
var response = JSON.parse(msg);
var code = response.code;
var message = response.message;
if (code == 400) {
layer.msg(message);
} else if (code == 401) {
localStorage.removeItem("token");
layer.msg("token过期请先登录", { shift: -1, time: 1000 }, function () {
location.href = pagesPath + '/login.html';
});
} else if (code == 403) {
console.log("未授权:" + message);
layer.msg('未授权');
} else if (code == 500) {
layer.msg('系统错误:' + message);
}
}
},
"dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-10 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-10' p v>>",
"columns": [
{ "data": "username", "defaultContent": "" },
{ "data": "nickname", "defaultContent": "" },
{ "data": "phone", "defaultContent": "" },
{ "data": "email", "defaultContent": "" },
{
"data": "status",
"defaultContent": "",
"render": function (data, type, row) {
return userStatus[data];
}
},
{
"data": "",
"defaultContent": "",
"orderable": false,
"render": function (data, type, row) {
var id = row['id'];
var href = "updateUser.html?id=" + id;
var edit = buttonEdit(href, "sys:user:add", pers);
return edit;
}
},
],
"order": [[0, "desc"], [1, "asc"]]
});
}
$("#searchBt").click(function () {
example.ajax.reload();
});
// init();
</script>