Blame view

antis-ncc-admin/src/components/VisualPortal/CommonFunc/index.vue 1.38 KB
03207d5d   wwk   1
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
  <template>
    <el-card shadow="never" class="commonFunc-box">
      <div slot="header" class="portal-common-title">
        <span>{{title}}</span>
      </div>
      <div class="commonFunc-box-body">
        <router-link class="item" :to="'/'+item.urlAddress" v-for="(item,i) in menuList" :key="i">
          <i :class="item.icon" :style="{color:item.iconBackgroundColor||'#1890FF'}"></i>
          <p class="name">{{item.fullName}}</p>
        </router-link>
      </div>
    </el-card>
  </template>
  <script>
  export default {
    props: {
      title: { type: String, default: '' },
      list: { type: Array, default: () => [] }
    },
    data() {
      return {
        menuList: []
      }
    },
    created() {
      this.menuList = this.list.filter(o => o.id)
    },
    watch: {
      list: {
        handler(val) {
          this.menuList = val.filter(o => o.id)
        },
        deep: true
      }
    }
  }
  </script>
  <style lang="scss" scoped>
  .commonFunc-box {
    >>> .el-card__body {
      width: 100%;
      height: calc(100% - 55px);
    }
    .commonFunc-box-body {
      padding: 0 30px;
      height: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .item {
        display: block;
        text-align: center;
        i {
          display: inline-block;
          height: 40px;
          font-size: 40px;
          margin-bottom: 10px;
        }
        .name {
          font-size: 14px;
          line-height: 20px;
        }
      }
    }
  }
  </style>