feat(sj_1.0.0): 告警通知通知场景编辑选中,类型必一致
This commit is contained in:
parent
06be428218
commit
cc20d97c2f
@ -87,13 +87,13 @@ export const jobNotifyScene: Record<Api.NotifyConfig.JobNotifyScene, App.I18n.I1
|
|||||||
1: 'page.notifyConfig.jobNotifyScene.jobTaskError',
|
1: 'page.notifyConfig.jobNotifyScene.jobTaskError',
|
||||||
2: 'page.notifyConfig.jobNotifyScene.jobClientError'
|
2: 'page.notifyConfig.jobNotifyScene.jobClientError'
|
||||||
};
|
};
|
||||||
export const jobNotifySceneOptions = transformRecordToOption(jobNotifyScene);
|
export const jobNotifySceneOptions = transformRecordToNumberOption(jobNotifyScene);
|
||||||
|
|
||||||
export const workflowNotifyScene: Record<Api.NotifyConfig.WorkflowNotifyScene, App.I18n.I18nKey> = {
|
export const workflowNotifyScene: Record<Api.NotifyConfig.WorkflowNotifyScene, App.I18n.I18nKey> = {
|
||||||
2: 'page.notifyConfig.workflowNotifyScene.workflowClientError',
|
2: 'page.notifyConfig.workflowNotifyScene.workflowClientError',
|
||||||
100: 'page.notifyConfig.workflowNotifyScene.workTaskError'
|
100: 'page.notifyConfig.workflowNotifyScene.workTaskError'
|
||||||
};
|
};
|
||||||
export const workflowNotifySceneOptions = transformRecordToOption(workflowNotifyScene);
|
export const workflowNotifySceneOptions = transformRecordToNumberOption(workflowNotifyScene);
|
||||||
|
|
||||||
export const groupConfigStatusRecord: Record<Api.GroupConfig.GroupStatusType, App.I18n.I18nKey> = {
|
export const groupConfigStatusRecord: Record<Api.GroupConfig.GroupStatusType, App.I18n.I18nKey> = {
|
||||||
0: 'page.manage.common.status.disable',
|
0: 'page.manage.common.status.disable',
|
||||||
|
2
src/typings/api.d.ts
vendored
2
src/typings/api.d.ts
vendored
@ -543,7 +543,7 @@ declare namespace Api {
|
|||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
groupName: string;
|
groupName: string;
|
||||||
/** 业务ID */
|
/** 业务ID */
|
||||||
businessId: string;
|
businessId: string | null;
|
||||||
/** 通知人id */
|
/** 通知人id */
|
||||||
recipientIds: number[];
|
recipientIds: number[];
|
||||||
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
||||||
|
@ -104,7 +104,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
|||||||
key: 'notifyScene',
|
key: 'notifyScene',
|
||||||
title: $t('page.notifyConfig.notifyScene'),
|
title: $t('page.notifyConfig.notifyScene'),
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 160,
|
||||||
render: row => {
|
render: row => {
|
||||||
if (row.notifyScene === null) {
|
if (row.notifyScene === null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -128,6 +128,7 @@ function handleUpdateModelWhenEdit() {
|
|||||||
|
|
||||||
if (props.operateType === 'edit' && props.rowData) {
|
if (props.operateType === 'edit' && props.rowData) {
|
||||||
Object.assign(model, props.rowData);
|
Object.assign(model, props.rowData);
|
||||||
|
systemTaskTypeChange(model.systemTaskType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,16 +208,27 @@ async function systemTaskTypeChange(value: number) {
|
|||||||
notifySceneOptions.value = translateOptions(retryNotifySceneOptions);
|
notifySceneOptions.value = translateOptions(retryNotifySceneOptions);
|
||||||
} else if (value === 3) {
|
} else if (value === 3) {
|
||||||
const res = await fetchGetJobList({ groupName: model.groupName });
|
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);
|
notifySceneOptions.value = translateOptions(jobNotifySceneOptions);
|
||||||
} else if (value === 4) {
|
} else if (value === 4) {
|
||||||
const res = await fetchGetWorkflowNameList({ groupName: model.groupName });
|
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);
|
notifySceneOptions.value = translateOptions(workflowNotifySceneOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
model.businessId = '';
|
if (value !== props.rowData?.systemTaskType) {
|
||||||
model.notifyScene = null;
|
model.businessId = null;
|
||||||
|
model.notifyScene = null;
|
||||||
|
} else {
|
||||||
|
model.businessId = props.rowData?.businessId;
|
||||||
|
model.notifyScene = props.rowData?.notifyScene;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function groupNameUpdate(groupName: string) {
|
function groupNameUpdate(groupName: string) {
|
||||||
@ -294,7 +306,7 @@ watch(visible, () => {
|
|||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="model.notifyScene"
|
v-model:value="model.notifyScene"
|
||||||
:placeholder="$t('page.notifyConfig.form.notifyScene')"
|
:placeholder="$t('page.notifyConfig.form.notifyScene')"
|
||||||
:options="notifySceneOptions"
|
:options="translateOptions(notifySceneOptions)"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
Loading…
Reference in New Issue
Block a user