pycharm下格式化模板文件,统一风格
This commit is contained in:
@@ -3,18 +3,18 @@ from flask import jsonify
|
|||||||
|
|
||||||
def success_api(msg: str = "成功"):
|
def success_api(msg: str = "成功"):
|
||||||
""" 成功响应 默认值”成功“ """
|
""" 成功响应 默认值”成功“ """
|
||||||
return jsonify(success=True, message=msg)
|
return jsonify(success=True, msg=msg)
|
||||||
|
|
||||||
|
|
||||||
def fail_api(msg: str = "失败"):
|
def fail_api(msg: str = "失败"):
|
||||||
""" 失败响应 默认值“失败” """
|
""" 失败响应 默认值“失败” """
|
||||||
return jsonify(success=False, message=msg)
|
return jsonify(success=False, msg=msg)
|
||||||
|
|
||||||
|
|
||||||
def table_api(msg: str = "", count=0, data=None, limit=10):
|
def table_api(msg: str = "", count=0, data=None, limit=10):
|
||||||
""" 动态表格渲染响应 """
|
""" 动态表格渲染响应 """
|
||||||
res = {
|
res = {
|
||||||
'message': msg,
|
'msg': msg,
|
||||||
'code': 0,
|
'code': 0,
|
||||||
'data': data,
|
'data': data,
|
||||||
'count': count,
|
'count': count,
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ class BaseConfig:
|
|||||||
MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306)
|
MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306)
|
||||||
MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask"
|
MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask"
|
||||||
|
|
||||||
|
UPLOADED_PHOTOS_DEST = '/static'
|
||||||
|
|
||||||
# mysql 数据库的配置信息
|
# mysql 数据库的配置信息
|
||||||
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}"
|
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}"
|
||||||
# 默认日志等级
|
# 默认日志等级
|
||||||
|
|||||||
@@ -40,74 +40,74 @@
|
|||||||
</script>
|
</script>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
|
|
||||||
let MODULE_PATH = "/admin/log/";
|
let MODULE_PATH = '/admin/log/'
|
||||||
|
|
||||||
let cols = [
|
let cols = [
|
||||||
[
|
[
|
||||||
{title: 'ID', field: 'id', align: 'center'},
|
{ title: 'ID', field: 'id', align: 'center' },
|
||||||
{title: '请求方式', field: 'method', align: 'center'},
|
{ title: '请求方式', field: 'method', align: 'center' },
|
||||||
{title: '接口', field: 'url', align: 'center'},
|
{ title: '接口', field: 'url', align: 'center' },
|
||||||
{title: '浏览器', field: 'user_agent', align: 'center'},
|
{ title: '浏览器', field: 'user_agent', align: 'center' },
|
||||||
{title: '操作地址', field: 'ip', align: 'center'},
|
{ title: '操作地址', field: 'ip', align: 'center' },
|
||||||
{title: '访问时间', field: 'create_time', templet: '#log-createTime', align: 'center'},
|
{ title: '访问时间', field: 'create_time', templet: '#log-createTime', align: 'center' },
|
||||||
{title: '操作人ID', field: 'uid', align: 'center'},
|
{ title: '操作人ID', field: 'uid', align: 'center' },
|
||||||
{title: '描述', field: 'desc', align: 'center'},
|
{ title: '描述', field: 'desc', align: 'center' },
|
||||||
{title: '访问状态', templet: '#log-status', align: 'center'}
|
{ title: '访问状态', templet: '#log-status', align: 'center' }
|
||||||
]
|
]
|
||||||
];
|
]
|
||||||
|
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#log-operate-table',
|
elem: '#log-operate-table',
|
||||||
url: MODULE_PATH + 'operateLog',
|
url: MODULE_PATH + 'operateLog',
|
||||||
page: true,
|
page: true,
|
||||||
cols: cols,
|
cols: cols,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
toolbar: false
|
toolbar: false
|
||||||
});
|
|
||||||
|
|
||||||
table.render({
|
|
||||||
elem: '#log-login-table',
|
|
||||||
url: MODULE_PATH + 'loginLog',
|
|
||||||
page: true,
|
|
||||||
cols: cols,
|
|
||||||
skin: 'line',
|
|
||||||
toolbar: false
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(dict-type-query)', function (data) {
|
|
||||||
table.reload('dict-type-table', {where: data.field});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('tool(log-operate-table)', function (obj) {
|
|
||||||
if (obj.event === 'details') {
|
|
||||||
window.info(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('tool(log-login-table)', function (obj) {
|
|
||||||
if (obj.event === 'details') {
|
|
||||||
window.info(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
window.info = function (obj) {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '详细信息',
|
|
||||||
shade: 0,
|
|
||||||
area: ['400px', '400px'],
|
|
||||||
content: MODULE_PATH + "info",
|
|
||||||
success: function (layero) {
|
|
||||||
let iframeWin = window[layero.find('iframe')[0]['name']];
|
|
||||||
iframeWin.show(obj.data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
table.render({
|
||||||
|
elem: '#log-login-table',
|
||||||
|
url: MODULE_PATH + 'loginLog',
|
||||||
|
page: true,
|
||||||
|
cols: cols,
|
||||||
|
skin: 'line',
|
||||||
|
toolbar: false
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('submit(dict-type-query)', function (data) {
|
||||||
|
table.reload('dict-type-table', { where: data.field })
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('tool(log-operate-table)', function (obj) {
|
||||||
|
if (obj.event === 'details') {
|
||||||
|
window.info(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('tool(log-login-table)', function (obj) {
|
||||||
|
if (obj.event === 'details') {
|
||||||
|
window.info(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
window.info = function (obj) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详细信息',
|
||||||
|
shade: 0,
|
||||||
|
area: ['400px', '400px'],
|
||||||
|
content: MODULE_PATH + 'info',
|
||||||
|
success: function (layero) {
|
||||||
|
let iframeWin = window[layero.find('iframe')[0]['name']]
|
||||||
|
iframeWin.show(obj.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=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='/admin/component/pear/css/pear.css') }}"/>
|
||||||
@@ -1,356 +1,413 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>首页</title>
|
<title>首页</title>
|
||||||
{% include 'admin/common/header.html' %}
|
{% include 'admin/common/header.html' %}
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console1.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console1.css') }}"/>
|
||||||
|
|
||||||
<!-- 主 题 更 换 -->
|
<!-- 主 题 更 换 -->
|
||||||
<style id="pearadmin-bg-color"></style>
|
<style id="pearadmin-bg-color"></style>
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
<div>
|
<div>
|
||||||
<div class="layui-row layui-col-space10">
|
<div class="layui-row layui-col-space10">
|
||||||
<div class="layui-col-xs6 layui-col-md3">
|
<div class="layui-col-xs6 layui-col-md3">
|
||||||
<div class="layui-card top-panel">
|
<div class="layui-card top-panel">
|
||||||
<div class="layui-card-header">今日访问</div>
|
<div class="layui-card-header">今日访问</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<div class="layui-row layui-col-space5">
|
<div class="layui-row layui-col-space5">
|
||||||
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value1">
|
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value1">
|
||||||
0
|
0
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 1024 1024" width="200" height="200" t="1591462258798"
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 1024 1024" width="200"
|
||||||
p-id="942" version="1.1">
|
height="200" t="1591462258798"
|
||||||
<path fill="#fcc66f" d="M 262.7 835 c -15.3 0 -28.1 -11.4 -29.8 -26.6 L 174.1 291 c -0.6 -5.1 1 -10.2 4.5 -14 s 8.3 -6 13.4 -6 h 640 c 5.1 0 10 2.2 13.4 6 s 5 8.9 4.5 14 l -58.8 517.4 c -1.7 15.2 -14.5 26.6 -29.8 26.6 H 262.7 Z" p-id="943" />
|
p-id="942" version="1.1">
|
||||||
<path fill="#ffd79c" d="M 802 289 l -58.8 517.4 c -0.7 6.1 -5.8 10.6 -11.9 10.6 h 30 c 6.1 0 11.2 -4.6 11.9 -10.6 L 832 289 h -30 Z" p-id="944" />
|
<path fill="#fcc66f"
|
||||||
<path fill="#f56e73" d="M 164 307 c -16.5 0 -30 -13.5 -30 -30 v -58 c 0 -16.5 13.5 -30 30 -30 h 696 c 16.5 0 30 13.5 30 30 v 58 c 0 16.5 -13.5 30 -30 30 H 164 Z" p-id="945" />
|
d="M 262.7 835 c -15.3 0 -28.1 -11.4 -29.8 -26.6 L 174.1 291 c -0.6 -5.1 1 -10.2 4.5 -14 s 8.3 -6 13.4 -6 h 640 c 5.1 0 10 2.2 13.4 6 s 5 8.9 4.5 14 l -58.8 517.4 c -1.7 15.2 -14.5 26.6 -29.8 26.6 H 262.7 Z"
|
||||||
<path fill="#ffa1a8" d="M 860 207 h -30 c 6.6 0 12 5.4 12 12 v 58 c 0 6.6 -5.4 12 -12 12 h 30 c 6.6 0 12 -5.4 12 -12 v -58 c 0 -6.6 -5.4 -12 -12 -12 Z" p-id="946" />
|
p-id="943"/>
|
||||||
<path fill="#65c8ff" d="M 190.9 651.5 c -31.4 0 -56.9 -25.5 -56.9 -56.9 V 219 c 0 -16.5 13.5 -30 30 -30 h 466.2 c 9.9 0 18 8.1 18 18 v 301.1 c 0 34.7 -28.2 62.9 -62.9 62.9 s -62.9 -28.2 -62.9 -62.9 V 393.5 c 0 -23.2 -18.8 -42 -42 -42 s -42 18.8 -42 42 v 68.1 c 0 29.4 -23.9 53.4 -53.4 53.4 s -53.4 -23.9 -53.4 -53.4 v -68.1 c 0 -23.2 -18.8 -42 -42 -42 s -42 18.8 -42 42 v 201.1 c 0.1 31.4 -25.4 56.9 -56.7 56.9 Z" p-id="947" />
|
<path fill="#ffd79c"
|
||||||
<path fill="#b3eaff" d="M 277.8 321.5 c -33.1 0 -60 26.9 -60 60 v 201.1 c 0 21.5 -17.4 38.9 -38.9 38.9 c -7.7 0 -14.8 -2.2 -20.8 -6.1 c 6.9 10.9 19 18.1 32.8 18.1 c 21.5 0 38.9 -17.4 38.9 -38.9 V 393.5 c 0 -33.1 26.9 -60 60 -60 c 13.5 0 25.9 4.5 36 12 c -11 -14.5 -28.4 -24 -48 -24 Z M 618.3 207 v 289.1 c 0 24.8 -20.1 44.9 -44.9 44.9 c -9.3 0 -18 -2.8 -25.2 -7.7 c 8.1 11.9 21.7 19.7 37.2 19.7 c 24.8 0 44.9 -20.1 44.9 -44.9 V 207 h -12 Z M 468.5 321.5 c -33.1 0 -60 26.9 -60 60 v 68.1 c 0 19.5 -15.8 35.4 -35.4 35.4 c -6.7 0 -12.9 -1.9 -18.3 -5.1 c 6.2 10.2 17.4 17.1 30.3 17.1 c 19.5 0 35.4 -15.8 35.4 -35.4 v -68.1 c 0 -33.1 26.9 -60 60 -60 c 13.5 0 25.9 4.5 36 12 c -11 -14.5 -28.4 -24 -48 -24 Z" p-id="948" />
|
d="M 802 289 l -58.8 517.4 c -0.7 6.1 -5.8 10.6 -11.9 10.6 h 30 c 6.1 0 11.2 -4.6 11.9 -10.6 L 832 289 h -30 Z"
|
||||||
<path fill="#453b56" d="M 698 729.4 m -18 0 a 18 18 0 1 0 36 0 a 18 18 0 1 0 -36 0 Z" p-id="949" />
|
p-id="944"/>
|
||||||
<path fill="#453b56" d="M 860 171 H 632.5 v 0.1 c -0.7 0 -1.5 -0.1 -2.2 -0.1 H 164 c -26.5 0 -48 21.5 -48 48 v 375.6 c 0 41.3 33.6 74.9 74.9 74.9 c 2.7 0 5.4 -0.2 8.1 -0.5 l 16 141.4 c 2.8 24.3 23.3 42.6 47.7 42.6 h 498.6 c 24.4 0 44.9 -18.3 47.7 -42.6 l 55.2 -485.6 c 24.5 -2.1 43.8 -22.7 43.8 -47.8 v -58 c 0 -26.5 -21.5 -48 -48 -48 Z M 190.9 633.5 c -21.5 0 -38.9 -17.4 -38.9 -38.9 V 219 c 0 -6.6 5.4 -12 12 -12 h 466.3 v 301.1 c 0 24.8 -20.1 44.9 -44.9 44.9 c -24.8 0 -44.9 -20.1 -44.9 -44.9 V 393.5 c 0 -33.1 -26.9 -60 -60 -60 s -60 26.9 -60 60 v 68.1 c 0 19.5 -15.8 35.4 -35.4 35.4 c -19.5 0 -35.4 -15.8 -35.4 -35.4 v -68.1 c 0 -33.1 -26.9 -60 -60 -60 s -60 26.9 -60 60 v 201.1 c 0.1 21.5 -17.4 38.9 -38.8 38.9 Z m 582.3 172.9 c -0.7 6.1 -5.8 10.6 -11.9 10.6 H 262.7 c -6.1 0 -11.2 -4.6 -11.9 -10.6 l -6.7 -59 h 396.6 c 9.9 0 18 -8.1 18 -18 s -8.1 -18 -18 -18 H 240 l -6.3 -55.4 c 19.3 -13.6 32.1 -36 32.1 -61.3 V 393.5 c 0 -13.2 10.8 -24 24 -24 s 24 10.8 24 24 v 68.1 c 0 39.4 32 71.4 71.4 71.4 s 71.4 -32 71.4 -71.4 v -68.1 c 0 -13.2 10.8 -24 24 -24 s 24 10.8 24 24 v 114.6 c 0 44.6 36.3 80.9 80.9 80.9 c 44.6 0 80.9 -36.3 80.9 -80.9 V 325 h 161.7 l -54.9 481.4 Z M 872 277 c 0 6.6 -5.4 12 -12 12 H 666.3 v -82 H 860 c 6.6 0 12 5.4 12 12 v 58 Z" p-id="950" /></svg>
|
<path fill="#f56e73"
|
||||||
</div>
|
d="M 164 307 c -16.5 0 -30 -13.5 -30 -30 v -58 c 0 -16.5 13.5 -30 30 -30 h 696 c 16.5 0 30 13.5 30 30 v 58 c 0 16.5 -13.5 30 -30 30 H 164 Z"
|
||||||
</div>
|
p-id="945"/>
|
||||||
</div>
|
<path fill="#ffa1a8"
|
||||||
</div>
|
d="M 860 207 h -30 c 6.6 0 12 5.4 12 12 v 58 c 0 6.6 -5.4 12 -12 12 h 30 c 6.6 0 12 -5.4 12 -12 v -58 c 0 -6.6 -5.4 -12 -12 -12 Z"
|
||||||
</div>
|
p-id="946"/>
|
||||||
<div class="layui-col-xs6 layui-col-md3">
|
<path fill="#65c8ff"
|
||||||
<div class="layui-card top-panel">
|
d="M 190.9 651.5 c -31.4 0 -56.9 -25.5 -56.9 -56.9 V 219 c 0 -16.5 13.5 -30 30 -30 h 466.2 c 9.9 0 18 8.1 18 18 v 301.1 c 0 34.7 -28.2 62.9 -62.9 62.9 s -62.9 -28.2 -62.9 -62.9 V 393.5 c 0 -23.2 -18.8 -42 -42 -42 s -42 18.8 -42 42 v 68.1 c 0 29.4 -23.9 53.4 -53.4 53.4 s -53.4 -23.9 -53.4 -53.4 v -68.1 c 0 -23.2 -18.8 -42 -42 -42 s -42 18.8 -42 42 v 201.1 c 0.1 31.4 -25.4 56.9 -56.7 56.9 Z"
|
||||||
<div class="layui-card-header">提交次数</div>
|
p-id="947"/>
|
||||||
<div class="layui-card-body">
|
<path fill="#b3eaff"
|
||||||
<div class="layui-row layui-col-space5">
|
d="M 277.8 321.5 c -33.1 0 -60 26.9 -60 60 v 201.1 c 0 21.5 -17.4 38.9 -38.9 38.9 c -7.7 0 -14.8 -2.2 -20.8 -6.1 c 6.9 10.9 19 18.1 32.8 18.1 c 21.5 0 38.9 -17.4 38.9 -38.9 V 393.5 c 0 -33.1 26.9 -60 60 -60 c 13.5 0 25.9 4.5 36 12 c -11 -14.5 -28.4 -24 -48 -24 Z M 618.3 207 v 289.1 c 0 24.8 -20.1 44.9 -44.9 44.9 c -9.3 0 -18 -2.8 -25.2 -7.7 c 8.1 11.9 21.7 19.7 37.2 19.7 c 24.8 0 44.9 -20.1 44.9 -44.9 V 207 h -12 Z M 468.5 321.5 c -33.1 0 -60 26.9 -60 60 v 68.1 c 0 19.5 -15.8 35.4 -35.4 35.4 c -6.7 0 -12.9 -1.9 -18.3 -5.1 c 6.2 10.2 17.4 17.1 30.3 17.1 c 19.5 0 35.4 -15.8 35.4 -35.4 v -68.1 c 0 -33.1 26.9 -60 60 -60 c 13.5 0 25.9 4.5 36 12 c -11 -14.5 -28.4 -24 -48 -24 Z"
|
||||||
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value2">
|
p-id="948"/>
|
||||||
0
|
<path fill="#453b56" d="M 698 729.4 m -18 0 a 18 18 0 1 0 36 0 a 18 18 0 1 0 -36 0 Z"
|
||||||
</div>
|
p-id="949"/>
|
||||||
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
<path fill="#453b56"
|
||||||
<svg t="1591462430908" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
d="M 860 171 H 632.5 v 0.1 c -0.7 0 -1.5 -0.1 -2.2 -0.1 H 164 c -26.5 0 -48 21.5 -48 48 v 375.6 c 0 41.3 33.6 74.9 74.9 74.9 c 2.7 0 5.4 -0.2 8.1 -0.5 l 16 141.4 c 2.8 24.3 23.3 42.6 47.7 42.6 h 498.6 c 24.4 0 44.9 -18.3 47.7 -42.6 l 55.2 -485.6 c 24.5 -2.1 43.8 -22.7 43.8 -47.8 v -58 c 0 -26.5 -21.5 -48 -48 -48 Z M 190.9 633.5 c -21.5 0 -38.9 -17.4 -38.9 -38.9 V 219 c 0 -6.6 5.4 -12 12 -12 h 466.3 v 301.1 c 0 24.8 -20.1 44.9 -44.9 44.9 c -24.8 0 -44.9 -20.1 -44.9 -44.9 V 393.5 c 0 -33.1 -26.9 -60 -60 -60 s -60 26.9 -60 60 v 68.1 c 0 19.5 -15.8 35.4 -35.4 35.4 c -19.5 0 -35.4 -15.8 -35.4 -35.4 v -68.1 c 0 -33.1 -26.9 -60 -60 -60 s -60 26.9 -60 60 v 201.1 c 0.1 21.5 -17.4 38.9 -38.8 38.9 Z m 582.3 172.9 c -0.7 6.1 -5.8 10.6 -11.9 10.6 H 262.7 c -6.1 0 -11.2 -4.6 -11.9 -10.6 l -6.7 -59 h 396.6 c 9.9 0 18 -8.1 18 -18 s -8.1 -18 -18 -18 H 240 l -6.3 -55.4 c 19.3 -13.6 32.1 -36 32.1 -61.3 V 393.5 c 0 -13.2 10.8 -24 24 -24 s 24 10.8 24 24 v 68.1 c 0 39.4 32 71.4 71.4 71.4 s 71.4 -32 71.4 -71.4 v -68.1 c 0 -13.2 10.8 -24 24 -24 s 24 10.8 24 24 v 114.6 c 0 44.6 36.3 80.9 80.9 80.9 c 44.6 0 80.9 -36.3 80.9 -80.9 V 325 h 161.7 l -54.9 481.4 Z M 872 277 c 0 6.6 -5.4 12 -12 12 H 666.3 v -82 H 860 c 6.6 0 12 5.4 12 12 v 58 Z"
|
||||||
p-id="3170" width="200" height="200">
|
p-id="950"/>
|
||||||
<path d="M532 784.2c0 24.4-19.8 44.3-44.3 44.3s-44.3-19.8-44.3-44.3c0-24.4 44.3-80.3 44.3-80.3s44.3 55.8 44.3 80.3zM766 784.2c0 24.4 19.8 44.3 44.3 44.3 24.4 0 44.3-19.8 44.3-44.3 0-24.4-44.3-80.3-44.3-80.3S766 759.7 766 784.2z"
|
</svg>
|
||||||
fill="#97DCFF" p-id="3171"></path>
|
</div>
|
||||||
<path d="M123.5 471.3c-9.9 0-18-8.1-18-18v-302c0-9.9 8.1-18 18-18h58c9.9 0 18 8.1 18 18v302c0 9.9-8.1 18-18 18h-58z"
|
</div>
|
||||||
fill="#FCC66F" p-id="3172"></path>
|
</div>
|
||||||
<path d="M181.5 151.3v302h-58v-302h58m0-36h-58c-19.9 0-36 16.1-36 36v302c0 19.9 16.1 36 36 36h58c19.9 0 36-16.1 36-36v-302c0-19.8-16.1-36-36-36z"
|
</div>
|
||||||
fill="#453B56" p-id="3173"></path>
|
</div>
|
||||||
<path d="M266.4 210.7m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56" p-id="3174"></path>
|
<div class="layui-col-xs6 layui-col-md3">
|
||||||
<path d="M430.8 641.1c-9.9 0-18-8.1-18-18v-21.6c0-130.3 106-236.3 236.3-236.3s236.3 106 236.3 236.3v21.6c0 9.9-8.1 18-18 18H430.8z"
|
<div class="layui-card top-panel">
|
||||||
fill="#FCC66F" p-id="3175"></path>
|
<div class="layui-card-header">提交次数</div>
|
||||||
<path d="M649 383.2c-5 0-10 0.2-15 0.6 113.5 7.7 203.3 102.2 203.3 217.7v21.6h30v-21.6c0-120.6-97.7-218.3-218.3-218.3z"
|
<div class="layui-card-body">
|
||||||
fill="#FFD79C" p-id="3176"></path>
|
<div class="layui-row layui-col-space5">
|
||||||
<path d="M419.6 694.4c-22.1 0-40.1-18-40.1-40.1s18-40.1 40.1-40.1h458.8c22.1 0 40.1 18 40.1 40.1s-18 40.1-40.1 40.1H419.6z"
|
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value2">
|
||||||
fill="#F56E73" p-id="3177"></path>
|
0
|
||||||
<path d="M878.4 632.3h-30c12.2 0 22.1 9.9 22.1 22.1s-9.9 22.1-22.1 22.1h30c12.2 0 22.1-9.9 22.1-22.1s-9.9-22.1-22.1-22.1z"
|
</div>
|
||||||
fill="#FFA1A8" p-id="3178"></path>
|
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
||||||
<path d="M693.3 846.4c0 24.4-19.8 44.3-44.3 44.3-24.4 0-44.3-19.8-44.3-44.3s44.3-80.3 44.3-80.3 44.3 55.9 44.3 80.3z"
|
<svg t="1591462430908" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||||
fill="#97DCFF" p-id="3179"></path>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<path d="M649 908.7c-34.3 0-62.3-27.9-62.3-62.3 0-28.5 36.9-77.2 48.1-91.4 3.4-4.3 8.6-6.8 14.1-6.8s10.7 2.5 14.1 6.8c11.3 14.2 48.1 62.9 48.1 91.4 0.2 34.3-27.8 62.3-62.1 62.3z m0-112.3c-14.1 20.4-26.3 41.9-26.3 50 0 14.5 11.8 26.3 26.3 26.3s26.3-11.8 26.3-26.3c0-8.1-12.1-29.6-26.3-50z"
|
p-id="3170" width="200" height="200">
|
||||||
fill="#453B56" p-id="3180"></path>
|
<path d="M532 784.2c0 24.4-19.8 44.3-44.3 44.3s-44.3-19.8-44.3-44.3c0-24.4 44.3-80.3 44.3-80.3s44.3 55.8 44.3 80.3zM766 784.2c0 24.4 19.8 44.3 44.3 44.3 24.4 0 44.3-19.8 44.3-44.3 0-24.4-44.3-80.3-44.3-80.3S766 759.7 766 784.2z"
|
||||||
<path d="M903.3 601.9v-0.5c0-134.1-104.4-244.3-236.3-253.6v-30.7c0-68.7-55.9-124.6-124.6-124.6H326.5c-9.9 0-18 8.1-18 18s8.1 18 18 18h215.9c48.8 0 88.6 39.7 88.6 88.6v30.7c-131.8 9.3-236.3 119.4-236.3 253.6v0.5c-19.6 9.3-33.2 29.3-33.2 52.4 0 32 26 58.1 58.1 58.1H459c-14.8 21-33.5 51.5-33.5 71.8 0 34.3 27.9 62.3 62.3 62.3 34.3 0 62.2-27.9 62.2-62.3 0-20.3-18.6-50.7-33.5-71.8h264.9c-14.8 21-33.5 51.5-33.5 71.8 0 34.3 27.9 62.3 62.3 62.3 34.3 0 62.3-27.9 62.3-62.3 0-20.3-18.6-50.7-33.5-71.8h39.4c32 0 58.1-26 58.1-58.1 0-23.1-13.6-43-33.2-52.4zM487.8 810.4c-14.5 0-26.3-11.8-26.3-26.3 0-8.1 12.1-29.6 26.3-50 14.1 20.4 26.2 41.9 26.2 50 0 14.5-11.8 26.3-26.2 26.3z m322.5 0c-14.5 0-26.3-11.8-26.3-26.3 0-8.1 12.1-29.6 26.3-50 14.1 20.4 26.3 41.9 26.3 50-0.1 14.5-11.9 26.3-26.3 26.3zM649 383.2c118.8 0 215.4 94.9 218.1 213.1H430.9c2.8-118.1 99.3-213.1 218.1-213.1z m251.5 271.1c0 12.2-9.9 22.1-22.1 22.1H419.6c-12.2 0-22.1-9.9-22.1-22.1 0-12.2 9.9-22.1 22.1-22.1h458.8c12.2 0.1 22.1 10 22.1 22.1z"
|
fill="#97DCFF" p-id="3171"></path>
|
||||||
fill="#453B56" p-id="3181"></path>
|
<path d="M123.5 471.3c-9.9 0-18-8.1-18-18v-302c0-9.9 8.1-18 18-18h58c9.9 0 18 8.1 18 18v302c0 9.9-8.1 18-18 18h-58z"
|
||||||
</svg>
|
fill="#FCC66F" p-id="3172"></path>
|
||||||
</div>
|
<path d="M181.5 151.3v302h-58v-302h58m0-36h-58c-19.9 0-36 16.1-36 36v302c0 19.9 16.1 36 36 36h58c19.9 0 36-16.1 36-36v-302c0-19.8-16.1-36-36-36z"
|
||||||
</div>
|
fill="#453B56" p-id="3173"></path>
|
||||||
</div>
|
<path d="M266.4 210.7m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56"
|
||||||
</div>
|
p-id="3174"></path>
|
||||||
</div>
|
<path d="M430.8 641.1c-9.9 0-18-8.1-18-18v-21.6c0-130.3 106-236.3 236.3-236.3s236.3 106 236.3 236.3v21.6c0 9.9-8.1 18-18 18H430.8z"
|
||||||
<div class="layui-col-xs6 layui-col-md3">
|
fill="#FCC66F" p-id="3175"></path>
|
||||||
<div class="layui-card top-panel">
|
<path d="M649 383.2c-5 0-10 0.2-15 0.6 113.5 7.7 203.3 102.2 203.3 217.7v21.6h30v-21.6c0-120.6-97.7-218.3-218.3-218.3z"
|
||||||
<div class="layui-card-header">下载数量</div>
|
fill="#FFD79C" p-id="3176"></path>
|
||||||
<div class="layui-card-body">
|
<path d="M419.6 694.4c-22.1 0-40.1-18-40.1-40.1s18-40.1 40.1-40.1h458.8c22.1 0 40.1 18 40.1 40.1s-18 40.1-40.1 40.1H419.6z"
|
||||||
<div class="layui-row layui-col-space5">
|
fill="#F56E73" p-id="3177"></path>
|
||||||
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value3">
|
<path d="M878.4 632.3h-30c12.2 0 22.1 9.9 22.1 22.1s-9.9 22.1-22.1 22.1h30c12.2 0 22.1-9.9 22.1-22.1s-9.9-22.1-22.1-22.1z"
|
||||||
0
|
fill="#FFA1A8" p-id="3178"></path>
|
||||||
</div>
|
<path d="M693.3 846.4c0 24.4-19.8 44.3-44.3 44.3-24.4 0-44.3-19.8-44.3-44.3s44.3-80.3 44.3-80.3 44.3 55.9 44.3 80.3z"
|
||||||
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
fill="#97DCFF" p-id="3179"></path>
|
||||||
<svg t="1591462464512" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
<path d="M649 908.7c-34.3 0-62.3-27.9-62.3-62.3 0-28.5 36.9-77.2 48.1-91.4 3.4-4.3 8.6-6.8 14.1-6.8s10.7 2.5 14.1 6.8c11.3 14.2 48.1 62.9 48.1 91.4 0.2 34.3-27.8 62.3-62.1 62.3z m0-112.3c-14.1 20.4-26.3 41.9-26.3 50 0 14.5 11.8 26.3 26.3 26.3s26.3-11.8 26.3-26.3c0-8.1-12.1-29.6-26.3-50z"
|
||||||
p-id="3311" width="200" height="200">
|
fill="#453B56" p-id="3180"></path>
|
||||||
<path d="M750.4 216.5h-130v-15.3c0-32.9-26.8-59.7-59.7-59.7h-97.3c-32.9 0-59.7 26.8-59.7 59.7v15.3h-130c-30.7 0-55.6 25-55.6 55.6v72.4c0 9.9 8.1 18 18 18h31.5v478c0 23.2 18.8 42 42 42h405c23.2 0 42-18.8 42-42v-478H788c9.9 0 18-8.1 18-18v-72.4c0-30.6-25-55.6-55.6-55.6z"
|
<path d="M903.3 601.9v-0.5c0-134.1-104.4-244.3-236.3-253.6v-30.7c0-68.7-55.9-124.6-124.6-124.6H326.5c-9.9 0-18 8.1-18 18s8.1 18 18 18h215.9c48.8 0 88.6 39.7 88.6 88.6v30.7c-131.8 9.3-236.3 119.4-236.3 253.6v0.5c-19.6 9.3-33.2 29.3-33.2 52.4 0 32 26 58.1 58.1 58.1H459c-14.8 21-33.5 51.5-33.5 71.8 0 34.3 27.9 62.3 62.3 62.3 34.3 0 62.2-27.9 62.2-62.3 0-20.3-18.6-50.7-33.5-71.8h264.9c-14.8 21-33.5 51.5-33.5 71.8 0 34.3 27.9 62.3 62.3 62.3 34.3 0 62.3-27.9 62.3-62.3 0-20.3-18.6-50.7-33.5-71.8h39.4c32 0 58.1-26 58.1-58.1 0-23.1-13.6-43-33.2-52.4zM487.8 810.4c-14.5 0-26.3-11.8-26.3-26.3 0-8.1 12.1-29.6 26.3-50 14.1 20.4 26.2 41.9 26.2 50 0 14.5-11.8 26.3-26.2 26.3z m322.5 0c-14.5 0-26.3-11.8-26.3-26.3 0-8.1 12.1-29.6 26.3-50 14.1 20.4 26.3 41.9 26.3 50-0.1 14.5-11.9 26.3-26.3 26.3zM649 383.2c118.8 0 215.4 94.9 218.1 213.1H430.9c2.8-118.1 99.3-213.1 218.1-213.1z m251.5 271.1c0 12.2-9.9 22.1-22.1 22.1H419.6c-12.2 0-22.1-9.9-22.1-22.1 0-12.2 9.9-22.1 22.1-22.1h458.8c12.2 0.1 22.1 10 22.1 22.1z"
|
||||||
fill="#FCC66F" p-id="3312"></path>
|
fill="#453B56" p-id="3181"></path>
|
||||||
<path d="M708.5 344.5v496c0 13.3-10.7 24-24 24h30c13.3 0 24-10.7 24-24v-496h-30z" fill="#FFD79C" p-id="3313"></path>
|
</svg>
|
||||||
<path d="M309.5 882.5c-23.2 0-42-18.8-42-42V596c0-9.9 8.1-18 18-18h36.8c30.2 0 54.8 24.6 54.8 54.8v231.7c0 9.9-8.1 18-18 18h-49.6zM664.9 882.5c-9.9 0-18-8.1-18-18V632.8c0-30.2 24.6-54.8 54.8-54.8h36.8c9.9 0 18 8.1 18 18v244.5c0 23.2-18.8 42-42 42h-49.6z"
|
</div>
|
||||||
fill="#F56E73" p-id="3314"></path>
|
</div>
|
||||||
<path d="M708.5 596v244.5c0 13.3-10.7 24-24 24h30c13.3 0 24-10.7 24-24V596h-30z" fill="#FFA1A8" p-id="3315"></path>
|
</div>
|
||||||
<path d="M475.2 882.5c-9.9 0-18-8.1-18-18V632.8c0-30.2 24.6-54.8 54.8-54.8 30.2 0 54.8 24.6 54.8 54.8v231.7c0 9.9-8.1 18-18 18h-73.6z"
|
</div>
|
||||||
fill="#F56E73" p-id="3316"></path>
|
</div>
|
||||||
<path d="M560.7 159.5h-18c23 0 41.7 18.7 41.7 41.7V221h18v-19.8c-0.1-23-18.7-41.7-41.7-41.7zM750.4 234.5h-30c20.8 0 37.6 16.8 37.6 37.6v72.4h30v-72.4c0-20.8-16.8-37.6-37.6-37.6z"
|
<div class="layui-col-xs6 layui-col-md3">
|
||||||
fill="#FFD79C" p-id="3317"></path>
|
<div class="layui-card top-panel">
|
||||||
<path d="M750.4 198.5H638.2c-1.4-41.6-35.6-75-77.5-75h-97.3c-41.9 0-76.1 33.4-77.5 75H273.6c-40.6 0-73.6 33-73.6 73.6v72.4c0 19.9 16.1 36 36 36h13.5v460c0 33.1 26.9 60 60 60H714.7c33.1 0 60-26.9 60-60v-460H788c19.9 0 36-16.1 36-36v-72.4c0-40.6-33-73.6-73.6-73.6z m-287.1-39h97.3c22.1 0 40.2 17.2 41.5 39H421.8c1.4-21.8 19.4-39 41.5-39z m-104.2 705h-49.6c-13.3 0-24-10.7-24-24V596h36.8c20.3 0 36.8 16.5 36.8 36.8v231.7z m189.7 0h-73.6V632.8c0-20.3 16.5-36.8 36.8-36.8 20.3 0 36.8 16.5 36.8 36.8v231.7z m189.7-24c0 13.3-10.7 24-24 24h-49.6V632.8c0-20.3 16.5-36.8 36.8-36.8h36.8v244.5z m0-280.5h-36.8c-40.1 0-72.8 32.6-72.8 72.8v231.7h-44.2V632.8c0-40.1-32.6-72.8-72.8-72.8-40.1 0-72.8 32.6-72.8 72.8v231.7h-44.2V632.8c0-40.1-32.6-72.8-72.8-72.8h-36.8v-74.5h279c9.9 0 18-8.1 18-18s-8.1-18-18-18h-279v-69h453V560zM788 344.5H236v-72.4c0-20.8 16.8-37.6 37.6-37.6h476.8c20.8 0 37.6 16.8 37.6 37.6v72.4z"
|
<div class="layui-card-header">下载数量</div>
|
||||||
fill="#453B56" p-id="3318"></path>
|
<div class="layui-card-body">
|
||||||
<path d="M621.8 467.5m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56" p-id="3319"></path>
|
<div class="layui-row layui-col-space5">
|
||||||
</svg>
|
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value3">
|
||||||
</div>
|
0
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
||||||
</div>
|
<svg t="1591462464512" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||||
</div>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<div class="layui-col-xs6 layui-col-md3">
|
p-id="3311" width="200" height="200">
|
||||||
<div class="layui-card top-panel">
|
<path d="M750.4 216.5h-130v-15.3c0-32.9-26.8-59.7-59.7-59.7h-97.3c-32.9 0-59.7 26.8-59.7 59.7v15.3h-130c-30.7 0-55.6 25-55.6 55.6v72.4c0 9.9 8.1 18 18 18h31.5v478c0 23.2 18.8 42 42 42h405c23.2 0 42-18.8 42-42v-478H788c9.9 0 18-8.1 18-18v-72.4c0-30.6-25-55.6-55.6-55.6z"
|
||||||
<div class="layui-card-header">流量统计</div>
|
fill="#FCC66F" p-id="3312"></path>
|
||||||
<div class="layui-card-body">
|
<path d="M708.5 344.5v496c0 13.3-10.7 24-24 24h30c13.3 0 24-10.7 24-24v-496h-30z"
|
||||||
<div class="layui-row layui-col-space5">
|
fill="#FFD79C" p-id="3313"></path>
|
||||||
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value4">
|
<path d="M309.5 882.5c-23.2 0-42-18.8-42-42V596c0-9.9 8.1-18 18-18h36.8c30.2 0 54.8 24.6 54.8 54.8v231.7c0 9.9-8.1 18-18 18h-49.6zM664.9 882.5c-9.9 0-18-8.1-18-18V632.8c0-30.2 24.6-54.8 54.8-54.8h36.8c9.9 0 18 8.1 18 18v244.5c0 23.2-18.8 42-42 42h-49.6z"
|
||||||
0
|
fill="#F56E73" p-id="3314"></path>
|
||||||
</div>
|
<path d="M708.5 596v244.5c0 13.3-10.7 24-24 24h30c13.3 0 24-10.7 24-24V596h-30z"
|
||||||
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
fill="#FFA1A8" p-id="3315"></path>
|
||||||
<svg t="1591462491887" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
<path d="M475.2 882.5c-9.9 0-18-8.1-18-18V632.8c0-30.2 24.6-54.8 54.8-54.8 30.2 0 54.8 24.6 54.8 54.8v231.7c0 9.9-8.1 18-18 18h-73.6z"
|
||||||
p-id="3449" width="200" height="200">
|
fill="#F56E73" p-id="3316"></path>
|
||||||
<path d="M363.2 807c-9.9 0-18-8.1-18-18v-75.5c0-9.9 8.1-18 18-18h108.5c9.9 0 18 8.1 18 18V789c0 9.9-8.1 18-18 18H363.2z"
|
<path d="M560.7 159.5h-18c23 0 41.7 18.7 41.7 41.7V221h18v-19.8c-0.1-23-18.7-41.7-41.7-41.7zM750.4 234.5h-30c20.8 0 37.6 16.8 37.6 37.6v72.4h30v-72.4c0-20.8-16.8-37.6-37.6-37.6z"
|
||||||
fill="#F56E73" p-id="3450"></path>
|
fill="#FFD79C" p-id="3317"></path>
|
||||||
<path d="M441.7 713.5h30V789h-30z" fill="#FFA1A8" p-id="3451"></path>
|
<path d="M750.4 198.5H638.2c-1.4-41.6-35.6-75-77.5-75h-97.3c-41.9 0-76.1 33.4-77.5 75H273.6c-40.6 0-73.6 33-73.6 73.6v72.4c0 19.9 16.1 36 36 36h13.5v460c0 33.1 26.9 60 60 60H714.7c33.1 0 60-26.9 60-60v-460H788c19.9 0 36-16.1 36-36v-72.4c0-40.6-33-73.6-73.6-73.6z m-287.1-39h97.3c22.1 0 40.2 17.2 41.5 39H421.8c1.4-21.8 19.4-39 41.5-39z m-104.2 705h-49.6c-13.3 0-24-10.7-24-24V596h36.8c20.3 0 36.8 16.5 36.8 36.8v231.7z m189.7 0h-73.6V632.8c0-20.3 16.5-36.8 36.8-36.8 20.3 0 36.8 16.5 36.8 36.8v231.7z m189.7-24c0 13.3-10.7 24-24 24h-49.6V632.8c0-20.3 16.5-36.8 36.8-36.8h36.8v244.5z m0-280.5h-36.8c-40.1 0-72.8 32.6-72.8 72.8v231.7h-44.2V632.8c0-40.1-32.6-72.8-72.8-72.8-40.1 0-72.8 32.6-72.8 72.8v231.7h-44.2V632.8c0-40.1-32.6-72.8-72.8-72.8h-36.8v-74.5h279c9.9 0 18-8.1 18-18s-8.1-18-18-18h-279v-69h453V560zM788 344.5H236v-72.4c0-20.8 16.8-37.6 37.6-37.6h476.8c20.8 0 37.6 16.8 37.6 37.6v72.4z"
|
||||||
<path d="M259.6 398c-9.9 0-18-8.1-18-18V178.6c0-23.8 19.3-43.1 43.1-43.1s43.1 19.3 43.1 43.1V380c0 9.9-8.1 18-18 18h-50.2zM525.1 398c-9.9 0-18-8.1-18-18V178.6c0-23.8 19.3-43.1 43.1-43.1s43.1 19.3 43.1 43.1V380c0 9.9-8.1 18-18 18h-50.2z"
|
fill="#453B56" p-id="3318"></path>
|
||||||
fill="#65C8FF" p-id="3452"></path>
|
<path d="M621.8 467.5m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56"
|
||||||
<path d="M550.2 153.5c-3.2 0-6.2 0.7-9 1.7 9.4 3.6 16.1 12.7 16.1 23.4V380h18V178.6c0.1-13.9-11.2-25.1-25.1-25.1z"
|
p-id="3319"></path>
|
||||||
fill="#97DCFF" p-id="3453"></path>
|
</svg>
|
||||||
<path d="M686 330.5H149c-9.9 0-18 8.1-18 18v63c0 9.9 8.1 18 18 18h33.2l45 225c8.7 43.4 47.1 75 91.4 75h197.6c44.3 0 82.7-31.5 91.4-75l45-225H686c9.9 0 18-8.1 18-18v-63c0-9.9-8.1-18-18-18z"
|
</div>
|
||||||
fill="#FCC66F" p-id="3454"></path>
|
</div>
|
||||||
<path d="M608 411.5L560.1 651c-7 35.2-37.9 60.5-73.8 60.5h30c35.9 0 66.7-25.3 73.8-60.5L638 411.5h-30zM656 348.5h30v63h-30z"
|
</div>
|
||||||
fill="#FFD79C" p-id="3455"></path>
|
</div>
|
||||||
<path d="M474.2 543.5m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56" p-id="3456"></path>
|
</div>
|
||||||
<path d="M416.9 525.5h-125c-9.9 0-18 8.1-18 18s8.1 18 18 18h125c9.9 0 18-8.1 18-18s-8.1-18-18-18zM893 543.5h-33.4c-65.2 0-118.2 53-118.2 118.2v19.6c0 9.9 8.1 18 18 18s18-8.1 18-18v-19.6c0-45.3 36.9-82.2 82.2-82.2H893c9.9 0 18-8.1 18-18s-8-18-18-18zM772.2 744.2c7-7 7-18.4 0-25.5-7-7-18.4-7-25.5 0s-7 18.4 0 25.5 18.4 7.1 25.5 0z"
|
<div class="layui-col-xs6 layui-col-md3">
|
||||||
fill="#453B56" p-id="3457"></path>
|
<div class="layui-card top-panel">
|
||||||
<path d="M759.5 761.6c-9.9 0-18 8.1-18 18v11.6c0 43.7-35.6 79.3-79.3 79.3H487.3c-26.4 0-48.3-19.9-51.4-45.5h35.8c19.9 0 36-16.1 36-36v-41.5h8.6c52.8 0 98.7-37.6 109.1-89.4l42.1-210.6H686c19.9 0 36-16.1 36-36v-63c0-19.9-16.1-36-36-36h-74.6V178.6c0-33.7-27.4-61.1-61.1-61.1s-61.1 27.4-61.1 61.1v133.9H345.9V178.6c0-33.7-27.4-61.1-61.1-61.1s-61.1 27.4-61.1 61.1v133.9H149c-19.9 0-36 16.1-36 36v63c0 19.9 16.1 36 36 36h18.5l42.1 210.6c10.4 51.8 56.2 89.4 109.1 89.4h8.6V789c0 19.9 16.1 36 36 36h36.6c3.3 45.5 41.2 81.5 87.5 81.5h174.8c63.6 0 115.3-51.7 115.3-115.3v-11.6c0-10-8.1-18-18-18z m-234.4-583c0-13.9 11.2-25.1 25.1-25.1s25.1 11.2 25.1 25.1v133.9H525V178.6z m-265.5 0c0-13.9 11.2-25.1 25.1-25.1s25.1 11.2 25.1 25.1v133.9h-50.3V178.6zM149 411.5v-63h537v63H149z m169.7 300c-35.9 0-66.7-25.3-73.8-60.5l-40.7-203.5h426.6L590.1 651c-7 35.2-37.9 60.5-73.8 60.5H318.7z m44.5 77.5v-41.5h108.5V789H363.2z"
|
<div class="layui-card-header">流量统计</div>
|
||||||
fill="#453B56" p-id="3458"></path>
|
<div class="layui-card-body">
|
||||||
</svg>
|
<div class="layui-row layui-col-space5">
|
||||||
</div>
|
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="value4">
|
||||||
</div>
|
0
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
|
||||||
</div>
|
<svg t="1591462491887" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||||
</div>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<div class="layui-row layui-col-space10">
|
p-id="3449" width="200" height="200">
|
||||||
<div class="layui-col-md9">
|
<path d="M363.2 807c-9.9 0-18-8.1-18-18v-75.5c0-9.9 8.1-18 18-18h108.5c9.9 0 18 8.1 18 18V789c0 9.9-8.1 18-18 18H363.2z"
|
||||||
<div class="layui-card">
|
fill="#F56E73" p-id="3450"></path>
|
||||||
<div class="layui-card-body">
|
<path d="M441.7 713.5h30V789h-30z" fill="#FFA1A8" p-id="3451"></path>
|
||||||
<div class="layui-tab custom-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<path d="M259.6 398c-9.9 0-18-8.1-18-18V178.6c0-23.8 19.3-43.1 43.1-43.1s43.1 19.3 43.1 43.1V380c0 9.9-8.1 18-18 18h-50.2zM525.1 398c-9.9 0-18-8.1-18-18V178.6c0-23.8 19.3-43.1 43.1-43.1s43.1 19.3 43.1 43.1V380c0 9.9-8.1 18-18 18h-50.2z"
|
||||||
<div id="echarts-records" style="background-color:#ffffff;min-height:400px;padding: 10px"></div>
|
fill="#65C8FF" p-id="3452"></path>
|
||||||
</div>
|
<path d="M550.2 153.5c-3.2 0-6.2 0.7-9 1.7 9.4 3.6 16.1 12.7 16.1 23.4V380h18V178.6c0.1-13.9-11.2-25.1-25.1-25.1z"
|
||||||
</div>
|
fill="#97DCFF" p-id="3453"></path>
|
||||||
</div>
|
<path d="M686 330.5H149c-9.9 0-18 8.1-18 18v63c0 9.9 8.1 18 18 18h33.2l45 225c8.7 43.4 47.1 75 91.4 75h197.6c44.3 0 82.7-31.5 91.4-75l45-225H686c9.9 0 18-8.1 18-18v-63c0-9.9-8.1-18-18-18z"
|
||||||
<div class="layui-card">
|
fill="#FCC66F" p-id="3454"></path>
|
||||||
<div class="layui-card-header">动态</div>
|
<path d="M608 411.5L560.1 651c-7 35.2-37.9 60.5-73.8 60.5h30c35.9 0 66.7-25.3 73.8-60.5L638 411.5h-30zM656 348.5h30v63h-30z"
|
||||||
<div class="layui-card-body">
|
fill="#FFD79C" p-id="3455"></path>
|
||||||
<dl class="layuiadmin-card-status">
|
<path d="M474.2 543.5m-18 0a18 18 0 1 0 36 0 18 18 0 1 0-36 0Z" fill="#453B56"
|
||||||
<dd>
|
p-id="3456"></path>
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
<path d="M416.9 525.5h-125c-9.9 0-18 8.1-18 18s8.1 18 18 18h125c9.9 0 18-8.1 18-18s-8.1-18-18-18zM893 543.5h-33.4c-65.2 0-118.2 53-118.2 118.2v19.6c0 9.9 8.1 18 18 18s18-8.1 18-18v-19.6c0-45.3 36.9-82.2 82.2-82.2H893c9.9 0 18-8.1 18-18s-8-18-18-18zM772.2 744.2c7-7 7-18.4 0-25.5-7-7-18.4-7-25.5 0s-7 18.4 0 25.5 18.4 7.1 25.5 0z"
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
fill="#453B56" p-id="3457"></path>
|
||||||
<div>
|
<path d="M759.5 761.6c-9.9 0-18 8.1-18 18v11.6c0 43.7-35.6 79.3-79.3 79.3H487.3c-26.4 0-48.3-19.9-51.4-45.5h35.8c19.9 0 36-16.1 36-36v-41.5h8.6c52.8 0 98.7-37.6 109.1-89.4l42.1-210.6H686c19.9 0 36-16.1 36-36v-63c0-19.9-16.1-36-36-36h-74.6V178.6c0-33.7-27.4-61.1-61.1-61.1s-61.1 27.4-61.1 61.1v133.9H345.9V178.6c0-33.7-27.4-61.1-61.1-61.1s-61.1 27.4-61.1 61.1v133.9H149c-19.9 0-36 16.1-36 36v63c0 19.9 16.1 36 36 36h18.5l42.1 210.6c10.4 51.8 56.2 89.4 109.1 89.4h8.6V789c0 19.9 16.1 36 36 36h36.6c3.3 45.5 41.2 81.5 87.5 81.5h174.8c63.6 0 115.3-51.7 115.3-115.3v-11.6c0-10-8.1-18-18-18z m-234.4-583c0-13.9 11.2-25.1 25.1-25.1s25.1 11.2 25.1 25.1v133.9H525V178.6z m-265.5 0c0-13.9 11.2-25.1 25.1-25.1s25.1 11.2 25.1 25.1v133.9h-50.3V178.6zM149 411.5v-63h537v63H149z m169.7 300c-35.9 0-66.7-25.3-73.8-60.5l-40.7-203.5h426.6L590.1 651c-7 35.2-37.9 60.5-73.8 60.5H318.7z m44.5 77.5v-41.5h108.5V789H363.2z"
|
||||||
<p>七彩枫叶 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin 专区</a> 回答问题</p>
|
fill="#453B56" p-id="3458"></path>
|
||||||
<span>几秒前</span>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</div>
|
||||||
<dd>
|
</div>
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
</div>
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
</div>
|
||||||
<div>
|
</div>
|
||||||
<p>简 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin 专区</a> 进行了 <a class="pear-text" lay-href="http://fly.layui.com/vipclub/list/layuiadmin/column/quiz/">提问</a></p>
|
<div class="layui-row layui-col-space10">
|
||||||
<span>2天前</span>
|
<div class="layui-col-md9">
|
||||||
</div>
|
<div class="layui-card">
|
||||||
</dd>
|
<div class="layui-card-body">
|
||||||
<dd>
|
<div class="layui-tab custom-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
<div id="echarts-records" style="background-color:#ffffff;min-height:400px;padding: 10px"></div>
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
</div>
|
||||||
<div>
|
</div>
|
||||||
<p>恒宇少年 将 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin </a> 更新至 2.3.0 版本</p>
|
</div>
|
||||||
<span>7天前</span>
|
<div class="layui-card">
|
||||||
</div>
|
<div class="layui-card-header">动态</div>
|
||||||
</dd>
|
<div class="layui-card-body">
|
||||||
<dd>
|
<dl class="layuiadmin-card-status">
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
<dd>
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
<div>
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
<p>如花 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin 社区</a> 发布了 <a class="pear-text" lay-href="http://fly.layui.com/column/suggest/">建议</a></p>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
<span>7天前</span>
|
<div>
|
||||||
</div>
|
<p>七彩枫叶 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
</dd>
|
Admin 专区</a> 回答问题</p>
|
||||||
<dd>
|
<span>几秒前</span>
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
</div>
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
</dd>
|
||||||
<div>
|
<dd>
|
||||||
<p>就眠仪式 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin 社区</a> 发布了 <a class="pear-text" lay-href="http://fly.layui.com/column/suggest/">建议</a></p>
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
<span>8天前</span>
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
</div>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
</dd>
|
<div>
|
||||||
<dd>
|
<p>简 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
|
Admin 专区</a> 进行了 <a class="pear-text"
|
||||||
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
lay-href="http://fly.layui.com/vipclub/list/layuiadmin/column/quiz/">提问</a>
|
||||||
<div>
|
</p>
|
||||||
<p>贤心 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear Admin 专区</a> 进行了 <a class="pear-text" lay-href="http://fly.layui.com/vipclub/list/layuiadmin/column/quiz/">提问</a></p>
|
<span>2天前</span>
|
||||||
<span>8天前</span>
|
</div>
|
||||||
</div>
|
</dd>
|
||||||
</dd>
|
<dd>
|
||||||
</dl>
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
</div>
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
</div>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
</div>
|
<div>
|
||||||
<div class="layui-col-md3">
|
<p>恒宇少年 将 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
<div class="layui-card">
|
Admin </a> 更新至 2.3.0 版本</p>
|
||||||
<div class="layui-card-header">最近更新</div>
|
<span>7天前</span>
|
||||||
<div class="layui-card-body">
|
</div>
|
||||||
<ul class="list">
|
</dd>
|
||||||
<li class="list-item"><span class="title">优化代码格式</span><span class="footer">2020-06-04 11:28</span></li>
|
<dd>
|
||||||
<li class="list-item"><span class="title">新增消息组件</span><span class="footer">2020-06-01 04:23</span></li>
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
<li class="list-item"><span class="title">移动端兼容</span><span class="footer">2020-05-22 21:38</span></li>
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
<li class="list-item"><span class="title">系统布局优化</span><span class="footer">2020-05-15 14:26</span></li>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
<li class="list-item"><span class="title">兼容多系统菜单模式</span><span class="footer">2020-05-13 16:32</span></li>
|
<div>
|
||||||
<li class="list-item"><span class="title">兼容多标签页切换</span><span class="footer">2019-12-9 14:58</span></li>
|
<p>如花 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
<li class="list-item"><span class="title">扩展下拉组件</span><span class="footer">2019-12-7 9:06</span></li>
|
Admin 社区</a> 发布了 <a class="pear-text"
|
||||||
<li class="list-item"><span class="title">扩展卡片样式</span><span class="footer">2019-12-1 10:26</span></li>
|
lay-href="http://fly.layui.com/column/suggest/">建议</a></p>
|
||||||
</ul>
|
<span>7天前</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</dd>
|
||||||
<div class="layui-card">
|
<dd>
|
||||||
<div class="layui-card-header">
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
链接
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
</div>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
<div class="layui-card-body">
|
<div>
|
||||||
<a target="_blank" href="http://www.pearadmin.com" class="pear-btn pear-btn-primary layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">官 网</a>
|
<p>就眠仪式 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
<br/>
|
Admin 社区</a> 发布了 <a class="pear-text"
|
||||||
<a target="_blank" href="https://gitee.com/pear-admin/Pear-Admin-Layui" class="pear-btn pear-btn-warming layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">下 载</a>
|
lay-href="http://fly.layui.com/column/suggest/">建议</a></p>
|
||||||
<br/>
|
<span>8天前</span>
|
||||||
<a target="_blank" href="https://gitee.com/pear-admin/pear-admin-flask" class="pear-btn pear-btn-danger layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">后 端</a>
|
</div>
|
||||||
</div>
|
</dd>
|
||||||
</div>
|
<dd>
|
||||||
</div>
|
<div class="layui-status-img"><a href="javascript:;"><img
|
||||||
</div>
|
style="width: 32px;height: 32px;border-radius: 50px;"
|
||||||
</div>
|
src="{{ url_for('static', filename='admin/admin/images/avatar.jpg') }}"></a></div>
|
||||||
<!--</div>-->
|
<div>
|
||||||
{% include 'admin/common/footer.html' %}
|
<p>贤心 在 <a class="pear-text" lay-href="https://gitee.com/Jmysy/Pear-Admin-Layui">Pear
|
||||||
<script>
|
Admin 专区</a> 进行了 <a class="pear-text"
|
||||||
layui.use(['layer', 'echarts', 'element', 'count'], function() {
|
lay-href="http://fly.layui.com/vipclub/list/layuiadmin/column/quiz/">提问</a>
|
||||||
var $ = layui.jquery,
|
</p>
|
||||||
layer = layui.layer,
|
<span>8天前</span>
|
||||||
element = layui.element,
|
</div>
|
||||||
count = layui.count,
|
</dd>
|
||||||
echarts = layui.echarts;
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-md3">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">最近更新</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<ul class="list">
|
||||||
|
<li class="list-item"><span class="title">优化代码格式</span><span
|
||||||
|
class="footer">2020-06-04 11:28</span></li>
|
||||||
|
<li class="list-item"><span class="title">新增消息组件</span><span
|
||||||
|
class="footer">2020-06-01 04:23</span></li>
|
||||||
|
<li class="list-item"><span class="title">移动端兼容</span><span
|
||||||
|
class="footer">2020-05-22 21:38</span></li>
|
||||||
|
<li class="list-item"><span class="title">系统布局优化</span><span
|
||||||
|
class="footer">2020-05-15 14:26</span></li>
|
||||||
|
<li class="list-item"><span class="title">兼容多系统菜单模式</span><span
|
||||||
|
class="footer">2020-05-13 16:32</span></li>
|
||||||
|
<li class="list-item"><span class="title">兼容多标签页切换</span><span
|
||||||
|
class="footer">2019-12-9 14:58</span></li>
|
||||||
|
<li class="list-item"><span class="title">扩展下拉组件</span><span
|
||||||
|
class="footer">2019-12-7 9:06</span></li>
|
||||||
|
<li class="list-item"><span class="title">扩展卡片样式</span><span
|
||||||
|
class="footer">2019-12-1 10:26</span></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-header">
|
||||||
|
链接
|
||||||
|
</div>
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<a target="_blank" href="http://www.pearadmin.com"
|
||||||
|
class="pear-btn pear-btn-primary layui-btn-fluid"
|
||||||
|
style="margin-top: 8px;height: 50px;line-height: 50px;">官 网</a>
|
||||||
|
<br/>
|
||||||
|
<a target="_blank" href="https://gitee.com/pear-admin/Pear-Admin-Layui"
|
||||||
|
class="pear-btn pear-btn-warming layui-btn-fluid"
|
||||||
|
style="margin-top: 8px;height: 50px;line-height: 50px;">下 载</a>
|
||||||
|
<br/>
|
||||||
|
<a target="_blank" href="https://gitee.com/pear-admin/pear-admin-flask"
|
||||||
|
class="pear-btn pear-btn-danger layui-btn-fluid"
|
||||||
|
style="margin-top: 8px;height: 50px;line-height: 50px;">后 端</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--</div>-->
|
||||||
|
{% include 'admin/common/footer.html' %}
|
||||||
|
<script>
|
||||||
|
layui.use(['layer', 'echarts', 'element', 'count'], function () {
|
||||||
|
var $ = layui.jquery,
|
||||||
|
layer = layui.layer,
|
||||||
|
element = layui.element,
|
||||||
|
count = layui.count,
|
||||||
|
echarts = layui.echarts
|
||||||
|
|
||||||
count.up("value1", {
|
count.up('value1', {
|
||||||
time: 4000,
|
time: 4000,
|
||||||
num: 440.34,
|
num: 440.34,
|
||||||
bit: 2,
|
bit: 2,
|
||||||
regulator: 50
|
regulator: 50
|
||||||
});
|
})
|
||||||
|
|
||||||
count.up("value2", {
|
count.up('value2', {
|
||||||
time: 4000,
|
time: 4000,
|
||||||
num: 236.30,
|
num: 236.30,
|
||||||
bit: 2,
|
bit: 2,
|
||||||
regulator: 50
|
regulator: 50
|
||||||
});
|
})
|
||||||
|
|
||||||
count.up("value3", {
|
count.up('value3', {
|
||||||
time: 4000,
|
time: 4000,
|
||||||
num: 634.43,
|
num: 634.43,
|
||||||
bit: 2,
|
bit: 2,
|
||||||
regulator: 50
|
regulator: 50
|
||||||
});
|
})
|
||||||
|
|
||||||
count.up("value4", {
|
count.up('value4', {
|
||||||
time: 4000,
|
time: 4000,
|
||||||
bit: 2,
|
bit: 2,
|
||||||
num: 373.23,
|
num: 373.23,
|
||||||
regulator: 50
|
regulator: 50
|
||||||
});
|
})
|
||||||
|
|
||||||
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden')
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
xAxis: [{
|
xAxis: [{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06'],
|
data: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06'],
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: "#999"
|
color: '#999'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
yAxis: [{
|
yAxis: [{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
splitNumber: 4,
|
splitNumber: 4,
|
||||||
splitLine: {
|
splitLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'dashed',
|
type: 'dashed',
|
||||||
color: '#DDD'
|
color: '#DDD'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: false,
|
show: false,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: "#333"
|
color: '#333'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: "#999"
|
color: '#999'
|
||||||
},
|
},
|
||||||
splitArea: {
|
splitArea: {
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
series: [{
|
series: [{
|
||||||
name: '课时',
|
name: '课时',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: [23, 60, 20, 36, 23, 85],
|
data: [23, 60, 20, 36, 23, 85],
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
width: 8,
|
width: 8,
|
||||||
color: {
|
color: {
|
||||||
type: 'linear',
|
type: 'linear',
|
||||||
|
|
||||||
colorStops: [{
|
colorStops: [{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#A9F387' // 0% 处的颜色
|
color: '#A9F387' // 0% 处的颜色
|
||||||
}, {
|
}, {
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#48D8BF' // 100% 处的颜色
|
color: '#48D8BF' // 100% 处的颜色
|
||||||
}],
|
}],
|
||||||
globalCoord: false // 缺省为 false
|
globalCoord: false // 缺省为 false
|
||||||
},
|
},
|
||||||
shadowColor: 'rgba(72,216,191, 0.3)',
|
shadowColor: 'rgba(72,216,191, 0.3)',
|
||||||
shadowBlur: 10,
|
shadowBlur: 10,
|
||||||
shadowOffsetY: 20
|
shadowOffsetY: 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
borderWidth: 10,
|
borderWidth: 10,
|
||||||
/*shadowColor: 'rgba(72,216,191, 0.3)',
|
/*shadowColor: 'rgba(72,216,191, 0.3)',
|
||||||
shadowBlur: 100,*/
|
shadowBlur: 100,*/
|
||||||
borderColor: "#A9F387"
|
borderColor: '#A9F387'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
smooth: true
|
smooth: true
|
||||||
}]
|
}]
|
||||||
};
|
}
|
||||||
echartsRecords.setOption(option);
|
echartsRecords.setOption(option)
|
||||||
|
|
||||||
window.onresize = function() {
|
window.onresize = function () {
|
||||||
echartsRecords.resize();
|
echartsRecords.resize()
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -81,43 +81,43 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery','dtree'], function () {
|
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
|
|
||||||
dtree.renderSelect({
|
dtree.renderSelect({
|
||||||
elem: "#selectParent",
|
elem: '#selectParent',
|
||||||
url: "/admin/dept/tree",
|
url: '/admin/dept/tree',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
selectInputName: {nodeId: "parentId", context: "parentName"},
|
selectInputName: { nodeId: 'parentId', context: 'parentName' },
|
||||||
skin: "layui",
|
skin: 'layui',
|
||||||
dataFormat: "list",
|
dataFormat: 'list',
|
||||||
response: {treeId: "deptId", parentId: "parentId", title: "deptName"},
|
response: { treeId: 'deptId', parentId: 'parentId', title: 'deptName' },
|
||||||
selectInitVal: "1"
|
selectInitVal: '1'
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(dept-save)', function (data) {
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/dept/save',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
dataType: 'json',
|
|
||||||
contentType: 'application/json',
|
|
||||||
type: 'post',
|
|
||||||
success: function (result) {
|
|
||||||
if (result.success) {
|
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
||||||
parent.render();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
form.on('submit(dept-save)', function (data) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/dept/save',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
dataType: 'json',
|
||||||
|
contentType: 'application/json',
|
||||||
|
type: 'post',
|
||||||
|
success: function (result) {
|
||||||
|
if (result.success) {
|
||||||
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
|
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||||
|
parent.render()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -26,21 +26,24 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">负责人</label>
|
<label class="layui-form-label">负责人</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{ dept.leader }}" name="leader" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" value="{{ dept.leader }}" name="leader" lay-verify="title" autocomplete="off"
|
||||||
|
placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">邮箱</label>
|
<label class="layui-form-label">邮箱</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{ dept.email }}" name="email" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" value="{{ dept.email }}" name="email" lay-verify="title" autocomplete="off"
|
||||||
|
placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">联系方式</label>
|
<label class="layui-form-label">联系方式</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{ dept.phone }}" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" value="{{ dept.phone }}" name="phone" lay-verify="title" autocomplete="off"
|
||||||
|
placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,16 +51,19 @@
|
|||||||
<label class="layui-form-label">状态</label>
|
<label class="layui-form-label">状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
|
|
||||||
<input type="radio" name="status"{% if dept.status == 1 %}checked{% endif %} value="1" title="开启">
|
<input type="radio" name="status" {% if dept.status == 1 %}checked{% endif %} value="1"
|
||||||
|
title="开启">
|
||||||
|
|
||||||
<input type="radio" name="status" {% if dept.status == 0 %}checked{% endif %} value="0" title="关闭"
|
<input type="radio" name="status" {% if dept.status == 0 %}checked{% endif %} value="0"
|
||||||
>
|
title="关闭"
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">排序</label>
|
<label class="layui-form-label">排序</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" name="sort" value="{{ dept.sort }}" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" name="sort" value="{{ dept.sort }}" lay-verify="title" autocomplete="off"
|
||||||
|
placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,31 +93,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(dept-update)', function (data) {
|
form.on('submit(dept-update)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/dept/update',
|
url: '/admin/dept/update',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'put',
|
type: 'put',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.render();
|
parent.render()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -34,33 +34,36 @@
|
|||||||
|
|
||||||
<script type="text/html" id="dept-toolbar">
|
<script type="text/html" id="dept-toolbar">
|
||||||
{% if authorize("admin:dept:edit") %}
|
{% if authorize("admin:dept:edit") %}
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||||
<i class="layui-icon layui-icon-add-1"></i>
|
<i class="layui-icon layui-icon-add-1"></i>
|
||||||
新增
|
新增
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:dept:remove") %}
|
{% if authorize("admin:dept:remove") %}
|
||||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||||
<i class="layui-icon layui-icon-delete"></i>
|
<i class="layui-icon layui-icon-delete"></i>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="dept-bar">
|
<script type="text/html" id="dept-bar">
|
||||||
{% if authorize("admin:dept:edit") %}
|
{% 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 class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||||
</button>
|
class="layui-icon layui-icon-edit"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:dept:remove") %}
|
{% 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 class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||||
</button>
|
class="layui-icon layui-icon-delete"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="dept-status">
|
<script type="text/html" id="dept-status">
|
||||||
<input type="checkbox" name="status" value="{{"{{ d.deptId }}"}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dept-enable"
|
<input type="checkbox" name="status" value="{{ "{{ d.deptId }}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||||
{{"{{# if(d.status==1){ }} checked {{# } }}"}}>
|
lay-filter="dept-enable"
|
||||||
|
{{ "{{# if(d.status==1){ }} checked {{# } }}" }}>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
@@ -68,158 +71,158 @@
|
|||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery', 'treetable','popup'], function () {
|
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let treetable = layui.treetable;
|
let treetable = layui.treetable
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
let MODULE_PATH = "/admin/dept/";
|
let MODULE_PATH = '/admin/dept/'
|
||||||
|
|
||||||
window.render = function () {
|
window.render = function () {
|
||||||
treetable.render({
|
treetable.render({
|
||||||
treeColIndex: 1,
|
treeColIndex: 1,
|
||||||
treeSpid: 0,
|
treeSpid: 0,
|
||||||
treeIdName: 'deptId',
|
treeIdName: 'deptId',
|
||||||
treePidName: 'parentId',
|
treePidName: 'parentId',
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
treeDefaultClose: false,
|
treeDefaultClose: false,
|
||||||
toolbar: '#dept-toolbar',
|
toolbar: '#dept-toolbar',
|
||||||
elem: '#dept-table',
|
elem: '#dept-table',
|
||||||
url: '/admin/dept/data',
|
url: '/admin/dept/data',
|
||||||
page: false,
|
page: false,
|
||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{type: 'checkbox'},
|
{ type: 'checkbox' },
|
||||||
{field: 'deptName', minWidth: 200, title: '部门名称'},
|
{ field: 'deptName', minWidth: 200, title: '部门名称' },
|
||||||
{field: 'leader', title: '负责人'},
|
{ field: 'leader', title: '负责人' },
|
||||||
{field: 'phone', title: '联系方式'},
|
{ field: 'phone', title: '联系方式' },
|
||||||
{field: 'email', title: '邮箱'},
|
{ field: 'email', title: '邮箱' },
|
||||||
{field: 'address', title: '详细地址'},
|
{ field: 'address', title: '详细地址' },
|
||||||
{field: 'status', title: '状态',templet:'#dept-status'},
|
{ field: 'status', title: '状态', templet: '#dept-status' },
|
||||||
{field: 'sort', title: '排序', width: 100},
|
{ field: 'sort', title: '排序', width: 100 },
|
||||||
{title: '操作', templet: '#dept-bar', width: 120, align: 'center'}
|
{ title: '操作', templet: '#dept-bar', width: 120, align: 'center' }
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
form.on('submit(dept-query)', function (data) {
|
form.on('submit(dept-query)', function (data) {
|
||||||
var keyword = data.field.deptName;
|
var keyword = data.field.deptName
|
||||||
var $tds = $('#dept-table').next('.treeTable').find('.layui-table-body tbody tr td');
|
var $tds = $('#dept-table').next('.treeTable').find('.layui-table-body tbody tr td')
|
||||||
if (!keyword) {
|
if (!keyword) {
|
||||||
$tds.css('background-color', 'transparent');
|
$tds.css('background-color', 'transparent')
|
||||||
layer.msg("请输入关键字", {icon: 5});
|
layer.msg('请输入关键字', { icon: 5 })
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
var searchCount = 0;
|
var searchCount = 0
|
||||||
$tds.each(function () {
|
$tds.each(function () {
|
||||||
$(this).css('background-color', 'transparent');
|
$(this).css('background-color', 'transparent')
|
||||||
if ($(this).text().indexOf(keyword) >= 0) {
|
if ($(this).text().indexOf(keyword) >= 0) {
|
||||||
$(this).css('background-color', 'rgba(250,230,160,0.5)');
|
$(this).css('background-color', 'rgba(250,230,160,0.5)')
|
||||||
if (searchCount === 0) {
|
if (searchCount === 0) {
|
||||||
$('body,html').stop(true);
|
$('body,html').stop(true)
|
||||||
$('body,html').animate({scrollTop: $(this).offset().top - 150}, 500);
|
$('body,html').animate({ scrollTop: $(this).offset().top - 150 }, 500)
|
||||||
}
|
}
|
||||||
searchCount++;
|
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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('switch(dept-enable)', function (obj) {
|
|
||||||
let operate;
|
|
||||||
if (obj.elem.checked) {
|
|
||||||
operate = "enable";
|
|
||||||
} else {
|
|
||||||
operate = "disable";
|
|
||||||
}
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('switch(dept-enable)', function (obj) {
|
||||||
|
let operate
|
||||||
|
if (obj.elem.checked) {
|
||||||
|
operate = 'enable'
|
||||||
|
} else {
|
||||||
|
operate = 'disable'
|
||||||
|
}
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/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>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -55,31 +55,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(dict-type-save)', function (data) {
|
form.on('submit(dict-type-save)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/dict/dictType/save',
|
url: '/admin/dict/dictType/save',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("dict-type-table");
|
parent.layui.table.reload('dict-type-table')
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">标识</label>
|
<label class="layui-form-label">标识</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{type_code}}" readonly="readonly" name="typeCode" lay-verify="title"
|
<input type="text" value="{{ type_code }}" readonly="readonly" name="typeCode"
|
||||||
|
lay-verify="title"
|
||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,31 +63,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(dict-data-save)', function (data) {
|
form.on('submit(dict-data-save)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/dict/dictData/save',
|
url: '/admin/dict/dictData/save',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("dict-data-table");
|
parent.layui.table.reload('dict-data-table')
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">标识</label>
|
<label class="layui-form-label">标识</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{dict_data.type_code}}" readonly="readonly" name="typeCode"
|
<input type="text" value="{{ dict_data.type_code }}" readonly="readonly" name="typeCode"
|
||||||
lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
|
lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<div class="layui-form-item layui-form-text">
|
<div class="layui-form-item layui-form-text">
|
||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea placeholder="请输入描述" name="remark"
|
<textarea placeholder="请输入描述" name="remark"
|
||||||
class="layui-textarea">{{ dict_data.remark }}</textarea>
|
class="layui-textarea">{{ dict_data.remark }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,31 +71,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(dict-data-save)', function (data) {
|
form.on('submit(dict-data-save)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/dict/dictData/update',
|
url: '/admin/dict/dictData/update',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'put',
|
type: 'put',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("dict-data-table");
|
parent.layui.table.reload('dict-data-table')
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,21 +12,21 @@
|
|||||||
<div class="layui-form-item layui-hide">
|
<div class="layui-form-item layui-hide">
|
||||||
<label class="layui-form-label">编号</label>
|
<label class="layui-form-label">编号</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{dict_type.id}}" name="id" lay-verify="title" autocomplete="off"
|
<input type="text" value="{{ dict_type.id }}" name="id" lay-verify="title" autocomplete="off"
|
||||||
placeholder="请输入标题" class="layui-input">
|
placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">名称</label>
|
<label class="layui-form-label">名称</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{dict_type.type_name}}" name="typeName" lay-verify="title"
|
<input type="text" value="{{ dict_type.type_name }}" name="typeName" lay-verify="title"
|
||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">标识</label>
|
<label class="layui-form-label">标识</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{dict_type.type_code}}" readonly name="typeCode"
|
<input type="text" value="{{ dict_type.type_code }}" readonly name="typeCode"
|
||||||
lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
|
lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
<div class="layui-form-item layui-form-text">
|
<div class="layui-form-item layui-form-text">
|
||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea placeholder="请输入描述" name="description"
|
<textarea placeholder="请输入描述" name="description"
|
||||||
class="layui-textarea">{{dict_type.description}}</textarea>
|
class="layui-textarea">{{ dict_type.description }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,33 +63,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(dict-type-update)', function (data) {
|
form.on('submit(dict-type-update)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/dict/dictType/update',
|
url: '/admin/dict/dictType/update',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'put',
|
type: 'put',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("dict-type-table");
|
parent.layui.table.reload('dict-type-table')
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -38,7 +38,29 @@
|
|||||||
<div class="layui-col-md6">
|
<div class="layui-col-md6">
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<svg class="empty" style="margin-top: 50px;margin-left: 220px;margin-bottom: 80px;" width="184" height="152" viewBox="0 0 184 152" xmlns="http://www.w3.org/2000/svg"><g fill="none" fillRule="evenodd"><g transform="translate(24 31.67)"><ellipse fillOpacity=".8" fill="#F5F5F7" cx="67.797" cy="106.89" rx="67.797" ry="12.668"></ellipse><path d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z" fill="#AEB8C2"></path><path d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z" fill="url(#linearGradient-1)" transform="translate(13.56)"></path><path d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z" fill="#F5F5F7"></path><path d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z" fill="#DCE0E6"></path></g><path d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z" fill="#DCE0E6"></path><g transform="translate(149.65 15.383)" fill="#FFF"><ellipse cx="20.654" cy="3.167" rx="2.849" ry="2.815"></ellipse><path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"></path></g></g></svg>
|
<svg class="empty" style="margin-top: 50px;margin-left: 220px;margin-bottom: 80px;" width="184"
|
||||||
|
height="152" viewBox="0 0 184 152" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g fill="none" fillRule="evenodd">
|
||||||
|
<g transform="translate(24 31.67)">
|
||||||
|
<ellipse fillOpacity=".8" fill="#F5F5F7" cx="67.797" cy="106.89" rx="67.797"
|
||||||
|
ry="12.668"></ellipse>
|
||||||
|
<path d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"
|
||||||
|
fill="#AEB8C2"></path>
|
||||||
|
<path d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z"
|
||||||
|
fill="url(#linearGradient-1)" transform="translate(13.56)"></path>
|
||||||
|
<path d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"
|
||||||
|
fill="#F5F5F7"></path>
|
||||||
|
<path d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"
|
||||||
|
fill="#DCE0E6"></path>
|
||||||
|
</g>
|
||||||
|
<path d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"
|
||||||
|
fill="#DCE0E6"></path>
|
||||||
|
<g transform="translate(149.65 15.383)" fill="#FFF">
|
||||||
|
<ellipse cx="20.654" cy="3.167" rx="2.849" ry="2.815"></ellipse>
|
||||||
|
<path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
<table id="dict-data-table" lay-filter="dict-data-table"></table>
|
<table id="dict-data-table" lay-filter="dict-data-table"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,8 +92,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="dict-type-enable">
|
<script type="text/html" id="dict-type-enable">
|
||||||
<input type="checkbox" value="{{"{{ d.id }}"}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dict-type-enable"
|
<input type="checkbox" value="{{ "{{ d.id }}" }}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dict-type-enable"
|
||||||
{{"{{# if(d.enable==1){ }} checked {{# } }}"}}>
|
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="dict-data-toolbar">
|
<script type="text/html" id="dict-data-toolbar">
|
||||||
@@ -93,259 +115,260 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="dict-data-enable">
|
<script type="text/html" id="dict-data-enable">
|
||||||
<input type="checkbox" value="{{"{{ d.dataId }}"}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dict-data-enable"
|
<input type="checkbox" value="{{ "{{ d.dataId }}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||||
{{"{{# if(d.enable==1){ }} checked {{# } }}"}}>
|
lay-filter="dict-data-enable"
|
||||||
|
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||||
</script>
|
</script>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery','popup'], function () {
|
layui.use(['table', 'form', 'jquery', 'popup'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
let typeCode;
|
let typeCode
|
||||||
|
|
||||||
let cols = [
|
let cols = [
|
||||||
[
|
[
|
||||||
{type: 'checkbox'},
|
{ type: 'checkbox' },
|
||||||
{title: '字典名称', field: 'typeName', align: 'center', width: 120},
|
{ title: '字典名称', field: 'typeName', align: 'center', width: 120 },
|
||||||
{title: '描述', field: 'description', align: 'center'},
|
{ title: '描述', field: 'description', align: 'center' },
|
||||||
{title: '字典状态', field: 'enable', align: 'center', templet: '#dict-type-enable'},
|
{ title: '字典状态', field: 'enable', align: 'center', templet: '#dict-type-enable' },
|
||||||
{title: '操作', toolbar: '#dict-type-bar', align: 'center', width: 180}
|
{ title: '操作', toolbar: '#dict-type-bar', align: 'center', width: 180 }
|
||||||
]
|
]
|
||||||
];
|
]
|
||||||
|
|
||||||
let dataCols = [
|
let dataCols = [
|
||||||
[
|
[
|
||||||
{type: 'checkbox'},
|
{ type: 'checkbox' },
|
||||||
{title: '标签', field: 'dataLabel', align: 'center', width: 120},
|
{ title: '标签', field: 'dataLabel', align: 'center', width: 120 },
|
||||||
{title: '对应值', field: 'dataValue', align: 'center'},
|
{ title: '对应值', field: 'dataValue', align: 'center' },
|
||||||
{title: '状态', field: 'enable', align: 'center', templet: '#dict-data-enable'},
|
{ title: '状态', field: 'enable', align: 'center', templet: '#dict-data-enable' },
|
||||||
{title: '操作', toolbar: '#dict-data-bar', align: 'center', width: 180}
|
{ title: '操作', toolbar: '#dict-data-bar', align: 'center', width: 180 }
|
||||||
]
|
]
|
||||||
];
|
]
|
||||||
|
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#dict-type-table',
|
elem: '#dict-type-table',
|
||||||
url: '/admin/dict/dictType/data',
|
url: '/admin/dict/dictType/data',
|
||||||
page: true,
|
page: true,
|
||||||
cols: cols,
|
cols: cols,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
height: 'full-148',
|
height: 'full-148',
|
||||||
toolbar: '#dict-type-toolbar',
|
toolbar: '#dict-type-toolbar',
|
||||||
defaultToolbar: [{
|
defaultToolbar: [{
|
||||||
layEvent: 'refresh',
|
layEvent: 'refresh',
|
||||||
icon: 'layui-icon-refresh',
|
icon: 'layui-icon-refresh',
|
||||||
}, 'filter', 'print', 'exports']
|
}, 'filter', 'print', 'exports']
|
||||||
});
|
|
||||||
|
|
||||||
window.renderData = function(code){
|
|
||||||
typeCode = code;
|
|
||||||
$(".empty").hide();
|
|
||||||
table.render({
|
|
||||||
elem: '#dict-data-table',
|
|
||||||
url: '/admin/dict/dictData/data?typeCode=' + typeCode,
|
|
||||||
page: true,
|
|
||||||
height: 'full-148',
|
|
||||||
cols: dataCols,
|
|
||||||
skin: 'line',
|
|
||||||
toolbar: '#dict-data-toolbar'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
table.on('tool(dict-type-table)', function (obj) {
|
|
||||||
if (obj.event === 'remove') {
|
|
||||||
window.removeType(obj);
|
|
||||||
} else if (obj.event === 'edit') {
|
|
||||||
window.editType(obj);
|
|
||||||
} else if (obj.event === 'details') {
|
|
||||||
window.renderData(obj.data['typeCode'])
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('toolbar(dict-type-table)', function (obj) {
|
|
||||||
if (obj.event === 'add') {
|
|
||||||
window.addType();
|
|
||||||
} else if (obj.event === 'refresh') {
|
|
||||||
window.refreshType();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(dict-type-query)', function (data) {
|
|
||||||
table.reload('dict-type-table', {where: data.field});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('switch(dict-type-enable)', function (obj) {
|
|
||||||
let operate;
|
|
||||||
if (obj.elem.checked) {
|
|
||||||
operate = "enable";
|
|
||||||
} else {
|
|
||||||
operate = "disable";
|
|
||||||
}
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/dict/dictType/' + operate,
|
|
||||||
data: JSON.stringify({id: 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.addType = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '新增',
|
|
||||||
shade: 0.1,
|
|
||||||
area: ['500px', '400px'],
|
|
||||||
content: '/admin/dict/dictType/add'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.editType = function (obj) {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '修改',
|
|
||||||
shade: 0.1,
|
|
||||||
area: ['500px', '400px'],
|
|
||||||
content: '/admin/dict/dictType/edit?dictTypeId=' + obj.data['id']
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.removeType = function (obj) {
|
|
||||||
layer.confirm('确定要删除该字典分类', {icon: 3, title: '提示'}, function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: "/admin/dict/dictType/remove/" + obj.data['id'],
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'delete',
|
|
||||||
success: function (result) {
|
|
||||||
layer.close(loading);
|
|
||||||
if (result.success) {
|
|
||||||
popup.success(result.msg, function(){
|
|
||||||
if(typeCode === obj.data['typeCode']){
|
|
||||||
$("[lay-id='dict-data-table']").remove();
|
|
||||||
$(".empty").show();
|
|
||||||
}
|
|
||||||
obj.del();
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
popup.failure(result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.refreshType = function () {
|
|
||||||
table.reload('dict-type-table');
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addData = function () {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '新增',
|
|
||||||
shade: 0.1,
|
|
||||||
area: ['500px', '450px'],
|
|
||||||
content: '/admin/dict/dictData/add?typeCode='+typeCode
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.editData = function (obj) {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '修改',
|
|
||||||
shade: 0.1,
|
|
||||||
area: ['500px', '450px'],
|
|
||||||
content: '/admin/dict/dictData/edit?dataId=' + obj.data['dataId']
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.removeData = function (obj) {
|
|
||||||
layer.confirm('确定要删除该字典值', {icon: 3, title: '提示'}, function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: "/admin/dict/dictData/remove/" + obj.data['dataId'],
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
table.on('tool(dict-data-table)', function (obj) {
|
|
||||||
if (obj.event === 'remove') {
|
|
||||||
window.removeData(obj);
|
|
||||||
} else if (obj.event === 'edit') {
|
|
||||||
window.editData(obj);
|
|
||||||
} else if (obj.event === 'details') {
|
|
||||||
window.details(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('toolbar(dict-data-table)', function (obj) {
|
|
||||||
if (obj.event === 'add') {
|
|
||||||
window.addData();
|
|
||||||
} else if (obj.event === 'refresh') {
|
|
||||||
window.refreshData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(dict-data-query)', function (data) {
|
|
||||||
data.field.typeCode = typeCode;
|
|
||||||
table.reload('dict-data-table', {where: data.field});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('switch(dict-data-enable)', function (obj) {
|
|
||||||
let operate;
|
|
||||||
if (obj.elem.checked) {
|
|
||||||
operate = "enable";
|
|
||||||
} else {
|
|
||||||
operate = "disable";
|
|
||||||
}
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/dict/dictData/' + operate,
|
|
||||||
data: JSON.stringify({dataId: 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.refreshData = function () {
|
|
||||||
table.reload('dict-data-table');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.renderData = function (code) {
|
||||||
|
typeCode = code
|
||||||
|
$('.empty').hide()
|
||||||
|
table.render({
|
||||||
|
elem: '#dict-data-table',
|
||||||
|
url: '/admin/dict/dictData/data?typeCode=' + typeCode,
|
||||||
|
page: true,
|
||||||
|
height: 'full-148',
|
||||||
|
cols: dataCols,
|
||||||
|
skin: 'line',
|
||||||
|
toolbar: '#dict-data-toolbar'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
table.on('tool(dict-type-table)', function (obj) {
|
||||||
|
if (obj.event === 'remove') {
|
||||||
|
window.removeType(obj)
|
||||||
|
} else if (obj.event === 'edit') {
|
||||||
|
window.editType(obj)
|
||||||
|
} else if (obj.event === 'details') {
|
||||||
|
window.renderData(obj.data['typeCode'])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('toolbar(dict-type-table)', function (obj) {
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
window.addType()
|
||||||
|
} else if (obj.event === 'refresh') {
|
||||||
|
window.refreshType()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('submit(dict-type-query)', function (data) {
|
||||||
|
table.reload('dict-type-table', { where: data.field })
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('switch(dict-type-enable)', function (obj) {
|
||||||
|
let operate
|
||||||
|
if (obj.elem.checked) {
|
||||||
|
operate = 'enable'
|
||||||
|
} else {
|
||||||
|
operate = 'disable'
|
||||||
|
}
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/dict/dictType/' + operate,
|
||||||
|
data: JSON.stringify({ id: 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.addType = function () {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '新增',
|
||||||
|
shade: 0.1,
|
||||||
|
area: ['500px', '400px'],
|
||||||
|
content: '/admin/dict/dictType/add'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.editType = function (obj) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '修改',
|
||||||
|
shade: 0.1,
|
||||||
|
area: ['500px', '400px'],
|
||||||
|
content: '/admin/dict/dictType/edit?dictTypeId=' + obj.data['id']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.removeType = function (obj) {
|
||||||
|
layer.confirm('确定要删除该字典分类', { icon: 3, title: '提示' }, function (index) {
|
||||||
|
layer.close(index)
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/dict/dictType/remove/' + obj.data['id'],
|
||||||
|
dataType: 'json',
|
||||||
|
type: 'delete',
|
||||||
|
success: function (result) {
|
||||||
|
layer.close(loading)
|
||||||
|
if (result.success) {
|
||||||
|
popup.success(result.msg, function () {
|
||||||
|
if (typeCode === obj.data['typeCode']) {
|
||||||
|
$('[lay-id=\'dict-data-table\']').remove()
|
||||||
|
$('.empty').show()
|
||||||
|
}
|
||||||
|
obj.del()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
popup.failure(result.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.refreshType = function () {
|
||||||
|
table.reload('dict-type-table')
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addData = function () {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '新增',
|
||||||
|
shade: 0.1,
|
||||||
|
area: ['500px', '450px'],
|
||||||
|
content: '/admin/dict/dictData/add?typeCode=' + typeCode
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.editData = function (obj) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '修改',
|
||||||
|
shade: 0.1,
|
||||||
|
area: ['500px', '450px'],
|
||||||
|
content: '/admin/dict/dictData/edit?dataId=' + obj.data['dataId']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.removeData = function (obj) {
|
||||||
|
layer.confirm('确定要删除该字典值', { icon: 3, title: '提示' }, function (index) {
|
||||||
|
layer.close(index)
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/dict/dictData/remove/' + obj.data['dataId'],
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
table.on('tool(dict-data-table)', function (obj) {
|
||||||
|
if (obj.event === 'remove') {
|
||||||
|
window.removeData(obj)
|
||||||
|
} else if (obj.event === 'edit') {
|
||||||
|
window.editData(obj)
|
||||||
|
} else if (obj.event === 'details') {
|
||||||
|
window.details(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('toolbar(dict-data-table)', function (obj) {
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
window.addData()
|
||||||
|
} else if (obj.event === 'refresh') {
|
||||||
|
window.refreshData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('submit(dict-data-query)', function (data) {
|
||||||
|
data.field.typeCode = typeCode
|
||||||
|
table.reload('dict-data-table', { where: data.field })
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('switch(dict-data-enable)', function (obj) {
|
||||||
|
let operate
|
||||||
|
if (obj.elem.checked) {
|
||||||
|
operate = 'enable'
|
||||||
|
} else {
|
||||||
|
operate = 'disable'
|
||||||
|
}
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/dict/dictData/' + operate,
|
||||||
|
data: JSON.stringify({ dataId: 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.refreshData = function () {
|
||||||
|
table.reload('dict-data-table')
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -71,43 +71,42 @@
|
|||||||
<!-- 依 赖 脚 本 -->
|
<!-- 依 赖 脚 本 -->
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['admin', 'jquery', 'layer', 'popup'], function () {
|
layui.use(['admin', 'jquery', 'layer', 'popup'], function () {
|
||||||
let admin = layui.admin;
|
let admin = layui.admin
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let layer = layui.layer;
|
let layer = layui.layer
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
// 框架初始化时会读取 根目录下 pear.configs.yml 文件作为初始化配置
|
// 框架初始化时会读取 根目录下 pear.configs.yml 文件作为初始化配置
|
||||||
// 你可以通过 admin.setConfigPath 方法修改配置文件位置
|
// 你可以通过 admin.setConfigPath 方法修改配置文件位置
|
||||||
// 你可以通过 admin.setConfigType 方法修改配置文件类型
|
// 你可以通过 admin.setConfigType 方法修改配置文件类型
|
||||||
admin.setConfigType("json");
|
admin.setConfigType('json')
|
||||||
admin.setConfigPath("{{ url_for('adminIndex.configs') }}");
|
admin.setConfigPath("{{ url_for('adminIndex.configs') }}")
|
||||||
|
|
||||||
admin.render();
|
admin.render()
|
||||||
|
|
||||||
|
// 注销实现
|
||||||
// 注销实现
|
admin.logout(function () {
|
||||||
admin.logout(function () {
|
let loading = layer.load()
|
||||||
let loading = layer.load();
|
$.ajax({
|
||||||
$.ajax({
|
url: '/admin/logout',
|
||||||
url: '/admin/logout',
|
dataType: 'json',
|
||||||
dataType: 'json',
|
type: 'post',
|
||||||
type: 'post',
|
success: function (result) {
|
||||||
success: function (result) {
|
layer.close(loading)
|
||||||
layer.close(loading);
|
if (result.success) {
|
||||||
if (result.success) {
|
popup.success(result.msg, function () {
|
||||||
popup.success(result.msg, function () {
|
location.href = '/admin'
|
||||||
location.href = "/admin";
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
});
|
return true
|
||||||
|
}
|
||||||
// 初始化消息事件
|
}
|
||||||
admin.message();
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 初始化消息事件
|
||||||
|
admin.message()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,30 +1,31 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>登录</title>
|
<title>登录</title>
|
||||||
<!-- 样 式 文 件 -->
|
<!-- 样 式 文 件 -->
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/component/pear/css/pear.css') }}" />
|
<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') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/login.css') }}"/>
|
||||||
</head>
|
</head>
|
||||||
<!-- 代 码 结 构 -->
|
<!-- 代 码 结 构 -->
|
||||||
<body background="{{ url_for('static', filename='/admin/admin/images/background.svg') }}" style="background-size: cover;">
|
<body background="{{ url_for('static', filename='/admin/admin/images/background.svg') }}"
|
||||||
|
style="background-size: cover;">
|
||||||
<form class="layui-form" action="javascript:void(0);">
|
<form class="layui-form" action="javascript:void(0);">
|
||||||
<div class="layui-form-item">
|
<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='/admin/admin/images/logo.png') }}"/>
|
||||||
<div class="title">Pear Admin</div>
|
<div class="title">Pear Admin</div>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
明 湖 区 最 具 影 响 力 的 设 计 规 范 之 一
|
明 湖 区 最 具 影 响 力 的 设 计 规 范 之 一
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<input name="username" type="text" placeholder="账 户 : admin " value="admin" hover class="layui-input" />
|
<input name="username" type="text" placeholder="账 户 : admin " value="admin" hover class="layui-input"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<input name="password" type="password" placeholder="密 码 : 123456 " value="123456" hover class="layui-input" />
|
<input name="password" type="password" placeholder="密 码 : 123456 " value="123456" hover class="layui-input"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<input placeholder="验证码 : " name="captcha" hover class="code layui-input layui-input-inline" />
|
<input placeholder="验证码 : " name="captcha" hover class="code layui-input layui-input-inline"/>
|
||||||
<img src="{{ url_for('adminIndex.get_captcha') }}" class="codeImage" id="captchaImage"/>
|
<img src="{{ url_for('adminIndex.get_captcha') }}" class="codeImage" id="captchaImage"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form','jquery','layer','button','popup'], function() {
|
layui.use(['form', 'jquery', 'layer', 'button', 'popup'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form;
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery;
|
||||||
let layer = layui.layer;
|
let layer = layui.layer;
|
||||||
@@ -46,23 +47,23 @@
|
|||||||
let popup = layui.popup;
|
let popup = layui.popup;
|
||||||
let captchaPath = "{{ url_for('adminIndex.get_captcha') }}";
|
let captchaPath = "{{ url_for('adminIndex.get_captcha') }}";
|
||||||
|
|
||||||
form.on('submit(login)', function(data){
|
form.on('submit(login)', function (data) {
|
||||||
let loader = layer.load();
|
let loader = layer.load();
|
||||||
let btn = button.load({elem: '.login'});
|
let btn = button.load({elem: '.login'});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:data.field,
|
data: data.field,
|
||||||
type:"post",
|
type: "post",
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
layer.close(loader);
|
layer.close(loader);
|
||||||
btn.stop(function(){
|
btn.stop(function () {
|
||||||
if(result.success){
|
if (result.success) {
|
||||||
popup.success(result.msg,function(){
|
popup.success(result.msg, function () {
|
||||||
location.href = "{{ url_for('adminIndex.index') }}";
|
location.href = "{{ url_for('adminIndex.index') }}";
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
popup.failure(result.msg,function(){
|
popup.failure(result.msg, function () {
|
||||||
document.getElementById("captchaImage").src=captchaPath + "?" + Math.random();
|
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -71,16 +72,18 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#captchaImage").click(function(){
|
$("#captchaImage").click(function () {
|
||||||
document.getElementById("captchaImage").src= captchaPath + "?" + Math.random();
|
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
|
||||||
})
|
});
|
||||||
setInterval(function(){
|
setInterval(function () {
|
||||||
document.getElementById("captchaImage").src= captchaPath + "?" + Math.random();
|
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
|
||||||
},30 * 1000);
|
}, 30 * 1000);
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
if(window!=top){ top.location.href = location.href; }
|
if (window != top) {
|
||||||
|
top.location.href = location.href;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>首页</title>
|
<title>首页</title>
|
||||||
{% include 'admin/common/header.html' %}
|
{% include 'admin/common/header.html' %}
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console2.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/console2.css') }}"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
<div class="layui-row layui-col-space10">
|
<div class="layui-row layui-col-space10">
|
||||||
@@ -19,13 +19,13 @@
|
|||||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||||
<div class="pear-card2">
|
<div class="pear-card2">
|
||||||
<div class="title">核心数</div>
|
<div class="title">核心数</div>
|
||||||
<div class="count pear-text" >{{ cpu_count }}</div>
|
<div class="count pear-text">{{ cpu_count }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||||
<div class="pear-card2">
|
<div class="pear-card2">
|
||||||
<div class="title">空闲率</div>
|
<div class="title">空闲率</div>
|
||||||
<div class="count pear-text" ></div>
|
<div class="count pear-text"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||||
@@ -96,20 +96,20 @@
|
|||||||
<div class="layui-card-header">磁盘信息</div>
|
<div class="layui-card-header">磁盘信息</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<ul class="pear-card-status">
|
<ul class="pear-card-status">
|
||||||
{% for i in disk_partitions_list %}
|
{% for i in disk_partitions_list %}
|
||||||
<li >
|
<li>
|
||||||
<p >{{ i.device }}</p>
|
<p>{{ i.device }}</p>
|
||||||
<p >{{ i.fstype }}</p>
|
<p>{{ i.fstype }}</p>
|
||||||
磁盘大小 <span >{{ i.total }}M</span>
|
磁盘大小 <span>{{ i.total }}M</span>
|
||||||
空闲大小 <span>{{ i.free }}M</span>
|
空闲大小 <span>{{ i.free }}M</span>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
已经使用 <span>{{ i.used }}M</span>
|
已经使用 <span>{{ i.used }}M</span>
|
||||||
使用概率 <span>{{ i.percent }}%</span>
|
使用概率 <span>{{ i.percent }}%</span>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="javascript:;" data-id="1" class="pear-btn pear-btn-xs pear-btn-primary pear-reply">详情</a>
|
<a href="javascript:;" data-id="1" class="pear-btn pear-btn-xs pear-btn-primary pear-reply">详情</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -153,14 +153,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['layer', 'echarts','popup'], function() {
|
layui.use(['layer', 'echarts', 'popup'], function () {
|
||||||
var $ = layui.jquery,
|
var $ = layui.jquery,
|
||||||
echarts = layui.echarts;
|
echarts = layui.echarts;
|
||||||
let popup = layui.popup;
|
let popup = layui.popup;
|
||||||
|
|
||||||
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||||
|
|
||||||
$("body").on("click", "[data-url]", function() {
|
$("body").on("click", "[data-url]", function () {
|
||||||
parent.layui.tab.addTabOnlyByElem("content", {
|
parent.layui.tab.addTabOnlyByElem("content", {
|
||||||
id: $(this).attr("data-id"),
|
id: $(this).attr("data-id"),
|
||||||
title: $(this).attr("data-title"),
|
title: $(this).attr("data-title"),
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
formatter: function(params) {
|
formatter: function (params) {
|
||||||
let html = '';
|
let html = '';
|
||||||
params.forEach(v => {
|
params.forEach(v => {
|
||||||
html +=
|
html +=
|
||||||
@@ -364,22 +364,22 @@
|
|||||||
|
|
||||||
echartsRecords.setOption(option);
|
echartsRecords.setOption(option);
|
||||||
|
|
||||||
window.onresize = function() {
|
window.onresize = function () {
|
||||||
echartsRecords.resize();
|
echartsRecords.resize();
|
||||||
}
|
};
|
||||||
|
|
||||||
setInterval(ajaxPolling, 1000 * 10)
|
setInterval(ajaxPolling, 1000 * 10);
|
||||||
|
|
||||||
function ajaxPolling() {
|
function ajaxPolling() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/admin/monitor/polling",
|
url: "/admin/monitor/polling",
|
||||||
success: function(data) {
|
success: function (data) {
|
||||||
echartData.push({
|
echartData.push({
|
||||||
name: data.time_now,
|
name: data.time_now,
|
||||||
cpu_percent: data.cups_percent,
|
cpu_percent: data.cups_percent,
|
||||||
memory_percent: data.memory_used
|
memory_percent: data.memory_used
|
||||||
});
|
});
|
||||||
if(echartData.length>8){
|
if (echartData.length > 8) {
|
||||||
echartData.shift();
|
echartData.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,20 +387,19 @@
|
|||||||
yAxisData1 = echartData.map(v => v.cpu_percent);
|
yAxisData1 = echartData.map(v => v.cpu_percent);
|
||||||
yAxisData2 = echartData.map(v => v.memory_percent);
|
yAxisData2 = echartData.map(v => v.memory_percent);
|
||||||
|
|
||||||
option.xAxis[0].data=xAxisData
|
option.xAxis[0].data = xAxisData;
|
||||||
option.series[0].data=yAxisData1
|
option.series[0].data = yAxisData1;
|
||||||
option.series[1].data=yAxisData2
|
option.series[1].data = yAxisData2;
|
||||||
|
|
||||||
echartsRecords.setOption(option);
|
echartsRecords.setOption(option);
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, type, errorThrown) {
|
error: function (xhr, type, errorThrown) {
|
||||||
popup.failure("api错误");
|
popup.failure("api错误");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,234 +37,234 @@
|
|||||||
</script>
|
</script>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery'], function () {
|
layui.use(['table', 'form', 'jquery'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let cols = [
|
let cols = [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: 'checkbox'
|
type: 'checkbox'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
sort: true,
|
sort: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
width: 80
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '文件名称',
|
title: '文件名称',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'href',
|
field: 'href',
|
||||||
title: '图片',
|
title: '图片',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
templet: function (d) {
|
templet: function (d) {
|
||||||
return '<img class="photo" style="max-width: 100%;\n' +
|
return '<img class="photo" style="max-width: 100%;\n' +
|
||||||
' height: 100%;\n' +
|
' height: 100%;\n' +
|
||||||
' cursor: pointer;" lay-event="photo" src=" ' + d.href + '"></i>';
|
' cursor: pointer;" lay-event="photo" src=" ' + d.href + '"></i>'
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'mime',
|
field: 'mime',
|
||||||
title: 'mime类型',
|
title: 'mime类型',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'size',
|
field: 'size',
|
||||||
title: '文件大小',
|
title: '文件大小',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'create_time',
|
field: 'create_time',
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
templet: '#file-uploadTime',
|
templet: '#file-uploadTime',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
toolbar: '#user-bar',
|
toolbar: '#user-bar',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
unresize: true,
|
unresize: true,
|
||||||
width: 200
|
width: 200
|
||||||
}
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
table.render({
|
|
||||||
elem: '#dataTable',
|
|
||||||
url: 'table',
|
|
||||||
page: true,
|
|
||||||
cols: cols,
|
|
||||||
skin: 'line',
|
|
||||||
toolbar: '#toolbar',
|
|
||||||
defaultToolbar: [{
|
|
||||||
layEvent: 'refresh',
|
|
||||||
icon: 'layui-icon-refresh',
|
|
||||||
}, 'filter', 'print', 'exports']
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('tool(dataTable)', function (obj) {
|
|
||||||
if (obj.event === 'remove') {
|
|
||||||
window.remove(obj);
|
|
||||||
} else if (obj.event === 'photo') {
|
|
||||||
window.photo(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('toolbar(dataTable)', function (obj) {
|
|
||||||
if (obj.event === 'add') {
|
|
||||||
window.add();
|
|
||||||
} else if (obj.event === 'refresh') {
|
|
||||||
window.refresh();
|
|
||||||
} else if (obj.event === 'batchRemove') {
|
|
||||||
window.batchRemove(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//弹出窗设置 自己设置弹出百分比
|
|
||||||
function screen() {
|
|
||||||
if (typeof width !== 'number' || width === 0) {
|
|
||||||
width = $(window).width() * 0.8;
|
|
||||||
}
|
|
||||||
if (typeof height !== 'number' || height === 0) {
|
|
||||||
height = $(window).height() - 20;
|
|
||||||
}
|
|
||||||
return [width + 'px', height + 'px'];
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
window.add = function () {
|
table.render({
|
||||||
layer.open({
|
elem: '#dataTable',
|
||||||
type: 2,
|
url: 'table',
|
||||||
maxmin: true,
|
page: true,
|
||||||
title: '新增图片',
|
cols: cols,
|
||||||
shade: 0.1,
|
skin: 'line',
|
||||||
area: screen(),
|
toolbar: '#toolbar',
|
||||||
content: 'upload'
|
defaultToolbar: [{
|
||||||
});
|
layEvent: 'refresh',
|
||||||
};
|
icon: 'layui-icon-refresh',
|
||||||
|
}, 'filter', 'print', 'exports']
|
||||||
window.remove = function (obj) {
|
|
||||||
layer.confirm('确定要删除该图片', {
|
|
||||||
icon: 3,
|
|
||||||
title: '提示'
|
|
||||||
}, function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: 'delete',
|
|
||||||
data: {id: obj.data['id']},
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'POST',
|
|
||||||
success: function (res) {
|
|
||||||
layer.close(loading);
|
|
||||||
if (res.success) {
|
|
||||||
layer.msg(res.msg, {
|
|
||||||
icon: 1,
|
|
||||||
time: 1000
|
|
||||||
}, function () {
|
|
||||||
obj.del();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(res.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('dataTable');
|
|
||||||
var hasCheckData = hasCheck.data;
|
|
||||||
if (hasCheckData.length > 0) {
|
|
||||||
$.each(hasCheckData, function (index, element) {
|
|
||||||
ids.push(element.id)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
layer.confirm('确定要删除这些图片', {
|
|
||||||
icon: 3,
|
|
||||||
title: '提示'
|
|
||||||
}, function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: "{{ url_for('adminFile.batch_remove') }}",
|
|
||||||
data: {ids: ids},
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'POST',
|
|
||||||
success: function (res) {
|
|
||||||
layer.close(loading);
|
|
||||||
if (res.success) {
|
|
||||||
layer.msg(res.msg, {
|
|
||||||
icon: 1,
|
|
||||||
time: 1000
|
|
||||||
}, function () {
|
|
||||||
table.reload('dataTable');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(res.msg, {
|
|
||||||
icon: 2,
|
|
||||||
time: 1000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.refresh = function () {
|
|
||||||
table.reload('dataTable');
|
|
||||||
};
|
|
||||||
// 查看大图
|
|
||||||
window.photo = function (obj) {
|
|
||||||
if (!obj.data.href || obj.data.href === "") {
|
|
||||||
layer.msg("图片地址错误!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var auto_img = {};
|
|
||||||
var img = new Image();
|
|
||||||
img.src = obj.data.href;
|
|
||||||
img.onload = function () {
|
|
||||||
var max_height = $(window).height() - 100;
|
|
||||||
var max_width = $(window).width();
|
|
||||||
var rate1 = max_height / img.height;
|
|
||||||
var rate2 = max_width / img.width;
|
|
||||||
var rate3 = 1;
|
|
||||||
var rate = Math.min(rate1, rate2, rate3);
|
|
||||||
auto_img.height = img.height * rate;
|
|
||||||
auto_img.width = img.width * rate;
|
|
||||||
layer.open({
|
|
||||||
type: 1,
|
|
||||||
title: false,
|
|
||||||
area: ['auto'],
|
|
||||||
skin: 'layui-layer-nobg', //没有背景色
|
|
||||||
shadeClose: true,
|
|
||||||
content: "<img src='" + obj.data['href'] + "' width='" + auto_img.width + "px' height='" + auto_img.height + "px'>"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
table.on('tool(dataTable)', function (obj) {
|
||||||
|
if (obj.event === 'remove') {
|
||||||
|
window.remove(obj)
|
||||||
|
} else if (obj.event === 'photo') {
|
||||||
|
window.photo(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('toolbar(dataTable)', function (obj) {
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
window.add()
|
||||||
|
} else if (obj.event === 'refresh') {
|
||||||
|
window.refresh()
|
||||||
|
} else if (obj.event === 'batchRemove') {
|
||||||
|
window.batchRemove(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//弹出窗设置 自己设置弹出百分比
|
||||||
|
function screen () {
|
||||||
|
if (typeof width !== 'number' || width === 0) {
|
||||||
|
width = $(window).width() * 0.8
|
||||||
|
}
|
||||||
|
if (typeof height !== 'number' || height === 0) {
|
||||||
|
height = $(window).height() - 20
|
||||||
|
}
|
||||||
|
return [width + 'px', height + 'px']
|
||||||
|
}
|
||||||
|
|
||||||
|
window.add = function () {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
maxmin: true,
|
||||||
|
title: '新增图片',
|
||||||
|
shade: 0.1,
|
||||||
|
area: screen(),
|
||||||
|
content: 'upload'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.remove = function (obj) {
|
||||||
|
layer.confirm('确定要删除该图片', {
|
||||||
|
icon: 3,
|
||||||
|
title: '提示'
|
||||||
|
}, function (index) {
|
||||||
|
layer.close(index)
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: 'delete',
|
||||||
|
data: { id: obj.data['id'] },
|
||||||
|
dataType: 'json',
|
||||||
|
type: 'POST',
|
||||||
|
success: function (res) {
|
||||||
|
layer.close(loading)
|
||||||
|
if (res.success) {
|
||||||
|
layer.msg(res.msg, {
|
||||||
|
icon: 1,
|
||||||
|
time: 1000
|
||||||
|
}, function () {
|
||||||
|
obj.del()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(res.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('dataTable')
|
||||||
|
var hasCheckData = hasCheck.data
|
||||||
|
if (hasCheckData.length > 0) {
|
||||||
|
$.each(hasCheckData, function (index, element) {
|
||||||
|
ids.push(element.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
layer.confirm('确定要删除这些图片', {
|
||||||
|
icon: 3,
|
||||||
|
title: '提示'
|
||||||
|
}, function (index) {
|
||||||
|
layer.close(index)
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: "{{ url_for('adminFile.batch_remove') }}",
|
||||||
|
data: { ids: ids },
|
||||||
|
dataType: 'json',
|
||||||
|
type: 'POST',
|
||||||
|
success: function (res) {
|
||||||
|
layer.close(loading)
|
||||||
|
if (res.success) {
|
||||||
|
layer.msg(res.msg, {
|
||||||
|
icon: 1,
|
||||||
|
time: 1000
|
||||||
|
}, function () {
|
||||||
|
table.reload('dataTable')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(res.msg, {
|
||||||
|
icon: 2,
|
||||||
|
time: 1000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.refresh = function () {
|
||||||
|
table.reload('dataTable')
|
||||||
|
}
|
||||||
|
// 查看大图
|
||||||
|
window.photo = function (obj) {
|
||||||
|
if (!obj.data.href || obj.data.href === '') {
|
||||||
|
layer.msg('图片地址错误!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var auto_img = {}
|
||||||
|
var img = new Image()
|
||||||
|
img.src = obj.data.href
|
||||||
|
img.onload = function () {
|
||||||
|
var max_height = $(window).height() - 100
|
||||||
|
var max_width = $(window).width()
|
||||||
|
var rate1 = max_height / img.height
|
||||||
|
var rate2 = max_width / img.width
|
||||||
|
var rate3 = 1
|
||||||
|
var rate = Math.min(rate1, rate2, rate3)
|
||||||
|
auto_img.height = img.height * rate
|
||||||
|
auto_img.width = img.width * rate
|
||||||
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
title: false,
|
||||||
|
area: ['auto'],
|
||||||
|
skin: 'layui-layer-nobg', //没有背景色
|
||||||
|
shadeClose: true,
|
||||||
|
content: '<img src=\'' + obj.data['href'] + '\' width=\'' + auto_img.width + 'px\' height=\'' + auto_img.height + 'px\'>'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -25,7 +25,8 @@
|
|||||||
<div class="layui-form-item" id="powerCodeItem">
|
<div class="layui-form-item" id="powerCodeItem">
|
||||||
<label class="layui-form-label">标识</label>
|
<label class="layui-form-label">标识</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" id="powerCode" name="powerCode" autocomplete="off" placeholder="权限标识" class="layui-input">
|
<input type="text" id="powerCode" name="powerCode" autocomplete="off" placeholder="权限标识"
|
||||||
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
@@ -39,7 +40,8 @@
|
|||||||
<div class="layui-form-item" id="powerUrlItem">
|
<div class="layui-form-item" id="powerUrlItem">
|
||||||
<label class="layui-form-label">路径</label>
|
<label class="layui-form-label">路径</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" id="powerUrl" name="powerUrl" autocomplete="off" placeholder="菜单路径" class="layui-input">
|
<input type="text" id="powerUrl" name="powerUrl" autocomplete="off" placeholder="菜单路径"
|
||||||
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" id="openTypeItem">
|
<div class="layui-form-item" id="openTypeItem">
|
||||||
@@ -61,7 +63,8 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">排序</label>
|
<label class="layui-form-label">排序</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" name="sort" lay-verify="title" autocomplete="off" placeholder="排序" class="layui-input">
|
<input type="text" name="sort" lay-verify="title" autocomplete="off" placeholder="排序"
|
||||||
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,83 +85,83 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let iconPicker = layui.iconPicker;
|
let iconPicker = layui.iconPicker
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
|
|
||||||
dtree.renderSelect({
|
dtree.renderSelect({
|
||||||
elem: "#selectParent",
|
elem: '#selectParent',
|
||||||
url: "/admin/power/selectParent",
|
url: '/admin/power/selectParent',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
selectInputName: {nodeId: "parentId", context: "powerName"},
|
selectInputName: { nodeId: 'parentId', context: 'powerName' },
|
||||||
skin: "layui",
|
skin: 'layui',
|
||||||
dataFormat: "list",
|
dataFormat: 'list',
|
||||||
response: {treeId: "powerId", parentId: "parentId", title: "powerName"}, //修改response中返回数据的定义
|
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' }, //修改response中返回数据的定义
|
||||||
selectInitVal: "0"
|
selectInitVal: '0'
|
||||||
});
|
|
||||||
|
|
||||||
form.on("radio(powerType)", function () {
|
|
||||||
if (this.value == '0') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#powerCodeItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#powerCode").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
} else if (this.value == '1') {
|
|
||||||
$("#powerUrlItem").show();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#openTypeItem").show();
|
|
||||||
} else if (this.value == '2') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(power-save)', function (data) {
|
|
||||||
data.field.icon = "layui-icon " + data.field.icon;
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/power/save',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
dataType: 'json',
|
|
||||||
contentType: 'application/json',
|
|
||||||
type: 'post',
|
|
||||||
success: function (result) {
|
|
||||||
if (result.success) {
|
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
|
||||||
parent.render();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
iconPicker.render({
|
|
||||||
// 选择器,推荐使用input
|
|
||||||
elem: '#icon',
|
|
||||||
// 数据类型:fontClass/unicode,推荐使用fontClass
|
|
||||||
type: 'fontClass',
|
|
||||||
// 是否开启搜索:true/false
|
|
||||||
search: true,
|
|
||||||
// 是否开启分页
|
|
||||||
page: true,
|
|
||||||
// 每页显示数量,默认12
|
|
||||||
limit: 12,
|
|
||||||
// 点击回调
|
|
||||||
click: function (data) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
form.on('radio(powerType)', function () {
|
||||||
|
if (this.value == '0') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#powerCodeItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#powerCode').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
} else if (this.value == '1') {
|
||||||
|
$('#powerUrlItem').show()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#openTypeItem').show()
|
||||||
|
} else if (this.value == '2') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('submit(power-save)', function (data) {
|
||||||
|
data.field.icon = 'layui-icon ' + data.field.icon
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/power/save',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
dataType: 'json',
|
||||||
|
contentType: 'application/json',
|
||||||
|
type: 'post',
|
||||||
|
success: function (result) {
|
||||||
|
if (result.success) {
|
||||||
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
|
parent.render()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
iconPicker.render({
|
||||||
|
// 选择器,推荐使用input
|
||||||
|
elem: '#icon',
|
||||||
|
// 数据类型:fontClass/unicode,推荐使用fontClass
|
||||||
|
type: 'fontClass',
|
||||||
|
// 是否开启搜索:true/false
|
||||||
|
search: true,
|
||||||
|
// 是否开启分页
|
||||||
|
page: true,
|
||||||
|
// 每页显示数量,默认12
|
||||||
|
limit: 12,
|
||||||
|
// 点击回调
|
||||||
|
click: function (data) {
|
||||||
|
console.log(data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -59,7 +59,8 @@
|
|||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="openType" id="openType">
|
<select name="openType" id="openType">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="_iframe" {% if power.open_type == "_iframe" %} selected{% endif %}>框架</option>
|
<option value="_iframe" {% if power.open_type == "_iframe" %} selected{% endif %}>框架
|
||||||
|
</option>
|
||||||
<option value="_blank" {% if power.open_type == "_blank" %} selected{% endif %}>签页</option>
|
<option value="_blank" {% if power.open_type == "_blank" %} selected{% endif %}>签页</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,102 +97,102 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
layui.use(['form', 'jquery', 'iconPicker', 'dtree'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let iconPicker = layui.iconPicker;
|
let iconPicker = layui.iconPicker
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
|
|
||||||
dtree.renderSelect({
|
dtree.renderSelect({
|
||||||
elem: "#selectParent",
|
elem: '#selectParent',
|
||||||
url: "/admin/power/selectParent",
|
url: '/admin/power/selectParent',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
selectInputName: {nodeId: "parentId", context: "powerName"},
|
selectInputName: { nodeId: 'parentId', context: 'powerName' },
|
||||||
skin: "layui",
|
skin: 'layui',
|
||||||
dataFormat: "list",
|
dataFormat: 'list',
|
||||||
response: {treeId: "powerId", parentId: "parentId", title: "powerName"},
|
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' },
|
||||||
selectInitVal: "{{ power.parent_id }}"
|
selectInitVal: "{{ power.parent_id }}"
|
||||||
});
|
|
||||||
|
|
||||||
form.on("radio(powerType)", function (data) {
|
|
||||||
if (this.value == '0') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#powerCodeItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#powerCode").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
} else if (this.value == '1') {
|
|
||||||
$("#powerUrlItem").show();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#openTypeItem").show();
|
|
||||||
} else if (this.value == '2') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(power-save)', function (data) {
|
|
||||||
data.field.icon = "layui-icon " + data.field.icon;
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/power/update',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
dataType: 'json',
|
|
||||||
contentType: 'application/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));//关闭当前页
|
|
||||||
parent.render();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
iconPicker.render({
|
|
||||||
elem: '#icon',
|
|
||||||
type: 'fontClass',
|
|
||||||
search: true,
|
|
||||||
page: true,
|
|
||||||
limit: 12,
|
|
||||||
click: function (data) {
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
iconPicker.checkIcon("icon", "{{ icon }}");
|
|
||||||
|
|
||||||
window.init = function (type) {
|
|
||||||
if (type == '0') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#powerCodeItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#powerCode").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
} else if (type == '1') {
|
|
||||||
$("#powerUrlItem").show();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#openTypeItem").show();
|
|
||||||
} else if (type == '2') {
|
|
||||||
$("#powerUrlItem").hide();
|
|
||||||
$("#openTypeItem").hide();
|
|
||||||
$("#powerCodeItem").show();
|
|
||||||
$("#powerUrl").val("");
|
|
||||||
$("#openType").val("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.init("{{ power.type}}");
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
form.on('radio(powerType)', function (data) {
|
||||||
|
if (this.value == '0') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#powerCodeItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#powerCode').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
} else if (this.value == '1') {
|
||||||
|
$('#powerUrlItem').show()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#openTypeItem').show()
|
||||||
|
} else if (this.value == '2') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
form.on('submit(power-save)', function (data) {
|
||||||
|
data.field.icon = 'layui-icon ' + data.field.icon
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/power/update',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
dataType: 'json',
|
||||||
|
contentType: 'application/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))//关闭当前页
|
||||||
|
parent.render()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
iconPicker.render({
|
||||||
|
elem: '#icon',
|
||||||
|
type: 'fontClass',
|
||||||
|
search: true,
|
||||||
|
page: true,
|
||||||
|
limit: 12,
|
||||||
|
click: function (data) {
|
||||||
|
console.log(data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
iconPicker.checkIcon('icon', "{{ icon }}")
|
||||||
|
|
||||||
|
window.init = function (type) {
|
||||||
|
if (type == '0') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#powerCodeItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#powerCode').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
} else if (type == '1') {
|
||||||
|
$('#powerUrlItem').show()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#openTypeItem').show()
|
||||||
|
} else if (type == '2') {
|
||||||
|
$('#powerUrlItem').hide()
|
||||||
|
$('#openTypeItem').hide()
|
||||||
|
$('#powerCodeItem').show()
|
||||||
|
$('#powerUrl').val('')
|
||||||
|
$('#openType').val('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.init("{{ power.type}}")
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -33,27 +33,29 @@
|
|||||||
|
|
||||||
<script type="text/html" id="power-toolbar">
|
<script type="text/html" id="power-toolbar">
|
||||||
{% if authorize("admin:power:add") %}
|
{% if authorize("admin:power:add") %}
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||||
<i class="layui-icon layui-icon-add-1"></i>
|
<i class="layui-icon layui-icon-add-1"></i>
|
||||||
新增
|
新增
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:role:remove") %}
|
{% if authorize("admin:role:remove") %}
|
||||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||||
<i class="layui-icon layui-icon-delete"></i>
|
<i class="layui-icon layui-icon-delete"></i>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="power-bar">
|
<script type="text/html" id="power-bar">
|
||||||
{% if authorize("admin:role:edit") %}
|
{% 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 class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||||
</button>
|
class="layui-icon layui-icon-edit"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:role:remove") %}
|
{% 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 class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||||
</button>
|
class="layui-icon layui-icon-delete"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -67,12 +69,13 @@
|
|||||||
<span>按钮</span>
|
<span>按钮</span>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
|
|
||||||
" |safe}}
|
" |safe }}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="power-enable">
|
<script type="text/html" id="power-enable">
|
||||||
<input type="checkbox" name="enable" value="{{ "{{d.powerId}}" }}" lay-skin="switch" lay-text="启用|禁用" lay-filter="power-enable" {{"{{# if(d.enable==1){ }} checked {{# } }}"}}>
|
<input type="checkbox" name="enable" value="{{ "{{d.powerId}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||||
|
lay-filter="power-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="icon">
|
<script type="text/html" id="icon">
|
||||||
@@ -82,202 +85,201 @@
|
|||||||
</body>
|
</body>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery', 'treetable','popup'], function () {
|
layui.use(['table', 'form', 'jquery', 'treetable', 'popup'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let treetable = layui.treetable;
|
let treetable = layui.treetable
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
let MODULE_PATH = "/admin/power/";
|
let MODULE_PATH = '/admin/power/'
|
||||||
|
|
||||||
window.render = function () {
|
window.render = function () {
|
||||||
treetable.render({
|
treetable.render({
|
||||||
treeColIndex: 1,
|
treeColIndex: 1,
|
||||||
treeSpid: 0,
|
treeSpid: 0,
|
||||||
treeIdName: 'powerId',
|
treeIdName: 'powerId',
|
||||||
treePidName: 'parentId',
|
treePidName: 'parentId',
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
treeDefaultClose: true,
|
treeDefaultClose: true,
|
||||||
toolbar: '#power-toolbar',
|
toolbar: '#power-toolbar',
|
||||||
elem: '#power-table',
|
elem: '#power-table',
|
||||||
url: '/admin/power/data',
|
url: '/admin/power/data',
|
||||||
page: false,
|
page: false,
|
||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{% if authorize("admin:role:remove") %}
|
{% if authorize("admin:role:remove") %}
|
||||||
{type: 'checkbox'},
|
{ type: 'checkbox' },
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{field: 'powerName', minWidth: 200, title: '权限名称'},
|
{ field: 'powerName', minWidth: 200, title: '权限名称' },
|
||||||
{field: 'icon', title: '图标', templet: '#icon'},
|
{ field: 'icon', title: '图标', templet: '#icon' },
|
||||||
{field: 'powerType', title: '权限类型', templet: '#power-type'},
|
{ field: 'powerType', title: '权限类型', templet: '#power-type' },
|
||||||
{field: 'enable', title: '是否可用', templet: '#power-enable'},
|
{ field: 'enable', title: '是否可用', templet: '#power-enable' },
|
||||||
{field: 'sort', title: '排序'},
|
{ field: 'sort', title: '排序' },
|
||||||
{title: '操作', templet: '#power-bar', width: 150, align: 'center'}
|
{ title: '操作', templet: '#power-bar', width: 150, align: 'center' }
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
render()
|
||||||
|
|
||||||
|
form.on('submit(power-query)', function (data) {
|
||||||
|
var keyword = data.field.powerName
|
||||||
|
var $tds = $('#power-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++
|
||||||
}
|
}
|
||||||
|
})
|
||||||
render();
|
if (searchCount === 0) {
|
||||||
|
layer.msg('没有匹配结果', { icon: 5 })
|
||||||
form.on('submit(power-query)', function (data) {
|
} else {
|
||||||
var keyword = data.field.powerName;
|
treetable.expandAll('#power-table')
|
||||||
var $tds = $('#power-table').next('.treeTable').find('.layui-table-body tbody tr td');
|
}
|
||||||
if (!keyword) {
|
return false
|
||||||
$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('#power-table');
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on('tool(power-table)', function (obj) {
|
|
||||||
if (obj.event === 'remove') {
|
|
||||||
window.remove(obj);
|
|
||||||
} else if (obj.event === 'edit') {
|
|
||||||
window.edit(obj);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
table.on('toolbar(power-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('switch(power-enable)', function (obj) {
|
|
||||||
let operate;
|
|
||||||
if (obj.elem.checked) {
|
|
||||||
operate = "enable";
|
|
||||||
} else {
|
|
||||||
operate = "disable";
|
|
||||||
}
|
|
||||||
let loading = layer.load();
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/power/' + operate,
|
|
||||||
data: JSON.stringify({powerId: 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/' + obj.data['powerId']
|
|
||||||
});
|
|
||||||
}
|
|
||||||
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['powerId'],
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'delete',
|
|
||||||
success: function (result) {
|
|
||||||
layer.close(loading);
|
|
||||||
if (result.success) {
|
|
||||||
popup.success(result.msg,function(){
|
|
||||||
console.log(obj);
|
|
||||||
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('power-table')
|
|
||||||
var hasCheckData = hasCheck.data
|
|
||||||
if (hasCheckData.length > 0) {
|
|
||||||
$.each(hasCheckData, function (index, element) {
|
|
||||||
ids.push(element.id)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
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 () {
|
|
||||||
console.log(obj);
|
|
||||||
obj.del();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
popup.failure(result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
table.on('tool(power-table)', function (obj) {
|
||||||
|
if (obj.event === 'remove') {
|
||||||
|
window.remove(obj)
|
||||||
|
} else if (obj.event === 'edit') {
|
||||||
|
window.edit(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
table.on('toolbar(power-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('switch(power-enable)', function (obj) {
|
||||||
|
let operate
|
||||||
|
if (obj.elem.checked) {
|
||||||
|
operate = 'enable'
|
||||||
|
} else {
|
||||||
|
operate = 'disable'
|
||||||
|
}
|
||||||
|
let loading = layer.load()
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/power/' + operate,
|
||||||
|
data: JSON.stringify({ powerId: 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/' + obj.data['powerId']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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['powerId'],
|
||||||
|
dataType: 'json',
|
||||||
|
type: 'delete',
|
||||||
|
success: function (result) {
|
||||||
|
layer.close(loading)
|
||||||
|
if (result.success) {
|
||||||
|
popup.success(result.msg, function () {
|
||||||
|
console.log(obj)
|
||||||
|
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('power-table')
|
||||||
|
var hasCheckData = hasCheck.data
|
||||||
|
if (hasCheckData.length > 0) {
|
||||||
|
$.each(hasCheckData, function (index, element) {
|
||||||
|
ids.push(element.id)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
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 () {
|
||||||
|
console.log(obj)
|
||||||
|
obj.del()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
popup.failure(result.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -60,31 +60,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(role-save)', function (data) {
|
form.on('submit(role-save)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/role/save',
|
url: '/admin/role/save',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("role-table");
|
parent.layui.table.reload('role-table')
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return false;
|
} else {
|
||||||
});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="layui-form-item layui-hide">
|
<div class="layui-form-item layui-hide">
|
||||||
<label class="layui-form-label">编号</label>
|
<label class="layui-form-label">编号</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{role.id}}" name="roleId" lay-verify="title"
|
<input type="text" value="{{ role.id }}" name="roleId" lay-verify="title"
|
||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,14 +32,17 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">状态</label>
|
<label class="layui-form-label">状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %}value="0" title="开启">
|
<input type="radio" name="enable" {% if role.enable == 0 %}checked {% endif %}value="0"
|
||||||
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %} value="1" title="关闭">
|
title="开启">
|
||||||
|
<input type="radio" name="enable" {% if role.enable == 1 %}checked {% endif %} value="1"
|
||||||
|
title="关闭">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">排序</label>
|
<label class="layui-form-label">排序</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" name="sort" value="{{ role.sort }}" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" name="sort" value="{{ role.sort }}" lay-verify="title" autocomplete="off"
|
||||||
|
placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +50,7 @@
|
|||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea placeholder="请输入内容" name="details"
|
<textarea placeholder="请输入内容" name="details"
|
||||||
class="layui-textarea">{{role.details}}</textarea>
|
class="layui-textarea">{{ role.details }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,31 +72,31 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
|
|
||||||
form.on('submit(role-update)', function (data) {
|
form.on('submit(role-update)', function (data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/role/update',
|
url: '/admin/role/update',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'put',
|
type: 'put',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("role-table");
|
parent.layui.table.reload('role-table')
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
return false;
|
} else {
|
||||||
});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -37,223 +37,227 @@
|
|||||||
|
|
||||||
<script type="text/html" id="role-toolbar">
|
<script type="text/html" id="role-toolbar">
|
||||||
{% if authorize("admin:role:add") %}
|
{% if authorize("admin:role:add") %}
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||||
<i class="layui-icon layui-icon-add-1"></i>
|
<i class="layui-icon layui-icon-add-1"></i>
|
||||||
新增
|
新增
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:role:remove") %}
|
{% if authorize("admin:role:remove") %}
|
||||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||||
<i class="layui-icon layui-icon-delete"></i>
|
<i class="layui-icon layui-icon-delete"></i>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="role-bar">
|
<script type="text/html" id="role-bar">
|
||||||
{% if authorize("admin:role:edit") %}
|
{% 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 class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
|
||||||
</button>
|
class="layui-icon layui-icon-edit"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:role:power") %}
|
{% 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 class="pear-btn pear-btn-warming pear-btn-sm" lay-event="power"><i
|
||||||
</button>
|
class="layui-icon layui-icon-vercode"></i>
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:role:remove") %}
|
{% 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 class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||||
</button>
|
class="layui-icon layui-icon-delete"></i>
|
||||||
{% endif %}
|
</button>
|
||||||
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="role-enable">
|
<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 {{# } }}"}}>
|
<input type="checkbox" name="enable" value="{{ "{{d.id}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||||
|
lay-filter="role-enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||||
</script>
|
</script>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'form', 'jquery','popup','common'], function () {
|
layui.use(['table', 'form', 'jquery', 'popup', 'common'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
let MODULE_PATH = "/admin/role/";
|
let MODULE_PATH = '/admin/role/'
|
||||||
|
|
||||||
let cols = [
|
let cols = [
|
||||||
[
|
[
|
||||||
{% if authorize("admin:role:remove") %}
|
{% if authorize("admin:role:remove") %}
|
||||||
{type: 'checkbox'},
|
{ type: 'checkbox' },
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{title: '角色名', field: 'roleName', align: 'center', width: 100},
|
{ title: '角色名', field: 'roleName', align: 'center', width: 100 },
|
||||||
{title: 'Key值', field: 'roleCode', align: 'center'},
|
{ title: 'Key值', field: 'roleCode', align: 'center' },
|
||||||
{title: '描述', field: 'details', align: 'center'},
|
{ title: '描述', field: 'details', align: 'center' },
|
||||||
{title: '是否可用', field: 'enable', align: 'center', templet: '#role-enable'},
|
{ title: '是否可用', field: 'enable', align: 'center', templet: '#role-enable' },
|
||||||
{title: '排序', field: 'sort', align: 'center'},
|
{ title: '排序', field: 'sort', align: 'center' },
|
||||||
{title: '操作', toolbar: '#role-bar', align: 'center', width: 195}
|
{ title: '操作', toolbar: '#role-bar', align: 'center', width: 195 }
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
table.render({
|
table.render({
|
||||||
elem: '#role-table',
|
elem: '#role-table',
|
||||||
url: MODULE_PATH + 'data',
|
url: MODULE_PATH + 'data',
|
||||||
page: true,
|
page: true,
|
||||||
cols: cols,
|
cols: cols,
|
||||||
skin: 'line',
|
skin: 'line',
|
||||||
toolbar: '#role-toolbar',
|
toolbar: '#role-toolbar',
|
||||||
defaultToolbar: [{
|
defaultToolbar: [{
|
||||||
layEvent: 'refresh',
|
layEvent: 'refresh',
|
||||||
icon: 'layui-icon-refresh',
|
icon: 'layui-icon-refresh',
|
||||||
}, 'filter', 'print', 'exports']
|
}, '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');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -27,53 +27,53 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['dtree', 'form', 'jquery'], function () {
|
layui.use(['dtree', 'form', 'jquery'], function () {
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
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;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
<label class="layui-form-label">角色</label>
|
<label class="layui-form-label">角色</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
|
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
<input
|
<input
|
||||||
value="{{role.id}}" title="{{role.name}}" type="checkbox"
|
value="{{ role.id }}" title="{{ role.name }}" type="checkbox"
|
||||||
name="roleIds" lay-skin="primary">
|
name="roleIds" lay-skin="primary">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -61,37 +61,37 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery'], function () {
|
layui.use(['form', 'jquery'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
form.on('submit(user-save)', function (data) {
|
form.on('submit(user-save)', function (data) {
|
||||||
let roleIds = "";
|
let roleIds = ''
|
||||||
$('input[type=checkbox]:checked').each(function () {
|
$('input[type=checkbox]:checked').each(function () {
|
||||||
roleIds += $(this).val() + ",";
|
roleIds += $(this).val() + ','
|
||||||
});
|
})
|
||||||
roleIds = roleIds.substr(0, roleIds.length - 1);
|
roleIds = roleIds.substr(0, roleIds.length - 1)
|
||||||
data.field.roleIds = roleIds;
|
data.field.roleIds = roleIds
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/user/save',
|
url: '/admin/user/save',
|
||||||
data: JSON.stringify(data.field),
|
data: JSON.stringify(data.field),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
layer.msg(result.msg, {icon: 1, time: 1000}, function () {
|
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
|
||||||
parent.layui.table.reload("user-table");
|
parent.layui.table.reload('user-table')
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,15 +4,17 @@
|
|||||||
<title>个人中心</title>
|
<title>个人中心</title>
|
||||||
{% include 'admin/common/header.html' %}
|
{% include 'admin/common/header.html' %}
|
||||||
<style>
|
<style>
|
||||||
.layui-form-item{
|
.layui-form-item {
|
||||||
margin-top: 17px!important;
|
margin-top: 17px !important;
|
||||||
margin-bottom: 17px!important;
|
margin-bottom: 17px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
<div class="layui-row layui-col-space10">
|
<div class="layui-row layui-col-space10">
|
||||||
|
{# 左侧栏 #}
|
||||||
<div class="layui-col-md3">
|
<div class="layui-col-md3">
|
||||||
|
{# 个人信息卡片 #}
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body" style="padding: 25px;">
|
<div class="layui-card-body" style="padding: 25px;">
|
||||||
<div class="text-center layui-text">
|
<div class="text-center layui-text">
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
<span>{{ user_info.remark }}</span>
|
<span>{{ user_info.remark }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{# 登录信息卡片 #}
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header">
|
<div class="layui-card-header">
|
||||||
登录记录
|
登录记录
|
||||||
@@ -34,13 +37,18 @@
|
|||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
{% for log in user_logs %}
|
{% for log in user_logs %}
|
||||||
<li class="list-item"><span class="title" >{{ log.url }}</span><span class="footer">{{ log.create_time }}</span></li>
|
<li class="list-item">
|
||||||
|
<span class="title">{{ log.url }}</span>
|
||||||
|
<span class="footer">{{ log.create_time }}</span>
|
||||||
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{# 右侧栏 #}
|
||||||
<div class="layui-col-md9">
|
<div class="layui-col-md9">
|
||||||
|
{# 个人信息卡片 #}
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header">个人信息</div>
|
<div class="layui-card-header">个人信息</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
@@ -51,27 +59,32 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">账号</label>
|
<label class="layui-form-label">账号</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input value="{{user_info.username}}" type="text" readonly name="username" lay-verify="title"
|
<input value="{{ user_info.username }}" type="text" readonly name="username"
|
||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
lay-verify="title"
|
||||||
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">姓名</label>
|
<label class="layui-form-label">姓名</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input value="{{user_info.realname}}" type="text" name="realName" lay-verify="title"
|
<input value="{{ user_info.realname }}" type="text" name="realName"
|
||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
lay-verify="title"
|
||||||
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item layui-form-text">
|
<div class="layui-form-item layui-form-text">
|
||||||
<label class="layui-form-label">描述</label>
|
<label class="layui-form-label">描述</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<textarea placeholder="请输入描述" name="details" class="layui-textarea">{{user_info.remark}}</textarea>
|
<textarea placeholder="请输入描述" name="details"
|
||||||
|
class="layui-textarea">{{ user_info.remark }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-submit lay-filter="user-update">修改资料</button>
|
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-submit
|
||||||
|
lay-filter="user-update">修改资料
|
||||||
|
</button>
|
||||||
<button class="pear-btn pear-btn-sm edit-password">更改密码</button>
|
<button class="pear-btn pear-btn-sm edit-password">更改密码</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,6 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{# 个人文章记录 #}
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header">
|
<div class="layui-card-header">
|
||||||
我的文章
|
我的文章
|
||||||
@@ -106,7 +120,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
<div class="layui-row layui-col-space10" style="margin: 15px;">
|
||||||
<div class="layui-col-md1">
|
<div class="layui-col-md1">
|
||||||
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}" style="width: 100%;height: 100%;border-radius: 5px;"/>
|
<img src="{{ url_for('static', filename='admin/admin/images/act.jpg') }}"
|
||||||
|
style="width: 100%;height: 100%;border-radius: 5px;"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-md11" style="height: 80px;">
|
<div class="layui-col-md11" style="height: 80px;">
|
||||||
<div class="title">为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?</div>
|
<div class="title">为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?</div>
|
||||||
@@ -156,56 +171,57 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script >
|
<script>
|
||||||
layui.use(['element', 'jquery', 'layer','form'], function () {
|
layui.use(['element', 'jquery', 'layer', 'form'], function () {
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let layer = layui.layer;
|
let layer = layui.layer
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
|
// 修改密码页面
|
||||||
$(".edit-password").click(function () {
|
$('.edit-password').click(function () {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: '修改密码',
|
title: '修改密码',
|
||||||
shade: 0.1,
|
shade: 0.1,
|
||||||
area: ['550px', '280px'],
|
area: ['550px', '280px'],
|
||||||
content: '/admin/user/editPassword'
|
content: '/admin/user/editPassword'
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$("#avatar").click(function () {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title: '更换图片',
|
|
||||||
shade: 0.1,
|
|
||||||
area: ["900px", "500px"],
|
|
||||||
content: '/admin/user/profile',
|
|
||||||
btn: ['确定', '取消'],
|
|
||||||
yes: function (index, layero) {
|
|
||||||
window['layui-layer-iframe' + index].submitForm();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
form.on('submit(user-update)', function (data) {
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/user/updateInfo',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
dataType: 'json',
|
|
||||||
contentType: 'application/json',
|
|
||||||
type: 'put',
|
|
||||||
success: function (result) {
|
|
||||||
if (result.success) {
|
|
||||||
layer.msg("修改成功", {icon: 1, time: 1000});
|
|
||||||
} else {
|
|
||||||
layer.msg("修改失败", {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 修改头像
|
||||||
|
$('#avatar').click(function () {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '更换图片',
|
||||||
|
shade: 0.1,
|
||||||
|
area: ['900px', '500px'],
|
||||||
|
content: '/admin/user/profile',
|
||||||
|
btn: ['确定', '取消'],
|
||||||
|
yes: function (index, layero) {
|
||||||
|
window['layui-layer-iframe' + index].submitForm()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 表单提交更改个人信息数据
|
||||||
|
form.on('submit(user-update)', function (data) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/user/updateInfo',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
dataType: 'json',
|
||||||
|
contentType: 'application/json',
|
||||||
|
type: 'put',
|
||||||
|
success: function (result) {
|
||||||
|
if (result.success) {
|
||||||
|
layer.msg('修改成功', { icon: 1, time: 1000 })
|
||||||
|
} else {
|
||||||
|
layer.msg('修改失败', { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -24,14 +24,15 @@
|
|||||||
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
autocomplete="off" placeholder="请输入标题" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">姓名</label>
|
<label class="layui-form-label">姓名</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="text" value="{{ user.realname }}" name="realName" lay-verify="title" autocomplete="off" placeholder="请输入标题"
|
<input type="text" value="{{ user.realname }}" name="realName" lay-verify="title"
|
||||||
|
autocomplete="off" placeholder="请输入标题"
|
||||||
class="layui-input">
|
class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">部门</label>
|
<label class="layui-form-label">部门</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<ul id="selectParent" name="deptId" class="dtree" data-id="0"></ul>
|
<ul id="selectParent" name="deptId" class="dtree" data-id="0"></ul>
|
||||||
@@ -43,11 +44,11 @@
|
|||||||
<label class="layui-form-label">角色</label>
|
<label class="layui-form-label">角色</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
<input{% if role.id in checked_roles %}
|
<input{% if role.id in checked_roles %}
|
||||||
checked
|
checked
|
||||||
{% endif %}
|
{% endif %}
|
||||||
value="{{role.id}}" title="{{role.name}}" type="checkbox"
|
value="{{ role.id }}" title="{{ role.name }}" type="checkbox"
|
||||||
name="roleIds" lay-skin="primary">
|
name="roleIds" lay-skin="primary">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,48 +71,48 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery','dtree'], function () {
|
layui.use(['form', 'jquery', 'dtree'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
|
|
||||||
dtree.renderSelect({
|
dtree.renderSelect({
|
||||||
elem: "#selectParent",
|
elem: '#selectParent',
|
||||||
url: "/admin/dept/tree",
|
url: '/admin/dept/tree',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
selectInputName: {nodeId: "deptId", context: "deptName"},
|
selectInputName: { nodeId: 'deptId', context: 'deptName' },
|
||||||
skin: "layui",
|
skin: 'layui',
|
||||||
dataFormat: "list",
|
dataFormat: 'list',
|
||||||
response: {treeId: "deptId", parentId: "parentId", title: "deptName"},
|
response: { treeId: 'deptId', parentId: 'parentId', title: 'deptName' },
|
||||||
selectInitVal: "{{ user.dept_id }}"
|
selectInitVal: "{{ user.dept_id }}"
|
||||||
});
|
|
||||||
form.on('submit(user-update)', function (data) {
|
|
||||||
let roleIds = "";
|
|
||||||
$('input[type=checkbox]:checked').each(function () {
|
|
||||||
roleIds += $(this).val() + ",";
|
|
||||||
});
|
|
||||||
roleIds = roleIds.substr(0, roleIds.length - 1);
|
|
||||||
data.field.roleIds = roleIds;
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/user/update',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
dataType: 'json',
|
|
||||||
contentType: 'application/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));//关闭当前页
|
|
||||||
parent.layui.table.reload("user-table");
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
form.on('submit(user-update)', function (data) {
|
||||||
|
let roleIds = ''
|
||||||
|
$('input[type=checkbox]:checked').each(function () {
|
||||||
|
roleIds += $(this).val() + ','
|
||||||
|
})
|
||||||
|
roleIds = roleIds.substr(0, roleIds.length - 1)
|
||||||
|
data.field.roleIds = roleIds
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/user/update',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
dataType: 'json',
|
||||||
|
contentType: 'application/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))//关闭当前页
|
||||||
|
parent.layui.table.reload('user-table')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
layer.msg(result.msg, { icon: 2, time: 1000 })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="edit-password">
|
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||||
|
lay-filter="edit-password">
|
||||||
<i class="layui-icon layui-icon-ok"></i>
|
<i class="layui-icon layui-icon-ok"></i>
|
||||||
提交
|
提交
|
||||||
</button>
|
</button>
|
||||||
@@ -48,32 +49,33 @@
|
|||||||
</form>
|
</form>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['form', 'jquery','popup'], function () {
|
layui.use(['form', 'jquery', 'popup'], function () {
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
form.on('submit(edit-password)', function (data) {
|
|
||||||
$.ajax({
|
|
||||||
url: '/admin/user/editPassword',
|
|
||||||
data: JSON.stringify(data.field),
|
|
||||||
contentType: 'application/json',
|
|
||||||
dataType: 'json',
|
|
||||||
type: 'put',
|
|
||||||
success: function (result) {
|
|
||||||
if (result.success) {
|
|
||||||
popup.success(result.msg,function(){
|
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
popup.failure(result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// 修改密码提交
|
||||||
|
form.on('submit(edit-password)', function (data) {
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/user/editPassword',
|
||||||
|
data: JSON.stringify(data.field),
|
||||||
|
contentType: 'application/json',
|
||||||
|
dataType: 'json',
|
||||||
|
type: 'put',
|
||||||
|
success: function (result) {
|
||||||
|
if (result.success) {
|
||||||
|
popup.success(result.msg, function () {
|
||||||
|
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
popup.failure(result.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>用户管理</title>
|
<title>用户管理</title>
|
||||||
{% include 'admin/common/header.html' %}
|
{% include 'admin/common/header.html' %}
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/user.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/user.css') }}"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
|
{# 查询表单 #}
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<form class="layui-form" action="" lay-filter="user-query-form">
|
<form class="layui-form" action="" lay-filter="user-query-form">
|
||||||
@@ -30,38 +31,39 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-left user-collasped">
|
<div class="user-left user-collasped">
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<div class="button button-primary user-group" user-group=""> 全 部 用 户 </div>
|
<div class="button button-primary user-group" user-group=""> 全 部 用 户</div>
|
||||||
<div class="button button-default user-group" user-group="-1"> 默 认 分 组 </div>
|
<div class="button button-default user-group" user-group="-1"> 默 认 分 组</div>
|
||||||
<div style="overflow: auto">
|
<div style="overflow: auto">
|
||||||
<ul id="dept-tree" class="dept-tree" data-id="0"></ul>
|
<ul id="dept-tree" class="dept-tree" data-id="0"></ul>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-main user-collasped">
|
</div>
|
||||||
<div class="layui-card">
|
{# 用户表格 #}
|
||||||
<div class="layui-card-body">
|
<div class="user-main user-collasped">
|
||||||
<table id="user-table" lay-filter="user-table"></table>
|
<div class="layui-card">
|
||||||
</div>
|
<div class="layui-card-body">
|
||||||
|
<table id="user-table" lay-filter="user-table"></table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
{# 表格操作 #}
|
||||||
<script type="text/html" id="user-toolbar">
|
<script type="text/html" id="user-toolbar">
|
||||||
{% if authorize("admin:user:add") %}
|
{% if authorize("admin:user:add") %}
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||||
<i class="pear-icon pear-icon-add"></i>
|
<i class="pear-icon pear-icon-add"></i>
|
||||||
新增
|
新增
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:user:remove") %}
|
{% if authorize("admin:user:remove") %}
|
||||||
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
<button class="pear-btn pear-btn-md" lay-event="batchRemove">
|
||||||
<i class="pear-icon pear-icon-ashbin"></i>
|
<i class="pear-icon pear-icon-ashbin"></i>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button class="pear-btn pear-btn-md" lay-event="collasped">
|
<button class="pear-btn pear-btn-md" lay-event="collasped">
|
||||||
<i class="pear-icon pear-icon-modular"></i>
|
<i class="pear-icon pear-icon-modular"></i>
|
||||||
@@ -69,247 +71,257 @@
|
|||||||
</button>
|
</button>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{# 用户修改操作 #}
|
||||||
<script type="text/html" id="user-bar">
|
<script type="text/html" id="user-bar">
|
||||||
{% if authorize("admin:user:edit") %}
|
{% 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 class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="pear-icon pear-icon-edit"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if authorize("admin:user:remove") %}
|
{% 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 class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
|
||||||
</button>
|
class="pear-icon pear-icon-ashbin"></i>
|
||||||
{% endif %}
|
</button>
|
||||||
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{# 启动与禁用 #}
|
||||||
<script type="text/html" id="user-enable">
|
<script type="text/html" id="user-enable">
|
||||||
<input type="checkbox" name="enable" value="{{"{{ d.id }}"}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="user-enable"
|
<input type="checkbox" name="enable" value="{{ "{{ d.id }}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||||
{{"{{# if(d.enable==1){ }} checked {{# } }}"}} />
|
lay-filter="user-enable"
|
||||||
|
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }} />
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{# 用户注册时间 #}
|
||||||
<script type="text/html" id="user-createTime">
|
<script type="text/html" id="user-createTime">
|
||||||
{{' {{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}' |safe}}}
|
{{ ' {{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{# 用户更新时间 #}
|
||||||
<script type="text/html" id="user-updateTime">
|
<script type="text/html" id="user-updateTime">
|
||||||
{{' {{layui.util.toDateString(d.update_at, "yyyy-MM-dd HH:mm:ss")}' |safe}}}
|
{{ ' {{layui.util.toDateString(d.update_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
layui.use(['table', 'dtree','form', 'jquery','popup','common'], function () {
|
layui.use(['table', 'dtree', 'form', 'jquery', 'popup', 'common'], function () {
|
||||||
let table = layui.table;
|
let table = layui.table
|
||||||
let form = layui.form;
|
let form = layui.form
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let dtree = layui.dtree;
|
let dtree = layui.dtree
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
let common = layui.common;
|
let common = layui.common
|
||||||
let MODULE_PATH = "/admin/user/";
|
let MODULE_PATH = '/admin/user/'
|
||||||
|
|
||||||
let cols = [
|
// 表格数据
|
||||||
[
|
let cols = [
|
||||||
{% if authorize("admin:user:remove") %}
|
[
|
||||||
{type: 'checkbox'},
|
{% if authorize("admin:user:remove") %}
|
||||||
{% endif %}
|
{ type: 'checkbox' },
|
||||||
{title: '姓名', field: 'realname', align: 'center', width: 110},
|
{% endif %}
|
||||||
{title: '账号', field: 'username', align: 'center'},
|
{ title: '姓名', field: 'realname', align: 'center', width: 110 },
|
||||||
{title: '部门', field: 'dept', align: 'center'},
|
{ title: '账号', field: 'username', align: 'center' },
|
||||||
{title: '启用', field: 'enable', align: 'center', templet: '#user-enable',width: 120},
|
{ title: '部门', field: 'dept', align: 'center' },
|
||||||
{title: '注册时间', field: 'create_at', templet: '#user-createTime', align: 'center'},
|
{ title: '启用', field: 'enable', align: 'center', templet: '#user-enable', width: 120 },
|
||||||
{title: '更新时间', field: 'update_at', templet: '#user-updateTime', align: 'center'},
|
{ title: '注册时间', field: 'create_at', templet: '#user-createTime', align: 'center' },
|
||||||
{title: '操作', toolbar: '#user-bar', align: 'center', width: 130}
|
{ title: '更新时间', field: 'update_at', templet: '#user-updateTime', align: 'center' },
|
||||||
]
|
{ title: '操作', toolbar: '#user-bar', align: 'center', width: 130 }
|
||||||
];
|
]
|
||||||
|
]
|
||||||
|
|
||||||
table.render({
|
// 渲染表格数据
|
||||||
elem: '#user-table',
|
table.render({
|
||||||
url: MODULE_PATH + 'data',
|
elem: '#user-table',
|
||||||
page: true,
|
url: MODULE_PATH + 'data',
|
||||||
cols: cols,
|
page: true,
|
||||||
skin: 'line',
|
cols: cols,
|
||||||
height: 'full-148',
|
skin: 'line',
|
||||||
toolbar: '#user-toolbar',
|
height: 'full-148',
|
||||||
text: {none: '暂无人员信息'},
|
toolbar: '#user-toolbar', /*工具栏*/
|
||||||
defaultToolbar: [{layEvent: 'refresh', icon: 'layui-icon-refresh'}, 'filter', 'print', 'exports']
|
text: { none: '暂无人员信息' },
|
||||||
});
|
defaultToolbar: [{ layEvent: 'refresh', icon: 'layui-icon-refresh' }, 'filter', 'print', 'exports'] /*默认工具栏*/
|
||||||
|
|
||||||
|
|
||||||
dtree.render({
|
|
||||||
elem: "#dept-tree",
|
|
||||||
method: "get",
|
|
||||||
url: "/admin/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('role-table');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
popup.failure(result.msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
window.refresh = function (param) {
|
|
||||||
table.reload('user-table', {where: param});
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 公司部门树状图菜单
|
||||||
|
dtree.render({
|
||||||
|
elem: '#dept-tree',
|
||||||
|
method: 'get',
|
||||||
|
url: '/admin/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('role-table')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
popup.failure(result.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
window.refresh = function (param) {
|
||||||
|
table.reload('user-table', { where: param })
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
@@ -12,17 +12,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs3" style="padding-left:0px;">
|
<div class="layui-col-xs3" style="padding-left:0px;">
|
||||||
<div id="previewImage" style="width:210px;height:210px;border: 1px solid rgb(200, 200, 200);border-radius: 50%;overflow:hidden;">
|
<div id="previewImage"
|
||||||
|
style="width:210px;height:210px;border: 1px solid rgb(200, 200, 200);border-radius: 50%;overflow:hidden;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-row">
|
<div class="layui-row">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-inline layui-btn-container" style="width: auto;vertical-align:top;">
|
<div class="layui-input-inline layui-btn-container" style="width: auto;vertical-align:top;">
|
||||||
<button class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-left" cropper-event="rotate" data-option="-15" title="左旋15°"></button>
|
<button class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-left" cropper-event="rotate"
|
||||||
<button class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-right" cropper-event="rotate" data-option="15" title="右旋15°"></button>
|
data-option="-15" title="左旋15°"></button>
|
||||||
<button class="pear-btn pear-btn-sm pear-btn-danger layui-icon layui-icon-refresh" cropper-event="reset" title="重置"></button>
|
<button class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-right" cropper-event="rotate"
|
||||||
<label for="uploadPicture" class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-upload" title="选择图片"></label>
|
data-option="15" title="右旋15°"></button>
|
||||||
|
<button class="pear-btn pear-btn-sm pear-btn-danger layui-icon layui-icon-refresh" cropper-event="reset"
|
||||||
|
title="重置"></button>
|
||||||
|
<label for="uploadPicture" class="pear-btn pear-btn-sm pear-btn-primary layui-icon layui-icon-upload"
|
||||||
|
title="选择图片"></label>
|
||||||
<input class="layui-upload-file" id="uploadPicture" type="file" value="选择图片">
|
<input class="layui-upload-file" id="uploadPicture" type="file" value="选择图片">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux">建议:图片的尺寸宽高比为1:1,大小在5m以内。</div>
|
<div class="layui-form-mid layui-word-aux">建议:图片的尺寸宽高比为1:1,大小在5m以内。</div>
|
||||||
@@ -31,91 +36,91 @@
|
|||||||
</body>
|
</body>
|
||||||
{% include 'admin/common/footer.html' %}
|
{% include 'admin/common/footer.html' %}
|
||||||
<script>
|
<script>
|
||||||
layui.use(['jquery','layer','cropper','popup'], function () {
|
layui.use(['jquery', 'layer', 'cropper', 'popup'], function () {
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery
|
||||||
let layer = layui.layer;
|
let layer = layui.layer
|
||||||
let cropper = layui.cropper;
|
let cropper = layui.cropper
|
||||||
let popup = layui.popup;
|
let popup = layui.popup
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
aspectRatio: 1 / 1, // 裁剪框比例
|
aspectRatio: 1 / 1, // 裁剪框比例
|
||||||
preview: '#previewImage', // 预览div
|
preview: '#previewImage', // 预览div
|
||||||
viewmode: 1
|
viewmode: 1
|
||||||
};
|
}
|
||||||
|
|
||||||
$("#sourceImage").attr("src", parent.layui.$("#avatar").attr("src"));
|
$('#sourceImage').attr('src', parent.layui.$('#avatar').attr('src'))
|
||||||
$("#sourceImage").cropper(options);
|
$('#sourceImage').cropper(options)
|
||||||
|
|
||||||
window.submitForm = function () {
|
window.submitForm = function () {
|
||||||
$("#sourceImage").crossOrigin = 'anonymous';//解决跨域图片问题
|
$('#sourceImage').crossOrigin = 'anonymous'//解决跨域图片问题
|
||||||
$("#sourceImage").cropper("getCroppedCanvas", {
|
$('#sourceImage').cropper('getCroppedCanvas', {
|
||||||
width: 280,
|
width: 280,
|
||||||
height: 140
|
height: 140
|
||||||
}).toBlob(function (blob) {
|
}).toBlob(function (blob) {
|
||||||
let timeStamp = Date.parse(new Date());
|
let timeStamp = Date.parse(new Date())
|
||||||
let fileName = timeStamp + '.jpg';
|
let fileName = timeStamp + '.jpg'
|
||||||
let formData = new FormData();
|
let formData = new FormData()
|
||||||
formData.append('file', blob, fileName);
|
formData.append('file', blob, fileName)
|
||||||
formData.append('fileName', fileName);
|
formData.append('fileName', fileName)
|
||||||
formData.append('fileToken', timeStamp);
|
formData.append('fileToken', timeStamp)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "post",
|
method: 'post',
|
||||||
url: "/admin/file/upload", //用于文件上传的服务器端请求地址
|
url: '/admin/file/upload', //用于文件上传的服务器端请求地址
|
||||||
data: formData,
|
data: formData,
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if(result.success){
|
if (result.success) {
|
||||||
// 修改 avatar 字段
|
// 修改 avatar 字段
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:"put",
|
method: 'put',
|
||||||
url: "/admin/user/updateAvatar",
|
url: '/admin/user/updateAvatar',
|
||||||
data: JSON.stringify({avatar:result.data}),
|
data: JSON.stringify({ avatar: result.data }),
|
||||||
dataType: "json",
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
success:function(resu){
|
success: function (res) {
|
||||||
if(resu.success){
|
if (res.success) {
|
||||||
// 关闭当前弹层
|
// 关闭当前弹层
|
||||||
parent.layui.$("#avatar").attr("src", result.data.src);
|
parent.layui.$('#avatar').attr('src', result.data.src)
|
||||||
top.layui.$("#avatar").attr("src", result.data.src);
|
top.layui.$('#avatar').attr('src', result.data.src)
|
||||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
||||||
}else{
|
} else {
|
||||||
popup.failure("上传失败")
|
popup.failure('上传失败')
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
popup.failure("上传失败")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$(".pear-btn").on('click', function () {
|
|
||||||
let event = $(this).attr("cropper-event");
|
|
||||||
if (event === 'rotate') {
|
|
||||||
let option = $(this).attr('data-option');
|
|
||||||
$("#sourceImage").cropper('rotate', option);
|
|
||||||
} else if (event === 'reset') {
|
|
||||||
$("#sourceImage").cropper('reset');
|
|
||||||
}
|
|
||||||
$("#uploadPicture").change(function () {
|
|
||||||
let r = new FileReader();
|
|
||||||
let f = this.files[0];
|
|
||||||
let uploadFileSize = f.size / 1024;
|
|
||||||
if (uploadFileSize > 5120) {
|
|
||||||
parent.layer.msg("上传文件不得超过5m", { icon: 5 });
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
r.readAsDataURL(f);
|
})
|
||||||
r.onload = function (e) {
|
} else {
|
||||||
$("#sourceImage")
|
popup.failure('上传失败')
|
||||||
.cropper('destroy')
|
}
|
||||||
.attr('src', this.result)
|
}
|
||||||
.cropper(options);
|
})
|
||||||
};
|
})
|
||||||
});
|
}
|
||||||
});
|
|
||||||
});
|
$('.pear-btn').on('click', function () {
|
||||||
|
let event = $(this).attr('cropper-event')
|
||||||
|
if (event === 'rotate') {
|
||||||
|
let option = $(this).attr('data-option')
|
||||||
|
$('#sourceImage').cropper('rotate', option)
|
||||||
|
} else if (event === 'reset') {
|
||||||
|
$('#sourceImage').cropper('reset')
|
||||||
|
}
|
||||||
|
$('#uploadPicture').change(function () {
|
||||||
|
let r = new FileReader()
|
||||||
|
let f = this.files[0]
|
||||||
|
let uploadFileSize = f.size / 1024
|
||||||
|
if (uploadFileSize > 5120) {
|
||||||
|
parent.layer.msg('上传文件不得超过5m', { icon: 5 })
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
r.readAsDataURL(f)
|
||||||
|
r.onload = function (e) {
|
||||||
|
$('#sourceImage')
|
||||||
|
.cropper('destroy')
|
||||||
|
.attr('src', this.result)
|
||||||
|
.cropper(options)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet" />
|
<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='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img src="{{ url_for('static', filename='admin/admin/images/403.svg') }}" alt="">
|
<img src="{{ url_for('static', filename='admin/admin/images/403.svg') }}" alt="">
|
||||||
<div class="content-r">
|
<div class="content-r">
|
||||||
<h1>403</h1>
|
<h1>403</h1>
|
||||||
<p>抱歉,你无权访问该页面</p>
|
<p>抱歉,你无权访问该页面</p>
|
||||||
<button class="pear-btn pear-btn-primary">返回首页</button>
|
<button class="pear-btn pear-btn-primary">返回首页</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet" />
|
<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='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img src="{{ url_for('static', filename='admin/admin/images/404.svg') }}" alt="">
|
<img src="{{ url_for('static', filename='admin/admin/images/404.svg') }}" alt="">
|
||||||
<div class="content-r">
|
<div class="content-r">
|
||||||
<h1>404</h1>
|
<h1>404</h1>
|
||||||
<p>抱歉,你访问的页面不存在或仍在开发中</p>
|
<p>抱歉,你访问的页面不存在或仍在开发中</p>
|
||||||
<button class="pear-btn pear-btn-primary">返回首页</button>
|
<button class="pear-btn pear-btn-primary">返回首页</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
<link href="{{ url_for('static', filename='admin/component/pear/css/pear.css') }}" rel="stylesheet" />
|
<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='admin/admin/css/other/error.css') }}" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
<body>admin/
|
<body>admin/
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img src="{{ url_for('static', filename='admin/admin/images/500.svg') }}" alt="">
|
<img src="{{ url_for('static', filename='admin/admin/images/500.svg') }}" alt="">
|
||||||
<div class="content-r">
|
<div class="content-r">
|
||||||
<h1>500</h1>
|
<h1>500</h1>
|
||||||
<p>抱歉,服务器出错了</p>
|
<p>抱歉,服务器出错了</p>
|
||||||
<button class="pear-btn pear-btn-primary">返回首页</button>
|
<button class="pear-btn pear-btn-primary">返回首页</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,147 +1,161 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>pear-admin-flask</title>
|
<title>pear-admin-flask</title>
|
||||||
<meta name="description" content="pear-admin-flask">
|
<meta name="description" content="pear-admin-flask">
|
||||||
<meta name="keyword" content="pear-admin-flask">
|
<meta name="keyword" content="pear-admin-flask">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/index/layui/css/layui.css') }}" />
|
<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/main.css') }}"/>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='/index/css/load.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='/index/css/load.css') }}"/>
|
||||||
<style>
|
<style>
|
||||||
.layui-nav .layui-this:after{
|
.layui-nav .layui-this:after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.layui-nav .layui-nav-bar{
|
|
||||||
display: none;
|
.layui-nav .layui-nav-bar {
|
||||||
}
|
display: none;
|
||||||
</style>
|
}
|
||||||
</head>
|
</style>
|
||||||
<body>
|
</head>
|
||||||
<!-- header -->
|
<body>
|
||||||
<div class="ew-header">
|
<!-- header -->
|
||||||
<img class="layui-logo" src="{{ url_for('static', filename='/index/images/un28.svg') }}" style="height:50px;padding: 10px;" />
|
<div class="ew-header">
|
||||||
<div class="ew-nav-group">
|
<img class="layui-logo" src="{{ url_for('static', filename='/index/images/un28.svg') }}"
|
||||||
<div class="nav-toggle"><i class="layui-icon layui-icon-more-vertical"></i></div>
|
style="height:50px;padding: 10px;"/>
|
||||||
<ul class="layui-nav" lay-filter="ew-header-nav">
|
<div class="ew-nav-group">
|
||||||
<li class="layui-nav-item">
|
<div class="nav-toggle"><i class="layui-icon layui-icon-more-vertical"></i></div>
|
||||||
<a lay-href="/">首页</a>
|
<ul class="layui-nav" lay-filter="ew-header-nav">
|
||||||
</li>
|
<li class="layui-nav-item">
|
||||||
<li class="layui-nav-item">
|
<a lay-href="/">首页</a>
|
||||||
<a href="/admin" target="_blank">后台</a>
|
</li>
|
||||||
</li>
|
<li class="layui-nav-item">
|
||||||
</ul>
|
<a href="/admin" target="_blank">后台</a>
|
||||||
</div>
|
</li>
|
||||||
</div>
|
</ul>
|
||||||
<!-- banner -->
|
</div>
|
||||||
<div class="ew-banner" style="box-shadow: 0 0 8px rgba(0,0,0,.101562);">
|
</div>
|
||||||
<div class="layui-container">
|
<!-- banner -->
|
||||||
<div class="layui-row layui-col-space25" style="margin-top: 10px;">
|
<div class="ew-banner" style="box-shadow: 0 0 8px rgba(0,0,0,.101562);">
|
||||||
<div class="layui-col-md6 layui-col-xs12">
|
<div class="layui-container">
|
||||||
<img style="margin-top: 0px;margin-bottom: 40px;width: 80%;" src="{{ url_for('static', filename='/index/images/pear.png') }}"></h1>
|
<div class="layui-row layui-col-space25" style="margin-top: 10px;">
|
||||||
<img style="width: 25%;position: absolute;left: 38%;margin-top: 5px;" src="{{ url_for('static', filename='/index/images/admin.png') }}"></h1>
|
<div class="layui-col-md6 layui-col-xs12">
|
||||||
<p style="font-size: 13.8px;font-weight: 500;margin-top: 10px;">💐 致 力 于 让 " Web " 开 发 变 得 简 单 优 雅 </p>
|
<img style="margin-top: 0px;margin-bottom: 40px;width: 80%;"
|
||||||
<div class="ew-banner-btngroup" style="margin-top: 50px;margin-bottom: 50px;">
|
src="{{ url_for('static', filename='/index/images/pear.png') }}"></h1>
|
||||||
<ul class="layui-nav" style="background-color: white;" lay-filter="ew-header-nav">
|
<img style="width: 25%;position: absolute;left: 38%;margin-top: 5px;"
|
||||||
<li class="layui-nav-item">
|
src="{{ url_for('static', filename='/index/images/admin.png') }}"></h1>
|
||||||
<a target="_blank" href="http://pearadmin.com/" class="layui-btn layui-btn-primary" nav-scroll="pricing">
|
<p style="font-size: 13.8px;font-weight: 500;margin-top: 10px;">💐 致 力 于 让 " Web " 开 发 变 得 简 单 优 雅 </p>
|
||||||
<svg data-v-796d512c="" style="width:20px;position: relative;top: 5px;margin-right: 5px;" aria-hidden="true"
|
<div class="ew-banner-btngroup" style="margin-top: 50px;margin-bottom: 50px;">
|
||||||
focusable="false" data-prefix="fad" data-icon="meteor" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"
|
<ul class="layui-nav" style="background-color: white;" lay-filter="ew-header-nav">
|
||||||
class="svg-inline--fa fa-meteor fa-w-16 h-5 -mb-1 mr-1">
|
<li class="layui-nav-item">
|
||||||
<g data-v-796d512c="" class="fa-group">
|
<a target="_blank" href="http://pearadmin.com/" class="layui-btn layui-btn-primary"
|
||||||
<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"
|
nav-scroll="pricing">
|
||||||
opacity="0.4" class="fa-secondary"></path>
|
<svg data-v-796d512c=""
|
||||||
<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"
|
style="width:20px;position: relative;top: 5px;margin-right: 5px;"
|
||||||
class="fa-primary"></path>
|
aria-hidden="true"
|
||||||
</g>
|
focusable="false" data-prefix="fad" data-icon="meteor" role="img"
|
||||||
</svg>
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"
|
||||||
官方网站</a>
|
class="svg-inline--fa fa-meteor fa-w-16 h-5 -mb-1 mr-1">
|
||||||
</li>
|
<g data-v-796d512c="" class="fa-group">
|
||||||
</ul>
|
<path data-v-796d512c="" fill="currentColor"
|
||||||
</div>
|
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"
|
||||||
</div>
|
opacity="0.4" class="fa-secondary"></path>
|
||||||
<div class="layui-col-md6 layui-col-xs12">
|
<path data-v-796d512c="" fill="currentColor"
|
||||||
<div class="ew-banner-right">
|
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"
|
||||||
<img class="show" style="width: 92%;" style="margin-top: 0px!important;" src="{{ url_for('static', filename='/index/images/un26.svg') }}">
|
class="fa-primary"></path>
|
||||||
</div>
|
</g>
|
||||||
</div>
|
</svg>
|
||||||
</div>
|
官方网站</a>
|
||||||
</div>
|
</li>
|
||||||
<br />
|
</ul>
|
||||||
<br />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="layui-col-md6 layui-col-xs12">
|
||||||
</div>
|
<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" nav-id="product">
|
||||||
<div class="section-title" style="font-size: 20px;font-weight:500;">
|
<div class="section-title" style="font-size: 20px;font-weight:500;">
|
||||||
用法演示
|
用法演示
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-container" style="padding-bottom: 60px;">
|
<div class="layui-container" style="padding-bottom: 60px;">
|
||||||
<div class="layui-row layui-col-space30">
|
<div class="layui-row layui-col-space30">
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- contact -->
|
<!-- contact -->
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<h2 style="font-size: 20px;font-weight:500;">合作伙伴</h2>
|
<h2 style="font-size: 20px;font-weight:500;">合作伙伴</h2>
|
||||||
<p>Sponsorship and cooperation</p>
|
<p>Sponsorship and cooperation</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-container">
|
<div class="layui-container">
|
||||||
<div class="layui-row layui-col-space30" style="margin-top: 10px;">
|
<div class="layui-row layui-col-space30" style="margin-top: 10px;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ew-footer">
|
<div class="ew-footer">
|
||||||
<div class="layui-container">
|
<div class="layui-container">
|
||||||
<div class="layui-row layui-col-space30">
|
<div class="layui-row layui-col-space30">
|
||||||
<div class="layui-col-md6">
|
<div class="layui-col-md6">
|
||||||
<h2 style="font-size: 17px;" class="footer-item-title">技术交流</h2>
|
<h2 style="font-size: 17px;" class="footer-item-title">技术交流</h2>
|
||||||
<p class="img-group" style="height: 105px;font-size: 15.5px;">
|
<p class="img-group" style="height: 105px;font-size: 15.5px;">
|
||||||
<img src="{{ url_for('static', filename='/index/images/code2.png') }}" style="border-radius: 2px;height: 100px;width: 100px;">
|
<img src="{{ url_for('static', filename='/index/images/code2.png') }}"
|
||||||
扫码免费加入前后端分离技术交流QQ群,与各位大佬一起交流技术、讨论问题。
|
style="border-radius: 2px;height: 100px;width: 100px;">
|
||||||
</p>
|
扫码免费加入前后端分离技术交流QQ群,与各位大佬一起交流技术、讨论问题。
|
||||||
</div>
|
</p>
|
||||||
<div class="layui-col-md4">
|
</div>
|
||||||
<h2 style="font-size: 17px;" class="footer-item-title">联系我们</h2>
|
<div class="layui-col-md4">
|
||||||
<p>
|
<h2 style="font-size: 17px;" class="footer-item-title">联系我们</h2>
|
||||||
<i class="layui-icon layui-icon-dialogue"></i>
|
<p>
|
||||||
<a href="http://www.pearadmin.com">官网 : www.pearadmin.com</a>
|
<i class="layui-icon layui-icon-dialogue"></i>
|
||||||
</p>
|
<a href="http://www.pearadmin.com">官网 : www.pearadmin.com</a>
|
||||||
<p style="margin-top: 2px;">
|
</p>
|
||||||
<i class="layui-icon layui-icon-website"></i>
|
<p style="margin-top: 2px;">
|
||||||
<a href="http://forum.pearadmin.com">社区 : forum.pearadmin.com</a>
|
<i class="layui-icon layui-icon-website"></i>
|
||||||
</p>
|
<a href="http://forum.pearadmin.com">社区 : forum.pearadmin.com</a>
|
||||||
</div>
|
</p>
|
||||||
<div class="layui-col-md2">
|
</div>
|
||||||
<h2 style="font-size: 17px;" class="footer-item-title">友情链接</h2>
|
<div class="layui-col-md2">
|
||||||
<p><i class="layui-icon layui-icon-website"></i><a href="https://monksoul.gitee.io/furion/" target="_blank">Furion</a></p>
|
<h2 style="font-size: 17px;" class="footer-item-title">友情链接</h2>
|
||||||
<p style="margin-top: 10px;"><i class="layui-icon layui-icon-website"></i><a href="http://mrdoc.zmister.com/" target="_blank">MrDoc</a></p>
|
<p><i class="layui-icon layui-icon-website"></i><a href="https://monksoul.gitee.io/furion/"
|
||||||
</div>
|
target="_blank">Furion</a></p>
|
||||||
</div>
|
<p style="margin-top: 10px;"><i class="layui-icon layui-icon-website"></i><a
|
||||||
</div>
|
href="http://mrdoc.zmister.com/" target="_blank">MrDoc</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- js部分 -->
|
<!-- js部分 -->
|
||||||
<script src="{{ url_for('static', filename='/admin/component/layui/layui.js') }}"></script>
|
<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 src="{{ url_for('static', filename='/admin/component/pear/pear.js') }}"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
layui.use(['layer', 'form', 'jquery'], function() {
|
layui.use(['layer', 'form', 'jquery'], function () {
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery
|
||||||
var layer = layui.layer;
|
var layer = layui.layer
|
||||||
var form = layui.form;
|
var form = layui.form
|
||||||
var jquery = layui.jquery;
|
var jquery = layui.jquery
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
from flask import Flask, redirect
|
|
||||||
|
|
||||||
from applications.view.admin import init_admin_views
|
from applications.view.admin import init_admin_views
|
||||||
from applications.view.index import init_index_views
|
from applications.view.index import init_index_views
|
||||||
|
|
||||||
|
|
||||||
def init_view(app: Flask):
|
def init_view(app):
|
||||||
init_admin_views(app)
|
init_admin_views(app)
|
||||||
init_index_views(app)
|
init_index_views(app)
|
||||||
|
|
||||||
# 重定向到后台管理首页
|
|
||||||
@app.route('/')
|
|
||||||
def redirect_index():
|
|
||||||
return redirect('/admin/login')
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ from flask import Blueprint
|
|||||||
|
|
||||||
index_bp = Blueprint('Index', __name__, url_prefix='/')
|
index_bp = Blueprint('Index', __name__, url_prefix='/')
|
||||||
|
|
||||||
|
from . import index
|
||||||
|
|
||||||
|
|
||||||
def init_index_views(app):
|
def init_index_views(app):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
alembic==1.6.5
|
|
||||||
blinker==1.4
|
|
||||||
captcha==0.3
|
|
||||||
click==8.0.1
|
|
||||||
colorama==0.4.4
|
|
||||||
Flask==2.0.1
|
|
||||||
Flask-DebugToolbar==0.11.0
|
|
||||||
Flask-Login==0.5.0
|
|
||||||
flask-marshmallow==0.14.0
|
|
||||||
Flask-Migrate==3.0.1
|
|
||||||
Flask-Reuploaded==1.1.0
|
|
||||||
Flask-Script==2.0.6
|
|
||||||
Flask-SQLAlchemy==2.5.1
|
|
||||||
greenlet==1.1.0
|
|
||||||
importlib-metadata==4.5.0
|
|
||||||
itsdangerous==2.0.1
|
|
||||||
Jinja2==3.0.1
|
|
||||||
Mako==1.1.4
|
|
||||||
MarkupSafe==2.0.1
|
|
||||||
marshmallow==3.12.1
|
|
||||||
marshmallow-sqlalchemy==0.26.1
|
|
||||||
Pillow==8.2.0
|
|
||||||
psutil==5.8.0
|
|
||||||
PyMySQL==1.0.2
|
|
||||||
python-dateutil==2.8.1
|
|
||||||
python-dotenv==0.17.1
|
|
||||||
python-editor==1.0.4
|
|
||||||
PyYAML==5.4.1
|
|
||||||
six==1.16.0
|
|
||||||
SQLAlchemy==1.4.18
|
|
||||||
sqlparse==0.4.1
|
|
||||||
typing-extensions==3.10.0.0
|
|
||||||
Werkzeug==2.0.1
|
|
||||||
zipp==3.4.1
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
Reference in New Issue
Block a user