Skip to content

Commit 72ed932

Browse files
author
shizhong
committed
2 parents cf892f7 + 83573b3 commit 72ed932

File tree

11 files changed

+61
-40
lines changed

11 files changed

+61
-40
lines changed

src/store/modules/permission.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,26 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
5858
icon: route.icon,
5959
noCache: !route.keepAlive,
6060
}
61-
// 路由地址转首字母大写驼峰,作为路由名称,适配 keepAlive
62-
route.name = toCamelCase(route.path, true)
63-
// 处理三级及以上菜单路由缓存问题,将path名字赋值给name
64-
if (route.path.indexOf("/") !== -1) {
65-
const pathArr = route.path.split("/");
66-
route.name = toCamelCase(pathArr[pathArr.length - 1], true)
67-
}
6861
route.hidden = !route.visible
62+
// 处理 name 属性
63+
if (route.componentName && route.componentName.length > 0) {
64+
route.name = route.componentName
65+
} else {
66+
// 路由地址转首字母大写驼峰,作为路由名称,适配 keepAlive
67+
route.name = toCamelCase(route.path, true)
68+
// 处理三级及以上菜单路由缓存问题,将 path 名字赋值给 name
69+
if (route.path.indexOf("/") !== -1) {
70+
const pathArr = route.path.split("/");
71+
route.name = toCamelCase(pathArr[pathArr.length - 1], true)
72+
}
73+
}
6974
// 处理 component 属性
7075
if (route.children) { // 父节点
7176
if (route.parentId === 0) {
7277
route.component = Layout
7378
} else {
7479
route.component = ParentView
7580
}
76-
// 解决只有一个菜单时无法显示目录
77-
route.alwaysShow = true
7881
} else { // 根节点
7982
route.component = loadView(route.component)
8083
}
@@ -85,8 +88,10 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
8588
}
8689
if (route.children != null && route.children && route.children.length) {
8790
route.children = filterAsyncRouter(route.children, route, type)
91+
route.alwaysShow = route.alwaysShow !== undefined ? route.alwaysShow : true
8892
} else {
8993
delete route['children']
94+
delete route['alwaysShow'] // 如果没有子菜单,就不需要考虑 alwaysShow 字段
9095
}
9196
return true
9297
})

src/views/infra/build/RightPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
554554
default-expand-all
555555
draggable
556556
>
557-
<span>
557+
<span slot-scope="{ node, data }">
558558
<span class="node-label">
559559
<svg-icon class="node-icon" :icon-class="data.__config__?data.__config__.tagIcon:data.tagIcon" />
560560
{{ node.label }}

src/views/mp/account/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ import {
132132
} from '@/api/mp/account'
133133
134134
export default {
135-
name: 'mpAccount',
135+
name: 'MpAccount',
136136
components: {},
137137
data() {
138138
return {

src/views/mp/autoReply/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ import { getSimpleAccounts } from "@/api/mp/account";
162162
import { createAutoReply, deleteAutoReply, getAutoReply, getAutoReplyPage, updateAutoReply } from "@/api/mp/autoReply";
163163
164164
export default {
165-
name: 'mpAutoReply',
165+
name: 'MpAutoReply',
166166
components: {
167167
WxVideoPlayer,
168168
WxVoicePlayer,

src/views/mp/draft/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ import { getSimpleAccounts } from "@/api/mp/account";
167167
import {deleteFreePublish, submitFreePublish} from "@/api/mp/freePublish";
168168
169169
export default {
170-
name: 'mpDraft',
170+
name: 'MpDraft',
171171
components: {
172172
WxEditor,
173173
WxNews,

src/views/mp/freePublish/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import { getSimpleAccounts } from "@/api/mp/account";
6464
import WxNews from '@/views/mp/components/wx-news/main.vue';
6565
6666
export default {
67-
name: 'mpDraft',
67+
name: 'MpFreePublish',
6868
components: {
6969
WxNews
7070
},

src/views/mp/material/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ import { getMaterialPage, deletePermanentMaterial } from "@/api/mp/material";
178178
import { getAccessToken } from '@/utils/auth'
179179
180180
export default {
181-
name: 'mpMaterial',
181+
name: 'MpMaterial',
182182
components: {
183183
WxVoicePlayer,
184184
WxVideoPlayer

src/views/mp/menu/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ import { deleteMenu, getMenuList, saveMenu } from "@/api/mp/menu";
157157
import { getSimpleAccounts } from "@/api/mp/account";
158158
159159
export default {
160-
name: 'mpMenu',
160+
name: 'MpMenu',
161161
components: {
162162
WxReplySelect,
163163
WxNews,

src/views/mp/mpuser/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ import { getSimpleAccounts } from "@/api/mp/account";
9595
import { getSimpleTags } from "@/api/mp/tag";
9696
9797
export default {
98-
name: "WxAccountFans",
98+
name: "MpUser",
9999
components: {
100100
},
101101
data() {

src/views/mp/statistics/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import {addTime, beginOfDay, betweenDay, endOfDay, formatDate} from "@/utils/dat
8282
import { getSimpleAccounts } from "@/api/mp/account";
8383
8484
export default {
85-
name: 'mpStatistics',
85+
name: 'MpStatistics',
8686
data() {
8787
return {
8888
date : [beginOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24 * 7)), // -7 天

0 commit comments

Comments
 (0)