-- fix bug

This commit is contained in:
yuping
2023-02-24 23:23:24 +08:00
parent d750267f41
commit 606ec95c66
2 changed files with 66 additions and 156 deletions

View File

@@ -477,17 +477,20 @@ const deleteTaskAll = () => {
return
}
dialog({
content: '确定要批量删除任务吗?',
content: '确定要删除所选任务吗?',
ok: () => {
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.filter(t => t.checked).forEach((t,i) => {
if(t.id){
t.checked = false;
t.deleted = true;
}else{
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(i,1)
for (let i = 0; i < projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.length; i++) {
const t = projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[i]
if (t.checked) {
if (t.id) {
t.checked = false;
t.deleted = true;
} else {
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(i, 1);
i--;
}
}
})
}
},
});
};
@@ -497,7 +500,7 @@ const confirmDelTask = (index) => {
content: '确定要删除此任务吗?',
ok: () => {
message.success("删除成功");
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].id?(projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].deleted = true):projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(index,1)
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].id ? (projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].deleted = true) : projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(index, 1)
},
});
};
@@ -535,7 +538,7 @@ const deleteStage = () => {
content: projectInfo.value.stageList.length === 1 ? "当前为最后一个阶段,删除后任务将被移出,为无阶段模式,确认删除阶段吗?" : '确认删除此阶段吗?',
ok: () => {
message.success("删除成功");
projectInfo.value.stageList[activeIndex.value].id?(projectInfo.value.stageList[activeIndex.value].deleted = true):projectInfo.value.stageList.splice(activeIndex.value,1)
projectInfo.value.stageList[activeIndex.value].id ? (projectInfo.value.stageList[activeIndex.value].deleted = true) : projectInfo.value.stageList.splice(activeIndex.value, 1)
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
},
});
@@ -556,12 +559,12 @@ const removeAllLevel = () => {
content: '确定要删除所有阶段吗?',
ok: () => {
message.success("删除成功");
projectInfo.value.stageList.forEach((t,i) => {
if(t.id){
projectInfo.value.stageList.forEach((t, i) => {
if (t.id) {
t.checked = false;
t.deleted = true;
}else{
projectInfo.value.stageList.splice(i,1)
} else {
projectInfo.value.stageList.splice(i, 1)
}
})
},