diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 07650f87..db200a96 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -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", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index dc5ce4ab..9e5de55c 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -6,6 +6,7 @@ "AI Model Configuration": "模型配置" }, "professional": { + "cannot_be_repeated": "术语名称,同义词不能重复", "code_for_debugging": "复制以下代码进行调试", "full_screen_mode": "全屏模式", "editing_terminology": "编辑术语", diff --git a/frontend/src/views/system/professional/index.vue b/frontend/src/views/system/professional/index.vue index e2ae6d52..2e9ddb21 100644 --- a/frontend/src/views/system/professional/index.vue +++ b/frontend/src/views/system/professional/index.vue @@ -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