diff --git a/src/constants/business.ts b/src/constants/business.ts index f2fc386..42d8440 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -12,12 +12,12 @@ export const enableStatusRecord: Record = { +export const enableStatusNumberRecord: Record = { 0: 'page.manage.common.status.disable', 1: 'page.manage.common.status.enable' }; -export const enableStatus01Options = transformRecordToNumberOption(enableStatus01Record, true); +export const enableStatusNumberOptions = transformRecordToNumberOption(enableStatusNumberRecord, true); export const userGenderRecord: Record = { '1': 'page.manage.user.gender.male', @@ -101,3 +101,11 @@ export const backOffRecord: Record = { 4: 'page.retryScene.backOffItem.random' }; export const backOffRecordOptions = transformRecordToNumberOption(backOffRecord, true); + +export const routeKeyRecord: Record = { + 1: 'page.retryScene.routeKeyItem.consistentHash', + 2: 'page.retryScene.routeKeyItem.random', + 3: 'page.retryScene.routeKeyItem.lru', + 4: 'page.retryScene.routeKeyItem.round' +}; +export const routeKeyRecordOptions = transformRecordToNumberOption(routeKeyRecord, true); diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index e8b4c75..3a247e3 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -638,6 +638,12 @@ const local: App.I18n.Schema = { fixed: '固定时间', cron: 'CRON表达式', random: '随机等待' + }, + routeKeyItem: { + consistentHash: '一致性哈希', + random: '随机', + lru: 'LRU', + round: '轮询' } } }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index df3a82d..2483937 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -602,7 +602,7 @@ const local: App.I18n.Schema = { lark: '飞书' }, retryScene: { - title: 'Scene 列表', + title: '场景列表', groupName: '组名', sceneName: '场景名', sceneStatus: '状态', @@ -634,6 +634,12 @@ const local: App.I18n.Schema = { fixed: '固定时间', cron: 'CRON表达式', random: '随机等待' + }, + routeKeyItem: { + consistentHash: '一致性哈希', + random: '随机', + lru: 'LRU', + round: '轮询' } } }, diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 0a0caff..01d6995 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -808,6 +808,12 @@ declare namespace App { cron: string; random: string; }; + routeKeyItem: { + consistentHash: string; + random: string; + lru: string; + round: 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 7f32109..e34ed6b 100644 --- a/src/views/notify/scene/modules/notify-config-operate-drawer.vue +++ b/src/views/notify/scene/modules/notify-config-operate-drawer.vue @@ -5,7 +5,7 @@ import OperateDrawer from '@/components/common/operate-drawer.vue'; import { $t } from '@/locales'; import { fetchAddNotify, fetchEditNotify, fetchGetAllGroupNameList, fetchGetNotifyRecipientList } from '@/service/api'; import { - enableStatus01Options, + enableStatusNumberOptions, jobNotifySceneOptions, retryNotifySceneOptions, systemTaskTypeOptions @@ -235,7 +235,7 @@ watch(visible, () => { { -import { NButton, NPopconfirm } from 'naive-ui'; +import { NButton, NPopconfirm, NTag } from 'naive-ui'; import { fetchGetRetryScenePageList } from '@/service/api'; import { $t } from '@/locales'; import { useAppStore } from '@/store/modules/app'; import { useTable, useTableOperate } from '@/hooks/common/table'; +import { backOffRecord, enableStatusNumberRecord, routeKeyRecord } from '@/constants/business'; import SceneOperateDrawer from './modules/scene-operate-drawer.vue'; import SceneSearch from './modules/scene-search.vue'; @@ -48,13 +49,31 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP key: 'sceneStatus', title: $t('page.retryScene.sceneStatus'), align: 'left', - minWidth: 120 + minWidth: 120, + render: row => { + const label = $t(enableStatusNumberRecord[row.sceneStatus!]); + return {label}; + } }, { key: 'backOff', title: $t('page.retryScene.backOff'), align: 'left', - minWidth: 120 + minWidth: 120, + render: row => { + const label = $t(backOffRecord[row.backOff!]); + return {label}; + } + }, + { + key: 'routeKey', + title: $t('page.retryScene.routeKey'), + align: 'left', + minWidth: 120, + render: row => { + const label = $t(routeKeyRecord[row.routeKey!]); + return {label}; + } }, { key: 'maxRetryCount', @@ -98,12 +117,6 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP align: 'left', minWidth: 120 }, - { - key: 'routeKey', - title: $t('page.retryScene.routeKey'), - align: 'left', - minWidth: 120 - }, { key: 'operate', title: $t('common.operate'), diff --git a/src/views/retry/scene/modules/scene-operate-drawer.vue b/src/views/retry/scene/modules/scene-operate-drawer.vue index d628a78..6067a12 100644 --- a/src/views/retry/scene/modules/scene-operate-drawer.vue +++ b/src/views/retry/scene/modules/scene-operate-drawer.vue @@ -1,11 +1,13 @@