|
|
|
@ -3,13 +3,19 @@
|
|
|
|
|
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
|
|
|
|
|
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
|
|
|
|
|
<PopConfirmButton v-bind="action">
|
|
|
|
|
<RenderComponent v-if="action.isCustomIcon" :renderProp="action.icon" />
|
|
|
|
|
<template v-else>
|
|
|
|
|
<Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" />
|
|
|
|
|
<template v-if="action.label">{{ action.label }}</template>
|
|
|
|
|
</template>
|
|
|
|
|
</PopConfirmButton>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
<PopConfirmButton v-else v-bind="action">
|
|
|
|
|
<RenderComponent v-if="action.isCustomIcon" :renderProp="action.icon" />
|
|
|
|
|
<template v-else>
|
|
|
|
|
<Icon v-if="action.icon" :icon="action.icon" :class="{ 'mr-1': !!action.label }" />
|
|
|
|
|
<template v-if="action.label">{{ action.label }}</template>
|
|
|
|
|
</template>
|
|
|
|
|
</PopConfirmButton>
|
|
|
|
|
<Divider
|
|
|
|
|
v-if="divider && index < getActions.length - 1"
|
|
|
|
@ -37,6 +43,7 @@
|
|
|
|
|
import Icon from '/@/components/Icon/index'
|
|
|
|
|
import { ActionItem, TableActionType } from '/@/components/Table'
|
|
|
|
|
import { PopConfirmButton } from '/@/components/Button'
|
|
|
|
|
import RenderComponent from './RenderComponent.vue'
|
|
|
|
|
import { Dropdown } from '/@/components/Dropdown'
|
|
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'
|
|
|
|
|
import { useTableContext } from '../hooks/useTableContext'
|
|
|
|
@ -47,7 +54,15 @@
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'TableAction',
|
|
|
|
|
components: { Icon, PopConfirmButton, Divider, Dropdown, MoreOutlined, Tooltip },
|
|
|
|
|
components: {
|
|
|
|
|
Icon,
|
|
|
|
|
PopConfirmButton,
|
|
|
|
|
Divider,
|
|
|
|
|
Dropdown,
|
|
|
|
|
MoreOutlined,
|
|
|
|
|
Tooltip,
|
|
|
|
|
RenderComponent,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
actions: {
|
|
|
|
|
type: Array as PropType<ActionItem[]>,
|
|
|
|
|