|
@@ -19,9 +19,8 @@ import _ from 'lodash'
|
|
|
import { h, ref, reactive } from 'vue'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
-import type { Router } from 'vue-router'
|
|
|
-import type { TableColumns, RowKey } from 'naive-ui/es/data-table/src/interface'
|
|
|
import { useAsyncState } from '@vueuse/core'
|
|
|
+import { useTextCopy } from '../components/dag/use-text-copy'
|
|
|
import {
|
|
|
batchCopyByCodes,
|
|
|
batchDeleteByCodes,
|
|
@@ -32,7 +31,8 @@ import {
|
|
|
} from '@/service/modules/process-definition'
|
|
|
import TableAction from './components/table-action'
|
|
|
import styles from './index.module.scss'
|
|
|
-import { NTag } from 'naive-ui'
|
|
|
+import { NTag, NSpace, NIcon, NButton, NEllipsis } from 'naive-ui'
|
|
|
+import { CopyOutlined } from '@vicons/antd'
|
|
|
import ButtonLink from '@/components/button-link'
|
|
|
import {
|
|
|
COLUMN_WIDTH_CONFIG,
|
|
@@ -40,11 +40,13 @@ import {
|
|
|
DefaultTableWidth
|
|
|
} from '@/utils/column-width-config'
|
|
|
import type { IDefinitionParam } from './types'
|
|
|
+import type { Router } from 'vue-router'
|
|
|
+import type { TableColumns, RowKey } from 'naive-ui/es/data-table/src/interface'
|
|
|
|
|
|
export function useTable() {
|
|
|
const { t } = useI18n()
|
|
|
const router: Router = useRouter()
|
|
|
-
|
|
|
+ const { copy } = useTextCopy()
|
|
|
const variables = reactive({
|
|
|
columns: [],
|
|
|
tableWidth: DefaultTableWidth,
|
|
@@ -82,18 +84,43 @@ export function useTable() {
|
|
|
title: t('project.workflow.workflow_name'),
|
|
|
key: 'name',
|
|
|
className: 'workflow-name',
|
|
|
- ...COLUMN_WIDTH_CONFIG['name'],
|
|
|
+ width: 200,
|
|
|
render: (row) =>
|
|
|
h(
|
|
|
- ButtonLink,
|
|
|
+ NSpace,
|
|
|
{
|
|
|
- onClick: () =>
|
|
|
- void router.push({
|
|
|
- name: 'workflow-definition-detail',
|
|
|
- params: { code: row.code }
|
|
|
- })
|
|
|
+ justify: 'space-between',
|
|
|
+ wrap: false,
|
|
|
+ class: styles['workflow-name']
|
|
|
},
|
|
|
- { default: () => row.name }
|
|
|
+ {
|
|
|
+ default: () => [
|
|
|
+ h(
|
|
|
+ ButtonLink,
|
|
|
+ {
|
|
|
+ onClick: () =>
|
|
|
+ void router.push({
|
|
|
+ name: 'workflow-definition-detail',
|
|
|
+ params: { code: row.code }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ {
|
|
|
+ default: () => h(NEllipsis, null, () => row.name)
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ NButton,
|
|
|
+ {
|
|
|
+ quaternary: true,
|
|
|
+ circle: true,
|
|
|
+ type: 'info',
|
|
|
+ size: 'tiny',
|
|
|
+ onClick: () => void copy(row.name)
|
|
|
+ },
|
|
|
+ { icon: () => h(NIcon, { size: 16 }, () => h(CopyOutlined)) }
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ }
|
|
|
)
|
|
|
},
|
|
|
{
|