|
@@ -52,10 +52,9 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
toChangeNum(tmp){
|
|
toChangeNum(tmp){
|
|
|
-
|
|
|
|
|
- let max = [0,0]
|
|
|
|
|
|
|
+ let fallInRange = [0,0]
|
|
|
if (this.isLegal) {
|
|
if (this.isLegal) {
|
|
|
- max = this.gradientArr.find(item=>{
|
|
|
|
|
|
|
+ fallInRange = this.gradientArr.find(item=>{
|
|
|
return tmp >= item[0] && tmp < item[1]
|
|
return tmp >= item[0] && tmp < item[1]
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -65,8 +64,19 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return Number(this.isLegal ? (max ? max[1] : tmp) : tmp)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (this.isLegal) {
|
|
|
|
|
+ if (fallInRange) {
|
|
|
|
|
+ if (tmp >= ((fallInRange[1] + fallInRange[0]) / 2)) {
|
|
|
|
|
+ return Number(fallInRange[1])
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Number(fallInRange[0])
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Number(tmp)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Number(tmp)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
clickHandle(ev) {
|
|
clickHandle(ev) {
|
|
|
let tmp = this.min + this.len * (ev.offsetX / this.width)
|
|
let tmp = this.min + this.len * (ev.offsetX / this.width)
|
|
@@ -134,22 +144,25 @@ export default {
|
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 4px;
|
|
|
|
|
|
|
+ height: 6px;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
- border: 1px solid #5d5d5d;
|
|
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ background: #1A1B1D;
|
|
|
|
|
+ border: 1px solid #404040;
|
|
|
|
|
|
|
|
>.percentage {
|
|
>.percentage {
|
|
|
- height: calc(100% + 2px);
|
|
|
|
|
|
|
+ height: 100%;
|
|
|
background-color: @color;
|
|
background-color: @color;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: -1px;
|
|
|
|
|
|
|
+ top: 0;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
>.bar {
|
|
>.bar {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- height: 15px;
|
|
|
|
|
- width: 15px;
|
|
|
|
|
|
|
+ height: 20px;
|
|
|
|
|
+ width: 20px;
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|