wangting
2025-01-16 18c43123b51a1688ab4ae01fe3d171c7d92e619b
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
<template>
  <div>
    <component :is="showComponent"></component>
  </div>
</template>
 
<script>
import {mapGetters} from "vuex";
import adminIndex from './adminIndex.vue';
import workIndex from './workIndex.vue';
 
export default {
  name: "wel",
  components:{adminIndex,workIndex},
  data() {
    return {
      showComponent: null, // 初始不显示任何组件
    };
  },
  computed: {
    ...mapGetters(["userInfo"]),
  },
  watch: {
    'userInfo.userId'() {
      //是管理员进入管理员首页
      if(this.userInfo.userId.includes('admin')){
        this.showComponent=adminIndex;
      }else {
        this.showComponent=workIndex;
      }
    }
  },
  created() {
    //是管理员进入管理员首页
    if(this.userInfo.userId.includes('admin')){
      this.showComponent=adminIndex;
    }else {
      this.showComponent=workIndex;
    }
  },
  methods: {
 
  },
};
</script>
 
<style>
.el-font-size {
  font-size: 14px;
}
 
.avue-text-ellipsis__text {
  font-size: 14px !important;
}
 
#chart {
  width: 100%;
  height: 309px;
}
</style>