<template>
|
<div class="layout-mai-title-compontent">
|
<div class="containter">
|
<span class="text">{{pageName}}</span>
|
<el-icon class="refresh-btn" @click.stop="onRefreshSubPage"><e-icon-refresh /></el-icon>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import {Refresh} from '@element-plus/icons'
|
export default {
|
name:'layoutMainTitleCompontent',
|
components:{eIconRefresh:Refresh},
|
computed:{
|
pageName(){
|
let temp = this.$store.getters['system/getCurrentFullMenuPath']
|
let res = '';
|
if (temp.length>0) {
|
res = temp[temp.length-1].name
|
}
|
return res
|
}
|
},
|
methods:{
|
onRefreshSubPage(){
|
let pageTag = this.$store.getters['system/getVisibleSubpage'];
|
let obj = this.$store.getters['system/getSubRefreshKey'];
|
let newObj = {...obj};
|
newObj[pageTag] = new Date().getTime();
|
this.$store.commit('system/setSubRefreshKey',newObj)
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.layout-mai-title-compontent{
|
height: 40px;
|
padding: 0 24px;
|
position: absolute;
|
top:48px;
|
left: 0;
|
width: 100%;
|
box-sizing: border-box;
|
&>.containter{
|
height: 100%;
|
background-color: #FFFFFF;
|
display: flex;
|
align-items: center;
|
border-radius: 6px;
|
justify-content: space-between;
|
padding: 0 12px;
|
cursor: default;
|
&>.text{
|
font-size: 18px;
|
font-weight: bold;
|
}
|
}
|
.refresh-btn{
|
font-size: 1.2em;
|
cursor: pointer;
|
}
|
}
|
</style>
|