ke_junjie
2025-06-04 84620534eb627e95811b971a4b552b6a177829bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<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>