From 3d41aac4649c1c2adbab812faa79449a6f653bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Sat, 20 Mar 2021 19:25:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E5=88=AB=E5=AD=97=E6=AE=B5=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvadmin-backend/application/settings.py | 1 + dvadmin-backend/apps/vadmin/permission/filters.py | 7 +++++++ dvadmin-backend/apps/vadmin/system/filters.py | 6 ++++++ dvadmin-ui/src/views/vadmin/permission/role/index.vue | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dvadmin-backend/application/settings.py b/dvadmin-backend/application/settings.py index e1b13ae..03d0924 100644 --- a/dvadmin-backend/application/settings.py +++ b/dvadmin-backend/application/settings.py @@ -313,3 +313,4 @@ CAPTCHA_NOISE_FUNCTIONS = ( ) # CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.random_char_challenge' CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.math_challenge' +DEFAULT_LOOKUP_EXPR = 'icontains' diff --git a/dvadmin-backend/apps/vadmin/permission/filters.py b/dvadmin-backend/apps/vadmin/permission/filters.py index 84d3734..a6f6809 100644 --- a/dvadmin-backend/apps/vadmin/permission/filters.py +++ b/dvadmin-backend/apps/vadmin/permission/filters.py @@ -7,6 +7,7 @@ class MenuFilter(django_filters.rest_framework.FilterSet): """ 菜单管理 简单序过滤器 """ + name = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = Menu @@ -17,6 +18,7 @@ class DeptFilter(django_filters.rest_framework.FilterSet): """ 部门管理 简单序过滤器 """ + deptName = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = Dept @@ -27,6 +29,7 @@ class PostFilter(django_filters.rest_framework.FilterSet): """ 岗位管理 简单序过滤器 """ + postName = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = Post @@ -37,6 +40,7 @@ class RoleFilter(django_filters.rest_framework.FilterSet): """ 角色管理 简单序过滤器 """ + roleName = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = Role @@ -47,7 +51,10 @@ class UserProfileFilter(django_filters.rest_framework.FilterSet): """ 用户管理 简单序过滤器 """ + username = django_filters.CharFilter(lookup_expr='icontains') + mobile = django_filters.CharFilter(lookup_expr='icontains') deptId = django_filters.CharFilter(field_name='dept__id') + class Meta: model = UserProfile exclude = ('secret', 'password',) diff --git a/dvadmin-backend/apps/vadmin/system/filters.py b/dvadmin-backend/apps/vadmin/system/filters.py index 6c85b54..a9dae47 100644 --- a/dvadmin-backend/apps/vadmin/system/filters.py +++ b/dvadmin-backend/apps/vadmin/system/filters.py @@ -8,6 +8,7 @@ class DictDataFilter(django_filters.rest_framework.FilterSet): """ 字典管理 简单过滤器 """ + dictName = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = DictData @@ -18,6 +19,7 @@ class DictDetailsFilter(django_filters.rest_framework.FilterSet): """ 字典详情 简单过滤器 """ + dictLabel = django_filters.CharFilter(lookup_expr='icontains') dictType = django_filters.CharFilter(field_name='dict_data__dictType') class Meta: @@ -29,6 +31,7 @@ class ConfigSettingsFilter(django_filters.rest_framework.FilterSet): """ 参数设置 简单过滤器 """ + configName = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = ConfigSettings @@ -39,6 +42,7 @@ class SaveFileFilter(django_filters.rest_framework.FilterSet): """ 文件管理 简单过滤器 """ + name = django_filters.CharFilter(lookup_expr='icontains') class Meta: model = SaveFile @@ -51,6 +55,8 @@ class MessagePushFilter(django_filters.rest_framework.FilterSet): """ # is_read = django_filters.CharFilter(field_name='messagepushuser_message_push__is_read') + title = django_filters.CharFilter(lookup_expr='icontains') + class Meta: model = MessagePush fields = '__all__' diff --git a/dvadmin-ui/src/views/vadmin/permission/role/index.vue b/dvadmin-ui/src/views/vadmin/permission/role/index.vue index 3679302..9e74b36 100755 --- a/dvadmin-ui/src/views/vadmin/permission/role/index.vue +++ b/dvadmin-ui/src/views/vadmin/permission/role/index.vue @@ -366,7 +366,7 @@ export default { /** 查询菜单树结构 */ getMenuTreeselect() { menuTreeselect().then(response => { - this.menuOptions = response.data; + this.menuOptions = this.handleTree(response.data,'id'); }); }, /** 查询部门树结构 */