| | |
| | | <div class="sub-nav-list" v-show="item.children && item.childrenFlag"> |
| | | <div v-for="(subItem, subIndex) in item.children" :key="subIndex" @click="goToPath(subItem)"> |
| | | {{ |
| | | subItem.menuName |
| | | }} |
| | | subItem.menuName |
| | | }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="sub-nav-list" v-show="item.children && item.childrenFlag"> |
| | | <div v-for="(subItem, subIndex) in item.children" :key="subIndex" @click="goToPath(subItem)"> |
| | | {{ |
| | | subItem.menuName |
| | | }} |
| | | subItem.menuName |
| | | }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <!-- 用户登录展示的 --> |
| | | <div class="user-infor" @click="openUser"> |
| | | <div class="userIcon" :class="{on: userOn == true}"> |
| | | <div class="userIcon" :class="{ on: userOn == true }"> |
| | | <i class="el-icon-user-solid"></i> |
| | | </div> |
| | | <div class="userDetail" v-if="isShowUserDetail"> |
| | | <div class="triangle"></div> |
| | | <div class="userName">用户名:{{user.user_name}}</div> |
| | | <div class="userName">用户名:{{ user.user_name }}</div> |
| | | <div class="userBtn"> |
| | | <div class="edit" @click="goTOLogout"> |
| | | <img src="../../../public/img/bg/editLogin.webp" alt /> |
| | |
| | | <script> |
| | | import getUserInfo from '@/utils/auth' |
| | | export default { |
| | | data () { |
| | | data() { |
| | | return { |
| | | menuLeftList: [ |
| | | { |
| | |
| | | currentUrl: '/lyout/home', |
| | | userOn: false, |
| | | isShowUserDetail: false, |
| | | user:{} |
| | | user: {} |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | created() { |
| | | this.currentUrl = this.$route.path |
| | | this.user = getUserInfo() |
| | | console.log(this.user,4451211) |
| | | console.log(this.user, 4451211) |
| | | }, |
| | | |
| | | watch: { |
| | | $route: { |
| | | handler (newPath, oldPath) { |
| | | handler(newPath, oldPath) { |
| | | this.currentUrl = newPath.path |
| | | |
| | | this.$nextTick(() => { |
| | |
| | | } |
| | | }, |
| | | |
| | | mounted () { |
| | | mounted() { |
| | | }, |
| | | |
| | | methods: { |
| | | //登出 |
| | | goTOLogout(){ |
| | | //跳转登录页 |
| | | this.$router.push({ path: "/login" }); |
| | | goTOLogout() { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | this.$router.push({ path: "/login" }); |
| | | }); |
| | | }, |
| | | /** |
| | | * @description: 路由跳转的事件 |
| | |
| | | * @param {*} e 子元素上绑定的的自定义属性 |
| | | * @return {*} 没有返回值 |
| | | */ |
| | | goToPath (params) { |
| | | goToPath(params) { |
| | | if (params.openExternal) { |
| | | window.open(params.path) |
| | | return |
| | |
| | | |
| | | }, |
| | | |
| | | flexibelClick () { |
| | | flexibelClick() { |
| | | this.show = !this.show |
| | | |
| | | if (this.$refs['target-name'].boxResize) this.$refs['target-name'].boxResize(this.show) |
| | |
| | | } |
| | | }, |
| | | |
| | | resize (val, flag = false) { |
| | | resize(val, flag = false) { |
| | | this.boxWidth = val |
| | | |
| | | this.show = flag |
| | |
| | | }) |
| | | }, |
| | | |
| | | openUser () { |
| | | openUser() { |
| | | this.userOn = !this.userOn |
| | | this.isShowUserDetail = !this.isShowUserDetail |
| | | }, |
| | |
| | | .userIcon.on { |
| | | color: rgba(252, 189, 86, 1); |
| | | } |
| | | |
| | | .userDetail { |
| | | width: 180px; |
| | | height: 92px; |
| | |
| | | border-left-color: transparent; |
| | | border-right-color: transparent; |
| | | } |
| | | |
| | | .userName { |
| | | width: 100%; |
| | | height: 40px; |
| | |
| | | position: absolute; |
| | | top: 0px; |
| | | } |
| | | |
| | | .userBtn { |
| | | width: 100%; |
| | | height: 50px; |
| | |
| | | justify-content: space-around; |
| | | padding-top: 4px; |
| | | |
| | | & > div { |
| | | &>div { |
| | | width: 100px; |
| | | height: 40px; |
| | | background-color: rgba(168, 222, 255, 0.6); |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | line-height: 44px; |
| | | |
| | | img { |
| | | width: 76px; |
| | | height: 20px; |