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