mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-02 10:57:24 +08:00
Compare commits
3 Commits
4a87c24acd
...
b468be4f57
Author | SHA1 | Date | |
---|---|---|---|
|
b468be4f57 | ||
|
6be410a03c | ||
|
21e5387ead |
22
package.json
22
package.json
@ -83,7 +83,7 @@
|
||||
"mqtt": "4.3.7",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pinia": "^3.0.1",
|
||||
"pinia": "^3.0.2",
|
||||
"pinyin-pro": "^3.26.0",
|
||||
"plus-pro-components": "^0.1.22",
|
||||
"qrcode": "^1.5.4",
|
||||
@ -94,7 +94,7 @@
|
||||
"typeit": "^8.8.7",
|
||||
"v-contextmenu": "^3.2.0",
|
||||
"v3-infinite-loading": "^1.3.2",
|
||||
"vditor": "^3.10.9",
|
||||
"vditor": "^3.11.0",
|
||||
"version-rocket": "^1.7.4",
|
||||
"vue": "^3.5.13",
|
||||
"vue-i18n": "^11.1.3",
|
||||
@ -118,11 +118,11 @@
|
||||
"@commitlint/config-conventional": "^19.8.0",
|
||||
"@commitlint/types": "^19.8.0",
|
||||
"@eslint/js": "^9.24.0",
|
||||
"@faker-js/faker": "^9.6.0",
|
||||
"@iconify/json": "^2.2.324",
|
||||
"@faker-js/faker": "^9.7.0",
|
||||
"@iconify/json": "^2.2.329",
|
||||
"@iconify/vue": "4.2.0",
|
||||
"@intlify/unplugin-vue-i18n": "^6.0.5",
|
||||
"@tailwindcss/vite": "^4.1.3",
|
||||
"@tailwindcss/vite": "^4.1.4",
|
||||
"@types/codemirror": "^5.60.15",
|
||||
"@types/dagre": "^0.7.52",
|
||||
"@types/intro.js": "^5.1.5",
|
||||
@ -136,16 +136,16 @@
|
||||
"@vitejs/plugin-vue": "^5.2.3",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
||||
"boxen": "^8.0.1",
|
||||
"code-inspector-plugin": "^0.20.7",
|
||||
"code-inspector-plugin": "^0.20.9",
|
||||
"cssnano": "^7.0.6",
|
||||
"dagre": "^0.8.5",
|
||||
"eslint": "^9.24.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"eslint-config-prettier": "^10.1.2",
|
||||
"eslint-plugin-prettier": "^5.2.6",
|
||||
"eslint-plugin-vue": "^10.0.0",
|
||||
"gradient-string": "^3.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.5.0",
|
||||
"lint-staged": "^15.5.1",
|
||||
"postcss": "^8.5.3",
|
||||
"postcss-html": "^1.8.0",
|
||||
"postcss-load-config": "^6.0.1",
|
||||
@ -160,11 +160,11 @@
|
||||
"stylelint-config-standard-scss": "^14.0.0",
|
||||
"stylelint-prettier": "^5.0.3",
|
||||
"svgo": "^3.3.2",
|
||||
"tailwindcss": "^4.1.3",
|
||||
"tailwindcss": "^4.1.4",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.29.1",
|
||||
"typescript-eslint": "^8.30.1",
|
||||
"unplugin-icons": "^22.1.0",
|
||||
"vite": "^6.2.5",
|
||||
"vite": "^6.3.2",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-fake-server": "^2.2.0",
|
||||
|
756
pnpm-lock.yaml
generated
756
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -69,7 +69,7 @@ const textClass = computed(() => {
|
||||
isCollapse.value &&
|
||||
!toRaw(item.meta.icon) &&
|
||||
((layout.value === "vertical" && item.parentId === null) ||
|
||||
(layout.value === "mix" && item.parentId !== 0))
|
||||
(layout.value === "mix" && item.pathList.length === 2))
|
||||
) {
|
||||
return `${baseClass} min-w-[54px]! text-center! px-3!`;
|
||||
}
|
||||
|
@ -7,7 +7,13 @@ import { buildHierarchyTree } from "@/utils/tree";
|
||||
import remainingRouter from "./modules/remaining";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||
import { isUrl, openLink, storageLocal, isAllEmpty } from "@pureadmin/utils";
|
||||
import {
|
||||
isUrl,
|
||||
openLink,
|
||||
storageLocal,
|
||||
isAllEmpty,
|
||||
cloneDeep
|
||||
} from "@pureadmin/utils";
|
||||
import {
|
||||
ascending,
|
||||
getTopMenu,
|
||||
@ -55,6 +61,9 @@ export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
|
||||
formatFlatteningRoutes(buildHierarchyTree(ascending(routes.flat(Infinity))))
|
||||
);
|
||||
|
||||
/** 初始的静态路由,用来在退出登陆时重置路由 */
|
||||
const initConstantRoutes: Array<RouteRecordRaw> = cloneDeep(constantRoutes);
|
||||
|
||||
/** 用于渲染菜单,保持原始层级 */
|
||||
export const constantMenus: Array<RouteComponent> = ascending(
|
||||
routes.flat(Infinity)
|
||||
@ -87,17 +96,13 @@ export const router: Router = createRouter({
|
||||
|
||||
/** 重置路由 */
|
||||
export function resetRouter() {
|
||||
router.getRoutes().forEach(route => {
|
||||
const { name, meta } = route;
|
||||
if (name && router.hasRoute(name) && meta?.backstage) {
|
||||
router.removeRoute(name);
|
||||
router.options.routes = formatTwoStageRoutes(
|
||||
formatFlatteningRoutes(
|
||||
buildHierarchyTree(ascending(routes.flat(Infinity)))
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
router.clearRoutes();
|
||||
for (const route of initConstantRoutes.concat(...(remainingRouter as any))) {
|
||||
router.addRoute(route);
|
||||
}
|
||||
router.options.routes = formatTwoStageRoutes(
|
||||
formatFlatteningRoutes(buildHierarchyTree(ascending(routes.flat(Infinity))))
|
||||
);
|
||||
usePermissionStoreHook().clearAllCachePage();
|
||||
}
|
||||
|
||||
|
@ -172,6 +172,8 @@ function handleAsyncRoutes(routeList) {
|
||||
const flattenRouters: any = router
|
||||
.getRoutes()
|
||||
.find(n => n.path === "/");
|
||||
// 保持router.options.routes[0].children与path为"/"的children一致,防止数据不一致导致异常
|
||||
flattenRouters.children = router.options.routes[0].children;
|
||||
router.addRoute(flattenRouters);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user