perf: 通知和定时器的删除按钮显示为红色更显眼

v2
xiaojunnuo 2025-07-14 23:25:56 +08:00
parent 6369fed5fc
commit 61ba83c775
4 changed files with 15 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<template #title> <template #title>
<div> <div>
{{ t("certd.edit_notification") }} {{ t("certd.edit_notification") }}
<a-button v-if="mode === 'edit'" @click="notificationDelete()"> <a-button v-if="mode === 'edit'" danger @click="notificationDelete()">
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
</template> </template>

View File

@ -3,7 +3,7 @@
<template #title> <template #title>
<div> <div>
编辑任务 编辑任务
<a-button v-if="editMode" @click="taskDelete()"> <a-button v-if="editMode" danger @click="taskDelete()">
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
</a-button> </a-button>
</div> </div>

View File

@ -3,7 +3,7 @@
<template #title> <template #title>
<div> <div>
{{ t("certd.editTrigger") }} {{ t("certd.editTrigger") }}
<a-button v-if="mode === 'edit'" @click="triggerDelete()"> <a-button v-if="mode === 'edit'" danger @click="triggerDelete()">
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
</template> </template>

View File

@ -302,6 +302,7 @@ import { eachSteps, findStep } from "../utils";
import { usePluginStore } from "/@/store/plugin"; import { usePluginStore } from "/@/store/plugin";
import { getCronNextTimes } from "/@/components/cron-editor/utils"; import { getCronNextTimes } from "/@/components/cron-editor/utils";
import { useCertViewer } from "/@/views/certd/pipeline/use"; import { useCertViewer } from "/@/views/certd/pipeline/use";
import { useI18n } from "/@/locales";
export default defineComponent({ export default defineComponent({
name: "PipelineEdit", name: "PipelineEdit",
@ -339,6 +340,7 @@ export default defineComponent({
}, },
emits: ["update:modelValue", "update:editMode"], emits: ["update:modelValue", "update:editMode"],
setup(props, ctx) { setup(props, ctx) {
const { t } = useI18n();
const currentPipeline: Ref<any> = ref({}); const currentPipeline: Ref<any> = ref({});
const pipeline: Ref<any> = ref({}); const pipeline: Ref<any> = ref({});
@ -668,9 +670,19 @@ export default defineComponent({
notificationFormRef.value.notificationView(notification, (type: string, value: any) => {}); notificationFormRef.value.notificationView(notification, (type: string, value: any) => {});
} }
}; };
const notificationDelete = (notification: any, index: any) => {
Modal.confirm({
title: t("certd.confirm"),
content: t("certd.confirm_delete_trigger"),
async onOk() {
pipeline.value.notifications.splice(index, 1);
},
});
};
return { return {
notificationAdd, notificationAdd,
notificationEdit, notificationEdit,
notificationDelete,
notificationFormRef, notificationFormRef,
}; };
} }