吉安感知网项目-前端
shuishen
2026-02-03 89380e6260a75d1d3b94de687ebcc2f50d50659d
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
<template>
  <div class="avue-top">
    <div class="top-bar__left">
      任务工单管理子系统
    </div>
 
    <div class="top-bar__right">
      <div class="top-user">
<!--        <div class="icon-box">-->
<!--         <img class="gateway" @click="jumpMH" src="@/assets/images/mh.png" alt="进入门户" title="进入门户">-->
<!--        </div>-->
 
        <el-dropdown>
          <span class="el-dropdown-link">
            <img class="top-bar__img" :src="userInfo.avatar" alt="" />
          </span>
 
          <template #dropdown>
            <el-dropdown-menu>
              <!--              <el-dropdown-item>
                <router-link to="/">{{ $t('navbar.dashboard') }}</router-link>
              </el-dropdown-item>-->
              <!-- <el-dropdown-item>
                <router-link to="/info/index">{{ $t('navbar.userinfo') }}</router-link>
              </el-dropdown-item> -->
              <el-dropdown-item @click="logout">{{ $t('navbar.logOut') }}
              </el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <top-setting></top-setting>
      </div>
    </div>
  </div>
</template>
 
<script>
import { mapGetters } from 'vuex'
import topLock from './top-lock.vue'
import topMenu from './top-menu.vue'
import topSearch from './top-search.vue'
import topTheme from './top-theme.vue'
import topLogs from './top-logs.vue'
import topColor from './top-color.vue'
import topLang from './top-lang.vue'
import topFull from './top-full.vue'
import topQna from './top-qna.vue'
import topSetting from '../setting.vue'
 
export default {
  components: {
    topLock,
    topMenu,
    topSearch,
    topTheme,
    topLogs,
    topColor,
    topLang,
    topFull,
    topQna,
    topSetting,
  },
  name: 'top',
  data () {
    return {}
  },
  filters: {},
  created () { },
  computed: {
    ...mapGetters([
      'setting',
      'userInfo',
      'tagWel',
      'bsTagList',
      'isCollapse',
      'tag',
      'logsLen',
      'logsFlag',
      'isHorizontal',
    ]),
  },
  methods: {
    logout () {
      this.$confirm(this.$t('logoutTip'), this.$t('提示'), {
        confirmButtonText: this.$t('submitText'),
        cancelButtonText: this.$t('cancelText'),
        type: 'warning',
      }).then(() => {
        this.$store.dispatch('LogOut').then(() => {
        const env = import.meta.env.VITE_APP_ENV
          const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
                    this.$router.push({ path: '/login' })
           // env === 'development' ? this.$router.push({ path: '/login' }):window.location.replace(`${adminUrl}#/login`)
        })
      })
    },
    jumpMH () {
      const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
      window.location.href = `${adminUrl}#/gatewayPage`
    },
  },
}
</script>
 
<style lang="scss" scoped>
.avue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
 
.top-bar__left {
  flex: 0 0 auto;
}
 
.top-bar__title {
  flex: 1;
  display: flex;
  align-items: center;
  height: pxToVh(80);
}
 
.top-bar__right {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  height: 100%;
  pointer-events: auto;
  box-sizing: border-box;
 
  .icon-box {
    margin-right: 62px;
    display: flex;
    align-items: center;
 
    .gateway {
      width: 32px;
      height: 32px;
    }
 
    >* {
      cursor: pointer;
    }
  }
}
 
.top-bar__item {
  margin-right: 15px;
  display: inline-block !important;
}
 
.top-user {
  display: flex;
  align-items: center;
}
 
.top-bar__img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
 
.el-dropdown-link {
  cursor: pointer;
  color: #606266;
}
 
.el-dropdown-link:hover {
  color: #409EFF;
}
</style>