mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
v3.8.2 版本前端代码
This commit is contained in:
@ -35,7 +35,7 @@
|
||||
// components
|
||||
import { Dropdown, Menu } from 'ant-design-vue';
|
||||
|
||||
import { defineComponent, computed, ref } from 'vue';
|
||||
import { defineComponent, computed, ref, nextTick } from 'vue';
|
||||
|
||||
import { SITE_URL } from '/@/settings/siteSetting';
|
||||
|
||||
@ -57,9 +57,9 @@
|
||||
import { removeAuthCache, setAuthCache } from '/src/utils/auth';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { getRefPromise } from '/@/utils/index';
|
||||
import { refreshDragCache } from "@/api/common/api";
|
||||
import { refreshDragCache, refreshHomeCache } from "@/api/common/api";
|
||||
|
||||
type MenuEvent = 'logout' | 'doc' | 'lock' | 'cache' | 'depart';
|
||||
type MenuEvent = 'logout' | 'doc' | 'lock' | 'cache' | 'depart' | 'defaultHomePage' | 'password' | 'account';
|
||||
const { createMessage } = useMessage();
|
||||
export default defineComponent({
|
||||
name: 'UserDropdown',
|
||||
@ -82,6 +82,7 @@
|
||||
const userStore = useUserStore();
|
||||
const go = useGo();
|
||||
const passwordVisible = ref(false);
|
||||
const homeSelectVisible = ref(false);
|
||||
const lockActionVisible = ref(false);
|
||||
const lockActionRef = ref(null);
|
||||
|
||||
@ -123,9 +124,8 @@
|
||||
// 清除缓存
|
||||
async function clearCache() {
|
||||
const result = await refreshCache();
|
||||
//TODO 当前版本还不支持刷新缓存,需要等jimibi升级
|
||||
// const dragRes = await refreshDragCache();
|
||||
// console.log('dragRes', dragRes);
|
||||
const dragRes = await refreshDragCache();
|
||||
console.log('dragRes', dragRes);
|
||||
if (result.success) {
|
||||
const res = await queryAllDictItems();
|
||||
removeAuthCache(DB_DICT_DATA_KEY);
|
||||
@ -255,4 +255,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20250702---for:【QQYUN-13013】切换到英文模式下拉菜单宽度有点窄
|
||||
html[lang="en"] {
|
||||
.@{prefix-cls} {
|
||||
&-dropdown-overlay {
|
||||
width: 175px;
|
||||
}
|
||||
}
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20250702---for:【QQYUN-13013】切换到英文模式下拉菜单宽度有点窄
|
||||
</style>
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
import { useTabDropdown } from '../useTabDropdown';
|
||||
import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting';
|
||||
import { useLocaleStore } from '/@/store/modules/locale';
|
||||
import { PageEnum } from '/@/enums/pageEnum';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TabContent',
|
||||
@ -61,7 +62,7 @@
|
||||
const prefixIconType = computed(() => {
|
||||
if (props.tabItem.meta.icon) {
|
||||
return props.tabItem.meta.icon;
|
||||
} else if (props.tabItem.path === '/dashboard/analysis') {
|
||||
} else if (props.tabItem.path === PageEnum.BASE_HOME) {
|
||||
// 当是首页时返回 home 图标 TODO 此处可能需要动态判断首页路径
|
||||
return 'ant-design:home-outlined';
|
||||
} else {
|
||||
|
||||
65
jeecgboot-vue3/src/layouts/default/tabs/useHideHomeDesign.ts
Normal file
65
jeecgboot-vue3/src/layouts/default/tabs/useHideHomeDesign.ts
Normal file
@ -0,0 +1,65 @@
|
||||
import { ref } from 'vue';
|
||||
import { getMenus } from '/@/router/menus';
|
||||
|
||||
export const useHideHomeDesign = (currentRoute) => {
|
||||
let menus: any = [];
|
||||
// 是否隐藏门户设计
|
||||
const isHideHomeDesign = ref(true);
|
||||
const getHideHomeDesign = (isCurItem, path) => {
|
||||
if (/^\/portal-view\/[^/]+$/.test(path) && isCurItem) {
|
||||
if (['/portal-view/system', '/portal-view/template'].includes(path)) {
|
||||
// 主门户、模板门户 (需要检查是否存在设计列表,存在则显示门户设计,不存在则隐藏门户设计)
|
||||
getIsHasPortalDesignList();
|
||||
} else if (['/portal-view/default'].includes(path)) {
|
||||
// 设计器打开的预览需隐藏设计模式
|
||||
isHideHomeDesign.value = true;
|
||||
} else {
|
||||
// 个人工作台或者普通门户都可显示门户设计
|
||||
isHideHomeDesign.value = false;
|
||||
}
|
||||
} else {
|
||||
// 非门户页面隐藏门户设计
|
||||
isHideHomeDesign.value = true;
|
||||
}
|
||||
};
|
||||
const getMenusContainPath = async (ptah) => {
|
||||
if (!menus.length) {
|
||||
menus = await getMenus();
|
||||
}
|
||||
const result = getMatchingRouterName(menus, ptah);
|
||||
return !!result;
|
||||
};
|
||||
const getIsHasPortalDesignList = async () => {
|
||||
if (['/portal-view/system', '/portal-view/template'].includes(currentRoute.value.path)) {
|
||||
// 主门户、模板门户时才需要查询菜单中是否有portalDesignList
|
||||
getMenusContainPath('/super/eoa/portalapp/portalDesignList').then((result) => {
|
||||
isHideHomeDesign.value = !result;
|
||||
});
|
||||
}
|
||||
};
|
||||
getIsHasPortalDesignList();
|
||||
return {
|
||||
getHideHomeDesign,
|
||||
isHideHomeDesign,
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* 20250701
|
||||
* liaozhiyang
|
||||
* 通过path匹配菜单中的项
|
||||
* */
|
||||
function getMatchingRouterName(menus, path) {
|
||||
for (let i = 0, len = menus.length; i < len; i++) {
|
||||
const item = menus[i];
|
||||
if (item.path === path && !item.redirect && !item.paramPath) {
|
||||
return item;
|
||||
} else if (item.children?.length) {
|
||||
const result = getMatchingRouterName(item.children, path);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -8,6 +8,7 @@ import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import { RouteLocationNormalized, useRouter } from 'vue-router';
|
||||
import { useTabs } from '/@/hooks/web/useTabs';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useHideHomeDesign } from './useHideHomeDesign';
|
||||
|
||||
export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: ComputedRef<boolean>) {
|
||||
const state = reactive({
|
||||
@ -23,6 +24,10 @@ export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: Comp
|
||||
const getTargetTab = computed((): RouteLocationNormalized => {
|
||||
return unref(getIsTabs) ? tabContentProps.tabItem : unref(currentRoute);
|
||||
});
|
||||
// update-begin--author:liaozhiyang---date:20250701---for:【QQYUN-12994】门户
|
||||
// 隐藏下拉菜单中的门户设计项
|
||||
const { getHideHomeDesign, isHideHomeDesign } = useHideHomeDesign(currentRoute);
|
||||
// update-end--author:liaozhiyang---date:20250701---for:【QQYUN-12994】门户
|
||||
|
||||
/**
|
||||
* @description: drop-down list
|
||||
@ -65,6 +70,10 @@ export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: Comp
|
||||
// Close right
|
||||
const closeRightDisabled = index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0;
|
||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
// update-begin--author:liaozhiyang---date:20250701---for:【QQYUN-12994】门户
|
||||
// 隐藏下拉菜单中的门户设计项
|
||||
getHideHomeDesign(isCurItem, path);
|
||||
// update-end--author:liaozhiyang---date:20250701---for:【QQYUN-12994】门户
|
||||
const dropMenuList: DropMenu[] = [
|
||||
{
|
||||
icon: 'jam:refresh-reverse',
|
||||
@ -76,7 +85,8 @@ export function useTabDropdown(tabContentProps: TabContentProps, getIsTabs: Comp
|
||||
icon: 'ant-design:setting-outlined',
|
||||
event: MenuEventEnum.HOME_DESIGN,
|
||||
text: t('layout.multipleTab.homeDesign'),
|
||||
disabled: path !== '/PortalView',
|
||||
disabled: !/^\/portal-view\/[^/]+$/.test(path),
|
||||
hide: isHideHomeDesign.value,
|
||||
divider: true,
|
||||
},
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user