blocHome.vue
3.95 KB
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
<template>
<div class="bloc-container">
<div class="top_wrapper">
<div class="left_box_wrap"></div>
<div class="right_wrap">
<div class="right_top_wrap">
<div class="r_t_box"></div>
<div class="r_t_box"></div>
<div class="r_t_box r_t_box_max"></div>
</div>
<div class="right_bottom_wrap"></div>
</div>
</div>
<div class="bottom_wrapper">
<div class="table_title flex_scb">
<span class="h12_title">门店直播产值详情</span>
<span class="export_span">
导出
<i class="el-icon-d-arrow-right"></i>
</span>
</div>
<div class="tbale_wrap">
<el-table :data="tableData" height="350" style="100%" highlight-current-row>
<el-table-column prop="merchantName" label="门店名称" width="300px" align="center"></el-table-column>
<el-table-column prop="count" label="参与场次" width="100px" align="center"></el-table-column>
<el-table-column prop="total" label="总产值" width="500px">
<template slot-scope="scope">
<div class="echat_wrap">
<div class="h19_title xtext">¥{{ scope.row.total }}</div>
<div class="progress_wrap">
<div :style="{ width: (100 * scope.row.total) / custSortMax + '%' }" class="summary-progress-barin"></div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="平均单场产值" align="center">
<template slot-scope="scope">
<div class="h19_title">¥{{ scope.row.perProduct }}</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tableData: [],
custSortMax: 0
}
},
mounted() {
// 模拟数据
this.custSortMax = 0
for (let i = 0; i < 10; i++) {
let obj = {
merchantName: '门店' + i,
count: i + 10,
total: Math.round(Math.random() * 10000),
perProduct: Math.round(Math.random() * 6000)
}
this.tableData.push(obj)
}
this.tableData.forEach(item => {
if (item.total >= this.custSortMax) {
this.custSortMax = item.total
}
})
}
}
</script>
<style lang="scss" scoped>
.bloc-container {
margin-top: 17px;
}
.top_wrapper {
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding: 20px 10px 20px 20px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.left_box_wrap {
width: 300px;
height: 350px;
border-radius: 2px;
border: 1px solid #eae9ee;
}
.right_wrap {
width: calc(100% - 310px);
.right_top_wrap {
display: flex;
justify-content: space-between;
.r_t_box {
// width: 240px;
width: calc(30% - 5px);
height: 160px;
background: #ffffff;
border-radius: 2px;
border: 1px solid #eae9ee;
}
.r_t_box_max {
width: calc(40% - 10px);
}
}
.right_bottom_wrap {
margin-top: 10px;
height: 180px;
background: #ffffff;
border-radius: 2px;
border: 1px solid #eae9ee;
}
}
}
.bottom_wrapper {
margin-top: 10px;
height: 398px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 15px;
.table_title {
padding: 0 0 10px 0;
.export_span {
font-size: 14px;
font-weight: 500;
color: #5850ff;
cursor: pointer;
> i {
color: #5850ff;
margin-left: 5px;
}
}
}
.tbale_wrap {
.echat_wrap {
display: flex;
align-items: center;
.xtext {
width: 20%;
}
.progress_wrap {
width: 65%;
margin-left: 10px;
}
.summary-progress-barin {
height: 15px;
background-color: #5850ff;
}
}
}
}
</style>