fix: Issues #218 done.
This commit is contained in:
@@ -181,10 +181,12 @@ export default {
|
||||
break;
|
||||
case 'cfmPtEteSEStart':
|
||||
this.selectCfmPtEteSEStart = data.task;
|
||||
this.timeCfmPtEteSE = {min: 0, max: 0};
|
||||
if(this.selectCfmPtEteSEEnd) this.timeCfmPtEteSE = this.getDurationTime(this.cfmPtEteSE, 'double', data.task, this.selectCfmPtEteSEEnd);
|
||||
break;
|
||||
case 'cfmPtEteSEEnd':
|
||||
this.selectCfmPtEteSEEnd = data.task;
|
||||
this.timeCfmPtEteSE = {min: 0, max: 0};
|
||||
if(this.selectCfmPtEteSEStart) this.timeCfmPtEteSE = this.getDurationTime(this.cfmPtEteSE, 'double', this.selectCfmPtEteSEStart, data.task);
|
||||
break;
|
||||
case 'cfmPtPStart':
|
||||
@@ -195,10 +197,12 @@ export default {
|
||||
break;
|
||||
case 'cfmPtPSEStart':
|
||||
this.selectCfmPtPSEStart = data.task;
|
||||
this.timeCfmPtPSE = {min: 0, max: 0};
|
||||
if(this.selectCfmPtPSEEnd) this.timeCfmPtPSE = this.getDurationTime(this.cfmPtPSE, 'double', data.task, this.selectCfmPtPSEEnd);
|
||||
break;
|
||||
case 'cfmPtPSEEnd':
|
||||
this.selectCfmPtPSEEnd = data.task;
|
||||
this.timeCfmPtPSE = {min: 0, max: 0};
|
||||
if(this.selectCfmPtPSEStart) this.timeCfmPtPSE = this.getDurationTime(this.cfmPtPSE, 'double', this.selectCfmPtPSEStart, data.task);
|
||||
break;
|
||||
// Waiting time
|
||||
@@ -210,10 +214,12 @@ export default {
|
||||
break;
|
||||
case 'cfmWtEteSEStart':
|
||||
this.selectCfmWtEteSEStart = data.task;
|
||||
this.timeCfmWtEteSE = {min: 0, max: 0};
|
||||
if(this.selectCfmWtEteSEEnd) this.timeCfmWtEteSE = this.getDurationTime(this.cfmWtEteSE, 'double', data.task, this.selectCfmWtEteSEEnd);
|
||||
break;
|
||||
case 'cfmWtEteSEEnd':
|
||||
this.selectCfmWtEteSEEnd = data.task;
|
||||
this.timeCfmWtEteSE = {min: 0, max: 0};
|
||||
if(this.selectCfmWtEteSEStart) this.timeCfmWtEteSE = this.getDurationTime(this.cfmWtEteSE, 'double', this.selectCfmWtEteSEStart, data.task);
|
||||
break;
|
||||
case 'cfmWtPStart':
|
||||
@@ -224,10 +230,12 @@ export default {
|
||||
break;
|
||||
case 'cfmWtPSEStart':
|
||||
this.selectCfmWtPSEStart = data.task;
|
||||
this.timeCfmWtPSE = {min: 0, max: 0};
|
||||
if(this.selectCfmWtPSEEnd) this.timeCfmWtPSE = this.getDurationTime(this.cfmWtPSE, 'double', data.task, this.selectCfmWtPSEEnd);
|
||||
break;
|
||||
case 'cfmWtPSEEnd':
|
||||
this.selectCfmWtPSEEnd = data.task;
|
||||
this.timeCfmWtPSE = {min: 0, max: 0};
|
||||
if(this.selectCfmWtPSEStart) this.timeCfmWtPSE = this.getDurationTime(this.cfmWtPSE, 'double', this.selectCfmWtPSEStart, data.task);
|
||||
break;
|
||||
// Cycle time
|
||||
@@ -239,10 +247,12 @@ export default {
|
||||
break;
|
||||
case 'cfmCtEteSEStart':
|
||||
this.selectCfmCtEteSEStart = data.task;
|
||||
this.timeCfmCtEteSEE = {min: 0, max: 0};
|
||||
if(this.selectCfmCtEteSEEnd) this.timeCfmCtEteSE = this.getDurationTime(this.cfmCtEteSE, 'double', data.task, this.selectCfmCtEteSEEnd);
|
||||
break;
|
||||
case 'cfmCtEteSEEnd':
|
||||
this.selectCfmCtEteSEEnd = data.task;
|
||||
this.timeCfmCtEteSEE = {min: 0, max: 0};
|
||||
if(this.selectCfmCtEteSEStart) this.timeCfmCtEteSE = this.getDurationTime(this.cfmCtEteSE, 'double', this.selectCfmCtEteSEStart, data.task);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -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