release: update 3.6.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from "vue-router";
|
||||
import { cloneDeep } from "lodash-unified";
|
||||
import SearchResult from "./SearchResult.vue";
|
||||
import SearchFooter from "./SearchFooter.vue";
|
||||
import { useNav } from "/@/layout/hooks/useNav";
|
||||
@@ -31,7 +32,7 @@ const handleSearch = useDebounceFn(search, 300);
|
||||
|
||||
/** 菜单树形结构 */
|
||||
const menusData = computed(() => {
|
||||
return deleteChildren(usePermissionStoreHook().menusTree);
|
||||
return deleteChildren(cloneDeep(usePermissionStoreHook().wholeMenus));
|
||||
});
|
||||
|
||||
const show = computed({
|
||||
|
@@ -14,6 +14,7 @@ import panel from "../panel/index.vue";
|
||||
import { emitter } from "/@/utils/mitt";
|
||||
import { resetRouter } from "/@/router";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import { removeToken } from "/@/utils/auth";
|
||||
import { routerArrays } from "/@/layout/types";
|
||||
import { useNav } from "/@/layout/hooks/useNav";
|
||||
import { useAppStoreHook } from "/@/store/modules/app";
|
||||
@@ -131,7 +132,7 @@ const multiTagsCacheChange = () => {
|
||||
|
||||
/** 清空缓存并返回登录页 */
|
||||
function onReset() {
|
||||
router.push("/login");
|
||||
removeToken();
|
||||
storageLocal.clear();
|
||||
storageSession.clear();
|
||||
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
|
||||
@@ -140,6 +141,7 @@ function onReset() {
|
||||
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
|
||||
toggleClass(Grey, "html-grey", document.querySelector("html"));
|
||||
toggleClass(Weak, "html-weakness", document.querySelector("html"));
|
||||
router.push("/login");
|
||||
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
|
||||
resetRouter();
|
||||
}
|
||||
|
@@ -51,6 +51,12 @@ const { title } = useNav();
|
||||
margin-top: 5px;
|
||||
|
||||
.sidebar-title {
|
||||
display: block;
|
||||
width: 160px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
color: #1890ff;
|
||||
font-weight: 600;
|
||||
font-size: 20px;
|
||||
|
@@ -48,7 +48,7 @@ nextTick(() => {
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.path,
|
||||
() => [route.path, usePermissionStoreHook().wholeMenus],
|
||||
() => {
|
||||
getDefaultActive(route.path);
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ const menuData = computed(() => {
|
||||
: usePermissionStoreHook().wholeMenus;
|
||||
});
|
||||
|
||||
function getSubMenuData(path) {
|
||||
function getSubMenuData(path: string) {
|
||||
// path的上级路由组成的数组
|
||||
const parentPathArr = getParentPaths(
|
||||
path,
|
||||
@@ -41,6 +41,7 @@ function getSubMenuData(path) {
|
||||
if (!parenetRoute?.children) return;
|
||||
subMenuData.value = parenetRoute?.children;
|
||||
}
|
||||
|
||||
getSubMenuData(route.path);
|
||||
|
||||
onBeforeMount(() => {
|
||||
@@ -50,7 +51,7 @@ onBeforeMount(() => {
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.path,
|
||||
() => [route.path, usePermissionStoreHook().wholeMenus],
|
||||
() => {
|
||||
getSubMenuData(route.path);
|
||||
menuSelect(route.path, routers);
|
||||
|
@@ -1,26 +1,25 @@
|
||||
import { computed } from "vue";
|
||||
import { router } from "/@/router";
|
||||
import { getConfig } from "/@/config";
|
||||
import { useRouter } from "vue-router";
|
||||
import { emitter } from "/@/utils/mitt";
|
||||
import { routeMetaType } from "../types";
|
||||
import type { StorageConfigs } from "/#/index";
|
||||
import { routerArrays } from "/@/layout/types";
|
||||
import { useGlobal } from "@pureadmin/utils";
|
||||
import { transformI18n } from "/@/plugins/i18n";
|
||||
import { router, remainingPaths } from "/@/router";
|
||||
import { useAppStoreHook } from "/@/store/modules/app";
|
||||
import { remainingPaths, resetRouter } from "/@/router";
|
||||
import { storageSession, useGlobal } from "@pureadmin/utils";
|
||||
import { useUserStoreHook } from "/@/store/modules/user";
|
||||
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
|
||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
|
||||
|
||||
const errorInfo = "当前路由配置不正确,请检查配置";
|
||||
|
||||
export function useNav() {
|
||||
const pureApp = useAppStoreHook();
|
||||
const routers = useRouter().options.routes;
|
||||
|
||||
/** 用户名 */
|
||||
const username: string =
|
||||
storageSession.getItem<StorageConfigs>("info")?.username;
|
||||
const username = computed(() => {
|
||||
return useUserStoreHook()?.username;
|
||||
});
|
||||
|
||||
/** 设置国际化选中后的样式 */
|
||||
const getDropdownItemStyle = computed(() => {
|
||||
@@ -39,7 +38,7 @@ export function useNav() {
|
||||
});
|
||||
|
||||
const avatarsStyle = computed(() => {
|
||||
return username ? { marginRight: "10px" } : "";
|
||||
return username.value ? { marginRight: "10px" } : "";
|
||||
});
|
||||
|
||||
const isCollapse = computed(() => {
|
||||
@@ -68,10 +67,7 @@ export function useNav() {
|
||||
|
||||
/** 退出登录 */
|
||||
function logout() {
|
||||
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
|
||||
storageSession.removeItem("info");
|
||||
router.push("/login");
|
||||
resetRouter();
|
||||
useUserStoreHook().logOut();
|
||||
}
|
||||
|
||||
function backHome() {
|
||||
|
@@ -14,7 +14,7 @@ export type routeMetaType = {
|
||||
icon?: string;
|
||||
showLink?: boolean;
|
||||
savedPosition?: boolean;
|
||||
authority?: Array<string>;
|
||||
auths?: Array<string>;
|
||||
};
|
||||
|
||||
export type RouteConfigs = {
|
||||
|
Reference in New Issue
Block a user