diff --git a/src/constants/business.ts b/src/constants/business.ts index 33363a8..8ab137a 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -87,13 +87,13 @@ export const jobNotifyScene: Record = { 2: 'page.notifyConfig.workflowNotifyScene.workflowClientError', 100: 'page.notifyConfig.workflowNotifyScene.workTaskError' }; -export const workflowNotifySceneOptions = transformRecordToOption(workflowNotifyScene); +export const workflowNotifySceneOptions = transformRecordToNumberOption(workflowNotifyScene); export const groupConfigStatusRecord: Record = { 0: 'page.manage.common.status.disable', diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index ad66544..c6bc531 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -543,7 +543,7 @@ declare namespace Api { /** 组名称 */ groupName: string; /** 业务ID */ - businessId: string; + businessId: string | null; /** 通知人id */ recipientIds: number[]; /** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */ diff --git a/src/views/notify/scene/index.vue b/src/views/notify/scene/index.vue index f28af19..ebf63b7 100644 --- a/src/views/notify/scene/index.vue +++ b/src/views/notify/scene/index.vue @@ -104,7 +104,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP key: 'notifyScene', title: $t('page.notifyConfig.notifyScene'), align: 'left', - width: 120, + width: 160, render: row => { if (row.notifyScene === null) { return null; 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 2341ac6..2245451 100644 --- a/src/views/notify/scene/modules/notify-config-operate-drawer.vue +++ b/src/views/notify/scene/modules/notify-config-operate-drawer.vue @@ -128,6 +128,7 @@ function handleUpdateModelWhenEdit() { if (props.operateType === 'edit' && props.rowData) { Object.assign(model, props.rowData); + systemTaskTypeChange(model.systemTaskType); } } @@ -207,16 +208,27 @@ async function systemTaskTypeChange(value: number) { notifySceneOptions.value = translateOptions(retryNotifySceneOptions); } else if (value === 3) { const res = await fetchGetJobList({ groupName: model.groupName }); - jobs.value = res.data as Api.Job.Job[]; + jobs.value = res.data?.map(i => { + i.id = String(i.id); + return i; + }) 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[]; + workflows.value = res.data?.map(i => { + i.id = String(i.id); + return i; + }) as Api.Workflow.Workflow[]; notifySceneOptions.value = translateOptions(workflowNotifySceneOptions); } - model.businessId = ''; - model.notifyScene = null; + if (value !== props.rowData?.systemTaskType) { + model.businessId = null; + model.notifyScene = null; + } else { + model.businessId = props.rowData?.businessId; + model.notifyScene = props.rowData?.notifyScene; + } } function groupNameUpdate(groupName: string) { @@ -294,7 +306,7 @@ watch(visible, () => {