diff --git a/apps/tools/serializers/tool.py b/apps/tools/serializers/tool.py index 0708a70e0..ebce1ab5c 100644 --- a/apps/tools/serializers/tool.py +++ b/apps/tools/serializers/tool.py @@ -551,7 +551,7 @@ class ToolTreeSerializer(serializers.Serializer): name = serializers.CharField(required=False, allow_null=True, allow_blank=True, label=_('tool name')) user_id = serializers.UUIDField(required=False, allow_null=True, label=_('user id')) scope = serializers.CharField(required=True, label=_('scope')) - create_user = serializers.UUIDField(required=False, label=_('scope'), allow_null=True) + create_user = serializers.UUIDField(required=False, label=_('create user'), allow_null=True) def page_tool(self, current_page: int, page_size: int): self.is_valid(raise_exception=True) diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index 482e2c62a..5ddff3ece 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -530,9 +530,11 @@ function searchHandle() { } function getList() { - const params = { + const params: any = { folder_id: folder.currentFolder?.id || 'default', - [search_type.value]: search_form.value[search_type.value], + } + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] } ApplicationApi.getApplication(paginationConfig, params, loading).then((res) => { paginationConfig.total = res.data.total diff --git a/ui/src/views/knowledge/component/KnowledgeListContainer.vue b/ui/src/views/knowledge/component/KnowledgeListContainer.vue index cb363bbb5..f4e57f6ce 100644 --- a/ui/src/views/knowledge/component/KnowledgeListContainer.vue +++ b/ui/src/views/knowledge/component/KnowledgeListContainer.vue @@ -503,10 +503,12 @@ watch( ) function getList() { - const params = { + const params: any = { folder_id: folder.currentFolder?.id || user.getWorkspaceId(), scope: apiType.value === 'systemShare' ? 'SHARED' : 'WORKSPACE', - [search_type.value]: search_form.value[search_type.value], + } + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] } loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value }) .getKnowledgeListPage(paginationConfig, params, loading) diff --git a/ui/src/views/system-chat-user/chat-user/index.vue b/ui/src/views/system-chat-user/chat-user/index.vue index 9fba41543..e1fc2604e 100644 --- a/ui/src/views/system-chat-user/chat-user/index.vue +++ b/ui/src/views/system-chat-user/chat-user/index.vue @@ -298,8 +298,9 @@ const paginationConfig = reactive({ const userTableData = ref([]) function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value as keyof typeof search_form.value], + const params: any = {} + if (search_form.value[search_type.value as keyof typeof search_form.value]) { + params[search_type.value] = search_form.value[search_type.value as keyof typeof search_form.value] } return loadPermissionApi('chatUser').getUserManage(paginationConfig, params, loading).then((res: any) => { userTableData.value = res.data.records diff --git a/ui/src/views/system-resource-management/ApplicationResourceIndex.vue b/ui/src/views/system-resource-management/ApplicationResourceIndex.vue index bb148380b..39a016ea7 100644 --- a/ui/src/views/system-resource-management/ApplicationResourceIndex.vue +++ b/ui/src/views/system-resource-management/ApplicationResourceIndex.vue @@ -301,8 +301,9 @@ const search_type_change = () => { } function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value], + const params: any = {} + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] } if (workspaceArr.value.length > 0) { params['workspace_ids'] = JSON.stringify(workspaceArr.value) diff --git a/ui/src/views/system-resource-management/KnowledgeResourceIndex.vue b/ui/src/views/system-resource-management/KnowledgeResourceIndex.vue index c530eced1..ac8245b8e 100644 --- a/ui/src/views/system-resource-management/KnowledgeResourceIndex.vue +++ b/ui/src/views/system-resource-management/KnowledgeResourceIndex.vue @@ -192,8 +192,9 @@ const search_type_change = () => { } function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value], + const params: any = {} + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] } if (workspaceArr.value.length > 0) { params.workspace_ids = JSON.stringify(workspaceArr.value) diff --git a/ui/src/views/system-resource-management/ToolResourceIndex.vue b/ui/src/views/system-resource-management/ToolResourceIndex.vue index 2e63c5777..6a6f79391 100644 --- a/ui/src/views/system-resource-management/ToolResourceIndex.vue +++ b/ui/src/views/system-resource-management/ToolResourceIndex.vue @@ -214,8 +214,9 @@ const search_type_change = () => { } function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value], + const params: any = {} + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] } if (workspaceArr.value.length > 0) { params.workspace_ids = JSON.stringify(workspaceArr.value) diff --git a/ui/src/views/system/user-manage/index.vue b/ui/src/views/system/user-manage/index.vue index 5456ea685..5e6d878f4 100644 --- a/ui/src/views/system/user-manage/index.vue +++ b/ui/src/views/system/user-manage/index.vue @@ -250,8 +250,9 @@ function handleSizeChange() { } function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value as keyof typeof search_form.value], + const params: any = {} + if (search_form.value[search_type.value as keyof typeof search_form.value]) { + params[search_type.value] = search_form.value[search_type.value as keyof typeof search_form.value] } return userManageApi.getUserManage(paginationConfig, params, loading).then((res) => { userTableData.value = res.data.records.map((item: any) => ({ diff --git a/ui/src/views/tool/component/ToolListContainer.vue b/ui/src/views/tool/component/ToolListContainer.vue index 690043dc0..bc55db36a 100644 --- a/ui/src/views/tool/component/ToolListContainer.vue +++ b/ui/src/views/tool/component/ToolListContainer.vue @@ -606,11 +606,13 @@ watch( { deep: true, immediate: true }, ) function getList() { - const params = { - [search_type.value]: search_form.value[search_type.value], + const params: any = { folder_id: folder.currentFolder?.id || user.getWorkspaceId(), scope: apiType.value === 'systemShare' ? 'SHARED' : 'WORKSPACE', } + if (search_form.value[search_type.value]) { + params[search_type.value] = search_form.value[search_type.value] + } loadSharedApi({ type: 'tool', isShared: isShared.value, systemType: apiType.value }) .getToolListPage(paginationConfig, params, loading) .then((res: any) => {