Skip to content

Commit b10322d

Browse files
committed
fix(Terminology Configuration): Term name, synonyms cannot be repeated
1 parent 5d12216 commit b10322d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"AI Model Configuration": "AI Model Configuration"
77
},
88
"professional": {
9+
"cannot_be_repeated": "Term name, synonyms cannot be repeated",
910
"code_for_debugging": "Copy the following code for debugging",
1011
"full_screen_mode": "Full screen mode",
1112
"editing_terminology": "Editing Terminology",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"AI Model Configuration": "模型配置"
77
},
88
"professional": {
9+
"cannot_be_repeated": "术语名称,同义词不能重复",
910
"code_for_debugging": "复制以下代码进行调试",
1011
"full_screen_mode": "全屏模式",
1112
"editing_terminology": "编辑术语",

frontend/src/views/system/professional/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ const rules = {
222222
const saveHandler = () => {
223223
termFormRef.value.validate((res: any) => {
224224
if (res) {
225+
const arr = [...pageForm.value.other_words.filter((ele) => !!ele), pageForm.value.word]
226+
if (arr.length !== new Set(arr).size) {
227+
return ElMessage.error(t('professional.cannot_be_repeated'))
228+
}
225229
const obj = unref(pageForm)
226230
if (!obj.id) {
227231
delete obj.id

0 commit comments

Comments
 (0)