ZhangXianQiang
2024-03-06 c0ec39cf3b2e92d64cd4056938ea6e282fcc021a
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
<template>
  <div class="data-container">
    <el-row>
      <el-col>
        <h1 class="title">运维报表</h1>
      </el-col>
    </el-row>
    <el-row :gutter="20" class="data-plane">
      <el-col :xs='24' :md="6" :xl="{ span: '4-8' }" :sm="12" v-for="item, index in dataList" :key="item.id">
        <div class="col-content">
          <el-card>
            <el-row type="flex" align="middle" justify="space-between">
              <el-col :xl="8" :lg="8" :md="10" :sm="8" :xs="6">
                <div class="icon-container" :style="{ backgroundColor: iconList[index].color }">
                  <i :class="iconList[index].icon" class="icon-font"></i>
                </div>
              </el-col>
              <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16">
                <div class="data-info">
                  <div class="data-num">{{ item.num }}</div>
                  <div class="data-lable">{{ item.type }}</div>
                </div>
              </el-col>
            </el-row>
          </el-card>
        </div>
      </el-col>
 
    </el-row>
  </div>
 
</template>
 
<script>
export default {
  name: 'DataView',
  data() {
    return {
      dataList: [
        { id: 1, type: '工单数', num: 523, },
        { id: 2, type: '恢复数', num: 50, },
        { id: 3, type: '待恢复数', num: 523, },
        { id: 4, type: '产生违约事项数', num: 123, },
        { id: 5, type: '产生违约责任书', num: 512323, },
      ],
      iconList: [
        { icon: 'el-icon-tickets', color: '#7868d9' },
        { icon: 'el-icon-s-claim', color: '#3eba45' },
        { icon: 'el-icon-edit', color: '#3da7f8' },
        { icon: 'el-icon-warning', color: '#ffbe40' },
        { icon: 'el-icon-error', color: '#fe640d' },
      ]
    }
  }
}
</script>
 
<style lang="scss" scoped>
.data-container {
  margin-bottom: 20px;
}
.title {
  text-align: left;
}
 
.icon-container {
  height: 80px;
}
 
.col-content {
  margin-bottom: 10px;
}
 
.icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
 
  .icon-font {
    font-size: 30px;
    color: #fff;
  }
}
 
.data-info {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  text-align: left;
 
  .data-num {
    font-size: 32px;
  }
 
  .data-lable {
    font-size: 16px;
    text-indent: 3px;
  }
}
 
@media screen and (min-width: 1200px) {
  .el-col-md-6 {
    width: 20%;
  }
}
</style>