Commit e9d88b7c authored by lizhichao's avatar lizhichao

Merge remote-tracking branch 'origin/master'

parents 593e50a6 9d52fed4
package com.zehong.web.controller.map;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
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.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 上图设备信息Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/deviceInfo")
public class TMapDeviceInfoController extends BaseController
{
@Autowired
private ITMapDeviceInfoService tMapDeviceInfoService;
/**
* 查询上图设备信息列表
*/
@GetMapping("/list")
public TableDataInfo list(TMapDeviceInfo tMapDeviceInfo)
{
startPage();
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
return getDataTable(list);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@GetMapping("/deviceInfoLists")
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoService.deviceInfoLists(tMapDeviceInfo);
}
/**
* 导出上图设备信息列表
*/
@Log(title = "上图设备信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceInfo tMapDeviceInfo)
{
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
ExcelUtil<TMapDeviceInfo> util = new ExcelUtil<TMapDeviceInfo>(TMapDeviceInfo.class);
return util.exportExcel(list, "上图设备信息数据");
}
/**
* 获取上图设备信息详细信息
*/
@GetMapping(value = "/{mapDeviceId}")
public AjaxResult getInfo(@PathVariable("mapDeviceId") Long mapDeviceId)
{
return AjaxResult.success(tMapDeviceInfoService.selectTMapDeviceInfoById(mapDeviceId));
}
/**
* 新增上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.insertTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 修改上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.updateTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 删除上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{mapDeviceIds}")
public AjaxResult remove(@PathVariable Long[] mapDeviceIds)
{
return toAjax(tMapDeviceInfoService.deleteTMapDeviceInfoByIds(mapDeviceIds));
}
}
package com.zehong.web.controller.map;
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.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 上图设备监测Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/monitor")
public class TMapDeviceMonitorController extends BaseController
{
@Autowired
private ITMapDeviceMonitorService tMapDeviceMonitorService;
/**
* 查询上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:list')")
@GetMapping("/list")
public TableDataInfo list(TMapDeviceMonitor tMapDeviceMonitor)
{
startPage();
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
return getDataTable(list);
}
/**
* 导出上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:export')")
@Log(title = "上图设备监测", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceMonitor tMapDeviceMonitor)
{
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
ExcelUtil<TMapDeviceMonitor> util = new ExcelUtil<TMapDeviceMonitor>(TMapDeviceMonitor.class);
return util.exportExcel(list, "上图设备监测数据");
}
/**
* 获取上图设备监测详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monitor:query')")
@GetMapping(value = "/{monitorId}")
public AjaxResult getInfo(@PathVariable("monitorId") Long monitorId)
{
return AjaxResult.success(tMapDeviceMonitorService.selectTMapDeviceMonitorById(monitorId));
}
/**
* 新增上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:add')")
@Log(title = "上图设备监测", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.insertTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 修改上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:edit')")
@Log(title = "上图设备监测", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.updateTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 删除上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:remove')")
@Log(title = "上图设备监测", businessType = BusinessType.DELETE)
@DeleteMapping("/{monitorIds}")
public AjaxResult remove(@PathVariable Long[] monitorIds)
{
return toAjax(tMapDeviceMonitorService.deleteTMapDeviceMonitorByIds(monitorIds));
}
}
package com.zehong.system.domain;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 上图设备信息对象 t_map_device_info
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 上图设备id */
private Long mapDeviceId;
/** 上图设备名称 */
@Excel(name = "上图设备名称")
private String mapDeviceName;
/** 设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头 */
@Excel(name = "设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头")
private String mapDeviceType;
/** 设备编号 */
@Excel(name = "设备编号")
private String mapDeviceNum;
/** 检测介质 */
@Excel(name = "检测介质")
private String mapDeviceMedium;
/** 单位 */
@Excel(name = "单位")
private String mapDeviceUnit;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
//监测值
private BigDecimal monitorValue;
//设备状态
private String monitorDeviceStatus;
public BigDecimal getMonitorValue() {
return monitorValue;
}
public void setMonitorValue(BigDecimal monitorValue) {
this.monitorValue = monitorValue;
}
public String getMonitorDeviceStatus() {
return monitorDeviceStatus;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus) {
this.monitorDeviceStatus = monitorDeviceStatus;
}
public void setMapDeviceId(Long mapDeviceId)
{
this.mapDeviceId = mapDeviceId;
}
public Long getMapDeviceId()
{
return mapDeviceId;
}
public void setMapDeviceName(String mapDeviceName)
{
this.mapDeviceName = mapDeviceName;
}
public String getMapDeviceName()
{
return mapDeviceName;
}
public void setMapDeviceType(String mapDeviceType)
{
this.mapDeviceType = mapDeviceType;
}
public String getMapDeviceType()
{
return mapDeviceType;
}
public void setMapDeviceNum(String mapDeviceNum)
{
this.mapDeviceNum = mapDeviceNum;
}
public String getMapDeviceNum()
{
return mapDeviceNum;
}
public void setMapDeviceMedium(String mapDeviceMedium)
{
this.mapDeviceMedium = mapDeviceMedium;
}
public String getMapDeviceMedium()
{
return mapDeviceMedium;
}
public void setMapDeviceUnit(String mapDeviceUnit)
{
this.mapDeviceUnit = mapDeviceUnit;
}
public String getMapDeviceUnit()
{
return mapDeviceUnit;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("mapDeviceId", getMapDeviceId())
.append("mapDeviceName", getMapDeviceName())
.append("mapDeviceType", getMapDeviceType())
.append("mapDeviceNum", getMapDeviceNum())
.append("mapDeviceMedium", getMapDeviceMedium())
.append("mapDeviceUnit", getMapDeviceUnit())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
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_map_device_monitor
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceMonitor extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 监测id */
private Long monitorId;
/** 监测值 */
@Excel(name = "监测值")
private BigDecimal monitorValue;
/** 监测设备状态 */
@Excel(name = "监测设备状态")
private String monitorDeviceStatus;
/** 监测设备编号 */
@Excel(name = "监测设备编号")
private String monitorDeviceNum;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
public void setMonitorId(Long monitorId)
{
this.monitorId = monitorId;
}
public Long getMonitorId()
{
return monitorId;
}
public void setMonitorValue(BigDecimal monitorValue)
{
this.monitorValue = monitorValue;
}
public BigDecimal getMonitorValue()
{
return monitorValue;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus)
{
this.monitorDeviceStatus = monitorDeviceStatus;
}
public String getMonitorDeviceStatus()
{
return monitorDeviceStatus;
}
public void setMonitorDeviceNum(String monitorDeviceNum)
{
this.monitorDeviceNum = monitorDeviceNum;
}
public String getMonitorDeviceNum()
{
return monitorDeviceNum;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("monitorId", getMonitorId())
.append("monitorValue", getMonitorValue())
.append("monitorDeviceStatus", getMonitorDeviceStatus())
.append("monitorDeviceNum", getMonitorDeviceNum())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
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;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 隐患台账对象 t_staning_book
*
* @author zehong
* @date 2022-07-11
* @date 2022-10-07
*/
public class TStaningBook extends BaseEntity
{
......@@ -34,18 +37,96 @@ public class TStaningBook extends BaseEntity
@Excel(name = "隐患描述")
private String measures;
/** 完成用时 */
@Excel(name = "完成用时")
/** 隐患危害 */
@Excel(name = "隐患危害")
private String troubleHarm;
/** 隐患上报人 */
@Excel(name = "隐患上报人")
private Long escalation;
private String escalationName;
/** 隐患上报时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "隐患上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date findTime;
/** 现场照片 */
@Excel(name = "现场照片")
private String picture;
/** 隐患附件 */
@Excel(name = "隐患附件")
private String enclosure;
/** 整改建议 */
@Excel(name = "整改建议")
private String proposal;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date rectificationTerm;
/** 投入费用 */
@Excel(name = "投入费用")
private String investmentCost;
/** 投入物资 */
@Excel(name = "投入物资")
private String investmentMaterial;
/** 整改人 */
@Excel(name = "整改人")
private Long rectification;
private String rectificationName;
/** 整改后图片 */
@Excel(name = "整改后图片")
private String rectificationPictrue;
/** 整改描述 */
@Excel(name = "整改描述")
private String rectificationText;
/** 整改时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "整改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date rectificationTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
/** 完成时间 */
@Excel(name = "完成时间")
private Long finishDay;
/** 复查结果 */
@Excel(name = "复查结果")
/** 复查图片 */
@Excel(name = "复查图片")
private String inspectPictrue;
/** 复查时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "复查时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectTime;
/** 复查结果描述 */
@Excel(name = "复查结果描述")
private String inspectResult;
/** 责任人 */
@Excel(name = "责任人")
/** 复查人 */
@Excel(name = "复查人")
private Long personLiable;
private String personLiableName;
/** 隐患状态 */
@Excel(name = "隐患状态 ")
private Integer state;
/** 部门id */
@Excel(name = "部门id")
private Long deptId;
......@@ -57,9 +138,40 @@ public class TStaningBook extends BaseEntity
private Long workId;
/** 删除 0否 1是 */
@Excel(name = "删除 0否 1是")
private Integer isDel;
public String getEscalationName() {
return escalationName;
}
public void setEscalationName(String escalationName) {
this.escalationName = escalationName;
}
public String getRectificationName() {
return rectificationName;
}
public void setRectificationName(String rectificationName) {
this.rectificationName = rectificationName;
}
public String getPersonLiableName() {
return personLiableName;
}
public void setPersonLiableName(String personLiableName) {
this.personLiableName = personLiableName;
}
public Date getRectificationTerm() {
return rectificationTerm;
}
public void setRectificationTerm(Date rectificationTerm) {
this.rectificationTerm = rectificationTerm;
}
public String getDeptName() {
return deptName;
}
......@@ -113,6 +225,123 @@ public class TStaningBook extends BaseEntity
{
return measures;
}
public void setTroubleHarm(String troubleHarm)
{
this.troubleHarm = troubleHarm;
}
public String getTroubleHarm()
{
return troubleHarm;
}
public void setEscalation(Long escalation)
{
this.escalation = escalation;
}
public Long getEscalation()
{
return escalation;
}
public void setFindTime(Date findTime)
{
this.findTime = findTime;
}
public Date getFindTime()
{
return findTime;
}
public void setPicture(String picture)
{
this.picture = picture;
}
public String getPicture()
{
return picture;
}
public void setEnclosure(String enclosure)
{
this.enclosure = enclosure;
}
public String getEnclosure()
{
return enclosure;
}
public void setProposal(String proposal)
{
this.proposal = proposal;
}
public String getProposal()
{
return proposal;
}
public void setInvestmentCost(String investmentCost)
{
this.investmentCost = investmentCost;
}
public String getInvestmentCost()
{
return investmentCost;
}
public void setInvestmentMaterial(String investmentMaterial)
{
this.investmentMaterial = investmentMaterial;
}
public String getInvestmentMaterial()
{
return investmentMaterial;
}
public void setRectification(Long rectification)
{
this.rectification = rectification;
}
public Long getRectification()
{
return rectification;
}
public void setRectificationPictrue(String rectificationPictrue)
{
this.rectificationPictrue = rectificationPictrue;
}
public String getRectificationPictrue()
{
return rectificationPictrue;
}
public void setRectificationText(String rectificationText)
{
this.rectificationText = rectificationText;
}
public String getRectificationText()
{
return rectificationText;
}
public void setRectificationTime(Date rectificationTime)
{
this.rectificationTime = rectificationTime;
}
public Date getRectificationTime()
{
return rectificationTime;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setFinishDay(Long finishDay)
{
this.finishDay = finishDay;
......@@ -122,6 +351,24 @@ public class TStaningBook extends BaseEntity
{
return finishDay;
}
public void setInspectPictrue(String inspectPictrue)
{
this.inspectPictrue = inspectPictrue;
}
public String getInspectPictrue()
{
return inspectPictrue;
}
public void setInspectTime(Date inspectTime)
{
this.inspectTime = inspectTime;
}
public Date getInspectTime()
{
return inspectTime;
}
public void setInspectResult(String inspectResult)
{
this.inspectResult = inspectResult;
......@@ -140,6 +387,15 @@ public class TStaningBook extends BaseEntity
{
return personLiable;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
......@@ -176,9 +432,25 @@ public class TStaningBook extends BaseEntity
.append("troubleType", getTroubleType())
.append("troubleLevel", getTroubleLevel())
.append("measures", getMeasures())
.append("troubleHarm", getTroubleHarm())
.append("escalation", getEscalation())
.append("findTime", getFindTime())
.append("picture", getPicture())
.append("enclosure", getEnclosure())
.append("proposal", getProposal())
.append("investmentCost", getInvestmentCost())
.append("investmentMaterial", getInvestmentMaterial())
.append("rectification", getRectification())
.append("rectificationPictrue", getRectificationPictrue())
.append("rectificationText", getRectificationText())
.append("rectificationTime", getRectificationTime())
.append("remarks", getRemarks())
.append("finishDay", getFinishDay())
.append("inspectPictrue", getInspectPictrue())
.append("inspectTime", getInspectTime())
.append("inspectResult", getInspectResult())
.append("personLiable", getPersonLiable())
.append("state", getState())
.append("deptId", getDeptId())
.append("workId", getWorkId())
.append("createTime", getCreateTime())
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceInfoMapper
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 删除上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceMonitorMapper
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 删除上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceInfoService
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceMonitorService
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
}
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.TMapDeviceInfoMapper;
import com.zehong.system.domain.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
/**
* 上图设备信息Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceInfoServiceImpl implements ITMapDeviceInfoService
{
@Autowired
private TMapDeviceInfoMapper tMapDeviceInfoMapper;
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
@Override
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoById(mapDeviceId);
}
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息
*/
@Override
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoList(tMapDeviceInfo);
}
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setCreateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.insertTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.updateTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoByIds(mapDeviceIds);
}
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoById(mapDeviceId);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@Override
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoMapper.deviceInfoLists(tMapDeviceInfo);
}
}
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.TMapDeviceMonitorMapper;
import com.zehong.system.domain.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
/**
* 上图设备监测Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceMonitorServiceImpl implements ITMapDeviceMonitorService
{
@Autowired
private TMapDeviceMonitorMapper tMapDeviceMonitorMapper;
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
@Override
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorById(monitorId);
}
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测
*/
@Override
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorList(tMapDeviceMonitor);
}
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setCreateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.insertTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.updateTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorByIds(monitorIds);
}
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorById(monitorId);
}
}
......@@ -51,14 +51,14 @@ public class TStaningBookServiceImpl implements ITStaningBookService
public List<TStaningBook> selectTStaningBookList(TStaningBook tStaningBook)
{
List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook);
for(TStaningBook book: list){
if(book.getDeptId()!=null){
SysDept dept = deptMapper.selectDeptById(book.getDeptId());
if(dept!=null){
book.setDeptName(dept.getDeptName());
}
}
}
// for(TStaningBook book: list){
// if(book.getDeptId()!=null){
// SysDept dept = deptMapper.selectDeptById(book.getDeptId());
// if(dept!=null){
// book.setDeptName(dept.getDeptName());
// }
// }
// }
return list;
}
......
<?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.TMapDeviceInfoMapper">
<resultMap type="TMapDeviceInfo" id="TMapDeviceInfoResult">
<result property="mapDeviceId" column="map_device_id" />
<result property="mapDeviceName" column="map_device_name" />
<result property="mapDeviceType" column="map_device_type" />
<result property="mapDeviceNum" column="map_device_num" />
<result property="mapDeviceMedium" column="map_device_medium" />
<result property="mapDeviceUnit" column="map_device_unit" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorValue" column="monitor_value" />
</resultMap>
<sql id="selectTMapDeviceInfoVo">
select map_device_id, map_device_name, map_device_type, map_device_num, map_device_medium, map_device_unit, longitude, latitude, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_info
</sql>
<select id="selectTMapDeviceInfoList" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and map_device_num = #{mapDeviceNum}</if>
<if test="mapDeviceMedium != null and mapDeviceMedium != ''"> and map_device_medium = #{mapDeviceMedium}</if>
<if test="mapDeviceUnit != null and mapDeviceUnit != ''"> and map_device_unit = #{mapDeviceUnit}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceInfoById" parameterType="Long" resultMap="TMapDeviceInfoResult">
SELECT
device.map_device_id,
device.map_device_name,
device.map_device_type,
device.map_device_num,
device.map_device_medium,
device.map_device_unit,
device.longitude,
device.latitude,
mon.monitor_device_status,
mon.monitor_value
FROM
t_map_device_info device
LEFT JOIN (
SELECT
max(monitor.monitor_id),
monitor.monitor_value,
monitor.monitor_device_status,
monitor.monitor_device_num
FROM
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num
where device.map_device_id = #{mapDeviceId}
</select>
<insert id="insertTMapDeviceInfo" parameterType="TMapDeviceInfo" useGeneratedKeys="true" keyProperty="mapDeviceId">
insert into t_map_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name,</if>
<if test="mapDeviceType != null">map_device_type,</if>
<if test="mapDeviceNum != null">map_device_num,</if>
<if test="mapDeviceMedium != null">map_device_medium,</if>
<if test="mapDeviceUnit != null">map_device_unit,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">#{mapDeviceName},</if>
<if test="mapDeviceType != null">#{mapDeviceType},</if>
<if test="mapDeviceNum != null">#{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">#{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">#{mapDeviceUnit},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceInfo" parameterType="TMapDeviceInfo">
update t_map_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name = #{mapDeviceName},</if>
<if test="mapDeviceType != null">map_device_type = #{mapDeviceType},</if>
<if test="mapDeviceNum != null">map_device_num = #{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">map_device_medium = #{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">map_device_unit = #{mapDeviceUnit},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where map_device_id = #{mapDeviceId}
</update>
<delete id="deleteTMapDeviceInfoById" parameterType="Long">
delete from t_map_device_info where map_device_id = #{mapDeviceId}
</delete>
<delete id="deleteTMapDeviceInfoByIds" parameterType="String">
delete from t_map_device_info where map_device_id in
<foreach item="mapDeviceId" collection="array" open="(" separator="," close=")">
#{mapDeviceId}
</foreach>
</delete>
<select id="deviceInfoLists" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
SELECT
device.map_device_id,
device.map_device_name,
device.map_device_type,
device.map_device_num,
device.map_device_medium,
device.map_device_unit,
device.longitude,
device.latitude,
mon.monitor_device_status,
mon.monitor_value
FROM
t_map_device_info device
LEFT JOIN (
SELECT
max(monitor.monitor_id),
monitor.monitor_value,
monitor.monitor_device_status,
monitor.monitor_device_num
FROM
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and device.map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and device.map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and device.map_device_num = #{mapDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and device.is_del = #{isDel}</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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.TMapDeviceMonitorMapper">
<resultMap type="TMapDeviceMonitor" id="TMapDeviceMonitorResult">
<result property="monitorId" column="monitor_id" />
<result property="monitorValue" column="monitor_value" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorDeviceNum" column="monitor_device_num" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTMapDeviceMonitorVo">
select monitor_id, monitor_value, monitor_device_status, monitor_device_num, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_monitor
</sql>
<select id="selectTMapDeviceMonitorList" parameterType="TMapDeviceMonitor" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
<where>
<if test="monitorValue != null "> and monitor_value = #{monitorValue}</if>
<if test="monitorDeviceStatus != null and monitorDeviceStatus != ''"> and monitor_device_status = #{monitorDeviceStatus}</if>
<if test="monitorDeviceNum != null and monitorDeviceNum != ''"> and monitor_device_num = #{monitorDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceMonitorById" parameterType="Long" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
where monitor_id = #{monitorId}
</select>
<insert id="insertTMapDeviceMonitor" parameterType="TMapDeviceMonitor" useGeneratedKeys="true" keyProperty="monitorId">
insert into t_map_device_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">monitor_value,</if>
<if test="monitorDeviceStatus != null">monitor_device_status,</if>
<if test="monitorDeviceNum != null">monitor_device_num,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">#{monitorValue},</if>
<if test="monitorDeviceStatus != null">#{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">#{monitorDeviceNum},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceMonitor" parameterType="TMapDeviceMonitor">
update t_map_device_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="monitorValue != null">monitor_value = #{monitorValue},</if>
<if test="monitorDeviceStatus != null">monitor_device_status = #{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">monitor_device_num = #{monitorDeviceNum},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where monitor_id = #{monitorId}
</update>
<delete id="deleteTMapDeviceMonitorById" parameterType="Long">
delete from t_map_device_monitor where monitor_id = #{monitorId}
</delete>
<delete id="deleteTMapDeviceMonitorByIds" parameterType="String">
delete from t_map_device_monitor where monitor_id in
<foreach item="monitorId" collection="array" open="(" separator="," close=")">
#{monitorId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询上图设备信息列表
export function listInfo(query) {
return request({
url: '/map/deviceInfo/list',
method: 'get',
params: query
})
}
//获取所有上图设备信息
export function deviceInfoLists(query) {
return request({
url: '/map/deviceInfo/deviceInfoLists',
method: 'get',
params: query
})
}
// 查询上图设备信息详细
export function getInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'get'
})
}
// 新增上图设备信息
export function addInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'post',
data: data
})
}
// 修改上图设备信息
export function updateInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'put',
data: data
})
}
// 删除上图设备信息
export function delInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'delete'
})
}
// 导出上图设备信息
export function exportInfo(query) {
return request({
url: '/map/deviceInfo/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询上图设备监测列表
export function listMonitor(query) {
return request({
url: '/map/monitor/list',
method: 'get',
params: query
})
}
// 查询上图设备监测详细
export function getMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'get'
})
}
// 新增上图设备监测
export function addMonitor(data) {
return request({
url: '/map/monitor',
method: 'post',
data: data
})
}
// 修改上图设备监测
export function updateMonitor(data) {
return request({
url: '/map/monitor',
method: 'put',
data: data
})
}
// 删除上图设备监测
export function delMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'delete'
})
}
// 导出上图设备监测
export function exportMonitor(query) {
return request({
url: '/map/monitor/export',
method: 'get',
params: query
})
}
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-21 09:24:11
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-11 18:06:41
* @FilePath: /danger-manage-web/src/components/bigWindow/Danger.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="danger-wrapper">
<div class="close" @click="close">
<img src="@/assets/images/closeBtn.png" alt="" />
</div>
<div class="text">
{{deviceData.name}}
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {};
},
mounted() {
console.log(this.deviceData);
},
methods: {
close() {
//this.handleClose();
this.mapClass.clearInfoWindow();
},
},
};
</script>
<style lang="scss" scoped>
.danger-wrapper {
background-color: rgba(9, 18, 32, 0.6);
position: absolute;
padding: 30px;
padding-bottom: 0;
box-sizing: border-box;
// width: 100px;
// height: 510px;
.text{
color:#fff;
padding-bottom:30px;
}
.up {
border-bottom: 1px solid #cccccc;
margin-bottom: 15px;
&.noBroder{
border-bottom: 0px solid #cccccc;
margin-bottom: 10px;
}
}
.tit {
line-height: 14px;
color: #ffffff;
font-weight: 600;
position: relative;
margin-left: 12px;
&:before {
content: "";
position: absolute;
width: 5px;
height: 15px;
left: -12px;
top: 0;
background: #fff;
}
}
.close {
position: absolute;
right: 15px;
top: 10px;
cursor: pointer;
}
.one {
width: 100%;
flex-wrap: wrap;
.flex-item {
width: 50%;
margin-bottom: 5px;
.left {
color: #cccccc;
}
.right {
color: #fff;
margin-left: 5px;
}
}
}
.item {
margin-bottom: 5px;
.left {
color: #cccccc;
}
.right {
color: #fff;
margin-left: 5px;
}
.img {
width: 300px;
height: 120px;
display: inline-block;
vertical-align: top;
margin-left: 5px;
img {
width: 100%;
height: 100%;
}
}
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-21 09:24:11
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-13 17:53:09
* @LastEditTime: 2022-10-10 10:01:57
* @FilePath: /danger-manage-web/src/components/bigWindow/Danger.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -37,21 +37,50 @@
<span class="left">监测值:</span
><span v-unValue class="right">{{ deviceData.jcz }}</span>
</div>
</div>
</div>
</template>
<script>
import { getInfo } from "@/api/map/deviceInfo";
export default {
name: "tcq",
data() {
return {};
return {
deviceData: null,
};
},
mounted() {
console.log(this.deviceData);
created() {
// console.log(this.deviceData);
this.$nextTick(() => {
this.getInfo(this.deviceData.deviceId);
});
},
methods: {
getInfo(id) {
getInfo(id).then((res) => {
const data = res.data;
const obj = {
deviceId: data.mapDeviceId,
latitude: data.latitude,
longitude: data.longitude,
deviceType: data.mapDeviceType,
title: data.mapDeviceName,
sbmc: data.mapDeviceName,
// 号
sbbh: item.mapDeviceNum,
// 探测介质
tcjz: data.mapDeviceMedium,
sbzt: data.monitorDeviceStatus,
jcz: data.monitorValue + "" + data.mapDeviceUnit,
shortNum: 12,
config: { scale: 1, textHeight: -94 },
};
this.deviceData = obj;
});
},
close() {
//this.handleClose();
this.mapClass.clearInfoWindow();
......
/*
* @Author: your name
* @Date: 2022-02-25 17:07:40
* @LastEditTime: 2022-02-26 20:59:40
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-10-10 10:01:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/directive/permission/hasValue.js
*/
......@@ -11,8 +11,19 @@
* Copyright (c) 2021 gassafety
*/
export default {
export default {
inserted(el, binding, vnode) {
el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
}
// console.log("开始")
if (!el.innerHTML.replace(/\s+/g, "")) {
el.innerHTML = "-";
}
// el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
},
componentUpdated(el, binding, vnode) {
// console.log("改变了", el.innerHTML);
// el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
if (!el.innerHTML.replace(/\s+/g, "")) {
el.innerHTML = "-";
}
},
};
/*
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-10-07 15:24:09
* @LastEditTime: 2022-10-12 10:09:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
*/
window.danger = { name: "", colorNum: null, path: [], data: {} };
window.dangerArr = JSON.parse(localStorage.getItem('J') )?.length>0? JSON.parse(localStorage.getItem('J') ): [];
window.repeat = () => {
window.danger = { name: "", path: [], data: {} };
};
window.save = () => {
window.dangerArr.push(window.danger);
const json = JSON.stringify(window.dangerArr);
localStorage.setItem("J", json);
console.log(json)
window.repeat()
};
var viewModel = {
silhouetteColor: "Yellow",
......@@ -41,33 +53,54 @@ export const DEVICE_PIC_TYPE = {
ZHIYEWEIHAI: 4,
YINHUAN: 5,
};
// 死数据用的
// const DEVICE_PIC_URL = {
// 1: require("@/assets/marks/jiankong.png"),
// 2: require("@/assets/marks/weixian.png"),
// 3: require("@/assets/marks/qttcq.png"),
// 4: require("@/assets/marks/yltcq.png"),
// 11: require("@/assets/indexImages/bottom/videoUrl.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
// 13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
// 14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
// 15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// // 首页的
// };
const DEVICE_PIC_URL = {
1: require("@/assets/marks/jiankong.png"),
2: require("@/assets/marks/weixian.png"),
3: require("@/assets/marks/qttcq.png"),
4: require("@/assets/marks/yltcq.png"),
// 4: require("@/assets/indexImages/bottom/1.png"),
11: require("@/assets/indexImages/bottom/videoUrl.png"),
12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// 工业探测器
1: require("@/assets/indexImages/bottom/gytcqUrl.png"),
// 温度变送器
2: require("@/assets/indexImages/bottom/wdbsqUrl.png"),
// 压力监测设备
3: require("@/assets/indexImages/bottom/yljcqUrl.png"),
// 液位探测器
4: require("@/assets/indexImages/bottom/ywtcqUrl.png"),
// 摄像头
5: require("@/assets/indexImages/bottom/video2.png"),
// 危险骷髅
10: require("@/assets/marks/weixian.png"),
// 11: require("@/assets/indexImages/bottom/videoUrl.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrl.png"),
// 13: require("@/assets/indexImages/bottom/ydtcqUrl.png"),
// 14: require("@/assets/indexImages/bottom/yltcqUrl.png"),
// 15: require("@/assets/indexImages/bottom/wdtcqUrl.png"),
// 首页的
};
const DEVICE_PIC_URL_WRING = {
12: require("@/assets/indexImages/bottom/qtbjqUrlWring.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrlWring.png"),
};
const DEVICE_PIC_URL_ALARM = {
12: require("@/assets/indexImages/bottom/qtbjqUrlAlarm.png"),
// 12: require("@/assets/indexImages/bottom/qtbjqUrlAlarm.png"),
};
const arr = [];
const dangerColor = {
// 1:Cesium.Color.fromCssColorString("red")
1: Cesium.Color.RED.withAlpha(0.5),
2: Cesium.Color.ORANGE.withAlpha(0.5),
3: Cesium.Color.BLUE.withAlpha(0.5),
4: Cesium.Color.YELLOW.withAlpha(0.5),
3: Cesium.Color.YELLOW.withAlpha(0.5),
4: Cesium.Color.BLUE.withAlpha(0.5),
};
// const picUrlList = {
......@@ -295,7 +328,7 @@ export default class CreateCesium {
let offset = Cesium.Cartesian3.fromRadians(
Cesium.Math.toRadians(gps[0]),
Cesium.Math.toRadians(gps[1]),
-160
-161.1
);
// let offset = Cesium.Cartesian3.fromRadians(
// Cesium.Math.toRadians(gaodeLnglat.lng),
......@@ -362,7 +395,7 @@ export default class CreateCesium {
this.createDevice(movement);
}
var picked = this.scene.pick(movement.position);
console.log("picked", picked);
// console.log("picked", picked);
if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id)
......@@ -422,9 +455,12 @@ export default class CreateCesium {
const pitch = Cesium.Math.toDegrees(this.viewer.camera.pitch).toFixed(2);
//围绕X轴旋转
const roll = Cesium.Math.toDegrees(this.viewer.camera.roll).toFixed(2);
console.log(height, heading, pitch, roll);
// console.log(height, heading, pitch, roll);
const ln = this.getLnglat(movement);
console.log(ln);
// console.log(ln);
window.danger.path.push(ln);
console.log(window.danger.path);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler.setInputAction((movement) => {
// 新建
......@@ -433,7 +469,7 @@ export default class CreateCesium {
handler.setInputAction((movement) => {
// 如果是鼠标按下的状态,则监听地图移动
if (this.mouseDownFlag) {
console.log("地图移动");
// console.log("地图移动");
// this.clearInfoWindow();
// 改变位置
// this.changePosition();
......@@ -458,7 +494,7 @@ export default class CreateCesium {
// this.clearInfoWindow();
var picked = this.scene.pick(movement.position);
console.log(movement.position);
// console.log(movement.position);
if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id)
......@@ -511,7 +547,7 @@ export default class CreateCesium {
// 鼠标抬起
this.mouseDownFlag = false;
console.log("up");
// console.log("up");
// this.viewer.scene.screenSpaceCameraController.enableRotate = true;
// handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
......@@ -544,7 +580,7 @@ export default class CreateCesium {
// 打印中心点坐标、高度
// 当鼠地图移动的时候与相机事件隔离
if (!this.mouseDownFlag) {
console.log("相机发生变化");
// console.log("相机发生变化");
// this.clearInfoWindow();
}
});
......@@ -781,14 +817,15 @@ export default class CreateCesium {
const { longitude, latitude, shortNum, deviceType, title, deviceState } =
item;
let imageUrl;
// 1正常,2警告,3报警,没有的就按原来的算
if (deviceState == 1 || !deviceState) {
imageUrl = DEVICE_PIC_URL[deviceType];
} else if (deviceState == 2) {
imageUrl = DEVICE_PIC_URL_WRING[deviceType];
} else {
imageUrl = DEVICE_PIC_URL_ALARM[deviceType];
}
// // 1正常,2警告,3报警,没有的就按原来的算
// if (deviceState == 1 || !deviceState) {
// imageUrl = DEVICE_PIC_URL[deviceType];
// } else if (deviceState == 2) {
// imageUrl = DEVICE_PIC_URL_WRING[deviceType];
// } else {
// imageUrl = DEVICE_PIC_URL_ALARM[deviceType];
// }
imageUrl = DEVICE_PIC_URL[deviceType];
const obj = this.createPicture(
imageUrl,
......@@ -808,7 +845,7 @@ export default class CreateCesium {
this.deviceTilesArr[deviceType] = [];
}
this.deviceTilesArr[deviceType].push(obj);
console.log("obj", obj);
// console.log("obj", obj);
// }
} else {
// arr.forEach((item) => {
......@@ -1063,6 +1100,7 @@ export default class CreateCesium {
// material: Cesium.Color.RED.withAlpha(0.5),
material: dangerColor[item.colorNum],
classificationType: Cesium.ClassificationType.BOTH,
// classificationType: Cesium.ClassificationType.CESIUM_3D_TILE,
},
});
polygon.danger = true;
......@@ -1084,7 +1122,7 @@ export default class CreateCesium {
this.dangerArr.forEach((item) => {
item.show = bool;
});
this.deviceTilesArr[2].forEach((item) => {
this.deviceTilesArr[10].forEach((item) => {
item.show = bool;
});
}
......
This diff is collapsed.
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @Date: 2022-09-29 16:57:34
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:16:23
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @LastEditTime: 2022-10-10 10:12:39
* @FilePath: /danger-manage-web/src/views/dangerControl/monitor/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="big-window">
<!-- <button @click="$router.push('/')">idnex</button> -->
<!-- <div class="danger">
<el-button @click="dangerChange" type="primary">{{
danger ? "隐藏危险区域" : "展示危险区域"
}}</el-button>
</div> -->
<!-- <div class="go-index">
<el-button @click="$router.push('/index')" type="primary"
>首页</el-button
>
</div> -->
<div id="mapbox"></div>
<div class="index-wrapper">
<Index :charsShow="false" />
</div>
</template>
<script>
import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js";
import Video from "@/components/bigWindow/video";
import tcq from "@/components/bigWindow/tcq";
import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger";
import danger from "@/assets/images/danger.png";
import Editor from "@/components/Editor";
// 危险源实时监测
import Index from "@/views/index.vue";
export default {
name: "monitor",
name: "",
components: {
Editor,
Index,
},
data() {
return {
// Cesium: null,
danger: true,
data1: [
{
deviceType: 11,
longitude: 114.07848044941088,
latitude: 38.24830985372926,
shortNum: 10,
title: "视频1",
},
{
deviceType: 11,
longitude: 114.07858975280202,
latitude: 38.24853877908846,
shortNum: 16,
title: "视频2",
},
{
deviceType: 11,
longitude: 114.0788726514246,
latitude: 38.24854905109693,
shortNum: 16,
title: "视频3",
},
{
deviceType: 11,
longitude: 114.07933673582353,
latitude: 38.24932372451273,
shortNum: 10,
title: "视频4",
},
{
deviceType: 11,
longitude: 114.07943113040781,
latitude: 38.249634714126636,
shortNum: 16,
title: "视频5",
},
{
deviceType: 11,
longitude: 114.08000305885355,
latitude: 38.2494852174479,
shortNum: 16,
title: "视频6",
},
{
deviceType: 11,
longitude: 114.08007200486942,
latitude: 38.249835018521594,
shortNum: 16,
title: "视频7",
},
{
deviceType: 11,
longitude: 114.07771206027549,
latitude: 38.252223651533114,
shortNum: 16,
title: "视频8",
},
],
data2: [
{
deviceType: 3,
longitude: 114.08274961653991,
latitude: 38.24983876031178,
shortNum: 15,
title: "气体探测器",
sbmc: "气体探测器",
sbbh: "HBS030015037",
tcjz: "甲烷",
sbzt: "正常",
},
{
deviceType: 4,
longitude: 114.08344461545148,
latitude: 38.249814328043456,
shortNum: 15,
title: "压力探测器",
sbmc: "压力探测器",
sbbh: "HBS030015037",
tcjz: "压力",
sbzt: "正常",
jcz: "2.3MPa",
},
],
};
},
mounted() {
this.Cesium = new CreateCesium(
"mapbox",
["../3dtiles/jsondata/tileset.json"],
this
);
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
this.data1.forEach((item) => {
item.config = { scale: 1, textHeight: -32 };
this.Cesium.addDevice(item, "pic", Video);
});
this.data2.forEach((item) => {
this.Cesium.addDevice(item, "pic", tcq);
});
},
methods: {
dangerChange() {
this.danger = !this.danger;
// 当infowindow里存在danger-wrappeclass名称时,就清楚infowindow
this.Cesium.dangerTotal(this.danger, "danger-wrappe");
},
},
beforeDestroy() {
// 挂掉该关的 infowindow 跟计算infowindow位置的计时器
this.Cesium.clearInfoWindow();
this.Cesium.destroy();
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.big-window {
.index-wrapper {
width: 100%;
// height: 100%;
height: calc(100vh - 50px);
#mapbox {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
.danger {
position: fixed;
top: 20px;
right: 20px;
z-index: 10;
}
.go-index {
position: fixed;
top: 20px;
left: 20px;
z-index: 10;
}
// height: 100vh;
// background: red;
position: relative;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:23:18
* @LastEditTime: 2022-10-12 09:20:17
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -25,12 +25,16 @@
<script>
import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js";
import { dangerArr } from "@/utils/cesium/dangerArr.js";
import Video from "@/components/bigWindow/video";
import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger";
import weixiandian from "@/components/bigWindow/weixiandian";
import ydqt from "@/components/bigWindow/ydqt";
import danger from "@/assets/images/danger.png";
import Danger2 from "@/components/bigWindow/Danger2";
import Editor from "@/components/Editor";
// 危险风险分布图
......@@ -62,7 +66,7 @@ export default {
data2: [
{
deviceType: 2,
deviceType: 10,
longitude: 114.081436341043262,
latitude: 38.24983817327583,
shortNum: 7,
......@@ -79,7 +83,7 @@ export default {
yhrscw: "二氧化碳。",
},
{
deviceType: 2,
deviceType: 10,
longitude: 114.07705728663734,
latitude: 38.249097661403205,
shortNum: 6,
......@@ -204,9 +208,19 @@ export default {
["../3dtiles/jsondata/tileset.json"],
this
);
this.danger.forEach((item) => {
this.Cesium.addDanger(item, Danger);
});
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
dangerArr
.map((item) => {
return {
lnglatArr: item.path,
...item,
};
})
.forEach((item) => {
this.Cesium.addDanger(item, Danger2);
});
// this.data1.forEach((item) => {
// this.Cesium.addDevice(item, "pic", Video);
// });
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-30 17:23:02
* @LastEditTime: 2022-10-12 09:22:21
* @FilePath: /danger-manage-web/src/views/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -10,11 +10,12 @@
<div class="index-wrapper">
<Top />
<Left
v-if="charsShow"
ref="left"
@clickShow="clickShow"
@dangerDeviceChange="dangerDeviceChange"
/>
<Right ref="right" />
<Right v-if="charsShow" ref="right" />
<Bottom
v-show="deviceOrDangerType == 1"
@deviceChange="deviceChange"
......@@ -31,6 +32,7 @@ import Video from "@/components/bigWindow/video";
import tcq from "@/components/bigWindow/tcq";
import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger";
import Danger2 from "@/components/bigWindow/Danger2";
import weixiandian from "@/components/bigWindow/weixiandian";
import ydqt from "@/components/bigWindow/ydqt";
import danger from "@/assets/images/danger.png";
......@@ -39,8 +41,18 @@ import Top from "@/views/indexComponents/Top";
import Left from "@/views/indexComponents/Left";
import Right from "@/views/indexComponents/Right";
import Bottom from "@/views/indexComponents/Bottom";
import { deviceInfoLists } from "@/api/map/deviceInfo";
import { dangerArr } from "@/utils/cesium/dangerArr.js";
export default {
name: "shouye",
props: {
charsShow: {
type: Boolean,
default: true,
},
},
components: {
Top,
Left,
......@@ -53,8 +65,8 @@ export default {
deviceOrDangerType: 1,
data2: [
{
deviceType: 2,
longitude: 114.081436341043262,
deviceType: 10,
longitude: 114.081436341043262,
latitude: 38.24983817327583,
shortNum: 7,
title: "锅炉点火",
......@@ -70,8 +82,8 @@ export default {
yhrscw: "二氧化碳。",
},
{
deviceType: 2,
longitude: 114.07705728663734,
deviceType: 10,
longitude: 114.07705728663734,
latitude: 38.249097661403205,
shortNum: 6,
title: "有害气体",
......@@ -189,56 +201,56 @@ export default {
],
data11: [
{
deviceType: 11,
deviceType: 5,
longitude: 114.07848044941088,
latitude: 38.24830985372926,
shortNum: 10,
title: "视频1",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07858975280202,
latitude: 38.24853877908846,
shortNum: 16,
title: "视频2",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.0788726514246,
latitude: 38.24854905109693,
shortNum: 16,
title: "视频3",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07933673582353,
latitude: 38.24932372451273,
shortNum: 10,
title: "视频4",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07943113040781,
latitude: 38.249634714126636,
shortNum: 16,
title: "视频5",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.08000305885355,
latitude: 38.2494852174479,
shortNum: 16,
title: "视频6",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.08007200486942,
latitude: 38.249835018521594,
shortNum: 16,
title: "视频7",
},
{
deviceType: 11,
deviceType: 5,
longitude: 114.07771206027549,
latitude: 38.252223651533114,
shortNum: 16,
......@@ -365,6 +377,7 @@ export default {
// rootTopShowChange(boolean) {
// this.$parent.$parent.topShow = boolean;
// },
init() {
this.data2.forEach((item, index) => {
if (index == 0) {
......@@ -373,20 +386,92 @@ export default {
this.Cesium.addDevice(item, "pic", ydqt);
}
});
this.danger.forEach((item) => {
this.Cesium.addDanger(item, Danger);
});
this.data11.forEach((item) => {
item.config = { scale: 1, textHeight: -32 };
this.Cesium.addDevice(item, "pic", Video);
});
this.data12.forEach((item) => {
item.config = { scale: 1, textHeight: -94 };
this.Cesium.addDevice(item, "pic", tcq);
});
// 初始化危险源关闭
// 如果有缓存
// const J = localStorage.getItem("J");
// if (J) {
// const data = JSON.parse(J);
// data
// .map((item) => {
// return {
// lnglatArr: item.path,
// ...item,
// };
// })
// .forEach((item) => {
// this.Cesium.addDanger(item, Null);
// });
// } else {
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
// }
dangerArr
.map((item) => {
return {
lnglatArr: item.path,
...item,
};
})
.forEach((item) => {
this.Cesium.addDanger(item, Danger2);
});
// this.data11.forEach((item) => {
// item.config = { scale: 1, textHeight: -32 };
// this.Cesium.addDevice(item, "pic", Video);
// });
// this.data12.forEach((item) => {
// item.config = { scale: 1, textHeight: -94 };
// this.Cesium.addDevice(item, "pic", tcq);
// });
// // 初始化危险源关闭
this.Cesium.dangerAllShow(false);
this.deviceInfoLists();
},
deviceInfoLists() {
deviceInfoLists().then((res) => {
console.log("设备", res);
res
.map((item) => {
let obj;
// 视频
if (item.mapDeviceType == 5) {
obj = {
latitude: item.latitude,
longitude: item.longitude,
deviceId: item.mapDeviceId,
shortNum: 10,
deviceType: item.mapDeviceType,
title: item.mapDeviceName,
config: { scale: 1, textHeight: -32 },
};
} else {
obj = {
deviceId: item.mapDeviceId,
latitude: item.latitude,
longitude: item.longitude,
deviceType: item.mapDeviceType,
title: item.mapDeviceName,
sbmc: item.mapDeviceName,
// 号
sbbh: item.mapDeviceNum,
// 探测介质
tcjz: item.mapDeviceMedium,
sbzt: item.monitorDeviceStatus,
jcz: item.monitorValue + "" + item.mapDeviceUnit,
shortNum: 12,
config: { scale: 1, textHeight: -94 },
};
}
return obj;
})
.forEach((item) => {
if (item.deviceType == 5) {
this.Cesium.addDevice(item, "pic", Video);
} else {
this.Cesium.addDevice(item, "pic", tcq);
}
});
});
},
clickShow(e) {
// 控制两个组件的展示与隐藏
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-13 09:55:30
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-14 10:25:34
* @LastEditTime: 2022-10-09 17:39:15
* @FilePath: /danger-manage-web/src/views/indexComponents/Bottom.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -42,57 +42,78 @@
</template>
<script>
// 视频图标
import video1 from "@/assets/indexImages/bottom/video1.png";
import video2 from "@/assets/indexImages/bottom/video2.png";
// 气体报警器提标
import qtbjq1 from "@/assets/indexImages/bottom/qtbjq1.png";
import qtbjq2 from "@/assets/indexImages/bottom/qtbjq2.png";
// // 视频图标
// import video1 from "@/assets/indexImages/bottom/video1.png";
// import video2 from "@/assets/indexImages/bottom/video2.png";
// // 气体报警器提标
// import qtbjq1 from "@/assets/indexImages/bottom/qtbjq1.png";
// import qtbjq2 from "@/assets/indexImages/bottom/qtbjq2.png";
// 用电探测器
import ydtcq1 from "@/assets/indexImages/bottom/ydtcq1.png";
import ydtcq2 from "@/assets/indexImages/bottom/ydtcq2.png";
// // 用电探测器
// import ydtcq1 from "@/assets/indexImages/bottom/ydtcq1.png";
// import ydtcq2 from "@/assets/indexImages/bottom/ydtcq2.png";
// 压力探测器
import yltcq1 from "@/assets/indexImages/bottom/yltcq1.png";
import yltcq2 from "@/assets/indexImages/bottom/yltcq2.png";
// // 压力探测器
// import yltcq1 from "@/assets/indexImages/bottom/yltcq1.png";
// import yltcq2 from "@/assets/indexImages/bottom/yltcq2.png";
// 温度探测器
import wdtcq1 from "@/assets/indexImages/bottom/wdtcq1.png";
import wdtcq2 from "@/assets/indexImages/bottom/wdtcq2.png";
// // 温度探测器
// import wdtcq1 from "@/assets/indexImages/bottom/wdtcq1.png";
// import wdtcq2 from "@/assets/indexImages/bottom/wdtcq2.png";
// 工业探测器
import gytcq1 from "@/assets/indexImages/bottom/gytcq1.png";
import gytcq2 from "@/assets/indexImages/bottom/gytcq2.png";
// 温度变送器
import wdbsq1 from "@/assets/indexImages/bottom/wdbsq1.png";
import wdbsq2 from "@/assets/indexImages/bottom/wdbsq2.png";
// 压力监测设备
import yljcq1 from "@/assets/indexImages/bottom/yljcq1.png";
import yljcq2 from "@/assets/indexImages/bottom/yljcq2.png";
// 液位探测器
import ywtcq1 from "@/assets/indexImages/bottom/ywtcq1.png";
import ywtcq2 from "@/assets/indexImages/bottom/ywtcq2.png";
// 摄像头
import video1 from "@/assets/indexImages/bottom/video1.png";
import video2 from "@/assets/indexImages/bottom/video2.png";
export default {
name: "",
data() {
return {
data: [
{ name: "摄像头", icon: video1, iconActive: video2, deviceType: 11 },
{
name: "气体报警器",
icon: qtbjq1,
iconActive: qtbjq2,
deviceType: 12,
name: "工业探测器",
icon: gytcq1,
iconActive: gytcq2,
deviceType: 1,
},
{
name: "温度变送器",
icon: wdbsq1,
iconActive: wdbsq2,
deviceType: 2,
},
{
name: "用电探测器",
icon: ydtcq1,
iconActive: ydtcq2,
deviceType: 13,
name: "压力监测设备",
icon: yljcq1,
iconActive: yljcq2,
deviceType: 3,
},
{
name: "压力探测器",
icon: yltcq1,
iconActive: yltcq2,
deviceType: 14,
name: "液位探测器",
icon: ywtcq1,
iconActive: ywtcq2,
deviceType: 4,
},
{
name: "温度探测器",
icon: wdtcq1,
iconActive: wdtcq2,
deviceType: 15,
name: "摄像头",
icon: video1,
iconActive: video2,
deviceType: 5,
},
],
activeArr: [11, 12, 13, 14, 15],
activeArr: [1, 2, 3, 4, 5],
};
},
methods: {
......
......@@ -201,7 +201,7 @@
<!--</el-form-item>-->
<el-form-item label="责任部门" prop="deptId">
<!--<el-input v-model="form.deptId" placeholder="请输入部门id" />-->
<el-select v-model="form.deptId" placeholder="请选择责任部门">
<el-select v-model="form.deptId" filterable placeholder="请选择责任部门">
<el-option
v-for="dict in deptList"
:key="dict.deptId"
......@@ -215,17 +215,17 @@
<!--<el-form-item label="关联隐患" prop="bookId">-->
<!--<el-input v-model="form.bookId" placeholder="请" />-->
<!--</el-form-item>-->
<el-form-item label="关联隐患" prop="bookId">
<!--<el-input v-model="form.deptId" placeholder="请输入部门id" />-->
<el-select v-model="form.bookId" placeholder="请选择关联隐患">
<el-option
v-for="dict in bookList"
:key="dict.bookId"
:label="dict.troubleName"
:value="parseInt(dict.bookId)"
></el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="关联隐患" prop="bookId">-->
<!--&lt;!&ndash;<el-input v-model="form.deptId" placeholder="请输入部门id" />&ndash;&gt;-->
<!--<el-select v-model="form.bookId" placeholder="请选择关联隐患">-->
<!--<el-option-->
<!--v-for="dict in bookList"-->
<!--:key="dict.bookId"-->
<!--:label="dict.troubleName"-->
<!--:value="parseInt(dict.bookId)"-->
<!--&gt;</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<el-form-item label="任务范围" prop="workRange">
<el-input v-model="form.workRange" placeholder="请输入任务范围" />
</el-form-item>
......
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