fix(Terminology Configuration): Term name, synonyms cannot be repeated

This commit is contained in:
dataeaseShu
2025-08-29 15:05:43 +08:00
parent 5d122168cc
commit b10322d5c1
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@
"AI Model Configuration": "AI Model Configuration"
},
"professional": {
"cannot_be_repeated": "Term name, synonyms cannot be repeated",
"code_for_debugging": "Copy the following code for debugging",
"full_screen_mode": "Full screen mode",
"editing_terminology": "Editing Terminology",
+1
View File
@@ -6,6 +6,7 @@
"AI Model Configuration": "模型配置"
},
"professional": {
"cannot_be_repeated": "术语名称,同义词不能重复",
"code_for_debugging": "复制以下代码进行调试",
"full_screen_mode": "全屏模式",
"editing_terminology": "编辑术语",
@@ -222,6 +222,10 @@ const rules = {
const saveHandler = () => {
termFormRef.value.validate((res: any) => {
if (res) {
const arr = [...pageForm.value.other_words.filter((ele) => !!ele), pageForm.value.word]
if (arr.length !== new Set(arr).size) {
return ElMessage.error(t('professional.cannot_be_repeated'))
}
const obj = unref(pageForm)
if (!obj.id) {
delete obj.id