Browse Source

fix: Fix some mistakes in the datasource (#12775)

* fix: Fix some mistakes in the datasource

* fix: delete useless console
labbomb 2 years ago
parent
commit
d6fb46b682

+ 1 - 0
dolphinscheduler-ui/src/locales/en_US/datasource.ts

@@ -19,6 +19,7 @@ export default {
   datasource: 'DataSource',
   create_datasource: 'Create DataSource',
   choose_datasource_type: 'Choose DataSource Type',
+  select: 'Select',
   search_input_tips: 'Please input the keywords',
   datasource_name: 'Datasource Name',
   datasource_name_tips: 'Please enter datasource name',

+ 1 - 0
dolphinscheduler-ui/src/locales/zh_CN/datasource.ts

@@ -19,6 +19,7 @@ export default {
   datasource: '数据源',
   create_datasource: '创建源',
   choose_datasource_type: '选择源类型',
+  select: '更改',
   search_input_tips: '请输入关键字',
   datasource_name: '源名称',
   datasource_name_tips: '请输入数据源名称',

+ 1 - 1
dolphinscheduler-ui/src/views/datasource/list/detail.tsx

@@ -199,7 +199,7 @@ const DetailModal = defineComponent({
                 >
                   <div class={[styles.typeBox, !!id && styles.disabledBox]}>
                     <div v-model={[detailForm.type, 'value']}>{detailForm.label}</div>
-                    <div class={[styles['text-color'], 'btn-data-source-type-drop-down']} onClick={handleSourceModalOpen}>更换</div>
+                    <div class={[styles['text-color'], 'btn-data-source-type-drop-down']} onClick={handleSourceModalOpen}>{t('datasource.select')}</div>
                   </div>
                 </NFormItem>
                 <NFormItem

+ 2 - 1
dolphinscheduler-ui/src/views/datasource/list/index.tsx

@@ -56,10 +56,11 @@ const list = defineComponent({
     const { data, changePage, changePageSize, deleteRecord, updateList } =
       useTable()
 
-    const { getColumns } = useColumns((id: number, type: 'edit' | 'delete') => {
+    const { getColumns } = useColumns((id: number, type: 'edit' | 'delete', row?: any) => {
       if (type === 'edit') {
         showDetailModal.value = true
         selectId.value = id
+        selectType.value = row.type
       } else {
         deleteRecord(id)
       }

+ 1 - 1
dolphinscheduler-ui/src/views/datasource/list/use-columns.ts

@@ -118,7 +118,7 @@ export function useColumns(onCallback: Function) {
                       circle: true,
                       type: 'info',
                       size: 'small',
-                      onClick: () => void onCallback(rowData.id, 'edit')
+                      onClick: () => void onCallback(rowData.id, 'edit', rowData)
                     },
                     {
                       default: () =>