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