|
|
|
@ -4,6 +4,7 @@ import { useRouter } from 'vue-router'
|
|
|
|
import type { RouteLocationNormalizedLoaded, RouterLinkProps } from 'vue-router'
|
|
|
|
import type { RouteLocationNormalizedLoaded, RouterLinkProps } from 'vue-router'
|
|
|
|
import { usePermissionStore } from '@/store/modules/permission'
|
|
|
|
import { usePermissionStore } from '@/store/modules/permission'
|
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
|
|
|
|
import { useAppStore } from '@/store/modules/app'
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
import { filterAffixTags } from './helper'
|
|
|
|
import { filterAffixTags } from './helper'
|
|
|
|
import { ContextMenu, ContextMenuExpose } from '@/components/ContextMenu'
|
|
|
|
import { ContextMenu, ContextMenuExpose } from '@/components/ContextMenu'
|
|
|
|
@ -30,6 +31,10 @@ const visitedViews = computed(() => tagsViewStore.getVisitedViews)
|
|
|
|
|
|
|
|
|
|
|
|
const affixTagArr = ref<RouteLocationNormalizedLoaded[]>([])
|
|
|
|
const affixTagArr = ref<RouteLocationNormalizedLoaded[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tagsViewIcon = computed(() => appStore.getTagsViewIcon)
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化tag
|
|
|
|
// 初始化tag
|
|
|
|
const initTags = () => {
|
|
|
|
const initTags = () => {
|
|
|
|
affixTagArr.value = filterAffixTags(unref(routers))
|
|
|
|
affixTagArr.value = filterAffixTags(unref(routers))
|
|
|
|
@ -341,6 +346,17 @@ watch(
|
|
|
|
@click="navigate"
|
|
|
|
@click="navigate"
|
|
|
|
class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
|
|
|
|
class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
|
|
item?.matched &&
|
|
|
|
|
|
|
|
item?.matched[1] &&
|
|
|
|
|
|
|
|
item?.matched[1]?.meta?.icon &&
|
|
|
|
|
|
|
|
tagsViewIcon
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
:icon="item?.matched[1]?.meta?.icon"
|
|
|
|
|
|
|
|
:size="12"
|
|
|
|
|
|
|
|
class="mr-5px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
{{ t(item?.meta?.title as string) }}
|
|
|
|
{{ t(item?.meta?.title as string) }}
|
|
|
|
<Icon
|
|
|
|
<Icon
|
|
|
|
:class="`${prefixCls}__item--close`"
|
|
|
|
:class="`${prefixCls}__item--close`"
|
|
|
|
@ -434,6 +450,7 @@ watch(
|
|
|
|
@prefix-cls: ~'@{namespace}-tags-view';
|
|
|
|
@prefix-cls: ~'@{namespace}-tags-view';
|
|
|
|
|
|
|
|
|
|
|
|
.@{prefix-cls} {
|
|
|
|
.@{prefix-cls} {
|
|
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
:deep(.@{elNamespace}-scrollbar__view) {
|
|
|
|
:deep(.@{elNamespace}-scrollbar__view) {
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|