fix: 延迟等级参数联动
This commit is contained in:
parent
00705e1ead
commit
bc5cda07ca
@ -22,8 +22,6 @@ const interval = ref<number>(props.backOff === 2 || props.backOff === 4 ? Number
|
|||||||
/** 保存 `CRON表达式` 类型的 表达式 */
|
/** 保存 `CRON表达式` 类型的 表达式 */
|
||||||
const cron = ref<string>(props.backOff === 3 ? model.value! : '* * * * * ?');
|
const cron = ref<string>(props.backOff === 3 ? model.value! : '* * * * * ?');
|
||||||
|
|
||||||
const delayLevelDesc = ref('10s,15s,30s,35s,40s,50s,1m,2m,4m,6m,8m,10m,20m,40m,1h,2h,3h,4h,5h,6h,7h,8h,9h,10h,11h,12h');
|
|
||||||
|
|
||||||
/** 监视 触发间隔 变化 */
|
/** 监视 触发间隔 变化 */
|
||||||
watch(
|
watch(
|
||||||
interval,
|
interval,
|
||||||
@ -70,7 +68,6 @@ watch(
|
|||||||
:placeholder="$t('page.retryScene.form.triggerInterval')"
|
:placeholder="$t('page.retryScene.form.triggerInterval')"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<NInput v-else v-model:value="delayLevelDesc" type="textarea" :autosize="{ minRows: 1, maxRows: 3 }" readonly />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -202,17 +202,6 @@ async function handleSubmit() {
|
|||||||
emit('submitted');
|
emit('submitted');
|
||||||
}
|
}
|
||||||
|
|
||||||
function maxRetryCountUpdate(maxRetryCount: number) {
|
|
||||||
if (model.backOff !== 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let desc = '';
|
|
||||||
for (let i = 1; i <= maxRetryCount; i += 1) {
|
|
||||||
desc += `,${DelayLevel[i as keyof typeof DelayLevel]}`;
|
|
||||||
}
|
|
||||||
delayLevelDesc.value = desc.substring(1, desc.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(visible, () => {
|
watch(visible, () => {
|
||||||
if (visible.value) {
|
if (visible.value) {
|
||||||
handleUpdateModelWhenEdit();
|
handleUpdateModelWhenEdit();
|
||||||
@ -220,10 +209,19 @@ watch(visible, () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => model.backOff,
|
||||||
|
backOff => {
|
||||||
|
if (backOff === 1 && model.maxRetryCount > 26) {
|
||||||
|
model.maxRetryCount = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => model.maxRetryCount,
|
() => model.maxRetryCount,
|
||||||
() => {
|
() => {
|
||||||
maxRetryCountUpdate(model.maxRetryCount);
|
delayLevelDesc.value = Object.values(DelayLevel).slice(0, model.maxRetryCount).join(',');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
@ -299,7 +297,18 @@ watch(
|
|||||||
</NGi>
|
</NGi>
|
||||||
<NGi>
|
<NGi>
|
||||||
<NFormItem path="triggerInterval">
|
<NFormItem path="triggerInterval">
|
||||||
<SceneTriggerInterval v-model="model.triggerInterval" :back-off="model.backOff" />
|
<SceneTriggerInterval
|
||||||
|
v-if="model.backOff !== 1"
|
||||||
|
v-model="model.triggerInterval"
|
||||||
|
:back-off="model.backOff"
|
||||||
|
/>
|
||||||
|
<NInput
|
||||||
|
v-else
|
||||||
|
v-model:value="delayLevelDesc"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 1, maxRows: 3 }"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex-center">
|
<div class="flex-center">
|
||||||
{{ $t('page.retryScene.triggerInterval') }}
|
{{ $t('page.retryScene.triggerInterval') }}
|
||||||
|
Loading…
Reference in New Issue
Block a user