mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: Search ignores capitalization
--story=1017866 --user=王孝刚 【Bug转需求】【搜索】-函数库、模型、团队成员界面搜索不支持忽略大小写 #2126 https://www.tapd.cn/57709429/s/1654282
This commit is contained in:
parent
a8d79c5e60
commit
9c67f6bfe1
|
|
@ -105,7 +105,7 @@ class FunctionLibSerializer(serializers.Serializer):
|
|||
query_set = QuerySet(FunctionLib).filter(
|
||||
(Q(user_id=self.data.get('user_id')) | Q(permission_type='PUBLIC')))
|
||||
if self.data.get('name') is not None:
|
||||
query_set = query_set.filter(name__contains=self.data.get('name'))
|
||||
query_set = query_set.filter(name__icontains=self.data.get('name'))
|
||||
if self.data.get('desc') is not None:
|
||||
query_set = query_set.filter(desc__contains=self.data.get('desc'))
|
||||
if self.data.get('is_active') is not None:
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class ModelSerializer(serializers.Serializer):
|
|||
model_query_set = QuerySet(Model).filter((Q(user_id=user_id) | Q(permission_type='PUBLIC')))
|
||||
query_params = {}
|
||||
if name is not None:
|
||||
query_params['name__contains'] = name
|
||||
query_params['name__icontains'] = name
|
||||
if self.data.get('model_type') is not None:
|
||||
query_params['model_type'] = self.data.get('model_type')
|
||||
if self.data.get('model_name') is not None:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,12 @@
|
|||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('views.team.setting.check')" align="center" width="100" fixed="right">
|
||||
<el-table-column
|
||||
:label="$t('views.team.setting.check')"
|
||||
align="center"
|
||||
width="100"
|
||||
fixed="right"
|
||||
>
|
||||
<template #header>
|
||||
<el-checkbox
|
||||
:disabled="props.manage"
|
||||
|
|
@ -135,7 +140,9 @@ const allChecked: any = ref({
|
|||
|
||||
const filterText = ref('')
|
||||
|
||||
const filterData = computed(() => props.data.filter((v: any) => v.name.includes(filterText.value)))
|
||||
const filterData = computed(() =>
|
||||
props.data.filter((v: any) => v.name.toLowerCase().includes(filterText.value.toLowerCase()))
|
||||
)
|
||||
|
||||
const allIndeterminate: any = ref({
|
||||
[TeamEnum.MANAGE]: computed(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue