diff --git a/apps/dataset/serializers/document_serializers.py b/apps/dataset/serializers/document_serializers.py index 80cfdccbe10..e37af025b1d 100644 --- a/apps/dataset/serializers/document_serializers.py +++ b/apps/dataset/serializers/document_serializers.py @@ -143,20 +143,21 @@ def get_request_params_api(): required=True, description='知识库id'), ] + @staticmethod def get_request_body_api(): return openapi.Schema( type=openapi.TYPE_OBJECT, required=['source_url_list'], properties={ - 'source_url_list': openapi.Schema(type=openapi.TYPE_ARRAY, title="文档地址列表", description="文档地址列表", + 'source_url_list': openapi.Schema(type=openapi.TYPE_ARRAY, title="文档地址列表", + description="文档地址列表", items=openapi.Schema(type=openapi.TYPE_STRING)), 'selector': openapi.Schema(type=openapi.TYPE_STRING, title="选择器", description="选择器") } ) - class DocumentInstanceSerializer(ApiMixin, serializers.Serializer): name = serializers.CharField(required=True, error_messages=ErrMessage.char("文档名称"), @@ -396,8 +397,8 @@ def get_query_set(self): query_set = query_set.annotate( reversed_status=Reverse('status'), task_type_status=Substr('reversed_status', TaskType(task_type).value, - TaskType(task_type).value), - ).filter(task_type_status__in=[State(status).value]).values('id') + 1), + ).filter(task_type_status=State(status).value).values('id') else: if status != State.SUCCESS.value: query_set = query_set.filter(status__icontains=status) @@ -674,7 +675,7 @@ def cancel(self, instance, with_valid=True): ListenerManagement.update_status(QuerySet(Paragraph).annotate( reversed_status=Reverse('status'), task_type_status=Substr('reversed_status', TaskType(instance.get('type')).value, - TaskType(instance.get('type')).value), + 1), ).filter(task_type_status__in=[State.PENDING.value, State.STARTED.value]).filter( document_id=document_id).values('id'), TaskType(instance.get('type')), @@ -682,7 +683,7 @@ def cancel(self, instance, with_valid=True): ListenerManagement.update_status(QuerySet(Document).annotate( reversed_status=Reverse('status'), task_type_status=Substr('reversed_status', TaskType(instance.get('type')).value, - TaskType(instance.get('type')).value), + 1), ).filter(task_type_status__in=[State.PENDING.value, State.STARTED.value]).filter( id=document_id).values('id'), TaskType(instance.get('type')), diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index a6df1fb0b1e..5a3cd2f2c97 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -136,7 +136,7 @@ " class="justify-center" :command="beforeCommand('status', State.STARTED, TaskType.GENERATE_PROBLEM)" - >生成问题中生成中