bmp-layout 0.0.6 → 0.0.7
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.
- package/bmp-layout.es.js +22 -18
- package/bmp-layout.umd.js +8 -8
- package/package.json +1 -1
package/bmp-layout.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock, createBlock, unref, normalizeClass,
|
|
1
|
+
import { openBlock, createBlock, unref, normalizeClass, ref as ref$1, getCurrentInstance, inject, computed, isRef, warn, defineComponent, createElementBlock, mergeProps, renderSlot, onMounted, watch, toRef, onUnmounted, shallowRef, nextTick, useAttrs as useAttrs$1, useSlots, normalizeStyle, createCommentVNode, Fragment, createElementVNode, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, onBeforeUnmount, Transition, withDirectives, vShow, provide, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, readonly, onDeactivated, createTextVNode, isVNode, h, watchEffect, onScopeDispose, createSlots, resolveComponent, normalizeProps, guardReactiveProps, toRefs, TransitionGroup, toRaw, resolveDirective, toHandlerKey, renderList, withKeys, vModelText, KeepAlive } from "vue";
|
|
2
2
|
import { createPinia, defineStore } from "pinia";
|
|
3
3
|
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
|
4
4
|
import { cloneDeep, omit, get as get$1, fromPairs, set, pick, isNil, isUndefined as isUndefined$1, castArray, clone, isEqual, debounce, findLastIndex } from "lodash-es";
|
|
@@ -9,8 +9,11 @@ import axios from "axios";
|
|
|
9
9
|
import { Loading, CircleCheck, CircleClose, Close, View, Hide, ArrowDown } from "@element-plus/icons-vue";
|
|
10
10
|
import dayjs from "dayjs";
|
|
11
11
|
import "vue-i18n";
|
|
12
|
-
|
|
12
|
+
let store = createPinia();
|
|
13
13
|
store.use(piniaPluginPersistedstate);
|
|
14
|
+
const setPinia = (pinia) => {
|
|
15
|
+
store = pinia;
|
|
16
|
+
};
|
|
14
17
|
const humpToUnderline = (str) => {
|
|
15
18
|
return str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
16
19
|
};
|
|
@@ -3417,10 +3420,10 @@ const hasOneShowingChild = (children = [], parent) => {
|
|
|
3417
3420
|
onlyOneChild: unref(onlyOneChild)
|
|
3418
3421
|
};
|
|
3419
3422
|
};
|
|
3420
|
-
const permissionStore = usePermissionStoreWithOut();
|
|
3421
3423
|
const getLeftMenuRouters = (path, push2) => {
|
|
3422
|
-
const
|
|
3423
|
-
const
|
|
3424
|
+
const permissionStore = usePermissionStoreWithOut();
|
|
3425
|
+
const routers = permissionStore.getRouters;
|
|
3426
|
+
const _router = routers.find((router2) => router2.path == path);
|
|
3424
3427
|
if (_router) {
|
|
3425
3428
|
const meta = _router.meta ?? {};
|
|
3426
3429
|
const { oneShowingChild, onlyOneChild } = hasOneShowingChild(_router.children, _router);
|
|
@@ -17686,7 +17689,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
17686
17689
|
push: push2,
|
|
17687
17690
|
currentRoute
|
|
17688
17691
|
} = useRouter();
|
|
17689
|
-
const
|
|
17692
|
+
const permissionStore = usePermissionStore();
|
|
17690
17693
|
const menuMode = computed(() => {
|
|
17691
17694
|
switch (unref(layout)) {
|
|
17692
17695
|
case "left":
|
|
@@ -17699,9 +17702,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
17699
17702
|
});
|
|
17700
17703
|
const routers = computed(() => {
|
|
17701
17704
|
if (layout.value == "topLeft" && props.mode == "vertical") {
|
|
17702
|
-
return
|
|
17705
|
+
return permissionStore.getLeftMenuRouters;
|
|
17703
17706
|
} else {
|
|
17704
|
-
return
|
|
17707
|
+
return permissionStore.getRouters;
|
|
17705
17708
|
}
|
|
17706
17709
|
});
|
|
17707
17710
|
const collapse = computed(() => appStore.getCollapse);
|
|
@@ -22311,8 +22314,8 @@ const _sfc_main$x = /* @__PURE__ */ Object.assign({ name: "TagsView" }, {
|
|
|
22311
22314
|
const { t: t2 } = useI18n();
|
|
22312
22315
|
const { currentRoute, push: push2 } = useRouter();
|
|
22313
22316
|
const { closeAll, closeLeft, closeRight, closeOther, closeCurrent, refreshPage } = useTagsView();
|
|
22314
|
-
const
|
|
22315
|
-
const routers = computed(() =>
|
|
22317
|
+
const permissionStore = usePermissionStore();
|
|
22318
|
+
const routers = computed(() => permissionStore.getRouters);
|
|
22316
22319
|
const tagsViewStore = useTagsViewStore();
|
|
22317
22320
|
const visitedViews = computed(() => tagsViewStore.getVisitedViews);
|
|
22318
22321
|
const affixTagArr = ref$1([]);
|
|
@@ -22350,11 +22353,11 @@ const _sfc_main$x = /* @__PURE__ */ Object.assign({ name: "TagsView" }, {
|
|
|
22350
22353
|
if (latestView) {
|
|
22351
22354
|
push2(latestView);
|
|
22352
22355
|
} else {
|
|
22353
|
-
if (unref(currentRoute).path ===
|
|
22356
|
+
if (unref(currentRoute).path === permissionStore.getAddRouters[0].path || unref(currentRoute).path === permissionStore.getAddRouters[0].redirect) {
|
|
22354
22357
|
addTags();
|
|
22355
22358
|
return;
|
|
22356
22359
|
}
|
|
22357
|
-
push2(
|
|
22360
|
+
push2(permissionStore.getAddRouters[0].path);
|
|
22358
22361
|
}
|
|
22359
22362
|
};
|
|
22360
22363
|
const closeAllTags = () => {
|
|
@@ -22766,10 +22769,10 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ name: "ProductServicePanel"
|
|
|
22766
22769
|
const props = __props;
|
|
22767
22770
|
const emit = __emit;
|
|
22768
22771
|
const router2 = useRouter();
|
|
22769
|
-
const
|
|
22772
|
+
const permissionStore = usePermissionStore();
|
|
22770
22773
|
const searchKeyword = ref$1("");
|
|
22771
22774
|
const activeCategory = ref$1(0);
|
|
22772
|
-
const routers = computed(() =>
|
|
22775
|
+
const routers = computed(() => permissionStore.getRouters);
|
|
22773
22776
|
const filteredMenus = computed(() => {
|
|
22774
22777
|
const keyword = searchKeyword.value.toLowerCase().trim();
|
|
22775
22778
|
const filterHiddenMenus = (items) => {
|
|
@@ -23806,9 +23809,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
23806
23809
|
t: t2
|
|
23807
23810
|
} = useI18n();
|
|
23808
23811
|
const levelList = ref$1([]);
|
|
23809
|
-
const
|
|
23812
|
+
const permissionStore = usePermissionStore();
|
|
23810
23813
|
const menuRouters = computed(() => {
|
|
23811
|
-
const routers =
|
|
23814
|
+
const routers = permissionStore.getRouters;
|
|
23812
23815
|
return filterBreadcrumb(routers);
|
|
23813
23816
|
});
|
|
23814
23817
|
const getBreadcrumb = () => {
|
|
@@ -24785,7 +24788,7 @@ const prefixCls$1 = getPrefixCls$1("layout");
|
|
|
24785
24788
|
const scrollRef = ref$1();
|
|
24786
24789
|
const useRenderLayout = () => {
|
|
24787
24790
|
const appStore = useAppStore();
|
|
24788
|
-
const
|
|
24791
|
+
const permissionStore = usePermissionStore();
|
|
24789
24792
|
const pageLoading = computed(() => appStore.getPageLoading);
|
|
24790
24793
|
const tagsView = computed(() => appStore.getTagsView);
|
|
24791
24794
|
const collapse = computed(() => appStore.getCollapse);
|
|
@@ -24793,7 +24796,7 @@ const useRenderLayout = () => {
|
|
|
24793
24796
|
const fixedHeader = computed(() => appStore.getFixedHeader);
|
|
24794
24797
|
computed(() => appStore.getMobile);
|
|
24795
24798
|
computed(() => appStore.getFixedMenu);
|
|
24796
|
-
const leftMenuRouters = computed(() =>
|
|
24799
|
+
const leftMenuRouters = computed(() => permissionStore.getLeftMenuRouters);
|
|
24797
24800
|
const theme = computed(() => appStore.getTheme);
|
|
24798
24801
|
const festivalTopClass = computed(() => {
|
|
24799
24802
|
return {
|
|
@@ -39149,6 +39152,7 @@ export {
|
|
|
39149
39152
|
Layout as default,
|
|
39150
39153
|
setGenerateRoutesFn,
|
|
39151
39154
|
setI18n,
|
|
39155
|
+
setPinia,
|
|
39152
39156
|
useAppStore,
|
|
39153
39157
|
useAppStoreWithOut,
|
|
39154
39158
|
useLayout,
|