Skip to content

Commit 36d637f

Browse files
committed
fix(Data Source): The relationship management fields in the table should be consistent with the table structure fields.
1 parent 4ca1adb commit 36d637f

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

frontend/src/i18n/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"edit_prompt_word": "Edit prompt word",
2727
"all_236_terms": "Export all {msg} {type} prompt records?",
2828
"export_hint": "Export all {type} prompts?",
29-
"prompt_word_name_de": "Do you want to delete the prompt word: {msg}?"
29+
"prompt_word_name_de": "Do you want to delete the prompt word: {msg}?",
30+
"disable_field": "Disable Field",
31+
"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?"
3032
},
3133
"training": {
3234
"effective_data_sources": "Effective data sources",
@@ -798,4 +800,4 @@
798800
"modelType": {
799801
"llm": "Large Language Model"
800802
}
801-
}
803+
}

frontend/src/i18n/ko-KR.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"edit_prompt_word": "프롬프트 편집",
2727
"all_236_terms": "모든 {msg}개의 {type} 프롬프트 기록을 내보내시겠습니까?",
2828
"export_hint": "모든 {type} 프롬프트를 내보내시겠습니까?",
29-
"prompt_word_name_de": "프롬프트를 삭제하시겠습니까: {msg}?"
29+
"prompt_word_name_de": "프롬프트를 삭제하시겠습니까: {msg}?",
30+
"disable_field": "필드 비활성화",
31+
"to_disable_it": "이 필드에는 테이블 관계가 설정되어 있습니다. 비활성화하면 관계가 유효하지 않게 됩니다. 비활성화하시겠습니까?"
3032
},
3133
"training": {
3234
"effective_data_sources": "유효한 데이터 소스",
@@ -798,4 +800,4 @@
798800
"modelType": {
799801
"llm": "대형 언어 모델"
800802
}
801-
}
803+
}

frontend/src/i18n/zh-CN.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"edit_prompt_word": "编辑提示词",
2727
"all_236_terms": "是否导出全部 {msg} 条{type}提示词?",
2828
"export_hint": "是否导出全部{type}提示词?",
29-
"prompt_word_name_de": "是否删除提示词:{msg}?"
29+
"prompt_word_name_de": "是否删除提示词:{msg}?",
30+
"disable_field": "禁用字段",
31+
"to_disable_it": "该字段已配置表关联关系,若禁用后,关联关系将失效,确定禁用?"
3032
},
3133
"training": {
3234
"effective_data_sources": "生效数据源",
@@ -798,4 +800,4 @@
798800
"modelType": {
799801
"llm": "大语言模型"
800802
}
801-
}
803+
}

frontend/src/views/ds/DataTable.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const editField = (row: any) => {
211211
fieldDialog.value = true
212212
}
213213
214-
const changeStatus = (row: any) => {
214+
const setStatus = (row: any) => {
215215
currentField.value = row
216216
datasourceApi.saveField(currentField.value).then(() => {
217217
closeField()
@@ -223,6 +223,25 @@ const changeStatus = (row: any) => {
223223
})
224224
}
225225
226+
const changeStatus = (row: any) => {
227+
if (!row.checked) {
228+
row.checked = true
229+
ElMessageBox.confirm(t('prompt.disable_field'), {
230+
type: 'warning',
231+
confirmButtonType: 'primary',
232+
tip: t('prompt.to_disable_it'),
233+
confirmButtonText: t('common.confirm2'),
234+
cancelButtonText: t('common.cancel'),
235+
autofocus: false,
236+
}).then(() => {
237+
row.checked = false
238+
setStatus(row)
239+
})
240+
return
241+
}
242+
setStatus(row)
243+
}
244+
226245
const emits = defineEmits(['back', 'refresh'])
227246
const back = () => {
228247
emits('back')

0 commit comments

Comments
 (0)