pull/265/head
xiaojunnuo 2024-12-09 21:44:37 +08:00
parent 498cf34999
commit fef1305e41
3 changed files with 13 additions and 9 deletions

View File

@ -126,14 +126,12 @@ function clear() {
} }
async function emitValue(value: any) { async function emitValue(value: any) {
const target = optionsDictRef.dataMap[value]; if (value !== 0 && pipeline?.value && target && pipeline.value.userId !== target.value.userId) {
if (value !== 0 && pipeline?.value && target && pipeline.value.userId !== target.userId) {
message.error("对不起,您不能修改他人流水线的通知"); message.error("对不起,您不能修改他人流水线的通知");
return; return;
} }
emit("change", value); emit("change", value);
emit("update:modelValue", value); emit("update:modelValue", value);
emit("selectedChange", target);
} }
watch( watch(
@ -143,6 +141,7 @@ watch(
async (value) => { async (value) => {
await optionsDictRef.loadDict(); await optionsDictRef.loadDict();
target.value = optionsDictRef.dataMap[value]; target.value = optionsDictRef.dataMap[value];
emit("selectedChange", target.value);
}, },
{ {
immediate: true immediate: true

View File

@ -107,10 +107,15 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
title: "失败通知", title: "失败通知",
type: "text", type: "text",
form: { form: {
value: true, value: 0,
component: { component: {
name: "a-switch", name: NotificationSelector,
vModel: "checked" vModel: "modelValue",
on: {
selectedChange({ $event, form }) {
form.notificationTarget = $event;
}
}
}, },
order: 101, order: 101,
helper: "任务执行失败实时提醒" helper: "任务执行失败实时提醒"

View File

@ -102,12 +102,12 @@ export default function ({ crudExpose, context: { certdFormRef, groupDictRef, se
triggers.push({ title: "定时触发", type: "timer", props: { cron: form.triggerCron } }); triggers.push({ title: "定时触发", type: "timer", props: { cron: form.triggerCron } });
} }
const notifications = []; const notifications = [];
if (form.notification) { if (form.notification != null) {
notifications.push({ notifications.push({
type: "custom", type: "custom",
when: ["error", "turnToSuccess"], when: ["error", "turnToSuccess"],
notificationId: 0, notificationId: form.notification,
title: "使用默认通知" title: form.notificationTarget?.name || "自定义通知"
}); });
} }
let pipeline = { let pipeline = {