This commit is contained in:
@@ -31,7 +31,7 @@ function handleClick(path?: string) {
|
||||
>
|
||||
<li>
|
||||
<a href="javascript:void 0" @click.stop="handleClick(item.path)">
|
||||
<span class="flex-center h-full">
|
||||
<span class="flex-center z-10 h-full">
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
:icon="item.icon"
|
||||
|
@@ -11,6 +11,7 @@ import { cn } from '@vben-core/toolkit';
|
||||
interface Props {
|
||||
class?: HTMLAttributes['class'];
|
||||
horizontal?: boolean;
|
||||
scrollBarClass?: HTMLAttributes['class'];
|
||||
shadow?: boolean;
|
||||
shadowBorder?: boolean;
|
||||
}
|
||||
@@ -58,7 +59,11 @@ function handleScroll(event: Event) {
|
||||
}"
|
||||
class="scrollbar-bottom-shadow pointer-events-none absolute bottom-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"
|
||||
></div>
|
||||
<ScrollBar v-if="horizontal" orientation="horizontal" />
|
||||
<ScrollBar
|
||||
v-if="horizontal"
|
||||
:class="scrollBarClass"
|
||||
orientation="horizontal"
|
||||
/>
|
||||
</ScrollArea>
|
||||
</template>
|
||||
|
||||
|
@@ -71,7 +71,11 @@ function scrollIntoView() {
|
||||
|
||||
<template>
|
||||
<div :style="style" class="tabs-chrome size-full flex-1 overflow-hidden pt-1">
|
||||
<VbenScrollbar class="tabs-chrome__scrollbar h-full" horizontal>
|
||||
<VbenScrollbar
|
||||
class="tabs-chrome__scrollbar h-full"
|
||||
horizontal
|
||||
scroll-bar-class="z-10"
|
||||
>
|
||||
<!-- footer -> 4px -->
|
||||
<div
|
||||
ref="contentRef"
|
||||
|
@@ -72,7 +72,11 @@ function scrollIntoView() {
|
||||
|
||||
<template>
|
||||
<div class="h-full flex-1 overflow-hidden">
|
||||
<VbenScrollbar class="tabs-scrollbar h-full" horizontal>
|
||||
<VbenScrollbar
|
||||
class="tabs-scrollbar h-full"
|
||||
horizontal
|
||||
scroll-bar-class="z-10"
|
||||
>
|
||||
<div
|
||||
:class="contentClass"
|
||||
class="relative !flex h-full w-max items-center"
|
||||
|
@@ -45,6 +45,11 @@ async function initTabsSortable() {
|
||||
|
||||
const el = document.querySelectorAll(`.${contentClass}`)?.[0] as HTMLElement;
|
||||
|
||||
const resetElState = () => {
|
||||
el.style.cursor = 'default';
|
||||
el.classList.remove('dragging');
|
||||
};
|
||||
|
||||
const { initializeSortable } = useSortable(el, {
|
||||
filter: (_evt, target: HTMLElement) => {
|
||||
const parent = findParentElement(target);
|
||||
@@ -57,16 +62,20 @@ async function initTabsSortable() {
|
||||
const { srcElement } = (evt as any).originalEvent;
|
||||
|
||||
if (!srcElement) {
|
||||
resetElState();
|
||||
return;
|
||||
}
|
||||
|
||||
const srcParent = findParentElement(srcElement);
|
||||
|
||||
if (!srcParent) {
|
||||
resetElState();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!srcParent.classList.contains('dragable')) {
|
||||
resetElState();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,8 +88,7 @@ async function initTabsSortable() {
|
||||
) {
|
||||
emit('sortTabs', oldIndex, newIndex);
|
||||
}
|
||||
el.classList.remove('dragging');
|
||||
el.style.cursor = 'default';
|
||||
resetElState();
|
||||
},
|
||||
onMove(evt) {
|
||||
const parent = findParentElement(evt.related);
|
||||
|
@@ -15,10 +15,9 @@ export function useAppConfig(
|
||||
? window._VBEN_ADMIN_PRO_APP_CONF_
|
||||
: (env as VbenAdminProAppConfigRaw);
|
||||
|
||||
const { VITE_GLOB_API_URL, VITE_GLOB_APP_TITLE } = config;
|
||||
const { VITE_GLOB_API_URL } = config;
|
||||
|
||||
return {
|
||||
apiURL: VITE_GLOB_API_URL,
|
||||
appTitle: VITE_GLOB_APP_TITLE,
|
||||
};
|
||||
}
|
||||
|
@@ -121,7 +121,10 @@ export const useCoreTabbarStore = defineStore('core-tabbar', {
|
||||
} else {
|
||||
// 页面已经存在,不重复添加选项卡,只更新选项卡参数
|
||||
const currentTab = toRaw(this.tabs)[tabIndex];
|
||||
this.tabs.splice(tabIndex, 1, { ...currentTab, ...tab });
|
||||
if (!currentTab.meta.affixTab) {
|
||||
const mergedTab = { ...currentTab, ...tab };
|
||||
this.tabs.splice(tabIndex, 1, mergedTab);
|
||||
}
|
||||
}
|
||||
this.updateCacheTab();
|
||||
},
|
||||
@@ -269,7 +272,8 @@ export const useCoreTabbarStore = defineStore('core-tabbar', {
|
||||
);
|
||||
if (index !== -1) {
|
||||
tab.meta.affixTab = true;
|
||||
this.addTab(tab);
|
||||
// this.addTab(tab);
|
||||
this.tabs.splice(index, 1, tab);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -369,7 +373,8 @@ export const useCoreTabbarStore = defineStore('core-tabbar', {
|
||||
|
||||
if (index !== -1) {
|
||||
tab.meta.affixTab = false;
|
||||
this.addTab(tab);
|
||||
// this.addTab(tab);
|
||||
this.tabs.splice(index, 1, tab);
|
||||
}
|
||||
},
|
||||
|
||||
|
2
packages/types/global.d.ts
vendored
2
packages/types/global.d.ts
vendored
@@ -8,12 +8,10 @@ declare module 'vue-router' {
|
||||
|
||||
export interface VbenAdminProAppConfigRaw {
|
||||
VITE_GLOB_API_URL: string;
|
||||
VITE_GLOB_APP_TITLE: string;
|
||||
}
|
||||
|
||||
export interface ApplicationConfig {
|
||||
apiURL: string;
|
||||
appTitle: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
Reference in New Issue
Block a user