This commit is contained in:
zhaokaiyao@91isoft.com
2021-10-09 17:23:15 +08:00
113 changed files with 5391 additions and 1607 deletions
+76 -77
View File
@@ -7,102 +7,102 @@
<!--面包屑-->
<el-breadcrumb separator="/">
<el-breadcrumb-item
v-for="(item, index) in routerList"
:key="index"
v-for="(item, index) in routerList"
:key="index"
>
{{ item.meta.title }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<!-- header头部 右侧内容 当前登录人和退出-->
<div class="header-right">
<div class="user-info">
<el-dropdown
trigger="click"
@command="handleCommand"
>
<div class="user-box">
<img :src="userAvator" v-if="$store.getters.userInfo.avator">
<span class="iconfont" v-else style="color: #333333;">&#xe69b;</span>
<span>您好{{ $store.getters.userInfo.uName }}</span>
<i class="el-icon-arrow-down"/>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="loginOut">退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<!-- <div class="header-right">-->
<!-- <div class="user-info">-->
<!-- <el-dropdown-->
<!-- trigger="click"-->
<!-- @command="handleCommand"-->
<!-- >-->
<!-- <div class="user-box">-->
<!-- <img :src="userAvator" v-if="$store.getters.userInfo.avator">-->
<!-- <span class="iconfont" v-else style="color: #333333;">&#xe69b;</span>-->
<!-- <span>您好{{ $store.getters.userInfo.uName }}</span>-->
<!-- <i class="el-icon-arrow-down"/>-->
<!-- </div>-->
<!-- <el-dropdown-menu slot="dropdown">-->
<!-- <el-dropdown-item command="loginOut">退出</el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</template>
<script>
import { mapMutations, mapGetters } from 'vuex'
export default {
name: 'ComHeader',
data () {
return {
routerList: [] // 面包屑数组
}
},
created () {
// 渲染面包屑数组
this.routerList = this.$route.matched
},
computed: {
// 获取用户头像
userAvator () {
return this.$store.getters.userInfo.avator || require('@/assets/images/avator_default.png')
},
...mapGetters(['isCollapse'])
},
watch: {
// 监听路由 重新渲染面包屑
$route () {
this.routerList = this.$route.matched
}
},
methods: {
// 点击下拉选项事件
handleCommand (command) {
// 退出登录
if (command === 'loginOut') {
this.$confirm('您确认要退出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: false
}).then(() => {
// this.$http.post('/logout', {}, res => {
// window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code'
// })
// return
this.$store.commit('setTypeFlag', 'loginOut')
this.$http.get('logout', {}, {
_this: this
}, res => {
this.$store.dispatch('logout')
this.$router.push('/login')
}, e => {})
}).catch(() => {
})
import { mapMutations, mapGetters } from 'vuex'
export default {
name: 'ComHeader',
data () {
return {
routerList: [] // 面包屑数组
}
},
handleToggleSideBar() {
this.toggleSideBar(!this.isCollapse)
created () {
// 渲染面包屑数组
this.routerList = this.$route.matched
},
computed: {
// 获取用户头像
userAvator () {
return this.$store.getters.userInfo.avator || require('@/assets/images/avator_default.png')
},
...mapGetters(['isCollapse'])
},
watch: {
// 监听路由 重新渲染面包屑
$route () {
this.routerList = this.$route.matched
}
},
methods: {
// 点击下拉选项事件
handleCommand (command) {
// 退出登录
if (command === 'loginOut') {
this.$confirm('您确认要退出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: false
}).then(() => {
// this.$http.post('/logout', {}, res => {
// window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code'
// })
// return
this.$store.commit('setTypeFlag', 'loginOut')
this.$http.get('logout', {}, {
_this: this
}, res => {
this.$store.dispatch('logout')
this.$router.push('/login')
}, e => {})
}).catch(() => {
})
}
},
...mapMutations(['toggleSideBar'])
handleToggleSideBar() {
this.toggleSideBar(!this.isCollapse)
},
...mapMutations(['toggleSideBar'])
}
}
}
</script>
<style lang="less" scoped>
.com-header{
padding: 0 10px;
height: 50px;
background: #ffffff;
background: #fff;
border-bottom: 1px solid #e5e5e5;
display: flex;
align-items: center;
@@ -129,7 +129,6 @@ export default {
align-items: center;
.iconfont {
font-size: 22px;
margin-right: 5px;
}
& > img{
width: 25px;
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -7,7 +7,7 @@
<span class="date">{{currentTime}}</span>
<span class="divide-line"> | </span>
<span class="user-img"></span>
<span class="user">您好{{ $store.getters.userInfo.uName }}</span>
<span class="user">{{ $store.getters.userInfo.uName }}</span>
<div class="user-info-panel-setting" @click.prevent="userInfoVisible = !userInfoVisible">
<el-dropdown
trigger="click"
@@ -37,7 +37,7 @@ export default {
},
methods: {
toHome () {
this.$router.push('/home1')
this.$router.push('/home2')
},
// 获取当前时间
getTime () {