ke_junjie
2025-06-04 bb6e2230bb8ded3c5546bc4e4c282ee343754475
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
<!--  -->
<template>
  <div class="navtab">
    <div class="flex heard-title align-center justify-between">
      <div class="flex align-end">
        <svg-icon
          style="font-size: 20px"
          class="svgicon margin-right pointer"
          @click="toggleSideBar"
          iconClass="align-right"
          classNames="alignSvg"
          :class="{ isActive: isCollapse }"
        />
        <p class="title">智能化立体库管理系统</p>
      </div>
 
      <div class="technical">
        <el-dropdown class="right-menu">
          <div class="avatar-wrapper flex align-center">
            <img src="../../assets/heard/heard.jpg" class="user-avatar" />
            <span class="margin-left pointer text-overflow">{{ userinfo.userName }}</span>
          </div>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item> {{ userinfo.deptName }} </el-dropdown-item>
            <el-dropdown-item divided @click.native="logout">
              <p>退出登录</p>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <div class="Breadcrumb">
      <tags-view />
    </div>
  </div>
</template>
 
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import { mapGetters } from 'vuex';
import TagsView from './TagsView/index';
import { getCache } from '@/utils/sessionStorage';
import ResizeMixin from '@/mixins/layout';
export default {
  //name放入模板名,方便在其他地方引用
  name: '',
  //import引入的组件需要注入到对象中才能使用
  components: { TagsView },
  mixins: [ResizeMixin],
  data() {
    //这里存放数据
    return {
      userinfo: getCache('userInfo')
    };
  },
  //监听属性 类似于data概念
  computed: {
    ...mapGetters(['sidebar']),
    isCollapse() {
      return this.sidebar;
    }
  },
  //生命周期 - 创建完成(可以访问当前this实例)
  created() {},
  //生命周期 - 挂载完成(可以访问DOM元素)
  mounted() {},
  //方法集合
  methods: {
    toggleSideBar() {
      this.$store.dispatch('setting/togglesidebar');
    },
    async logout() {
      await this.$store.dispatch('user/logout');
      this.$store.dispatch('permission/generateRoutes', []);
      this.$router.push({ path: '/login' });
    }
  },
  //监控data中的数据变化
  watch: {},
  //如果页面有keep-alive缓存功能,这个函数会触发
  activated() {}
};
</script>
<style lang="scss" scoped>
/* @import url(); 引入公共css类 */
.navtab {
  width: 100%;
  height: 80px;
  border-bottom: 1px solid #d6e2e9;
  box-shadow: 0 0 4px #345;
  .isActive {
    transform: rotate(180deg);
  }
  .Breadcrumb {
    display: flex;
    align-items: center;
    .svgicon {
      padding: 0 15px;
    }
  }
  .technical {
    display: flex;
    align-items: center;
    width: 11%;
    justify-content: flex-end;
    .right-menu {
      margin-right: 15px;
      .avatar-wrapper {
        margin: auto;
        display: flex;
        .user-avatar {
          cursor: pointer;
          width: 24px;
          height: 24px;
          border-radius: 10px;
        }
      }
    }
    .full {
      cursor: pointer;
    }
  }
  .heard-title {
    height: 50px;
    padding-left: 10px;
    background-color: rgb(255, 255, 255);
    border-radius: 0px !important;
    .title {
      // padding: 13px 10px 10px;
      font-size: 20px;
    }
  }
}
</style>