Browse Source

[Fix #9925]: fix ellipsis bug in table column (#9936)

* fix: fix ellipsis bug in table column

* fix ellipsis bug in table column
3.0.0/version-upgrade
rockfang 3 years ago committed by GitHub
parent
commit
38271cea9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-ui/src/common/column-width-config.ts
  2. 17
      dolphinscheduler-ui/src/views/projects/list/use-table.ts
  3. 23
      dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts
  4. 13
      dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts
  5. 12
      dolphinscheduler-ui/src/views/projects/workflow/instance/use-table.ts
  6. 8
      dolphinscheduler-ui/src/views/resource/file/table/use-table.ts
  7. 12
      dolphinscheduler-ui/src/views/resource/udf/resource/use-table.ts

6
dolphinscheduler-ui/src/common/column-width-config.ts

@ -28,6 +28,12 @@ export const COLUMN_WIDTH_CONFIG = {
index: { index: {
width: 50 width: 50
}, },
linkName: {
width: 200
},
linkEllipsis: {
style: 'max-width: 180px;line-height: 1.5'
},
name: { name: {
width: 200, width: 200,
ellipsis: { ellipsis: {

17
dolphinscheduler-ui/src/views/projects/list/use-table.ts

@ -76,13 +76,8 @@ export function useTable() {
title: t('project.list.project_name'), title: t('project.list.project_name'),
key: 'name', key: 'name',
className: 'project-name', className: 'project-name',
...COLUMN_WIDTH_CONFIG['name'], ...COLUMN_WIDTH_CONFIG['linkName'],
render: (row: { code: string; name: any }) => render: (row: { code: string; name: any }) =>
h(
NEllipsis,
{ style: 'max-width: 200px; color: #2080f0' },
{
default: () =>
h( h(
ButtonLink, ButtonLink,
{ {
@ -90,9 +85,13 @@ export function useTable() {
router.push({ path: `/projects/${row.code}` }) router.push({ path: `/projects/${row.code}` })
} }
}, },
{ default: () => row.name } {
), default: () =>
tooltip: () => row.name h(
NEllipsis,
COLUMN_WIDTH_CONFIG['linkEllipsis'],
() => row.name
)
} }
) )
}, },

23
dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts

@ -17,7 +17,15 @@
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue' import { reactive, h, ref } from 'vue'
import { NButton, NIcon, NPopconfirm, NSpace, NTag, NTooltip } from 'naive-ui' import {
NButton,
NIcon,
NPopconfirm,
NSpace,
NTag,
NTooltip,
NEllipsis
} from 'naive-ui'
import ButtonLink from '@/components/button-link' import ButtonLink from '@/components/button-link'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { import {
@ -58,15 +66,22 @@ export function useTable(onEdit: Function) {
{ {
title: t('project.task.task_name'), title: t('project.task.task_name'),
key: 'taskName', key: 'taskName',
...COLUMN_WIDTH_CONFIG['linkName'],
render: (row: IRecord) => render: (row: IRecord) =>
h( h(
ButtonLink, ButtonLink,
{ {
onClick: () => void onEdit(row, true) onClick: () => void onEdit(row, true)
}, },
{ default: () => row.taskName } {
), default: () =>
...COLUMN_WIDTH_CONFIG['name'] h(
NEllipsis,
COLUMN_WIDTH_CONFIG['linkEllipsis'],
() => row.taskName
)
}
)
}, },
{ {
title: t('project.task.workflow_name'), title: t('project.task.workflow_name'),

13
dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts

@ -23,7 +23,7 @@ import {
forceSuccess, forceSuccess,
downloadLog downloadLog
} from '@/service/modules/task-instances' } from '@/service/modules/task-instances'
import { NButton, NIcon, NSpace, NTooltip, NSpin } from 'naive-ui' import { NButton, NIcon, NSpace, NTooltip, NSpin, NEllipsis } from 'naive-ui'
import ButtonLink from '@/components/button-link' import ButtonLink from '@/components/button-link'
import { import {
AlignLeftOutlined, AlignLeftOutlined,
@ -86,7 +86,7 @@ export function useTable() {
{ {
title: t('project.task.workflow_instance'), title: t('project.task.workflow_instance'),
key: 'processInstanceName', key: 'processInstanceName',
...COLUMN_WIDTH_CONFIG['name'], ...COLUMN_WIDTH_CONFIG['linkName'],
render: (row: { render: (row: {
processInstanceId: number processInstanceId: number
processInstanceName: string processInstanceName: string
@ -101,7 +101,14 @@ export function useTable() {
query: { code: projectCode } query: { code: projectCode }
}) })
}, },
{ default: () => row.processInstanceName } {
default: () =>
h(
NEllipsis,
COLUMN_WIDTH_CONFIG['linkEllipsis'],
() => row.processInstanceName
)
}
) )
}, },
{ {

12
dolphinscheduler-ui/src/views/projects/workflow/instance/use-table.ts

@ -21,6 +21,7 @@ import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import ButtonLink from '@/components/button-link' import ButtonLink from '@/components/button-link'
import { RowKey } from 'naive-ui/lib/data-table/src/interface' import { RowKey } from 'naive-ui/lib/data-table/src/interface'
import { NEllipsis } from 'naive-ui'
import { import {
queryProcessInstanceListPaging, queryProcessInstanceListPaging,
deleteProcessInstanceById, deleteProcessInstanceById,
@ -79,7 +80,7 @@ export function useTable() {
{ {
title: t('project.workflow.workflow_name'), title: t('project.workflow.workflow_name'),
key: 'name', key: 'name',
...COLUMN_WIDTH_CONFIG['name'], ...COLUMN_WIDTH_CONFIG['linkName'],
className: 'workflow-name', className: 'workflow-name',
render: (row: IWorkflowInstance) => render: (row: IWorkflowInstance) =>
h( h(
@ -92,7 +93,14 @@ export function useTable() {
query: { code: row.processDefinitionCode } query: { code: row.processDefinitionCode }
}) })
}, },
{ default: () => row.name } {
default: () =>
h(
NEllipsis,
COLUMN_WIDTH_CONFIG['linkEllipsis'],
() => row.name
)
}
) )
}, },
{ {

8
dolphinscheduler-ui/src/views/resource/file/table/use-table.ts

@ -23,6 +23,7 @@ import { useFileStore } from '@/store/file/file'
import TableAction from './table-action' import TableAction from './table-action'
import { IRenameFile } from '../types' import { IRenameFile } from '../types'
import ButtonLink from '@/components/button-link' import ButtonLink from '@/components/button-link'
import { NEllipsis } from 'naive-ui'
import { import {
COLUMN_WIDTH_CONFIG, COLUMN_WIDTH_CONFIG,
calculateTableWidth, calculateTableWidth,
@ -57,14 +58,17 @@ export function useTable(renameResource: IRenameFile, updateList: () => void) {
{ {
title: t('resource.file.name'), title: t('resource.file.name'),
key: 'name', key: 'name',
...COLUMN_WIDTH_CONFIG['name'], ...COLUMN_WIDTH_CONFIG['linkName'],
render: (row) => render: (row) =>
h( h(
ButtonLink, ButtonLink,
{ {
onClick: () => void goSubFolder(router, row) onClick: () => void goSubFolder(router, row)
}, },
{ default: () => row.name } {
default: () =>
h(NEllipsis, COLUMN_WIDTH_CONFIG['linkEllipsis'], () => row.name)
}
) )
}, },
{ {

12
dolphinscheduler-ui/src/views/resource/udf/resource/use-table.ts

@ -21,6 +21,7 @@ import { useRouter } from 'vue-router'
import { bytesToSize } from '@/common/common' import { bytesToSize } from '@/common/common'
import { useFileStore } from '@/store/file/file' import { useFileStore } from '@/store/file/file'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import { NEllipsis } from 'naive-ui'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface' import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { NSpace, NTooltip, NButton, NPopconfirm } from 'naive-ui' import { NSpace, NTooltip, NButton, NPopconfirm } from 'naive-ui'
import { EditOutlined, DeleteOutlined, DownloadOutlined } from '@vicons/antd' import { EditOutlined, DeleteOutlined, DownloadOutlined } from '@vicons/antd'
@ -81,7 +82,7 @@ export function useTable() {
{ {
title: t('resource.udf.udf_source_name'), title: t('resource.udf.udf_source_name'),
key: 'alias', key: 'alias',
width: 220, ...COLUMN_WIDTH_CONFIG['linkName'],
render: (row) => { render: (row) => {
return !row.directory return !row.directory
? row.alias ? row.alias
@ -90,7 +91,14 @@ export function useTable() {
{ {
onClick: () => void goSubFolder(router, row) onClick: () => void goSubFolder(router, row)
}, },
{ default: () => row.alias } {
default: () =>
h(
NEllipsis,
COLUMN_WIDTH_CONFIG['linkEllipsis'],
() => row.alias
)
}
) )
} }
}, },

Loading…
Cancel
Save