fix: Issues #218 done.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<!-- select:{{ select }} -->
|
||||
<div class="flex justify-between items-center" id="cyp-timerange">
|
||||
<Durationjs :max="minVuemax" :min="minVuemin" :size="'min'" :updateMax="updateMax" @total-seconds="minTotalSeconds" :value="durationMin"></Durationjs>
|
||||
<span>~</span>
|
||||
<Durationjs :max="maxVuemax" :min="maxVuemin" :size="'max'" @total-seconds="maxTotalSeconds" :value="durationMax"></Durationjs>
|
||||
<Durationjs :max="maxVuemax" :min="maxVuemin" :size="'max'" :updateMin="updateMin" @total-seconds="maxTotalSeconds" :value="durationMax"></Durationjs>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -24,6 +23,7 @@ export default {
|
||||
maxVuemin: 0,
|
||||
maxVuemax: 0,
|
||||
updateMax: null,
|
||||
updateMin: null,
|
||||
durationMin: null,
|
||||
durationMax: null,
|
||||
}
|
||||
@@ -34,6 +34,8 @@ export default {
|
||||
watch: {
|
||||
time: {
|
||||
handler: function(newValue, oldValue) {
|
||||
this.durationMax = null
|
||||
this.durationMin = null
|
||||
if(newValue == null) {
|
||||
this.timeData = {
|
||||
min: 0,
|
||||
@@ -70,6 +72,7 @@ export default {
|
||||
*/
|
||||
minTotalSeconds(e) {
|
||||
this.timeRangeMin = e;
|
||||
this.updateMin = e;
|
||||
this.$emit('min-total-seconds', e);
|
||||
},
|
||||
/**
|
||||
@@ -84,15 +87,14 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if(this.select){
|
||||
// 缺:
|
||||
// 1. 外面傳入的原始資料最大最小值
|
||||
// 2. isSubmit 的值
|
||||
// this.timeData = {min: 63320, max: 1489525};
|
||||
this.timeData = this.select;
|
||||
this.setTimeValue();
|
||||
// console.log('select',this.select);
|
||||
// this.durationMin = 70000;
|
||||
// this.durationMax = 84700;
|
||||
if(Object.keys(this.select.base).length !== 0) {
|
||||
this.timeData = this.select.base;
|
||||
this.setTimeValue();
|
||||
}
|
||||
if(Object.keys(this.select.rule).length !== 0) {
|
||||
this.durationMin = this.select.rule.min;
|
||||
this.durationMax = this.select.rule.max;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user