去除首页面,优化命名,优化schema
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
<script src="{{ url_for('static', filename='admin/component/layui/layui.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='admin/component/pear/pear.js') }}"></script>
|
||||
@@ -1,229 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>部门新增</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">部门名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="deptName" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="dept-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="dept-table" lay-filter="dept-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="dept-toolbar">
|
||||
{% if authorize("admin:dept:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:dept:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="dept-bar">
|
||||
{% if authorize("admin:dept:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:dept:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="dept-status">
|
||||
<input type="checkbox" name="status" value="{{ "{{ d.deptId }}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="dept-enable"
|
||||
{{ "{{# if(d.status==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let treetable = layui.treetable
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/dept/'
|
||||
|
||||
window.render = function () {
|
||||
treetable.render({
|
||||
treeColIndex: 1,
|
||||
treeSpid: 0,
|
||||
treeIdName: 'deptId',
|
||||
treePidName: 'parentId',
|
||||
skin: 'line',
|
||||
method: 'post',
|
||||
treeDefaultClose: false,
|
||||
toolbar: '#dept-toolbar',
|
||||
elem: '#dept-table',
|
||||
url: '/dept/data',
|
||||
page: false,
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox' },
|
||||
{ field: 'deptName', minWidth: 200, title: '部门名称' },
|
||||
{ field: 'leader', title: '负责人' },
|
||||
{ field: 'phone', title: '联系方式' },
|
||||
{ field: 'email', title: '邮箱' },
|
||||
{ field: 'address', title: '详细地址' },
|
||||
{ field: 'status', title: '状态', templet: '#dept-status' },
|
||||
{ field: 'sort', title: '排序', width: 100 },
|
||||
{ title: '操作', templet: '#dept-bar', width: 120, align: 'center' }
|
||||
]
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
form.on('submit(dept-query)', function (data) {
|
||||
var keyword = data.field.deptName
|
||||
var $tds = $('#dept-table').next('.treeTable').find('.layui-table-body tbody tr td')
|
||||
if (!keyword) {
|
||||
$tds.css('background-color', 'transparent')
|
||||
layer.msg('请输入关键字', { icon: 5 })
|
||||
return
|
||||
}
|
||||
var searchCount = 0
|
||||
$tds.each(function () {
|
||||
$(this).css('background-color', 'transparent')
|
||||
if ($(this).text().indexOf(keyword) >= 0) {
|
||||
$(this).css('background-color', 'rgba(250,230,160,0.5)')
|
||||
if (searchCount === 0) {
|
||||
$('body,html').stop(true)
|
||||
$('body,html').animate({ scrollTop: $(this).offset().top - 150 }, 500)
|
||||
}
|
||||
searchCount++
|
||||
}
|
||||
})
|
||||
if (searchCount === 0) {
|
||||
layer.msg('没有匹配结果', { icon: 5 })
|
||||
} else {
|
||||
treetable.expandAll('#dept-table')
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
render()
|
||||
|
||||
table.on('tool(dept-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(dept-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
{#window.batchRemove(obj)#}
|
||||
console.log(table.checkStatus(obj.config.id).data)
|
||||
}
|
||||
})
|
||||
|
||||
form.on('switch(dept-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/dept/' + operate,
|
||||
data: JSON.stringify({ deptId: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该部门', { icon: 3, title: '提示' }, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['deptId'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -1,263 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">角色名</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="roleName" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<label class="layui-form-label">角色标识</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="roleCode" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="role-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="role-table" lay-filter="role-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/html" id="role-toolbar">
|
||||
{% if authorize("admin:role:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:role:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="role-bar">
|
||||
{% if authorize("admin:role:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:role:power") %}
|
||||
<button class="pear-btn pear-btn-warming pear-btn-sm" lay-event="power"><i
|
||||
class="layui-icon layui-icon-vercode"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:role:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="role-enable">
|
||||
<input type="checkbox" name="enable" value="{{ "{{d.id}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="role-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/admin/role/'
|
||||
|
||||
let cols = [
|
||||
[
|
||||
{% if authorize("admin:role:remove") %}
|
||||
{ type: 'checkbox' },
|
||||
{% endif %}
|
||||
{ title: '角色名', field: 'roleName', align: 'center', width: 100 },
|
||||
{ title: 'Key值', field: 'roleCode', align: 'center' },
|
||||
{ title: '描述', field: 'details', align: 'center' },
|
||||
{ title: '是否可用', field: 'enable', align: 'center', templet: '#role-enable' },
|
||||
{ title: '排序', field: 'sort', align: 'center' },
|
||||
{ title: '操作', toolbar: '#role-bar', align: 'center', width: 195 }
|
||||
]
|
||||
]
|
||||
|
||||
table.render({
|
||||
elem: '#role-table',
|
||||
url: MODULE_PATH + 'data',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
toolbar: '#role-toolbar',
|
||||
defaultToolbar: [{
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
})
|
||||
|
||||
table.on('tool(role-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
} else if (obj.event === 'power') {
|
||||
window.power(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(role-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
window.batchRemove(obj)
|
||||
}
|
||||
})
|
||||
|
||||
form.on('submit(role-query)', function (data) {
|
||||
table.reload('role-table', { where: data.field })
|
||||
return false
|
||||
})
|
||||
|
||||
form.on('switch(role-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/role/' + operate,
|
||||
data: JSON.stringify({ roleId: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 })
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['500px', '500px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.power = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '授权',
|
||||
shade: 0.1,
|
||||
area: ['320px', '400px'],
|
||||
content: MODULE_PATH + 'power/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['500px', '500px'],
|
||||
content: MODULE_PATH + 'edit/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该角色', { icon: 3, title: '提示' }, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['id'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.batchRemove = function (obj) {
|
||||
let data = table.checkStatus(obj.config.id).data
|
||||
if (data.length === 0) {
|
||||
layer.msg('未选中数据', {
|
||||
icon: 3,
|
||||
time: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
var hasCheck = table.checkStatus('role-table')
|
||||
var hasCheckData = hasCheck.data
|
||||
if (hasCheckData.length > 0) {
|
||||
$.each(hasCheckData, function (index, element) {
|
||||
ids.push(element.id)
|
||||
})
|
||||
}
|
||||
console.log(ids)
|
||||
layer.confirm('确定要删除选中角色', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
|
||||
url: MODULE_PATH + 'batchRemove',
|
||||
data: { ids: ids },
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
table.reload('role-table')
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.refresh = function () {
|
||||
table.reload('role-table')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -1,79 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>角色授权</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
<div class="main-container">
|
||||
<ul id="role-power" class="dtree" data-id="0"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="power-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-sm">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['dtree', 'form', 'jquery'], function () {
|
||||
let dtree = layui.dtree
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
|
||||
dtree.render({
|
||||
elem: '#role-power',
|
||||
method: 'get',
|
||||
url: '/admin/role/getRolePower/' + {{id}},
|
||||
dataFormat: 'list',
|
||||
checkbar: true,
|
||||
skin: 'layui',
|
||||
initLevel: '1',
|
||||
checkbarType: 'self',
|
||||
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' },
|
||||
})
|
||||
|
||||
form.on('submit(power-save)', function (data) {
|
||||
let param = dtree.getCheckbarNodesParam('role-power')
|
||||
let ids = ''
|
||||
for (let i = 0; i < param.length; i++) {
|
||||
let id = param[i].nodeId
|
||||
ids += id + ','
|
||||
}
|
||||
ids = ids.substr(0, ids.length - 1)
|
||||
data.field.roleId = {{id}};
|
||||
data.field.powerIds = ids
|
||||
|
||||
$.ajax({
|
||||
url: '/admin/role/saveRolePower',
|
||||
data: data.field,
|
||||
dataType: 'json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,327 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/user.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{# 查询表单 #}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="" lay-filter="user-query-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="realName" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<label class="layui-form-label">账号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-left user-collasped">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="button button-primary user-group" user-group=""> 全 部 用 户</div>
|
||||
<div class="button button-default user-group" user-group="-1"> 默 认 分 组</div>
|
||||
<div style="overflow: auto">
|
||||
<ul id="dept-tree" class="dept-tree" data-id="0"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{# 用户表格 #}
|
||||
<div class="user-main user-collasped">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="user-table" lay-filter="user-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{# 表格操作 #}
|
||||
<script type="text/html" id="user-toolbar">
|
||||
{% if authorize("admin:user:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="pear-icon pear-icon-add"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:user:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="pear-icon pear-icon-ashbin"></i>
|
||||
删除
|
||||
</button>
|
||||
{% endif %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="collasped">
|
||||
<i class="pear-icon pear-icon-modular"></i>
|
||||
高级
|
||||
</button>
|
||||
</script>
|
||||
|
||||
{# 用户修改操作 #}
|
||||
<script type="text/html" id="user-bar">
|
||||
{% if authorize("admin:user:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="pear-icon pear-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:user:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="pear-icon pear-icon-ashbin"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
{# 启动与禁用 #}
|
||||
<script type="text/html" id="user-enable">
|
||||
<input type="checkbox" name="enable" value="{{ "{{ d.id }}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="user-enable"
|
||||
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }} />
|
||||
</script>
|
||||
|
||||
{# 用户注册时间 #}
|
||||
<script type="text/html" id="user-createTime">
|
||||
{{ ' {{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
|
||||
{# 用户更新时间 #}
|
||||
<script type="text/html" id="user-updateTime">
|
||||
{{ ' {{layui.util.toDateString(d.update_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'dtree', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let dtree = layui.dtree
|
||||
let popup = layui.popup
|
||||
let common = layui.common
|
||||
let MODULE_PATH = '/admin/user/'
|
||||
|
||||
// 表格数据
|
||||
let cols = [
|
||||
[
|
||||
{% if authorize("admin:user:remove") %}
|
||||
{ type: 'checkbox' },
|
||||
{% endif %}
|
||||
{ title: '姓名', field: 'realname', align: 'center', width: 110 },
|
||||
{ title: '账号', field: 'username', align: 'center' },
|
||||
{ title: '部门', field: 'dept_name', align: 'center' },
|
||||
{ title: '启用', field: 'enable', align: 'center', templet: '#user-enable', width: 120 },
|
||||
{ title: '注册时间', field: 'create_at', templet: '#user-createTime', align: 'center' },
|
||||
{ title: '更新时间', field: 'update_at', templet: '#user-updateTime', align: 'center' },
|
||||
{ title: '操作', toolbar: '#user-bar', align: 'center', width: 130 }
|
||||
]
|
||||
]
|
||||
|
||||
// 渲染表格数据
|
||||
table.render({
|
||||
elem: '#user-table',
|
||||
url: MODULE_PATH + 'data',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
height: 'full-148',
|
||||
toolbar: '#user-toolbar', /*工具栏*/
|
||||
text: { none: '暂无人员信息' },
|
||||
defaultToolbar: [{ layEvent: 'refresh', icon: 'layui-icon-refresh' }, 'filter', 'print', 'exports'] /*默认工具栏*/
|
||||
})
|
||||
|
||||
// 公司部门树状图菜单
|
||||
dtree.render({
|
||||
elem: '#dept-tree',
|
||||
method: 'get',
|
||||
url: '/dept/tree',
|
||||
dataFormat: 'list',
|
||||
line: true,
|
||||
skin: 'laySimple',
|
||||
icon: '-1',
|
||||
response: { treeId: 'deptId', parentId: 'parentId', title: 'deptName' },
|
||||
})
|
||||
|
||||
// 菜单栏渲染
|
||||
dtree.on('node(\'dept-tree\')', function (obj) {
|
||||
let field = form.val('user-query-form') /*用户账号查询*/
|
||||
field.deptId = obj.param.nodeId
|
||||
window.refresh(field)
|
||||
})
|
||||
|
||||
//
|
||||
$('.user-group').click(function () {
|
||||
let group = $(this).attr('user-group')
|
||||
let field = form.val('user-query-form')
|
||||
if (group === '-1') {
|
||||
field.deptId = group
|
||||
$(this).removeClass('button-default')
|
||||
$(this).prev().removeClass('button-primary')
|
||||
$(this).prev().addClass('button-default')
|
||||
$(this).addClass('button-primary')
|
||||
} else {
|
||||
field.deptId = group
|
||||
$(this).removeClass('button-default')
|
||||
$(this).next().removeClass('button-primary')
|
||||
$(this).next().addClass('button-default')
|
||||
$(this).addClass('button-primary')
|
||||
}
|
||||
window.refresh(field)
|
||||
})
|
||||
|
||||
table.on('tool(user-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(user-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
window.batchRemove(obj)
|
||||
} else if (obj.event === 'collasped') {
|
||||
$('.user-left').toggleClass('user-collasped')
|
||||
$('.user-main').toggleClass('user-collasped')
|
||||
table.resize()
|
||||
}
|
||||
})
|
||||
|
||||
form.on('submit(user-query)', function (data) {
|
||||
window.refresh(data.field)
|
||||
return false
|
||||
})
|
||||
|
||||
form.on('switch(user-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/user/' + operate,
|
||||
data: JSON.stringify({ userId: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['550px', '550px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['550px', '500px'],
|
||||
content: MODULE_PATH + 'edit/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该用户', { icon: 3, title: '提示' }, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['id'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.batchRemove = function (obj) {
|
||||
let data = table.checkStatus(obj.config.id).data
|
||||
if (data.length === 0) {
|
||||
layer.msg('未选中数据', {
|
||||
icon: 3,
|
||||
time: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
var hasCheck = table.checkStatus('user-table')
|
||||
var hasCheckData = hasCheck.data
|
||||
if (hasCheckData.length > 0) {
|
||||
$.each(hasCheckData, function (index, element) {
|
||||
ids.push(element.id)
|
||||
})
|
||||
}
|
||||
{#console.log(ids);#}
|
||||
layer.confirm('确定要删除选中角色', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
|
||||
url: MODULE_PATH + 'batchRemove',
|
||||
data: { ids: ids },
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
table.reload('user-table')
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.refresh = function (param) {
|
||||
table.reload('user-table', { where: param })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/403.svg') }}" alt="">
|
||||
<img src="{{ url_for('static', filename='system/admin/images/403.svg') }}" alt="">
|
||||
<div class="content-r">
|
||||
<h1>403</h1>
|
||||
<p>抱歉,你无权访问该页面</p>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/404.svg') }}" alt="">
|
||||
<img src="{{ url_for('static', filename='system/admin/images/404.svg') }}" alt="">
|
||||
<div class="content-r">
|
||||
<h1>404</h1>
|
||||
<p>抱歉,你访问的页面不存在或仍在开发中</p>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/component/pear/css/pear.css') }}" rel="stylesheet"/>
|
||||
<link href="{{ url_for('static', filename='system/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>admin/
|
||||
<div class="content">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/500.svg') }}" alt="">
|
||||
<img src="{{ url_for('static', filename='system/admin/images/500.svg') }}" alt="">
|
||||
<div class="content-r">
|
||||
<h1>500</h1>
|
||||
<p>抱歉,服务器出错了</p>
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>pear-admin-flask</title>
|
||||
<meta name="description" content="pear-admin-flask">
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='index/layui/css/layui.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='index/css/main.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='index/css/load.css') }}"/>
|
||||
<style>
|
||||
.layui-nav .layui-this:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-nav .layui-nav-bar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- header -->
|
||||
<div class="ew-header">
|
||||
<img class="layui-logo" src="{{ url_for('static', filename='index/images/un28.svg') }}"
|
||||
style="height:50px;padding: 10px;"/>
|
||||
<div class="ew-nav-group">
|
||||
<div class="nav-toggle"><i class="layui-icon layui-icon-more-vertical"></i></div>
|
||||
<ul class="layui-nav" lay-filter="ew-header-nav">
|
||||
<li class="layui-nav-item">
|
||||
<a lay-href="/">首页</a>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="/admin" target="_blank">后台</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- banner -->
|
||||
<div class="ew-banner" style="box-shadow: 0 0 8px rgba(0,0,0,.101562);">
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space25" style="margin-top: 10px;">
|
||||
<div class="layui-col-md6 layui-col-xs12">
|
||||
<img style="margin-top: 0px;margin-bottom: 40px;width: 80%;"
|
||||
src="{{ url_for('static', filename='index/images/pear.png') }}"></h1>
|
||||
<img style="width: 25%;position: absolute;left: 38%;margin-top: 5px;"
|
||||
src="{{ url_for('static', filename='index/images/admin.png') }}"></h1>
|
||||
<p style="font-size: 13.8px;font-weight: 500;margin-top: 10px;">💐 致 力 于 让 " Web " 开 发 变 得 简 单 优 雅 </p>
|
||||
<div class="ew-banner-btngroup" style="margin-top: 50px;margin-bottom: 50px;">
|
||||
<ul class="layui-nav" style="background-color: white;" lay-filter="ew-header-nav">
|
||||
<li class="layui-nav-item">
|
||||
<a target="_blank" href="http://pearadmin.com/" class="layui-btn layui-btn-primary"
|
||||
nav-scroll="pricing">
|
||||
<svg data-v-796d512c=""
|
||||
style="width:20px;position: relative;top: 5px;margin-right: 5px;"
|
||||
aria-hidden="true"
|
||||
focusable="false" data-prefix="fad" data-icon="meteor" role="img"
|
||||
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"
|
||||
class="svg-inline--fa fa-meteor fa-w-16 h-5 -mb-1 mr-1">
|
||||
<g data-v-796d512c="" class="fa-group">
|
||||
<path data-v-796d512c="" fill="currentColor"
|
||||
d="M491.14.7C452.44 12.3 379.34 35 303.44 62c-2.1-7-4-13.5-5.6-18.6a16.06 16.06 0 0 0-20-10.69 16.6 16.6 0 0 0-2.86 1.19C232.54 56 122.14 116.5 60.54 176.4c-1.1 1-2.5 2-3.5 3C-19 255.5-19 378.87 57.09 455s199.48 76 275.55-.1c1-1 2-2.4 3-3.5C395.44 389.8 456 279.3 478.14 237a16.05 16.05 0 0 0-6.64-21.72 15.52 15.52 0 0 0-2.86-1.18c-5.2-1.6-11.6-3.5-18.6-5.6 27-76 49.7-149 61.3-187.7A16.17 16.17 0 0 0 491.14.7zM191.94 448a128 128 0 1 1 128-128 128 128 0 0 1-128 128z"
|
||||
opacity="0.4" class="fa-secondary"></path>
|
||||
<path data-v-796d512c="" fill="currentColor"
|
||||
d="M191.94 192a128 128 0 1 0 128 128 128 128 0 0 0-128-128zm-32 128a32 32 0 1 1 32-32 32 32 0 0 1-32 32zm48 64a16 16 0 1 1 16-16 16 16 0 0 1-16 16z"
|
||||
class="fa-primary"></path>
|
||||
</g>
|
||||
</svg>
|
||||
官方网站</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-xs12">
|
||||
<div class="ew-banner-right">
|
||||
<img class="show" style="width: 92%;" style="margin-top: 0px!important;"
|
||||
src="{{ url_for('static', filename='index/images/un26.svg') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="section">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="section" nav-id="product">
|
||||
<div class="section-title" style="font-size: 20px;font-weight:500;">
|
||||
用法演示
|
||||
</div>
|
||||
<div class="layui-container" style="padding-bottom: 60px;">
|
||||
<div class="layui-row layui-col-space30">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- contact -->
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<h2 style="font-size: 20px;font-weight:500;">合作伙伴</h2>
|
||||
<p>Sponsorship and cooperation</p>
|
||||
</div>
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space30" style="margin-top: 10px;">
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ew-footer">
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space30">
|
||||
<div class="layui-col-md6">
|
||||
<h2 style="font-size: 17px;" class="footer-item-title">技术交流</h2>
|
||||
<p>
|
||||
<i class="layui-icon layui-icon-dialogue"></i>
|
||||
<a href="https://gitee.com/pear-admin/pear-admin-flask/issues">提问与帮助</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<h2 style="font-size: 17px;" class="footer-item-title">联系我们</h2>
|
||||
<p>
|
||||
<i class="layui-icon layui-icon-dialogue"></i>
|
||||
<a href="http://www.pearadmin.com">官网 : www.pearadmin.com</a>
|
||||
</p>
|
||||
<p style="margin-top: 2px;">
|
||||
<i class="layui-icon layui-icon-website"></i>
|
||||
<a href="http://forum.pearadmin.com">社区 : forum.pearadmin.com</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="layui-col-md2">
|
||||
<h2 style="font-size: 17px;" class="footer-item-title">友情链接</h2>
|
||||
<p><i class="layui-icon layui-icon-website"></i><a href="https://monksoul.gitee.io/furion/"
|
||||
target="_blank">Furion</a></p>
|
||||
<p style="margin-top: 10px;"><i class="layui-icon layui-icon-website"></i><a
|
||||
href="http://mrdoc.zmister.com/" target="_blank">MrDoc</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- js部分 -->
|
||||
<script src="{{ url_for('static', filename='admin/component/layui/layui.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='admin/component/pear/pear.js') }}"></script>
|
||||
|
||||
<script>
|
||||
layui.use(['layer', 'form', 'jquery'], function () {
|
||||
var $ = layui.jquery
|
||||
var layer = layui.layer
|
||||
var form = layui.form
|
||||
var jquery = layui.jquery
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,8 +2,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>日志</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/console2.css') }}"/>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/system/css/other/console2.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
<span style="color: red">失败</span>
|
||||
{{# } }}'|safe }}
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
|
||||
let MODULE_PATH = '/admin/log/'
|
||||
let MODULE_PATH = '/system/log/'
|
||||
|
||||
let cols = [
|
||||
[
|
||||
@@ -0,0 +1,2 @@
|
||||
<script src="{{ url_for('static', filename='system/component/layui/layui.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='system/component/pear/pear.js') }}"></script>
|
||||
@@ -2,4 +2,4 @@
|
||||
<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, maximum-scale=1">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/component/pear/css/pear.css') }}"/>
|
||||
@@ -2,8 +2,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>首页</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/console1.css') }}"/>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/other/console1.css') }}"/>
|
||||
|
||||
<!-- 主 题 更 换 -->
|
||||
<style id="pearadmin-bg-color"></style>
|
||||
@@ -178,7 +178,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>七彩枫叶 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin 专区</a> 回答问题</p>
|
||||
@@ -188,7 +188,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>简 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin 专区</a> 进行了 <a class="pear-text"
|
||||
@@ -200,7 +200,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>恒宇少年 将 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin </a> 更新至 2.3.0 版本</p>
|
||||
@@ -210,7 +210,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>如花 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin 社区</a> 发布了 <a class="pear-text"
|
||||
@@ -221,7 +221,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>就眠仪式 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin 社区</a> 发布了 <a class="pear-text"
|
||||
@@ -232,7 +232,7 @@
|
||||
<dd>
|
||||
<div class="layui-status-img"><a href="javascript:;"><img
|
||||
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||
src="{{ url_for('static', filename='system/system/images/avatar.jpg') }}"></a></div>
|
||||
<div>
|
||||
<p>贤心 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||
Admin 专区</a> 进行了 <a class="pear-text"
|
||||
@@ -291,7 +291,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['layer', 'echarts', 'element', 'count'], function () {
|
||||
var $ = layui.jquery,
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>部门管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
@@ -88,18 +88,18 @@
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/dept/tree',
|
||||
url: '/system/dept/tree',
|
||||
method: 'get',
|
||||
selectInputName: { nodeId: 'parentId', context: 'parentName' },
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'deptId', parentId: 'parentId', title: 'deptName' },
|
||||
response: { treeId: 'id', parentId: 'parent_id', title: 'dept_name' },
|
||||
selectInitVal: '1'
|
||||
})
|
||||
|
||||
form.on('submit(dept-save)', function (data) {
|
||||
$.ajax({
|
||||
url: '/dept/save',
|
||||
url: '/system/dept/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>部门修改</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
form.on('submit(dept-update)', function (data) {
|
||||
$.ajax({
|
||||
url: '/dept/update',
|
||||
url: '/system/dept/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -0,0 +1,229 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>部门新增</title>
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">部门名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="deptName" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="dept-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="dept-table" lay-filter="dept-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="dept-toolbar">
|
||||
{% if authorize("system:dept:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("system:dept:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="dept-bar">
|
||||
{% if authorize("system:dept:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("system:dept:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
{% raw %}
|
||||
<script type="text/html" id="dept-status">
|
||||
<input type="checkbox" name="status" value="{{ d.deptId }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="dept-enable"
|
||||
{{# if(d.status==1){ }} checked {{# } }}>
|
||||
</script>
|
||||
{% endraw %}
|
||||
</body>
|
||||
|
||||
{% include 'system/common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let treetable = layui.treetable
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/system/dept/'
|
||||
|
||||
window.render = function () {
|
||||
treetable.render({
|
||||
treeColIndex: 1,
|
||||
treeSpid: 0,
|
||||
treeIdName: 'id',
|
||||
treePidName: 'parent_id',
|
||||
skin: 'line',
|
||||
method: 'post',
|
||||
treeDefaultClose: false,
|
||||
toolbar: '#dept-toolbar',
|
||||
elem: '#dept-table',
|
||||
url: '/system/dept/data',
|
||||
page: false,
|
||||
cols: [
|
||||
[
|
||||
{field: 'id', title: 'id'},
|
||||
{field: 'dept_name', minWidth: 200, title: '部门名称'},
|
||||
{field: 'leader', title: '负责人'},
|
||||
{field: 'phone', title: '联系方式'},
|
||||
{field: 'email', title: '邮箱'},
|
||||
{field: 'address', title: '详细地址'},
|
||||
{field: 'status', title: '状态', templet: '#dept-status'},
|
||||
{field: 'sort', title: '排序', width: 100},
|
||||
{title: '操作', templet: '#dept-bar', width: 120, align: 'center'}
|
||||
]
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
form.on('submit(dept-query)', function (data) {
|
||||
var keyword = data.field.deptName
|
||||
var $tds = $('#dept-table').next('.treeTable').find('.layui-table-body tbody tr td')
|
||||
if (!keyword) {
|
||||
$tds.css('background-color', 'transparent')
|
||||
layer.msg('请输入关键字', {icon: 5})
|
||||
return
|
||||
}
|
||||
var searchCount = 0
|
||||
$tds.each(function () {
|
||||
$(this).css('background-color', 'transparent')
|
||||
if ($(this).text().indexOf(keyword) >= 0) {
|
||||
$(this).css('background-color', 'rgba(250,230,160,0.5)')
|
||||
if (searchCount === 0) {
|
||||
$('body,html').stop(true)
|
||||
$('body,html').animate({scrollTop: $(this).offset().top - 150}, 500)
|
||||
}
|
||||
searchCount++
|
||||
}
|
||||
})
|
||||
if (searchCount === 0) {
|
||||
layer.msg('没有匹配结果', {icon: 5})
|
||||
} else {
|
||||
treetable.expandAll('#dept-table')
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
render()
|
||||
|
||||
table.on('tool(dept-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(dept-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
{#window.batchRemove(obj)#}
|
||||
console.log(table.checkStatus(obj.config.id).data)
|
||||
}
|
||||
})
|
||||
|
||||
form.on('switch(dept-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/system/dept/' + operate,
|
||||
data: JSON.stringify({deptId: this.value}),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['450px', '500px'],
|
||||
content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该部门', {icon: 3, title: '提示'}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['deptId'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>字典增加</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
form.on('submit(dict-type-save)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictType/save',
|
||||
url: '/system/dict/dictType/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>字典增加</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
form.on('submit(dict-data-save)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictData/save',
|
||||
url: '/system/dict/dictData/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>字典增加</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
form.on('submit(dict-data-save)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictData/update',
|
||||
url: '/system/dict/dictData/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>字典增加</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
form.on('submit(dict-type-update)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictType/update',
|
||||
url: '/system/dict/dictType/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>字典管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-row layui-col-space10">
|
||||
@@ -119,7 +119,7 @@
|
||||
lay-filter="dict-data-enable"
|
||||
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup'], function () {
|
||||
let table = layui.table
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
table.render({
|
||||
elem: '#dict-type-table',
|
||||
url: '/admin/dict/dictType/data',
|
||||
url: '/system/dict/dictType/data',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
@@ -168,7 +168,7 @@
|
||||
$('.empty').hide()
|
||||
table.render({
|
||||
elem: '#dict-data-table',
|
||||
url: '/admin/dict/dictData/data?typeCode=' + typeCode,
|
||||
url: '/system/dict/dictData/data?typeCode=' + typeCode,
|
||||
page: true,
|
||||
height: 'full-148',
|
||||
cols: dataCols,
|
||||
@@ -209,7 +209,7 @@
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictType/' + operate,
|
||||
url: '/system/dict/dictType/' + operate,
|
||||
data: JSON.stringify({ id: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -231,7 +231,7 @@
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['500px', '400px'],
|
||||
content: '/admin/dict/dictType/add'
|
||||
content: '/system/dict/dictType/add'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['500px', '400px'],
|
||||
content: '/admin/dict/dictType/edit?dictTypeId=' + obj.data['id']
|
||||
content: '/system/dict/dictType/edit?dictTypeId=' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictType/remove/' + obj.data['id'],
|
||||
url: '/system/dict/dictType/remove/' + obj.data['id'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
@@ -281,7 +281,7 @@
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['500px', '450px'],
|
||||
content: '/admin/dict/dictData/add?typeCode=' + typeCode
|
||||
content: '/system/dict/dictData/add?typeCode=' + typeCode
|
||||
})
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['500px', '450px'],
|
||||
content: '/admin/dict/dictData/edit?dataId=' + obj.data['dataId']
|
||||
content: '/system/dict/dictData/edit?dataId=' + obj.data['dataId']
|
||||
})
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictData/remove/' + obj.data['dataId'],
|
||||
url: '/system/dict/dictData/remove/' + obj.data['dataId'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
@@ -350,7 +350,7 @@
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/dict/dictData/' + operate,
|
||||
url: '/system/dict/dictData/' + operate,
|
||||
data: JSON.stringify({ dataId: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -1,11 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
<title> Pear Admin Flask </title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/loader.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/admin.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/loader.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/admin.css') }}"/>
|
||||
</head>
|
||||
<!-- 结 构 代 码 -->
|
||||
<body class="layui-layout-body pear-admin">
|
||||
@@ -38,7 +37,7 @@
|
||||
<a class="layui-icon layui-icon-username" href="javascript:;"></a>
|
||||
<!-- 功 能 菜 单 -->
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a user-menu-url="/admin/user/center" user-menu-id="5555" user-menu-title="基本资料">基本资料</a></dd>
|
||||
<dd><a user-menu-url="/system/user/center" user-menu-id="5555" user-menu-title="基本资料">基本资料</a></dd>
|
||||
<dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
@@ -89,16 +88,17 @@
|
||||
<a href="#" class="layui-icon layui-icon-shrink-right"></a>
|
||||
</div>
|
||||
<!-- 依 赖 脚 本 -->
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<!-- 框 架 初 始 化 -->
|
||||
<script>
|
||||
layui.use(['admin','jquery','popup','drawer'], function() {
|
||||
layui.use(['admin','jquery','popup','layer'], function() {
|
||||
var $ = layui.jquery;
|
||||
var admin = layui.admin;
|
||||
let layer = layui.layer;
|
||||
var popup = layui.popup;
|
||||
|
||||
admin.setConfigType('json')
|
||||
admin.setConfigPath("{{ url_for('rights.configs') }}")
|
||||
admin.setConfigPath("{{ url_for('system.rights.configs') }}")
|
||||
|
||||
admin.render();
|
||||
|
||||
@@ -106,14 +106,15 @@
|
||||
admin.logout(function () {
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/passport/logout',
|
||||
url: '{{ url_for('system.passport.logout') }}',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
location.href = '/admin'
|
||||
location.href = '/'
|
||||
})
|
||||
return true
|
||||
}
|
||||
@@ -2,31 +2,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>登录</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<!-- 样 式 文 件 -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/login.css') }}"/>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/other/login.css') }}"/>
|
||||
</head>
|
||||
<!-- 代 码 结 构 -->
|
||||
<body background="{{ url_for('static', filename='admin/admin/images/background.svg') }}"
|
||||
style="background-size: cover;">
|
||||
<body class="login-body" background="{{ url_for('static', filename='system/admin/images/background.svg') }}">
|
||||
<form class="layui-form" action="javascript:void(0);">
|
||||
<div class="layui-form-item">
|
||||
<img class="logo" src="{{ url_for('static', filename='admin/admin/images/logo.png') }}"/>
|
||||
<img class="logo" src="{{ url_for('static', filename='system/admin/images/logo.png') }}"/>
|
||||
<div class="title">Pear Admin</div>
|
||||
<div class="desc">
|
||||
明 湖 区 最 具 影 响 力 的 设 计 规 范 之 一
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input name="username" type="text" placeholder="账 户 : admin " value="admin" hover class="layui-input"/>
|
||||
<input name="username" type="text" placeholder="用户名:" value="" hover class="layui-input"/>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input name="password" type="password" placeholder="密 码 : 123456 " value="123456" hover class="layui-input"/>
|
||||
<input name="password" type="password" placeholder="密码:" value="" hover class="layui-input"/>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input placeholder="验证码 : " name="captcha" hover class="code layui-input layui-input-inline"/>
|
||||
<img src="{{ url_for('passport.get_captcha') }}" class="codeImage" id="captchaImage"/>
|
||||
<img src="{{ url_for('system.passport.get_captcha') }}" class="codeImage" id="captchaImage"/>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input type="checkbox" name="remember-me" title="记住密码" lay-skin="primary">
|
||||
@@ -37,7 +33,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'layer', 'button', 'popup'], function () {
|
||||
let form = layui.form;
|
||||
@@ -45,7 +41,7 @@
|
||||
let layer = layui.layer;
|
||||
let button = layui.button;
|
||||
let popup = layui.popup;
|
||||
let captchaPath = "{{ url_for('passport.get_captcha') }}";
|
||||
let captchaPath = "{{ url_for('system.passport.get_captcha') }}";
|
||||
|
||||
form.on('submit(login)', function (data) {
|
||||
let loader = layer.load();
|
||||
@@ -59,7 +55,7 @@
|
||||
btn.stop(function () {
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
location.href = "{{ url_for('admin.index') }}";
|
||||
location.href = "{{ url_for('index.index') }}";
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg, function () {
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>邮件管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form">
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -2,8 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>邮件管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/user.css') }}"/>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/system/css/other/user.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{# 查询表单 #}
|
||||
@@ -46,13 +46,13 @@
|
||||
</body>
|
||||
{# 表格操作 #}
|
||||
<script type="text/html" id="mail-toolbar">
|
||||
{% if authorize("admin:mail:add") %}
|
||||
{% if authorize("system:mail:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="pear-icon pear-icon-add"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:mail:remove") %}
|
||||
{% if authorize("system:mail:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="pear-icon pear-icon-ashbin"></i>
|
||||
删除
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
{# 用户修改操作 #}
|
||||
<script type="text/html" id="mail-bar">
|
||||
{% if authorize("admin:mail:remove") %}
|
||||
{% if authorize("system:mail:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="pear-icon pear-icon-ashbin"></i>
|
||||
</button>
|
||||
@@ -81,7 +81,7 @@
|
||||
{{ ' {{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
@@ -91,12 +91,12 @@
|
||||
let dtree = layui.dtree
|
||||
let popup = layui.popup
|
||||
let common = layui.common
|
||||
let MODULE_PATH = '/admin/mail/'
|
||||
let MODULE_PATH = '/system/mail/'
|
||||
|
||||
// 表格数据
|
||||
let cols = [
|
||||
[
|
||||
{% if authorize("admin:mail:remove") %}
|
||||
{% if authorize("system:mail:remove") %}
|
||||
{ type: 'checkbox' },
|
||||
{% endif %}
|
||||
{ title: '邮件编号', field: 'id', align: 'center', width: 110 },
|
||||
@@ -2,8 +2,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>首页</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='admin/admin/css/other/console2.css') }}"/>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/system/css/other/console2.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-row layui-col-space10">
|
||||
@@ -158,7 +158,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['layer', 'echarts', 'popup'], function () {
|
||||
var $ = layui.jquery,
|
||||
@@ -379,7 +379,7 @@
|
||||
|
||||
function ajaxPolling() {
|
||||
$.ajax({
|
||||
url: "/admin/monitor/polling",
|
||||
url: "/system/monitor/polling",
|
||||
success: function (data) {
|
||||
echartData.push({
|
||||
name: data.time_now,
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>图片上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
@@ -12,13 +12,13 @@
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbar">
|
||||
{% if authorize("admin:file:add") %}
|
||||
{% if authorize("system:file:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:file:delete") %}
|
||||
{% if authorize("system:file:delete") %}
|
||||
<button class="pear-btn pear-btn-sm" lay-event="batchRemove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
@@ -27,7 +27,7 @@
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-bar">
|
||||
{% if authorize("admin:file:delete") %}
|
||||
{% if authorize("system:file:delete") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i></button>
|
||||
{% endif %}
|
||||
@@ -35,7 +35,7 @@
|
||||
<script type="text/html" id="file-uploadTime">
|
||||
{{ ' {{layui.util.toDateString(d.create_time, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery'], function () {
|
||||
let table = layui.table
|
||||
@@ -210,7 +210,7 @@
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: "{{ url_for('adminFile.batch_remove') }}",
|
||||
url: "{{ url_for('system.adminFile.batch_remove') }}",
|
||||
data: { ids: ids },
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
<style>
|
||||
.pear-container {
|
||||
background-color: white;
|
||||
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['jquery', 'element', 'form', 'upload'], function () {
|
||||
var $ = layui.jquery;
|
||||
@@ -43,7 +43,7 @@
|
||||
//选完文件后不自动上传
|
||||
upload.render({
|
||||
elem: '#logo-img'
|
||||
, url: "{{ url_for('adminFile.upload_api') }}"
|
||||
, url: "{{ url_for('system.adminFile.upload_api') }}"
|
||||
, auto: false
|
||||
, exts: 'jpg|png|gif|bmp|jpeg'
|
||||
, size: 1000
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/admin/power/selectParent',
|
||||
url: '/system/power/selectParent',
|
||||
method: 'get',
|
||||
selectInputName: {nodeId: 'parentId', context: 'powerName'},
|
||||
skin: 'layui',
|
||||
@@ -126,7 +126,7 @@
|
||||
form.on('submit(power-save)', function (data) {
|
||||
data.field.icon = 'layui-icon ' + data.field.icon
|
||||
$.ajax({
|
||||
url: '/admin/power/save',
|
||||
url: '/system/power/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/admin/power/selectParent',
|
||||
url: '/system/power/selectParent',
|
||||
method: 'get',
|
||||
selectInputName: {nodeId: 'parentId', context: 'powerName'},
|
||||
skin: 'layui',
|
||||
@@ -138,7 +138,7 @@
|
||||
form.on('submit(power-save)', function (data) {
|
||||
data.field.icon = 'layui-icon ' + data.field.icon
|
||||
$.ajax({
|
||||
url: '/admin/power/update',
|
||||
url: '/system/power/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
@@ -32,13 +32,13 @@
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="power-toolbar">
|
||||
{% if authorize("admin:power:add") %}
|
||||
{% if authorize("system:power:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:role:remove") %}
|
||||
{% if authorize("system:role:remove") %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
@@ -47,12 +47,12 @@
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="power-bar">
|
||||
{% if authorize("admin:role:edit") %}
|
||||
{% if authorize("system:role:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:role:remove") %}
|
||||
{% if authorize("system:role:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
@@ -61,11 +61,11 @@
|
||||
|
||||
<script type="text/html" id="power-type">
|
||||
{{ "
|
||||
{{#if (d.powerType == '0') { }}
|
||||
{{#if (d.type == '0') { }}
|
||||
<span>目录</span>
|
||||
{{# }else if(d.powerType == '1'){ }}
|
||||
{{# }else if(d.type == '1'){ }}
|
||||
<span>菜单</span>
|
||||
{{# }else if(d.powerType == '2'){ }}
|
||||
{{# }else if(d.type == '2'){ }}
|
||||
<span>按钮</span>
|
||||
{{# } }}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="power-enable">
|
||||
<input type="checkbox" name="enable" value="{{ "{{d.powerId}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
<input type="checkbox" name="enable" value="{{ "{{d.id}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="power-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</script>
|
||||
|
||||
</body>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||
let table = layui.table
|
||||
@@ -92,29 +92,26 @@
|
||||
let treetable = layui.treetable
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/admin/power/'
|
||||
let MODULE_PATH = '/system/power/'
|
||||
|
||||
window.render = function () {
|
||||
treetable.render({
|
||||
treeColIndex: 1,
|
||||
treeSpid: 0,
|
||||
treeIdName: 'powerId',
|
||||
treePidName: 'parentId',
|
||||
treeIdName: 'id',
|
||||
treePidName: 'parent_id',
|
||||
skin: 'line',
|
||||
method: 'post',
|
||||
treeDefaultClose: true,
|
||||
toolbar: '#power-toolbar',
|
||||
elem: '#power-table',
|
||||
url: '/admin/power/data',
|
||||
url: '/system/power/data',
|
||||
page: false,
|
||||
cols: [
|
||||
[
|
||||
{% if authorize("admin:role:remove") %}
|
||||
{ type: 'checkbox' },
|
||||
{% endif %}
|
||||
{ field: 'powerName', minWidth: 200, title: '权限名称' },
|
||||
[{ field: 'id', title: 'id' },
|
||||
{ field: 'name', minWidth: 200, title: '权限名称' },
|
||||
{ field: 'icon', title: '图标', templet: '#icon' },
|
||||
{ field: 'powerType', title: '权限类型', templet: '#power-type' },
|
||||
{ field: 'type', title: '权限类型', templet: '#power-type' },
|
||||
{ field: 'enable', title: '是否可用', templet: '#power-enable' },
|
||||
{ field: 'sort', title: '排序' },
|
||||
{ title: '操作', templet: '#power-bar', width: 150, align: 'center' }
|
||||
@@ -180,7 +177,7 @@
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/admin/power/' + operate,
|
||||
url: '/system/power/' + operate,
|
||||
data: JSON.stringify({ powerId: this.value }),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色新增</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
form.on('submit(role-save)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/role/save',
|
||||
url: '/system/role/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>角色编辑</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -32,9 +32,9 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %}value="0"
|
||||
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %}value="1"
|
||||
title="开启">
|
||||
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %} value="1"
|
||||
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %} value="0"
|
||||
title="关闭">
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
form.on('submit(role-update)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/role/update',
|
||||
url: '/system/role/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -0,0 +1,255 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">角色名</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="roleName" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<label class="layui-form-label">角色标识</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="roleCode" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="role-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="role-table" lay-filter="role-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/html" id="role-toolbar">
|
||||
{% if authorize("system:role:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="role-bar">
|
||||
{% if authorize("system:role:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"> 编辑</i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("system:role:power") %}
|
||||
<button class="pear-btn pear-btn-warming pear-btn-sm" lay-event="power"><i
|
||||
class="layui-icon layui-icon-vercode"> 授权</i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("system:role:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"> 删除</i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="role-enable">
|
||||
<input type="checkbox" name="enable" value="{{ "{{d.id}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="role-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/system/role/'
|
||||
|
||||
let cols = [
|
||||
[
|
||||
{title: 'id', field: 'id', align: 'center'},
|
||||
{title: '角色名', field: 'name', align: 'center', width: 100},
|
||||
{title: 'Key值', field: 'code', align: 'center'},
|
||||
{title: '描述', field: 'details', align: 'center'},
|
||||
{title: '是否可用', field: 'enable', align: 'center', templet: '#role-enable'},
|
||||
{title: '排序', field: 'sort', align: 'center'},
|
||||
{title: '操作', toolbar: '#role-bar', align: 'center', width: 240}
|
||||
]
|
||||
]
|
||||
|
||||
table.render({
|
||||
elem: '#role-table',
|
||||
url: MODULE_PATH + 'data',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
toolbar: '#role-toolbar',
|
||||
defaultToolbar: [{
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
})
|
||||
|
||||
table.on('tool(role-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
} else if (obj.event === 'power') {
|
||||
window.power(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(role-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
window.batchRemove(obj)
|
||||
}
|
||||
})
|
||||
|
||||
form.on('submit(role-query)', function (data) {
|
||||
table.reload('role-table', {where: data.field})
|
||||
return false
|
||||
})
|
||||
|
||||
form.on('switch(role-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '/system/role/' + operate,
|
||||
data: JSON.stringify({roleId: this.value}),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1000})
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['500px', '500px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.power = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '授权',
|
||||
shade: 0.1,
|
||||
area: ['320px', '400px'],
|
||||
content: MODULE_PATH + 'power/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['500px', '500px'],
|
||||
content: MODULE_PATH + 'edit/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该角色', {icon: 3, title: '提示'}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['id'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.batchRemove = function (obj) {
|
||||
let data = table.checkStatus(obj.config.id).data
|
||||
if (data.length === 0) {
|
||||
layer.msg('未选中数据', {
|
||||
icon: 3,
|
||||
time: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
var ids = []
|
||||
var hasCheck = table.checkStatus('role-table')
|
||||
var hasCheckData = hasCheck.data
|
||||
if (hasCheckData.length > 0) {
|
||||
$.each(hasCheckData, function (index, element) {
|
||||
ids.push(element.id)
|
||||
})
|
||||
}
|
||||
console.log(ids)
|
||||
layer.confirm('确定要删除选中角色', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
|
||||
url: MODULE_PATH + 'batchRemove',
|
||||
data: {ids: ids},
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
table.reload('role-table')
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
window.refresh = function () {
|
||||
table.reload('role-table')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>角色授权</title>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
<div class="main-container">
|
||||
<ul id="role-power" class="dtree" data-id="0"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="power-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-sm">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['dtree', 'form', 'jquery'], function () {
|
||||
let dtree = layui.dtree
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
|
||||
dtree.render({
|
||||
elem: '#role-power',
|
||||
method: 'get',
|
||||
url: '/system/role/getRolePower/{{id}}',
|
||||
dataFormat: 'list',
|
||||
checkbar: true,
|
||||
skin: 'layui',
|
||||
initLevel: '1',
|
||||
checkbarType: 'self',
|
||||
response: {treeId: 'powerId', parentId: 'parentId', title: 'powerName'},
|
||||
})
|
||||
|
||||
form.on('submit(power-save)', function (data) {
|
||||
let param = dtree.getCheckbarNodesParam('role-power')
|
||||
let ids = ''
|
||||
for (let i = 0; i < param.length; i++) {
|
||||
let id = param[i].nodeId
|
||||
ids += id + ','
|
||||
}
|
||||
ids = ids.substr(0, ids.length - 1)
|
||||
data.field.roleId = {{id}};
|
||||
data.field.powerIds = ids
|
||||
|
||||
$.ajax({
|
||||
url: '/system/role/saveRolePower',
|
||||
data: data.field,
|
||||
dataType: 'json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||
})
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>任务新增</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
@@ -75,7 +75,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>任务管理</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
{% include 'system/common/header.html' %}</head>
|
||||
<body class="pear-container">
|
||||
|
||||
<div class="layui-card">
|
||||
@@ -13,7 +13,7 @@
|
||||
</body>
|
||||
|
||||
<script type="text/html" id="role-toolbar">
|
||||
{% if authorize("admin:task:add") %}
|
||||
{% if authorize("system:task:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
新增
|
||||
@@ -22,12 +22,12 @@
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="role-bar">
|
||||
{% if authorize("admin:task:edit") %}
|
||||
{% if authorize("system:task:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||
class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("admin:task:remove") %}
|
||||
{% if authorize("system:task:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
@@ -42,7 +42,7 @@
|
||||
<script type="text/html" id="task-createTime">
|
||||
{{ ' {{layui.util.toDateString(d.start_date, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
@@ -50,11 +50,11 @@
|
||||
let $ = layui.jquery
|
||||
let popup = layui.popup
|
||||
|
||||
let MODULE_PATH = '/admin/task/'
|
||||
let MODULE_PATH = '/system/task/'
|
||||
|
||||
let cols = [
|
||||
[
|
||||
{% if authorize("admin:role:remove") %}
|
||||
{% if authorize("system:role:remove") %}
|
||||
{ type: 'checkbox' },
|
||||
{% endif %}
|
||||
{ title: 'ID', field: 'id', align: 'center', width: 100 },
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form">
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form
|
||||
@@ -73,7 +73,7 @@
|
||||
data.field.roleIds = roleIds
|
||||
|
||||
$.ajax({
|
||||
url: '/admin/user/save',
|
||||
url: '/system/user/save',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>个人中心</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
<style>
|
||||
.layui-form-item {
|
||||
margin-top: 17px !important;
|
||||
@@ -105,7 +105,7 @@
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
||||
<div class="layui-col-md1">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}"
|
||||
<img src="{{ url_for('static', filename='system/admin/images/act.jpg') }}"
|
||||
style="width: 100%;height: 100%;border-radius: 5px;"/>
|
||||
</div>
|
||||
<div class="layui-col-md11" style="height: 80px;">
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
||||
<div class="layui-col-md1">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}"
|
||||
<img src="{{ url_for('static', filename='system/admin/images/act.jpg') }}"
|
||||
style="width: 100%;height: 100%;border-radius: 5px;"/>
|
||||
</div>
|
||||
<div class="layui-col-md11" style="height: 80px;">
|
||||
@@ -135,7 +135,7 @@
|
||||
</div>
|
||||
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
||||
<div class="layui-col-md1">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}"
|
||||
<img src="{{ url_for('static', filename='system/admin/images/act.jpg') }}"
|
||||
style="width: 100%;height: 100%;border-radius: 5px;"/>
|
||||
</div>
|
||||
<div class="layui-col-md11" style="height: 80px;">
|
||||
@@ -150,7 +150,7 @@
|
||||
</div>
|
||||
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
||||
<div class="layui-col-md1">
|
||||
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}"
|
||||
<img src="{{ url_for('static', filename='system/admin/images/act.jpg') }}"
|
||||
style="width: 100%;height: 100%;border-radius: 5px;"/>
|
||||
</div>
|
||||
<div class="layui-col-md11" style="height: 80px;">
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['element', 'jquery', 'layer', 'form'], function () {
|
||||
let $ = layui.jquery
|
||||
@@ -183,7 +183,7 @@
|
||||
title: '修改密码',
|
||||
shade: 0.1,
|
||||
area: ['550px', '280px'],
|
||||
content: '/admin/user/editPassword'
|
||||
content: '/system/user/editPassword'
|
||||
})
|
||||
return false
|
||||
})
|
||||
@@ -195,7 +195,7 @@
|
||||
title: '更换图片',
|
||||
shade: 0.1,
|
||||
area: ['900px', '500px'],
|
||||
content: '/admin/user/profile',
|
||||
content: '/system/user/profile',
|
||||
btn: ['确定', '取消'],
|
||||
yes: function (index, layero) {
|
||||
window['layui-layer-iframe' + index].submitForm()
|
||||
@@ -206,7 +206,7 @@
|
||||
// 表单提交更改个人信息数据
|
||||
form.on('submit(user-update)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/user/updateInfo',
|
||||
url: '/system/user/updateInfo',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -3,7 +3,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>用户编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||
let form = layui.form
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
dtree.renderSelect({
|
||||
elem: '#selectParent',
|
||||
url: '/dept/tree',
|
||||
url: '/system/dept/tree',
|
||||
method: 'get',
|
||||
selectInputName: { nodeId: 'deptId', context: 'deptName' },
|
||||
skin: 'layui',
|
||||
@@ -94,7 +94,7 @@
|
||||
roleIds = roleIds.substr(0, roleIds.length - 1)
|
||||
data.field.roleIds = roleIds
|
||||
$.ajax({
|
||||
url: '/admin/user/update',
|
||||
url: '/system/user/update',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>修改密码</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['form', 'jquery', 'popup'], function () {
|
||||
let form = layui.form
|
||||
@@ -57,7 +57,7 @@
|
||||
// 修改密码提交
|
||||
form.on('submit(edit-password)', function (data) {
|
||||
$.ajax({
|
||||
url: '/admin/user/editPassword',
|
||||
url: '/system/user/editPassword',
|
||||
data: JSON.stringify(data.field),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
@@ -0,0 +1,274 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
{% include 'system/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='system/admin/css/other/user.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{# 查询表单 #}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="" lay-filter="user-query-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="realname" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<label class="layui-form-label">账号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" placeholder="" class="layui-input">
|
||||
</div>
|
||||
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-left user-collasped">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="button button-primary user-group" user-group=""> 全 部 用 户</div>
|
||||
<div class="button button-default user-group" user-group="-1"> 默 认 分 组</div>
|
||||
<div style="overflow: auto">
|
||||
<ul id="dept-tree" class="dept-tree" data-id="0"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{# 用户表格 #}
|
||||
<div class="user-main user-collasped">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="user-table" lay-filter="user-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{# 表格操作 #}
|
||||
<script type="text/html" id="user-toolbar">
|
||||
{% if authorize("system:user:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
<i class="pear-icon pear-icon-add"></i>
|
||||
新增
|
||||
</button>
|
||||
{% endif %}
|
||||
<button class="pear-btn pear-btn-md" lay-event="collasped">
|
||||
<i class="pear-icon pear-icon-modular"></i>
|
||||
高级
|
||||
</button>
|
||||
</script>
|
||||
|
||||
{# 用户修改操作 #}
|
||||
<script type="text/html" id="user-bar">
|
||||
{% if authorize("system:user:edit") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="pear-icon pear-icon-edit"> 编辑</i>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if authorize("system:user:remove") %}
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||
class="pear-icon pear-icon-ashbin"> 删除</i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
{% raw %}
|
||||
<script type="text/html" id="user-enable">
|
||||
<input type="checkbox" name="enable" value="{{ d.id }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="user-enable"
|
||||
{{# if(d.enable==1){ }} checked {{# } }} />
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-createTime">
|
||||
{{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="user-updateTime">
|
||||
{{layui.util.toDateString(d.update_at, "yyyy-MM-dd HH:mm:ss")}}
|
||||
</script>
|
||||
{% endraw %}
|
||||
|
||||
{% include 'system/common/footer.html' %}
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'dtree', 'form', 'jquery', 'popup', 'common'], function () {
|
||||
let table = layui.table
|
||||
let form = layui.form
|
||||
let $ = layui.jquery
|
||||
let dtree = layui.dtree
|
||||
let popup = layui.popup
|
||||
let common = layui.common
|
||||
let MODULE_PATH = "{{ url_for('system.user.main') }}"
|
||||
// 表格数据
|
||||
let cols = [
|
||||
[
|
||||
{title: 'id', field: 'id', align: 'center'},
|
||||
{title: '姓名', field: 'realname', align: 'center', width: 110},
|
||||
{title: '账号', field: 'username', align: 'center'},
|
||||
{title: '部门', field: 'dept_name', align: 'center'},
|
||||
{title: '启用', field: 'enable', align: 'center', templet: '#user-enable', width: 120},
|
||||
{title: '注册时间', field: 'create_at', templet: '#user-createTime', align: 'center'},
|
||||
{title: '更新时间', field: 'update_at', templet: '#user-updateTime', align: 'center'},
|
||||
{title: '操作', toolbar: '#user-bar', align: 'center', width: 180}
|
||||
]
|
||||
]
|
||||
|
||||
// 渲染表格数据
|
||||
table.render({
|
||||
elem: '#user-table',
|
||||
url: MODULE_PATH + 'data',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
height: 'full-148',
|
||||
toolbar: '#user-toolbar', /*工具栏*/
|
||||
text: {none: '暂无人员信息'},
|
||||
defaultToolbar: [{layEvent: 'refresh', icon: 'layui-icon-refresh'}, 'filter', 'print', 'exports'] /*默认工具栏*/
|
||||
})
|
||||
|
||||
// 公司部门树状图菜单
|
||||
dtree.render({
|
||||
elem: '#dept-tree',
|
||||
method: 'get',
|
||||
url: '/system/dept/tree',
|
||||
dataFormat: 'list',
|
||||
line: true,
|
||||
skin: 'laySimple',
|
||||
icon: '-1',
|
||||
response: {treeId: 'id', parentId: 'parent_id', title: 'dept_name'},
|
||||
})
|
||||
|
||||
// 菜单栏渲染
|
||||
dtree.on('node(\'dept-tree\')', function (obj) {
|
||||
let field = form.val('user-query-form') /*用户账号查询*/
|
||||
field.deptId = obj.param.nodeId
|
||||
window.refresh(field)
|
||||
})
|
||||
|
||||
//
|
||||
$('.user-group').click(function () {
|
||||
let group = $(this).attr('user-group')
|
||||
let field = form.val('user-query-form')
|
||||
if (group === '-1') {
|
||||
field.deptId = group
|
||||
$(this).removeClass('button-default')
|
||||
$(this).prev().removeClass('button-primary')
|
||||
$(this).prev().addClass('button-default')
|
||||
$(this).addClass('button-primary')
|
||||
} else {
|
||||
field.deptId = group
|
||||
$(this).removeClass('button-default')
|
||||
$(this).next().removeClass('button-primary')
|
||||
$(this).next().addClass('button-default')
|
||||
$(this).addClass('button-primary')
|
||||
}
|
||||
window.refresh(field)
|
||||
})
|
||||
|
||||
table.on('tool(user-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj)
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj)
|
||||
}
|
||||
})
|
||||
|
||||
table.on('toolbar(user-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add()
|
||||
} else if (obj.event === 'refresh') {
|
||||
window.refresh()
|
||||
} else if (obj.event === 'batchRemove') {
|
||||
window.batchRemove(obj)
|
||||
} else if (obj.event === 'collasped') {
|
||||
$('.user-left').toggleClass('user-collasped')
|
||||
$('.user-main').toggleClass('user-collasped')
|
||||
table.resize()
|
||||
}
|
||||
})
|
||||
|
||||
form.on('submit(user-query)', function (data) {
|
||||
window.refresh(data.field)
|
||||
return false
|
||||
})
|
||||
|
||||
form.on('switch(user-enable)', function (obj) {
|
||||
let operate
|
||||
if (obj.elem.checked) {
|
||||
operate = 'enable'
|
||||
} else {
|
||||
operate = 'disable'
|
||||
}
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: '{{ url_for('system.user.main') }}' + operate,
|
||||
data: JSON.stringify({userId: this.value}),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'put',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg)
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: ['550px', '550px'],
|
||||
content: MODULE_PATH + 'add'
|
||||
})
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['550px', '500px'],
|
||||
content: MODULE_PATH + 'edit/' + obj.data['id']
|
||||
})
|
||||
}
|
||||
|
||||
window.remove = function (obj) {
|
||||
layer.confirm('确定要删除该用户', {icon: 3, title: '提示'}, function (index) {
|
||||
layer.close(index)
|
||||
let loading = layer.load()
|
||||
$.ajax({
|
||||
url: MODULE_PATH + 'remove/' + obj.data['id'],
|
||||
dataType: 'json',
|
||||
type: 'delete',
|
||||
success: function (result) {
|
||||
layer.close(loading)
|
||||
if (result.success) {
|
||||
popup.success(result.msg, function () {
|
||||
obj.del()
|
||||
})
|
||||
} else {
|
||||
popup.failure(result.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
window.refresh = function (param) {
|
||||
table.reload('user-table', {where: param})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>头像上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
{% include 'system/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% include 'system/common/footer.html' %}
|
||||
<script>
|
||||
layui.use(['jquery', 'layer', 'cropper', 'popup'], function () {
|
||||
let $ = layui.jquery
|
||||
Reference in New Issue
Block a user