From c8789b982e1b4d3d7c58bb40affe013b2807f1a3 Mon Sep 17 00:00:00 2001 From: 15036302109 Date: Fri, 22 Dec 2023 10:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E9=99=A9=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/ehsRisk/domain/EhsRisk.java | 11 ++++++++++ .../service/impl/EhsRiskServiceImpl.java | 11 +++++++++- ruoyi-ui/src/views/ehs/ehsRisk/index.vue | 20 +++++++++---------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/domain/EhsRisk.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/domain/EhsRisk.java index e98bd84..48172de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/domain/EhsRisk.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/domain/EhsRisk.java @@ -102,6 +102,17 @@ public class EhsRisk extends BaseEntity @Excel(name = "巡查责任人电话") private String inspectionTel; + /** 风险点位置 */ + @TableField(exist = false) + private String riskLocation1;// 村 (社区) + @TableField(exist = false) + private String riskLocation2;// 位置 + /** 涉及群众数量 */ + @TableField(exist = false) + private String peopleQuantity1;// 户 + + @TableField(exist = false) + private String peopleQuantity2;// 人 } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java index 101083e..3daf822 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java @@ -33,7 +33,16 @@ public class EhsRiskServiceImpl extends ServiceImpl impl @Override public EhsRisk selectEhsRiskByRiskId(Long riskId) { - return ehsRiskMapper.selectEhsRiskByRiskId(riskId); + EhsRisk ehsRisk = ehsRiskMapper.selectEhsRiskByRiskId(riskId); + // 风险点位置 + String[] riskLocationArr = ehsRisk.getRiskLocation().split(";"); + ehsRisk.setRiskLocation1(riskLocationArr[0]);// 村 (社区) + ehsRisk.setRiskLocation2(riskLocationArr[1]);// 位置 + // 涉及群众数量 + String[] peopleNumArr = ehsRisk.getPeopleQuantity().split(";"); + ehsRisk.setPeopleQuantity1(peopleNumArr[0]);// 户 + ehsRisk.setPeopleQuantity2(peopleNumArr[1]);// 人 + return ehsRisk; } /** diff --git a/ruoyi-ui/src/views/ehs/ehsRisk/index.vue b/ruoyi-ui/src/views/ehs/ehsRisk/index.vue index 89bb88c..256a898 100644 --- a/ruoyi-ui/src/views/ehs/ehsRisk/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsRisk/index.vue @@ -343,13 +343,19 @@ - + - + @@ -649,17 +655,9 @@ this.reset(); const riskId = row.riskId || this.ids getEhsRisk(riskId).then(response => { - this.form = response.data; this.open = true; this.title = "修改风险信息"; - // 风险点位置回显 - const split1 = response.data.riskLocation.split(";") - this.form.riskLocation1 = split1[0]; - this.form.riskLocation2 = split1[1]; - // 涉及群众数量回显 - const split2 = response.data.peopleQuantity.split(";") - this.form.peopleQuantity1 = split2[0]; - this.form.peopleQuantity2 = split2[1]; + this.form = response.data; }); }, /** 提交按钮 */