Blame view

src/layout/components/Navbar.vue 4.05 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 70 71 72 73 74 75 76 77 78 79
  width: 30%;
}

/deep/.el-menu {
  display: flex;
  justify-content: space-between;
}

/deep/.el-menu-item {
  flex: 1;
  width: 100%;
任超 committed
80 81
}

任超 committed
82 83
.sidebarRight {
  position: relative;
任超 committed
84
  top: 13px;
任超 committed
85 86
  width: 30%;
  padding-left: 20px;
任超 committed
87 88
}

任超 committed
89 90
// 导航选中背景色
.xuanzhong {
任超 committed
91 92
  background: url('~@/image/selNavbar.png') no-repeat;
  background-size: 100% 100%;
任超 committed
93
  color: #FFFFFF !important;
94
  font-weight: 700;
任超 committed
95
}
任超 committed
96

任超 committed
97 98 99 100 101 102
/deep/.el-menu-item:hover {
  @extend .xuanzhong;
}

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

任超 committed
105 106 107 108
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
  @extend .xuanzhong;
}

任超 committed
109 110 111 112
/deep/.el-menu-item.is-active {
  @extend .xuanzhong;
}

任超 committed
113

任超 committed
114 115 116 117 118 119
.navbar {
  height: $headerHeight;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
任超 committed
120
  padding: 0 20px;
任超 committed
121
  justify-content: space-between;
任超 committed
122 123 124
  background: url('~@/image/header.png') no-repeat;
  background-size: 100% 100%;

任超 committed
125 126 127 128 129
  .user {
    font-size: 12px;
    color: #FFFFFF;
    position: absolute;
    right: 20px;
任超 committed
130
    top: 0;
任超 committed
131 132 133 134 135 136 137
    cursor: pointer;

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

任超 committed
138 139 140
  .title {
    position: absolute;
    left: 0;
任超 committed
141
    top: 10px;
任超 committed
142 143 144 145 146 147 148 149 150
    bottom: 0;
    right: 0;
    margin: 0 auto;
    font-size: 32px;
    color: #FFFFFF;
    font-weight: 700;
    text-align: center;

  }
任超 committed
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 224 225 226 227 228 229 230 231 232 233 234 235

  .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>