Blame view

src/layout1/components/Navbar.vue 4.72 KB
任超 committed
1 2 3
<template>
  <div class="navbar-con">
    <div class="navbar">
任超 committed
4
      <div class="logo">
xiaomiao committed
5 6
        <img :src="require('@/image/bdclogo.png')" alt="" />
        <h4>不动产登记上报系统</h4>
任超 committed
7
      </div>
任超 committed
8 9 10 11 12 13 14 15 16 17 18
      <div class="right-menu">
        <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover" @command="handleCommand">
          <div class="avatar-wrapper">
            <span style="padding-right:10px">{{ name }}</span>
            <img :src="avatar + '?imageView2/1/w/80/h/80'" class="user-avatar" />
          </div>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="a">个人中心</el-dropdown-item>
            <el-dropdown-item command="b">退出</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
任超 committed
19 20 21 22 23
      </div>
    </div>
  </div>
</template>
<script>
任超 committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
import { mapGetters } from 'vuex'
import Breadcrumb from './Breadcrumb'
import defaultSettings from '@/settings'
export default {
  components: {
    Breadcrumb
  },
  computed: {
    ...mapGetters(['sidebar', 'avatar', 'name'])
  },
  data () {
    return {
      title: defaultSettings.title
    }
  },
  methods: {
    handleDataView () {
      const { href } = this.$router.resolve('/dataView');
      window.open(href, '_blank');
xiaomiao committed
43
    },
任超 committed
44 45
    themeChange (val) {
      this.$store.dispatch('app/updateTheme', val)
任超 committed
46
    },
任超 committed
47 48 49
    handleCommand (command) {
      if (command == 'a') {
      } else {
任超 committed
50

任超 committed
51 52 53
      }
    }
  }
任超 committed
54
}
任超 committed
55 56
</script>
<style lang="scss" scoped>
任超 committed
57
@import "~@/styles/_handle.scss";
任超 committed
58

任超 committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
.navbar-con {
  position: relative;

  .logo {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    display: flex;

    img {
      width: 47px;
      height: 47px;
    }

    h4 {
      margin-left: 20px;
      height: 50px;
      line-height: 50px;
xiaomiao committed
77
    }
任超 committed
78
  }
任超 committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
}

.NoticeBar {
  position: absolute;
  bottom: 0;
}

.el-dropdown-menu {
  padding: 0 !important;
  border: 1px solid #ebeef5;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  border-radius: 4px 0 0 4px 4px;

  .el-dropdown-menu__item {
    text-align: center;
    margin-top: 0 !important;
    font-size: 14px;
    font-weight: 400;
    color: #4a4a4a;
    width: 140px;
    height: 36px;
    line-height: 36px;
  }
任超 committed
102

任超 committed
103 104
  .el-dropdown-menu__item:nth-child(6) {
    border-top: 1px solid #ebeef5;
105
  }
任超 committed
106

任超 committed
107 108 109 110 111
  .popper__arrow {
    top: -11px !important;
    left: 110px !important;
    transform: rotate(0deg) scale(2);
  }
任超 committed
112

任超 committed
113 114 115 116 117 118
  .el-dropdown-menu__item:not(.is-disabled):hover,
  .el-dropdown-menu__item:focus {
    background: #f6f7f9;
    color: #4a4a4a;
  }
}
任超 committed
119

任超 committed
120 121 122 123 124
.navbar {
  height: $headerHeight;
  overflow: hidden;
  position: relative;
  @include background_color("navbg");
任超 committed
125

任超 committed
126 127 128 129 130 131 132
  display: flex;
  align-items: center;
  padding-right: 20px;
  justify-content: space-between;

  .header-logo {
    width: 300px;
133 134
  }

任超 committed
135 136 137 138
  .backdrop {
    flex: 1;
    width: 60%;
    background-size: 100% 100%;
xiaomiao committed
139
    height: $headerHeight;
任超 committed
140 141
    display: flex;
    align-items: center;
任超 committed
142
  }
任超 committed
143

任超 committed
144 145 146 147 148 149 150 151 152 153
  .hamburger-container {
    line-height: 43px;
    height: 100%;
    float: left;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;

    &:hover {
      background: rgba(0, 0, 0, 0.025);
154
    }
任超 committed
155
  }
xiaomiao committed
156

任超 committed
157 158 159
  .breadcrumb-container {
    float: left;
  }
xiaomiao committed
160

任超 committed
161 162 163 164 165 166 167 168 169 170
  .right-menu {
    float: right;
    height: 100%;
    line-height: 50px;
    display: flex;
    align-items: center;

    .function {
      margin: 0 15px;
      cursor: pointer;
任超 committed
171 172
    }

任超 committed
173 174 175 176
    .shutdown {
      font-size: 20px;
      margin-left: 15px;
      cursor: pointer;
任超 committed
177 178
    }

任超 committed
179 180 181 182
    .organization-item {
      margin-right: 40px;
      margin-top: -40px !important;
    }
任超 committed
183

任超 committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197
    .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;
xiaomiao committed
198
        cursor: pointer;
任超 committed
199
        z-index: 100;
xiaomiao committed
200
      }
任超 committed
201
    }
任超 committed
202

任超 committed
203 204 205
    &:focus {
      outline: none;
    }
任超 committed
206

任超 committed
207 208 209 210 211 212
    .right-menu-item {
      display: inline-block;
      height: 100%;
      font-size: 18px;
      color: #fff;
      vertical-align: text-bottom;
xiaomiao committed
213

任超 committed
214
      &.hover-effect {
215
        cursor: pointer;
任超 committed
216 217 218
        transition: background 0.3s;
        display: flex;
        align-items: center;
xiaomiao committed
219

任超 committed
220 221
        &:hover {
          background: rgba(0, 0, 0, 0.025);
xiaomiao committed
222 223
        }
      }
任超 committed
224
    }
xiaomiao committed
225

任超 committed
226 227 228 229 230
    .avatar-wrapper {
      position: relative;
      display: flex;
      height: 40px;
      align-items: center;
xiaomiao committed
231

任超 committed
232 233 234 235 236 237
      .user-avatar {
        cursor: pointer;
        width: 35px;
        height: 35px;
        border-radius: 50%;
      }
xiaomiao committed
238

任超 committed
239 240 241 242 243 244
      .el-icon-caret-bottom {
        cursor: pointer;
        position: absolute;
        right: -15px;
        top: 17px;
        font-size: 12px;
任超 committed
245 246 247
      }
    }
  }
任超 committed
248
}
任超 committed
249
</style>