From 57ba9e00f8248f9e838c66c8805b0142c7f39826 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 3 Sep 2025 14:48:08 +0800 Subject: [PATCH] fix(Professional term): When the list is empty, there is no new button below --- .../src/views/system/professional/index.vue | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/frontend/src/views/system/professional/index.vue b/frontend/src/views/system/professional/index.vue index 0fe210d6..3cada580 100644 --- a/frontend/src/views/system/professional/index.vue +++ b/frontend/src/views/system/professional/index.vue @@ -149,7 +149,7 @@ const handleSelectionChange = (val: any[]) => { const arr = fieldList.value.filter(selectable) const ids = arr.map((ele: any) => ele.id) multipleSelectionAll.value = [ - ...multipleSelectionAll.value.filter((ele) => !ids.includes(ele.id)), + ...multipleSelectionAll.value.filter((ele: any) => !ids.includes(ele.id)), ...val, ] isIndeterminate.value = !(val.length === 0 || val.length === arr.length) @@ -222,7 +222,7 @@ const rules = { const saveHandler = () => { termFormRef.value.validate((res: any) => { if (res) { - const arr = [...pageForm.value.other_words.filter((ele) => !!ele), pageForm.value.word] + const arr = [...pageForm.value.other_words.filter((ele: any) => !!ele), pageForm.value.word] if (arr.length !== new Set(arr).size) { return ElMessage.error(t('professional.cannot_be_repeated')) } @@ -252,6 +252,9 @@ const editHandler = (row: any) => { pageForm.value.id = null if (row) { pageForm.value = cloneDeep(row) + if (!pageForm.value.other_words.length) { + pageForm.value.other_words = [''] + } } dialogTitle.value = row?.id ? t('professional.editing_terminology') @@ -336,23 +339,7 @@ const deleteHandlerItem = (idx: number) => { class="table-content" :class="multipleSelectionAll?.length && 'show-pagination_height'" > - -
+