From d7d7e554eef7ebe7fbf9b64733924a4da66bf529 Mon Sep 17 00:00:00 2001 From: zhengxinonly Date: Wed, 1 Jun 2022 20:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A7=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/rights/department.py | 42 +- applications/view/department.py | 11 +- applications/view/file.py | 4 +- applications/view/index.py | 14 +- applications/view/logs_view.py | 6 - applications/view/rights.py | 14 +- applications/view/roles.py | 14 +- applications/view/users.py | 29 +- templates/admin/common/header.html | 5 - templates/admin/department/dept.html | 254 -------- templates/admin/logs_temp/main.html | 85 --- templates/admin/rights/rights.html | 282 --------- templates/admin/roles/roles.html | 254 -------- templates/admin/users/profile.html | 316 ---------- templates/admin/users/profile_avatar.html | 127 ---- templates/admin/users/users.html | 315 ---------- templates/view/includes/links.html | 1 + .../includes/scripts.html} | 4 +- templates/view/system/department.html | 120 ++-- .../system/department_add.html} | 14 +- .../system/department_edit.html} | 4 +- templates/view/system/dict.html | 6 +- templates/view/system/log.html | 29 +- templates/view/system/operate.html | 209 ++++--- templates/view/system/person.html | 375 ++++++------ .../{admin/file => view/system}/photo.html | 4 +- .../file => view/system}/photo_add.html | 4 +- templates/view/system/power.html | 459 ++++++++------- .../system/power_add.html} | 6 +- .../system/power_edit.html} | 4 +- templates/view/system/profile.html | 10 +- templates/view/system/role.html | 217 ++++--- .../roles => view/system}/roles_add.html | 4 +- .../roles => view/system}/roles_edit.html | 4 +- .../roles => view/system}/roles_power.html | 4 +- templates/view/system/space.html | 6 +- templates/view/system/theme.html | 553 +++++++++--------- templates/view/system/user.html | 406 ++++++------- .../system/user_add.html} | 4 +- .../system/user_edit.html} | 4 +- 40 files changed, 1311 insertions(+), 2912 deletions(-) delete mode 100644 templates/admin/common/header.html delete mode 100644 templates/admin/department/dept.html delete mode 100644 templates/admin/logs_temp/main.html delete mode 100644 templates/admin/rights/rights.html delete mode 100644 templates/admin/roles/roles.html delete mode 100644 templates/admin/users/profile.html delete mode 100644 templates/admin/users/profile_avatar.html delete mode 100644 templates/admin/users/users.html create mode 100644 templates/view/includes/links.html rename templates/{admin/common/footer.html => view/includes/scripts.html} (76%) rename templates/{admin/department/dept_add.html => view/system/department_add.html} (93%) rename templates/{admin/department/dept_edit.html => view/system/department_edit.html} (98%) rename templates/{admin/file => view/system}/photo.html (98%) rename templates/{admin/file => view/system}/photo_add.html (95%) rename templates/{admin/rights/rights_add.html => view/system/power_add.html} (98%) rename templates/{admin/rights/rights_edit.html => view/system/power_edit.html} (98%) rename templates/{admin/roles => view/system}/roles_add.html (97%) rename templates/{admin/roles => view/system}/roles_edit.html (98%) rename templates/{admin/roles => view/system}/roles_power.html (96%) rename templates/{admin/users/users_add.html => view/system/user_add.html} (97%) rename templates/{admin/users/users_edit.html => view/system/user_edit.html} (97%) diff --git a/applications/rights/department.py b/applications/rights/department.py index 27b25d6..64ca9d7 100644 --- a/applications/rights/department.py +++ b/applications/rights/department.py @@ -1,11 +1,10 @@ import typing as t -from flask import jsonify from flask.views import MethodView from flask_pydantic import validate from pydantic import BaseModel, Field -from common.utils.http import success_api, fail_api +from common.utils.http import success_api, fail_api, table_api from extensions import db from models import DepartmentModel, UserModel @@ -39,26 +38,25 @@ class DepartmentsApi(MethodView): return dict(success=True, message='ok', dept=dept_data) dept_data = DepartmentModel.query.order_by(DepartmentModel.sort).all() - # TODO dtree 需要返回状态信息 - res = { - "status": {"code": 200, "message": "默认"}, - "data": [ - { - 'deptId': item.id, - 'parentId': item.parent_id, - 'deptName': item.dept_name, - 'sort': item.sort, - 'leader': item.leader, - 'phone': item.phone, - 'email': item.email, - 'status': item.status, - 'comment': item.comment, - 'address': item.address, - 'create_at': item.create_at.strftime('%Y-%m-%d %H:%M:%S') - } for item in dept_data - ] - } - return jsonify(res) + return table_api( + result={ + 'items': [ + { + 'deptId': item.id, + 'parentId': item.parent_id, + 'deptName': item.dept_name, + 'sort': item.sort, + 'leader': item.leader, + 'phone': item.phone, + 'email': item.email, + 'status': item.status, + 'comment': item.comment, + 'address': item.address, + 'create_at': item.create_at.strftime('%Y-%m-%d %H:%M:%S') + } for item in dept_data + ], + 'total': len(dept_data)} + , code=0) @validate() def post(self, body: DeptModel): diff --git a/applications/view/department.py b/applications/view/department.py index 13dfca0..4224500 100644 --- a/applications/view/department.py +++ b/applications/view/department.py @@ -5,18 +5,11 @@ from common.utils.rights import permission_required, view_logging_required from applications.view import index_bp -@index_bp.get('/dept') -@view_logging_required -@permission_required("admin:dept:main") -def dept_index(): - return render_template('admin/department/dept.html') - - @index_bp.get('/dept/add') @view_logging_required @permission_required("admin:dept:add") def add(): - return render_template('admin/department/dept_add.html') + return render_template('view/system/department_add.html') @index_bp.get('/dept/edit') @@ -25,4 +18,4 @@ def add(): def edit(): dept_id = request.args.get("deptId", type=int) dept = DepartmentModel.query.get(dept_id) - return render_template('admin/department/dept_edit.html', dept=dept) + return render_template('view/system/department_edit.html', dept=dept) diff --git a/applications/view/file.py b/applications/view/file.py index a84a0eb..5d15041 100644 --- a/applications/view/file.py +++ b/applications/view/file.py @@ -8,11 +8,11 @@ from common.utils.rights import view_logging_required, permission_required @view_logging_required @permission_required("admin:file:main") def file_index(): - return render_template('admin/file/photo.html') + return render_template('view/system/photo.html') @index_bp.get('/file/photo/add') @view_logging_required @permission_required("admin:file:main") def file_photo_add(): - return render_template('admin/file/photo_add.html') + return render_template('view/system/photo_add.html') diff --git a/applications/view/index.py b/applications/view/index.py index 5d44a75..d6f9f2c 100644 --- a/applications/view/index.py +++ b/applications/view/index.py @@ -1,6 +1,7 @@ -from flask import Blueprint +from flask import Blueprint, redirect, url_for from flask import send_file from flask import session, render_template +from flask_login import current_user, logout_user, login_required from common.gen_captcha import get_captcha_image @@ -63,17 +64,16 @@ def get_captcha(): # 退出登录 @index_bp.post('/logout') -# @login_required +@login_required def logout(): - # logout_user() - # session.pop('permissions') + logout_user() + session.pop('permissions') print({"message": "注销成功", "success": True}) return {"message": "注销成功", "success": True} @index_bp.get('/login') def login(): - # if current_user.is_authenticated: - # return redirect(url_for('admin.index')) - # TODO 分离视图操作 最终实现接口登录与视图登录两套逻辑 + if current_user.is_authenticated: + return redirect(url_for('admin.index')) return render_template('login.html') diff --git a/applications/view/logs_view.py b/applications/view/logs_view.py index dabaf01..76aa715 100644 --- a/applications/view/logs_view.py +++ b/applications/view/logs_view.py @@ -8,12 +8,6 @@ from models import LogModel logs_bp = Blueprint('logs', __name__, url_prefix='/logs') -@logs_bp.get('/') -@permission_required("admin:log:main") -def index(): - return render_template('admin/logs_temp/main.html') - - @logs_bp.get('/login_log') @permission_required("admin:log:main") def login_log(): diff --git a/applications/view/rights.py b/applications/view/rights.py index 156dc85..5d9e74f 100644 --- a/applications/view/rights.py +++ b/applications/view/rights.py @@ -5,11 +5,11 @@ from models import RightModel from applications.view import index_bp -@index_bp.get('/rights/') -@view_logging_required -@permission_required("admin:power:main") -def rights_index(): - return render_template('admin/rights/rights.html') +# @index_bp.get('/rights/') +# @view_logging_required +# @permission_required("admin:power:main") +# def rights_index(): +# return render_template('admin/rights/rights.html') @index_bp.get('/rights/power/') @@ -22,11 +22,11 @@ def rights_edit(power_id): icon = icon[1] else: icon = None - return render_template('admin/rights/rights_edit.html', power=power, icon=icon) + return render_template('view/system/power_edit.html', power=power, icon=icon) @index_bp.get('/rights/add') @view_logging_required @permission_required("admin:power:main") def rights_add(): - return render_template('admin/rights/rights_add.html') + return render_template('view/system/power_add.html') diff --git a/applications/view/roles.py b/applications/view/roles.py index 91cf689..7874fdb 100644 --- a/applications/view/roles.py +++ b/applications/view/roles.py @@ -7,20 +7,12 @@ from models import RoleModel role_bp = Blueprint('role', __name__, url_prefix='/admin/role') -# 角色而管理 -@role_bp.get('/') -@view_logging_required -@permission_required("admin:role:main") -def main(): - return render_template('admin/roles/roles.html') - - # 角色授权操作 @role_bp.get('/power/') @view_logging_required @permission_required("admin:role:power") def power(role_id): - return render_template('admin/roles/roles_power.html', role_id=role_id) + return render_template('view/system/roles_power.html', role_id=role_id) # 角色编辑 @@ -29,11 +21,11 @@ def power(role_id): @permission_required("admin:role:edit") def role_editor(role_id): role = RoleModel.query.filter_by(id=role_id).first() - return render_template('admin/roles/roles_edit.html', role=role) + return render_template('view/system/roles_edit.html', role=role) @role_bp.get('/add') @view_logging_required @permission_required("admin:role:edit") def role_add(): - return render_template('admin/roles/roles_add.html') + return render_template('view/system/roles_add.html') diff --git a/applications/view/users.py b/applications/view/users.py index 2085b7a..77d2610 100644 --- a/applications/view/users.py +++ b/applications/view/users.py @@ -1,26 +1,16 @@ from flask import render_template -from flask_login import login_required, current_user -from sqlalchemy import desc from common.utils.rights import permission_required, view_logging_required -from models import LogModel, RoleModel, UserModel +from models import RoleModel, UserModel from . import index_bp -# 用户增加 -@index_bp.get('/users/') -@view_logging_required -@permission_required("admin:user:main") -def users_main(): - return render_template('admin/users/users.html') - - @index_bp.get('/users/add') @view_logging_required @permission_required("admin:user:add") def users_add_view(): roles = RoleModel.query.all() - return render_template('admin/users/users_add.html', roles=roles) + return render_template('view/system/user_add.html', roles=roles) @index_bp.get('/users/') @@ -33,17 +23,4 @@ def users_user_id_view(user_id): checked_roles = [] for r in user.role: checked_roles.append(r.id) - return render_template('admin/users/users_edit.html', user=user, roles=roles, checked_roles=checked_roles) - - -@index_bp.get('/users/center') -@login_required -def users_center(): - user_logs = LogModel.query.filter_by(url='/passport/login').filter_by(uid=current_user.id).order_by( - desc(LogModel.create_at)).limit(10) - return render_template('admin/users/profile.html', user_info=current_user, user_logs=user_logs) - - -@index_bp.get('/users/avatar') -def users_avatar_view(): - return render_template('admin/users/profile_avatar.html') + return render_template('view/system/user_edit.html', user=user, roles=roles, checked_roles=checked_roles) diff --git a/templates/admin/common/header.html b/templates/admin/common/header.html deleted file mode 100644 index b717e72..0000000 --- a/templates/admin/common/header.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/templates/admin/department/dept.html b/templates/admin/department/dept.html deleted file mode 100644 index 244cdf7..0000000 --- a/templates/admin/department/dept.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - 部门新增 - {% include 'admin/common/header.html' %} - -{#搜索框布局#} -
-
-
-
- -
- {#部门信息搜索字段#} - -
- {#查询按钮--需要触发layui事件#} - - {#重置按钮#} - -
-
-
-
-
-
- {#表格字段渲染#} -
-
-
- - -{% include 'admin/common/footer.html' %} -{#表格工具栏,需要在表格中绑定,且需要自定义事件#} - -{#操作字段,需要在表格中使用#} - -{#表格内的切换按钮#} - - - - - - - - - - - diff --git a/templates/admin/logs_temp/main.html b/templates/admin/logs_temp/main.html deleted file mode 100644 index 1086d4a..0000000 --- a/templates/admin/logs_temp/main.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - 日志 - {% include 'admin/common/header.html' %} - - - - -
-
-
-
    -
  • 登录日志
  • -
  • 访问日志
  • -
-
-
-
-
-
-
-
-
-
-
-
- - -{% include 'admin/common/footer.html' %} - - - - - diff --git a/templates/admin/rights/rights.html b/templates/admin/rights/rights.html deleted file mode 100644 index b093ce9..0000000 --- a/templates/admin/rights/rights.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - 权限 - {% include 'admin/common/header.html' %} - - -
-
-
-
- -
- -
- - -
-
-
-
-
-
-
-
-
- - -{% include 'admin/common/footer.html' %} - - - - - \ No newline at end of file diff --git a/templates/admin/roles/roles.html b/templates/admin/roles/roles.html deleted file mode 100644 index aebf9ce..0000000 --- a/templates/admin/roles/roles.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - 角色管理 - {% include 'admin/common/header.html' %} - - - -
-
-
-
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
- - -{% include 'admin/common/footer.html' %} - - - - - - - diff --git a/templates/admin/users/profile.html b/templates/admin/users/profile.html deleted file mode 100644 index 6cf852d..0000000 --- a/templates/admin/users/profile.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - 个人中心 - - {% include 'admin/common/header.html' %} - - - -
- {# 左侧栏 #} -
- {# 个人信息卡片 #} -
-
-
- -

{{ user_info.realname }}

-

China , 中国

-
-
-
- {{ user_info.remark }} -
-
- {# 登录信息卡片 #} -
-
- 登录记录 -
-
-
    - {% for log in user_logs %} -
  • - {{ log.url }} - {{ log.create_time }} -
  • - {% endfor %} -
-
-
-
- {# 右侧栏 #} -
- {# 个人信息卡片 #} -
-
个人信息
-
-
-
-
-
- -
- -
- -
-
-
- -
- -
-
- -
- -
- -
-
-
-
- - -
-
-
-
-
-
-
-
- {# 个人文章记录 #} -
-
- 我的文章 -
-
-
-
-
-
-
- -
-
-
为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
-
- “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
-
2020-06-12        评论 5 点赞 12 - 转发 - 4 -
-
-
-
-
- -
-
-
为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
-
- “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
-
2020-06-12        评论 5 点赞 12 - 转发 - 4 -
-
-
-
-
- -
-
-
为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
-
- “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
-
2020-06-12        评论 5 点赞 12 - 转发 - 4 -
-
-
-
-
- -
-
-
为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
-
- “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
-
2020-06-12        评论 5 点赞 12 - 转发 - 4 -
-
-
-
-
-
-
-
-
-
- - - -{% include 'admin/common/footer.html' %} - - - diff --git a/templates/admin/users/profile_avatar.html b/templates/admin/users/profile_avatar.html deleted file mode 100644 index 4622cfd..0000000 --- a/templates/admin/users/profile_avatar.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - 头像上传 - {% include 'admin/common/header.html' %} - - -
-
-
- -
-
-
-
-
-
-
-
-
-
- - - - - -
-
建议:图片的尺寸宽高比为1:1,大小在5m以内。
- -
-
- - -{% include 'admin/common/footer.html' %} - - - \ No newline at end of file diff --git a/templates/admin/users/users.html b/templates/admin/users/users.html deleted file mode 100644 index b536dee..0000000 --- a/templates/admin/users/users.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - 用户管理 - {% include 'admin/common/header.html' %} - - - - - -{# 查询表单 #} -
-
-
-
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
全 部 用 户
-
默 认 分 组
-
-
    -
    -
    -
    -
    -{# 用户表格 #} -
    -
    -
    -
    -
    -
    -
    - - -{% include 'admin/common/footer.html' %} -{# 表格操作 #} - -{# 用户修改操作 #} - -{# 启动与禁用 #} - -{# 用户注册时间 #} - -{# 用户更新时间 #} - - - - \ No newline at end of file diff --git a/templates/view/includes/links.html b/templates/view/includes/links.html new file mode 100644 index 0000000..c395f0e --- /dev/null +++ b/templates/view/includes/links.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/admin/common/footer.html b/templates/view/includes/scripts.html similarity index 76% rename from templates/admin/common/footer.html rename to templates/view/includes/scripts.html index abf3d53..4b8b486 100644 --- a/templates/admin/common/footer.html +++ b/templates/view/includes/scripts.html @@ -1,5 +1,5 @@ - - + + - - +{#表格内的切换按钮#} + + +{% include 'view/includes/scripts.html' %} @@ -117,7 +118,8 @@ diff --git a/templates/view/system/log.html b/templates/view/system/log.html index 3e67f29..351682b 100644 --- a/templates/view/system/log.html +++ b/templates/view/system/log.html @@ -3,7 +3,7 @@ 行为日志 - + {% include 'view/includes/links.html' %}
    @@ -40,33 +40,34 @@ {{ '{{layui.util.toDateString(d.createTime, "yyyy-MM-dd HH:mm:ss")}}'|safe }} - - +{% include 'view/includes/scripts.html' %} - - + + - - + form.on('submit(form-save)', function(data) { + $.ajax({ + url: '/system/user/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.layui.table.reload('form-table'); + }); + } else { + layer.msg(result.msg, { + icon: 2, + time: 1000, + }); + } + }, + }); + return false; + }); + }); + + + diff --git a/templates/view/system/person.html b/templates/view/system/person.html index 3a40a9c..b8b22cb 100644 --- a/templates/view/system/person.html +++ b/templates/view/system/person.html @@ -1,183 +1,212 @@ - - - - + + + + -
    -
    -
    -
    -
    - -

    就眠仪式

    -

    China , 中国

    -
    -
    -
    - 今日事 ,今日毕 -
    -
    +
    +
    +
    +
    +
    + +

    就眠仪式

    +

    China , 中国

    +
    +
    +
    + 今日事 ,今日毕 +
    +
    -
    -
    - 归档 -
    -
    -
      -
    • 优化代码格式2020-06-04 11:28
    • -
    • 新增消息组件2020-06-01 04:23
    • -
    • 移动端兼容2020-05-22 21:38
    • -
    • 系统布局优化2020-05-15 14:26
    • -
    • 兼容多系统菜单模式2020-05-13 16:32
    • -
    • 兼容多标签页切换2019-12-9 14:58
    • -
    • 扩展下拉组件2019-12-7 9:06
    • -
    • 扩展卡片样式2019-12-1 10:26
    • -
    -
    -
    -
    -
    -
    -
    - 我的文章 -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    - -
    -
    -
    为什么程序员们愿意在GitHub上开源自己的成果给别人免费使用和学习?
    -
    - “Git的精髓在于让所有人的贡献无缝合并。而GitHub的天才之处,在于理解了Git的精髓。”来一句我们程序员们接地气的话:分享是一种快乐~ -
    -
    2020-06-12        评论 5 点赞 12 转发 4
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - + + + var image = new Image(); + image.src = '/static/admin/images/avatar.jpg'; + image.onload = function() { + $('#userAvatar').attr('src', convert.imageToBase64(image)); + }; + + window.callback = function(data) { + layer.close(data.index); + $('#userAvatar').attr('src', data.newAvatar); + }; + + $('#userAvatar').click(function() { + layer.open({ + type: 2, + title: '更换图片', + shade: 0.1, + area: ['900px', '500px'], + content: MODULE_PATH + 'profile.html', + btn: ['确定', '取消'], + yes: function(index, layero) { + window['layui-layer-iframe' + index].submitForm(); + }, + }); + }); + }); + diff --git a/templates/admin/file/photo.html b/templates/view/system/photo.html similarity index 98% rename from templates/admin/file/photo.html rename to templates/view/system/photo.html index 9e9aec9..02a8b5e 100644 --- a/templates/admin/file/photo.html +++ b/templates/view/system/photo.html @@ -2,7 +2,7 @@ 图片上传 - {% include 'admin/common/header.html' %} + {% include 'view/includes/links.html' %} @@ -13,7 +13,6 @@
    -{% include 'admin/common/footer.html' %} +{% include 'view/includes/scripts.html' %} + - - - - - - - - - - +{% include 'view/includes/scripts.html' %} \ No newline at end of file diff --git a/templates/admin/rights/rights_add.html b/templates/view/system/power_add.html similarity index 98% rename from templates/admin/rights/rights_add.html rename to templates/view/system/power_add.html index 4e36c2f..0083eef 100644 --- a/templates/admin/rights/rights_add.html +++ b/templates/view/system/power_add.html @@ -2,7 +2,7 @@ 权限 - {% include 'admin/common/header.html' %} + {% include 'view/includes/links.html' %}
    @@ -86,7 +86,7 @@
    -{% include 'admin/common/footer.html' %} +{% include 'view/includes/scripts.html' %} - + + - - - - - - +{% include 'view/includes/scripts.html' %} + diff --git a/templates/admin/roles/roles_add.html b/templates/view/system/roles_add.html similarity index 97% rename from templates/admin/roles/roles_add.html rename to templates/view/system/roles_add.html index d15b4b3..2eeafea 100644 --- a/templates/admin/roles/roles_add.html +++ b/templates/view/system/roles_add.html @@ -2,7 +2,7 @@ 角色新增 - {% include 'admin/common/header.html' %} + {% include 'view/includes/links.html' %} @@ -61,7 +61,7 @@ -{% include 'admin/common/footer.html' %} +{% include 'view/includes/scripts.html' %} - + + diff --git a/templates/view/system/theme.html b/templates/view/system/theme.html index 6a02c0f..4eb6980 100644 --- a/templates/view/system/theme.html +++ b/templates/view/system/theme.html @@ -1,300 +1,305 @@ - - - - - - -
    -
    按钮
    -
    - - -
    -
    -
    -
    输入框
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    复选框
    -
    -
    - - - - - - -
    -
    -
    -
    -
    开关
    -
    -
    -    -    -    -    -
    -
    -
    -
    -
    单选框
    -
    -
    - - - -
    -
    -
    -
    -
    下拉
    -
    - -
    -
    -
    -
    -
    -
    -
    + + + + + + +
    +
    按钮
    +
    + + +
    +
    +
    +
    输入框
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    复选框
    +
    +
    + + + + + + +
    +
    +
    +
    +
    开关
    +
    +
    +    +    +    +    +
    +
    +
    +
    +
    单选框
    +
    +
    + + + +
    +
    +
    +
    +
    下拉
    +
    + +
    +
    +
    +
    +
    +
    +
    - + - + - + - + - + - + -
    -
    选项卡
    -
    -
    -
      -
    • 网站设置
    • -
    • 用户管理
    • -
    • 权限分配
    • -
    • 商品管理
    • -
    • 订单管理
    • -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    进度条
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    分页
    -
    -
    -
    -
    -
    -
    辅助元素
    -
    -
    快乐的时候不敢尽兴,频繁警戒自己保持清醒.
    -
    路上没有灯火的时候,就点亮自己的头颅.
    -
    -
    -
    -
    -
    -
      -
    • - -
      -

      8月18日

      -

      - layui 2.0 的一切准备工作似乎都已到位。发布之弦,一触即发。 -

      -
      -
    • -
    • - -
      -

      8月16日

      -

      杜甫的思想核心是儒家的仁政思想,他有“致君尧舜上,再使风俗淳”的宏伟抱负。个人最爱的名篇有:

      -
      -
    • -
    • - -
      -

      8月15日

      -

      - 中国人民抗日战争胜利72周年 -

      -
      -
    • -
    -
    -
    -
    -
    日期选择
    -
    - -
    -
    - - - - + + - + - + - + + laydate.render({ + elem: '#test2', //指定元素 + }); + }); + diff --git a/templates/view/system/user.html b/templates/view/system/user.html index eec36fb..4bded57 100644 --- a/templates/view/system/user.html +++ b/templates/view/system/user.html @@ -1,304 +1,282 @@ - - + + - 用户管理 - + {% include 'view/includes/links.html' %} +{# 查询表单 #}
    -
    +
    -
    - -
    - -
    + +
    +
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - + +
    +
    + +
    -
    -
    -
    + +{# 用户表格 #} +
    +
    +
    +
    +
    - - - - - - - - - - +{# 用户注册时间 #} +{# 用户更新时间 #} + - - - - + \ No newline at end of file diff --git a/templates/admin/users/users_add.html b/templates/view/system/user_add.html similarity index 97% rename from templates/admin/users/users_add.html rename to templates/view/system/user_add.html index 012bbc4..23326ea 100644 --- a/templates/admin/users/users_add.html +++ b/templates/view/system/user_add.html @@ -2,7 +2,7 @@ 用户管理 - {% include 'admin/common/header.html' %} + {% include 'view/includes/links.html' %}
    @@ -62,7 +62,7 @@
    -{% include 'admin/common/footer.html' %} +{% include 'view/includes/scripts.html' %}