From c9c8086fd44a87fec7c2e9fe25bf68834d5de59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Sun, 4 Feb 2024 15:43:46 +0800 Subject: [PATCH] fix 80746 --- .../VehicleItemLibraryDetail.vue | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/views/projectLibrary/vehicleItemLibrary/VehicleItemLibraryDetail.vue b/src/views/projectLibrary/vehicleItemLibrary/VehicleItemLibraryDetail.vue index a54e02f1..487a2ad6 100644 --- a/src/views/projectLibrary/vehicleItemLibrary/VehicleItemLibraryDetail.vue +++ b/src/views/projectLibrary/vehicleItemLibrary/VehicleItemLibraryDetail.vue @@ -157,6 +157,7 @@ import StandardSelectionModal from '../../../components/selection/StandardSelect import { StandardSource, EvaluateProcessStatus } from '../../../enums/commonEnums' import VehicleProjectSelectionDrawer from '../../../components/selection/VehicleProjectSelectionDrawer' import { mapGetters } from 'vuex' +import { postAction } from '../../../api/manage' export default { name: 'VehicleItemLibraryDetail', @@ -373,6 +374,7 @@ export default { this.$message.success(res.message) this.loading = false this.loadData() + this.loadProjectRiskOverview() } else { this.$message.warning(res.message) this.loading = false @@ -393,6 +395,7 @@ export default { this.$message.success(res.message) this.loading = false this.loadData() + this.loadProjectRiskOverview() } else { this.$message.warning(res.message) this.loading = false @@ -466,7 +469,33 @@ export default { projectId: this.$route.query.id } }) - } + }, + handleDelete: function (id) { + if (!this.url.delete) { + this.$message.warning('请设置url.delete属性!') + return + } + const that = this + this.$confirm({ + title: this.$t('confirmDeletion'), + content: this.$t('areYouSure'), + onOk: function () { + postAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message) + // 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一 + if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) { + that.ipagination.current -= 1 + } + that.loadData() + that.loadProjectRiskOverview() + } else { + that.$message.warning(res.message) + } + }) + } + }) + }, } }