|
|
|
@ -9,7 +9,6 @@ import { Icon } from '@/components/Icon'
|
|
|
|
|
|
|
|
|
|
import { useDesign } from '@/hooks/web/useDesign' |
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n' |
|
|
|
|
import { useMultipleTabSetting } from '@/hooks/setting/useMultipleTabSetting' |
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'TabContent' }) |
|
|
|
|
|
|
|
|
@ -30,25 +29,10 @@ const getTitle = computed(() => {
|
|
|
|
|
|
|
|
|
|
const getIsTabs = computed(() => !props.isExtra) |
|
|
|
|
|
|
|
|
|
const prefixIconType = computed(() => { |
|
|
|
|
if (props.tabItem.meta.icon) |
|
|
|
|
return props.tabItem.meta.icon |
|
|
|
|
else if (props.tabItem.path === '/dashboard/analysis') |
|
|
|
|
return 'ant-design:home-outlined' |
|
|
|
|
else |
|
|
|
|
return 'ant-design:code' |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const getTrigger = computed((): ('contextmenu' | 'click' | 'hover')[] => (unref(getIsTabs) ? ['contextmenu'] : ['click'])) |
|
|
|
|
|
|
|
|
|
const { getDropMenuList, handleMenuEvent, handleContextMenu } = useTabDropdown(props as TabContentProps, getIsTabs) |
|
|
|
|
|
|
|
|
|
const { getShowMultipleTabIcon } = useMultipleTabSetting() |
|
|
|
|
|
|
|
|
|
const getShowTabsIcon = computed(() => { |
|
|
|
|
return unref(getShowMultipleTabIcon) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function handleContext(e) { |
|
|
|
|
props.tabItem && handleContextMenu(props.tabItem)(e) |
|
|
|
|
} |
|
|
|
@ -63,9 +47,6 @@ function handleContext(e) {
|
|
|
|
|
@menu-event="handleMenuEvent" |
|
|
|
|
> |
|
|
|
|
<div v-if="getIsTabs" :class="`${prefixCls}__info`" @contextmenu="handleContext"> |
|
|
|
|
<span v-if="getShowTabsIcon" :class="`${prefixCls}__prefix-icon`" @click="handleContext"> |
|
|
|
|
<Icon :icon="prefixIconType" /> |
|
|
|
|
</span> |
|
|
|
|
<span class="ml-1">{{ getTitle }}</span> |
|
|
|
|
</div> |
|
|
|
|
<span v-else :class="`${prefixCls}__extra-quick`" @click="handleContext"> |
|
|
|
|