|
|
|
@ -43,7 +43,7 @@ export default {
|
|
|
|
|
average01: 0,
|
|
|
|
|
average02: 1,
|
|
|
|
|
checkboxList: [],
|
|
|
|
|
checkNum: this.$options && this.$options.propsData && this.$options.propsData.check ? this.$options.propsData.check : (val) => val
|
|
|
|
|
checkNum: this.$options.propsData.check
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
name: 'crontab-second',
|
|
|
|
@ -97,14 +97,14 @@ export default {
|
|
|
|
|
computed: {
|
|
|
|
|
// 计算两个周期值
|
|
|
|
|
cycleTotal: function () {
|
|
|
|
|
const cycle01 = typeof this.checkNum === 'function' ? this.checkNum(this.cycle01, 0, 58) : this.cycle01
|
|
|
|
|
const cycle02 = typeof this.checkNum === 'function' ? this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59) : this.cycle02
|
|
|
|
|
const cycle01 = this.checkNum(this.cycle01, 0, 58)
|
|
|
|
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
|
|
|
|
|
return cycle01 + '-' + cycle02;
|
|
|
|
|
},
|
|
|
|
|
// 计算平均用到的值
|
|
|
|
|
averageTotal: function () {
|
|
|
|
|
const average01 = typeof this.checkNum === 'function' ? this.checkNum(this.average01, 0, 58) : this.average01
|
|
|
|
|
const average02 = typeof this.checkNum === 'function' ? this.checkNum(this.average02, 1, 59 - average01 || 0) : this.average02
|
|
|
|
|
const average01 = this.checkNum(this.average01, 0, 58)
|
|
|
|
|
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
|
|
|
|
|
return average01 + '/' + average02;
|
|
|
|
|
},
|
|
|
|
|
// 计算勾选的checkbox值合集
|
|
|
|
@ -112,12 +112,6 @@ export default {
|
|
|
|
|
let str = this.checkboxList.join();
|
|
|
|
|
return str == '' ? '*' : str;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// 如果props传入了check函数,就使用props的check函数
|
|
|
|
|
if (typeof this.check === 'function') {
|
|
|
|
|
this.checkNum = this.check;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|