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
0e615072
提交
0e615072
authored
9月 05, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
页签新增关闭左侧
上级
44adf03d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
40 行增加
和
1 行删除
+40
-1
index.vue
ruoyi-ui/src/layout/components/TagsView/index.vue
+15
-0
tagsView.js
ruoyi-ui/src/store/modules/tagsView.js
+25
-1
没有找到文件。
ruoyi-ui/src/layout/components/TagsView/index.vue
浏览文件 @
0e615072
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<li
@
click=
"refreshSelectedTag(selectedTag)"
><i
class=
"el-icon-refresh-right"
></i>
刷新页面
</li>
<li
@
click=
"refreshSelectedTag(selectedTag)"
><i
class=
"el-icon-refresh-right"
></i>
刷新页面
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
><i
class=
"el-icon-close"
></i>
关闭当前
</li>
<li
v-if=
"!isAffix(selectedTag)"
@
click=
"closeSelectedTag(selectedTag)"
><i
class=
"el-icon-close"
></i>
关闭当前
</li>
<li
@
click=
"closeOthersTags"
><i
class=
"el-icon-circle-close"
></i>
关闭其他
</li>
<li
@
click=
"closeOthersTags"
><i
class=
"el-icon-circle-close"
></i>
关闭其他
</li>
<li
v-if=
"!isFirstView()"
@
click=
"closeLeftTags"
><i
class=
"el-icon-back"
></i>
关闭左侧
</li>
<li
v-if=
"!isLastView()"
@
click=
"closeRightTags"
><i
class=
"el-icon-right"
></i>
关闭右侧
</li>
<li
v-if=
"!isLastView()"
@
click=
"closeRightTags"
><i
class=
"el-icon-right"
></i>
关闭右侧
</li>
<li
@
click=
"closeAllTags(selectedTag)"
><i
class=
"el-icon-circle-close"
></i>
全部关闭
</li>
<li
@
click=
"closeAllTags(selectedTag)"
><i
class=
"el-icon-circle-close"
></i>
全部关闭
</li>
</ul>
</ul>
...
@@ -84,6 +85,13 @@ export default {
...
@@ -84,6 +85,13 @@ export default {
isAffix
(
tag
)
{
isAffix
(
tag
)
{
return
tag
.
meta
&&
tag
.
meta
.
affix
return
tag
.
meta
&&
tag
.
meta
.
affix
},
},
isFirstView
()
{
try
{
return
this
.
selectedTag
.
fullPath
===
this
.
visitedViews
[
1
].
fullPath
||
this
.
selectedTag
.
fullPath
===
'/index'
}
catch
(
err
)
{
return
false
}
},
isLastView
()
{
isLastView
()
{
try
{
try
{
return
this
.
selectedTag
.
fullPath
===
this
.
visitedViews
[
this
.
visitedViews
.
length
-
1
].
fullPath
return
this
.
selectedTag
.
fullPath
===
this
.
visitedViews
[
this
.
visitedViews
.
length
-
1
].
fullPath
...
@@ -167,6 +175,13 @@ export default {
...
@@ -167,6 +175,13 @@ export default {
}
}
})
})
},
},
closeLeftTags
()
{
this
.
$store
.
dispatch
(
'tagsView/delLeftTags'
,
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
浏览文件 @
0e615072
...
@@ -79,6 +79,23 @@ const mutations = {
...
@@ -79,6 +79,23 @@ const mutations = {
}
}
return
false
return
false
})
})
},
DEL_LEFT_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
})
}
}
}
}
...
@@ -172,7 +189,14 @@ const actions = {
...
@@ -172,7 +189,14 @@ const actions = {
commit
(
'DEL_RIGHT_VIEWS'
,
view
)
commit
(
'DEL_RIGHT_VIEWS'
,
view
)
resolve
([...
state
.
visitedViews
])
resolve
([...
state
.
visitedViews
])
})
})
}
},
delLeftTags
({
commit
},
view
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'DEL_LEFT_VIEWS'
,
view
)
resolve
([...
state
.
visitedViews
])
})
},
}
}
export
default
{
export
default
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论