diff --git a/applications/templates/department/add.html b/applications/templates/department/add.html deleted file mode 100644 index 36db667..0000000 --- a/applications/templates/department/add.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - 部门管理 - {% include 'common/header.html' %} - - -
-
-
-
-
- -
- {#渲染树形选择器#} -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -{% include 'common/footer.html' %} - - - - \ No newline at end of file diff --git a/applications/templates/department/edit.html b/applications/templates/department/edit.html deleted file mode 100644 index f540ae5..0000000 --- a/applications/templates/department/edit.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - 部门修改 - {% include 'common/header.html' %} - - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -{% include 'common/footer.html' %} - - - - \ No newline at end of file diff --git a/applications/templates/department/main.html b/applications/templates/department/main.html index f30b20a..53c1ad8 100644 --- a/applications/templates/department/main.html +++ b/applications/templates/department/main.html @@ -17,7 +17,7 @@ {#查询按钮--需要触发layui事件#} - @@ -34,20 +34,20 @@
    {#表格字段渲染#} -
    +
    {#表格工具栏,需要在表格中绑定,且需要自定义事件#} - {#表格内的切换按钮#} @@ -75,6 +79,170 @@ {% include 'common/footer.html' %} +{#添加数据表单#} + +{#编辑表单数据#} + +{#添加数据#} + +{#修改数据#} + \ No newline at end of file diff --git a/applications/templates/rights/add.html b/applications/templates/rights/add.html deleted file mode 100644 index 99edee7..0000000 --- a/applications/templates/rights/add.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - 权限 - {% include 'common/header.html' %} - - -
    -
    -
    -
    -
    - -
    -
      -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - - - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      -
      -
      -
      -
      - - -
      -
      -
      -{% include 'common/footer.html' %} - - - - \ No newline at end of file diff --git a/applications/templates/rights/edit.html b/applications/templates/rights/edit.html index 0ef546b..2621626 100644 --- a/applications/templates/rights/edit.html +++ b/applications/templates/rights/edit.html @@ -39,11 +39,11 @@
      - - -
      @@ -68,7 +68,7 @@
      -
      @@ -116,6 +116,7 @@ form.on('radio(powerType)', function (data) { if (this.value == '0') { + {#目录#} $('#powerUrlItem').hide() $('#powerCodeItem').hide() $('#openTypeItem').hide() @@ -123,10 +124,12 @@ $('#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() @@ -139,7 +142,7 @@ data.field.icon = 'layui-icon ' + data.field.icon console.log(data.field) $.ajax({ - url: '/rights/power/' + data.field.powerId , + url: '/rights/power/' + data.field.powerId, data: JSON.stringify(data.field), dataType: 'json', contentType: 'application/json', @@ -159,7 +162,7 @@ }) iconPicker.render({ - elem: '#icon', + elem: '#edit_icon', type: 'fontClass', search: true, page: true, diff --git a/applications/templates/rights/main.html b/applications/templates/rights/main.html index 8f01d46..e06bd88 100644 --- a/applications/templates/rights/main.html +++ b/applications/templates/rights/main.html @@ -13,7 +13,7 @@
      - @@ -27,7 +27,7 @@
      -
      +
      @@ -73,9 +73,10 @@ - + + + {% include 'common/footer.html' %} +{#添加权限数据页面#} + \ No newline at end of file diff --git a/applications/templates/roles/add.html b/applications/templates/roles/add.html deleted file mode 100644 index cf3935c..0000000 --- a/applications/templates/roles/add.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - 角色新增 - {% include 'common/header.html' %} - -
      -
      -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      - -
      - - -
      -
      -
      - -
      - -
      -
      -
      - -
      - -
      -
      -
      -
      -
      -
      -
      - - -
      -
      -
      -{% include 'common/footer.html' %} - - - \ No newline at end of file diff --git a/applications/templates/roles/main.html b/applications/templates/roles/main.html index 64f7027..c2295ad 100644 --- a/applications/templates/roles/main.html +++ b/applications/templates/roles/main.html @@ -34,7 +34,58 @@ - + +{#添加数据逻辑#} + \ No newline at end of file diff --git a/applications/templates/users/add.html b/applications/templates/users/add.html index 005905e..b34e67d 100644 --- a/applications/templates/users/add.html +++ b/applications/templates/users/add.html @@ -8,40 +8,38 @@
      -
      -
      - -
      - -
      +
      + +
      +
      -
      - -
      - -
      +
      +
      + +
      +
      -
      - -
      - -
      +
      +
      + +
      +
      +
      -
      - -
      +
      + +
      - {% for role in roles %} - - {% endfor %} + {% for role in roles %} + + {% endfor %} -
      diff --git a/applications/view/department/__init__.py b/applications/view/department/__init__.py index a912917..248b049 100644 --- a/applications/view/department/__init__.py +++ b/applications/view/department/__init__.py @@ -30,9 +30,9 @@ def data(): @dept_api.resource('/add') class AddDepartment(Resource): - @authorize("admin:dept:add", log=True) - def get(self): - return make_response(render_template('department/add.html')) + # @authorize("admin:dept:add", log=True) + # def get(self): + # return make_response(render_template('department/add.html')) @authorize("admin:dept:add", log=True) def post(self): @@ -98,7 +98,18 @@ class DeptURD(Resource): @authorize("admin:dept:edit", log=True) def get(self, dept_id): dept = Dept.query.filter_by(id=dept_id).first() - return make_response(render_template('department/edit.html', dept=dept)) + dept_data = { + 'id': dept.id, + 'dept_name': dept.dept_name, + 'leader': dept.leader, + 'email': dept.email, + 'phone': dept.phone, + 'status': dept.status, + 'sort': dept.sort, + 'address': dept.address, + } + # return make_response(render_template('department/edit.html', dept=dept)) + return jsonify(success=True, msg='ok', dept=dept_data) @authorize("admin:dept:edit", log=True) def put(self, dept_id): diff --git a/applications/view/rights/right.py b/applications/view/rights/right.py index b681c4c..0562eb0 100644 --- a/applications/view/rights/right.py +++ b/applications/view/rights/right.py @@ -76,10 +76,10 @@ def batch_remove_view(): @rights_api.resource('/power') class AddRight(Resource): - @authorize("admin:power:add", log=True) - def get(self): - """获取增加视图""" - return make_response(render_template('rights/add.html')) + # @authorize("admin:power:add", log=True) + # def get(self): + # """获取增加视图""" + # return make_response(render_template('rights/add.html')) @authorize("admin:power:add", log=True) def post(self): diff --git a/applications/view/roles/role.py b/applications/view/roles/role.py index 3823137..8995957 100644 --- a/applications/view/roles/role.py +++ b/applications/view/roles/role.py @@ -53,9 +53,9 @@ def table(): @role_api.resource('/add') class AddRole(Resource): - @authorize("admin:role:add", log=True) - def get(self): - return make_response(render_template('roles/add.html')) + # @authorize("admin:role:add", log=True) + # def get(self): + # return make_response(render_template('roles/add.html')) @authorize("admin:role:add", log=True) def post(self): diff --git a/applications/view/users/user_view.py b/applications/view/users/user_view.py index bc39abe..c10a849 100644 --- a/applications/view/users/user_view.py +++ b/applications/view/users/user_view.py @@ -68,7 +68,7 @@ class CURDUser(Resource): return make_response( render_template('users/edit_users.html', user=user, roles=roles, checked_roles=checked_roles)) - @authorize("admin:users:remove", log=True) + @authorize("admin:user:remove", log=True) def delete(self, user_id): # 删除用户 res = _utils.delete_by_id(user_id) @@ -76,7 +76,7 @@ class CURDUser(Resource): return fail_api(msg="删除失败") return success_api(msg="删除成功") - @authorize("admin:users:edit", log=True) + @authorize("admin:user:edit", log=True) def put(self, user_id): parser = reqparse.RequestParser() @@ -157,7 +157,7 @@ def data(): per_page=res.limit, error_out=False) - dept_name = lambda dept_id: Dept.query.filter_by(id=dept_id).first().dept_name + dept_name = lambda dept_id: Dept.query.filter_by(id=dept_id).first().dept_name if dept_id else "" user_data = [{ 'id': item.id, 'username': item.username,