fix: Issues #218, Time value Change done.
This commit is contained in:
@@ -405,6 +405,7 @@ export default {
|
|||||||
// 打開 rule 檔要顯示儲存的選項、規則、時間
|
// 打開 rule 檔要顯示儲存的選項、規則、時間
|
||||||
conformanceTempReportData: {
|
conformanceTempReportData: {
|
||||||
handler: function(newValue) {
|
handler: function(newValue) {
|
||||||
|
console.log('conformanceTempReportData', newValue);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if(newValue !== null) {
|
if(newValue !== null) {
|
||||||
const rule = newValue.rule;
|
const rule = newValue.rule;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- select:{{ select }} -->
|
||||||
<div class="flex justify-between items-center" id="cyp-timerange">
|
<div class="flex justify-between items-center" id="cyp-timerange">
|
||||||
<Durationjs :max="minVuemax" :min="minVuemin" :size="'min'" :updateMax="updateMax" @total-seconds="minTotalSeconds"></Durationjs>
|
<Durationjs :max="minVuemax" :min="minVuemin" :size="'min'" :updateMax="updateMax" @total-seconds="minTotalSeconds" :value="durationMin"></Durationjs>
|
||||||
<span>~</span>
|
<span>~</span>
|
||||||
<Durationjs :max="maxVuemax" :min="maxVuemin" :size="'max'" @total-seconds="maxTotalSeconds"></Durationjs>
|
<Durationjs :max="maxVuemax" :min="maxVuemin" :size="'max'" @total-seconds="maxTotalSeconds" :value="durationMax"></Durationjs>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -23,6 +24,8 @@ export default {
|
|||||||
maxVuemin: 0,
|
maxVuemin: 0,
|
||||||
maxVuemax: 0,
|
maxVuemax: 0,
|
||||||
updateMax: null,
|
updateMax: null,
|
||||||
|
durationMin: null,
|
||||||
|
durationMax: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -81,8 +84,15 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(this.select){
|
if(this.select){
|
||||||
|
// 缺:
|
||||||
|
// 1. 外面傳入的原始資料最大最小值
|
||||||
|
// 2. isSubmit 的值
|
||||||
|
// this.timeData = {min: 63320, max: 1489525};
|
||||||
this.timeData = this.select;
|
this.timeData = this.select;
|
||||||
this.setTimeValue();
|
this.setTimeValue();
|
||||||
|
// console.log('select',this.select);
|
||||||
|
// this.durationMin = 70000;
|
||||||
|
// this.durationMax = 84700;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,13 @@ export default {
|
|||||||
default: false,
|
default: false,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
value: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
validator(value) {
|
||||||
|
return value >= 0;
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -200,6 +207,7 @@ export default {
|
|||||||
actionUpDown(input, goUp, selectIt = false) {
|
actionUpDown(input, goUp, selectIt = false) {
|
||||||
const tUnit = input.dataset.tunit;
|
const tUnit = input.dataset.tunit;
|
||||||
let newVal = parseInt(input.value, 10);
|
let newVal = parseInt(input.value, 10);
|
||||||
|
|
||||||
newVal = isNaN(newVal) ? 0 : newVal;
|
newVal = isNaN(newVal) ? 0 : newVal;
|
||||||
|
|
||||||
// if (newVal <= 0 || newVal > this.tUnits[tUnit].max) {
|
// if (newVal <= 0 || newVal > this.tUnits[tUnit].max) {
|
||||||
@@ -311,22 +319,28 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async createData() {
|
async createData() {
|
||||||
let size = this.size;
|
let size = this.size;
|
||||||
|
|
||||||
if (this.maxTotal !== await null && this.minTotal !== await null) {
|
if (this.maxTotal !== await null && this.minTotal !== await null) {
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 'max':
|
case 'max':
|
||||||
this.secondToDate(this.minTotal, 'min');
|
this.secondToDate(this.minTotal, 'min');
|
||||||
this.secondToDate(this.maxTotal, 'max');
|
this.secondToDate(this.maxTotal, 'max');
|
||||||
this.totalSeconds = this.maxTotal;
|
this.totalSeconds = this.maxTotal;
|
||||||
|
if(this.value !== null) {
|
||||||
|
this.totalSeconds = this.value;
|
||||||
|
this.secondToDate(this.value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'min':
|
case 'min':
|
||||||
this.secondToDate(this.maxTotal, 'max');
|
this.secondToDate(this.maxTotal, 'max');
|
||||||
this.secondToDate(this.minTotal, 'min');
|
this.secondToDate(this.minTotal, 'min');
|
||||||
this.totalSeconds = this.minTotal;
|
this.totalSeconds = this.minTotal;
|
||||||
break;
|
if(this.value !== null) {
|
||||||
default:
|
this.totalSeconds = this.value;
|
||||||
|
this.secondToDate(this.value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// this.$emit('total-seconds', this.totalSeconds);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -357,7 +371,6 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user