Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
5f235056
提交
5f235056
authored
4月 10, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
页签新增关闭右侧
上级
6810243a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
0 行删除
+39
-0
index.vue
ruoyi-ui/src/layout/components/TagsView/index.vue
+15
-0
tagsView.js
ruoyi-ui/src/store/modules/tagsView.js
+24
-0
没有找到文件。
ruoyi-ui/src/layout/components/TagsView/index.vue
浏览文件 @
5f235056
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<li
@
click=
"refreshSelectedTag(selectedTag)"
>
刷新页面
</li>
<li
@
click=
"refreshSelectedTag(selectedTag)"
>
刷新页面
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
>
关闭当前
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
>
关闭当前
</li>
<li
@
click=
"closeOthersTags"
>
关闭其他
</li>
<li
@
click=
"closeOthersTags"
>
关闭其他
</li>
<li
v-if=
"!isLastView()"
@
click=
"closeRightTags"
>
关闭右侧
</li>
<li
@
click=
"closeAllTags(selectedTag)"
>
关闭所有
</li>
<li
@
click=
"closeAllTags(selectedTag)"
>
关闭所有
</li>
</ul>
</ul>
</div>
</div>
...
@@ -83,6 +84,13 @@ export default {
...
@@ -83,6 +84,13 @@ export default {
isAffix
(
tag
)
{
isAffix
(
tag
)
{
return
tag
.
meta
&&
tag
.
meta
.
affix
return
tag
.
meta
&&
tag
.
meta
.
affix
},
},
isLastView
()
{
try
{
return
this
.
selectedTag
.
fullPath
===
this
.
visitedViews
[
this
.
visitedViews
.
length
-
1
].
fullPath
}
catch
(
err
)
{
return
false
}
},
filterAffixTags
(
routes
,
basePath
=
'/'
)
{
filterAffixTags
(
routes
,
basePath
=
'/'
)
{
let
tags
=
[]
let
tags
=
[]
routes
.
forEach
(
route
=>
{
routes
.
forEach
(
route
=>
{
...
@@ -152,6 +160,13 @@ export default {
...
@@ -152,6 +160,13 @@ export default {
}
}
})
})
},
},
closeRightTags
()
{
this
.
$store
.
dispatch
(
'tagsView/delRightTags'
,
this
.
selectedTag
).
then
(
visitedViews
=>
{
if
(
!
visitedViews
.
find
(
i
=>
i
.
fullPath
===
this
.
$route
.
fullPath
))
{
this
.
toLastView
(
visitedViews
)
}
})
},
closeOthersTags
()
{
closeOthersTags
()
{
this
.
$router
.
push
(
this
.
selectedTag
).
catch
(()
=>
{});
this
.
$router
.
push
(
this
.
selectedTag
).
catch
(()
=>
{});
this
.
$store
.
dispatch
(
'tagsView/delOthersViews'
,
this
.
selectedTag
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'tagsView/delOthersViews'
,
this
.
selectedTag
).
then
(()
=>
{
...
...
ruoyi-ui/src/store/modules/tagsView.js
浏览文件 @
5f235056
...
@@ -62,6 +62,23 @@ const mutations = {
...
@@ -62,6 +62,23 @@ const mutations = {
break
break
}
}
}
}
},
DEL_RIGHT_VIEWS
:
(
state
,
view
)
=>
{
const
index
=
state
.
visitedViews
.
findIndex
(
v
=>
v
.
path
===
view
.
path
)
if
(
index
===
-
1
)
{
return
}
state
.
visitedViews
=
state
.
visitedViews
.
filter
((
item
,
idx
)
=>
{
if
(
idx
<=
index
||
(
item
.
meta
&&
item
.
meta
.
affix
))
{
return
true
}
const
i
=
state
.
cachedViews
.
indexOf
(
item
.
name
)
if
(
i
>
-
1
)
{
state
.
cachedViews
.
splice
(
i
,
1
)
}
return
false
})
}
}
}
}
...
@@ -148,6 +165,13 @@ const actions = {
...
@@ -148,6 +165,13 @@ const actions = {
updateVisitedView
({
commit
},
view
)
{
updateVisitedView
({
commit
},
view
)
{
commit
(
'UPDATE_VISITED_VIEW'
,
view
)
commit
(
'UPDATE_VISITED_VIEW'
,
view
)
},
delRightTags
({
commit
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'DEL_RIGHT_VIEWS'
,
view
)
resolve
([...
state
.
visitedViews
])
})
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论