fix: 修复移动任务后出现空阶段的bug

pull/229/head
xiaojunnuo 2024-10-23 09:38:03 +08:00
parent 1291e98e82
commit 4ea3edd59e
3 changed files with 11 additions and 3 deletions

View File

@ -13,7 +13,8 @@ import { useSettingStore } from "/@/store/modules/settings";
import _ from "lodash-es";
import { useModal } from "/@/use/use-modal";
import CertView from "./cert-view.vue";
import { eachRunnable, eachStages } from "./utils";
import { eachStages } from "./utils";
export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
const { t } = useI18n();

View File

@ -264,7 +264,7 @@ import _ from "lodash-es";
import { message, Modal, notification } from "ant-design-vue";
import { nanoid } from "nanoid";
import { PipelineDetail, PipelineOptions, PluginGroups, RunHistory } from "./type";
import type { Runnable } from "@certd/pipeline";
import type { Runnable, Stage } from "@certd/pipeline";
import PiHistoryTimelineItem from "/@/views/certd/pipeline/pipeline/component/history-timeline-item.vue";
import { FsIcon } from "@fast-crud/fast-crud";
import { useSettingStore } from "/@/store/modules/settings";
@ -633,6 +633,12 @@ export default defineComponent({
}
pipeline.value.version++;
currentPipeline.value = pipeline.value;
//
_.remove(pipeline.value.stages, (item: Stage) => {
return item.tasks.length === 0;
});
await props.options.doSave(pipeline.value);
}
toggleEditMode(false);

View File

@ -4,6 +4,7 @@ export type StatusEnumItem = {
color: string;
icon: string;
spin?: boolean;
iconSpin?: boolean;
};
export type StatusEnumType = {
[key: string]: StatusEnumItem;
@ -34,13 +35,13 @@ const StatusEnum: StatusEnumType = {
label: "运行中",
color: "blue",
spin: true,
iconSpin: true,
icon: "ant-design:sync-outlined"
},
canceled: {
value: "canceled",
label: "已取消",
color: "yellow",
spin: true,
icon: "ant-design:minus-circle-twotone"
},
none: {