max) event.target.value = max.toString().padStart(2, '0');
- else if(inputValue < min) event.target.value= min.toString().padStart(2, '0');
+ if(inputValue > max) {
+ event.target.value = max.toString().padStart(2, '0');
+ this.totalSeconds = this.maxTotal;
+ this.secondToDate(this.maxTotal, 'max');
+ }else if(inputValue < min) event.target.value= min.toString().padStart(2, '0');
// 數值更新, tUnits 也更新, 並計算 totalSeconds
const dsp = event.target.dataset.tunit;
@@ -179,9 +178,9 @@ export default {
newVal = '00';
} else {
newVal = '00';
- };
- };
- };
+ }
+ }
+ }
input.value = newVal.toString().padStart(2, '0');
switch (tUnit) {
@@ -214,12 +213,6 @@ export default {
},
calculateTotalSeconds() {
let totalSeconds = 0;
- let tUnits = {
- s: { dsp: 's', inc: 1, val: this.seconds, max: 60, rate: 1, min: 0 },
- m: { dsp: 'm', inc: 1, val: this.minutes, max: 60, rate: 60, min: 0 },
- h: { dsp: 'h', inc: 1, val: this.hours, max: 24, rate: 3600, min: 0 },
- d: { dsp: 'd', inc: 1, val: this.days, max: this.maxDays, rate: 86400, min: this.minDays },
- };
for (const unit in this.tUnits) {
const val = parseInt(this.tUnits[unit].val, 10);
@@ -228,47 +221,41 @@ export default {
}
}
- // 大於最大值時要等於最大值
- console.log(totalSeconds);
- if(totalSeconds >= this.maxTotal){
- console.log('>max');
+ if(totalSeconds >= this.maxTotal){ // 大於最大值時要等於最大值
totalSeconds = this.maxTotal;
- this.tUnits = tUnits;
- } else if (totalSeconds <= this.minTotal) {
- console.log('
diff --git a/src/stores/conformance.js b/src/stores/conformance.js
index bf03184..d773ae2 100644
--- a/src/stores/conformance.js
+++ b/src/stores/conformance.js
@@ -148,6 +148,22 @@ export default defineStore('conformanceStore', {
state.allLoopCases.map(c => {
c.started_at = moment(c.started_at).format('YYYY/MM/DD HH:MM');
c.completed_at = moment(c.completed_at).format('YYYY/MM/DD HH:MM');
+ // if(c.facets) {
+ // c.facets = '111';
+ // c.facets.map(att => {
+ // switch(att.type) {
+ // case 'float-list':
+ // console.log(att.value);
+ // att.value ='111'
+ // // att.value = att.value.map(v => v !== null ? new Decimal(v.toFixed(2)) : null);
+ // // att.value = att.value.join(', ');
+ // break;
+ // default:
+ // break;
+ // };
+ // return att;
+ // });
+ // };
c.attributes.map(att => {
switch (att.type) {
case 'date':
@@ -160,7 +176,7 @@ export default defineStore('conformanceStore', {
break;
}
return att;
- })
+ });
return c;
});
};