Browse Source

[Fix][UI Next][V1.0.0-Alpha] Add the hover tips for the datasource ta… (#8977)

* [Fix][UI Next][V1.0.0-Alpha] Add the hover tips for the datasource table action buttons.

* [Fix][UI Next][V1.0.0-Alpha] Remove the unused paramter for the datasource table operation column render function.
3.0.0/version-upgrade
Amy0104 3 years ago committed by GitHub
parent
commit
a485771a73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  2. 1
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  3. 94
      dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts

1
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@ -1157,6 +1157,7 @@ const datasource = {
click_to_view: 'Click to view', click_to_view: 'Click to view',
delete: 'Delete', delete: 'Delete',
confirm: 'Confirm', confirm: 'Confirm',
delete_confirm: 'Delete?',
cancel: 'Cancel', cancel: 'Cancel',
create: 'Create', create: 'Create',
edit: 'Edit', edit: 'Edit',

1
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@ -1144,6 +1144,7 @@ const datasource = {
click_to_view: '点击查看', click_to_view: '点击查看',
delete: '删除', delete: '删除',
confirm: '确定', confirm: '确定',
delete_confirm: '删除?',
cancel: '取消', cancel: '取消',
create: '创建', create: '创建',
edit: '编辑', edit: '编辑',

94
dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts

@ -17,7 +17,14 @@
import { h } from 'vue' import { h } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { NPopover, NButton, NIcon, NPopconfirm, NSpace } from 'naive-ui' import {
NPopover,
NButton,
NIcon,
NPopconfirm,
NSpace,
NTooltip
} from 'naive-ui'
import { EditOutlined, DeleteOutlined } from '@vicons/antd' import { EditOutlined, DeleteOutlined } from '@vicons/antd'
import JsonHighlight from './json-highlight' import JsonHighlight from './json-highlight'
import ButtonLink from '@/components/button-link' import ButtonLink from '@/components/button-link'
@ -78,45 +85,56 @@ export function useColumns(onCallback: Function) {
title: t('datasource.operation'), title: t('datasource.operation'),
key: 'operation', key: 'operation',
width: 150, width: 150,
render: (rowData, unused) => { render: (rowData) => {
return h(NSpace, null, { return h(NSpace, null, {
default: () => [ default: () => [
h( h(NTooltip, null, {
NButton, trigger: () =>
{ h(
circle: true, NButton,
type: 'info', {
onClick: () => void onCallback(rowData.id, 'edit') circle: true,
}, type: 'info',
{ onClick: () => void onCallback(rowData.id, 'edit')
default: () => },
h(NIcon, null, { default: () => h(EditOutlined) }) {
} default: () =>
), h(NIcon, null, { default: () => h(EditOutlined) })
h( }
NPopconfirm, ),
{ default: () => t('datasource.edit')
onPositiveClick: () => void onCallback(rowData.id, 'delete'), }),
negativeText: t('datasource.cancel'), h(NTooltip, null, {
positiveText: t('datasource.confirm') trigger: () =>
}, h(
{ NPopconfirm,
trigger: () => {
h( onPositiveClick: () =>
NButton, void onCallback(rowData.id, 'delete'),
{ negativeText: t('datasource.cancel'),
circle: true, positiveText: t('datasource.confirm')
type: 'error', },
class: 'btn-delete' {
}, trigger: () =>
{ h(
default: () => NButton,
h(NIcon, null, { default: () => h(DeleteOutlined) }) {
} circle: true,
), type: 'error',
default: () => t('datasource.delete') class: 'btn-delete'
} },
) {
default: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
}
),
default: () => t('datasource.delete_confirm')
}
),
default: () => t('datasource.delete')
})
] ]
}) })
} }

Loading…
Cancel
Save