Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
integrate-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
integrate-admin
Commits
dfd703a0
提交
dfd703a0
authored
12月 12, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改空白tabs名称问题
上级
5ec4dff0
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
7 行增加
和
129 行删除
+7
-129
MenuBar.vue
src/layout/menu/MenuBar.vue
+2
-128
Tabs.vue
src/layout/tabs/Tabs.vue
+2
-0
menu.ts
src/store/modules/menu.ts
+3
-1
没有找到文件。
src/layout/menu/MenuBar.vue
浏览文件 @
dfd703a0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</el-menu>
</el-menu>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
reactive
,
computed
}
from
'vue'
import
{
computed
}
from
'vue'
import
{
useRoute
}
from
'vue-router'
import
{
useRoute
}
from
'vue-router'
import
{
useStore
}
from
'@/store/index'
import
{
useStore
}
from
'@/store/index'
import
MenuItem
from
'./MenuItem.vue'
import
MenuItem
from
'./MenuItem.vue'
...
@@ -25,136 +25,10 @@ const activeIdex = computed(() => {
...
@@ -25,136 +25,10 @@ const activeIdex = computed(() => {
})
})
//菜单数据
//菜单数据
const
menuList
=
computed
(()
=>
{
const
menuList
=
computed
(()
=>
{
console
.
log
(
store
.
getters
[
'menu/getMenuList'
]);
return
store
.
getters
[
'menu/getMenuList'
]
return
store
.
getters
[
'menu/getMenuList'
]
})
})
// let menuList = reactive([
// {
// path: '/dashboard',
// component: "Layout",
// meta: {
// title: "首页",
// icon: "HomeFilled",
// roles: ["sys:manage"]
// },
// children: []
// },
// {
// path: "/system",
// component: "Layout",
// alwaysShow: true,
// name: "system",
// meta: {
// title: "系统管理",
// icon: "Menu",
// roles: ["sys:manage"],
// parentId: 0,
// },
// children: [
// {
// path: "/department",
// component: "/system/department/department",
// alwaysShow: false,
// name: "department",
// meta: {
// title: "机构管理",
// icon: "Platform",
// roles: ["sys:dept"],
// parentId: 17,
// },
// },
// {
// path: "/userList",
// component: "/system/User/UserList",
// alwaysShow: false,
// name: "userList",
// meta: {
// title: "用户管理",
// icon: "el-icon-s-custom",
// roles: ["sys:user"],
// parentId: 17,
// },
// },
// {
// path: "/roleList",
// component: "/system/Role/RoleList",
// alwaysShow: false,
// name: "roleList",
// meta: {
// title: "角色管理",
// icon: "el-icon-s-tools",
// roles: ["sys:role"],
// parentId: 17,
// },
// },
// {
// path: "/menuList",
// component: "/system/Menu/MenuList",
// alwaysShow: false,
// name: "menuList",
// meta: {
// title: "权限管理",
// icon: "el-icon-document",
// roles: ["sys:menu"],
// parentId: 17,
// },
// },
// ],
// },
// {
// path: "/goods",
// component: "Layout",
// alwaysShow: true,
// name: "goods",
// meta: {
// title: "商品管理",
// icon: "el-icon-document",
// roles: ["sys:goods"],
// parentId: 0,
// },
// children: [
// {
// path: "/goodCategory",
// component: "/goods/goodsCategory/goodsCategoryList",
// alwaysShow: false,
// name: "goodCategory",
// meta: {
// title: "商品分类",
// icon: "el-icon-document",
// roles: ["sys:goodsCategory"],
// parentId: 34,
// },
// },
// ],
// },
// {
// path: "/systenConfig",
// component: "Layout",
// alwaysShow: true,
// name: "systenConfig",
// meta: {
// title: "系统工具",
// icon: "el-icon-document",
// roles: ["sys:systenConfig"],
// parentId: 0,
// },
// children: [
// {
// path: "/document",
// component: "/system/config/systemDocument",
// alwaysShow: false,
// name: "http://42.193.158.170:8089/swagger-ui/index.html",
// meta: {
// title: "接口文档",
// icon: "el-icon-document",
// roles: ["sys:document"],
// parentId: 42,
// },
// },
// ],
// },
// ]);
const
isCollapse
=
computed
(()
=>
{
const
isCollapse
=
computed
(()
=>
{
// return store.getters['getCollapse']
// return store.getters['getCollapse']
return
store
.
getters
[
'menu/getCollapse'
]
return
store
.
getters
[
'menu/getCollapse'
]
...
...
src/layout/tabs/Tabs.vue
浏览文件 @
dfd703a0
...
@@ -54,6 +54,8 @@ const addTab = () => {
...
@@ -54,6 +54,8 @@ const addTab = () => {
path
:
path
,
path
:
path
,
title
:
meta
.
title
as
string
title
:
meta
.
title
as
string
}
}
// 路径不在后台,手动判断添加tabs名称
if
(
tab
.
path
===
'/manage/fieldConfiguration'
)
tab
.
title
=
'场景配置'
// store.commit('addTabe', tab);
// store.commit('addTabe', tab);
store
.
commit
(
'tabs/addTabe'
,
tab
)
store
.
commit
(
'tabs/addTabe'
,
tab
)
}
}
...
...
src/store/modules/menu.ts
浏览文件 @
dfd703a0
...
@@ -3,7 +3,6 @@ import { RouteRecordRaw } from "vue-router";
...
@@ -3,7 +3,6 @@ import { RouteRecordRaw } from "vue-router";
import
{
ActionContext
}
from
"vuex"
;
import
{
ActionContext
}
from
"vuex"
;
import
{
RootState
}
from
".."
;
import
{
RootState
}
from
".."
;
import
Layout
from
"@/layout/index.vue"
;
import
Layout
from
"@/layout/index.vue"
;
import
{
store
}
from
"@/store"
;
const
modules
=
import
.
meta
.
glob
(
"../../views/**/*.vue"
);
const
modules
=
import
.
meta
.
glob
(
"../../views/**/*.vue"
);
//定义state
//定义state
export
type
MenuState
=
{
export
type
MenuState
=
{
...
@@ -39,6 +38,8 @@ export const mutations = {
...
@@ -39,6 +38,8 @@ export const mutations = {
},
},
setMenuList
:
(
state
:
MenuState
,
menuList
:
Array
<
RouteRecordRaw
>
)
=>
{
setMenuList
:
(
state
:
MenuState
,
menuList
:
Array
<
RouteRecordRaw
>
)
=>
{
state
.
menuList
=
state
.
menuList
.
concat
(
menuList
);
state
.
menuList
=
state
.
menuList
.
concat
(
menuList
);
console
.
log
(
state
.
menuList
);
},
},
reSetList
:
(
state
:
MenuState
,
menuList
:
Array
<
RouteRecordRaw
>
)
=>
{
reSetList
:
(
state
:
MenuState
,
menuList
:
Array
<
RouteRecordRaw
>
)
=>
{
...
@@ -60,6 +61,7 @@ export const actions = {
...
@@ -60,6 +61,7 @@ export const actions = {
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
//动态生成路由
//动态生成路由
accessedRoutes
=
filterAsyncRoutes
(
res
.
data
,
router
);
accessedRoutes
=
filterAsyncRoutes
(
res
.
data
,
router
);
console
.
log
(
accessedRoutes
);
//设置到menuList
//设置到menuList
commit
(
"setMenuList"
,
accessedRoutes
);
commit
(
"setMenuList"
,
accessedRoutes
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论