performanceStatus.vue
2.68 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
<!-- 业绩状况 -->
<template>
<div class="performance-status">
<div class="header">业绩状况(延保)</div>
<div class="tabs">
<div
:class="{
'tabs-item': true,
'tabs-item-active': index === activeIndex
}"
v-for="(item, index) in timeData"
:key="index"
@click="handleClick(index)"
>
{{ item.text }}
</div>
</div>
<div class="content">
<!-- 产值 -->
<div class="content-item">
<div class="title">个人产值(元)</div>
<echart-bar
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-bar>
</div>
<div class="content-item">
<div class="title">转化率(%)</div>
<echart-line
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-line>
</div>
<div class="content-item">
<div class="title">客单价(元)</div>
<echart-bar
class="echart"
id="production"
:xData="xData"
:yData="yData"
></echart-bar>
</div>
</div>
</div>
</template>
<script>
import EchartLine from "./echartLine"
import EchartBar from "./echartBar"
export default {
components: {
EchartLine,
EchartBar
},
name: "performanceStatus",
data() {
return {
xData: ["2021-01-01", "2021-01-02", "2021-01-03", "2021-01-04"],
yData: [15600, 24897, 24897, 18350],
activeIndex: 0,
timeData: [
{
text: "近4周",
value: 1
},
{
text: "近4月",
value: 2
}
]
}
},
methods: {
handleClick(index) {
this.activeIndex = index
}
}
}
</script>
<style scoped lang="scss">
.performance-status {
.header {
color: #111111;
font-size: 16px;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
.tabs {
margin: 12px 0 16px 20px;
display: flex;
align-items: center;
background: #fff;
border-radius: 2px;
.tabs-item {
padding: 6px 20px;
cursor: pointer;
font-size: 12px;
font-weight: 400;
color: #1d1d1d;
border: 1px solid #dbdbdb;
}
.tabs-item-active {
color: #ffffff;
background: #2a58ad;
}
}
.content {
margin: 20px;
display: flex;
height: 238px;
width: 100%;
.content-item {
flex: 1;
.echart {
width: 100%;
height: 100%;;
}
.title {
color: #333333;
font-size: 14px;
font-weight: 400;
margin-bottom: 12px;
}
}
}
}
</style>