-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,271 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<div class="cron-inner-config-list"> | ||
<a-radio-group v-model="type"> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.unset" v-bind="beforeRadioAttrs">不设置</a-radio> | ||
<span class="tip-info">日和周只能设置其中之一</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.every" v-bind="beforeRadioAttrs">每日</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.range" v-bind="beforeRadioAttrs">区间</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueRange.start" v-bind="inputNumberAttrs" /> | ||
<span>日 至</span> | ||
<a-input-number v-model="valueRange.end" v-bind="inputNumberAttrs" /> | ||
<span>日</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueLoop.start" v-bind="typeLoopAttrs" /> | ||
<span>日开始, 间隔</span> | ||
<a-input-number v-model="valueLoop.interval" v-bind="typeLoopAttrs" /> | ||
<span>日</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.last" v-bind="beforeRadioAttrs">最后一日</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</a-radio> | ||
<div class="list"> | ||
<a-checkbox-group v-model="valueList"> | ||
<a-grid :cols="11"> | ||
<a-grid-item v-for="i in specifyRange" :key="i"> | ||
<a-checkbox :value="i" v-bind="typeSpecifyAttrs"> | ||
{{ i }} | ||
</a-checkbox> | ||
</a-grid-item> | ||
</a-grid> | ||
</a-checkbox-group> | ||
</div> | ||
</div> | ||
</a-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { TypeEnum, useFormProps, useFormSetup, useFromEmits } from './use-mixin' | ||
export default defineComponent({ | ||
name: 'DayForm', | ||
props: useFormProps({ | ||
defaultValue: '*', | ||
props: { | ||
week: { type: String, default: '?' } | ||
} | ||
}), | ||
emits: useFromEmits(), | ||
setup(props, context) { | ||
const isDisabled = computed(() => { | ||
return (props.week && props.week !== '?') || props.disabled | ||
}) | ||
const setup = useFormSetup(props, context, { | ||
defaultValue: '*', | ||
valueWork: 1, | ||
minValue: 1, | ||
maxValue: 31, | ||
valueRange: { start: 1, end: 31 }, | ||
valueLoop: { start: 1, interval: 1 }, | ||
disabled: isDisabled | ||
}) | ||
const typeWorkAttrs = computed(() => ({ | ||
disabled: setup.type.value !== TypeEnum.work || props.disabled || isDisabled.value, | ||
...setup.inputNumberAttrs.value | ||
})) | ||
watch( | ||
() => props.week, | ||
() => { | ||
setup.updateValue(isDisabled.value ? '?' : setup.computeValue.value) | ||
} | ||
) | ||
return { ...setup, typeWorkAttrs } | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="cron-inner-config-list"> | ||
<a-radio-group v-model="type"> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.every" v-bind="beforeRadioAttrs">每时</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.range" v-bind="beforeRadioAttrs">区间</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueRange.start" v-bind="typeRangeAttrs" /> | ||
<span>时 至</span> | ||
<a-input-number v-model="valueRange.end" v-bind="typeRangeAttrs" /> | ||
<span>时</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueLoop.start" v-bind="typeLoopAttrs" /> | ||
<span>时开始, 间隔</span> | ||
<a-input-number v-model="valueLoop.interval" v-bind="typeLoopAttrs" /> | ||
<span>时</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</a-radio> | ||
<div class="list"> | ||
<a-checkbox-group v-model="valueList"> | ||
<a-grid :cols="12"> | ||
<a-grid-item v-for="i in specifyRange" :key="i"> | ||
<a-checkbox :value="i" v-bind="typeSpecifyAttrs"> | ||
{{ i }} | ||
</a-checkbox> | ||
</a-grid-item> | ||
</a-grid> | ||
</a-checkbox-group> | ||
</div> | ||
</div> | ||
</a-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useFormProps, useFormSetup, useFromEmits } from './use-mixin' | ||
export default defineComponent({ | ||
name: 'HourForm', | ||
props: useFormProps({ | ||
defaultValue: '*' | ||
}), | ||
emits: useFromEmits(), | ||
setup(props, context) { | ||
return useFormSetup(props, context, { | ||
defaultValue: '*', | ||
minValue: 0, | ||
maxValue: 23, | ||
valueRange: { start: 0, end: 23 }, | ||
valueLoop: { start: 0, interval: 1 } | ||
}) | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="cron-inner-config-list"> | ||
<a-radio-group v-model="type"> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.every" v-bind="beforeRadioAttrs">每分</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.range" v-bind="beforeRadioAttrs">区间</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueRange.start" v-bind="typeRangeAttrs" /> | ||
<span>分 至</span> | ||
<a-input-number v-model="valueRange.end" v-bind="typeRangeAttrs" /> | ||
<span>分</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueLoop.start" v-bind="typeLoopAttrs" /> | ||
<span>分开始, 间隔</span> | ||
<a-input-number v-model="valueLoop.interval" v-bind="typeLoopAttrs" /> | ||
<span>分</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</a-radio> | ||
<div class="list"> | ||
<a-checkbox-group v-model="valueList"> | ||
<a-grid :cols="10"> | ||
<a-grid-item v-for="i in specifyRange" :key="i"> | ||
<a-checkbox :value="i" v-bind="typeSpecifyAttrs"> | ||
{{ i }} | ||
</a-checkbox> | ||
</a-grid-item> | ||
</a-grid> | ||
</a-checkbox-group> | ||
</div> | ||
</div> | ||
</a-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useFormProps, useFormSetup, useFromEmits } from './use-mixin' | ||
export default defineComponent({ | ||
name: 'MinuteForm', | ||
props: useFormProps({ | ||
defaultValue: '*' | ||
}), | ||
emits: useFromEmits(), | ||
setup(props, context) { | ||
return useFormSetup(props, context, { | ||
defaultValue: '*', | ||
minValue: 0, | ||
maxValue: 59, | ||
valueRange: { start: 0, end: 59 }, | ||
valueLoop: { start: 0, interval: 1 } | ||
}) | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="cron-inner-config-list"> | ||
<a-radio-group v-model="type"> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.every" v-bind="beforeRadioAttrs">每月</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.range" v-bind="beforeRadioAttrs">区间</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueRange.start" v-bind="typeRangeAttrs" /> | ||
<span>月 至</span> | ||
<a-input-number v-model="valueRange.end" v-bind="typeRangeAttrs" /> | ||
<span>月</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueLoop.start" v-bind="typeLoopAttrs" /> | ||
<span>月开始, 间隔</span> | ||
<a-input-number v-model="valueLoop.interval" v-bind="typeLoopAttrs" /> | ||
<span>月</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</a-radio> | ||
<div class="list"> | ||
<a-checkbox-group v-model="valueList"> | ||
<a-grid :cols="12"> | ||
<a-grid-item v-for="i in specifyRange" :key="i"> | ||
<a-checkbox :value="i" v-bind="typeSpecifyAttrs"> | ||
{{ i }} | ||
</a-checkbox> | ||
</a-grid-item> | ||
</a-grid> | ||
</a-checkbox-group> | ||
</div> | ||
</div> | ||
</a-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useFormProps, useFormSetup, useFromEmits } from './use-mixin' | ||
export default defineComponent({ | ||
name: 'MonthForm', | ||
props: useFormProps({ | ||
defaultValue: '*' | ||
}), | ||
emits: useFromEmits(), | ||
setup(props, context) { | ||
return useFormSetup(props, context, { | ||
defaultValue: '*', | ||
minValue: 1, | ||
maxValue: 12, | ||
valueRange: { start: 1, end: 12 }, | ||
valueLoop: { start: 1, interval: 1 } | ||
}) | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="cron-inner-config-list"> | ||
<a-radio-group v-model="type"> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.every" v-bind="beforeRadioAttrs">每秒</a-radio> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.range" v-bind="beforeRadioAttrs">区间</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueRange.start" v-bind="typeRangeAttrs" /> | ||
<span>秒 至</span> | ||
<a-input-number v-model="valueRange.end" v-bind="typeRangeAttrs" /> | ||
<span>秒</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.loop" v-bind="beforeRadioAttrs">循环</a-radio> | ||
<span>从</span> | ||
<a-input-number v-model="valueLoop.start" v-bind="typeLoopAttrs" /> | ||
<span>秒开始, 间隔</span> | ||
<a-input-number v-model="valueLoop.interval" v-bind="typeLoopAttrs" /> | ||
<span>秒</span> | ||
</div> | ||
<div class="item"> | ||
<a-radio :value="TypeEnum.specify" v-bind="beforeRadioAttrs">指定</a-radio> | ||
<div class="list"> | ||
<a-checkbox-group v-model="valueList"> | ||
<a-grid :cols="10"> | ||
<a-grid-item v-for="i in specifyRange" :key="i"> | ||
<a-checkbox :value="i" v-bind="typeSpecifyAttrs"> | ||
{{ i }} | ||
</a-checkbox> | ||
</a-grid-item> | ||
</a-grid> | ||
</a-checkbox-group> | ||
</div> | ||
</div> | ||
</a-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useFormProps, useFormSetup, useFromEmits } from './use-mixin' | ||
export default defineComponent({ | ||
name: 'SecondForm', | ||
props: useFormProps({ | ||
defaultValue: '*' | ||
}), | ||
emits: useFromEmits(), | ||
setup(props, context) { | ||
return useFormSetup(props, context, { | ||
defaultValue: '*', | ||
minValue: 0, | ||
maxValue: 59, | ||
valueRange: { start: 0, end: 59 }, | ||
valueLoop: { start: 0, interval: 1 } | ||
}) | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.