mooho-base-admin-plus 2.3.2 → 2.3.3
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/package.json
CHANGED
package/public/setting.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
</i-link>
|
|
10
10
|
</transition>
|
|
11
11
|
</div>
|
|
12
|
+
<div v-if="!menuCollapse && layout.menuFilter"><Input v-model="menuFilter" prefix="ios-search" placeholder="搜索菜单..." style="margin: 2%; width: 96%" /></div>
|
|
12
13
|
<Menu
|
|
13
14
|
ref="menu"
|
|
14
15
|
class="i-layout-menu-side i-scrollbar-hide"
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
:open-names="openNames"
|
|
20
21
|
width="auto"
|
|
21
22
|
>
|
|
22
|
-
<template v-for="(item, index) in
|
|
23
|
+
<template v-for="(item, index) in siderMenuData" :key="index">
|
|
23
24
|
<template v-if="!menuCollapse">
|
|
24
25
|
<i-menu-side-item v-if="item.children == null || !item.children.length" :menu="item" :key="index" />
|
|
25
26
|
<i-menu-side-submenu v-else :menu="item" />
|
|
@@ -65,18 +66,31 @@
|
|
|
65
66
|
name: 'iMenuSide',
|
|
66
67
|
mixins: [mixinPage],
|
|
67
68
|
components: { iMenuSideItem, iMenuSideSubmenu, iMenuSideCollapse },
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
menuFilter: null
|
|
72
|
+
};
|
|
73
|
+
},
|
|
68
74
|
props: {
|
|
69
75
|
hideLogo: {
|
|
70
76
|
type: Boolean,
|
|
71
77
|
default: false
|
|
72
78
|
}
|
|
73
79
|
},
|
|
80
|
+
|
|
74
81
|
computed: {
|
|
75
82
|
...mapState('admin/layout', ['siderTheme', 'menuAccordion', 'menuCollapse']),
|
|
76
83
|
...mapState('admin/menu', ['activePath', 'openNames']),
|
|
77
84
|
...mapGetters('admin/menu', ['filterSider']),
|
|
78
85
|
rootPath() {
|
|
79
86
|
return Setting.rootPath;
|
|
87
|
+
},
|
|
88
|
+
siderMenuData() {
|
|
89
|
+
if (this.menuFilter) {
|
|
90
|
+
return this.getSiderMenuData(this.copy(this.filterSider));
|
|
91
|
+
} else {
|
|
92
|
+
return this.filterSider;
|
|
93
|
+
}
|
|
80
94
|
}
|
|
81
95
|
},
|
|
82
96
|
watch: {
|
|
@@ -113,6 +127,29 @@
|
|
|
113
127
|
});
|
|
114
128
|
}
|
|
115
129
|
});
|
|
130
|
+
},
|
|
131
|
+
isMatch(menu, deep) {
|
|
132
|
+
let name = this.layout.showI18n ? this.$t('Permission_' + menu.code) : menu.title;
|
|
133
|
+
if (name.indexOf(this.menuFilter) >= 0) {
|
|
134
|
+
return true;
|
|
135
|
+
} else {
|
|
136
|
+
if (menu.children && deep) {
|
|
137
|
+
return menu.children.some(item => this.isMatch(item));
|
|
138
|
+
} else {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
getSiderMenuData(data) {
|
|
144
|
+
let result = data.filter(item => this.isMatch(item, true));
|
|
145
|
+
|
|
146
|
+
for (let menu of result) {
|
|
147
|
+
if (menu.children && !this.isMatch(menu, false)) {
|
|
148
|
+
menu.children = this.getSiderMenuData(menu.children);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return result;
|
|
116
153
|
}
|
|
117
154
|
}
|
|
118
155
|
};
|