-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
188 lines (188 loc) · 4.16 KB
/
index.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DEMO vue-caliper</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<style>
body {
margin: 0;
}
.record {
width: 200px;
height: 30px;
margin: 0px auto;
text-align: center;
line-height: 30px;
color: #10a0eb;
}
.ang {
width: 0px;
height: 0px;
border-top: 9px solid #10a0eb;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
display: block;
position: fixed;
left: 50%;
top: 10px;
margin-left: -6px;
position: absolute;
}
.line {
height: 60px;
width: 2px;
background: #10a0eb;
display: block;
position: fixed;
left: 50%;
margin-left: -1px;
top: 12px;
position: absolute;
z-index: 999;
}
.all {
width: 100%;
height: 80px;
overflow-x: hidden;
margin: 10px auto;
position: relative;
}
#canv {
display: block;
min-width: 1000px;
transition-property: -webkit-transform;
transform-origin: 0px 0px 0px;
}
.red{
display: block;margin-top: -8px;font-size: 22px;color:#10a0eb;
}
.dotted,.dotted1{
position: absolute;
height: 0;
}
.dotted{
margin-left: -60px;
top:9px;
border-bottom:1px dotted #ccc;
width:120px;
left:50%;
}
.dotted1{
left:0;
border-bottom:2px solid #ccc;
bottom:8px;
width:100%;
}
.orangeday .red,.orangeday .record{
color:#ff7d15;
}
.orangeday .line{
background: #ff7d15;
}
.orangeday .ang{
border-top: 9px solid #ff7d15;
}
</style>
</head>
<body>
<div id="example">
<div class="scale1" :class="[colorClasses]">
<div class="record"><span>{{texts}}</span><span class="red" id="red">{{mes}}</span></div>
<div class="all">
<b class="ang"></b>
<i class="line"></i>
<div class="dotted"></div>
<vue-caliper
v-model="day"
:list="listDay"
:min-value="setMinDay"
:interval="15"
:widths="4200"
@change="onChange"
></vue-caliper>
<div class="dotted1"></div>
</div>
</div>
<div class="scale1">
<div class="record"><span>{{text}}</span><span class="red">{{amounts}}</span></div>
<div class="all">
<b class="ang"></b>
<i class="line"></i>
<div class="dotted"></div>
<vue-caliper
v-model="amount"
:list="list"
:min-value="setMinNum"
@change="onChanges"
></vue-caliper>
<div class="dotted1"></div>
</div>
</div>
</div>
<script src="//cdn.bootcss.com/vue/2.3.3/vue.js"></script>
</body>
<script>
const arry = [
{
'move': 0,
'line': 10000,
'interval': 100,
'transformMove': 0,
'transformLine': 0
}, {
'move': 10000,
'line': 100000,
'interval': 1000,
'transformMove': 0,
'transformLine': 0
}, {
'move': 100000,
'line': 1000000,
'interval': 10000,
'transformMove': 0,
'transformLine': 0
}, {
'move': 1000000,
'line': 2000000,
'interval': 100000,
'transformMove': 0,
'transformLine': 0
}
]
new Vue({
el: '#example',
data: {
amount: 15000,
amounts: 15000,
list: arry,
setMinNum: 1000,
text: '单笔投资金额(元)',
day: 30,
mes: 30,
//list中多个对象时,每个对象中每小格子可对应数值不同;前一个对象line为后一对象move
listDay: [
{
'move': 0, //开始数值
'line': 375, //结束数值
'interval': 1, //每格子对应数值
'transformMove': 0,
'transformLine': 0
}
],
setMinDay: 1,
texts: '项目期限(天)',
colorClasses: 'orangeday'
},
methods: {
onChange (val) {
this.mes = val
},
onChanges (val) {
this.amounts = val
}
}
});
</script>
</html>