ViewSurface.vue
3.63 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
157
158
159
160
161
162
163
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 10:58:34
* @FilePath: \dj-data-view\src\components\ViewSurface.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class='surface box' :class="isEqually?'whetherToDivideEqually':''">
<div class='title title-icon'>
<!-- <span class='icon'></span>-->
<div class='title-h3' v-if='title'>{{ title }}</div>
<span class='merchantName' v-if='merchantName'>{{ merchantName }}</span>
<!-- <div class='go'>-->
<!-- <img src='@/assets/images/go.png' />-->
<!-- </div>-->
<SelectCpn
v-if='showSeletion'
:selectName="'业务:'"
:selectArr='businessList'
:selectType="'springbudAtion'"></SelectCpn>
<div
v-if='isMonthDay'
class='month-day-wrap'
v-for='(item,index) in monthDayList' :key='index'
@click='changeMonthDay(item,index)'>
<div class='form' :class="currentIndex==index? 'light':''">{{ item.label }}</div>
</div>
</div>
<div class='line-chart'>
<line-bar :domId='domId' :isDatazoom='isDatazoom' :boxHeight='boxHeight' :dataList='dataList'></line-bar>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import SelectCpn from 'views/sassPlus/componts/selectCpn'
export default {
name: 'ViewSurface',
components: {
SelectCpn
},
props: {
title: {
type: String,
default: ''
},
isMonthDay: {
type: Boolean,
default: false
},
isDatazoom: {
type: Boolean,
default: false
},
showSeletion: {
type: Boolean,
default: false
},
isEqually: {
type: Boolean,
default: true
},
merchantName: {
type: String,
default: ''
},
boxHeight: {
type: String,
// default: '19.5vh'
default: '20vh'
},
dataList: {
type: Array,
default: () => []
},
domId: {
type: String,
default: ''
}
},
data() {
return {
businessList: [
{ label: '1.1转换+', value: 'transwork' },
{ label: '1.2膨胀金', value: 'expandedgold' },
{ label: '1.3众筹', value: 'crowdfunding' },
{ label: '2.1车损无忧', value: 'noworries' }
],
monthDayList: [{
label: '日表', value: 1
}, {
label: '月表', value: 0
}],
currentIndex: 0
}
},
mounted() {
},
methods: {
changeMonthDay(item, index) {
this.currentIndex = index
this.$bus.$emit('monthDayEvent', { queryItem: item.value })
}
}
}
</script>
<style scoped lang='scss'>
.whetherToDivideEqually {
height: 21.46vh;
width: calc(50% - 0.5vw);
height: calc(50% - 0.5vw);
}
.surface {
//height: 21.46vh;
margin-bottom: 0.98vh;
border: 2px solid black;
border-radius: 5px;
box-sizing: border-box;
//width: calc(50% - 5px);
//height: calc(50% - 5px);
.title {
//margin-bottom: 0.5vh;
.go {
margin-left: 0.2vw;
}
.merchantName {
margin-left: 0.5vw;
}
.month-day-wrap {
margin-left: 1vw;
display: flex;
width: 4.4vw;
justify-content: space-between;
align-items: center;
.form {
width: 100%;
border-radius: 3px;
text-align: center;
padding: 0.1vw;
}
.light {
background: #2436b7;
}
}
}
//.line-chart{
// padding-left: 2vw;
//}
}
</style>