Blame view

src/layout/components/Navbar.vue 3.89 KB
任超 committed
1 2
<template>
  <div class="navbar-con">
1  
任超 committed
3
    <div class="navbar">
任超 committed
4
      <div class="title">{{ dicData['sysCode'] && dicData['sysCode'][0].DNAME }}</div>
任超 committed
5
      <div class="user">欢迎进入系统 {{ name }} <svg-icon icon-class='close' class="closeStyle" @click="onCancel" />退出系统</div>
任超 committed
6 7
      <div class="sidebarLeft">
        <sidebarLeft />
8
      </div>
任超 committed
9 10
      <div class="sidebarRight d-center">
        <sidebarRight />
任超 committed
11 12 13 14 15
      </div>
    </div>
  </div>
</template>
<script>
任超 committed
16 17 18
import sidebarLeft from './Sidebar/sidebarLeft'
import sidebarRight from './Sidebar/sidebarRight'
import { mapGetters } from 'vuex'
任超 committed
19
export default {
任超 committed
20
  components: {
任超 committed
21 22
    sidebarLeft,
    sidebarRight
任超 committed
23
  },
任超 committed
24
  computed: {
任超 committed
25
    ...mapGetters(['sidebar', 'dicData', 'name'])
任超 committed
26 27
  },
  methods: {
任超 committed
28
    onCancel () {
任超 committed
29 30 31 32 33
    }
  }
}
</script>
<style lang="scss" scoped>
任超 committed
34 35 36 37
/deep/.el-menu--horizontal {
  display: flex;
  align-items: center;
}
任超 committed
38

任超 committed
39
.menubg {
任超 committed
40
  height: 34px;
任超 committed
41 42
  width: 130px;
  text-align: center;
任超 committed
43
  color: #FFFFFF;
任超 committed
44
  margin-right: 20px;
任超 committed
45 46
  background: url('~@/image/navbar.png') no-repeat;
  background-size: 100% 100%;
任超 committed
47 48
}

任超 committed
49 50
/deep/.el-menu-item {
  @extend .menubg;
任超 committed
51 52
}

任超 committed
53 54
/deep/.el-submenu {
  @extend .menubg;
任超 committed
55 56
}

任超 committed
57
/deep/.el-submenu__title {
任超 committed
58
  height: 34px;
任超 committed
59
  color: #FFFFFF;
任超 committed
60
}
任超 committed
61

任超 committed
62 63 64
/deep/.el-submenu__title span {
  font-size: 14px;
}
任超 committed
65

任超 committed
66
.sidebarLeft {
任超 committed
67 68
  position: relative;
  top: 13px;
任超 committed
69
  left: 10px;
任超 committed
70 71
}

任超 committed
72 73
.sidebarRight {
  position: relative;
任超 committed
74 75
  left: 10px;
  top: 13px;
任超 committed
76 77
}

任超 committed
78 79
// 导航选中背景色
.xuanzhong {
任超 committed
80 81 82
  background: url('~@/image/selNavbar.png') no-repeat;
  background-size: 100% 100%;
  color: #09C39A !important;
任超 committed
83
}
任超 committed
84

任超 committed
85 86 87 88 89 90
/deep/.el-menu-item:hover {
  @extend .xuanzhong;
}

/deep/.el-submenu__title:hover {
  @extend .xuanzhong;
任超 committed
91 92
}

任超 committed
93 94 95 96
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
  @extend .xuanzhong;
}

任超 committed
97 98 99 100
/deep/.el-menu-item.is-active {
  @extend .xuanzhong;
}

任超 committed
101

任超 committed
102 103 104 105 106 107
.navbar {
  height: $headerHeight;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
任超 committed
108
  padding: 0 20px;
任超 committed
109
  justify-content: space-between;
任超 committed
110 111 112
  background: url('~@/image/header.png') no-repeat;
  background-size: 100% 100%;

任超 committed
113 114 115 116 117
  .user {
    font-size: 12px;
    color: #FFFFFF;
    position: absolute;
    right: 20px;
任超 committed
118
    top: 0;
任超 committed
119 120 121 122 123 124 125
    cursor: pointer;

    .closeStyle {
      margin-right: 5px;
    }
  }

任超 committed
126 127 128
  .title {
    position: absolute;
    left: 0;
任超 committed
129
    top: 10px;
任超 committed
130 131 132 133 134 135 136 137 138
    bottom: 0;
    right: 0;
    margin: 0 auto;
    font-size: 32px;
    color: #FFFFFF;
    font-weight: 700;
    text-align: center;

  }
任超 committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223

  .right-menu {
    float: right;
    height: 100%;
    line-height: 50px;
    display: flex;
    align-items: center;

    .shutdown {
      font-size: 20px;
      margin-left: 15px;
      cursor: pointer;
    }

    .organization-item {
      margin-right: 40px;
      margin-top: -40px !important;
    }

    .item {
      margin-right: 40px;
      margin-top: -20px;
      line-height: 18.4px;
      cursor: pointer;
      position: relative;

      .item-box {
        position: absolute;
        top: -5px;
        left: 3px;
        width: 100%;
        min-width: 25px;
        height: 25px;
        cursor: pointer;
        z-index: 100;
      }
    }

    &:focus {
      outline: none;
    }

    .right-menu-item {
      display: inline-block;
      height: 100%;
      font-size: 18px;
      color: #fff;
      vertical-align: text-bottom;

      &.hover-effect {
        cursor: pointer;
        transition: background 0.3s;
        display: flex;
        align-items: center;

        &:hover {
          background: rgba(0, 0, 0, 0.025);
        }
      }
    }

    .avatar-wrapper {
      position: relative;
      display: flex;
      height: 40px;
      align-items: center;

      .user-avatar {
        cursor: pointer;
        width: 35px;
        height: 35px;
        border-radius: 50%;
      }

      .el-icon-caret-bottom {
        cursor: pointer;
        position: absolute;
        right: -15px;
        top: 17px;
        font-size: 12px;
      }
    }
  }
}
</style>