bmp-layout 0.0.8 → 0.0.9
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 +34 -32
- package/bmp-layout.umd.js +4 -4
- package/package.json +1 -1
- package/style.css +1 -1
package/bmp-layout.es.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { openBlock, createBlock, unref as unref$1, normalizeClass, nextTick as nextTick$1,
|
|
1
|
+
import { openBlock, createBlock, unref as unref$1, normalizeClass, nextTick as nextTick$1, withCtx, createElementBlock, createElementVNode, normalizeStyle, createVNode, Fragment, isVNode, ref as ref$1, computed as computed$1, watch as watch$1, Teleport, Transition, withModifiers, toDisplayString, renderList, createCommentVNode, resolveComponent, resolveDynamicComponent, defineComponent as defineComponent$1, TransitionGroup, createTextVNode, mergeProps, isRef, withDirectives, resolveDirective, provide as provide$1, onMounted as onMounted$1, renderSlot, render, useCssVars, createSlots, watchEffect, vShow, onBeforeUnmount } from "vue";
|
|
2
2
|
import { createPinia, defineStore } from "pinia";
|
|
3
3
|
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
|
4
4
|
import { cloneDeep, omit } from "lodash-es";
|
|
5
|
-
import { ElBacktop, ElMenuItem, ElSubMenu, ElScrollbar, ElMenu, ElInput, ElMessageBox, ElBreadcrumb, ElBreadcrumbItem, ElMessage, ElConfigProvider, ElNotification, ElAffix } from "element-plus";
|
|
5
|
+
import { ElBacktop, ElIcon, ElMenuItem, ElSubMenu, ElScrollbar, ElMenu, ElInput, ElBadge, ElDropdown, ElDropdownMenu, ElDropdownItem, ElAvatar, ElMessageBox, ElBreadcrumb, ElBreadcrumbItem, ElDrawer, ElMessage, ElConfigProvider, ElNotification, ElAffix } from "element-plus";
|
|
6
6
|
import { createRouter, createWebHashHistory, useRouter as useRouter$1 } from "vue-router";
|
|
7
|
-
import "dayjs";
|
|
8
7
|
import "vue-i18n";
|
|
9
8
|
import { useClipboard, useWindowSize } from "@vueuse/core";
|
|
10
9
|
let store = createPinia();
|
|
@@ -1050,7 +1049,8 @@ const usePermissionStore = defineStore("layout-permission", {
|
|
|
1050
1049
|
addRouters: [],
|
|
1051
1050
|
menuTabRouters: [],
|
|
1052
1051
|
leftMenuRouters: [],
|
|
1053
|
-
moduleRouters: []
|
|
1052
|
+
moduleRouters: [],
|
|
1053
|
+
moduleId: void 0
|
|
1054
1054
|
}),
|
|
1055
1055
|
getters: {
|
|
1056
1056
|
getRouters() {
|
|
@@ -1074,6 +1074,9 @@ const usePermissionStore = defineStore("layout-permission", {
|
|
|
1074
1074
|
},
|
|
1075
1075
|
getModuleRouters() {
|
|
1076
1076
|
return this.moduleRouters;
|
|
1077
|
+
},
|
|
1078
|
+
getModuleId() {
|
|
1079
|
+
return this.moduleId;
|
|
1077
1080
|
}
|
|
1078
1081
|
},
|
|
1079
1082
|
actions: {
|
|
@@ -1100,6 +1103,7 @@ const usePermissionStore = defineStore("layout-permission", {
|
|
|
1100
1103
|
},
|
|
1101
1104
|
// 处理模块对应菜单
|
|
1102
1105
|
setModuleRouters(menuId) {
|
|
1106
|
+
this.moduleId = menuId;
|
|
1103
1107
|
const findRouter = this.getRoleRouters.find((router) => router.id === menuId);
|
|
1104
1108
|
if (findRouter) {
|
|
1105
1109
|
const children = findRouter.children || [];
|
|
@@ -3530,8 +3534,7 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ name: "Icon" }, {
|
|
|
3530
3534
|
}
|
|
3531
3535
|
);
|
|
3532
3536
|
return (_ctx, _cache) => {
|
|
3533
|
-
|
|
3534
|
-
return openBlock(), createBlock(_component_ElIcon, {
|
|
3537
|
+
return openBlock(), createBlock(unref$1(ElIcon), {
|
|
3535
3538
|
class: normalizeClass(unref$1(prefixCls2)),
|
|
3536
3539
|
color: __props.color,
|
|
3537
3540
|
size: __props.size
|
|
@@ -3852,7 +3855,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ name: "ProductServicePanel"
|
|
|
3852
3855
|
const { t: t2 } = useI18n$1("layout");
|
|
3853
3856
|
const props = __props;
|
|
3854
3857
|
const emit = __emit;
|
|
3855
|
-
useRouter$1();
|
|
3858
|
+
const router = useRouter$1();
|
|
3856
3859
|
const permissionStore = usePermissionStore();
|
|
3857
3860
|
const searchKeyword = ref$1("");
|
|
3858
3861
|
const activeCategory = ref$1(0);
|
|
@@ -3895,6 +3898,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ name: "ProductServicePanel"
|
|
|
3895
3898
|
return filteredMenus.value.map((menu) => {
|
|
3896
3899
|
var _a2, _b;
|
|
3897
3900
|
return {
|
|
3901
|
+
id: menu.id,
|
|
3898
3902
|
title: ((_a2 = menu.meta) == null ? void 0 : _a2.title) || menu.name,
|
|
3899
3903
|
icon: (_b = menu.meta) == null ? void 0 : _b.icon,
|
|
3900
3904
|
path: menu.path,
|
|
@@ -3931,11 +3935,18 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ name: "ProductServicePanel"
|
|
|
3931
3935
|
activeCategory.value = 0;
|
|
3932
3936
|
};
|
|
3933
3937
|
const handleSelect = (item, parentPath = "") => {
|
|
3938
|
+
var _a2;
|
|
3934
3939
|
const fullPath = getAccessiblePath(item, parentPath);
|
|
3935
3940
|
if (fullPath) {
|
|
3936
|
-
const
|
|
3937
|
-
const
|
|
3938
|
-
|
|
3941
|
+
const currentModuleId = permissionStore.getModuleId;
|
|
3942
|
+
const selectedModuleId = (_a2 = groupedMenus.value[activeCategory.value]) == null ? void 0 : _a2.id;
|
|
3943
|
+
if (selectedModuleId === currentModuleId) {
|
|
3944
|
+
router.push(fullPath.startsWith("/") ? fullPath : `/${fullPath}`);
|
|
3945
|
+
} else {
|
|
3946
|
+
const currentOrigin = window.location.origin;
|
|
3947
|
+
const targetUrl = `${currentOrigin}${fullPath.startsWith("/") ? fullPath : `/${fullPath}`}`;
|
|
3948
|
+
window.location.href = targetUrl;
|
|
3949
|
+
}
|
|
3939
3950
|
closePanel();
|
|
3940
3951
|
}
|
|
3941
3952
|
};
|
|
@@ -4117,7 +4128,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign({ name: "ProductServicePanel"
|
|
|
4117
4128
|
};
|
|
4118
4129
|
}
|
|
4119
4130
|
});
|
|
4120
|
-
const ProductServicePanel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
4131
|
+
const ProductServicePanel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-b7114eec"]]);
|
|
4121
4132
|
const _sfc_main$r = /* @__PURE__ */ Object.assign({ name: "Logo" }, {
|
|
4122
4133
|
__name: "Logo",
|
|
4123
4134
|
setup(__props) {
|
|
@@ -7971,9 +7982,8 @@ const _sfc_main$p = /* @__PURE__ */ Object.assign({ name: "Message" }, {
|
|
|
7971
7982
|
});
|
|
7972
7983
|
return (_ctx, _cache) => {
|
|
7973
7984
|
const _component_Icon = resolveComponent("Icon");
|
|
7974
|
-
const _component_ElBadge = resolveComponent("ElBadge");
|
|
7975
7985
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
7976
|
-
createVNode(
|
|
7986
|
+
createVNode(unref$1(ElBadge), {
|
|
7977
7987
|
"is-dot": unref$1(unreadCount) > 0,
|
|
7978
7988
|
class: "message-badge"
|
|
7979
7989
|
}, {
|
|
@@ -7990,7 +8000,7 @@ const _sfc_main$p = /* @__PURE__ */ Object.assign({ name: "Message" }, {
|
|
|
7990
8000
|
};
|
|
7991
8001
|
}
|
|
7992
8002
|
});
|
|
7993
|
-
const Message = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
8003
|
+
const Message = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-f707ca24"]]);
|
|
7994
8004
|
const _sfc_main$o = /* @__PURE__ */ Object.assign({ name: "Collapse" }, {
|
|
7995
8005
|
__name: "Collapse",
|
|
7996
8006
|
props: {
|
|
@@ -8051,18 +8061,14 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ name: "UserInfo" }, {
|
|
|
8051
8061
|
};
|
|
8052
8062
|
return (_ctx, _cache) => {
|
|
8053
8063
|
const _component_Icon = resolveComponent("Icon");
|
|
8054
|
-
|
|
8055
|
-
const _component_ElDropdownItem = resolveComponent("ElDropdownItem");
|
|
8056
|
-
const _component_ElDropdownMenu = resolveComponent("ElDropdownMenu");
|
|
8057
|
-
const _component_ElDropdown = resolveComponent("ElDropdown");
|
|
8058
|
-
return openBlock(), createBlock(_component_ElDropdown, {
|
|
8064
|
+
return openBlock(), createBlock(unref$1(ElDropdown), {
|
|
8059
8065
|
class: normalizeClass(["custom-hover cursor-pointer", unref$1(prefixCls2)]),
|
|
8060
8066
|
trigger: "click"
|
|
8061
8067
|
}, {
|
|
8062
8068
|
dropdown: withCtx(() => [
|
|
8063
|
-
createVNode(
|
|
8069
|
+
createVNode(unref$1(ElDropdownMenu), null, {
|
|
8064
8070
|
default: withCtx(() => [
|
|
8065
|
-
createVNode(
|
|
8071
|
+
createVNode(unref$1(ElDropdownItem), { onClick: loginOut }, {
|
|
8066
8072
|
default: withCtx(() => [
|
|
8067
8073
|
createVNode(_component_Icon, { icon: "ep:switch-button" }),
|
|
8068
8074
|
createElementVNode("div", null, toDisplayString(unref$1(t2)("common.loginOut")), 1)
|
|
@@ -8075,7 +8081,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ name: "UserInfo" }, {
|
|
|
8075
8081
|
]),
|
|
8076
8082
|
default: withCtx(() => [
|
|
8077
8083
|
createElementVNode("div", _hoisted_1$a, [
|
|
8078
|
-
createVNode(
|
|
8084
|
+
createVNode(unref$1(ElAvatar), {
|
|
8079
8085
|
src: unref$1(avatar),
|
|
8080
8086
|
size: 32,
|
|
8081
8087
|
class: "!bg-transparent"
|
|
@@ -8099,7 +8105,7 @@ const _sfc_main$n = /* @__PURE__ */ Object.assign({ name: "UserInfo" }, {
|
|
|
8099
8105
|
};
|
|
8100
8106
|
}
|
|
8101
8107
|
});
|
|
8102
|
-
const UserInfo = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
8108
|
+
const UserInfo = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-36e09d56"]]);
|
|
8103
8109
|
const filterBreadcrumb = (routes, parentPath = "") => {
|
|
8104
8110
|
var _a2;
|
|
8105
8111
|
const res = [];
|
|
@@ -8662,19 +8668,16 @@ const _sfc_main$l = /* @__PURE__ */ Object.assign({ name: "LocaleDropdown" }, {
|
|
|
8662
8668
|
};
|
|
8663
8669
|
return (_ctx, _cache) => {
|
|
8664
8670
|
const _component_Icon = resolveComponent("Icon");
|
|
8665
|
-
|
|
8666
|
-
const _component_ElDropdownMenu = resolveComponent("ElDropdownMenu");
|
|
8667
|
-
const _component_ElDropdown = resolveComponent("ElDropdown");
|
|
8668
|
-
return openBlock(), createBlock(_component_ElDropdown, {
|
|
8671
|
+
return openBlock(), createBlock(unref$1(ElDropdown), {
|
|
8669
8672
|
class: normalizeClass(unref$1(prefixCls2)),
|
|
8670
8673
|
trigger: "click",
|
|
8671
8674
|
onCommand: setLang
|
|
8672
8675
|
}, {
|
|
8673
8676
|
dropdown: withCtx(() => [
|
|
8674
|
-
createVNode(
|
|
8677
|
+
createVNode(unref$1(ElDropdownMenu), null, {
|
|
8675
8678
|
default: withCtx(() => [
|
|
8676
8679
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(langMap), (item) => {
|
|
8677
|
-
return openBlock(), createBlock(
|
|
8680
|
+
return openBlock(), createBlock(unref$1(ElDropdownItem), {
|
|
8678
8681
|
key: item.lang,
|
|
8679
8682
|
command: item.lang
|
|
8680
8683
|
}, {
|
|
@@ -8982,7 +8985,6 @@ const _sfc_main$h = /* @__PURE__ */ Object.assign({ name: "Setting" }, {
|
|
|
8982
8985
|
return (_ctx, _cache) => {
|
|
8983
8986
|
const _component_Icon = resolveComponent("Icon");
|
|
8984
8987
|
const _component_el_button = resolveComponent("el-button");
|
|
8985
|
-
const _component_ElDrawer = resolveComponent("ElDrawer");
|
|
8986
8988
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
8987
8989
|
createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
8988
8990
|
class: unref$1(prefixCls2),
|
|
@@ -8994,7 +8996,7 @@ const _sfc_main$h = /* @__PURE__ */ Object.assign({ name: "Setting" }, {
|
|
|
8994
8996
|
size: 18
|
|
8995
8997
|
}, null, 8, ["color"])
|
|
8996
8998
|
], 16),
|
|
8997
|
-
createVNode(
|
|
8999
|
+
createVNode(unref$1(ElDrawer), {
|
|
8998
9000
|
modelValue: unref$1(drawer),
|
|
8999
9001
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(drawer) ? drawer.value = $event : null),
|
|
9000
9002
|
"z-index": 4e3,
|
|
@@ -9039,7 +9041,7 @@ const _sfc_main$h = /* @__PURE__ */ Object.assign({ name: "Setting" }, {
|
|
|
9039
9041
|
};
|
|
9040
9042
|
}
|
|
9041
9043
|
});
|
|
9042
|
-
const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
9044
|
+
const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-81f39a2a"]]);
|
|
9043
9045
|
const _sfc_main$g = {
|
|
9044
9046
|
__name: "index",
|
|
9045
9047
|
props: {
|