Browse Source

[新增]删除任务

master
邵佳豪 1 month ago
parent
commit
95f66fd288
  1. 3
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  2. 22
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

3
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html

@ -470,7 +470,8 @@
<div class="flexcol" style="flex: 1;">
<span class="ellipsi">
<span style="cursor: pointer;" (click)="look(i)">查看</span>
<span style="cursor: pointer;margin-right: 5px;" (click)="look(i)">查看</span>
<span style="cursor: pointer;color: rgb(255, 64, 77);" (click)="deleteTask(item,i)">删除</span>
</span>
<span>
操作

22
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

@ -740,4 +740,26 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
);
}
}
deleteTask(element, item) {
this.modal.confirm({
nzTitle: '确定删除此任务吗?',
nzOkText: '确定',
nzOkType: 'primary',
nzOkDanger: true,
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe({
next: (data) => {
this.message.create('success', '删除成功');
element.data = element.data.filter((i) => i.id != item.id);
},
error: (err) => {
this.message.create('warning', '删除失败');
},
});
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel'),
});
}
}

Loading…
Cancel
Save