refactor(jinja2):修改模板使用继承
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{#页面标题#}
|
||||
{% block title %}
|
||||
<title>Pear Admin Flask</title>
|
||||
{% endblock %}
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
{# 头部导入的 Script,主要为样式 #}
|
||||
{% block header_script %}
|
||||
<link rel="stylesheet" href="/static/admin/component/pear/css/pear.css"/>
|
||||
{% endblock %}
|
||||
</head>
|
||||
{#pear 后台边框#}
|
||||
<body class="pear-container">
|
||||
|
||||
{#页面的主题内容,用于页面进行改写#}
|
||||
{% block body %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{# 当前页面需要依赖的 JavaScript #}
|
||||
{% block footer_script %}
|
||||
<script src="/static/admin/component/layui/layui.js"></script>
|
||||
<script src="/static/admin/component/pear/pear.js"></script>
|
||||
{% endblock %}
|
||||
{# 当前页面自己编写的 JavaScript #}
|
||||
{% block models_script %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,2 +0,0 @@
|
||||
<script src="/static/admin/component/layui/layui.js"></script>
|
||||
<script src="/static/admin/component/pear/pear.js"></script>
|
||||
@@ -1,5 +0,0 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="/static/admin/component/pear/css/pear.css"/>
|
||||
@@ -1,11 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>部门新增</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
{#pear 后台边框#}
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
{#搜索框布局#}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
@@ -36,8 +35,10 @@
|
||||
<table id="tables" lay-filter="tables"></table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block models_script %}
|
||||
{#表格工具栏,需要在表格中绑定,且需要自定义事件#}
|
||||
<script type="text/html" id="toolbar">
|
||||
{% if authorize("admin:dept:edit") %}
|
||||
@@ -73,9 +74,6 @@
|
||||
{{ "{{# if(d.status==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
<script type="module">
|
||||
|
||||
import { DEPARTMENT_API } from '/static/api/http.js'
|
||||
@@ -217,7 +215,6 @@
|
||||
}
|
||||
|
||||
window.tool_edit = function (obj) {
|
||||
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
@@ -252,5 +249,4 @@
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>部门管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -38,7 +39,8 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系方式</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="phone" lay-verify="title" autocomplete="off" placeholder="请输入联系方式(电话号码)"
|
||||
<input type="text" name="phone" lay-verify="title" autocomplete="off"
|
||||
placeholder="请输入联系方式(电话号码)"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +68,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="dept-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="dept-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -77,10 +80,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { DEPARTMENT_API } from '/static/api/http.js'
|
||||
|
||||
@@ -98,7 +100,7 @@
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'deptId', parentId: 'parentId', title: 'deptName' },
|
||||
selectInitVal: '1'
|
||||
selectInitVal: '1',
|
||||
})
|
||||
|
||||
/*添加数据 表单组件,提交按钮之后触发的事件*/
|
||||
@@ -118,11 +120,10 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>部门修改</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -90,10 +91,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { DEPARTMENT_API } from '/static/api/http.js'
|
||||
|
||||
@@ -118,12 +119,11 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>图片上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="tables" lay-filter="tables"></table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="text/html" id="toolbar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="toolbar-add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
@@ -266,5 +265,4 @@
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,14 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<style>
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>新增图片</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
@@ -29,10 +25,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { FILE_API } from '/static/api/http.js'
|
||||
|
||||
@@ -62,5 +58,4 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>日志</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="/static/admin/admin/css/other/console2.css"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>日志</title>
|
||||
<link rel="stylesheet" href="/static/admin/admin/css/other/console2.css"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab layui-tab-card">
|
||||
@@ -25,10 +25,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="text/html" id="log-createTime">
|
||||
{{ ' {{layui.util.toDateString(d.create_at, "yyyy-MM-dd HH:mm:ss")}' |safe }}}
|
||||
</script>
|
||||
@@ -84,4 +83,4 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
@@ -30,10 +31,9 @@
|
||||
<table id="tables" lay-filter="tables"></table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="text/html" id="toolbar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="toolbar-add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
@@ -282,5 +282,4 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>权限</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -72,7 +72,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="power-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="power-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -83,10 +84,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { RIGHTS_API } from '/static/api/http.js'
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' }, //修改response中返回数据的定义
|
||||
selectInitVal: '0'
|
||||
selectInitVal: '0',
|
||||
})
|
||||
|
||||
form.on('radio(powerType)', function () {
|
||||
@@ -145,7 +145,7 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
@@ -164,9 +164,8 @@
|
||||
// 点击回调
|
||||
click: function (data) {
|
||||
console.log(data)
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>权限编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -82,7 +82,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="power-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="power-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -94,9 +95,9 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
|
||||
import { RIGHTS_API } from '/static/api/http.js'
|
||||
@@ -115,7 +116,7 @@
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
response: { treeId: 'powerId', parentId: 'parentId', title: 'powerName' },
|
||||
selectInitVal: "{{ power.parent_id }}"
|
||||
selectInitVal: "{{ power.parent_id }}",
|
||||
})
|
||||
|
||||
form.on('radio(powerType)', function (data) {
|
||||
@@ -160,7 +161,7 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
@@ -173,7 +174,7 @@
|
||||
limit: 12,
|
||||
click: function (data) {
|
||||
console.log(data)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
iconPicker.checkIcon('icon', "{{ icon }}")
|
||||
@@ -202,5 +203,4 @@
|
||||
window.init("{{ power.type }}")
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>角色管理</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form" action="">
|
||||
@@ -33,10 +34,9 @@
|
||||
<table id="tables" lay-filter="tables"></table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
|
||||
{% block models_script %}
|
||||
<script type="text/html" id="toolbar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="toolbar-add">
|
||||
<i class="layui-icon layui-icon-add-1"></i>
|
||||
@@ -251,5 +251,4 @@
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>角色新增</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -45,7 +45,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="role-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="role-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -56,10 +57,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { ROLE_API } from '/static/api/http.js'
|
||||
|
||||
@@ -89,5 +90,4 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>角色编辑</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -70,10 +70,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
|
||||
import { ROLE_API } from '/static/api/http.js'
|
||||
@@ -98,11 +98,10 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>角色授权</title>
|
||||
{% include 'admin/common/header.html' %}</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -14,7 +14,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="power-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="power-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -25,10 +26,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
|
||||
import { ROLE_API } from '/static/api/http.js'
|
||||
@@ -74,12 +75,11 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,16 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>个人中心</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<style>
|
||||
.layui-form-item {
|
||||
margin-top: 17px !important;
|
||||
margin-bottom: 17px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-row layui-col-space10">
|
||||
{# 左侧栏 #}
|
||||
<div class="layui-col-md3">
|
||||
@@ -122,7 +123,8 @@
|
||||
<div class="content">
|
||||
“Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~
|
||||
</div>
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12 转发
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12
|
||||
转发
|
||||
4
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,7 +139,8 @@
|
||||
<div class="content">
|
||||
“Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~
|
||||
</div>
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12 转发
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12
|
||||
转发
|
||||
4
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,7 +155,8 @@
|
||||
<div class="content">
|
||||
“Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~
|
||||
</div>
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12 转发
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12
|
||||
转发
|
||||
4
|
||||
</div>
|
||||
</div>
|
||||
@@ -167,7 +171,8 @@
|
||||
<div class="content">
|
||||
“Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~
|
||||
</div>
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12 转发
|
||||
<div class="comment">2020-06-12 评论 5 点赞 12
|
||||
转发
|
||||
4
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,9 +237,9 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { USER_API } from '/static/api/http.js'
|
||||
|
||||
@@ -251,7 +256,7 @@
|
||||
title: '修改密码',
|
||||
shade: 0.1,
|
||||
area: ['550px', '280px'],
|
||||
content: $('#edit_password_view')
|
||||
content: $('#edit_password_view'),
|
||||
})
|
||||
return false
|
||||
})
|
||||
@@ -267,7 +272,7 @@
|
||||
btn: ['确定', '取消'],
|
||||
yes: function (index, layero) {
|
||||
window['layui-layer-iframe' + index].submitForm()
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
@@ -285,7 +290,7 @@
|
||||
} else {
|
||||
layer.msg('修改失败', { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
@@ -307,11 +312,10 @@
|
||||
} else {
|
||||
popup.failure(result.message)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>头像上传</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-xs9">
|
||||
<div style="height:325px;background-color: rgb(247, 247, 247);">
|
||||
@@ -34,8 +34,10 @@
|
||||
<input type="text" hidden value="{{ current_user.id }}" id="user_id">
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { USER_API } from '/static/api/http.js'
|
||||
|
||||
@@ -48,7 +50,7 @@
|
||||
let options = {
|
||||
aspectRatio: 1 / 1, // 裁剪框比例
|
||||
preview: '#previewImage', // 预览div
|
||||
viewmode: 1
|
||||
viewmode: 1,
|
||||
}
|
||||
|
||||
$('#sourceImage').attr('src', parent.layui.$('#avatar').attr('src'))
|
||||
@@ -58,7 +60,7 @@
|
||||
$('#sourceImage').crossOrigin = 'anonymous'//解决跨域图片问题
|
||||
$('#sourceImage').cropper('getCroppedCanvas', {
|
||||
width: 280,
|
||||
height: 140
|
||||
height: 140,
|
||||
}).toBlob(function (blob) {
|
||||
let timeStamp = Date.parse(new Date())
|
||||
let fileName = timeStamp + '.jpg'
|
||||
@@ -90,12 +92,12 @@
|
||||
} else {
|
||||
popup.failure('上传失败')
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
popup.failure('上传失败')
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -118,14 +120,10 @@
|
||||
}
|
||||
r.readAsDataURL(f)
|
||||
r.onload = function (e) {
|
||||
$('#sourceImage')
|
||||
.cropper('destroy')
|
||||
.attr('src', this.result)
|
||||
.cropper(options)
|
||||
$('#sourceImage').cropper('destroy').attr('src', this.result).cropper(options)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,11 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='/admin/admin/css/other/user.css') }}"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<link rel="stylesheet" href="/static/admin/admin/css/other/user.css"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
{# 查询表单 #}
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
@@ -50,10 +51,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
{# 表格操作 #}
|
||||
<script type="text/html" id="toolbar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="toolbar-add">
|
||||
@@ -312,5 +312,4 @@
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>用户管理</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -48,7 +47,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-save">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="user-save">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -59,7 +59,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include 'admin/common/footer.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { USER_API } from '/static/api/http.js'
|
||||
|
||||
@@ -95,7 +97,4 @@
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -1,11 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% extends 'admin/base.html' %}
|
||||
{% block title %}
|
||||
<title>用户编辑</title>
|
||||
{% include 'admin/common/header.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
@@ -57,7 +56,8 @@
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-update">
|
||||
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
|
||||
lay-filter="user-update">
|
||||
<i class="layui-icon layui-icon-ok"></i>
|
||||
提交
|
||||
</button>
|
||||
@@ -68,10 +68,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% include 'admin/common/footer.html' %}
|
||||
|
||||
{% block models_script %}
|
||||
<script type="module">
|
||||
import { USER_API } from '/static/api/http.js'
|
||||
|
||||
@@ -88,8 +87,9 @@
|
||||
skin: 'layui',
|
||||
dataFormat: 'list',
|
||||
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 () {
|
||||
@@ -112,11 +112,10 @@
|
||||
} else {
|
||||
layer.msg(result.message, { icon: 2, time: 1000 })
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user