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
d1eacc1d
提交
d1eacc1d
authored
11月 19, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增tab对象简化页签操作
上级
e41dd8a0
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
102 行增加
和
26 行删除
+102
-26
index.vue
ruoyi-ui/src/layout/components/TagsView/index.vue
+6
-13
index.js
ruoyi-ui/src/plugins/index.js
+3
-0
tab.js
ruoyi-ui/src/plugins/tab.js
+68
-0
tagsView.js
ruoyi-ui/src/store/modules/tagsView.js
+1
-1
log.vue
ruoyi-ui/src/views/monitor/job/log.vue
+2
-2
data.vue
ruoyi-ui/src/views/system/dict/data.vue
+14
-0
authUser.vue
ruoyi-ui/src/views/system/role/authUser.vue
+2
-2
authRole.vue
ruoyi-ui/src/views/system/user/authRole.vue
+2
-2
resetPwd.vue
ruoyi-ui/src/views/system/user/profile/resetPwd.vue
+1
-2
userInfo.vue
ruoyi-ui/src/views/system/user/profile/userInfo.vue
+1
-2
editTable.vue
ruoyi-ui/src/views/tool/gen/editTable.vue
+2
-2
没有找到文件。
ruoyi-ui/src/layout/components/TagsView/index.vue
浏览文件 @
d1eacc1d
...
...
@@ -152,31 +152,24 @@ export default {
})
},
refreshSelectedTag
(
view
)
{
this
.
$store
.
dispatch
(
'tagsView/delCachedView'
,
view
).
then
(()
=>
{
const
{
fullPath
}
=
view
this
.
$nextTick
(()
=>
{
this
.
$router
.
replace
({
path
:
'/redirect'
+
fullPath
})
})
})
this
.
$tab
.
refreshPage
(
view
);
},
closeSelectedTag
(
view
)
{
this
.
$
store
.
dispatch
(
'tagsView/delView'
,
view
).
then
(({
visitedViews
})
=>
{
this
.
$
tab
.
closePage
(
view
).
then
(({
visitedViews
})
=>
{
if
(
this
.
isActive
(
view
))
{
this
.
toLastView
(
visitedViews
,
view
)
}
})
},
closeRightTags
()
{
this
.
$
store
.
dispatch
(
'tagsView/delRightTags'
,
this
.
selectedTag
).
then
(
visitedViews
=>
{
this
.
$
tab
.
closeRightPage
(
this
.
selectedTag
).
then
(
visitedViews
=>
{
if
(
!
visitedViews
.
find
(
i
=>
i
.
fullPath
===
this
.
$route
.
fullPath
))
{
this
.
toLastView
(
visitedViews
)
}
})
},
closeLeftTags
()
{
this
.
$
store
.
dispatch
(
'tagsView/delLeftTags'
,
this
.
selectedTag
).
then
(
visitedViews
=>
{
this
.
$
tab
.
closeLeftPage
(
this
.
selectedTag
).
then
(
visitedViews
=>
{
if
(
!
visitedViews
.
find
(
i
=>
i
.
fullPath
===
this
.
$route
.
fullPath
))
{
this
.
toLastView
(
visitedViews
)
}
...
...
@@ -184,12 +177,12 @@ export default {
},
closeOthersTags
()
{
this
.
$router
.
push
(
this
.
selectedTag
).
catch
(()
=>
{});
this
.
$
store
.
dispatch
(
'tagsView/delOthersViews'
,
this
.
selectedTag
).
then
(()
=>
{
this
.
$
tab
.
closeOtherPage
(
this
.
selectedTag
).
then
(()
=>
{
this
.
moveToCurrentTag
()
})
},
closeAllTags
(
view
)
{
this
.
$
store
.
dispatch
(
'tagsView/delAllViews'
).
then
(({
visitedViews
})
=>
{
this
.
$
tab
.
closeAllPage
(
).
then
(({
visitedViews
})
=>
{
if
(
this
.
affixTags
.
some
(
tag
=>
tag
.
path
===
this
.
$route
.
path
))
{
return
}
...
...
ruoyi-ui/src/plugins/index.js
浏览文件 @
d1eacc1d
import
tab
from
'./tab'
import
auth
from
'./auth'
import
cache
from
'./cache'
import
modal
from
'./modal'
...
...
@@ -5,6 +6,8 @@ import download from './download'
export
default
{
install
(
Vue
)
{
// 页签操作
Vue
.
prototype
.
$tab
=
tab
// 认证对象
Vue
.
prototype
.
$auth
=
auth
// 缓存对象
...
...
ruoyi-ui/src/plugins/tab.js
0 → 100644
浏览文件 @
d1eacc1d
import
store
from
'@/store'
import
router
from
'@/router'
;
export
default
{
// 刷新当前tab页签
refreshPage
(
obj
)
{
const
{
path
,
matched
}
=
router
.
currentRoute
;
if
(
obj
===
undefined
)
{
matched
.
forEach
((
m
)
=>
{
if
(
m
.
components
&&
m
.
components
.
default
&&
m
.
components
.
default
.
name
)
{
if
(
!
[
'Layout'
,
'ParentView'
].
includes
(
m
.
components
.
default
.
name
))
{
obj
=
{
name
:
m
.
components
.
default
.
name
,
path
:
path
};
}
}
});
}
return
store
.
dispatch
(
'tagsView/delCachedView'
,
obj
).
then
(()
=>
{
const
{
path
}
=
obj
router
.
replace
({
path
:
'/redirect'
+
path
})
})
},
// 关闭当前tab页签,打开新页签
closeOpenPage
(
obj
)
{
store
.
dispatch
(
"tagsView/delView"
,
router
.
currentRoute
);
if
(
obj
!==
undefined
)
{
return
router
.
push
(
obj
);
}
},
// 关闭指定tab页签
closePage
(
obj
)
{
if
(
obj
===
undefined
)
{
return
store
.
dispatch
(
'tagsView/delView'
,
router
.
currentRoute
).
then
(({
lastPath
})
=>
{
return
router
.
push
(
lastPath
||
'/'
);
});
}
return
store
.
dispatch
(
'tagsView/delView'
,
obj
);
},
// 关闭所有tab页签
closeAllPage
()
{
return
store
.
dispatch
(
'tagsView/delAllViews'
);
},
// 关闭左侧tab页签
closeLeftPage
(
obj
)
{
return
store
.
dispatch
(
'tagsView/delLeftTags'
,
obj
||
router
.
currentRoute
);
},
// 关闭右侧tab页签
closeRightPage
(
obj
)
{
return
store
.
dispatch
(
'tagsView/delRightTags'
,
obj
||
router
.
currentRoute
);
},
// 关闭其他tab页签
closeOtherPage
(
obj
)
{
return
store
.
dispatch
(
'tagsView/delOthersViews'
,
obj
||
router
.
currentRoute
);
},
// 添加tab页签
addPage
(
title
,
url
)
{
var
obj
=
{
path
:
url
,
meta
:
{
title
:
title
}
}
store
.
dispatch
(
'tagsView/addView'
,
obj
);
return
router
.
push
(
url
);
},
// 修改tab页签
updatePage
(
obj
)
{
return
store
.
dispatch
(
'tagsView/updateVisitedView'
,
obj
);
}
}
ruoyi-ui/src/store/modules/tagsView.js
浏览文件 @
d1eacc1d
...
...
@@ -14,7 +14,7 @@ const mutations = {
},
ADD_CACHED_VIEW
:
(
state
,
view
)
=>
{
if
(
state
.
cachedViews
.
includes
(
view
.
name
))
return
if
(
!
view
.
meta
.
noCache
)
{
if
(
view
.
meta
&&
!
view
.
meta
.
noCache
)
{
state
.
cachedViews
.
push
(
view
.
name
)
}
},
...
...
ruoyi-ui/src/views/monitor/job/log.vue
浏览文件 @
d1eacc1d
...
...
@@ -245,8 +245,8 @@ export default {
},
// 返回按钮
handleClose
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
)
;
this
.
$
router
.
push
({
path
:
"/monitor/job"
}
);
const
obj
=
{
path
:
"/monitor/job"
}
;
this
.
$
tab
.
closeOpenPage
(
obj
);
},
/** 搜索按钮操作 */
handleQuery
()
{
...
...
ruoyi-ui/src/views/system/dict/data.vue
浏览文件 @
d1eacc1d
...
...
@@ -79,6 +79,15 @@
v-hasPermi=
"['system:dict:export']"
>
导出
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-close"
size=
"mini"
@
click=
"handleClose"
>
关闭
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
...
...
@@ -316,6 +325,11 @@ export default {
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
// 返回按钮
handleClose
()
{
const
obj
=
{
path
:
"/system/dict"
};
this
.
$tab
.
closeOpenPage
(
obj
);
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
...
...
ruoyi-ui/src/views/system/role/authUser.vue
浏览文件 @
d1eacc1d
...
...
@@ -153,8 +153,8 @@ export default {
},
// 返回按钮
handleClose
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
)
;
this
.
$
router
.
push
({
path
:
"/system/role"
}
);
const
obj
=
{
path
:
"/system/role"
}
;
this
.
$
tab
.
closeOpenPage
(
obj
);
},
/** 搜索按钮操作 */
handleQuery
()
{
...
...
ruoyi-ui/src/views/system/user/authRole.vue
浏览文件 @
d1eacc1d
...
...
@@ -109,8 +109,8 @@ export default {
},
/** 关闭按钮 */
close
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
)
;
this
.
$
router
.
push
({
path
:
"/system/user"
}
);
const
obj
=
{
path
:
"/system/user"
}
;
this
.
$
tab
.
closeOpenPage
(
obj
);
},
},
};
...
...
ruoyi-ui/src/views/system/user/profile/resetPwd.vue
浏览文件 @
d1eacc1d
...
...
@@ -64,8 +64,7 @@ export default {
});
},
close
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"/index"
});
this
.
$tab
.
closePage
();
}
}
};
...
...
ruoyi-ui/src/views/system/user/profile/userInfo.vue
浏览文件 @
d1eacc1d
...
...
@@ -68,8 +68,7 @@ export default {
});
},
close
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
"/index"
});
this
.
$tab
.
closePage
();
}
}
};
...
...
ruoyi-ui/src/views/tool/gen/editTable.vue
浏览文件 @
d1eacc1d
...
...
@@ -211,8 +211,8 @@ export default {
},
/** 关闭按钮 */
close
()
{
this
.
$store
.
dispatch
(
"tagsView/delView"
,
this
.
$route
)
;
this
.
$
router
.
push
({
path
:
"/tool/gen"
,
query
:
{
t
:
Date
.
now
(),
pageNum
:
this
.
$route
.
query
.
pageNum
}
})
const
obj
=
{
path
:
"/tool/gen"
,
query
:
{
t
:
Date
.
now
(),
pageNum
:
this
.
$route
.
query
.
pageNum
}
}
;
this
.
$
tab
.
closeOpenPage
(
obj
);
}
},
mounted
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论