feat(sj_1.3.0-beta1): 定时任务新增告警通知场景
This commit is contained in:
parent
1e7856f2da
commit
2b22acb21c
11141
pnpm-lock.yaml
11141
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -52,18 +52,21 @@ export const retryNotifyScene: Record<Api.NotifyConfig.RetryNotifyScene, App.I18
|
|||||||
3: 'page.notifyConfig.retryNotifyScene.clientReportError',
|
3: 'page.notifyConfig.retryNotifyScene.clientReportError',
|
||||||
4: 'page.notifyConfig.retryNotifyScene.clientComponentError',
|
4: 'page.notifyConfig.retryNotifyScene.clientComponentError',
|
||||||
5: 'page.notifyConfig.retryNotifyScene.retryTaskReachThreshold',
|
5: 'page.notifyConfig.retryNotifyScene.retryTaskReachThreshold',
|
||||||
6: 'page.notifyConfig.retryNotifyScene.retryTaskEnterDeadLetter'
|
6: 'page.notifyConfig.retryNotifyScene.retryTaskEnterDeadLetter',
|
||||||
|
7: 'page.notifyConfig.retryNotifyScene.retryNoClientNodesError'
|
||||||
};
|
};
|
||||||
export const retryNotifySceneOptions = transformRecordToNumberOption(retryNotifyScene);
|
export const retryNotifySceneOptions = transformRecordToNumberOption(retryNotifyScene);
|
||||||
|
|
||||||
export const jobNotifyScene: Record<Api.NotifyConfig.JobNotifyScene, App.I18n.I18nKey> = {
|
export const jobNotifyScene: Record<Api.NotifyConfig.JobNotifyScene, App.I18n.I18nKey> = {
|
||||||
1: 'page.notifyConfig.jobNotifyScene.jobTaskError',
|
1: 'page.notifyConfig.jobNotifyScene.jobTaskError',
|
||||||
2: 'page.notifyConfig.jobNotifyScene.jobClientError'
|
2: 'page.notifyConfig.jobNotifyScene.jobClientError',
|
||||||
|
3: 'page.notifyConfig.jobNotifyScene.jobNoClientNodesError'
|
||||||
};
|
};
|
||||||
export const jobNotifySceneOptions = transformRecordToNumberOption(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',
|
||||||
|
3: 'page.notifyConfig.workflowNotifyScene.workNoClientNodesError',
|
||||||
100: 'page.notifyConfig.workflowNotifyScene.workTaskError'
|
100: 'page.notifyConfig.workflowNotifyScene.workTaskError'
|
||||||
};
|
};
|
||||||
export const workflowNotifySceneOptions = transformRecordToNumberOption(workflowNotifyScene);
|
export const workflowNotifySceneOptions = transformRecordToNumberOption(workflowNotifyScene);
|
||||||
|
@ -533,6 +533,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: 'Alarm Notify List',
|
title: 'Alarm Notify List',
|
||||||
groupName: 'Group name',
|
groupName: 'Group name',
|
||||||
businessName: 'Business ID',
|
businessName: 'Business ID',
|
||||||
|
notifyName: 'Notify name',
|
||||||
notifyStatus: 'State',
|
notifyStatus: 'State',
|
||||||
notifyType: 'Notify type',
|
notifyType: 'Notify type',
|
||||||
notifyScene: 'Notify scene',
|
notifyScene: 'Notify scene',
|
||||||
@ -543,13 +544,13 @@ const local: App.I18n.Schema = {
|
|||||||
job: 'Job',
|
job: 'Job',
|
||||||
workflow: 'Workflow',
|
workflow: 'Workflow',
|
||||||
form: {
|
form: {
|
||||||
businessId: 'Please select Business ID',
|
|
||||||
description: 'Please enter Describe',
|
description: 'Please enter Describe',
|
||||||
notifyType: 'Please select Notification type',
|
notifyType: 'Please select Notification type',
|
||||||
notifyAttribute: 'Please enter notify attribute',
|
notifyAttribute: 'Please enter notify attribute',
|
||||||
notifyScene: 'Please select Notification scene',
|
notifyScene: 'Please select Notification scene',
|
||||||
groupName: 'Please select Group name',
|
groupName: 'Please select Group name',
|
||||||
notifyThreshold: 'Please enter Notification threshold',
|
notifyThreshold: 'Please enter Notification threshold',
|
||||||
|
notifyName: 'Please enter name',
|
||||||
notifyStatus: 'Please select State',
|
notifyStatus: 'Please select State',
|
||||||
systemTaskType: 'Please enter task type',
|
systemTaskType: 'Please enter task type',
|
||||||
notifyRecipient: 'Please enter recipient',
|
notifyRecipient: 'Please enter recipient',
|
||||||
@ -567,15 +568,18 @@ const local: App.I18n.Schema = {
|
|||||||
clientReportError: 'Client report error',
|
clientReportError: 'Client report error',
|
||||||
clientComponentError: 'Client component error',
|
clientComponentError: 'Client component error',
|
||||||
retryTaskReachThreshold: 'Retry task reach threshold',
|
retryTaskReachThreshold: 'Retry task reach threshold',
|
||||||
retryTaskEnterDeadLetter: 'Retry task enter dead letter'
|
retryTaskEnterDeadLetter: 'Retry task enter dead letter',
|
||||||
|
retryNoClientNodesError: 'Retry task no client node'
|
||||||
},
|
},
|
||||||
jobNotifyScene: {
|
jobNotifyScene: {
|
||||||
jobTaskError: 'Task execute error',
|
jobTaskError: 'Task execute error',
|
||||||
jobClientError: 'Client execute error'
|
jobClientError: 'Client execute error',
|
||||||
|
jobNoClientNodesError: 'Job No Client execute error'
|
||||||
},
|
},
|
||||||
workflowNotifyScene: {
|
workflowNotifyScene: {
|
||||||
workTaskError: 'Workflow task execute error',
|
workflowClientError: 'Client execute error',
|
||||||
workflowClientError: 'Client execute error'
|
workNoClientNodesError: 'Workflow No Client execute error',
|
||||||
|
workTaskError: 'Workflow task execute error'
|
||||||
},
|
},
|
||||||
notifyRecipient: 'Notify recipient',
|
notifyRecipient: 'Notify recipient',
|
||||||
rateLimiterStatus: 'Rate limiter status',
|
rateLimiterStatus: 'Rate limiter status',
|
||||||
|
@ -541,6 +541,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: '告警通知列表',
|
title: '告警通知列表',
|
||||||
groupName: '组名称',
|
groupName: '组名称',
|
||||||
businessName: '业务ID',
|
businessName: '业务ID',
|
||||||
|
notifyName: '告警通知名称',
|
||||||
notifyStatus: '通知状态',
|
notifyStatus: '通知状态',
|
||||||
notifyType: '通知类型',
|
notifyType: '通知类型',
|
||||||
notifyScene: '通知场景',
|
notifyScene: '通知场景',
|
||||||
@ -551,7 +552,7 @@ const local: App.I18n.Schema = {
|
|||||||
job: '定时任务',
|
job: '定时任务',
|
||||||
workflow: '工作流',
|
workflow: '工作流',
|
||||||
form: {
|
form: {
|
||||||
businessId: '请选择业务ID',
|
notifyName: '请选择告警通知名称',
|
||||||
description: '请输入描述',
|
description: '请输入描述',
|
||||||
notifyType: '请选择通知类型',
|
notifyType: '请选择通知类型',
|
||||||
notifyAttribute: '请求输入通知属性',
|
notifyAttribute: '请求输入通知属性',
|
||||||
@ -575,15 +576,18 @@ const local: App.I18n.Schema = {
|
|||||||
clientReportError: '客户端上报失败',
|
clientReportError: '客户端上报失败',
|
||||||
clientComponentError: '客户端组件异常',
|
clientComponentError: '客户端组件异常',
|
||||||
retryTaskReachThreshold: '任务重试失败数量超过阈值',
|
retryTaskReachThreshold: '任务重试失败数量超过阈值',
|
||||||
retryTaskEnterDeadLetter: '任务重试失败进入死信队列'
|
retryTaskEnterDeadLetter: '任务重试失败进入死信队列',
|
||||||
|
retryNoClientNodesError: '没有可执行的客户端节点'
|
||||||
},
|
},
|
||||||
jobNotifyScene: {
|
jobNotifyScene: {
|
||||||
jobTaskError: '任务执行失败',
|
jobTaskError: '任务执行失败',
|
||||||
jobClientError: '客户端执行失败'
|
jobClientError: '客户端执行失败',
|
||||||
|
jobNoClientNodesError: '没有可执行的客户端节点'
|
||||||
},
|
},
|
||||||
workflowNotifyScene: {
|
workflowNotifyScene: {
|
||||||
workTaskError: '工作流任务执行失败',
|
workflowClientError: '客户端执行失败',
|
||||||
workflowClientError: '客户端执行失败'
|
workNoClientNodesError: '没有可执行的客户端节点',
|
||||||
|
workTaskError: '工作流任务执行失败'
|
||||||
},
|
},
|
||||||
notifyRecipient: '通知人信息',
|
notifyRecipient: '通知人信息',
|
||||||
rateLimiterStatus: '限流状态',
|
rateLimiterStatus: '限流状态',
|
||||||
|
@ -9,6 +9,14 @@ export function fetchGetNotifyConfigList(params?: Api.NotifyConfig.NotifySearchP
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** get notify systemTaskType list */
|
||||||
|
export function fetchGetNotifyConfigSystemTaskTypeList(systemTaskType: number) {
|
||||||
|
return request<CommonType.Option<number>[]>({
|
||||||
|
url: `/notify-config/all/${systemTaskType}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** add notify */
|
/** add notify */
|
||||||
export function fetchAddNotify(data: Api.NotifyConfig.NotifyConfig) {
|
export function fetchAddNotify(data: Api.NotifyConfig.NotifyConfig) {
|
||||||
return request<boolean>({
|
return request<boolean>({
|
||||||
|
29
src/typings/api.d.ts
vendored
29
src/typings/api.d.ts
vendored
@ -125,7 +125,7 @@ declare namespace Api {
|
|||||||
interface LoginToken {
|
interface LoginToken {
|
||||||
id: string;
|
id: string;
|
||||||
mode: string;
|
mode: string;
|
||||||
role: String;
|
role: string;
|
||||||
token: string;
|
token: string;
|
||||||
refreshToken: string;
|
refreshToken: string;
|
||||||
createDt: string;
|
createDt: string;
|
||||||
@ -576,14 +576,14 @@ declare namespace Api {
|
|||||||
type NotifyConfig = Common.CommonRecord<{
|
type NotifyConfig = Common.CommonRecord<{
|
||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
groupName: string | null;
|
groupName: string | null;
|
||||||
/** 业务ID */
|
|
||||||
businessId: string | null;
|
|
||||||
/** 通知人id */
|
/** 通知人id */
|
||||||
recipientIds: number[];
|
recipientIds: number[];
|
||||||
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
||||||
systemTaskType: SystemTaskType | null;
|
systemTaskType: SystemTaskType | null;
|
||||||
/** 业务名称 */
|
/** 业务名称 */
|
||||||
businessName?: string;
|
businessName?: string;
|
||||||
|
/** 通知名称 */
|
||||||
|
notifyName: string;
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
notifyStatus: Api.Common.EnableStatusNumber;
|
notifyStatus: Api.Common.EnableStatusNumber;
|
||||||
/** 通知场景 */
|
/** 通知场景 */
|
||||||
@ -600,10 +600,7 @@ declare namespace Api {
|
|||||||
|
|
||||||
/** notify-config search params */
|
/** notify-config search params */
|
||||||
type NotifySearchParams = CommonType.RecordNullable<
|
type NotifySearchParams = CommonType.RecordNullable<
|
||||||
Pick<
|
Pick<Api.NotifyConfig.NotifyConfig, 'groupName' | 'systemTaskType' | 'notifyStatus' | 'notifyScene'> &
|
||||||
Api.NotifyConfig.NotifyConfig,
|
|
||||||
'groupName' | 'businessId' | 'systemTaskType' | 'notifyStatus' | 'notifyScene'
|
|
||||||
> &
|
|
||||||
CommonSearchParams
|
CommonSearchParams
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -613,14 +610,14 @@ declare namespace Api {
|
|||||||
/** 任务类型 1、重试任务 2、回调任务、 3、JOB任务 4、WORKFLOW任务 */
|
/** 任务类型 1、重试任务 2、回调任务、 3、JOB任务 4、WORKFLOW任务 */
|
||||||
type SystemTaskType = 1 | 3 | 4;
|
type SystemTaskType = 1 | 3 | 4;
|
||||||
|
|
||||||
/** 1、场景重试数量超过阈值 2、场景重试失败数量超过阈值 3、客户端上报失败 4、客户端组件异常 5、任务重试失败数量超过阈值 6、任务重试失败进入死信队列 */
|
/** 1、场景重试数量超过阈值 2、场景重试失败数量超过阈值 3、客户端上报失败 4、客户端组件异常 5、任务重试失败数量超过阈值 6、任务重试失败进入死信队列 7、没有可执行的客户端节点 */
|
||||||
type RetryNotifyScene = 1 | 2 | 3 | 4 | 5 | 6;
|
type RetryNotifyScene = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||||
|
|
||||||
/** 1、任务执行失败 2、客户端执行失败 */
|
/** 1、任务执行失败 2、客户端执行失败 3、没有可执行的客户端节点 */
|
||||||
type JobNotifyScene = 1 | 2;
|
type JobNotifyScene = 1 | 2 | 3;
|
||||||
|
|
||||||
/** 2、 客户端执行失败 100、工作流任务执行失败 */
|
/** 2、 客户端执行失败 3、没有可执行的客户端节点 100、工作流任务执行失败 */
|
||||||
type WorkflowNotifyScene = 2 | 100;
|
type WorkflowNotifyScene = 2 | 3 | 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -934,7 +931,7 @@ declare namespace Api {
|
|||||||
>;
|
>;
|
||||||
|
|
||||||
type ExportWorkflow = Common.CommonRecord<{
|
type ExportWorkflow = Common.CommonRecord<{
|
||||||
workflowIds: String[];
|
workflowIds: string[];
|
||||||
}> &
|
}> &
|
||||||
WorkflowSearchParams;
|
WorkflowSearchParams;
|
||||||
|
|
||||||
@ -954,6 +951,8 @@ declare namespace Api {
|
|||||||
type Job = Common.CommonRecord<{
|
type Job = Common.CommonRecord<{
|
||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
groupName: string;
|
groupName: string;
|
||||||
|
/** 通知场景ids */
|
||||||
|
notifyIds: number[];
|
||||||
/** 任务名称 */
|
/** 任务名称 */
|
||||||
jobName: string;
|
jobName: string;
|
||||||
/** 方法参数 */
|
/** 方法参数 */
|
||||||
@ -992,6 +991,8 @@ declare namespace Api {
|
|||||||
bucketIndex?: number;
|
bucketIndex?: number;
|
||||||
/** 描述 */
|
/** 描述 */
|
||||||
description?: string;
|
description?: string;
|
||||||
|
/** 通知场景 */
|
||||||
|
notifyScene?: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
/** JobTask search params */
|
/** JobTask search params */
|
||||||
|
8
src/typings/app.d.ts
vendored
8
src/typings/app.d.ts
vendored
@ -741,6 +741,7 @@ declare namespace App {
|
|||||||
title: string;
|
title: string;
|
||||||
groupName: string;
|
groupName: string;
|
||||||
businessName: string;
|
businessName: string;
|
||||||
|
notifyName: string;
|
||||||
notifyStatus: string;
|
notifyStatus: string;
|
||||||
notifyType: string;
|
notifyType: string;
|
||||||
notifyScene: string;
|
notifyScene: string;
|
||||||
@ -751,13 +752,13 @@ declare namespace App {
|
|||||||
job: string;
|
job: string;
|
||||||
workflow: string;
|
workflow: string;
|
||||||
form: {
|
form: {
|
||||||
businessId: string;
|
|
||||||
description: string;
|
description: string;
|
||||||
notifyType: string;
|
notifyType: string;
|
||||||
notifyAttribute: string;
|
notifyAttribute: string;
|
||||||
notifyScene: string;
|
notifyScene: string;
|
||||||
groupName: string;
|
groupName: string;
|
||||||
notifyThreshold: string;
|
notifyThreshold: string;
|
||||||
|
notifyName: string;
|
||||||
notifyStatus: string;
|
notifyStatus: string;
|
||||||
systemTaskType: string;
|
systemTaskType: string;
|
||||||
notifyRecipient: string;
|
notifyRecipient: string;
|
||||||
@ -776,14 +777,17 @@ declare namespace App {
|
|||||||
clientComponentError: string;
|
clientComponentError: string;
|
||||||
retryTaskReachThreshold: string;
|
retryTaskReachThreshold: string;
|
||||||
retryTaskEnterDeadLetter: string;
|
retryTaskEnterDeadLetter: string;
|
||||||
|
retryNoClientNodesError: string;
|
||||||
};
|
};
|
||||||
jobNotifyScene: {
|
jobNotifyScene: {
|
||||||
jobTaskError: string;
|
jobTaskError: string;
|
||||||
jobClientError: string;
|
jobClientError: string;
|
||||||
|
jobNoClientNodesError: string;
|
||||||
};
|
};
|
||||||
workflowNotifyScene: {
|
workflowNotifyScene: {
|
||||||
workTaskError: string;
|
|
||||||
workflowClientError: string;
|
workflowClientError: string;
|
||||||
|
workNoClientNodesError: string;
|
||||||
|
workTaskError: string;
|
||||||
};
|
};
|
||||||
notifyRecipient: string;
|
notifyRecipient: string;
|
||||||
rateLimiterStatus: string;
|
rateLimiterStatus: string;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, reactive, ref, watch } from 'vue';
|
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { type FormInst, NInputNumber } from 'naive-ui';
|
import { type FormInst, NInputNumber } from 'naive-ui';
|
||||||
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
||||||
import OperateDrawer from '@/components/common/operate-drawer.vue';
|
import OperateDrawer from '@/components/common/operate-drawer.vue';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { enableStatusNumberOptions } from '@/constants/business';
|
import { enableStatusNumberOptions } from '@/constants/business';
|
||||||
import { fetchAddJob, fetchEditJob } from '@/service/api';
|
import { fetchAddJob, fetchEditJob, fetchGetNotifyConfigSystemTaskTypeList } from '@/service/api';
|
||||||
import RouteKey from '@/components/common/route-key.vue';
|
import RouteKey from '@/components/common/route-key.vue';
|
||||||
import BlockStrategy from '@/components/common/block-strategy.vue';
|
import BlockStrategy from '@/components/common/block-strategy.vue';
|
||||||
import ExecutorType from '@/components/common/executor-type.vue';
|
import ExecutorType from '@/components/common/executor-type.vue';
|
||||||
@ -13,6 +13,7 @@ import TaskType from '@/components/common/task-type.vue';
|
|||||||
import CodeMirror from '@/components/common/code-mirror.vue';
|
import CodeMirror from '@/components/common/code-mirror.vue';
|
||||||
import JobTriggerInterval from '@/components/common/job-trigger-interval.vue';
|
import JobTriggerInterval from '@/components/common/job-trigger-interval.vue';
|
||||||
import { isNotNull } from '@/utils/common';
|
import { isNotNull } from '@/utils/common';
|
||||||
|
import SelectGroup from '@/components/common/select-group.vue';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'JobTaskOperateDrawer'
|
name: 'JobTaskOperateDrawer'
|
||||||
@ -25,6 +26,7 @@ interface Props {
|
|||||||
rowData?: Api.Job.Job | null;
|
rowData?: Api.Job.Job | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const notifyNameList = ref<CommonType.Option<number>[]>([]);
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
@ -59,6 +61,7 @@ type Model = Pick<
|
|||||||
Api.Job.Job,
|
Api.Job.Job,
|
||||||
| 'id'
|
| 'id'
|
||||||
| 'groupName'
|
| 'groupName'
|
||||||
|
| 'notifyIds'
|
||||||
| 'jobName'
|
| 'jobName'
|
||||||
| 'argsStr'
|
| 'argsStr'
|
||||||
| 'argsType'
|
| 'argsType'
|
||||||
@ -75,14 +78,27 @@ type Model = Pick<
|
|||||||
| 'taskType'
|
| 'taskType'
|
||||||
| 'parallelNum'
|
| 'parallelNum'
|
||||||
| 'description'
|
| 'description'
|
||||||
|
| 'notifyScene'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
getNotifyConfigSystemTaskTypeList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getNotifyConfigSystemTaskTypeList() {
|
||||||
|
const res = await fetchGetNotifyConfigSystemTaskTypeList(3);
|
||||||
|
notifyNameList.value = res.data as CommonType.Option<number>[];
|
||||||
|
}
|
||||||
|
|
||||||
const model: Model = reactive(createDefaultModel());
|
const model: Model = reactive(createDefaultModel());
|
||||||
|
|
||||||
function createDefaultModel(): Model {
|
function createDefaultModel(): Model {
|
||||||
return {
|
return {
|
||||||
// @ts-expect-error groupName is required
|
// @ts-expect-error groupName is required
|
||||||
groupName: undefined,
|
groupName: undefined,
|
||||||
|
notifyIds: [],
|
||||||
jobName: '',
|
jobName: '',
|
||||||
argsStr: '',
|
argsStr: '',
|
||||||
argsType: 1,
|
argsType: 1,
|
||||||
@ -252,6 +268,7 @@ async function handleSubmit() {
|
|||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
groupName,
|
groupName,
|
||||||
|
notifyIds,
|
||||||
jobName,
|
jobName,
|
||||||
argsType,
|
argsType,
|
||||||
jobStatus,
|
jobStatus,
|
||||||
@ -286,6 +303,7 @@ async function handleSubmit() {
|
|||||||
if (props.operateType === 'add') {
|
if (props.operateType === 'add') {
|
||||||
const { error } = await fetchAddJob({
|
const { error } = await fetchAddJob({
|
||||||
groupName,
|
groupName,
|
||||||
|
notifyIds,
|
||||||
jobName,
|
jobName,
|
||||||
argsStr,
|
argsStr,
|
||||||
argsType,
|
argsType,
|
||||||
@ -311,6 +329,7 @@ async function handleSubmit() {
|
|||||||
const { error } = await fetchEditJob({
|
const { error } = await fetchEditJob({
|
||||||
id,
|
id,
|
||||||
groupName,
|
groupName,
|
||||||
|
notifyIds,
|
||||||
jobName,
|
jobName,
|
||||||
argsStr,
|
argsStr,
|
||||||
argsType,
|
argsType,
|
||||||
@ -512,7 +531,9 @@ const scriptMethodOptions = [
|
|||||||
<icon-ic-round-delete class="text-icon" />
|
<icon-ic-round-delete class="text-icon" />
|
||||||
</NButton>
|
</NButton>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NButton block dashed attr-type="button" @click="addItem"><icon-ic-round-plus class="text-icon" /></NButton>
|
<NButton block dashed attr-type="button" @click="addItem">
|
||||||
|
<icon-ic-round-plus class="text-icon" />
|
||||||
|
</NButton>
|
||||||
</NCard>
|
</NCard>
|
||||||
<CodeMirror v-else v-model="model.argsStr" lang="json" :placeholder="$t('page.jobTask.form.argsStr')" />
|
<CodeMirror v-else v-model="model.argsStr" lang="json" :placeholder="$t('page.jobTask.form.argsStr')" />
|
||||||
</template>
|
</template>
|
||||||
@ -679,6 +700,17 @@ const scriptMethodOptions = [
|
|||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NGi>
|
</NGi>
|
||||||
</NGrid>
|
</NGrid>
|
||||||
|
<NFormItem :label="$t('page.notifyConfig.notifyName')" path="notifyIds">
|
||||||
|
<NSelect
|
||||||
|
v-model:value="model.notifyIds"
|
||||||
|
value-field="id"
|
||||||
|
label-field="notifyName"
|
||||||
|
:placeholder="$t('page.notifyConfig.form.notifyName')"
|
||||||
|
:options="notifyNameList"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.jobTask.description')" path="description">
|
<NFormItem :label="$t('page.jobTask.description')" path="description">
|
||||||
<NInput v-model:value="model.description" type="textarea" :placeholder="$t('page.jobTask.form.description')" />
|
<NInput v-model:value="model.description" type="textarea" :placeholder="$t('page.jobTask.form.description')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
@ -74,9 +74,9 @@ type Model = Pick<
|
|||||||
Api.NotifyConfig.NotifyConfig,
|
Api.NotifyConfig.NotifyConfig,
|
||||||
| 'id'
|
| 'id'
|
||||||
| 'groupName'
|
| 'groupName'
|
||||||
| 'businessId'
|
|
||||||
| 'recipientIds'
|
| 'recipientIds'
|
||||||
| 'systemTaskType'
|
| 'systemTaskType'
|
||||||
|
| 'notifyName'
|
||||||
| 'notifyStatus'
|
| 'notifyStatus'
|
||||||
| 'notifyScene'
|
| 'notifyScene'
|
||||||
| 'notifyThreshold'
|
| 'notifyThreshold'
|
||||||
@ -101,9 +101,9 @@ const model: Model = reactive(createDefaultModel());
|
|||||||
function createDefaultModel(): Model {
|
function createDefaultModel(): Model {
|
||||||
return {
|
return {
|
||||||
groupName: null,
|
groupName: null,
|
||||||
businessId: '',
|
|
||||||
recipientIds: [],
|
recipientIds: [],
|
||||||
systemTaskType: null,
|
systemTaskType: null,
|
||||||
|
notifyName: '',
|
||||||
notifyStatus: 1,
|
notifyStatus: 1,
|
||||||
notifyScene: null,
|
notifyScene: null,
|
||||||
notifyThreshold: 16,
|
notifyThreshold: 16,
|
||||||
@ -116,9 +116,9 @@ function createDefaultModel(): Model {
|
|||||||
type RuleKey = Extract<
|
type RuleKey = Extract<
|
||||||
keyof Model,
|
keyof Model,
|
||||||
| 'groupName'
|
| 'groupName'
|
||||||
| 'businessId'
|
|
||||||
| 'systemTaskType'
|
| 'systemTaskType'
|
||||||
| 'recipientIds'
|
| 'recipientIds'
|
||||||
|
| 'notifyName'
|
||||||
| 'notifyStatus'
|
| 'notifyStatus'
|
||||||
| 'notifyScene'
|
| 'notifyScene'
|
||||||
| 'rateLimiterStatus'
|
| 'rateLimiterStatus'
|
||||||
@ -127,8 +127,8 @@ type RuleKey = Extract<
|
|||||||
|
|
||||||
const rules: Record<RuleKey, App.Global.FormRule> = {
|
const rules: Record<RuleKey, App.Global.FormRule> = {
|
||||||
groupName: defaultRequiredRule,
|
groupName: defaultRequiredRule,
|
||||||
businessId: defaultRequiredRule,
|
|
||||||
systemTaskType: defaultRequiredRule,
|
systemTaskType: defaultRequiredRule,
|
||||||
|
notifyName: defaultRequiredRule,
|
||||||
notifyStatus: defaultRequiredRule,
|
notifyStatus: defaultRequiredRule,
|
||||||
notifyScene: defaultRequiredRule,
|
notifyScene: defaultRequiredRule,
|
||||||
recipientIds: defaultRequiredRule,
|
recipientIds: defaultRequiredRule,
|
||||||
@ -160,9 +160,9 @@ async function handleSubmit() {
|
|||||||
if (props.operateType === 'add') {
|
if (props.operateType === 'add') {
|
||||||
const {
|
const {
|
||||||
groupName,
|
groupName,
|
||||||
businessId,
|
|
||||||
recipientIds,
|
recipientIds,
|
||||||
systemTaskType,
|
systemTaskType,
|
||||||
|
notifyName,
|
||||||
notifyStatus,
|
notifyStatus,
|
||||||
notifyScene,
|
notifyScene,
|
||||||
notifyThreshold,
|
notifyThreshold,
|
||||||
@ -172,9 +172,9 @@ async function handleSubmit() {
|
|||||||
} = model;
|
} = model;
|
||||||
const { error } = await fetchAddNotify({
|
const { error } = await fetchAddNotify({
|
||||||
groupName,
|
groupName,
|
||||||
businessId,
|
|
||||||
recipientIds,
|
recipientIds,
|
||||||
systemTaskType,
|
systemTaskType,
|
||||||
|
notifyName,
|
||||||
notifyStatus,
|
notifyStatus,
|
||||||
notifyScene,
|
notifyScene,
|
||||||
notifyThreshold,
|
notifyThreshold,
|
||||||
@ -189,9 +189,9 @@ async function handleSubmit() {
|
|||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
groupName,
|
groupName,
|
||||||
businessId,
|
|
||||||
recipientIds,
|
recipientIds,
|
||||||
notifyStatus,
|
notifyStatus,
|
||||||
|
notifyName,
|
||||||
systemTaskType,
|
systemTaskType,
|
||||||
notifyScene,
|
notifyScene,
|
||||||
notifyThreshold,
|
notifyThreshold,
|
||||||
@ -202,9 +202,9 @@ async function handleSubmit() {
|
|||||||
const { error } = await fetchEditNotify({
|
const { error } = await fetchEditNotify({
|
||||||
id,
|
id,
|
||||||
groupName,
|
groupName,
|
||||||
businessId,
|
|
||||||
recipientIds,
|
recipientIds,
|
||||||
systemTaskType,
|
systemTaskType,
|
||||||
|
notifyName,
|
||||||
notifyStatus,
|
notifyStatus,
|
||||||
notifyScene,
|
notifyScene,
|
||||||
notifyThreshold,
|
notifyThreshold,
|
||||||
@ -239,14 +239,6 @@ async function systemTaskTypeChange(value: number | null) {
|
|||||||
}) as Api.Workflow.Workflow[];
|
}) as Api.Workflow.Workflow[];
|
||||||
notifySceneOptions.value = translateOptions(workflowNotifySceneOptions);
|
notifySceneOptions.value = translateOptions(workflowNotifySceneOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value !== props.rowData?.systemTaskType) {
|
|
||||||
model.businessId = null;
|
|
||||||
model.notifyScene = null;
|
|
||||||
} else {
|
|
||||||
model.businessId = props.rowData?.businessId;
|
|
||||||
model.notifyScene = props.rowData?.notifyScene;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function retrySceneChange(
|
async function retrySceneChange(
|
||||||
@ -278,7 +270,7 @@ watch(visible, () => {
|
|||||||
<OperateDrawer v-model="visible" :title="title" :min-size="480" @handle-submit="handleSubmit">
|
<OperateDrawer v-model="visible" :title="title" :min-size="480" @handle-submit="handleSubmit">
|
||||||
<NForm ref="formRef" :model="model" :rules="rules">
|
<NForm ref="formRef" :model="model" :rules="rules">
|
||||||
<NFormItem :label="$t('page.notifyConfig.groupName')" path="groupName">
|
<NFormItem :label="$t('page.notifyConfig.groupName')" path="groupName">
|
||||||
<SelectGroup v-model:modelValue="model.groupName" @update:model-value="groupNameUpdate" />
|
<SelectGroup v-model:value="model.groupName" @update:model-value="groupNameUpdate" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.systemTaskType')" path="systemTaskType">
|
<NFormItem :label="$t('page.notifyConfig.systemTaskType')" path="systemTaskType">
|
||||||
<NSelect
|
<NSelect
|
||||||
@ -288,32 +280,8 @@ watch(visible, () => {
|
|||||||
@update:value="systemTaskTypeChange"
|
@update:value="systemTaskTypeChange"
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem v-if="model.systemTaskType === 1" :label="$t('page.notifyConfig.retryScene')" path="businessId">
|
<NFormItem :label="$t('page.notifyConfig.notifyName')" path="notifyName">
|
||||||
<NSelect
|
<NInput v-model:value="model.notifyName" :placeholder="$t('page.notifyConfig.form.notifyName')" />
|
||||||
v-model:value="model.businessId"
|
|
||||||
:placeholder="$t('page.notifyConfig.form.sceneName')"
|
|
||||||
:options="retryScenes"
|
|
||||||
label-field="sceneName"
|
|
||||||
value-field="sceneName"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
|
||||||
<NFormItem v-if="model.systemTaskType === 3" :label="$t('page.notifyConfig.job')" path="businessId">
|
|
||||||
<NSelect
|
|
||||||
v-model:value="model.businessId"
|
|
||||||
:placeholder="$t('page.notifyConfig.form.jobName')"
|
|
||||||
:options="jobs"
|
|
||||||
label-field="jobName"
|
|
||||||
value-field="id"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
|
||||||
<NFormItem v-if="model.systemTaskType === 4" :label="$t('page.notifyConfig.workflow')" path="businessId">
|
|
||||||
<NSelect
|
|
||||||
v-model:value="model.businessId"
|
|
||||||
:placeholder="$t('page.notifyConfig.form.workflowName')"
|
|
||||||
:options="workflows"
|
|
||||||
label-field="workflowName"
|
|
||||||
value-field="id"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.notifyScene')" path="notifyScene">
|
<NFormItem :label="$t('page.notifyConfig.notifyScene')" path="notifyScene">
|
||||||
<NSelect
|
<NSelect
|
||||||
|
Loading…
Reference in New Issue
Block a user