project.vue
3.54 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
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-03-02 09:46:55
* @FilePath: \dj-data-view\src\views\saas\project.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="project-wrap flex">
<div class="project-item flex" v-for="(item, index) in projectList" :key="index">
<div class="project-left">
<div :class="['project-title', { fontSmall: index == 3 }]">{{ item.name }}</div>
<div class="project-icon"><img src="@/assets/images/arrow.png" alt="" /></div>
</div>
<div class="project-right flex">
<div class="project-content-item">
<div class="project-content-desc">展业门店数</div>
<div class="project-content-num">{{ item.totalNum }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">当年新增</div>
<div class="project-content-num">{{ item.incrNum }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">转化率</div>
<div class="project-content-num">{{ toFixRatio(item.conversionrate) }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">客单价</div>
<div class="project-content-num">{{ toFixNum(item.atv) }}</div>
</div>
<div class="project-content-item">
<div class="project-content-desc">GMV</div>
<div class="project-content-num">{{ numAddSymbol(item.outputValue) }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
import datas from '../../utils/data'
export default {
name: 'Project',
data() {
return {
projectList: []
}
},
mounted() {
this.getBusinessType()
},
methods: {
toFixRatio(val) {
return (val * 100).toFixed(2) + '%'
},
toFixNum(val) {
return this.numAddSymbol(Math.round(val))
},
getBusinessType() {
this.api.sass.getBusinessType().then(res => {
if (res.code == 0) {
this.projectList = res.data.dataList
}
})
}
}
}
</script>
<style lang="scss" scoped>
.project-wrap {
margin-top: 1.5vh;
height: 11.71vh;
flex-wrap: wrap;
justify-content: space-between;
.project-item {
width: 49.6%;
background: #0b0e31;
.project-left {
width: 2.8vw;
padding: 0px 0.4vw;
height: 5.61vh;
background: #2436b7;
text-align: center;
.project-title {
color: #e8e8e8;
font-size: 10px;
line-height: 12px;
margin-top: 0.4vh;
// &.fontSmall {
// font-size: 9px;
// }
}
.project-icon {
width: 1.25vw;
height: 1.22vh;
margin: 0 auto;
}
}
.project-right {
flex: 1;
.project-content-item {
&:first-child {
width: 22%;
}
&:nth-child(2) {
width: 16%;
}
&:nth-child(3) {
width: 16%;
}
&:nth-child(4) {
width: 17%;
}
&:nth-child(5) {
width: 28%;
}
padding-left: 0.5vw;
.project-content-desc {
font-size: 9px;
color: #dddddd;
}
.project-content-num {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
}
}
}
}
</style>