From 0d3d8f23bbd7c50c8dcddce204a072421fb9f4e2 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 26 Dec 2024 18:16:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(AppWeightManage):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重构 handleDelete 方法,通过 API 删除数据 - 更新删除按钮点击事件,传入正确的 id 参数 - 删除成功后重新获取数据,保持列表同步 --- project/xumu/AppWeightManage/add.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/project/xumu/AppWeightManage/add.vue b/project/xumu/AppWeightManage/add.vue index 90a2ebc2..ef9b8d2a 100644 --- a/project/xumu/AppWeightManage/add.vue +++ b/project/xumu/AppWeightManage/add.vue @@ -48,9 +48,15 @@ export default { } }) }, - handleDelete(index) { + handleDelete(id) { this.$confirm("确定删除该条数据?").then(() => { - this.detail.detailList.splice(index, 1) + this.instance.post("/api/breed/weight/del", null, { + params: {id} + }).then(res => { + if (res?.code == 0) { + this.getDetail() + } + }) }) }, submit() { @@ -109,7 +115,7 @@ export default {