Blame view

HHECS.Web/src/layout/components/Sidebar/Logo.vue 2.77 KB
胡菁 authored
1
<template>
王硕 authored
2
  <div class="sidebar-logo-container" :class="{ collapse: collapse }">
胡菁 authored
3
    <transition name="sidebarLogoFade">
王硕 authored
4
5
6
7
8
9
10
      <router-link
        v-if="collapse"
        key="collapse"
        class="sidebar-logo-link"
        to="/"
      >
        <img v-if="logo" :src="logo" class="sidebar-logo" />
胡菁 authored
11
        <h1 v-else class="sidebar-title">{{ $t("system.systemName") }}</h1>
胡菁 authored
12
13
      </router-link>
      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
胡菁 authored
14
15
16
17
18
19
20
21
22
        <h1 class="sidebar-title">
          <img v-if="logo" :src="logo" class="sidebar-logo" />

          <!-- style="
            background-image: url('@/assets/images/logo.png');
            background-size: 100% 100%;
            background-position: center;
            background-repeat: no-repeat;
          " -->
胡菁 authored
23
24
          <!-- 长沙华恒ECS系统 -->
          {{ $t("system.systemName") }}
胡菁 authored
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          <!-- <span
            style="
              background-color: #555555;
              color: #fff;
              border-radius: 5px 0px 0px 5px;
              padding: 5px 0px 5px 5px;
              font-size: 10pt;
            "
          >
            ECS
          </span> -->
          <span
            style="
              background-color: #4eb899;
              color: #fff;
              border-radius: 5px;
              padding: 4px 5px 3px 5px;
              font-size: 10pt;
            "
            >5.0</span
          >
        </h1>
胡菁 authored
47
48
49
50
51
52
53
      </router-link>
    </transition>
  </div>
</template>

<script>
export default {
王硕 authored
54
  name: "SidebarLogo",
胡菁 authored
55
56
57
  props: {
    collapse: {
      type: Boolean,
王硕 authored
58
59
      required: true,
    },
胡菁 authored
60
61
62
  },
  data() {
    return {
王硕 authored
63
64
65
66
      logo: "favicon.ico", // 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
    };
  },
};
胡菁 authored
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
</script>

<style lang="scss" scoped>
.sidebarLogoFade-enter-active {
  transition: opacity 1.5s;
}

.sidebarLogoFade-enter,
.sidebarLogoFade-leave-to {
  opacity: 0;
}

.sidebar-logo-container {
  position: relative;
  width: 100%;
  height: 50px;
  line-height: 50px;
  background: #2b2f3a;
胡菁 authored
85
86
87
88
  //   background-image: url("../../../assets/images/logo.png");
  //   background-size: 100% 100%;
  //   background-position: center;
  //   background-repeat: no-repeat;
胡菁 authored
89
90
91
92
93
94
95
96
97
98
99
  text-align: center;
  overflow: hidden;

  & .sidebar-logo-link {
    height: 100%;
    width: 100%;

    & .sidebar-logo {
      width: 32px;
      height: 32px;
      vertical-align: middle;
胡菁 authored
100
      //   margin-right: 12px;
胡菁 authored
101
102
103
    }

    & .sidebar-title {
胡菁 authored
104
      //   display: inline-block;
胡菁 authored
105
106
107
108
      margin: 0;
      color: #fff;
      font-weight: 600;
      line-height: 50px;
胡菁 authored
109
      font-size: 18px;
胡菁 authored
110
111
112
113
114
115
116
117
118
119
120
121
      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
      vertical-align: middle;
    }
  }

  &.collapse {
    .sidebar-logo {
      margin-right: 0px;
    }
  }
}
</style>