From f30827f01f29d24bfa204fc7f7774462830d41f5 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Sun, 5 May 2024 23:22:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.0.0):=20=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/business.ts | 7 +++++ src/locales/langs/en-us.ts | 10 ++++++- src/locales/langs/zh-cn.ts | 10 ++++++- src/typings/api.d.ts | 5 +++- src/typings/app.d.ts | 8 ++++++ .../modules/notify-config-operate-drawer.vue | 26 ++++++++++++++----- 6 files changed, 57 insertions(+), 9 deletions(-) diff --git a/src/constants/business.ts b/src/constants/business.ts index 00623b2..6f0fe99 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -76,6 +76,13 @@ export const jobNotifyScene: Record = { + 100: 'page.notifyConfig.workflowNotifyScene.workTaskError', + 101: 'page.notifyConfig.workflowNotifyScene.workflowTaskCallbackError', + 102: 'page.notifyConfig.workflowNotifyScene.workflowTaskDecisionError' +}; +export const workflowNotifySceneOptions = transformRecordToOption(workflowNotifyScene); + export const groupConfigStatusRecord: Record = { 0: 'page.manage.common.status.disable', 1: 'page.manage.common.status.enable' diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 8727e1e..b57f33c 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -693,7 +693,10 @@ const local: App.I18n.Schema = { notifyStatus: 'Please select State', systemTaskType: '请选择任务类型', notifyRecipient: '请选择通知人', - rateLimiterThreshold: '请选择阈值' + rateLimiterThreshold: '请选择阈值', + sceneName: '请选择重试场景', + jobName: '请选择定时任务', + workflowName: '请选择工作流' }, addNotifyConfig: 'Add Alarm notification', editNotifyConfig: 'Add Alarm notification', @@ -709,6 +712,11 @@ const local: App.I18n.Schema = { jobNotifyScene: { jobTaskError: '任务执行失败' }, + workflowNotifyScene: { + workTaskError: '任务执行失败', + workflowTaskCallbackError: '回调任务执行失败', + workflowTaskDecisionError: '判定节点执行失败' + }, notifyRecipient: '通知人信息', rateLimiterStatus: '限流开关', rateLimiterThreshold: '每秒限流阈值' diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index f0fe1aa..29aa06b 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -689,7 +689,10 @@ const local: App.I18n.Schema = { notifyStatus: '请选择状态', systemTaskType: '请选择任务类型', notifyRecipient: '请选择通知人', - rateLimiterThreshold: '请选择阈值' + rateLimiterThreshold: '请选择阈值', + sceneName: '请选择重试场景', + jobName: '请选择定时任务', + workflowName: '请选择工作流' }, addNotifyConfig: '新增告警通知', editNotifyConfig: '编辑告警通知', @@ -705,6 +708,11 @@ const local: App.I18n.Schema = { jobNotifyScene: { jobTaskError: '任务执行失败' }, + workflowNotifyScene: { + workTaskError: '工作流任务执行失败', + workflowTaskCallbackError: '工作流回调任务执行失败', + workflowTaskDecisionError: '工作流判定节点执行失败' + }, notifyRecipient: '通知人信息', rateLimiterStatus: '限流开关', rateLimiterThreshold: '每秒限流阈值' diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 48bcf14..9c8ce35 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -565,7 +565,7 @@ declare namespace Api { /** 状态 */ notifyStatus: Api.Common.EnableStatusNumber; /** 通知场景 */ - notifyScene: JobNotifyScene | RetryNotifyScene; + notifyScene: JobNotifyScene | RetryNotifyScene | WorkflowNotifyScene | null; /** 通知阈值 */ notifyThreshold: number; /** 限流开关 */ @@ -596,6 +596,9 @@ declare namespace Api { /** 1、任务执行失败 */ type JobNotifyScene = 1; + + /** 100、工作流任务执行失败 101、回调节点执行失败 102、判定节点执行失败 */ + type WorkflowNotifyScene = 100 | 101 | 102; } /** diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 04f3da8..a4b48cd 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -837,6 +837,9 @@ declare namespace App { systemTaskType: string; notifyRecipient: string; rateLimiterThreshold: string; + sceneName: string; + jobName: string; + workflowName: string; }; addNotifyConfig: string; editNotifyConfig: string; @@ -852,6 +855,11 @@ declare namespace App { jobNotifyScene: { jobTaskError: string; }; + workflowNotifyScene: { + workTaskError: string; + workflowTaskCallbackError: string; + workflowTaskDecisionError: string; + }; notifyRecipient: string; rateLimiterStatus: string; rateLimiterThreshold: string; 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 53fba8f..640b1d2 100644 --- a/src/views/notify/scene/modules/notify-config-operate-drawer.vue +++ b/src/views/notify/scene/modules/notify-config-operate-drawer.vue @@ -8,13 +8,15 @@ import { fetchEditNotify, fetchGetJobList, fetchGetNotifyRecipientList, - fetchGetRetrySceneList + fetchGetRetrySceneList, + fetchGetWorkflowNameList } from '@/service/api'; import { enableStatusNumberOptions, jobNotifySceneOptions, retryNotifySceneOptions, - systemTaskTypeOptions + systemTaskTypeOptions, + workflowNotifySceneOptions } from '@/constants/business'; import { translateOptions } from '@/utils/common'; import SelectGroup from '@/components/common/select-group.vue'; @@ -33,6 +35,7 @@ interface Props { const notifyRecipientList = ref[]>([]); const retryScenes = ref([]); const jobs = ref([]); +const workflows = ref([]); const props = defineProps(); @@ -212,10 +215,14 @@ async function systemTaskTypeChange(value: number) { const res = await fetchGetJobList({ groupName: model.groupName }); jobs.value = res.data as Api.Job.Job[]; notifySceneOptions.value = translateOptions(jobNotifySceneOptions); + } else if (value === 4) { + const res = await fetchGetWorkflowNameList({ groupName: model.groupName }); + workflows.value = res.data as Api.Workflow.Workflow[]; + notifySceneOptions.value = translateOptions(workflowNotifySceneOptions); } model.businessId = ''; - model.notifyScene = 1; + model.notifyScene = null; } function groupNameUpdate(groupName: string) { @@ -262,7 +269,7 @@ watch(visible, () => { { { /> - +