Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
SHR
/
tFIMS
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49bb49bd
authored
Sep 20, 2019
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增keepalive开关
1 parent
1179c973
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
52 deletions
src/assets/style/animate/vue-transition.scss
src/assets/style/theme/theme-base.scss
src/layout/header-aside/components/header-fullscreen/index.vue
src/layout/header-aside/components/header-theme/index.vue
src/layout/header-aside/components/tabs/index.vue
src/store/modules/d2admin/modules/page.js
src/assets/style/animate/vue-transition.scss
View file @
49bb49b
// 过渡动画 横向渐变
.fade-transverse-leave-active
,
.fade-transverse-enter-active
{
transition
:
all
.
2
s
;
transition
:
all
.
3
s
;
}
.fade-transverse-enter
{
opacity
:
0
;
...
...
src/assets/style/theme/theme-base.scss
View file @
49bb49b
...
...
@@ -276,12 +276,18 @@
.el-button-group
{
.el-button
{
border-bottom
:
none
;
padding
:
10px
20
px
;
padding
:
10px
12
px
;
&
:first-child
{
border-bottom-left-radius
:
0px
;
border-right
:
none
;
}
&
:nth-child
(
2
)
{
border-right
:
none
;
border-left
:
none
;
}
&
:last-child
{
border-bottom-right-radius
:
0px
;
border-left
:
none
}
}
// }
...
...
src/layout/header-aside/components/header-fullscreen/index.vue
View file @
49bb49b
<
template
>
<el-tooltip
<
!--
<
el-tooltip
effect=
"dark"
:content=
"active ? '退出全屏' : '全屏'"
placement=
"bottom"
>
placement=
"bottom"
>
-->
<el-button
class=
"d2-mr btn-text can-hover"
type=
"text"
@
click=
"toggle"
>
<d2-el-icon
v-if=
"active"
name=
"aim"
/>
<d2-el-icon
v-else
name=
"full-screen"
style=
"font-size: 16px"
/>
</el-button>
<
/el-tooltip
>
<
!--
</el-tooltip>
--
>
</
template
>
<
script
>
...
...
src/layout/header-aside/components/header-theme/index.vue
View file @
49bb49b
<
template
>
<div>
<el-tooltip
<
!--
<
el-tooltip
effect=
"dark"
content=
"主题"
placement=
"bottom"
>
placement=
"bottom"
>
-->
<el-button
class=
"d2-ml-0 d2-mr btn-text can-hover"
type=
"text"
...
...
@@ -12,7 +12,7 @@
name=
"magic-stick"
style=
"font-size: 18px"
/>
</el-button>
<
/el-tooltip
>
<
!--
</el-tooltip>
--
>
<el-dialog
title=
"主题"
width=
"600px"
...
...
src/layout/header-aside/components/tabs/index.vue
View file @
49bb49b
...
...
@@ -32,43 +32,17 @@
flex-box=
"0"
>
<el-button-group>
<el-button
icon=
"el-icon-error"
@
click=
"closeAll"
></el-button>
<el-tooltip
class=
"item"
effect=
"dark"
:content=
"cacheTip"
placement=
"bottom"
>
<el-button
:icon=
"kaIcon"
@
click=
"handleCache"
></el-button>
</el-tooltip>
<el-button
icon=
"el-icon-refresh"
@
click=
"reload"
:disabled=
"current==='/index'"
></el-button>
</el-button-group>
<!--
<el-dropdown
size=
"default"
split-button
@
click=
"closeAll"
@
command=
"command => handleControlItemClick(command)"
>
<d2-el-icon
name=
"error"
/>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"reload"
>
<d2-el-icon
name=
"refresh"
/>
刷新
</el-dropdown-item>
<el-dropdown-item
command=
"left"
>
<d2-el-icon
name=
"back"
class=
"d2-mr-10"
/>
关闭左侧
</el-dropdown-item>
<el-dropdown-item
command=
"right"
>
<d2-el-icon
name=
"right"
class=
"d2-mr-10"
/>
关闭右侧
</el-dropdown-item>
<el-dropdown-item
command=
"other"
>
<d2-el-icon
name=
"circle-close"
class=
"d2-mr-10"
/>
关闭其它
</el-dropdown-item>
<el-dropdown-item
command=
"all"
>
<d2-el-icon
name=
"error"
class=
"d2-mr-10"
/>
全部关闭
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
-->
</div>
</div>
</
template
>
<
script
>
import
{
mapState
,
mapActions
,
mapMutations
}
from
'vuex'
import
{
mapState
,
mapActions
}
from
'vuex'
const
CMD_MAP
=
{
'left'
:
'closeLeft'
,
'right'
:
'closeRight'
,
...
...
@@ -101,8 +75,20 @@ export default {
computed
:
{
...
mapState
(
'd2admin/page'
,
[
'opened'
,
'current'
])
'current'
,
'keepAlive'
]),
isCached
()
{
const
_curPage
=
this
.
opened
.
find
(
page
=>
page
.
fullPath
===
this
.
current
)
const
_cache
=
_curPage
&&
_curPage
.
meta
.
cache
return
_cache
},
cacheTip
()
{
return
this
.
isCached
?
'已缓存当前页面数据'
:
'不缓存当前页面数据'
},
kaIcon
()
{
return
this
.
isCached
?
'el-icon-star-on'
:
'el-icon-star-off'
}
},
mounted
()
{
this
.
$event
.
$on
(
'e-reload'
,
this
.
reload
)
...
...
@@ -113,15 +99,15 @@ export default {
'closeLeft'
,
'closeRight'
,
'closeOther'
,
'closeAll'
'closeAll'
,
'keepAliveRemove'
,
'keepAlivePush'
]),
...
mapMutations
(
'd2admin/page'
,
[
'keepAliveRemove'
,
'keepAlivePush'
]),
/**
* @description 右键菜单功能点击
*/
handleContextmenu
(
event
)
{
let
target
=
event
.
target
// 解决 https://github.com/d2-projects/d2-admin/issues/54
let
flag
=
false
if
(
target
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
flag
=
true
else
if
(
target
.
parentNode
.
className
.
indexOf
(
'el-tabs__item'
)
>
-
1
)
{
...
...
@@ -166,16 +152,21 @@ export default {
this
.
$router
.
push
({
name
,
params
,
query
})
}
},
handleCache
()
{
this
[
this
.
isCached
?
'keepAliveRemove'
:
'keepAlivePush'
](
this
.
$router
.
currentRoute
.
name
)
},
async
reload
()
{
const
name
=
this
.
$router
.
currentRoute
.
name
await
this
.
keepAliveRemove
(
name
)
await
this
.
$router
.
replace
(
'/refresh'
)
var
__timer
=
setInterval
(()
=>
{
if
(
this
.
$router
.
currentRoute
.
name
===
name
)
{
clearInterval
(
__timer
)
this
.
keepAlivePush
(
name
)
}
},
10
)
if
(
this
.
isCached
)
{
const
name
=
this
.
$router
.
currentRoute
.
name
await
this
.
keepAliveRemove
(
name
)
var
__timer
=
setInterval
(()
=>
{
if
(
this
.
$router
.
currentRoute
.
name
===
name
)
{
clearInterval
(
__timer
)
this
.
keepAlivePush
(
name
)
}
},
10
)
}
this
.
$router
.
replace
(
'/refresh'
)
},
/**
* @description 点击 tab 上的删除按钮触发这里 首页的删除按钮已经隐藏 因此这里不用判断是 index
...
...
src/store/modules/d2admin/modules/page.js
deleted
100644 → 0
View file @
1179c97
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment