个别字段模糊查询功能完成

pull/2/head
李强 2021-03-20 19:25:38 +08:00
parent 24de92aa74
commit 3d41aac464
4 changed files with 15 additions and 1 deletions

View File

@ -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'

View File

@ -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',)

View File

@ -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__'

View File

@ -366,7 +366,7 @@ export default {
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
this.menuOptions = this.handleTree(response.data,'id');
});
},
/** 查询部门树结构 */