@pubinfo/core 2.0.9 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{AppSetting-Bqdk4mr0.js → AppSetting-CMpNBlQc.js} +15 -15
  2. package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-Dun5ilGJ.js → HCheckList.vue_vue_type_script_setup_true_lang-C6P1ydHt.js} +1 -1
  3. package/dist/{HToggle-B1MlIVcK.js → HToggle-CHtRZAou.js} +1 -1
  4. package/dist/HeaderThinMenu-Moc7VP7Y.js +4 -0
  5. package/dist/{PreferencesContent-DLqC7RFC.js → PreferencesContent-DIXXC38B.js} +4 -4
  6. package/dist/{SettingBreadcrumb-DWRDMfAi.js → SettingBreadcrumb-BjB0GM9T.js} +3 -3
  7. package/dist/{SettingCopyright-C4K-AXxu.js → SettingCopyright-CuFMDBfS.js} +2 -2
  8. package/dist/{SettingEnableTransition-82BIgjuv.js → SettingEnableTransition-D3EtQLgG.js} +2 -2
  9. package/dist/{SettingHome-D9qElPUi.js → SettingHome-BKlvF3WY.js} +2 -2
  10. package/dist/{SettingMenu-smmCDuqz.js → SettingMenu-BkStOtR-.js} +3 -3
  11. package/dist/{SettingMode-Ct8lcvcA.js → SettingMode-BS9Wy6Mz.js} +1 -1
  12. package/dist/{SettingNavSearch-CC4Hl4wF.js → SettingNavSearch-SaawGh7a.js} +2 -2
  13. package/dist/{SettingOther-DMFPAPjR.js → SettingOther-CAT38ecY.js} +2 -2
  14. package/dist/{SettingPage-D8m-naZp.js → SettingPage-BAfP9dqM.js} +2 -2
  15. package/dist/{SettingTabbar-P3lOwe5Y.js → SettingTabbar-Ysqa0n6W.js} +3 -3
  16. package/dist/{SettingThemes-BwKbjHZZ.js → SettingThemes-CsZRq0SI.js} +1 -1
  17. package/dist/{SettingToolbar-NjhqqJNo.js → SettingToolbar-CD_RIfGa.js} +2 -2
  18. package/dist/{SettingTopbar-CL9g9QwB.js → SettingTopbar-BFFdv4Yb.js} +3 -3
  19. package/dist/{SettingWidthMode-Bfv4uU4j.js → SettingWidthMode-BIUimDhl.js} +1 -1
  20. package/dist/{colors-BksLvfd2.js → colors-CaM5gI4b.js} +1 -1
  21. package/dist/index--uFimSjO.js +4 -0
  22. package/dist/{index-BfNdcMoQ.js → index-Bgv7RWxh.js} +2 -2
  23. package/dist/{index-BZvIi9NG.js → index-C9GkmLho.js} +943 -933
  24. package/dist/{index-CY6xyw-d.js → index-CSVmA2GR.js} +2 -2
  25. package/dist/{index-DN5TqEna.js → index-C_s8Qt78.js} +4 -4
  26. package/dist/{index-icXFkR7f.js → index-Cv6Xl5EV.js} +1 -1
  27. package/dist/{index-Ck4Qus0W.js → index-DWjWJWRj.js} +2 -2
  28. package/dist/{index-CKhI9IyX.js → index-lnxCi5Hk.js} +1 -1
  29. package/dist/{index-BR7USpvK.js → index-pQQjVA76.js} +2 -2
  30. package/dist/index.js +1 -1
  31. package/dist/{pick-DjxDa62c.js → pick-DQM9Mp68.js} +1 -1
  32. package/dist/style.css +1 -1
  33. package/package.json +5 -5
  34. package/src/built-in/layout-component/Layout.vue +1 -1
  35. package/src/features/stores/modules/route.ts +23 -1
  36. package/dist/HeaderThinMenu-C5rj1NGZ.js +0 -4
  37. package/dist/index-BiFknLSr.js +0 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/core",
3
3
  "type": "module",
4
- "version": "2.0.9",
4
+ "version": "2.0.11",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -26,8 +26,8 @@
26
26
  "pinia": "^3.0.3",
27
27
  "vue": "^3.5.17",
28
28
  "vue-router": "^4.5.1",
29
- "@pubinfo/config": "2.0.9",
30
- "@pubinfo/vite": "2.0.9"
29
+ "@pubinfo/config": "2.0.11",
30
+ "@pubinfo/vite": "2.0.11"
31
31
  },
32
32
  "dependencies": {
33
33
  "@alova/adapter-axios": "^2.0.16",
@@ -85,8 +85,8 @@
85
85
  "vite-plugin-dts": "^4.5.4",
86
86
  "vue": "^3.5.17",
87
87
  "vue-router": "^4.5.1",
88
- "@pubinfo/config": "2.0.9",
89
- "@pubinfo/vite": "2.0.9"
88
+ "@pubinfo/config": "2.0.11",
89
+ "@pubinfo/vite": "2.0.11"
90
90
  },
91
91
  "scripts": {
92
92
  "dev": "vite build -w -m watch",
@@ -164,7 +164,7 @@ watch(() => routeInfo.path, () => {
164
164
  --at-apply: h-full bg-[--g-bg] mx-auto my-0;
165
165
  }
166
166
 
167
- #app-main.main-page-maximize header,
167
+ :deep(#app-main.main-page-maximize header),
168
168
  #app-main.main-page-maximize .sidebar-container {
169
169
  --at-apply: hidden;
170
170
  }
@@ -401,7 +401,11 @@ const useRouteStore = defineStore(
401
401
  }
402
402
  });
403
403
 
404
- routesRaw.value = [...remoteRoutes, ...restStaticRoutes];
404
+ // 对后端路由和本地路由进行排序
405
+ routesRaw.value = sortRoutesByRemoteOrder(
406
+ [...remoteRoutes, ...restStaticRoutes],
407
+ res.data ?? [],
408
+ );
405
409
  }
406
410
 
407
411
  if (settingsStore.settings.app.enablePermission) {
@@ -414,6 +418,24 @@ const useRouteStore = defineStore(
414
418
  }
415
419
  }
416
420
 
421
+ function sortRoutesByRemoteOrder(
422
+ routesRaw: Route.recordMainRaw[],
423
+ remoteRoutesRaw: API.PubResourceTreeBo[],
424
+ ): Route.recordMainRaw[] {
425
+ const orderMap = new Map(remoteRoutesRaw.map((r, i) => [r.code, i]));
426
+
427
+ const matched = routesRaw.filter(r => orderMap.has(r.meta?.auth as string));
428
+ const unmatched = routesRaw.filter(r => !orderMap.has(r.meta?.auth as string));
429
+
430
+ matched.sort((a, b) => {
431
+ const orderA = orderMap.get(a.meta.auth! as string) ?? Infinity;
432
+ const orderB = orderMap.get(b.meta.auth! as string) ?? Infinity;
433
+ return orderA - orderB;
434
+ });
435
+
436
+ return [...matched, ...unmatched];
437
+ }
438
+
417
439
  /**
418
440
  * 设置当前要移除的路由。
419
441
  * @param {(() => void)[]} routes - 要设置的路由。
@@ -1,4 +0,0 @@
1
- import { bH as f } from "./index-BZvIi9NG.js";
2
- export {
3
- f as default
4
- };
@@ -1,4 +0,0 @@
1
- import { bG as f } from "./index-BZvIi9NG.js";
2
- export {
3
- f as default
4
- };