diff --git a/backend/apps/chat/curd/chat.py b/backend/apps/chat/curd/chat.py index 6ee3ff9a..d6e2bfe1 100644 --- a/backend/apps/chat/curd/chat.py +++ b/backend/apps/chat/curd/chat.py @@ -43,8 +43,7 @@ def list_chats(session: SessionDep, current_user: CurrentUser) -> List[Chat]: def list_recent_questions(session: SessionDep, current_user: CurrentUser, datasource_id: int) -> List[str]: chat_records = ( session.query( - ChatRecord.question, - func.count(ChatRecord.question).label('question_count') + ChatRecord.question ) .join(Chat, ChatRecord.chat_id == Chat.id) # 关联Chat表 .filter( @@ -52,7 +51,7 @@ def list_recent_questions(session: SessionDep, current_user: CurrentUser, dataso ChatRecord.question.isnot(None) ) .group_by(ChatRecord.question) - .order_by(desc('question_count'), desc(func.max(ChatRecord.create_time))) + .order_by(desc(func.max(ChatRecord.create_time))) .limit(10) .all() ) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index f3f80f18..bf679c93 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -193,8 +193,7 @@ "chart_selected": "Selected {0}" }, "qa": { - "recommended_repetitive_tips": "Duplicate questions exist", - "retrieve_error": "Model recommendation failed...", + "retrieve_error": "No content available", "retrieve_again": "Retrieve Again", "recently": "recently", "recommend": "recommend", @@ -324,6 +323,7 @@ } }, "datasource": { + "recommended_repetitive_tips": "Duplicate questions exist", "recommended_problem_tips": "Custom configuration requires at least one problem, each problem should be 2-200 characters", "recommended_problem_configuration": "Recommended Problem Configuration", "problem_generation_method": "Problem Generation Method", @@ -800,4 +800,4 @@ "modelType": { "llm": "Large Language Model" } -} \ No newline at end of file +} diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 44a222ea..b4a46cf7 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -193,8 +193,7 @@ "chart_selected": "{0}개 선택됨" }, "qa": { - "recommended_repetitive_tips": "중복된 문제가 존재합니다", - "retrieve_error": "모델 추천 문제 실패...", + "retrieve_error": "콘텐츠 없음", "retrieve_again": "다시 가져오기", "recently": "최근", "recommend": "추천", @@ -324,6 +323,7 @@ } }, "datasource": { + "recommended_repetitive_tips": "중복된 문제가 존재합니다", "recommended_problem_tips": "사용자 정의 구성으로 최소 한 개의 문제를 생성하세요, 각 문제는 2~200자로 작성", "recommended_problem_configuration": "추천 문제 구성", "problem_generation_method": "문제 생성 방식", @@ -800,4 +800,4 @@ "modelType": { "llm": "대형 언어 모델" } -} \ No newline at end of file +} diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 0ab61197..e5164c92 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -193,7 +193,8 @@ "chart_selected": "已选{0}" }, "qa": { - "retrieve_error": "模型推荐问题失败...", + "recommended_repetitive_tips": "Duplicate questions exist", + "retrieve_error": "暂无内容", "retrieve_again": "重新获取", "recently": "最近", "recommend": "推荐", @@ -800,4 +801,4 @@ "modelType": { "llm": "大语言模型" } -} \ No newline at end of file +} diff --git a/frontend/src/views/chat/QuickQuestion.vue b/frontend/src/views/chat/QuickQuestion.vue index dd412a59..5dd5ef10 100644 --- a/frontend/src/views/chat/QuickQuestion.vue +++ b/frontend/src/views/chat/QuickQuestion.vue @@ -1,7 +1,6 @@ @@ -56,8 +62,6 @@ defineExpose({ .recent-questions { height: 100%; width: 100%; - overflow-x: hidden; - overflow-y: auto; font-size: 14px; font-weight: 500; line-height: 22px; @@ -72,7 +76,7 @@ defineExpose({ .question-grid-input { display: grid; - grid-gap: 12px; + grid-gap: 1px; grid-template-columns: repeat(1, calc(100% - 6px)); } @@ -85,11 +89,13 @@ defineExpose({ .question { font-weight: 400; cursor: pointer; - background: rgba(245, 246, 247, 1); - min-height: 32px; - border-radius: 6px; - padding: 5px 12px; + height: 32px; + border-radius: 4px; + padding: 5px 8px; line-height: 22px; + white-space: nowrap; /* 禁止换行 */ + overflow: hidden; /* 隐藏溢出内容 */ + text-overflow: ellipsis; /* 显示省略号 */ &:hover { background: rgba(31, 35, 41, 0.1); } @@ -99,4 +105,15 @@ defineExpose({ } } } + +.recommend-questions-error { + font-size: 14px; + font-weight: 400; + color: rgba(100, 106, 115, 1); + margin-top: 60px; + display: flex; + align-items: center; + justify-content: center; + width: 100%; +} diff --git a/frontend/src/views/chat/RecommendQuestionQuick.vue b/frontend/src/views/chat/RecommendQuestionQuick.vue index fbb174a7..789ee44f 100644 --- a/frontend/src/views/chat/RecommendQuestionQuick.vue +++ b/frontend/src/views/chat/RecommendQuestionQuick.vue @@ -130,24 +130,27 @@ defineExpose({ getRecommendQuestions, id: () => props.recordId, stop }) @@ -168,7 +171,7 @@ defineExpose({ getRecommendQuestions, id: () => props.recordId, stop }) .question-grid-input { display: grid; - grid-gap: 12px; + grid-gap: 1px; grid-template-columns: repeat(1, calc(100% - 6px)); } @@ -181,11 +184,13 @@ defineExpose({ getRecommendQuestions, id: () => props.recordId, stop }) .question { font-weight: 400; cursor: pointer; - background: rgba(245, 246, 247, 1); - min-height: 32px; - border-radius: 6px; - padding: 5px 12px; + height: 32px; + border-radius: 4px; + padding: 5px 8px; line-height: 22px; + white-space: nowrap; /* 禁止换行 */ + overflow: hidden; /* 隐藏溢出内容 */ + text-overflow: ellipsis; /* 显示省略号 */ &:hover { background: rgba(31, 35, 41, 0.1); } @@ -197,10 +202,10 @@ defineExpose({ getRecommendQuestions, id: () => props.recordId, stop }) } .recommend-questions-error { - font-size: 12px; - font-weight: 500; + font-size: 14px; + font-weight: 400; color: rgba(100, 106, 115, 1); - margin-top: 70px; + margin-top: 60px; display: flex; align-items: center; justify-content: center; diff --git a/frontend/src/views/system/prompt/index.vue b/frontend/src/views/system/prompt/index.vue index 5a6855d5..20fdd77b 100644 --- a/frontend/src/views/system/prompt/index.vue +++ b/frontend/src/views/system/prompt/index.vue @@ -592,7 +592,7 @@ const drawerMainClose = () => { - {{ $t('prompt.add_prompt_word') }}22 + {{ $t('prompt.add_prompt_word') }}