diff --git a/src/components/Crontab/day.vue b/src/components/Crontab/day.vue index 691d31b..39263f5 100644 --- a/src/components/Crontab/day.vue +++ b/src/components/Crontab/day.vue @@ -1,171 +1,174 @@ - - + + \ No newline at end of file diff --git a/src/components/Crontab/hour.vue b/src/components/Crontab/hour.vue index 7ec40ce..8e7c21c 100644 --- a/src/components/Crontab/hour.vue +++ b/src/components/Crontab/hour.vue @@ -1,123 +1,133 @@ - + + \ No newline at end of file diff --git a/src/components/Crontab/index.vue b/src/components/Crontab/index.vue index 604cf16..103cf4c 100644 --- a/src/components/Crontab/index.vue +++ b/src/components/Crontab/index.vue @@ -1,389 +1,151 @@ - - + \ No newline at end of file diff --git a/src/components/Crontab/min.vue b/src/components/Crontab/min.vue index 0566ea1..65f0946 100644 --- a/src/components/Crontab/min.vue +++ b/src/components/Crontab/min.vue @@ -1,124 +1,126 @@ - - \ No newline at end of file + return checkboxList.value.join(',') +}) +watch(() => props.cron.min, value => changeRadioValue(value)) +watch([radioValue, cycleTotal, averageTotal, checkboxString], () => onRadioChange()) +function changeRadioValue(value) { + if (value === '*') { + radioValue.value = 1 + } else if (value.indexOf('-') > -1) { + const indexArr = value.split('-') + cycle01.value = Number(indexArr[0]) + cycle02.value = Number(indexArr[1]) + radioValue.value = 2 + } else if (value.indexOf('/') > -1) { + const indexArr = value.split('/') + average01.value = Number(indexArr[0]) + average02.value = Number(indexArr[1]) + radioValue.value = 3 + } else { + checkboxList.value = [...new Set(value.split(',').map(item => Number(item)))] + radioValue.value = 4 + } +} +function onRadioChange() { + switch (radioValue.value) { + case 1: + emit('update', 'min', '*', 'min') + break + case 2: + emit('update', 'min', cycleTotal.value, 'min') + break + case 3: + emit('update', 'min', averageTotal.value, 'min') + break + case 4: + if (checkboxList.value.length === 0) { + checkboxList.value.push(checkCopy.value[0]) + } else { + checkCopy.value = checkboxList.value + } + emit('update', 'min', checkboxString.value, 'min') + break + } +} + + + \ No newline at end of file diff --git a/src/components/Crontab/month.vue b/src/components/Crontab/month.vue index 55ba305..e561ba4 100644 --- a/src/components/Crontab/month.vue +++ b/src/components/Crontab/month.vue @@ -1,123 +1,141 @@ - + + \ No newline at end of file diff --git a/src/components/Crontab/result.vue b/src/components/Crontab/result.vue index 7837cb8..5a812ee 100644 --- a/src/components/Crontab/result.vue +++ b/src/components/Crontab/result.vue @@ -10,580 +10,531 @@ - +function checkDate(value) { + let time = new Date(value); + let format = formatDate(time) + return value === format; +} +onMounted(() => { + expressionChange() +}) + \ No newline at end of file diff --git a/src/components/Crontab/second.vue b/src/components/Crontab/second.vue index e7cc65f..15e47a0 100644 --- a/src/components/Crontab/second.vue +++ b/src/components/Crontab/second.vue @@ -1,132 +1,128 @@ - + + \ No newline at end of file diff --git a/src/components/Crontab/week.vue b/src/components/Crontab/week.vue index 471858e..e59da22 100644 --- a/src/components/Crontab/week.vue +++ b/src/components/Crontab/week.vue @@ -1,212 +1,197 @@ - + + \ No newline at end of file diff --git a/src/components/Crontab/year.vue b/src/components/Crontab/year.vue index 52481f5..fa921ae 100644 --- a/src/components/Crontab/year.vue +++ b/src/components/Crontab/year.vue @@ -1,145 +1,149 @@ - + + \ No newline at end of file