fix: bug#11191
This commit is contained in:
parent
09267955f5
commit
5cf8ce8aff
|
@ -75,7 +75,7 @@
|
||||||
style='max-width: 170px'
|
style='max-width: 170px'
|
||||||
:precision='0'
|
:precision='0'
|
||||||
:min='1'
|
:min='1'
|
||||||
:max='59'
|
:max='unitMax'
|
||||||
v-model:value='formModel.period.every'
|
v-model:value='formModel.period.every'
|
||||||
@change='updateValue'
|
@change='updateValue'
|
||||||
>
|
>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
{ label: "分", value: "minutes" },
|
{ label: "分", value: "minutes" },
|
||||||
{ label: "小时", value: "hours" },
|
{ label: "小时", value: "hours" },
|
||||||
]'
|
]'
|
||||||
@select='updateValue'
|
@select='periodUnitChange'
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</j-input-number>
|
</j-input-number>
|
||||||
|
@ -124,6 +124,7 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<Emit>()
|
const emit = defineEmits<Emit>()
|
||||||
|
const unitMax = ref<number>(99)
|
||||||
|
|
||||||
const cronRules = [
|
const cronRules = [
|
||||||
{ max: 64, message: '最多可输入64个字符' },
|
{ max: 64, message: '最多可输入64个字符' },
|
||||||
|
@ -171,7 +172,6 @@ const showPeriod = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const updateValue = () => {
|
const updateValue = () => {
|
||||||
|
|
||||||
const cloneValue = cloneDeep(formModel)
|
const cloneValue = cloneDeep(formModel)
|
||||||
|
@ -189,12 +189,26 @@ const updateValue = () => {
|
||||||
emit('update:value', cloneValue)
|
emit('update:value', cloneValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
const triggerChange = (v: any) => {
|
const triggerChange = () => {
|
||||||
formModel.when = []
|
formModel.when = []
|
||||||
formModel.cron = undefined
|
formModel.cron = undefined
|
||||||
updateValue()
|
updateValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率单位切换
|
||||||
|
* @param v
|
||||||
|
*/
|
||||||
|
const periodUnitChange = (v: any) => {
|
||||||
|
if(v === 'hours') {
|
||||||
|
unitMax.value = 99999
|
||||||
|
} else {
|
||||||
|
unitMax.value = 99
|
||||||
|
}
|
||||||
|
formModel.period!.every = 1
|
||||||
|
updateValue()
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
validateFields: () => new Promise(async (resolve) => {
|
validateFields: () => new Promise(async (resolve) => {
|
||||||
const data = await timerForm.value?.validateFields()
|
const data = await timerForm.value?.validateFields()
|
||||||
|
|
Loading…
Reference in New Issue