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

View File

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

View File

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