diff --git a/src/constants/business.ts b/src/constants/business.ts index 6c83613..f2fc386 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -93,3 +93,11 @@ export const groupConfigYesOrNoRecord: Record = { + 1: 'page.retryScene.backOffItem.delayLevel', + 2: 'page.retryScene.backOffItem.fixed', + 3: 'page.retryScene.backOffItem.cron', + 4: 'page.retryScene.backOffItem.random' +}; +export const backOffRecordOptions = transformRecordToNumberOption(backOffRecord, true); diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 286aa96..e8b4c75 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -632,7 +632,13 @@ const local: App.I18n.Schema = { backOff: 'Please enter Backoff strategy' }, addScene: 'Add Scenes', - editScene: 'Add Scenes' + editScene: 'Add Scenes', + backOffItem: { + delayLevel: '延迟等级', + fixed: '固定时间', + cron: 'CRON表达式', + random: '随机等待' + } } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index aa9d36d..df3a82d 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -628,7 +628,13 @@ const local: App.I18n.Schema = { backOff: '请输入退避策略' }, addScene: '新增场景', - editScene: '编辑场景' + editScene: '编辑场景', + backOffItem: { + delayLevel: '延迟等级', + fixed: '固定时间', + cron: 'CRON表达式', + random: '随机等待' + } } }, form: { diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index b98317b..f935799 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -629,7 +629,9 @@ declare namespace Api { /** 状态 */ sceneStatus: EnableStatusNumber; /** 退避策略 */ - backOff: number; + backOff: BackOff; + /** 路由策略 */ + routeKey: RouteKey; /** 最大重试次数 */ maxRetryCount: number; /** 间隔时间 */ @@ -640,8 +642,6 @@ declare namespace Api { executorTimeout: number; /** 描述 */ description: string; - /** 路由策略 */ - routeKey: number; }>; /** scene search params */ @@ -664,5 +664,11 @@ declare namespace Api { /** scene list */ type SceneList = Common.PaginatingQueryRecord; + + /** 1: 延迟等级 2: 固定时间 3: CRON表达式 4: 随机等待 */ + type BackOff = 1 | 2 | 3 | 4; + + /** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 */ + type RouteKey = 1 | 2 | 3 | 4; } } diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index da1f732..0a0caff 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -802,6 +802,12 @@ declare namespace App { }; addScene: string; editScene: string; + backOffItem: { + delayLevel: string; + fixed: string; + cron: string; + random: string; + }; }; }; form: { diff --git a/src/views/notify/scene/modules/notify-config-operate-drawer.vue b/src/views/notify/scene/modules/notify-config-operate-drawer.vue index 72a9388..7f32109 100644 --- a/src/views/notify/scene/modules/notify-config-operate-drawer.vue +++ b/src/views/notify/scene/modules/notify-config-operate-drawer.vue @@ -223,7 +223,7 @@ watch(visible, () => {