File tree Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 190190 "chart_selected" : " Selected {0}"
191191 },
192192 "qa" : {
193+ "recommended_repetitive_tips" : " Duplicate questions exist" ,
193194 "retrieve_error" : " Model recommendation failed..." ,
194195 "retrieve_again" : " Retrieve Again" ,
195196 "recently" : " recently" ,
Original file line number Diff line number Diff line change 190190 "chart_selected" : " {0}개 선택됨"
191191 },
192192 "qa" : {
193+ "recommended_repetitive_tips" : " 중복된 문제가 존재합니다" ,
193194 "retrieve_error" : " 모델 추천 문제 실패..." ,
194195 "retrieve_again" : " 다시 가져오기" ,
195196 "recently" : " 최근" ,
Original file line number Diff line number Diff line change 320320 }
321321 },
322322 "datasource" : {
323+ "recommended_repetitive_tips" : " 存在重复问题" ,
323324 "recommended_problem_tips" : " 自定义配置至少一个问题,每个问题2-200个字符" ,
324325 "recommended_problem_configuration" : " 推荐问题配置" ,
325326 "problem_generation_method" : " 问题生成方式" ,
Original file line number Diff line number Diff line change @@ -51,18 +51,29 @@ const closeDialog = () => {
5151const save = () => {
5252 if (state .recommended .recommended_config == 2 ) {
5353 let checkProblem = false
54+ let repetitiveQuestion = false
5455 if (state .recommended .recommendedProblemList .length === 0 ) {
5556 checkProblem = true
5657 }
58+ const questions = new Set <string >()
5759 state .recommended .recommendedProblemList .forEach ((problem : RecommendedProblem ): void => {
5860 if (problem .question .length > 200 || problem .question .length < 2 ) {
5961 checkProblem = true
6062 }
63+ if (questions .has (problem .question )) {
64+ repetitiveQuestion = true
65+ }
66+ questions .add (problem .question )
6167 })
6268 if (checkProblem ) {
6369 ElMessage .error (t (' datasource.recommended_problem_tips' ))
6470 return
6571 }
72+
73+ if (repetitiveQuestion ) {
74+ ElMessage .error (t (' datasource.recommended_repetitive_tips' ))
75+ return
76+ }
6677 }
6778 recommendedApi
6879 .save_recommended_problem ({
You can’t perform that action at this time.
0 commit comments