Commit fddcb462 authored by xulihui's avatar xulihui

密闭空间和人员密集场所模块和重要风险点模块

parent 80111dda
......@@ -61,6 +61,22 @@ public class TDeviceReportDataController extends BaseController
return getDataTable(list);
}
@GetMapping("/spaceList")
public TableDataInfo spaceList(TDeviceReportData tDeviceReportData)
{
startPage();
List<TDeviceReportData> list = tDeviceReportDataService.selectSpaceTDeviceReportDataList(tDeviceReportData);
return getDataTable(list);
}
@GetMapping("/riskList")
public TableDataInfo riskList(TDeviceReportData tDeviceReportData)
{
startPage();
List<TDeviceReportData> list = tDeviceReportDataService.selectRiskTDeviceReportDataList(tDeviceReportData);
return getDataTable(list);
}
@GetMapping("/redisList")
public TableDataInfo redisList(TDeviceInfoS tDeviceInfos)
{
......
package com.zehong.web.controller.risk;
import java.util.List;
import com.zehong.system.domain.SpaceListaw;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TConfinedSpace;
import com.zehong.system.domain.SpaceListaw;
import com.zehong.system.service.ITConfinedSpaceService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 密闭空间和人员密集场所Controller
*
* @author zehong
* @date 2026-03-18
*/
@RestController
@RequestMapping("/system/space")
public class TConfinedSpaceController extends BaseController
{
@Autowired
private ITConfinedSpaceService tConfinedSpaceService;
/**
* 查询密闭空间和人员密集场所列表
*/
@GetMapping("/list")
public TableDataInfo list(TConfinedSpace tConfinedSpace)
{
startPage();
List<TConfinedSpace> list = tConfinedSpaceService.selectTConfinedSpaceList(tConfinedSpace);
return getDataTable(list);
}
/**
* 导出密闭空间和人员密集场所列表
*/
@Log(title = "密闭空间和人员密集场所", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TConfinedSpace tConfinedSpace)
{
List<TConfinedSpace> list = tConfinedSpaceService.selectTConfinedSpaceList(tConfinedSpace);
ExcelUtil<TConfinedSpace> util = new ExcelUtil<TConfinedSpace>(TConfinedSpace.class);
return util.exportExcel(list, "密闭空间和人员密集场所数据");
}
/**
* 获取密闭空间和人员密集场所详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tConfinedSpaceService.selectTConfinedSpaceById(id));
}
/**
* 新增密闭空间和人员密集场所
*/
@Log(title = "密闭空间和人员密集场所", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SpaceListaw listaw)
{
//添加密闭空间表数据 并且返回新增 id
tConfinedSpaceService.insertTConfinedSpace(listaw.gettConfinedSpace());
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())){
//将关联设备信息与密闭空间进行绑定
tConfinedSpaceService.updatetRelationDeviceDetailInfo(listaw.gettDeviceInfoS(), listaw.gettConfinedSpace().getId(), listaw.gettConfinedSpace().getRelationDeviceType());
}
return AjaxResult.success();
}
/**
* 修改密闭空间和人员密集场所
*/
@Log(title = "密闭空间和人员密集场所", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SpaceListaw listaw)
{
//先更新密闭空间基本信息
int result = tConfinedSpaceService.updateTConfinedSpace(listaw.gettConfinedSpace());
//如果有关联设备数据,则更新关联关系
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())) {
tConfinedSpaceService.updatetRelationDeviceDetailInfo(
listaw.gettDeviceInfoS(),
listaw.gettConfinedSpace().getId(),
listaw.gettConfinedSpace().getRelationDeviceType()
);
}
return toAjax(result);
}
/**
* 删除密闭空间和人员密集场所
*/
@Log(title = "密闭空间和人员密集场所", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tConfinedSpaceService.deleteTConfinedSpaceByIds(ids));
}
}
\ No newline at end of file
package com.zehong.web.controller.risk;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TIssueRectification;
import com.zehong.system.service.ITIssueRectificationService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 风险点隐患及异常情况Controller
*
* @author zehong
* @date 2026-03-20
*/
@RestController
@RequestMapping("/system/rectification")
public class TIssueRectificationController extends BaseController
{
@Autowired
private ITIssueRectificationService tIssueRectificationService;
/**
* 查询风险点隐患及异常情况列表
*/
@GetMapping("/list")
public TableDataInfo list(TIssueRectification tIssueRectification)
{
startPage();
List<TIssueRectification> list = tIssueRectificationService.selectTIssueRectificationList(tIssueRectification);
return getDataTable(list);
}
/**
* 导出风险点隐患及异常情况列表
*/
@Log(title = "风险点隐患及异常情况", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TIssueRectification tIssueRectification)
{
List<TIssueRectification> list = tIssueRectificationService.selectTIssueRectificationList(tIssueRectification);
ExcelUtil<TIssueRectification> util = new ExcelUtil<TIssueRectification>(TIssueRectification.class);
return util.exportExcel(list, "风险点隐患及异常情况数据");
}
/**
* 获取风险点隐患及异常情况详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tIssueRectificationService.selectTIssueRectificationById(id));
}
/**
* 新增风险点隐患及异常情况
*/
@Log(title = "风险点隐患及异常情况", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TIssueRectification tIssueRectification)
{
return toAjax(tIssueRectificationService.insertTIssueRectification(tIssueRectification));
}
/**
* 修改风险点隐患及异常情况
*/
@Log(title = "风险点隐患及异常情况", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TIssueRectification tIssueRectification)
{
return toAjax(tIssueRectificationService.updateTIssueRectification(tIssueRectification));
}
/**
* 删除风险点隐患及异常情况
*/
@Log(title = "风险点隐患及异常情况", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tIssueRectificationService.deleteTIssueRectificationByIds(ids));
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TRiskDevMajInfor;
import com.zehong.system.domain.RiskInfoListaw;
import com.zehong.system.service.ITRiskDevMajInforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -73,9 +74,15 @@ public class TRiskDevMajInforController extends BaseController
*/
@Log(title = "重要风险点管控", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TRiskDevMajInfor tRiskDevMajInfor)
public AjaxResult add(@RequestBody RiskInfoListaw listaw)
{
return toAjax(tRiskDevMajInforService.insertTRiskDevMajInfor(tRiskDevMajInfor));
//添加重要风险点表数据 并且返回新增 id
tRiskDevMajInforService.insertTRiskDevMajInfor(listaw.gettRiskDevMajInfor());
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())){
//将关联设备信息与重要风险点进行绑定
tRiskDevMajInforService.updateRelationDeviceDetailInfo(listaw.gettDeviceInfoS(), listaw.gettRiskDevMajInfor().getfRiskDevMajInforId(), listaw.gettRiskDevMajInfor().getRelationDeviceType());
}
return AjaxResult.success();
}
/**
......@@ -83,9 +90,21 @@ public class TRiskDevMajInforController extends BaseController
*/
@Log(title = "重要风险点管控", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TRiskDevMajInfor tRiskDevMajInfor)
public AjaxResult edit(@RequestBody RiskInfoListaw listaw)
{
return toAjax(tRiskDevMajInforService.updateTRiskDevMajInfor(tRiskDevMajInfor));
//先更新重要风险点基本信息
int result = tRiskDevMajInforService.updateTRiskDevMajInfor(listaw.gettRiskDevMajInfor());
//如果有关联设备数据,则更新关联关系
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(listaw.gettDeviceInfoS())) {
tRiskDevMajInforService.updateRelationDeviceDetailInfo(
listaw.gettDeviceInfoS(),
listaw.gettRiskDevMajInfor().getfRiskDevMajInforId(),
listaw.gettRiskDevMajInfor().getRelationDeviceType()
);
}
return toAjax(result);
}
/**
......
package com.zehong.system.domain;
import java.util.List;
/**
* 重要风险点与关联设备封装类
*/
public class RiskInfoListaw {
private TRiskDevMajInfor tRiskDevMajInfor;
private List<TDeviceInfoS> tDeviceInfoS;
public TRiskDevMajInfor gettRiskDevMajInfor() {
return tRiskDevMajInfor;
}
public void settRiskDevMajInfor(TRiskDevMajInfor tRiskDevMajInfor) {
this.tRiskDevMajInfor = tRiskDevMajInfor;
}
public List<TDeviceInfoS> gettDeviceInfoS() {
return tDeviceInfoS;
}
public void settDeviceInfoS(List<TDeviceInfoS> tDeviceInfoS) {
this.tDeviceInfoS = tDeviceInfoS;
}
}
package com.zehong.system.domain;
import java.util.List;
/**
* 密闭空间与关联设备封装类
*/
public class SpaceListaw {
private TConfinedSpace tConfinedSpace;
private List<TDeviceInfoS> tDeviceInfoS;
public TConfinedSpace gettConfinedSpace() {
return tConfinedSpace;
}
public void settConfinedSpace(TConfinedSpace tConfinedSpace) {
this.tConfinedSpace = tConfinedSpace;
}
public List<TDeviceInfoS> gettDeviceInfoS() {
return tDeviceInfoS;
}
public void settDeviceInfoS(List<TDeviceInfoS> tDeviceInfoS) {
this.tDeviceInfoS = tDeviceInfoS;
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 密闭空间和人员密集场所对象 t_confined_space
*
* @author zehong
* @date 2026-03-18
*/
public class TConfinedSpace extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 企业id */
@Excel(name = "企业id")
private String enterpriseId;
/** 企业名称 */
@Excel(name = "企业名称")
private String enterpriseName;
/** 统一社会信用代码 */
@Excel(name = "统一社会信用代码")
private String socialCreditCode;
/** 场所/设施名称 */
@Excel(name = "场所/设施名称")
private String venueFacility;
/** 场所分类(1,密闭空间;2,人员密集场所) */
@Excel(name = "场所分类(1,密闭空间;2,人员密集场所)")
private String venueType;
/** 具体位置 */
private String specificLocation;
/** 面积/容积(平方米或立方米) */
@Excel(name = "面积/容积(平方米或立方米)")
private String area;
/** 主要危险因素 */
private String riskFactors;
/** 作业/人员频次 */
private String workFrequency;
/** 警示标识(1,已设置;2,未设置) */
@Excel(name = "警示标识(1,已设置;2,未设置)")
private String warningSign;
/** 主要应急器材 */
private String emergencyEquipment;
/** 现场负责人 */
private String siteSupervisor;
/** 负责人电话 */
private String supervisorPhone;
/** 最近检查日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最近检查日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastDate;
/** 经度 */
@Excel(name = "经度")
private String longitude;
/** 纬度 */
@Excel(name = "纬度")
private String latitude;
/** 关联设备类型 3 密闭空间和人员密集场所*/
private String relationDeviceType;
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getRelationDeviceType() {
return relationDeviceType;
}
public void setRelationDeviceType(String relationDeviceType) {
this.relationDeviceType = relationDeviceType;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setEnterpriseId(String enterpriseId)
{
this.enterpriseId = enterpriseId;
}
public String getEnterpriseId()
{
return enterpriseId;
}
public void setEnterpriseName(String enterpriseName)
{
this.enterpriseName = enterpriseName;
}
public String getEnterpriseName()
{
return enterpriseName;
}
public void setSocialCreditCode(String socialCreditCode)
{
this.socialCreditCode = socialCreditCode;
}
public String getSocialCreditCode()
{
return socialCreditCode;
}
public void setVenueFacility(String venueFacility)
{
this.venueFacility = venueFacility;
}
public String getVenueFacility()
{
return venueFacility;
}
public void setVenueType(String venueType)
{
this.venueType = venueType;
}
public String getVenueType()
{
return venueType;
}
public void setSpecificLocation(String specificLocation)
{
this.specificLocation = specificLocation;
}
public String getSpecificLocation()
{
return specificLocation;
}
public void setArea(String area)
{
this.area = area;
}
public String getArea()
{
return area;
}
public void setRiskFactors(String riskFactors)
{
this.riskFactors = riskFactors;
}
public String getRiskFactors()
{
return riskFactors;
}
public void setWorkFrequency(String workFrequency)
{
this.workFrequency = workFrequency;
}
public String getWorkFrequency()
{
return workFrequency;
}
public void setWarningSign(String warningSign)
{
this.warningSign = warningSign;
}
public String getWarningSign()
{
return warningSign;
}
public void setEmergencyEquipment(String emergencyEquipment)
{
this.emergencyEquipment = emergencyEquipment;
}
public String getEmergencyEquipment()
{
return emergencyEquipment;
}
public void setSiteSupervisor(String siteSupervisor)
{
this.siteSupervisor = siteSupervisor;
}
public String getSiteSupervisor()
{
return siteSupervisor;
}
public void setSupervisorPhone(String supervisorPhone)
{
this.supervisorPhone = supervisorPhone;
}
public String getSupervisorPhone()
{
return supervisorPhone;
}
public void setLastDate(Date lastDate)
{
this.lastDate = lastDate;
}
public Date getLastDate()
{
return lastDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("enterpriseId", getEnterpriseId())
.append("enterpriseName", getEnterpriseName())
.append("socialCreditCode", getSocialCreditCode())
.append("venueFacility", getVenueFacility())
.append("venueType", getVenueType())
.append("specificLocation", getSpecificLocation())
.append("area", getArea())
.append("riskFactors", getRiskFactors())
.append("workFrequency", getWorkFrequency())
.append("warningSign", getWarningSign())
.append("emergencyEquipment", getEmergencyEquipment())
.append("siteSupervisor", getSiteSupervisor())
.append("supervisorPhone", getSupervisorPhone())
.append("lastDate", getLastDate())
.append("createTime", getCreateTime())
.toString();
}
}
\ No newline at end of file
......@@ -98,6 +98,16 @@ public class TDeviceReportData extends BaseEntity
*/
private String deviceType;
private String relationDeviceId;
public String getRelationDeviceId() {
return relationDeviceId;
}
public void setRelationDeviceId(String relationDeviceId) {
this.relationDeviceId = relationDeviceId;
}
public String getDeviceType() {
return deviceType;
}
......
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 风险点隐患及异常情况对象 t_issue_rectification
*
* @author zehong
* @date 2026-03-20
*/
public class TIssueRectification extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 重要风险点id */
@Excel(name = "重要风险点id")
private Long fRiskDevMajInforId;
/** 隐患/异常 */
@Excel(name = "隐患/异常")
private String dangerAnomaly;
/** 整改/处置 */
@Excel(name = "整改/处置")
private String rectificationDisposal;
/** 处理人 */
@Excel(name = "处理人")
private String handler;
/** 联系电话 */
@Excel(name = "联系电话")
private String phone;
/** 类型(1,隐患及整改情况;2.监测异常及处置情况) */
@Excel(name = "类型(1,隐患及整改情况;2.监测异常及处置情况)")
private String issueType;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setfRiskDevMajInforId(Long fRiskDevMajInforId)
{
this.fRiskDevMajInforId = fRiskDevMajInforId;
}
public Long getfRiskDevMajInforId()
{
return fRiskDevMajInforId;
}
public void setDangerAnomaly(String dangerAnomaly)
{
this.dangerAnomaly = dangerAnomaly;
}
public String getDangerAnomaly()
{
return dangerAnomaly;
}
public void setRectificationDisposal(String rectificationDisposal)
{
this.rectificationDisposal = rectificationDisposal;
}
public String getRectificationDisposal()
{
return rectificationDisposal;
}
public void setHandler(String handler)
{
this.handler = handler;
}
public String getHandler()
{
return handler;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setIssueType(String issueType)
{
this.issueType = issueType;
}
public String getIssueType()
{
return issueType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fRiskDevMajInforId", getfRiskDevMajInforId())
.append("dangerAnomaly", getDangerAnomaly())
.append("rectificationDisposal", getRectificationDisposal())
.append("handler", getHandler())
.append("phone", getPhone())
.append("issueType", getIssueType())
.append("createTime", getCreateTime())
.toString();
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ public class TRiskDevMajInfor extends BaseEntity
private String fLon;
/** 在GIS地图上的围堵 */
@Excel(name = "在GIS地图上的围堵")
@Excel(name = "在GIS地图上的纬度")
private String fLat;
/** 风险构成 */
......@@ -110,6 +110,18 @@ public class TRiskDevMajInfor extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date govUploadTime;
/** 关联设备类型 4 重要风险点*/
private String relationDeviceType;
public String getRelationDeviceType() {
return relationDeviceType;
}
public void setRelationDeviceType(String relationDeviceType) {
this.relationDeviceType = relationDeviceType;
}
public void updateFields() {
this.entUploadState = govUploadState;
if (govUploadTime != null) {
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TConfinedSpace;
import com.zehong.system.domain.TDeviceInfoS;
import org.apache.ibatis.annotations.Param;
/**
* 密闭空间和人员密集场所Mapper接口
*
* @author zehong
* @date 2026-03-18
*/
public interface TConfinedSpaceMapper
{
/**
* 查询密闭空间和人员密集场所
*
* @param id 密闭空间和人员密集场所ID
* @return 密闭空间和人员密集场所
*/
public TConfinedSpace selectTConfinedSpaceById(Long id);
/**
* 查询密闭空间和人员密集场所列表
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 密闭空间和人员密集场所集合
*/
public List<TConfinedSpace> selectTConfinedSpaceList(TConfinedSpace tConfinedSpace);
/**
* 新增密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
public int insertTConfinedSpace(TConfinedSpace tConfinedSpace);
/**
* 修改密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
public int updateTConfinedSpace(TConfinedSpace tConfinedSpace);
/**
* 删除密闭空间和人员密集场所
*
* @param id 密闭空间和人员密集场所ID
* @return 结果
*/
public int deleteTConfinedSpaceById(Long id);
/**
* 批量删除密闭空间和人员密集场所
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTConfinedSpaceByIds(Long[] ids);
/**
* 将关联设备信息与密闭空间进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param id 密闭空间 ID
* @param relationDevicetype 关联设备类型
*/
void updatetRelationDeviceDetailInfo(@Param("gettDeviceInfoS") List<TDeviceInfoS> gettDeviceInfoS, @Param("id") Long id, @Param("relationDevicetype") String relationDevicetype);
}
\ No newline at end of file
......@@ -27,6 +27,10 @@ public interface TDeviceReportDataMapper
*/
public List<TDeviceReportData> selectTDeviceReportDataList(TDeviceReportData tDeviceReportData);
public List<TDeviceReportData> selectSpaceTDeviceReportDataList(TDeviceReportData tDeviceReportData);
public List<TDeviceReportData> selectRiskTDeviceReportDataList(TDeviceReportData tDeviceReportData);
/**
* 新增设备监控
*
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TIssueRectification;
/**
* 风险点隐患及异常情况Mapper接口
*
* @author zehong
* @date 2026-03-20
*/
public interface TIssueRectificationMapper
{
/**
* 查询风险点隐患及异常情况
*
* @param id 风险点隐患及异常情况ID
* @return 风险点隐患及异常情况
*/
public TIssueRectification selectTIssueRectificationById(Long id);
/**
* 查询风险点隐患及异常情况列表
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 风险点隐患及异常情况集合
*/
public List<TIssueRectification> selectTIssueRectificationList(TIssueRectification tIssueRectification);
/**
* 新增风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
public int insertTIssueRectification(TIssueRectification tIssueRectification);
/**
* 修改风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
public int updateTIssueRectification(TIssueRectification tIssueRectification);
/**
* 删除风险点隐患及异常情况
*
* @param id 风险点隐患及异常情况ID
* @return 结果
*/
public int deleteTIssueRectificationById(Long id);
/**
* 批量删除风险点隐患及异常情况
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTIssueRectificationByIds(Long[] ids);
}
\ No newline at end of file
package com.zehong.system.mapper;
import java.util.Date;
import java.util.List;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.domain.TRiskDevMajInfor;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 重要风险点管控Mapper接口
*
......@@ -83,4 +85,12 @@ public interface TRiskDevMajInforMapper
* @return 结果
*/
public int deleteTRiskDevMajInforByIds(Long[] fRiskDevMajInforIds);
/**
* 将关联设备信息与重要风险点进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param fRiskDevMajInforId 重要风险点 ID
* @param relationDevicetype 关联设备类型
*/
void updateRelationDeviceDetailInfo(@Param("gettDeviceInfoS") List<TDeviceInfoS> gettDeviceInfoS, @Param("fRiskDevMajInforId") Long fRiskDevMajInforId, @Param("relationDevicetype") String relationDevicetype);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TConfinedSpace;
import com.zehong.system.domain.TDeviceInfoS;
/**
* 密闭空间和人员密集场所Service接口
*
* @author zehong
* @date 2026-03-18
*/
public interface ITConfinedSpaceService
{
/**
* 查询密闭空间和人员密集场所
*
* @param id 密闭空间和人员密集场所ID
* @return 密闭空间和人员密集场所
*/
public TConfinedSpace selectTConfinedSpaceById(Long id);
/**
* 查询密闭空间和人员密集场所列表
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 密闭空间和人员密集场所集合
*/
public List<TConfinedSpace> selectTConfinedSpaceList(TConfinedSpace tConfinedSpace);
/**
* 新增密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
public int insertTConfinedSpace(TConfinedSpace tConfinedSpace);
/**
* 修改密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
public int updateTConfinedSpace(TConfinedSpace tConfinedSpace);
/**
* 批量删除密闭空间和人员密集场所
*
* @param ids 需要删除的密闭空间和人员密集场所ID
* @return 结果
*/
public int deleteTConfinedSpaceByIds(Long[] ids);
/**
* 删除密闭空间和人员密集场所信息
*
* @param id 密闭空间和人员密集场所 ID
* @return 结果
*/
public int deleteTConfinedSpaceById(Long id);
/**
* 将关联设备信息与密闭空间进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param id 密闭空间 ID
* @param relationDevicetype 关联设备类型
*/
void updatetRelationDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS, Long id, String relationDevicetype);
}
\ No newline at end of file
......@@ -27,6 +27,10 @@ public interface ITDeviceReportDataService
*/
public List<TDeviceReportData> selectTDeviceReportDataList(TDeviceReportData tDeviceReportData);
public List<TDeviceReportData> selectSpaceTDeviceReportDataList(TDeviceReportData tDeviceReportData);
public List<TDeviceReportData> selectRiskTDeviceReportDataList(TDeviceReportData tDeviceReportData);
/**
* 新增设备监控
*
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TIssueRectification;
/**
* 风险点隐患及异常情况Service接口
*
* @author zehong
* @date 2026-03-20
*/
public interface ITIssueRectificationService
{
/**
* 查询风险点隐患及异常情况
*
* @param id 风险点隐患及异常情况ID
* @return 风险点隐患及异常情况
*/
public TIssueRectification selectTIssueRectificationById(Long id);
/**
* 查询风险点隐患及异常情况列表
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 风险点隐患及异常情况集合
*/
public List<TIssueRectification> selectTIssueRectificationList(TIssueRectification tIssueRectification);
/**
* 新增风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
public int insertTIssueRectification(TIssueRectification tIssueRectification);
/**
* 修改风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
public int updateTIssueRectification(TIssueRectification tIssueRectification);
/**
* 批量删除风险点隐患及异常情况
*
* @param ids 需要删除的风险点隐患及异常情况ID
* @return 结果
*/
public int deleteTIssueRectificationByIds(Long[] ids);
/**
* 删除风险点隐患及异常情况信息
*
* @param id 风险点隐患及异常情况ID
* @return 结果
*/
public int deleteTIssueRectificationById(Long id);
}
\ No newline at end of file
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.domain.TRiskDevMajInfor;
import java.util.List;
/**
* 重要风险点管控Service接口
*
......@@ -89,4 +91,12 @@ public interface ITRiskDevMajInforService
* @return
*/
int entReportRiskInfo(Long fRiskDevMajInforId) ;
/**
* 将关联设备信息与重要风险点进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param fRiskDevMajInforId 重要风险点 ID
* @param relationDevicetype 关联设备类型
*/
void updateRelationDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS, Long fRiskDevMajInforId, String relationDevicetype);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TConfinedSpace;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.mapper.TConfinedSpaceMapper;
import com.zehong.system.service.ITConfinedSpaceService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 密闭空间和人员密集场所Service业务层处理
*
* @author zehong
* @date 2026-03-18
*/
@Service
public class TConfinedSpaceServiceImpl implements ITConfinedSpaceService
{
@Autowired
private TConfinedSpaceMapper tConfinedSpaceMapper;
/**
* 查询密闭空间和人员密集场所
*
* @param id 密闭空间和人员密集场所ID
* @return 密闭空间和人员密集场所
*/
@Override
public TConfinedSpace selectTConfinedSpaceById(Long id)
{
return tConfinedSpaceMapper.selectTConfinedSpaceById(id);
}
/**
* 查询密闭空间和人员密集场所列表
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 密闭空间和人员密集场所
*/
@Override
public List<TConfinedSpace> selectTConfinedSpaceList(TConfinedSpace tConfinedSpace)
{
return tConfinedSpaceMapper.selectTConfinedSpaceList(tConfinedSpace);
}
/**
* 新增密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
@Override
public int insertTConfinedSpace(TConfinedSpace tConfinedSpace)
{
tConfinedSpace.setCreateTime(DateUtils.getNowDate());
return tConfinedSpaceMapper.insertTConfinedSpace(tConfinedSpace);
}
/**
* 修改密闭空间和人员密集场所
*
* @param tConfinedSpace 密闭空间和人员密集场所
* @return 结果
*/
@Override
public int updateTConfinedSpace(TConfinedSpace tConfinedSpace)
{
return tConfinedSpaceMapper.updateTConfinedSpace(tConfinedSpace);
}
/**
* 批量删除密闭空间和人员密集场所
*
* @param ids 需要删除的密闭空间和人员密集场所ID
* @return 结果
*/
@Override
public int deleteTConfinedSpaceByIds(Long[] ids)
{
return tConfinedSpaceMapper.deleteTConfinedSpaceByIds(ids);
}
/**
* 删除密闭空间和人员密集场所信息
*
* @param id 密闭空间和人员密集场所ID
* @return 结果
*/
@Override
public int deleteTConfinedSpaceById(Long id)
{
return tConfinedSpaceMapper.deleteTConfinedSpaceById(id);
}
/**
* 将关联设备信息与密闭空间进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param id 密闭空间 ID
* @param relationDevicetype 关联设备类型
*/
@Override
public void updatetRelationDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS, Long id, String relationDevicetype) {
if (CollectionUtils.isNotEmpty(gettDeviceInfoS)) {
tConfinedSpaceMapper.updatetRelationDeviceDetailInfo(gettDeviceInfoS, id, relationDevicetype);
}
}
}
\ No newline at end of file
......@@ -55,6 +55,30 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
return tDeviceReportDataMapper.selectTDeviceReportDataList(tDeviceReportData);
}
@Override
public List<TDeviceReportData> selectSpaceTDeviceReportDataList(TDeviceReportData tDeviceReportData)
{
// 20240725 调整 分 企业 和 政府 角色录入
if(isEnterprise()) {
tDeviceReportData.setBeyondEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tDeviceReportDataMapper.selectSpaceTDeviceReportDataList(tDeviceReportData);
}
@Override
public List<TDeviceReportData> selectRiskTDeviceReportDataList(TDeviceReportData tDeviceReportData)
{
// 20240725 调整 分 企业 和 政府 角色录入
if(isEnterprise()) {
tDeviceReportData.setBeyondEnterpriseId(SecurityUtils.getLoginUser().getUser().getDeptId());
}
return tDeviceReportDataMapper.selectRiskTDeviceReportDataList(tDeviceReportData);
}
/**
* 新增设备监控
*
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TIssueRectificationMapper;
import com.zehong.system.domain.TIssueRectification;
import com.zehong.system.service.ITIssueRectificationService;
/**
* 风险点隐患及异常情况Service业务层处理
*
* @author zehong
* @date 2026-03-20
*/
@Service
public class TIssueRectificationServiceImpl implements ITIssueRectificationService
{
@Autowired
private TIssueRectificationMapper tIssueRectificationMapper;
/**
* 查询风险点隐患及异常情况
*
* @param id 风险点隐患及异常情况ID
* @return 风险点隐患及异常情况
*/
@Override
public TIssueRectification selectTIssueRectificationById(Long id)
{
return tIssueRectificationMapper.selectTIssueRectificationById(id);
}
/**
* 查询风险点隐患及异常情况列表
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 风险点隐患及异常情况
*/
@Override
public List<TIssueRectification> selectTIssueRectificationList(TIssueRectification tIssueRectification)
{
return tIssueRectificationMapper.selectTIssueRectificationList(tIssueRectification);
}
/**
* 新增风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
@Override
public int insertTIssueRectification(TIssueRectification tIssueRectification)
{
tIssueRectification.setCreateTime(DateUtils.getNowDate());
return tIssueRectificationMapper.insertTIssueRectification(tIssueRectification);
}
/**
* 修改风险点隐患及异常情况
*
* @param tIssueRectification 风险点隐患及异常情况
* @return 结果
*/
@Override
public int updateTIssueRectification(TIssueRectification tIssueRectification)
{
return tIssueRectificationMapper.updateTIssueRectification(tIssueRectification);
}
/**
* 批量删除风险点隐患及异常情况
*
* @param ids 需要删除的风险点隐患及异常情况ID
* @return 结果
*/
@Override
public int deleteTIssueRectificationByIds(Long[] ids)
{
return tIssueRectificationMapper.deleteTIssueRectificationByIds(ids);
}
/**
* 删除风险点隐患及异常情况信息
*
* @param id 风险点隐患及异常情况ID
* @return 结果
*/
@Override
public int deleteTIssueRectificationById(Long id)
{
return tIssueRectificationMapper.deleteTIssueRectificationById(id);
}
}
\ No newline at end of file
......@@ -9,11 +9,13 @@ import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TConGasProInfor;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.domain.TRiskDevMajInfor;
import com.zehong.system.domain.vo.TRiskDevMajInfoVo;
import com.zehong.system.mapper.TRiskDevMajInforMapper;
import com.zehong.system.service.ITRiskDevMajInforService;
import com.zehong.system.service.ITSerialNumberInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -188,7 +190,7 @@ public class TRiskDevMajInforServiceImpl implements ITRiskDevMajInforService
/**
* 企业端 上传重要风险点档案
* @param fRiskDevMajInforId 重要风险点档案id
* @param fRiskDevMajInforId 重要风险点档案 id
* @return 1
*/
@Override
......@@ -196,4 +198,17 @@ public class TRiskDevMajInforServiceImpl implements ITRiskDevMajInforService
tRiskDevMajInforMapper.entReportRiskDevMajInfor("1",new Date(),fRiskDevMajInforId);
return 1;
}
/**
* 将关联设备信息与重要风险点进行绑定
* @param gettDeviceInfoS 关联设备列表
* @param fRiskDevMajInforId 重要风险点 ID
* @param relationDevicetype 关联设备类型
*/
@Override
public void updateRelationDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS, Long fRiskDevMajInforId, String relationDevicetype) {
if (CollectionUtils.isNotEmpty(gettDeviceInfoS)) {
tRiskDevMajInforMapper.updateRelationDeviceDetailInfo(gettDeviceInfoS, fRiskDevMajInforId, relationDevicetype);
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TConfinedSpaceMapper">
<resultMap type="com.zehong.system.domain.TConfinedSpace" id="TConfinedSpaceResult">
<result property="id" column="id" />
<result property="enterpriseId" column="enterprise_id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="socialCreditCode" column="social_credit_code" />
<result property="venueFacility" column="venue_facility" />
<result property="venueType" column="venue_type" />
<result property="specificLocation" column="specific_location" />
<result property="area" column="area" />
<result property="riskFactors" column="risk_factors" />
<result property="workFrequency" column="work_frequency" />
<result property="warningSign" column="warning_sign" />
<result property="emergencyEquipment" column="emergency_equipment" />
<result property="siteSupervisor" column="site_supervisor" />
<result property="supervisorPhone" column="supervisor_phone" />
<result property="lastDate" column="last_date" />
<result property="createTime" column="create_time" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
</resultMap>
<sql id="selectTConfinedSpaceVo">
select id, enterprise_id, enterprise_name, social_credit_code, venue_facility, venue_type, specific_location, area, risk_factors, work_frequency, warning_sign, emergency_equipment, site_supervisor, supervisor_phone, last_date, create_time, longitude, latitude from t_confined_space
</sql>
<select id="selectTConfinedSpaceList" parameterType="com.zehong.system.domain.TConfinedSpace" resultMap="TConfinedSpaceResult">
<include refid="selectTConfinedSpaceVo"/>
<where>
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="socialCreditCode != null and socialCreditCode != ''"> and social_credit_code = #{socialCreditCode}</if>
<if test="venueFacility != null and venueFacility != ''"> and venue_facility = #{venueFacility}</if>
<if test="venueType != null and venueType != ''"> and venue_type = #{venueType}</if>
<if test="warningSign != null and warningSign != ''"> and warning_sign = #{warningSign}</if>
<if test="lastDate != null "> and last_date = #{lastDate}</if>
</where>
</select>
<select id="selectTConfinedSpaceById" parameterType="Long" resultMap="TConfinedSpaceResult">
<include refid="selectTConfinedSpaceVo"/>
where id = #{id}
</select>
<insert id="insertTConfinedSpace" parameterType="com.zehong.system.domain.TConfinedSpace" useGeneratedKeys="true" keyProperty="id">
insert into t_confined_space
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="socialCreditCode != null">social_credit_code,</if>
<if test="venueFacility != null">venue_facility,</if>
<if test="venueType != null">venue_type,</if>
<if test="specificLocation != null">specific_location,</if>
<if test="area != null">area,</if>
<if test="riskFactors != null">risk_factors,</if>
<if test="workFrequency != null">work_frequency,</if>
<if test="warningSign != null">warning_sign,</if>
<if test="emergencyEquipment != null">emergency_equipment,</if>
<if test="siteSupervisor != null">site_supervisor,</if>
<if test="supervisorPhone != null">supervisor_phone,</if>
<if test="lastDate != null">last_date,</if>
<if test="createTime != null">create_time,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="socialCreditCode != null">#{socialCreditCode},</if>
<if test="venueFacility != null">#{venueFacility},</if>
<if test="venueType != null">#{venueType},</if>
<if test="specificLocation != null">#{specificLocation},</if>
<if test="area != null">#{area},</if>
<if test="riskFactors != null">#{riskFactors},</if>
<if test="workFrequency != null">#{workFrequency},</if>
<if test="warningSign != null">#{warningSign},</if>
<if test="emergencyEquipment != null">#{emergencyEquipment},</if>
<if test="siteSupervisor != null">#{siteSupervisor},</if>
<if test="supervisorPhone != null">#{supervisorPhone},</if>
<if test="lastDate != null">#{lastDate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
</trim>
</insert>
<update id="updateTConfinedSpace" parameterType="com.zehong.system.domain.TConfinedSpace">
update t_confined_space
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="socialCreditCode != null">social_credit_code = #{socialCreditCode},</if>
<if test="venueFacility != null">venue_facility = #{venueFacility},</if>
<if test="venueType != null">venue_type = #{venueType},</if>
<if test="specificLocation != null">specific_location = #{specificLocation},</if>
<if test="area != null">area = #{area},</if>
<if test="riskFactors != null">risk_factors = #{riskFactors},</if>
<if test="workFrequency != null">work_frequency = #{workFrequency},</if>
<if test="warningSign != null">warning_sign = #{warningSign},</if>
<if test="emergencyEquipment != null">emergency_equipment = #{emergencyEquipment},</if>
<if test="siteSupervisor != null">site_supervisor = #{siteSupervisor},</if>
<if test="supervisorPhone != null">supervisor_phone = #{supervisorPhone},</if>
<if test="lastDate != null">last_date = #{lastDate},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTConfinedSpaceById" parameterType="Long">
delete from t_confined_space where id = #{id}
</delete>
<delete id="deleteTConfinedSpaceByIds" parameterType="String">
delete from t_confined_space where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!--将关联设备信息与密闭空间进行绑定-->
<update id="updatetRelationDeviceDetailInfo" parameterType="java.util.List">
update t_relation_device_detail_info set relation_device_id = #{id} ,relation_device_type =#{relationDevicetype}
where
relation_device_detail_id in
<foreach collection="gettDeviceInfoS" item="items" index="key" open="(" separator="," close=")">
#{items.relationDeviceDetailId}
</foreach>
</update>
</mapper>
\ No newline at end of file
......@@ -87,6 +87,110 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectSpaceTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
SELECT
report.device_report_data_id,
report.device_name,
report.device_num,
report.standard_condition_accumulation,
report.working_condition_accumulation,
report.backing_standard_condition_accumulation,
report.residual_quantity,
report.standard_condition_flow,
report.working_condition_flow,
report.temperature,
report.pressure,
report.report_time,
report.communication_status,
report.device_status,
report.beyond_enterprise_id,
enterprise.enterprise_name AS beyond_enterprise_name,
report.create_by,
report.create_time,
report.update_by,
report.update_time,
report.is_del,
report.remarks
FROM
t_device_report_data report
INNER JOIN t_relation_device_detail_info detail ON detail.iot_no = report.device_num
INNER JOIN t_confined_space device ON device.id = detail.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = report.beyond_enterprise_id
<where>
<if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
<if test="relationDeviceId != null and relationDeviceId != ''">AND detail.relation_device_id = #{relationDeviceId}</if>
</where>
</select>
<select id="selectRiskTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
SELECT
report.device_report_data_id,
report.device_name,
report.device_num,
report.standard_condition_accumulation,
report.working_condition_accumulation,
report.backing_standard_condition_accumulation,
report.residual_quantity,
report.standard_condition_flow,
report.working_condition_flow,
report.temperature,
report.pressure,
report.report_time,
report.communication_status,
report.device_status,
report.beyond_enterprise_id,
enterprise.enterprise_name AS beyond_enterprise_name,
report.create_by,
report.create_time,
report.update_by,
report.update_time,
report.is_del,
report.remarks
FROM
t_device_report_data report
INNER JOIN t_relation_device_detail_info detail ON detail.iot_no = report.device_num
INNER JOIN t_risk_dev_maj_infor device ON device.f_risk_dev_maj_infor_id = detail.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = report.beyond_enterprise_id
<where>
<if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
<if test="relationDeviceId != null and relationDeviceId != ''">AND detail.relation_device_id = #{relationDeviceId}</if>
</where>
</select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/>
where report.device_report_data_id = #{deviceReportDataId}
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TIssueRectificationMapper">
<resultMap type="com.zehong.system.domain.TIssueRectification" id="TIssueRectificationResult">
<result property="id" column="id" />
<result property="fRiskDevMajInforId" column="f_risk_dev_maj_infor_id" />
<result property="dangerAnomaly" column="danger_anomaly" />
<result property="rectificationDisposal" column="rectification_disposal" />
<result property="handler" column="handler" />
<result property="phone" column="phone" />
<result property="issueType" column="issue_type" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectTIssueRectificationVo">
select id, f_risk_dev_maj_infor_id, danger_anomaly, rectification_disposal, handler, phone, issue_type, create_time from t_issue_rectification
</sql>
<select id="selectTIssueRectificationList" parameterType="com.zehong.system.domain.TIssueRectification" resultMap="TIssueRectificationResult">
<include refid="selectTIssueRectificationVo"/>
<where>
<if test="fRiskDevMajInforId != null "> and f_risk_dev_maj_infor_id = #{fRiskDevMajInforId}</if>
<if test="handler != null and handler != ''"> and handler = #{handler}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="issueType != null and issueType != ''"> and issue_type = #{issueType}</if>
</where>
</select>
<select id="selectTIssueRectificationById" parameterType="Long" resultMap="TIssueRectificationResult">
<include refid="selectTIssueRectificationVo"/>
where id = #{id}
</select>
<insert id="insertTIssueRectification" parameterType="com.zehong.system.domain.TIssueRectification" useGeneratedKeys="true" keyProperty="id">
insert into t_issue_rectification
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fRiskDevMajInforId != null">f_risk_dev_maj_infor_id,</if>
<if test="dangerAnomaly != null">danger_anomaly,</if>
<if test="rectificationDisposal != null">rectification_disposal,</if>
<if test="handler != null">handler,</if>
<if test="phone != null">phone,</if>
<if test="issueType != null">issue_type,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fRiskDevMajInforId != null">#{fRiskDevMajInforId},</if>
<if test="dangerAnomaly != null">#{dangerAnomaly},</if>
<if test="rectificationDisposal != null">#{rectificationDisposal},</if>
<if test="handler != null">#{handler},</if>
<if test="phone != null">#{phone},</if>
<if test="issueType != null">#{issueType},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateTIssueRectification" parameterType="com.zehong.system.domain.TIssueRectification">
update t_issue_rectification
<trim prefix="SET" suffixOverrides=",">
<if test="fRiskDevMajInforId != null">f_risk_dev_maj_infor_id = #{fRiskDevMajInforId},</if>
<if test="dangerAnomaly != null">danger_anomaly = #{dangerAnomaly},</if>
<if test="rectificationDisposal != null">rectification_disposal = #{rectificationDisposal},</if>
<if test="handler != null">handler = #{handler},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="issueType != null">issue_type = #{issueType},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTIssueRectificationById" parameterType="Long">
delete from t_issue_rectification where id = #{id}
</delete>
<delete id="deleteTIssueRectificationByIds" parameterType="String">
delete from t_issue_rectification where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -186,4 +186,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{fRiskDevMajInforId}
</foreach>
</delete>
<!-- 将关联设备信息与重要风险点进行绑定 -->
<update id="updateRelationDeviceDetailInfo">
update t_relation_device_detail_info
set relation_device_id = #{fRiskDevMajInforId},
relation_device_type = #{relationDevicetype}
where relation_device_detail_id in
<foreach collection="gettDeviceInfoS" item="device" open="(" separator="," close=")">
#{device.relationDeviceDetailId}
</foreach>
</update>
</mapper>
\ No newline at end of file
......@@ -46,7 +46,7 @@ export function delComplainDeal(complainDealId) {
// 导出投诉处置
export function exportComplainDeal(query) {
return request({
url: '/complainDeal/complainDeal/export',
url: '/complainDeal/export',
method: 'get',
params: query
})
......
......@@ -9,6 +9,22 @@ export function listData(query) {
})
}
export function spaceListData(query) {
return request({
url: '/system/data/spaceList',
method: 'get',
params: query
})
}
export function riskListData(query) {
return request({
url: '/system/data/riskList',
method: 'get',
params: query
})
}
export function redisList(query) {
return request({
url: '/system/data/redisList',
......
......@@ -59,18 +59,83 @@ export function exportInfor(query) {
})
}
export function reportRiskInfo(query) {
// 上报政府端
export function reportRiskInfo(data) {
return request({
url: '/risk/info/reportRiskInfo',
method: 'get',
params: query
params: data
})
}
export function entReportRiskInfo(query) {
// 上报企业端
export function entReportRiskInfo(data) {
return request({
url: '/risk/info/entReportRiskInfo',
method: 'get',
params: query
params: data
})
}
// 查询无绑定的关联设备信息
export function getDdeviceDetailInfo(data) {
return request({
url: '/device/device/selectDetailInfo',
method: 'post',
data: data
})
}
// 新增关联设备信息
export function addDetailInfos(data) {
return request({
url: '/device/device/insertDetailInfo',
method: 'post',
data: data
})
}
// 删除关联设备信息
export function deleteDetailInfo(deviceId) {
return request({
url: '/device/device/deleteDetailInfo',
method: 'delete',
data: deviceId
})
}
// 解除空间与关联设备关系
export function deleteDeviceDetailInfo(deviceId) {
return request({
url: '/device/device/deleteDeviceDetailInfo',
method: 'delete',
data: deviceId
})
}
// 删除关联设备信息(批量)
export function deleteeListDetailInfo(deviceId) {
return request({
url: '/device/device/deleteeListDetailInfo',
method: 'delete',
data: deviceId
})
}
// 查询已经关联的关联设备信息
export function selectDetailInfoList(data) {
return request({
url: '/device/device/selectDetailInfoList',
method: 'post',
data: data
})
}
// 修改关联设备绑定
export function updateDetailInfoLists(data) {
return request({
url: '/device/device/updateDetailInfoList',
method: 'post',
data: data
})
}
import request from '@/utils/request'
// 查询风险点隐患及异常情况列表
export function listRectification(query) {
return request({
url: '/system/rectification/list',
method: 'get',
params: query
})
}
// 查询风险点隐患及异常情况详细
export function getRectification(id) {
return request({
url: '/system/rectification/' + id,
method: 'get'
})
}
// 新增风险点隐患及异常情况
export function addRectification(data) {
return request({
url: '/system/rectification',
method: 'post',
data: data
})
}
// 修改风险点隐患及异常情况
export function updateRectification(data) {
return request({
url: '/system/rectification',
method: 'put',
data: data
})
}
// 删除风险点隐患及异常情况
export function delRectification(id) {
return request({
url: '/system/rectification/' + id,
method: 'delete'
})
}
// 导出风险点隐患及异常情况
export function exportRectification(query) {
return request({
url: '/system/rectification/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询密闭空间和人员密集场所列表
export function listSpace(query) {
return request({
url: '/system/space/list',
method: 'get',
params: query
})
}
// 查询密闭空间和人员密集场所详细
export function getSpace(id) {
return request({
url: '/system/space/' + id,
method: 'get'
})
}
// 新增密闭空间和人员密集场所
export function addSpace(data) {
return request({
url: '/system/space',
method: 'post',
data: data
})
}
// 修改密闭空间和人员密集场所
export function updateSpace(data) {
return request({
url: '/system/space',
method: 'put',
data: data
})
}
// 删除密闭空间和人员密集场所
export function delSpace(id) {
return request({
url: '/system/space/' + id,
method: 'delete'
})
}
// 导出密闭空间和人员密集场所
export function exportSpace(query) {
return request({
url: '/system/space/export',
method: 'get',
params: query
})
}
// 查询无绑定的关联设备信息
export function getDdeviceDetailInfo(data) {
return request({
url: '/device/device/selectDetailInfo',
method: 'post',
data: data
})
}
// 新增关联设备信息
export function addDetailInfos(data) {
return request({
url: '/device/device/insertDetailInfo',
method: 'post',
data: data
})
}
// 删除关联设备信息
export function deleteDetailInfo(deviceId) {
return request({
url: '/device/device/deleteDetailInfo',
method: 'delete',
data: deviceId
})
}
// 解除空间与关联设备关系
export function deleteDeviceDetailInfo(deviceId) {
return request({
url: '/device/device/deleteDeviceDetailInfo',
method: 'delete',
data: deviceId
})
}
// 删除关联设备信息(批量)
export function deleteeListDetailInfo(deviceId) {
return request({
url: '/device/device/deleteeListDetailInfo',
method: 'delete',
data: deviceId
})
}
// 查询已经关联的关联设备信息
export function selectDetailInfoList(data) {
return request({
url: '/device/device/selectDetailInfoList',
method: 'post',
data: data
})
}
// 修改关联设备绑定
export function updateDetailInfoLists(data) {
return request({
url: '/device/device/updateDetailInfoList',
method: 'post',
data: data
})
}
......@@ -1246,6 +1246,10 @@ export default {
},
// 满意度评价提交
evaluateSubmint(){
console.log("this.evaluateForm = " + this.evaluateForm)
if(this.evaluateForm.evaluateRate == null || this.evaluateForm.evaluateRate === ''){
this.msgError("请选择评价等级");
}else{
if (this.evaluateForm.complainDealEvaluateId != null && this.evaluateForm.complainDealEvaluateId != 0) {
updateComplainEvaluate(this.evaluateForm).then(response => {
this.msgSuccess("评论修改成功");
......@@ -1257,6 +1261,7 @@ export default {
this.dialogEvaluateVisible = false;
})
}
}
},
//关闭之前
handleEvaluateReturnBeforClose() {
......
......@@ -693,13 +693,13 @@ export default {
},
handleReport(row){
// 如果是 超级管理员或者 企业,并且 企业端上报状态为0
if (this.user.roleId == 5 && row.fUploadType == '0') {
if ((this.user.roleId == 5 || this.user.roleId == 1) && row.fUploadType == '0') {
this.$confirm('是否确认上报老旧管网改造计划项目名称为"' + row.fProjectName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return entReportPipeOldPlanProcess({fOldPlanProcessId : row.fOldPlanProcessId});
//return entReportPipeOldPlanProcess({fOldPlanProcessId : row.fOldPlanProcessId});
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
......@@ -708,13 +708,13 @@ export default {
// 如果是 超级管理员或者 政府,并且 政府端上报状态为0
if (this.user.roleId == 3 && row.govUploadState == '0') {
if ((this.user.roleId == 3 || this.user.roleId == 1) && row.govUploadState == '0') {
this.$confirm('是否确认上报老旧管网改造计划项目名称为"' + row.fProjectName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return reportPipeOldPlanProcess({fOldPlanProcessId : row.fOldPlanProcessId});
//return reportPipeOldPlanProcess({fOldPlanProcessId : row.fOldPlanProcessId});
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
......
......@@ -73,6 +73,18 @@
</el-row>
</el-form>
<div class="tableTitle">
<img :src="relationImg" style="width: 24px; height: 25px;position: relative; left: -339px; top: -12px;"/>
<span class="midText">关联设备</span>
</div>
<el-table v-loading="loadings" :data="DetailInfoList" tooltip-effect="dark" style="width: 100%" max-height="250">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
</el-table>
<el-divider content-position="left">上报时态</el-divider>
<el-form label-width="170px">
<el-row class="el-row-table">
......@@ -101,7 +113,7 @@
</template>
<script>
import { getInforForDetail } from "@/api/risk/info";
import { getInforForDetail,selectDetailInfoList } from "@/api/risk/info";
import { EditorMap } from "@/utils/mapClass/getPath.js";
import { getDefaultCountyList } from "@/api/area/county";
import { enterpriseLists } from "@/api/regulation/info";
......@@ -109,6 +121,7 @@
name: "detail-info",
data(){
return{
relationImg: require('@/assets/project/relation.png'),
fUploadTypeLable: "",
fUploadTimeLabel: "",
enterprises: [],
......@@ -117,7 +130,9 @@
enterpriseName:"",
detailOpen: false,
fUploadType: "",
fUploadTime: null
fUploadTime: null,
DetailInfoList: [],
loadings: true
}
},
watch:{
......@@ -192,6 +207,16 @@
this.showUploadType();
this.showUploadTime();
this.detailOpen = true;
// 查询关联设备信息
var tRiskInfo = {
id: id,
relationDeviceType: '4'
}
selectDetailInfoList(JSON.stringify(tRiskInfo)).then(response => {
this.DetailInfoList = response.rows;
this.loadings = false;
});
}
})
},
......
......@@ -232,12 +232,176 @@
</el-col>
</el-row>
</el-form>
<div class="tableTitle">
<img :src="relationImg" style="width: 24px; height: 25px;position: relative; left: -339px; top: -12px;"/>
<span class="midText">关联设备</span>
</div>
<el-table v-loading="loadings" ref="multipleTable" :data="DetailInfoList" tooltip-effect="dark" style="width: 100%" max-height="250">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDataListilInfo(scope.row,scope.$index)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="selectDataListInfo">选择关联设备</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!--选择关联设备弹出框-->
<el-dialog title="选择关联设备" :visible.sync="dialogTableVisible" width="1100px" formLabelWidth="160px">
<template>
<el-form :model="dateQueryParams" ref="queryForm" :inline="true" v-show="showSearch">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="dateQueryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="deviceCode">
<el-input
v-model="dateQueryParams.deviceModel"
placeholder="请输入设备型号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceAddr">
<el-input
v-model="dateQueryParams.iotNo"
placeholder="请输入物联网编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryData">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryDate">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="dialogFormVisible = true"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="deleteListDetailInfo"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getDataList"></right-toolbar>
</el-row>
<el-table v-loading="loadings" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDetailInfo(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="insertListDetailInfo">提 交</el-button>
<el-button @click="dialogTableVisible=false">取 消</el-button>
</div>
</template>
</el-dialog>
<!--添加关联设备弹出框-->
<el-dialog title="添加关联设备" :visible.sync="dialogFormVisible">
<el-form ref="formDetailInfo" :model="formDetailInfo" :rules="formDetailInfoRules" label-width="95px" style="height: 230px">
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="formDetailInfo.deviceName" placeholder="请输入设备名称" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="formDetailInfo.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="formDetailInfo.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium">
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
<el-input v-model="formDetailInfo.remarksn" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addDetailInfo">提 交</el-button>
<el-button @click="dialogFormVisible=false">取 消</el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
......@@ -253,11 +417,11 @@
</template>
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportRiskInfo,entReportRiskInfo } from "@/api/risk/info";
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportRiskInfo,entReportRiskInfo,getDdeviceDetailInfo, addDetailInfos, deleteDetailInfo, deleteeListDetailInfo, selectDetailInfoList, deleteDeviceDetailInfo, updateDetailInfoLists } from "@/api/risk/info";
import GetPos from '@/components/GetPos';
import { enterpriseLists } from "@/api/regulation/info";
import DetailInfo from "./components/DetailInfo";
import{getInfo} from "@/api/login"
import{getInfo}from "@/api/login"
import { getDefaultCountyList } from "@/api/area/county";
export default {
name: "Infor",
......@@ -267,10 +431,13 @@ export default {
},
data() {
return {
relationImg: require('@/assets/project/relation.png'),
uploadStateLabel:"",
uploadTimeLabel:"",
// 遮罩层
loading: true,
// 下级数据的遮罩层
loadings: true,
user:{},
// 导出遮罩层
exportLoading: false,
......@@ -309,7 +476,47 @@ export default {
// 表单参数
form: {
fUploadType: null,
fUploadTime: null
fUploadTime: null,
relationDeviceType: '4'
},
// 关联设备相关数据
dialogTableVisible: false,
dialogFormVisible: false,
tableData: [],
DetailInfoListId: [],
DetailInfoList: [],
multipleSelection: [],
datalist: [],
dateQueryParams: {
deviceName: null,
deviceModel: null,
iotNo: null,
},
formDetailInfo: {
relationDeviceDetailId: '',
deviceName: '',
deviceModel: '',
deviceType: '',
iotNo: '',
detectionMedium: '',
remarksn: ''
},
formDetailInfoRules: {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入联网编号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
},
// 表单校验
rules: {
......@@ -351,6 +558,30 @@ export default {
this.getCountyInfo();
},
methods: {
/**查询下级数据列表方法*/
getDataList(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
},
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
});
},
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
//判断 上报是否需要显示,上报分为企业上报 和 政府端上报
judgeUploadIsShow(row) {
......@@ -385,21 +616,6 @@ export default {
return true;
},
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
});
},
getuserInfo(){
getInfo().then(response => {
this.user = response.user.roles[0]
......@@ -463,9 +679,13 @@ export default {
fRemark: null,
fUpdateTime: null,
fUploadType: null,
fUploadTime: null
fUploadTime: null,
relationDeviceType: '4'
};
this.resetForm("form");
this.DetailInfoList = [];
this.datalist = [];
this.DetailInfoListId = [];
},
/** 搜索按钮操作 */
handleQuery() {
......@@ -484,6 +704,27 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
//关联数据多选框选中数据
tableDataSelectionChange(selection){
this.ids = selection.map(item => item.relationDeviceDetailId)
this.datalist = selection.map(item => item)
//按钮 非选中禁用
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 下级数据搜索*/
handleQueryData(){
this.getDataList();
},
/** 下级数据重置按钮操作 搜索框重置*/
resetQueryDate(){
this.dateQueryParams = {
deviceName: null,
deviceModel: null,
iotNo: null,
}
this.getDataList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
......@@ -494,11 +735,28 @@ export default {
this.form.fCompanyId = this.enterprises[0].enterpriseId
this.isDisabledEnterprise = true;
}
this.loadings = true;
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fRiskDevMajInforId = row.fRiskDevMajInforId || this.ids
var tRiskInfo = {
id: fRiskDevMajInforId,
relationDeviceType: '4'
}
//查询关联设备信息数据
selectDetailInfoList(JSON.stringify(tRiskInfo)).then(response => {
this.DetailInfoList = response.rows;
this.loadings = false;
});
getInfor(fRiskDevMajInforId).then(response => {
this.form = response.data;
this.open = true;
......@@ -520,12 +778,35 @@ export default {
this.open = false;
this.getList();
});
if (this.datalist != null && this.datalist.length > 0) {
this.form.relationDeviceType = '4';
var tRiskParam = {
tRiskDevMajInfor: this.form,
tDeviceInfoS: this.datalist
}
//重新绑定修改后的关联设备
updateDetailInfoLists(JSON.stringify(tRiskParam)).then(response => {
this.open = false;
this.getList();
});
}
} else {
addInfor(this.form).then(response => {
if (valid) {
const deviceIds = this.ids;
this.form.relationDeviceType = '4';
var tRiskParam = {
tRiskDevMajInfor: this.form,
tDeviceInfoS: this.datalist
}
addInfor(JSON.stringify(tRiskParam)).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
}
}
});
......@@ -655,6 +936,93 @@ export default {
}).catch(() => {});
}
},
/**关联设备添加方法*/
addDetailInfo(){
this.$refs["formDetailInfo"].validate(valid => {
if (valid) {
addDetailInfos(this.formDetailInfo).then(response => {
this.dialogFormVisible = false;
this.formDetailInfo = {
deviceName: null,
deviceModel: null,
deviceType: null,
iotNo: null,
remarksn: null
};
this.getDataList();
this.msgSuccess("新增成功");
});
}
});
},
/**关联设备单条删除方法*/
deleteDetailInfo(row){
const deviceIds = row.relationDeviceDetailId;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**关联设备已经选中数据删除方法*/
deleteDataListilInfo(row,index){
const deviceIds = row.relationDeviceDetailId;
if (this.form.fRiskDevMajInforId != null) {
deleteDeviceDetailInfo(deviceIds).then(response => {
this.msgSuccess("删除成功");
this.DetailInfoList.splice(index,1);
});
} else {
this.DetailInfoList.splice(index,1);
this.msgSuccess("删除成功");
}
},
/**批量删除关联设备方法*/
deleteListDetailInfo(row){
const deviceIds = this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteeListDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**添加关联设备与空间绑定的数据*/
insertListDetailInfo(row){
const deviceIds = this.ids;
const li = this.datalist;
if (this.form.fRiskDevMajInforId != null) {
this.DetailInfoList = this.DetailInfoList.concat(this.datalist)
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
} else {
this.DetailInfoListId.splice(row);
this.DetailInfoList = this.datalist;
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
}
},
/**选择关联设备查询方法*/
selectDataListInfo(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
this.dialogTableVisible = true
});
},
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="110px">
<el-form-item label="重要风险点编码" prop="fRiskCode">
<el-input
v-model="queryParams.fRiskCode"
placeholder="请输入重要风险点编码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="重要风险点名称" prop="fRiskName">
<el-input
v-model="queryParams.fRiskName"
placeholder="请输入重要风险点名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="重要风险点类型" prop="fRiskType">
<el-select v-model="queryParams.fRiskType" placeholder="请选择重要风险点类型" clearable size="small">
<el-option
v-for="dict in fRiskTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="上报状态" prop="entUploadState">
<el-select v-model="queryParams.entUploadState" placeholder="请选择上报状态" clearable size="small">
<el-option label="未上报" value="0" />
<el-option label="已上报" value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-if="user.roleId==5"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-if="user.roleId==5"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-if="user.roleId==5"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>-->
<el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange">
<el-table-column label="重要风险点编码" align="center" prop="fRiskCode" />
<el-table-column label="重要风险点名称" align="center" prop="fRiskName" :show-overflow-tooltip="true"/>
<el-table-column label="燃气企业" align="center" prop="fCompanyId" width="250" :formatter="fCompanyIdFormat"/>
<el-table-column label="县级行政区" align="center" prop="fRegionId" :formatter="fRegionIdFormat"/>
<el-table-column label="重要风险点类型" align="center" prop="fRiskType" :formatter="fRiskTypeFormat" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="备注" align="center" prop="fRemark" :show-overflow-tooltip="true"/> -->
<el-table-column :label="uploadStateLabel" align="center" prop="fUploadType" :formatter="uploadStateFormat">
</el-table-column>
<el-table-column :label="uploadTimeLabel" align="center" prop="fUploadTime" width="150" :formatter="uploadTimeFormat">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-monitor"
@click="handleDeviceData(scope.row)"
>设备监测数据</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-connection"
@click="handleIssue(scope.row, 1)"
>隐患及整改情况</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-warning-outline"
@click="handleIssue(scope.row, 2)"
>监测异常及处置情况</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改重要风险点管控对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="重要风险点名称" prop="fRiskName">
<el-input v-model="form.fRiskName" placeholder="请输入重要风险点名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="燃气企业" prop="fCompanyId">
<el-select style="width: 100%;" :disabled="isDisabledEnterprise" v-model="form.fCompanyId" placeholder="请选择">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="县级行政区" prop="fRegionId">
<el-select v-model="form.fRegionId" placeholder="请选择县级行政区" style="width: 100%" >
<el-option
v-for="county in countyInfo"
:key="county.fId"
:label="county.fName.trim()"
:value="county.fId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="重要风险点类型" prop="fRiskType">
<el-select style="width:100%" v-model="form.fRiskType" placeholder="请选择重要风险点类型">
<el-option
v-for="dict in fRiskTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="所在位置地址描述" prop="fRiskPlaceDetail">
<el-input v-model="form.fRiskPlaceDetail" placeholder="请输入所在位置地址描述" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经纬度坐标" prop="fLon">
<el-col :span="9">
<el-input v-model="form.fLon" placeholder="请输入经度"/>
</el-col>
<el-col :span="9" style="margin-left: 13px">
<el-input v-model="form.fLat" placeholder="请输入纬度"/>
</el-col>
<el-col :span="4" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="风险构成" prop="fRiskStructure">
<el-input type="textarea" v-model="form.fRiskStructure" placeholder="请输入风险构成" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="风险管控措施" prop="fRiskControlMeasures">
<el-input type="textarea" v-model="form.fRiskControlMeasures" placeholder="请输入风险管控措施" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="fRemark">
<el-input v-model="form.fRemark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="tableTitle">
<img :src="relationImg" style="width: 24px; height: 25px;position: relative; left: -339px; top: -12px;"/>
<span class="midText">关联设备</span>
</div>
<el-table v-loading="loadings" ref="multipleTable" :data="DetailInfoList" tooltip-effect="dark" style="width: 100%" max-height="250">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDataListilInfo(scope.row,scope.$index)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="selectDataListInfo">选择关联设备</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!--选择关联设备弹出框-->
<el-dialog title="选择关联设备" :visible.sync="dialogTableVisible" width="1100px" formLabelWidth="160px">
<template>
<el-form :model="dateQueryParams" ref="queryForm" :inline="true" v-show="showSearch">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="dateQueryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="deviceCode">
<el-input
v-model="dateQueryParams.deviceModel"
placeholder="请输入设备型号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceAddr">
<el-input
v-model="dateQueryParams.iotNo"
placeholder="请输入物联网编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryData">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryDate">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="dialogFormVisible = true"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="deleteListDetailInfo"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getDataList"></right-toolbar>
</el-row>
<el-table v-loading="loadings" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDetailInfo(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="insertListDetailInfo">提 交</el-button>
<el-button @click="dialogTableVisible=false">取 消</el-button>
</div>
</template>
</el-dialog>
<!--添加关联设备弹出框-->
<el-dialog title="添加关联设备" :visible.sync="dialogFormVisible">
<el-form ref="formDetailInfo" :model="formDetailInfo" :rules="formDetailInfoRules" label-width="95px" style="height: 230px">
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="formDetailInfo.deviceName" placeholder="请输入设备名称" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="formDetailInfo.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="formDetailInfo.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium">
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
<el-input v-model="formDetailInfo.remarksn" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addDetailInfo">提 交</el-button>
<el-button @click="dialogFormVisible=false">取 消</el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
/>
<!-- 详情 -->
<DetailInfo ref="detail"/>
<!-- 设备监测数据弹窗 -->
<el-dialog title="设备监测数据" :visible.sync="deviceDataVisible" width="900px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleDeviceTabClick">
<el-tab-pane label="压力表" name="1"></el-tab-pane>
<el-tab-pane label="流量计" name="2"></el-tab-pane>
<el-tab-pane label="探测器" name="3"></el-tab-pane>
<el-tab-pane label="温度计" name="4"></el-tab-pane>
</el-tabs>
<div v-if="deviceDataVisible">
<el-table v-loading="deviceDataLoading" :data="deviceDataList" style="width: 100%">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceNum" />
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="压力 (KPa)" align="center" prop="pressure" v-if="activeName === '1'" />
<el-table-column label="标况流量 (m³)" align="center" prop="standardConditionFlow" v-if="activeName === '2'" />
<el-table-column label="温度 (℃)" align="center" prop="temperature" v-if="activeName === '4'" />
<el-table-column label="通讯状态" align="center" prop="communicationStatus" :formatter="communicationStatusFormat" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination
v-show="deviceDataTotal>0"
:total="deviceDataTotal"
:page.sync="deviceDataQueryParams.pageNum"
:limit.sync="deviceDataQueryParams.pageSize"
@pagination="getDeviceDataList"
/>
</div>
</el-dialog>
<!-- 隐患及整改情况/监测异常及处置情况弹窗 -->
<el-dialog :title="issueDialogTitle" :visible.sync="issueDialogVisible" width="1200px" append-to-body>
<el-table v-loading="issueLoading" :data="issueList" style="width: 100%">
<el-table-column label="隐患描述" align="center" prop="dangerAnomaly" :show-overflow-tooltip="true" v-if="issueType === 1" />
<el-table-column label="异常描述" align="center" prop="dangerAnomaly" :show-overflow-tooltip="true" v-if="issueType === 2" />
<el-table-column label="整改情况" align="center" prop="rectificationDisposal" :show-overflow-tooltip="true" v-if="issueType === 1" />
<el-table-column label="处置情况" align="center" prop="rectificationDisposal" :show-overflow-tooltip="true" v-if="issueType === 2" />
<el-table-column label="处理人" align="center" prop="handler" width="120" />
<el-table-column label="联系电话" align="center" prop="phone"/>
<el-table-column label="上报日期" align="center" prop="createTime" width="120" />
</el-table>
<pagination
v-show="issueTotal>0"
:total="issueTotal"
:page.sync="issueQueryParams.pageNum"
:limit.sync="issueQueryParams.pageSize"
@pagination="getIssueList"
/>
</el-dialog>
</div>
</template>
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor, reportRiskInfo,entReportRiskInfo,getDdeviceDetailInfo, addDetailInfos, deleteDetailInfo, deleteeListDetailInfo, selectDetailInfoList, deleteDeviceDetailInfo, updateDetailInfoLists } from "@/api/risk/info";
import { listRectification } from "@/api/risk/rectification";
import GetPos from '@/components/GetPos';
import { enterpriseLists } from "@/api/regulation/info";
import DetailInfo from "../components/DetailInfo";
import{getInfo}from"@/api/login"
import { getDefaultCountyList } from "@/api/area/county";
import {riskListData} from "@/api/operationMonitor/data";
export default {
name: "RiskControl",
components: {
GetPos,
DetailInfo
},
data() {
return {
relationImg: require('@/assets/project/relation.png'),
uploadStateLabel:"",
uploadTimeLabel:"",
// 遮罩层
loading: true,
// 下级数据的遮罩层
loadings: true,
user:{},
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
fRiskCodes: [],
//燃气企业
enterprises: [],
//县级行政区
countyInfo: [],
isDisabledEnterprise: false,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 重要风险点管控表格数据
inforList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
fRiskTypeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fRiskCode: null,
fRiskName: null,
fRiskType: null,
entUploadState:null
},
// 表单参数
form: {
fUploadType: null,
fUploadTime: null,
relationDeviceType: '4'
},
// 关联设备相关数据
dialogTableVisible: false,
dialogFormVisible: false,
tableData: [],
DetailInfoListId: [],
DetailInfoList: [],
multipleSelection: [],
datalist: [],
dateQueryParams: {
deviceName: null,
deviceModel: null,
iotNo: null,
},
formDetailInfo: {
relationDeviceDetailId: '',
deviceName: '',
deviceModel: '',
deviceType: '',
iotNo: '',
detectionMedium: '',
remarksn: ''
},
formDetailInfoRules: {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入联网编号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
},
// 表单校验
rules: {
fRiskName: [
{ required: true, message: "重要风险点名称不能为空", trigger: "blur" }
],
fCompanyId: [
{ required: true, message: "涉及燃气企业编码不能为空", trigger: "blur" }
],
fRiskPlaceDetail: [
{ required: true, message: "所在位置地址描述不能为空", trigger: "blur" }
],
fLon: [
{ required: true, message: "请选择经纬度", trigger: "blur" }
],
fRiskStructure: [
{ required: true, message: "风险构成不能为空", trigger: "blur" }
],
fRiskControlMeasures: [
{ required: true, message: "风险管控不能为空", trigger: "blur" }
],
fRemark: [
{ required: true, message: "备注不能为空", trigger: "blur" }
],
fUpdateTime: [
{ required: true, message: "最后修改时间不能为空", trigger: "blur" }
]
},
devicePos: [],
dialogTableVisibles: false,
// 设备监测数据相关
deviceDataVisible: false,
deviceDataLoading: false,
deviceDataList: [],
deviceDataTotal: 0,
issueType: '1',
activeName: '1',
currentRiskId: null,
deviceDataQueryParams: {
pageNum: 1,
pageSize: 10,
deviceType: '1',
fRiskDevMajInforId: null
},
// 隐患及整改情况相关
issueDialogVisible: false,
issueLoading: false,
issueList: [],
issueTotal: 0,
issueDialogTitle: '',
issueQueryParams: {
pageNum: 1,
pageSize: 10,
fRiskDevMajInforId: null,
issueType: null
}
};
},
created() {
this.getuserInfo();
this.getDicts("t_risk_type").then(response => {
this.fRiskTypeOptions = response.data;
});
this.getEnterpriseLists();
this.getCountyInfo();
},
methods: {
/**查询下级数据列表方法*/
getDataList(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
},
// 设备类型字典翻译
deviceTypeFormat(row, column) {
const deviceTypeMap = {
'1': '压力表',
'2': '流量计',
'3': '探测器',
'4': '温度计'
};
return deviceTypeMap[row.deviceType] || row.deviceType;
},
// 通讯状态字典翻译
communicationStatusFormat(row, column) {
if (row.communicationStatus === '0') {
return '在线';
} else if (row.communicationStatus === '1') {
return '离线';
}
return '';
},
// 隐患类型字典翻译
issueTypeFormat(row, column) {
if (row.issueType === '1') {
return '隐患';
} else if (row.issueType === '2') {
return '监测异常';
}
return '';
},
// 设备监测数据
handleDeviceData(row) {
this.currentRiskId = row.fRiskDevMajInforId;
this.deviceDataVisible = true;
this.activeName = '1';
this.deviceDataQueryParams.deviceType = '1';
this.deviceDataQueryParams.relationDeviceId = row.fRiskDevMajInforId;
this.getDeviceDataList();
},
// 切换设备类型标签
handleDeviceTabClick(tab) {
this.activeName = tab.name;
this.deviceDataQueryParams.deviceType = tab.name;
this.getDeviceDataList();
},
// 获取设备数据列表
getDeviceDataList() {
this.deviceDataLoading = true;
riskListData(this.deviceDataQueryParams).then(response => {
this.deviceDataList = response.rows;
this.deviceDataTotal = response.total;
this.deviceDataLoading = false;
});
},
// 隐患及整改情况/监测异常及处置情况
handleIssue(row, issueType) {
this.currentRiskId = row.fRiskDevMajInforId;
this.issueDialogVisible = true;
this.issueDialogTitle = issueType === 1 ? '隐患及整改情况' : '监测异常及处置情况';
this.issueType = issueType;
this.issueQueryParams.fRiskDevMajInforId = row.fRiskDevMajInforId;
this.issueQueryParams.issueType = issueType;
this.getIssueList();
},
// 获取隐患及整改情况列表
getIssueList() {
this.issueLoading = true;
listRectification(this.issueQueryParams).then(response => {
this.issueList = response.rows;
this.issueTotal = response.total;
this.issueLoading = false;
});
},
//所属单位
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
this.enterprises = response.rows;
});
},
//获取县级
getCountyInfo(){
getDefaultCountyList().then(res =>{
if(res.code == 200 && res.data){
this.countyInfo = res.data;
}
})
},
//判断 上报是否需要显示,上报分为企业上报 和 政府端上报
judgeUploadIsShow(row) {
//角色 3 政府角色 5 企业角色
let roleId = this.user.roleId;
// 企业端 上报状态 0-未上报,1-已上报
let entUploadState = row.entUploadState;
// 政府端 上报状态 0-未上报,1-已上报
let govUploadState = row.govUploadState;
// 如果政府端都已经上报,那就不能显示了。
if(govUploadState === '1') {
return false;
}
// 如果企业端上报了,则企业端就不能显示了,政府端和 超级管理员能显示
if(entUploadState === '1' && govUploadState === '0') {
if (roleId === 5) {
this.uploadStateLabel = "上报状态"
this.uploadTimeLabel = "上报时间"
return false;
} else {
this.uploadStateLabel = "上报省厅状态"
this.uploadTimeLabel = "上报省厅时间"
return true;
}
}
// 别的情况,都显示
return true;
},
getuserInfo(){
getInfo().then(response => {
this.user = response.user.roles[0]
console.log("response.user.roles[0] = " + response.user.roles[0]);
this.getList();
});
},
/** 查询重要风险点管控列表 */
getList() {
this.loading = true;
// 企业查自己的数据
if (this.user.roleId == 5) {
this.queryParams.fCompanyId = this.$store.state.user.enterpriseId
}
// 政府如果按照状态查的话,是查的 govUploadState
if (this.user.roleId == 3) {
this.queryParams.govUploadState = this.queryParams.entUploadState;
}
listInfor(this.queryParams).then(response => {
this.inforList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 燃气企业
fCompanyIdFormat(row, column) {
let info = this.enterprises.find(item => item.enterpriseId == row.fCompanyId);
return info?info.enterpriseName:"-";
},
// 行政区
fRegionIdFormat(row, column) {
let info = this.countyInfo.find(item => item.fId == row.fRegionId);
return info?info.fName:"-";
},
// 重要风险点类型,1 密闭空间,2 人员密集场
fRiskTypeFormat(row, column) {
const riskType = this.selectDictLabel(this.fRiskTypeOptions, row.fRiskType);
return riskType ? riskType : "-";
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fRiskDevMajInforId: null,
fRiskCode: null,
fRiskName: null,
fCompanyId: null,
fRegionId: null,
fRiskType: null,
fRiskPlaceDetail: null,
fLon: null,
fLat: null,
fRiskStructure: null,
fRiskControlMeasures: null,
fRemark: null,
fUpdateTime: null,
fUploadType: null,
fUploadTime: null,
relationDeviceType: '4'
};
this.resetForm("form");
this.DetailInfoList = [];
this.datalist = [];
this.DetailInfoListId = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fRiskDevMajInforId);
this.fRiskCodes = selection.map(item => item.fRiskCode);
this.single = selection.length!==1
this.multiple = !selection.length
},
//关联数据多选框选中数据
tableDataSelectionChange(selection){
this.ids = selection.map(item => item.relationDeviceDetailId)
this.datalist = selection.map(item => item)
//按钮 非选中禁用
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 下级数据搜索*/
handleQueryData(){
this.getDataList();
},
/** 下级数据重置按钮操作 搜索框重置*/
resetQueryDate(){
this.dateQueryParams = {
deviceName: null,
deviceModel: null,
iotNo: null,
}
this.getDataList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加重要风险点管控";
// 说明是 企业在新增,直接赋值显示就行了。
if (this.enterprises.length == 1) {
this.form.fCompanyId = this.enterprises[0].enterpriseId
this.isDisabledEnterprise = true;
}
this.loadings = true;
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fRiskDevMajInforId = row.fRiskDevMajInforId || this.ids
var tRiskInfo = {
id: fRiskDevMajInforId,
relationDeviceType: '4'
}
//查询关联设备信息数据
selectDetailInfoList(JSON.stringify(tRiskInfo)).then(response => {
this.DetailInfoList = response.rows;
this.loadings = false;
});
getInfor(fRiskDevMajInforId).then(response => {
this.form = response.data;
this.open = true;
// 说明是 企业在新增,直接赋值显示就行了。
if (this.enterprises.length == 1) {
this.form.fCompanyId = this.enterprises[0].enterpriseId
this.isDisabledEnterprise = true;
}
this.title = "修改重要风险点管控";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fRiskDevMajInforId != null) {
updateInfor(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
if (this.datalist != null && this.datalist.length > 0) {
this.form.relationDeviceType = '4';
var tRiskParam = {
tRiskDevMajInfor: this.form,
tDeviceInfoS: this.datalist
}
//重新绑定修改后的关联设备
updateDetailInfoLists(JSON.stringify(tRiskParam)).then(response => {
this.open = false;
this.getList();
});
}
} else {
if (valid) {
const deviceIds = this.ids;
this.form.relationDeviceType = '4';
var tRiskParam = {
tRiskDevMajInfor: this.form,
tDeviceInfoS: this.datalist
}
addInfor(JSON.stringify(tRiskParam)).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fRiskDevMajInforIds = row.fRiskDevMajInforId || this.ids;
const fRiskCodes = row.fRiskCode || this.fRiskCodes;
this.$confirm('是否确认删除重要风险点管控编号为"' + fRiskCodes + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInfor(fRiskDevMajInforIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有重要风险点管控数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
// 企业查自己的数据
if (this.user.roleId == 5) {
this.queryParams.fCompanyId = this.$store.state.user.enterpriseId
}
// 政府如果按照状态查的话,是查的 govUploadState
if (this.user.roleId == 3) {
this.queryParams.govUploadState = this.queryParams.entUploadState;
}
return exportInfor(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.fLon = res[0];
this.form.fLat = res[1];
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fRiskDevMajInforId);
},
//上报状态动态展示
uploadStateFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
if (row.entUploadState == '0') {
return "未上报"
} else{
return "已上报"
}
} else {
if (row.govUploadState == '0') {
return "未上报"
} else{
return "已上报"
}
}
},
//上报时间动态展示
uploadTimeFormat(row, column) {
//角色 1 超级管理员 5 企业
let roleId = this.user.roleId;
if (roleId == 5) {
return row.entUploadTime;
} else {
return row.govUploadTime;
}
},
/** 上报按钮操作 */
handleReport(row) {
// 如果是 企业,并且 企业端上报状态为0
if (this.user.roleId == 5 && row.entUploadState == '0') {
this.$confirm('是否确认上报重要风险点编码为"' + row.fRiskCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return entReportRiskInfo({fRiskDevMajInforId : row.fRiskDevMajInforId});
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
}).catch(() => {});
}
// 如果是 政府,并且 政府端上报状态为0
if (this.user.roleId == 3 && row.govUploadState == '0') {
this.$confirm('是否确认上报重要风险点编码为"' + row.fRiskCode + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return reportRiskInfo({fRiskDevMajInforId : row.fRiskDevMajInforId});
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
}).catch(() => {});
}
},
/**关联设备添加方法*/
addDetailInfo(){
this.$refs["formDetailInfo"].validate(valid => {
if (valid) {
addDetailInfos(this.formDetailInfo).then(response => {
this.dialogFormVisible = false;
this.formDetailInfo = {
deviceName: null,
deviceModel: null,
deviceType: null,
iotNo: null,
remarksn: null
};
this.getDataList();
this.msgSuccess("新增成功");
});
}
});
},
/**关联设备单条删除方法*/
deleteDetailInfo(row){
const deviceIds = row.relationDeviceDetailId;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**关联设备已经选中数据删除方法*/
deleteDataListilInfo(row,index){
const deviceIds = row.relationDeviceDetailId;
if (this.form.fRiskDevMajInforId != null) {
deleteDeviceDetailInfo(deviceIds).then(response => {
this.msgSuccess("删除成功");
this.DetailInfoList.splice(index,1);
});
} else {
this.DetailInfoList.splice(index,1);
this.msgSuccess("删除成功");
}
},
/**批量删除关联设备方法*/
deleteListDetailInfo(row){
const deviceIds = this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteeListDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**添加关联设备与空间绑定的数据*/
insertListDetailInfo(row){
const deviceIds = this.ids;
const li = this.datalist;
if (this.form.fRiskDevMajInforId != null) {
this.DetailInfoList = this.DetailInfoList.concat(this.datalist)
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
} else {
this.DetailInfoListId.splice(row);
this.DetailInfoList = this.datalist;
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
}
},
/**选择关联设备查询方法*/
selectDataListInfo(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
this.dialogTableVisible = true
});
},
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属企业" prop="enterpriseId">
<el-select v-model="queryParams.enterpriseId" placeholder="请选择企业" clearable size="small">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"/>
</el-select>
</el-form-item>
<el-form-item label="场所/设施名称" prop="venueFacility">
<el-input
v-model="queryParams.venueFacility"
placeholder="请输入场所/设施名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="场所分类" prop="venueType">
<el-select v-model="queryParams.venueType" placeholder="请选择场所分类" clearable size="small">
<el-option label="密闭空间" value="1" />
<el-option label="人员密集场所" value="2" />
</el-select>
</el-form-item>
<el-form-item label="警示标识" prop="warningSign">
<el-select v-model="queryParams.warningSign" placeholder="请选择警示标识" clearable size="small">
<el-option label="已设置" value="1" />
<el-option label="未设置" value="2" />
</el-select>
</el-form-item>
<el-form-item label="最近检查日期" prop="lastDate">
<el-date-picker clearable size="small"
v-model="queryParams.lastDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最近检查日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="spaceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="统一社会信用代码" align="center" prop="socialCreditCode" />
<el-table-column label="场所/设施名称" align="center" prop="venueFacility" />
<el-table-column label="场所分类" align="center" prop="venueType" >
<template slot-scope="scope">
<span v-if="scope.row.venueType == '1'">密闭空间</span>
<span v-if="scope.row.venueType == '2'">人员密集场所</span>
</template>
</el-table-column>
<el-table-column label="面积/容积(平方米或立方米)" align="center" prop="area" />
<el-table-column label="警示标识" align="center" prop="warningSign" >
<template slot-scope="scope">
<span v-if="scope.row.warningSign == '1'">已设置</span>
<span v-if="scope.row.warningSign == '2'">未设置</span>
</template>
</el-table-column>
<el-table-column label="最近检查日期" align="center" prop="lastDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!--选择关联设备弹出框-->
<el-dialog title="选择关联设备" :visible.sync="dialogTableVisible" width="1100px" formLabelWidth="160px">
<template>
<el-form :model="dateQueryParams" ref="queryForm" :inline="true" v-show="showSearch">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="dateQueryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="deviceCode">
<el-input
v-model="dateQueryParams.deviceModel"
placeholder="请输入设备型号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceAddr">
<el-input
v-model="dateQueryParams.iotNo"
placeholder="请输入物联网编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryData">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryDate">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="dialogFormVisible = true"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="deleteListDetailInfo"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getDataList"></right-toolbar>
</el-row>
<el-table v-loading="loadings" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDetailInfo(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="insertListDetailInfo"> </el-button>
<el-button @click="dialogTableVisible=false"> </el-button>
</div>
</template>
</el-dialog>
<!--添加关联设备弹出框-->
<el-dialog title="添加关联设备" :visible.sync="dialogFormVisible">
<el-form ref="formDetailInfo" :model="formDetailInfo" :rules="formDetailInfoRules" label-width="95px" style="height: 230px">
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="formDetailInfo.deviceName" placeholder="请输入设备名称" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="formDetailInfo.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="物联网编号" prop="iotNo">
<el-input v-model="formDetailInfo.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium">
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
<el-input v-model="formDetailInfo.remarksn" type="textarea" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addDetailInfo"> </el-button>
<el-button @click="dialogFormVisible=false"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改密闭空间和人员密集场所对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="11">
<el-form-item label="所属企业" prop="enterpriseId">
<el-select v-model="form.enterpriseId" placeholder="请选择所属单位名称" style="width: 100%" @change="qiyechang" >
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="统一社会信用代码" prop="socialCreditCode">
<el-input v-model="form.socialCreditCode" placeholder="请输入统一社会信用代码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="场所设施" prop="venueFacility">
<el-input v-model="form.venueFacility" placeholder="请输入场所/设施名称" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="场所分类" prop="venueType">
<el-select v-model="form.venueType" placeholder="请选择场所分类">
<el-option label="密闭空间" value="1" />
<el-option label="人员密集场所" value="2" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="具体位置" prop="specificLocation">
<el-input v-model="form.specificLocation" placeholder="请输入具体位置" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="面积/容积" prop="area">
<el-input v-model="form.area" placeholder="请输入面积/容积(平方米或立方米)" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="21">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="9" style="margin-left: 15px">
<el-input v-model="form.latitude" placeholder="请输入纬度"/>
</el-col>
<el-col :span="3" style="margin-left: 33px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="危险因素" prop="riskFactors">
<el-input v-model="form.riskFactors" placeholder="请输入主要危险因素" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="频次" prop="workFrequency">
<el-input v-model="form.workFrequency" placeholder="请输入作业/人员频次" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="警示标识" prop="warningSign">
<el-select v-model="form.warningSign" placeholder="请选择警示标识">
<el-option label="已设置" value="1" />
<el-option label="未设置" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="应急器材" prop="emergencyEquipment">
<el-input v-model="form.emergencyEquipment" placeholder="请输入主要应急器材" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="负责人" prop="siteSupervisor">
<el-input v-model="form.siteSupervisor" placeholder="请输入现场负责人" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="电话" prop="supervisorPhone">
<el-input v-model="form.supervisorPhone" placeholder="请输入负责人电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="最近检查日期" prop="lastDate">
<el-date-picker clearable size="small"
v-model="form.lastDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最近检查日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="tableTitle">
<img :src="relationImg" style="width: 24px; height: 25px;position: relative; left: -339px; top: -12px;"/>
<span class="midText">关联设备</span>
</div>
<el-table v-loading="loadings" ref="multipleTable" :data="DetailInfoList" tooltip-effect="dark" style="width: 100%" max-height="250" @selection-change="tableDataSelectionChange">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteDataListilInfo(scope.row,scope.$index)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="selectDataListInfo">选择关联设备</el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
/>
</div>
</template>
<script>
import { listSpace, getSpace, delSpace, addSpace, updateSpace, exportSpace, getDdeviceDetailInfo, addDetailInfos, deleteDetailInfo, deleteeListDetailInfo, selectDetailInfoList, deleteDeviceDetailInfo, updateDetailInfoLists } from "@/api/risk/space";
import {enterpriseLists} from "@/api/regulation/info";
import GetPos from '@/components/GetPos';
export default {
name: "Space",
components: {
GetPos
},
data() {
return {
relationImg: require('@/assets/project/relation.png'),
/**--------------地图使用数据---------------*/
dialogTableVisibles: false,
devicePos: [],
/**--------------地图使用数据---------------*/
// 遮罩层
loading: true,
// 下级数据的遮罩层
loadings: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 下级关联设备条数
detailTotal: 0,
// 密闭空间和人员密集场所表格数据
spaceList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
enterprises: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
enterpriseName: null,
socialCreditCode: null,
venueFacility: null,
venueType: null,
warningSign: null,
lastDate: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
enterpriseId: [
{ required: true, message: "所属企业不能为空", trigger: "blur" }
],
venueFacility: [
{ required: true, message: "场所/设施名称不能为空", trigger: "blur" }
],
venueType: [
{ required: true, message: "场所分类不能为空", trigger: "blur" }
],
},
// 关联设备相关数据
dialogTableVisible: false,
dialogFormVisible: false,
tableData: [],
DetailInfoListId: [],
DetailInfoList: [],
multipleSelection: [],
datalist: [],
dateQueryParams: {
deviceName: null,
deviceModel: null,
iotNo: null,
},
formDetailInfo: {
relationDeviceDetailId: '',
deviceName: '',
deviceModel: '',
deviceType: '',
iotNo: '',
detectionMedium: '',
remarksn: ''
},
formDetailInfoRules: {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceModel: [
{ required: true, message: "请输入设备型号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" },
],
iotNo: [
{ required: true, message: "请输入联网编号", trigger: "blur" },
{ min: 0, max: 20, message: "长度 20 位", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.getEnterpriseLists();
},
methods: {
qiyechang(value){
let obj = {};
obj = this.enterprises.find((item)=>{
return item.enterpriseId === value;
});
this.form.enterpriseName = obj.enterpriseName;
this.form.enterpriseId = value;
},
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
if (response.rows.length>1){
this.enterprises = response.rows;
}else {
this.form.enterpriseId=response.rows[0].enterpriseId
this.enterprises = response.rows;
}
});
},
/** 查询密闭空间和人员密集场所列表 */
getList() {
this.loading = true;
listSpace(this.queryParams).then(response => {
this.spaceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/**查询下级数据列表方法*/
getDataList(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
enterpriseId: null,
enterpriseName: null,
socialCreditCode: null,
venueFacility: null,
venueType: null,
specificLocation: null,
area: null,
riskFactors: null,
workFrequency: null,
warningSign: null,
emergencyEquipment: null,
siteSupervisor: null,
supervisorPhone: null,
lastDate: null,
createTime: null,
longitude: null,
latitude: null,
relationDeviceType: '3',
};
this.resetForm("form");
this.DetailInfoList = [];
this.datalist = [];
this.DetailInfoListId = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 下级数据搜索*/
handleQueryData(){
this.getDataList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 下级数据重置按钮操作 搜索框重置*/
resetQueryDate(){
this.dateQueryParams = {
deviceName: null,
deviceModel: null,
iotNo: null,
}
this.getDataList();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
//关联数据多选框选中数据
tableDataSelectionChange(selection){
this.ids = selection.map(item => item.relationDeviceDetailId)
this.datalist = selection.map(item => item)
//按钮 非选中禁用
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.loadings = true;
//查询下级设备数据
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
});
this.open = true;
this.title = "添加密闭空间和人员密集场所";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
var tConfinedSpaceInfo = {
id: id,
relationDeviceType: '3'
}
//查询关联设备信息数据
selectDetailInfoList(JSON.stringify(tConfinedSpaceInfo)).then(response => {
this.DetailInfoList = response.rows;
this.loadings = false;
});
getSpace(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改密闭空间和人员密集场所";
this.devicePos = [response.data.longitude, response.data.latitude];
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSpace(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
if (this.datalist != null && this.datalist.length > 0) {
this.form.relationDeviceType = '3';
var tConfinedSpaceParam = {
tConfinedSpace: this.form,
tDeviceInfoS: this.datalist
}
//重新绑定修改后的关联设备
updateDetailInfoLists(JSON.stringify(tConfinedSpaceParam)).then(response => {
this.open = false;
this.getList();
});
}
} else {
if (valid) {
const deviceIds = this.ids;
this.form.relationDeviceType = '3';
var tConfinedSpaceParam = {
tConfinedSpace: this.form,
tDeviceInfoS: this.datalist
}
addSpace(JSON.stringify(tConfinedSpaceParam)).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
}
}
});
},
/**关联设备添加方法*/
addDetailInfo(){
this.$refs["formDetailInfo"].validate(valid => {
if (valid) {
addDetailInfos(this.formDetailInfo).then(response => {
this.dialogFormVisible = false;
this.formDetailInfo = {
deviceName: null,
deviceModel: null,
deviceType: null,
iotNo: null,
remarksn: null
};
this.getDataList();
this.msgSuccess("新增成功");
});
}
});
},
/**关联设备单条删除方法*/
deleteDetailInfo(row){
const deviceIds = row.relationDeviceDetailId;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**关联设备已经选中数据删除方法*/
deleteDataListilInfo(row,index){
const deviceIds = row.relationDeviceDetailId;
if (this.form.id != null) {
deleteDeviceDetailInfo(deviceIds).then(response => {
this.msgSuccess("删除成功");
this.DetailInfoList.splice(index,1);
});
} else {
this.DetailInfoList.splice(index,1);
this.msgSuccess("删除成功");
}
},
/**批量删除关联设备方法*/
deleteListDetailInfo(row){
const deviceIds = this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return deleteeListDetailInfo(deviceIds);
}).then(() => {
this.getDataList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**添加关联设备与空间绑定的数据*/
insertListDetailInfo(row){
const deviceIds = this.ids;
const li = this.datalist;
if (this.form.id != null) {
this.DetailInfoList = this.DetailInfoList.concat(this.datalist)
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
} else {
this.DetailInfoListId.splice(row);
this.DetailInfoList = this.datalist;
this.DetailInfoListId.push(deviceIds);
this.dialogTableVisible = false
this.msgSuccess("添加成功");
}
},
/**选择关联设备查询方法*/
selectDataListInfo(){
this.loadings = true;
getDdeviceDetailInfo(this.dateQueryParams).then(response => {
this.tableData = response.rows;
this.detailTotal = response.total;
this.loadings = false;
this.dialogTableVisible = true
});
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
this.form.longitude = res[0];
this.form.latitude = res[1];
}
}
};
</script>
<template>
<div class="drawer-container" :style="{ width: width }">
<div class="drawer-content">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
name: "Drawer",
props: {
title: {
type: String,
default: ''
},
inner: {
type: Boolean,
default: false
},
width: {
type: String,
default: '800px'
},
mask: {
type: Boolean,
default: true
}
},
data() {
return {
isOpen: true
};
}
};
</script>
<style lang="scss" scoped>
.drawer-container {
position: relative;
height: 100%;
background-color: #fff;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
overflow-y: auto;
flex-shrink: 0;
.drawer-content {
padding: 20px;
min-height: 100%;
}
}
</style>
<template>
<div class="gassVehicle app-container">
<drawer title="密闭空间和人员密集场所" :inner="true" :width="drawerWidth" :mask="false">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="场所名称" prop="venueFacility">
<el-input
v-model="queryParams.venueFacility"
placeholder="请输入场所/设施名称"
clearable
size="small"
style="width: 140px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="场所分类" prop="venueType">
<el-select v-model="queryParams.venueType" style="width: 140px" placeholder="请选择场所分类" clearable size="small">
<el-option label="密闭空间" value="1" />
<el-option label="人员密集场所" value="2" />
</el-select>
</el-form-item>
<el-form-item label="警示标识" prop="warningSign">
<el-select v-model="queryParams.warningSign" style="width: 140px" placeholder="请选择警示标识" clearable size="small">
<el-option label="已设置" value="1" />
<el-option label="未设置" value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!--<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>-->
<el-table v-loading="loading" :data="spaceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" align="center" />
<el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="场所/设施名称" align="center" prop="venueFacility" />
<el-table-column label="场所分类" align="center" prop="venueType" :formatter="venueTypeFormat" />
<el-table-column label="具体位置" align="center" prop="specificLocation" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-map-location"
@click="getViewLocation(scope.row)"
>查看位置</el-button>
<el-button
size="mini"
type="text"
@click="handleReport(scope.row)"
>上报</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</drawer>
<div id="map"></div>
<!-- 添加或修改密闭空间和人员密集场所对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="11">
<el-form-item label="所属企业" prop="enterpriseId">
<el-select v-model="form.enterpriseId" placeholder="请选择所属单位名称" style="width: 100%" @change="qiyechang" >
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="统一社会信用代码" prop="socialCreditCode">
<el-input v-model="form.socialCreditCode" placeholder="请输入统一社会信用代码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="场所设施" prop="venueFacility">
<el-input v-model="form.venueFacility" placeholder="请输入场所/设施名称" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="场所分类" prop="venueType">
<el-select v-model="form.venueType" placeholder="请选择场所分类">
<el-option label="密闭空间" value="1" />
<el-option label="人员密集场所" value="2" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="具体位置" prop="specificLocation">
<el-input v-model="form.specificLocation" placeholder="请输入具体位置" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="面积/容积" prop="area">
<el-input v-model="form.area" placeholder="请输入面积/容积 (平方米或立方米)" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="经纬度" prop="longitude">
<el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="9" style="margin-left: 10px">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-col>
<el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="危险因素" prop="riskFactors">
<el-input v-model="form.riskFactors" placeholder="请输入主要危险因素" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="频次" prop="workFrequency">
<el-input v-model="form.workFrequency" placeholder="请输入作业/人员频次" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="警示标识" prop="warningSign">
<el-select v-model="form.warningSign" placeholder="请选择警示标识">
<el-option label="已设置" value="1" />
<el-option label="未设置" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="应急器材" prop="emergencyEquipment">
<el-input v-model="form.emergencyEquipment" placeholder="请输入主要应急器材" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="负责人" prop="siteSupervisor">
<el-input v-model="form.siteSupervisor" placeholder="请输入现场负责人" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="电话" prop="supervisorPhone">
<el-input v-model="form.supervisorPhone" placeholder="请输入负责人电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="最近检查日期" prop="lastDate">
<el-date-picker clearable size="small"
v-model="form.lastDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最近检查日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 设备上报数据弹窗 -->
<el-dialog title="设备监测数据" :visible.sync="deviceDataVisible" width="900px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleDeviceTabClick">
<el-tab-pane label="压力表" name="1"></el-tab-pane>
<el-tab-pane label="流量计" name="2"></el-tab-pane>
<el-tab-pane label="探测器" name="3"></el-tab-pane>
<el-tab-pane label="温度计" name="4"></el-tab-pane>
</el-tabs>
<div v-if="deviceDataVisible">
<el-table v-loading="deviceDataLoading" :data="deviceDataList" style="width: 100%">
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceNum" />
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="压力 (KPa)" align="center" prop="pressure" v-if="activeName === '1'" />
<el-table-column label="标况流量 (m³)" align="center" prop="standardConditionFlow" v-if="activeName === '2'" />
<el-table-column label="温度 (℃)" align="center" prop="temperature" v-if="activeName === '4'" />
<el-table-column label="通讯状态" align="center" prop="communicationStatus" :formatter="communicationStatusFormat" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination
v-show="deviceDataTotal>0"
:total="deviceDataTotal"
:page.sync="deviceDataQueryParams.pageNum"
:limit.sync="deviceDataQueryParams.pageSize"
@pagination="getDeviceDataList"
/>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
/>
</div>
</template>
<script>
import { listSpace, getSpace, delSpace, addSpace, updateSpace, selectDetailInfoList } from "@/api/risk/space";
import {enterpriseLists} from "@/api/regulation/info";
import {spaceListData} from "@/api/operationMonitor/data";
import drawer from "./component/drawer";
import GetPos from '@/components/GetPos';
import { mapBound } from "@/utils/mapClass/boundaryMap";
import {entReportConGasProInfo, reportConGasProInfo} from "@/api/thirdbuild/project";
export default {
name: "VisualManagement",
components: {
GetPos,
drawer
},
data() {
return {
map: null,
recordMarkers: [],
drawerWidth: '800px',
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 密闭空间和人员密集场所表格数据
spaceList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
enterprises: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
venueFacility: null,
venueType: null,
warningSign: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
enterpriseId: [
{ required: true, message: "所属企业不能为空", trigger: "blur" }
],
venueFacility: [
{ required: true, message: "场所/设施名称不能为空", trigger: "blur" }
],
venueType: [
{ required: true, message: "场所分类不能为空", trigger: "blur" }
],
longitude: [
{ required: true, message: "经度不能为空", trigger: "blur" }
],
latitude: [
{ required: true, message: "纬度不能为空", trigger: "blur" }
],
},
/**--------------地图使用数据---------------*/
dialogTableVisibles: false,
devicePos: [],
/**--------------设备上报数据---------------*/
deviceDataVisible: false,
deviceDataLoading: false,
deviceDataList: [],
deviceDataTotal: 0,
activeName: '1',
currentSpaceId: null,
deviceDataQueryParams: {
pageNum: 1,
pageSize: 10,
deviceType: '1'
}
};
},
created() {
this.getList();
this.getEnterpriseLists();
},
mounted(){
// 延迟初始化确保 DOM 已经渲染
this.$nextTick(() => {
this.map = new AMap.Map("map", {
center: [117.08, 39.98],
zoom: 14,
});
mapBound('三河市', this.map, false);
});
},
methods: {
qiyechang(value){
let obj = {};
obj = this.enterprises.find((item)=>{
return item.enterpriseId === value;
});
this.form.enterpriseName = obj.enterpriseName;
this.form.enterpriseId = value;
},
getEnterpriseLists(){
const param = {};
enterpriseLists(param).then(response => {
if (response.rows.length>1){
this.enterprises = response.rows;
}else {
this.form.enterpriseId=response.rows[0].enterpriseId
this.enterprises = response.rows;
}
});
},
/** 查询密闭空间和人员密集场所列表 */
getList() {
this.loading = true;
listSpace(this.queryParams).then(response => {
this.spaceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 场所分类字典翻译
venueTypeFormat(row, column) {
if (row.venueType === '1') {
return '密闭空间';
} else if (row.venueType === '2') {
return '人员密集场所';
}
return '';
},
// 通讯状态字典翻译
communicationStatusFormat(row, column) {
if (row.communicationStatus === '0') {
return '在线';
} else if (row.communicationStatus === '1') {
return '离线';
}
return '';
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
enterpriseId: null,
enterpriseName: null,
socialCreditCode: null,
venueFacility: null,
venueType: null,
specificLocation: null,
area: null,
riskFactors: null,
workFrequency: null,
warningSign: null,
emergencyEquipment: null,
siteSupervisor: null,
supervisorPhone: null,
lastDate: null,
createTime: null,
longitude: null,
latitude: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加密闭空间和人员密集场所";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSpace(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改密闭空间和人员密集场所";
this.devicePos = [response.data.longitude, response.data.latitude];
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSpace(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSpace(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除密闭空间和人员密集场所编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delSpace(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/**获取场所位置并展示设备数据*/
getViewLocation(row){
this.currentSpaceId = row.id;
this.map.remove(this.recordMarkers);
if (row.longitude!=="" && row.latitude!="" && row.longitude!==undefined && row.latitude!==undefined){
let marker = new AMap.Marker({
icon: require("@/assets/firstimage/yjzy.png"),
position: [row.longitude,row.latitude],
offset: new AMap.Pixel(-13, -30),
clickable: true
});
marker.on('click', () => {
this.showDeviceData(row);
});
this.map.add(marker);
this.map.setCenter([row.longitude,row.latitude]);
this.map.setZoom(16);
this.recordMarkers.push(marker);
// 不再自动打开设备数据弹窗,只有点击地图标记才打开
// this.showDeviceData(row);
}else{
this.$message({
message: '当前场所未配置位置信息!',
type: 'warning'
});
}
},
/**展示设备上报数据*/
showDeviceData(row) {
this.deviceDataVisible = true;
this.activeName = '1';
this.deviceDataQueryParams.deviceType = '1';
this.deviceDataQueryParams.relationDeviceId = row.id;
this.getDeviceDataList();
},
/**切换设备类型标签*/
handleDeviceTabClick(tab) {
this.activeName = tab.name;
this.deviceDataQueryParams.deviceType = tab.name;
this.getDeviceDataList();
},
/**获取设备数据列表*/
getDeviceDataList() {
this.deviceDataLoading = true;
spaceListData(this.deviceDataQueryParams).then(response => {
this.deviceDataList = response.rows;
this.deviceDataTotal = response.total;
this.deviceDataLoading = false;
});
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
this.form.longitude = res[0];
this.form.latitude = res[1];
},
/** 上报按钮操作 */
handleReport(row) {
this.$confirm('是否确认上报监测异常?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.getList();
//this.msgSuccess("上报成功");
this.msgError("上级接口调用失败");
}).catch(() => {});
},
}
};
</script>
<style lang="scss" scoped>
.gassVehicle{
position:relative;
height:calc(100vh - 84px);
padding:0;
display: flex;
}
#map{
height: 100%;
flex: 1;
min-width: 500px;
}
.el-table{
background-color: #fff !important;
}
::v-deep .drawer-container {
height: 100%;
overflow-y: auto;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment