From f43c7132f8493b174d43bf2a3490abf3f53c8dbb Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 3 Dec 2025 10:27:59 +0800 Subject: [PATCH] fix(Data Source): The relationship management fields in the table should be consistent with the table structure fields. --- frontend/src/i18n/en.json | 6 ++++-- frontend/src/i18n/ko-KR.json | 6 ++++-- frontend/src/i18n/zh-CN.json | 6 ++++-- frontend/src/views/ds/DataTable.vue | 21 ++++++++++++++++++++- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index b3be84845..f3f80f18a 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -26,7 +26,9 @@ "edit_prompt_word": "Edit prompt word", "all_236_terms": "Export all {msg} {type} prompt records?", "export_hint": "Export all {type} prompts?", - "prompt_word_name_de": "Do you want to delete the prompt word: {msg}?" + "prompt_word_name_de": "Do you want to delete the prompt word: {msg}?", + "disable_field": "Disable Field", + "to_disable_it": "This field has a configured table relationship. If disabled, the relationship will be invalid. Are you sure you want to disable it?" }, "training": { "effective_data_sources": "Effective data sources", @@ -798,4 +800,4 @@ "modelType": { "llm": "Large Language Model" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index c4e9dd6c5..44a222ea5 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -26,7 +26,9 @@ "edit_prompt_word": "프롬프트 편집", "all_236_terms": "모든 {msg}개의 {type} 프롬프트 기록을 내보내시겠습니까?", "export_hint": "모든 {type} 프롬프트를 내보내시겠습니까?", - "prompt_word_name_de": "프롬프트를 삭제하시겠습니까: {msg}?" + "prompt_word_name_de": "프롬프트를 삭제하시겠습니까: {msg}?", + "disable_field": "필드 비활성화", + "to_disable_it": "이 필드에는 테이블 관계가 설정되어 있습니다. 비활성화하면 관계가 유효하지 않게 됩니다. 비활성화하시겠습니까?" }, "training": { "effective_data_sources": "유효한 데이터 소스", @@ -798,4 +800,4 @@ "modelType": { "llm": "대형 언어 모델" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index ca81c7bc1..0ab611971 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -26,7 +26,9 @@ "edit_prompt_word": "编辑提示词", "all_236_terms": "是否导出全部 {msg} 条{type}提示词?", "export_hint": "是否导出全部{type}提示词?", - "prompt_word_name_de": "是否删除提示词:{msg}?" + "prompt_word_name_de": "是否删除提示词:{msg}?", + "disable_field": "禁用字段", + "to_disable_it": "该字段已配置表关联关系,若禁用后,关联关系将失效,确定禁用?" }, "training": { "effective_data_sources": "生效数据源", @@ -798,4 +800,4 @@ "modelType": { "llm": "大语言模型" } -} +} \ No newline at end of file diff --git a/frontend/src/views/ds/DataTable.vue b/frontend/src/views/ds/DataTable.vue index 6c3d73358..5034a4238 100644 --- a/frontend/src/views/ds/DataTable.vue +++ b/frontend/src/views/ds/DataTable.vue @@ -211,7 +211,7 @@ const editField = (row: any) => { fieldDialog.value = true } -const changeStatus = (row: any) => { +const setStatus = (row: any) => { currentField.value = row datasourceApi.saveField(currentField.value).then(() => { closeField() @@ -223,6 +223,25 @@ const changeStatus = (row: any) => { }) } +const changeStatus = (row: any) => { + if (!row.checked) { + row.checked = true + ElMessageBox.confirm(t('prompt.disable_field'), { + type: 'warning', + confirmButtonType: 'primary', + tip: t('prompt.to_disable_it'), + confirmButtonText: t('common.confirm2'), + cancelButtonText: t('common.cancel'), + autofocus: false, + }).then(() => { + row.checked = false + setStatus(row) + }) + return + } + setStatus(row) +} + const emits = defineEmits(['back', 'refresh']) const back = () => { emits('back')