mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 01:36:57 +08:00
refactor: Recommended questions with repeated prompts added. (#524)
This commit is contained in:
@@ -190,6 +190,7 @@
|
||||
"chart_selected": "Selected {0}"
|
||||
},
|
||||
"qa": {
|
||||
"recommended_repetitive_tips": "Duplicate questions exist",
|
||||
"retrieve_error": "Model recommendation failed...",
|
||||
"retrieve_again": "Retrieve Again",
|
||||
"recently": "recently",
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
"chart_selected": "{0}개 선택됨"
|
||||
},
|
||||
"qa": {
|
||||
"recommended_repetitive_tips": "중복된 문제가 존재합니다",
|
||||
"retrieve_error": "모델 추천 문제 실패...",
|
||||
"retrieve_again": "다시 가져오기",
|
||||
"recently": "최근",
|
||||
|
||||
@@ -320,6 +320,7 @@
|
||||
}
|
||||
},
|
||||
"datasource": {
|
||||
"recommended_repetitive_tips": "存在重复问题",
|
||||
"recommended_problem_tips": "自定义配置至少一个问题,每个问题2-200个字符",
|
||||
"recommended_problem_configuration": "推荐问题配置",
|
||||
"problem_generation_method": "问题生成方式",
|
||||
|
||||
@@ -51,18 +51,29 @@ const closeDialog = () => {
|
||||
const save = () => {
|
||||
if (state.recommended.recommended_config == 2) {
|
||||
let checkProblem = false
|
||||
let repetitiveQuestion = false
|
||||
if (state.recommended.recommendedProblemList.length === 0) {
|
||||
checkProblem = true
|
||||
}
|
||||
const questions = new Set<string>()
|
||||
state.recommended.recommendedProblemList.forEach((problem: RecommendedProblem): void => {
|
||||
if (problem.question.length > 200 || problem.question.length < 2) {
|
||||
checkProblem = true
|
||||
}
|
||||
if (questions.has(problem.question)) {
|
||||
repetitiveQuestion = true
|
||||
}
|
||||
questions.add(problem.question)
|
||||
})
|
||||
if (checkProblem) {
|
||||
ElMessage.error(t('datasource.recommended_problem_tips'))
|
||||
return
|
||||
}
|
||||
|
||||
if (repetitiveQuestion) {
|
||||
ElMessage.error(t('datasource.recommended_repetitive_tips'))
|
||||
return
|
||||
}
|
||||
}
|
||||
recommendedApi
|
||||
.save_recommended_problem({
|
||||
|
||||
Reference in New Issue
Block a user