From 95f66fd28843b8f5956adb16a9c5e0d060d7a549 Mon Sep 17 00:00:00 2001
From: Sjh <55341701@qq.com>
Date: Fri, 18 Oct 2024 17:22:28 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=88=A0=E9=99=A4=E4=BB=BB?=
=?UTF-8?q?=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../da-monthly-task-overview.component.html | 3 ++-
.../da-monthly-task-overview.component.ts | 22 +++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
index 0564b25..b653df2 100644
--- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
+++ b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
@@ -470,7 +470,8 @@
- 查看
+ 查看
+ 删除
操作
diff --git a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts b/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
index dd68ae8..edd0830 100644
--- a/src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
+++ b/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'),
+ });
+ }
}