| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:24 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2022-12-19 11:24:14 |
| | | * @LastEditTime: 2022-12-27 09:32:53 |
| | | * @FilePath: \srs-police-affairs\src\views\lyout\index.vue |
| | | * @Description: |
| | | * |
| | |
| | | <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 /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import getUserInfo from '@/utils/auth' |
| | | import { getUserInfo } from '@/utils/auth' |
| | | export default { |
| | | data () { |
| | | return { |
| | |
| | | currentUrl: '/lyout/home', |
| | | userOn: false, |
| | | isShowUserDetail: false, |
| | | user:{} |
| | | user: {} |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | this.currentUrl = this.$route.path |
| | | this.user = getUserInfo() |
| | | console.log(this.user,4451211) |
| | | console.log(this.user, 4451211) |
| | | }, |
| | | |
| | | watch: { |
| | |
| | | |
| | | methods: { |
| | | //登出 |
| | | goTOLogout(){ |
| | | goTOLogout () { |
| | | //跳转登录页 |
| | | this.$router.push({ path: "/login" }); |
| | | this.$router.push({ path: "/login" }) |
| | | }, |
| | | /** |
| | | * @description: 路由跳转的事件 |
| | |
| | | .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; |