Fixiaobai
2023-10-13 e8308ddac0ba4a1f406e8f63d7e6b6f2541cb770
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
<template>
  <div class="avue-logo">
    <transition-group name="fade">
      <template v-if="!keyCollapse">
        <!--<span
          key="1"
          class="avue-logo_title" @click="goIndex"><span
          class="logo-lg">{{sysTitle&&sysTitle!='null'?sysTitle:'ASUN-MES'}}</span></span>-->
        <!--<span key="1" class="avue-logo_title" @click="goIndex">
          <el-image
            style="width: 220px;"
            src="/images/Sun-Mes-Logo-Normal.png"
        /></span>-->
        <div key="1" style="width:220px;height:60px;background-color:white;position: relative;">
          <el-image
            v-if="logSrc != null"
            style="width:200px;position: absolute;"
            class="left-logo-image"
            :src="logSrc"
          />
          <!--<el-image
            v-else
            style="width: 220px;position: absolute;"
            class="left-logo-image"
            src="/images/Sun-Mes-Logo-Normal.png"
          />-->
          <div
            style="box-sizing:border-box;width:220px;height:60px;position: absolute;padding-left:70px;"
          >
            <div
              style="text-align:left;height: 30px;font-size:13px;line-height:60px;"
            >
              {{ iconNameCn != null ? iconNameCn : '' }}
            </div>
            <div
              style="text-align:left;height: 30px;font-size:12px;line-height:30px;"
            >
              {{ iconNameEn != null ? iconNameEn : '' }}
            </div>
          </div>
        </div>
      </template>
      <template v-if="keyCollapse">
        <span key="1" class="avue-logo_title" @click="goIndex"
          ><el-image
            style="width: 60px; height: 50px"
            src="/images/Asun-Mes-Logo-small.png"
          />
        </span>
      </template>
    </transition-group>
  </div>
</template>
 
<script>
import { getByStaffId } from '@/api/basic/company'
import { mapGetters } from 'vuex'
 
export default {
  name: 'Logo',
  data() {
    return {
      sysTitle: 'ASUN-MES',
      logSrc: '/img/logo1.png',
      iconNameCn: '',
      iconNameEn: ''
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'website', 'keyCollapse'])
  },
  created() {
    this.sysTitle = localStorage.getItem('SYSTEM_LOGO_TITLE')
    console.log('userInfouserInfo', this.userInfo)
    // this.getLogoInfo()
  },
  methods: {
    getLogoInfo() {
      this.logSrc = null
      this.iconNameCn = null
      this.iconNameEn = null
      getByStaffId(this.userInfo.staffId).then((response) => {
        const resData = response.data.data
        console.log('resData', resData)
        if (resData != null) {
          this.logSrc = resData.fileAddress
          this.iconNameCn = resData.iconNameCn
          this.iconNameEn = resData.iconNameEn
        }
      })
    },
    goIndex: function() {
      window.location.href = '/'
    }
  }
}
</script>
 
<style lang="scss">
.left-logo-image .el-image__inner {
  vertical-align: top !important;
}
.fade-leave-active {
  transition: opacity 0.2s;
}
 
.fade-enter-active {
  transition: opacity 2.5s;
}
 
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
 
.avue-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 64px;
  line-height: 64px;
  background-color: #006eff;
  font-size: 20px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.8);
  z-index: 1024;
 
  &_title {
    display: block;
    text-align: center;
    font-weight: 300;
    font-size: 16px;
  }
 
  .fade-enter-active {
    transition: opacity 2.5s;
  }
 
  .fade-enter,
  .fade-leave-to {
    opacity: 0;
  }
 
  .avue-logo {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 64px;
    line-height: 64px;
    background-color: #006eff;
    font-size: 20px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.8);
    z-index: 1024;
 
    &_title {
      display: block;
      text-align: center;
      font-weight: 300;
      font-size: 16px;
    }
 
    &_subtitle {
      display: block;
      text-align: center;
      font-size: 18px;
      font-weight: bold;
      color: #fff;
    }
  }
}
</style>