Commit f747ed7b authored by yaqizhang's avatar yaqizhang

详情布局优化

parents 928bd1ab ee8f7bd4
...@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo; ...@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.vo.DeviceInfoVo;
import com.zehong.system.service.ITDeviceInfoService; import com.zehong.system.service.ITDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -36,7 +37,7 @@ public class TDeviceInfoController extends BaseController ...@@ -36,7 +37,7 @@ public class TDeviceInfoController extends BaseController
public TableDataInfo list(TDeviceInfo tDeviceInfo) public TableDataInfo list(TDeviceInfo tDeviceInfo)
{ {
startPage(); startPage();
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo); List<DeviceInfoVo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return getDataTable(list); return getDataTable(list);
} }
...@@ -84,8 +85,8 @@ public class TDeviceInfoController extends BaseController ...@@ -84,8 +85,8 @@ public class TDeviceInfoController extends BaseController
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TDeviceInfo tDeviceInfo) public AjaxResult export(TDeviceInfo tDeviceInfo)
{ {
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo); List<DeviceInfoVo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
ExcelUtil<TDeviceInfo> util = new ExcelUtil<TDeviceInfo>(TDeviceInfo.class); ExcelUtil<DeviceInfoVo> util = new ExcelUtil<DeviceInfoVo>(DeviceInfoVo.class);
return util.exportExcel(list, "设备信息数据"); return util.exportExcel(list, "设备信息数据");
} }
......
...@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo; ...@@ -7,6 +7,7 @@ import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.PipeVo;
import com.zehong.system.service.ITPipeService; import com.zehong.system.service.ITPipeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -35,7 +36,7 @@ public class TPipeController extends BaseController ...@@ -35,7 +36,7 @@ public class TPipeController extends BaseController
public TableDataInfo list(TPipe tPipe) public TableDataInfo list(TPipe tPipe)
{ {
startPage(); startPage();
List<TPipe> list = tPipeService.selectTPipeList(tPipe); List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
return getDataTable(list); return getDataTable(list);
} }
...@@ -43,7 +44,7 @@ public class TPipeController extends BaseController ...@@ -43,7 +44,7 @@ public class TPipeController extends BaseController
@GetMapping("/pipeAllInfoList") @GetMapping("/pipeAllInfoList")
public AjaxResult pipeAllInfoList(TPipe tPipe) public AjaxResult pipeAllInfoList(TPipe tPipe)
{ {
List<TPipe> list = tPipeService.selectTPipeList(tPipe); List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
return AjaxResult.success(list); return AjaxResult.success(list);
} }
...@@ -55,8 +56,8 @@ public class TPipeController extends BaseController ...@@ -55,8 +56,8 @@ public class TPipeController extends BaseController
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TPipe tPipe) public AjaxResult export(TPipe tPipe)
{ {
List<TPipe> list = tPipeService.selectTPipeList(tPipe); List<PipeVo> list = tPipeService.selectTPipeList(tPipe);
ExcelUtil<TPipe> util = new ExcelUtil<TPipe>(TPipe.class); ExcelUtil<PipeVo> util = new ExcelUtil<PipeVo>(PipeVo.class);
return util.exportExcel(list, "管道信息数据"); return util.exportExcel(list, "管道信息数据");
} }
......
...@@ -27,7 +27,7 @@ public class TDeviceInfo extends BaseEntity ...@@ -27,7 +27,7 @@ public class TDeviceInfo extends BaseEntity
/** 所属管道编号 */ /** 所属管道编号 */
@Excel(name = "所属管道编号") @Excel(name = "所属管道编号")
private String pipeCode; private int pipeId;
/** 设备名称 */ /** 设备名称 */
@Excel(name = "设备名称") @Excel(name = "设备名称")
...@@ -109,14 +109,14 @@ public class TDeviceInfo extends BaseEntity ...@@ -109,14 +109,14 @@ public class TDeviceInfo extends BaseEntity
{ {
return enterpriseId; return enterpriseId;
} }
public void setPipeCode(String pipeCode) public void setPipeId(int pipeId)
{ {
this.pipeCode = pipeCode; this.pipeId = pipeId;
} }
public String getPipeCode() public int getPipeId()
{ {
return pipeCode; return pipeId;
} }
public void setDeviceName(String deviceName) public void setDeviceName(String deviceName)
{ {
...@@ -259,7 +259,7 @@ public class TDeviceInfo extends BaseEntity ...@@ -259,7 +259,7 @@ public class TDeviceInfo extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceId", getDeviceId()) .append("deviceId", getDeviceId())
.append("enterpriseId", getEnterpriseId()) .append("enterpriseId", getEnterpriseId())
.append("pipeCode", getPipeCode()) .append("pipeCode", getPipeId())
.append("deviceName", getDeviceName()) .append("deviceName", getDeviceName())
.append("deviceCode", getDeviceCode()) .append("deviceCode", getDeviceCode())
.append("deviceAddr", getDeviceAddr()) .append("deviceAddr", getDeviceAddr())
......
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.util.Date;
/**
* 设备信息对象 t_device_info
*
* @author zehong
* @date 2021-07-09
*/
public class DeviceInfoVo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 设备id */
private Integer deviceId;
/** 企业id */
@Excel(name = "企业id")
private Integer enterpriseId;
/** 所属管道编号 */
@Excel(name = "所属管道编号")
private int pipeId;
/** 所属管道名称 */
@Excel(name = "所属管道名称")
private String pipeName;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备编号 */
@Excel(name = "设备编号")
private String deviceCode;
/** 所在地址 */
@Excel(name = "所在地址")
private String deviceAddr;
/** 设备型号 */
@Excel(name = "设备型号")
private String deviceModel;
/** 设备类型(1调压阀,2阀门井,3流量计,4压力表) */
@Excel(name = "设备类型")
private String deviceType;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 物联网编号 */
@Excel(name = "物联网编号")
private String iotNo;
/** 设备图片路径 */
@Excel(name = "设备图片路径")
private String iconUrl;
/** 联系人 */
@Excel(name = "联系人")
private String linkman;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date installationTime;
/** 最后巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectionTime;
/** 是否删除 */
@Excel(name = "是否删除")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setDeviceId(Integer deviceId)
{
this.deviceId = deviceId;
}
public Integer getDeviceId()
{
return deviceId;
}
public void setEnterpriseId(Integer enterpriseId)
{
this.enterpriseId = enterpriseId;
}
public Integer getEnterpriseId()
{
return enterpriseId;
}
public int getPipeId() {
return pipeId;
}
public void setPipeId(int pipeId) {
this.pipeId = pipeId;
}
public String getPipeName() {
return pipeName;
}
public void setPipeName(String pipeName) {
this.pipeName = pipeName;
}
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public void setDeviceAddr(String deviceAddr)
{
this.deviceAddr = deviceAddr;
}
public String getDeviceAddr()
{
return deviceAddr;
}
public void setDeviceModel(String deviceModel)
{
this.deviceModel = deviceModel;
}
public String getDeviceModel()
{
return deviceModel;
}
public void setDeviceType(String deviceType)
{
this.deviceType = deviceType;
}
public String getDeviceType()
{
return deviceType;
}
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 setIotNo(String iotNo)
{
this.iotNo = iotNo;
}
public String getIotNo()
{
return iotNo;
}
public void setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
{
return iconUrl;
}
public void setLinkman(String linkman)
{
this.linkman = linkman;
}
public String getLinkman()
{
return linkman;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setInstallationTime(Date installationTime)
{
this.installationTime = installationTime;
}
public Date getInstallationTime()
{
return installationTime;
}
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
{
return inspectionTime;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceId", getDeviceId())
.append("enterpriseId", getEnterpriseId())
.append("pipeId", getPipeId())
.append("pipeName", getPipeName())
.append("deviceName", getDeviceName())
.append("deviceCode", getDeviceCode())
.append("deviceAddr", getDeviceAddr())
.append("deviceModel", getDeviceModel())
.append("deviceType", getDeviceType())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("iotNo", getIotNo())
.append("iconUrl", getIconUrl())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("installationTime", getInstallationTime())
.append("inspectionTime", getInspectionTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 管道信息对象 t_pipe
*
* @author zehong
* @date 2021-07-08
*/
public class PipeVo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 管道id */
private Integer pipeId;
/** 企业id */
@Excel(name = "企业id")
private Integer enterpriseId;
/** 管道名称 */
@Excel(name = "管道名称")
private String pipeName;
/** 管道编号 */
@Excel(name = "管道编号")
private String pipeCode;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 管道所在地址 */
@Excel(name = "管道所在地址")
private String pipeAddr;
/** 坐标 */
@Excel(name = "坐标")
private String coordinates;
/** 管道长度 */
@Excel(name = "管道长度")
private double pipeLength;
/** 管道类型(1地埋管线、2地表管线) */
@Excel(name = "管道类型", readConverterExp = "1地埋管线、2地表管线")
private String pipeType;
/** 管道压力(低压,中压,次高压,高压) */
@Excel(name = "管道压力", readConverterExp = "1低压,2中压,3次高压,4高压")
private String pipePressure;
/** 设备图片路径 */
@Excel(name = "设备图片路径")
private String iconUrl;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date installationTime;
/** 最后巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectionTime;
/** 是否删除 */
@Excel(name = "是否删除")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setPipeId(Integer pipeId)
{
this.pipeId = pipeId;
}
public Integer getPipeId()
{
return pipeId;
}
public void setEnterpriseId(Integer enterpriseId)
{
this.enterpriseId = enterpriseId;
}
public Integer getEnterpriseId()
{
return enterpriseId;
}
public void setPipeName(String pipeName)
{
this.pipeName = pipeName;
}
public String getPipeName()
{
return pipeName;
}
public String getPipeCode() {
return pipeCode;
}
public void setPipeCode(String pipeCode) {
this.pipeCode = pipeCode;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
public void setDeviceInfoList(List<TDeviceInfo> deviceInfoList) {
this.deviceInfoList = deviceInfoList;
}
public void setPipeAddr(String pipeAddr)
{
this.pipeAddr = pipeAddr;
}
public String getPipeAddr()
{
return pipeAddr;
}
public void setCoordinates(String coordinates)
{
this.coordinates = coordinates;
}
public String getCoordinates()
{
return coordinates;
}
public void setPipeLength(double pipeLength)
{
this.pipeLength = pipeLength;
}
public double getPipeLength()
{
return pipeLength;
}
public void setPipeType(String pipeType)
{
this.pipeType = pipeType;
}
public String getPipeType()
{
return pipeType;
}
public void setPipePressure(String pipePressure)
{
this.pipePressure = pipePressure;
}
public String getPipePressure()
{
return pipePressure;
}
public void setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
{
return iconUrl;
}
public void setInstallationTime(Date installationTime)
{
this.installationTime = installationTime;
}
public Date getInstallationTime()
{
return installationTime;
}
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
{
return inspectionTime;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
}
...@@ -24,10 +24,10 @@ public interface TDeviceInfoMapper ...@@ -24,10 +24,10 @@ public interface TDeviceInfoMapper
/** /**
* 查询设备信息 * 查询设备信息
* *
* @param deviceCode 设备信息ID * @param pipeId 管道ID
* @return 设备信息 * @return 设备信息
*/ */
public TDeviceInfo selectTDeviceInfoByCode(String deviceCode); public List<TDeviceInfo> selectTDeviceInfoByPipeId(int pipeId);
/** /**
* 查询设备信息列表 * 查询设备信息列表
......
...@@ -19,14 +19,6 @@ public interface TPipeMapper ...@@ -19,14 +19,6 @@ public interface TPipeMapper
*/ */
public TPipe selectTPipeById(int pipeId); public TPipe selectTPipeById(int pipeId);
/**
* 查询管道信息
*
* @param pipeCode 管道编号
* @return 管道信息
*/
public TPipe selectTPipeByCode(String pipeCode);
/** /**
* 查询管道信息列表 * 查询管道信息列表
* *
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.vo.DeviceInfoVo;
/** /**
* 设备信息Service接口 * 设备信息Service接口
...@@ -19,7 +20,7 @@ public interface ITDeviceInfoService ...@@ -19,7 +20,7 @@ public interface ITDeviceInfoService
* @param deviceId 设备信息ID * @param deviceId 设备信息ID
* @return 设备信息 * @return 设备信息
*/ */
public TDeviceInfo selectTDeviceInfoById(int deviceId); public DeviceInfoVo selectTDeviceInfoById(int deviceId);
/** /**
* 查询设备信息列表 * 查询设备信息列表
...@@ -27,7 +28,7 @@ public interface ITDeviceInfoService ...@@ -27,7 +28,7 @@ public interface ITDeviceInfoService
* @param tDeviceInfo 设备信息 * @param tDeviceInfo 设备信息
* @return 设备信息集合 * @return 设备信息集合
*/ */
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo); public List<DeviceInfoVo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/** /**
* 构建前端所需要下拉树结构 * 构建前端所需要下拉树结构
......
...@@ -2,6 +2,7 @@ package com.zehong.system.service; ...@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.PipeVo;
/** /**
* 管道信息Service接口 * 管道信息Service接口
...@@ -17,7 +18,7 @@ public interface ITPipeService ...@@ -17,7 +18,7 @@ public interface ITPipeService
* @param pipeId 管道信息ID * @param pipeId 管道信息ID
* @return 管道信息 * @return 管道信息
*/ */
public TPipe selectTPipeById(int pipeId); public PipeVo selectTPipeById(int pipeId);
/** /**
* 查询管道信息列表 * 查询管道信息列表
...@@ -25,7 +26,7 @@ public interface ITPipeService ...@@ -25,7 +26,7 @@ public interface ITPipeService
* @param tPipe 管道信息 * @param tPipe 管道信息
* @return 管道信息集合 * @return 管道信息集合
*/ */
public List<TPipe> selectTPipeList(TPipe tPipe); public List<PipeVo> selectTPipeList(TPipe tPipe);
/** /**
* 统计管道总长度 * 统计管道总长度
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.*; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.DeviceInfoVo;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.mapper.TPipeMapper; import com.zehong.system.mapper.TPipeMapper;
import com.zehong.system.service.ITDeviceInfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.domain.TDeviceInfo; import java.util.ArrayList;
import com.zehong.system.service.ITDeviceInfoService; import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 设备信息Service业务层处理 * 设备信息Service业务层处理
...@@ -31,9 +36,16 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -31,9 +36,16 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
* @return 设备信息 * @return 设备信息
*/ */
@Override @Override
public TDeviceInfo selectTDeviceInfoById(int deviceId) public DeviceInfoVo selectTDeviceInfoById(int deviceId)
{ {
return tDeviceInfoMapper.selectTDeviceInfoById(deviceId); DeviceInfoVo deviceInfoVo = new DeviceInfoVo();
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
BeanUtils.copyProperties(tDeviceInfo, deviceInfoVo);
TPipe pipe = tPipeMapper.selectTPipeById(tDeviceInfo.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName());
return deviceInfoVo;
} }
/** /**
...@@ -43,9 +55,25 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -43,9 +55,25 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
* @return 设备信息 * @return 设备信息
*/ */
@Override @Override
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo) public List<DeviceInfoVo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo)
{ {
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo); List<DeviceInfoVo> list = new ArrayList<>();
List<TDeviceInfo> deviceInfoList = tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
if(deviceInfoList.size() != 0){
for(TDeviceInfo device : deviceInfoList){
DeviceInfoVo deviceInfoVo = new DeviceInfoVo();
BeanUtils.copyProperties(device, deviceInfoVo);
TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName());
list.add(deviceInfoVo);
}
}
return list;
} }
/** /**
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.vo.PipeVo;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TPipeMapper; import com.zehong.system.mapper.TPipeMapper;
...@@ -18,7 +27,8 @@ public class TPipeServiceImpl implements ITPipeService ...@@ -18,7 +27,8 @@ public class TPipeServiceImpl implements ITPipeService
{ {
@Autowired @Autowired
private TPipeMapper tPipeMapper; private TPipeMapper tPipeMapper;
@Autowired
private TDeviceInfoMapper tDeviceInfoMapper;
/** /**
* 查询管道信息 * 查询管道信息
* *
...@@ -26,9 +36,18 @@ public class TPipeServiceImpl implements ITPipeService ...@@ -26,9 +36,18 @@ public class TPipeServiceImpl implements ITPipeService
* @return 管道信息 * @return 管道信息
*/ */
@Override @Override
public TPipe selectTPipeById(int pipeId) public PipeVo selectTPipeById(int pipeId)
{ {
return tPipeMapper.selectTPipeById(pipeId); PipeVo pipeVo = new PipeVo();
TPipe tPipe = tPipeMapper.selectTPipeById(pipeId);
BeanUtils.copyProperties(tPipe, pipeVo);
List<TDeviceInfo> deviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(tPipe.getPipeId());
if(deviceInfoList.size() != 0) {
pipeVo.setDeviceInfoList(deviceInfoList);
}
return pipeVo;
} }
/** /**
...@@ -38,9 +57,26 @@ public class TPipeServiceImpl implements ITPipeService ...@@ -38,9 +57,26 @@ public class TPipeServiceImpl implements ITPipeService
* @return 管道信息 * @return 管道信息
*/ */
@Override @Override
public List<TPipe> selectTPipeList(TPipe tPipe) public List<PipeVo> selectTPipeList(TPipe tPipe)
{ {
return tPipeMapper.selectTPipeList(tPipe); List<PipeVo> list = new ArrayList<>();
List<TPipe> tPipeList = tPipeMapper.selectTPipeList(tPipe);
if(tPipeList.size() != 0){
for(TPipe pipe : tPipeList){
PipeVo pipeVo = new PipeVo();
BeanUtils.copyProperties(pipe, pipeVo);
List<TDeviceInfo> deviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(pipe.getPipeId());
if(deviceInfoList.size() != 0) {
pipeVo.setDeviceInfoList(deviceInfoList);
}
list.add(pipeVo);
}
}
return list;
} }
/** /**
...@@ -73,6 +109,16 @@ public class TPipeServiceImpl implements ITPipeService ...@@ -73,6 +109,16 @@ public class TPipeServiceImpl implements ITPipeService
@Override @Override
public int updateTPipe(TPipe tPipe) public int updateTPipe(TPipe tPipe)
{ {
if("1".equals(tPipe.getIsDel())){
List<TDeviceInfo> tDeviceInfoList = tDeviceInfoMapper.selectTDeviceInfoByPipeId(tPipe.getPipeId());
if(tDeviceInfoList.size() != 0) {
for (TDeviceInfo device : tDeviceInfoList) {
device.setIsDel("1");
tDeviceInfoMapper.updateTDeviceInfo(device);
}
}
}
return tPipeMapper.updateTPipe(tPipe); return tPipeMapper.updateTPipe(tPipe);
} }
......
...@@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceInfo" id="TDeviceInfoResult"> <resultMap type="TDeviceInfo" id="TDeviceInfoResult">
<result property="deviceId" column="device_id" /> <result property="deviceId" column="device_id" />
<result property="enterpriseId" column="enterprise_id" /> <result property="enterpriseId" column="enterprise_id" />
<result property="pipeCode" column="pipe_code" /> <result property="pipeId" column="pipe_id" />
<result property="deviceName" column="device_name" /> <result property="deviceName" column="device_name" />
<result property="deviceCode" column="device_code" /> <result property="deviceCode" column="device_code" />
<result property="deviceAddr" column="device_addr" /> <result property="deviceAddr" column="device_addr" />
...@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTDeviceInfoVo"> <sql id="selectTDeviceInfoVo">
select device_id, enterprise_id, pipe_code, device_name, device_code, device_addr, device_model, device_type, longitude, latitude, iot_no, icon_url, linkman, phone, installation_time, inspection_time, is_del, remarks from t_device_info select device_id, enterprise_id, pipe_id, device_name, device_code, device_addr, device_model, device_type, longitude, latitude, iot_no, icon_url, linkman, phone, installation_time, inspection_time, is_del, remarks from t_device_info
</sql> </sql>
<select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult"> <select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
...@@ -34,7 +34,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -34,7 +34,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
is_del = '0' is_del = '0'
<if test="enterpriseId != null and enterpriseId != 0 "> and enterprise_id = #{enterpriseId}</if> <if test="enterpriseId != null and enterpriseId != 0 "> and enterprise_id = #{enterpriseId}</if>
<if test="pipeCode != null "> and pipe_code = #{pipeCode}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if> <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if> <if test="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if>
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if> <if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
...@@ -57,9 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,9 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where device_id = #{deviceId} where device_id = #{deviceId}
</select> </select>
<select id="selectTDeviceInfoByCode" parameterType="String" resultMap="TDeviceInfoResult"> <select id="selectTDeviceInfoByPipeId" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/> <include refid="selectTDeviceInfoVo"/>
where device_code = #{deviceCode} where pipe_id = #{pipeId}
</select> </select>
<select id="countDeviceByType" resultType="map"> <select id="countDeviceByType" resultType="map">
...@@ -72,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -72,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into t_device_info insert into t_device_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id,</if> <if test="enterpriseId != null and enterpriseId != 0">enterprise_id,</if>
<if test="pipeCode != null">pipe_code,</if> <if test="pipeId != null">pipe_id,</if>
<if test="deviceName != null">device_name,</if> <if test="deviceName != null">device_name,</if>
<if test="deviceCode != null">device_code,</if> <if test="deviceCode != null">device_code,</if>
<if test="deviceAddr != null">device_addr,</if> <if test="deviceAddr != null">device_addr,</if>
...@@ -90,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null and enterpriseId != 0">#{enterpriseId},</if> <if test="enterpriseId != null and enterpriseId != 0">#{enterpriseId},</if>
<if test="pipeCode != null">#{pipeCode},</if> <if test="pipeId != null">#{pipeId},</if>
<if test="deviceName != null">#{deviceName},</if> <if test="deviceName != null">#{deviceName},</if>
<if test="deviceCode != null">#{deviceCode},</if> <if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceAddr != null">#{deviceAddr},</if> <if test="deviceAddr != null">#{deviceAddr},</if>
...@@ -112,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -112,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_device_info update t_device_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id = #{enterpriseId},</if> <if test="enterpriseId != null and enterpriseId != 0">enterprise_id = #{enterpriseId},</if>
<if test="pipeCode != null">pipe_code = #{pipeCode},</if> <if test="pipeId != null">pipe_id = #{pipeId},</if>
<if test="deviceName != null">device_name = #{deviceName},</if> <if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if> <if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceAddr != null">device_addr = #{deviceAddr},</if> <if test="deviceAddr != null">device_addr = #{deviceAddr},</if>
......
...@@ -48,11 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,11 +48,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where pipe_id = #{pipeId} where pipe_id = #{pipeId}
</select> </select>
<select id="selectTPipeByCode" parameterType="String" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
where pipe_code = #{pipeCode}
</select>
<select id="countPipeLength" resultType="double"> <select id="countPipeLength" resultType="double">
select sum(pipe_length) from t_pipe select sum(pipe_length) from t_pipe
where is_del = '0' where is_del = '0'
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
fileArr: [], fileArr: [],
pipeList: [], pipeList: [],
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
......
...@@ -146,13 +146,13 @@ export default { ...@@ -146,13 +146,13 @@ export default {
} else { } else {
// 显示左侧联动菜单 // 显示左侧联动菜单
path = this.activeRoutes(key); path = this.activeRoutes(key);
console.log(path) console.log(path);
console.log(this.$route.path) console.log(this.$route.path);
if (this.$route.path != path[0].path) { if (this.$route.path != path[0].path) {
if(path[0].path){ if (path[0].path) {
this.$router.push(path[0].path); this.$router.push(path[0].path);
}else{ } else {
if(path[0].path=="" && this.$route.path=="/index") return; if (path[0].path == "" && this.$route.path == "/index") return;
this.$router.push("/index"); this.$router.push("/index");
} }
} }
...@@ -207,6 +207,22 @@ export default { ...@@ -207,6 +207,22 @@ export default {
font-weight: 600; font-weight: 600;
text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2); text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2);
padding: 0 5px; padding: 0 5px;
border-bottom: none;
position: relative;
&:after {
content: "";
position: absolute;
width: 2px;
height: 38px;
background: radial-gradient(
circle,
#ffffff 0%,
rgba(255, 255, 255, 0) 100%
);
right: -20px;
top: 21px;
opacity: 1;
}
} }
.el-menu--horizontal > .el-menu-item.is-active { .el-menu--horizontal > .el-menu-item.is-active {
...@@ -219,6 +235,7 @@ export default { ...@@ -219,6 +235,7 @@ export default {
.el-menu--horizontal > .el-submenu .el-submenu__title { .el-menu--horizontal > .el-submenu .el-submenu__title {
height: 50px !important; height: 50px !important;
line-height: 50px !important; line-height: 50px !important;
margin-left:15px;
} }
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus { .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus {
......
<template>
<el-dialog
title="拾取坐标"
:visible.sync="dialogTableVisible"
:show-close="false"
:close-on-click-modal="false"
>
<el-row class="lt">
经纬度:
<el-input
placeholder="经度"
v-model.number="lnglat.lng"
type="number"
></el-input>
<el-input
placeholder="纬度"
v-model.number="lnglat.lat"
type="number"
></el-input>
<el-button type="primary" size="small" @click="confirmFun">确定</el-button
>
<el-button size="small" @click="$emit('dialogcancelFun')">取消</el-button
>
</el-row>
<div style="width: 47vw; height: 57vh" id="container"></div>
<el-col :span="8" class="button">
<el-input id="ss" placeholder="输入地址" v-model="keyWorld" ></el-input><el-button size="small" type="primary" icon="el-icon-search" @click="search" style="position: fixed;margin-left: 3px;">搜索</el-button>
</el-col>
</el-dialog>
</template>
<script>
export default {
props: {
dialogTableVisible: false,
slat: 0,
slng: 0
},
data(){
return{
lnglat: {
lat: "",
lng: ""
},
keyWorld: ""
}
},
mounted(){
let that = this;
that.$nextTick(() => {
//初始化地图
let map = new AMap.Map("container", {
center: [114.72995, 38.37417],
// resizeEnable: true,
disableSocket: true,
viewMode: "3D",
showLabel: true,
pitch: 8,
zoom: 10
});
map.setFitView();
//坐标回显
if (typeof that.slng == "number" && that.slng != 0) {
that.lnglat.lng = that.slng;
that.lnglat.lat = that.slat;
let marker = new AMap.Marker({
position: [that.slng,that.slat]
});
marker.setMap(map);
map.setCenter([that.slng,that.slat]);
}
//点击获取坐标点
var mouseTool = new AMap.MouseTool(map);
//监听draw事件可获取画好的覆盖物
var overlays = [];
mouseTool.on('draw',function(e){
map.remove(overlays);
overlays.push(e.obj);
that.lnglat.lat = e.obj._position.lat;
that.lnglat.lng = e.obj._position.lng;
})
that.draw(mouseTool);
//搜索功能
AMap.plugin(["AMap.AutoComplete","AMap.PlaceSearch"], function() {
that.placeSearch = new AMap.PlaceSearch({
map: map
});
});
})
},
methods:{
confirmFun(){
this.$emit('confirmFun',this.lnglat);
this.$emit('dialogcancelFun');
},
draw(mouseTool){
mouseTool.marker({
//同Marker的Option设置
});
},
search(){
this.placeSearch.search(this.keyWorld); //关键字查询查询
}
}
}
</script>
<style scoped lang="scss">
.lt{
margin-bottom: 10px;
}
.lt .el-input {
width: 180px;
margin-right: 15px;
display: inline-block;
}
.button{
position: relative;
top: -393px;
left: 14px;
}
.button .el-input{
width: 180px;
margin-right: 10px;
display: inline-block;
}
</style>
...@@ -53,16 +53,30 @@ export const constantRoutes = [ ...@@ -53,16 +53,30 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/401'], resolve), component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true hidden: true
}, },
// {
// path: '',
// component: Layout,
// redirect: 'index',
// children: [
// {
// path: 'index',
// component: (resolve) => require(['@/views/index_v1'], resolve),
// name: '首页',
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
// }
// ]
// },
// 首页改成地图
{ {
path: '', path: '',
component: Layout, component: Layout,
redirect: 'index', redirect: '/enterprise/mapView',
children: [ children: [
{ {
path: 'index', path: '/enterprise/mapView',
component: (resolve) => require(['@/views/index_v1'], resolve), component: (resolve) => require(['@/views/enterprise/mapView'], resolve),
name: '首页', // name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } // meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
} }
] ]
}, },
......
...@@ -26,7 +26,8 @@ const permission = { ...@@ -26,7 +26,8 @@ const permission = {
path: 'index', path: 'index',
meta: { title: '统计报表', icon: 'dashboard'} meta: { title: '统计报表', icon: 'dashboard'}
}] }]
state.topbarRouters = routes.concat(index); // state.topbarRouters = routes.concat(index);
state.topbarRouters = routes;
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes; state.sidebarRouters = routes;
......
...@@ -51,6 +51,8 @@ class gaodeMap { ...@@ -51,6 +51,8 @@ class gaodeMap {
view = null; view = null;
handleInfoWindowOpenFunc = null; handleInfoWindowOpenFunc = null;
onceFlag = false;
//构造函数中设置中央点默认值 //构造函数中设置中央点默认值
constructor(center) { constructor(center) {
this.markers = []; this.markers = [];
...@@ -107,6 +109,16 @@ class gaodeMap { ...@@ -107,6 +109,16 @@ class gaodeMap {
this.handleInfoWindowOpenFunc(); this.handleInfoWindowOpenFunc();
this.handleInfoWindowOpenFunc = null; this.handleInfoWindowOpenFunc = null;
} }
// 刚进入页面的时候只调用一次,让左侧的抽屉在地图移动完之后显示
if (!this.onceFlag) {
this.onceFlag = true;
this.view.backFlag = false;
let options = this.myMap.getStatus();
options.scrollWheel = true;
this.myMap.setStatus(options);
}
}); });
this.districtBoundaries(); this.districtBoundaries();
} }
...@@ -237,9 +249,9 @@ class gaodeMap { ...@@ -237,9 +249,9 @@ class gaodeMap {
// // infoWindow.close(); // // infoWindow.close();
// that.workerManInfoWindow = infoWindow; // that.workerManInfoWindow = infoWindow;
// }); // });
marker.markerType=markerType; marker.markerType = markerType;
marker.data = data; marker.data = data;
marker.infoWindow =infoWindow; marker.infoWindow = infoWindow;
marker.on("mouseover", this.wokerManOpen); marker.on("mouseover", this.wokerManOpen);
marker.on("mousedown", e => { marker.on("mousedown", e => {
// console.log(data); // console.log(data);
...@@ -346,17 +358,17 @@ class gaodeMap { ...@@ -346,17 +358,17 @@ class gaodeMap {
return marker; return marker;
} }
wokerManOpen=(e)=> { wokerManOpen = e => {
this.markerType = e.target.markerType; this.markerType = e.target.markerType;
e.target.content = this.getMarketContent( e.target.data); e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content); e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition()); e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()",e.target.getExtData()) console.log("e.target.getPosition()", e.target.getExtData());
this.boxCollision(e.target.infoWindow.dom); this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow); // that.addCloneDome(e.target, infoWindow);
// infoWindow.close(); // infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow; this.workerManInfoWindow = e.target.infoWindow;
} };
// 鼠标移入设备时候实行的函数 // 鼠标移入设备时候实行的函数
infoOpen = e => { infoOpen = e => {
...@@ -724,7 +736,7 @@ class gaodeMap { ...@@ -724,7 +736,7 @@ class gaodeMap {
let path = coordinates ? eval(coordinates) : []; let path = coordinates ? eval(coordinates) : [];
let polyline = new AMap.Polyline({ let polyline = new AMap.Polyline({
path, path,
strokeColor: "#F7FE38", strokeColor: "#2EE7E7",
strokeWeight: 4, strokeWeight: 4,
strokeOpacity: 0.9, strokeOpacity: 0.9,
zIndex: 50, zIndex: 50,
...@@ -748,7 +760,7 @@ class gaodeMap { ...@@ -748,7 +760,7 @@ class gaodeMap {
polyline.on("mouseout", e => { polyline.on("mouseout", e => {
// console.log("polyline.getExtData().lineData.alarmState",polyline.getExtData().lineData.alarmState) // console.log("polyline.getExtData().lineData.alarmState",polyline.getExtData().lineData.alarmState)
if (polyline.getExtData().lineData.alarmState == 1) return; if (polyline.getExtData().lineData.alarmState == 1) return;
polyline.setOptions({ strokeColor: "#F7FE38" }); polyline.setOptions({ strokeColor: "#2EE7E7" });
// infoWindow.close(); // infoWindow.close();
}); });
// 计算info的位置 // 计算info的位置
...@@ -1107,7 +1119,7 @@ class gaodeMap { ...@@ -1107,7 +1119,7 @@ class gaodeMap {
opstions.isState = 0; opstions.isState = 0;
item.setExtData(opstions); item.setExtData(opstions);
let attr = item.getOptions(); let attr = item.getOptions();
attr.strokeColor = "#F7FE38"; attr.strokeColor = "#2EE7E7";
item.setOptions(attr); item.setOptions(attr);
}); });
} }
......
<template>
<div class="app-container detail" style="background-color: rgb(238, 241, 245);">
<div style="padding-top: 10px;background: #fff;height: 100%;">
<div style="width: 5%;height: 45px;margin-left: 20px;" @click="$router.go(-1)">
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112);float: left;"
>返回</el-button>
<div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
</div>
<div style="width: 100%;height: 440px;">
<el-divider></el-divider>
<div style="color: #31EAEA;width: 30%;height: 30px;">
<ul><li>详细信息</li></ul>
</div>
<div style="float: left;width: 50%;">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;width: 50%;margin-bottom: 25px;">
<el-form-item label="设备名称:" prop="deviceName">
<font>{{form.deviceName}}</font>
</el-form-item>
<el-form-item label="设备编号:" prop="deviceCode">
<font>{{form.deviceCode}}</font>
</el-form-item>
<el-form-item label="设备类型:" prop="deviceType">
<font v-if="form.deviceType == 1">调压阀</font>
<font v-if="form.deviceType == 2">阀门井</font>
<font v-if="form.deviceType == 3">流量计</font>
<font v-if="form.deviceType == 4">压力表</font>
</el-form-item>
<el-form-item label="设备型号:" prop="deviceModel">
<font>{{form.deviceModel}}</font>
</el-form-item>
<el-form-item label="物联网编号:" prop="iotNo" v-if="form.iotNo != null || form.iotNo != ''">
<font>{{form.iotNo}}</font>
</el-form-item>
<el-form-item label="联系人:" prop="linkman">
<font>{{form.linkman}}</font>
</el-form-item>
<el-form-item label="联系电话:" prop="phone">
<font>{{form.phone}}</font>
</el-form-item>
<el-form-item label="备注信息:" prop="remarks">
<font>{{form.remarks}}</font>
</el-form-item>
</el-form>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;width: 40%;">
<el-form-item label="所属管道:" prop="pipeName">
<font>{{form.pipeName}}</font>
</el-form-item>
<el-form-item label="所在地址:" prop="deviceAddr">
<font>{{form.deviceAddr}}</font>
</el-form-item>
<el-form-item label="经度:" prop="longitude">
<font>{{form.longitude}}</font>
</el-form-item>
<el-form-item label="经度:" prop="latitude">
<font>{{form.latitude}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installationTime">
<font>{{form.installationTime}}</font>
</el-form-item>
<el-form-item label="最后巡检时间:" prop="inspectionTime">
<font>{{form.inspectionTime}}</font>
</el-form-item>
<el-form-item label="设备图片:" prop="inspectionTime">
<el-image :src="form.iconUrl" :preview-src-list="[form.iconUrl]" style="width: 90px;"></el-image>
</el-form-item>
</el-form>
</div>
<div id="marbox" style="width: 700px;height: 400px;float: left;margin-top: -25px; border: 1px solid rgb(218, 213, 213);">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getDeviceInfo } from "@/api/device/deviceInfo";
import gaodeMap from "utils/gaodeMap.js";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
name: "DeviceInfoDetail",
components: {
},
data() {
return {
// 表单参数
form: { },
// 表单校验
rules: { }
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.deviceId = this.$route.query.deviceId;
this.getDetail();
},
mounted(){
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
},
methods: {
/** 获取巡检计划详情 */
getDetail (){
getDeviceInfo(this.deviceId).then(response =>{
this.form = response.data;
console.log("this.form",this.form)
this.gaoMap.resetMapCenter([this.form.longitude, this.form.latitude]);
this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
});
},
}
}
</script>
<style>
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 20px 0;
}
.feedbackTime-div{
float: left;margin-left: 150px;margin-top: 10px;
}
.feedbackTime{
height: 120px;
width: 120px;
float: left;
margin-left: 15px;
margin-top: 5px;
margin-bottom: 15px;
display: flex;
justify-content: center;
align-items: center;
}
.el-card__body {
padding: 5px 20px 20px 20px;
}
.detail .el-form{
width: 20%;
}
.detail .el-form-item{
margin-bottom: 0px;
}
.avatar-uploader{
width: 25%;
float: left;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
li{
font-size: 15px;
font-weight: 900;
}
</style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="管道名称" prop="pipeName"> <el-form-item label="管道名称" prop="pipeName">
<el-input <el-input
v-model="queryParams.pipeName" v-model="queryParams.pipeName"
...@@ -10,6 +10,15 @@ ...@@ -10,6 +10,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="管道编号" prop="pipeCode">
<el-input
v-model="queryParams.pipeCode"
placeholder="请输入管道编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="管道类型" prop="pipeType"> <el-form-item label="管道类型" prop="pipeType">
<el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" size="small"> <el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" size="small">
<el-option <el-option
...@@ -37,7 +46,7 @@ ...@@ -37,7 +46,7 @@
v-hasPermi="['device:pipe:add']" v-hasPermi="['device:pipe:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!--<el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
...@@ -69,16 +78,13 @@ ...@@ -69,16 +78,13 @@
@click="handleExport" @click="handleExport"
v-hasPermi="['device:pipe:export']" v-hasPermi="['device:pipe:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="pipeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="pipeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="管道名称" align="center" prop="pipeName" /> <el-table-column label="管道名称" align="center" prop="pipeName" />
<el-table-column label="所在地址" align="center" prop="pipeAddr" /> <el-table-column label="管道编号" align="center" prop="pipeCode" />
<el-table-column label="管道坐标" align="center" prop="coordinates" />
<el-table-column label="管道长度" align="center" prop="pipeLength" />
<el-table-column label="管道类型" align="center" prop="pipeType" > <el-table-column label="管道类型" align="center" prop="pipeType" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.pipeType == 1">地埋管线</span> <span v-if="scope.row.pipeType == 1">地埋管线</span>
...@@ -93,16 +99,10 @@ ...@@ -93,16 +99,10 @@
<span v-if="scope.row.pipePressure == 4">高压</span> <span v-if="scope.row.pipePressure == 4">高压</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="安装时间" align="center" prop="installationTime" width="180"> <el-table-column label="管道长度" align="center" prop="pipeLength" />
<template slot-scope="scope"> <el-table-column label="所在地址" align="center" prop="pipeAddr" />
<span>{{ parseTime(scope.row.installationTime)}}</span> <el-table-column label="安装时间" align="center" prop="installationTime" width="180" />
</template> <el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180" />
</el-table-column>
<el-table-column label="最后巡检时间" align="center" prop="inspectionTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectionTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -112,6 +112,12 @@ ...@@ -112,6 +112,12 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:pipe:edit']" v-hasPermi="['device:pipe:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -132,25 +138,10 @@ ...@@ -132,25 +138,10 @@
/> />
<!-- 添加或修改管道信息对话框 --> <!-- 添加或修改管道信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="850px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-form-item label="管道名称" prop="pipeName">
<el-input v-model="form.pipeName" placeholder="请输入管道名称" />
</el-form-item>
<el-form-item label="管道编号" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入管道编号" />
</el-form-item>
<el-form-item label="所在地址" prop="pipeAddr">
<el-input v-model="form.pipeAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="管道坐标" prop="coordinates">
<el-input v-model="form.coordinates" type="textarea" placeholder="请输入坐标" />
</el-form-item>
<el-form-item label="管道长度" prop="pipeLength">
<el-input v-model="form.pipeLength"placeholder="请输入管道长度" />
</el-form-item>
<el-form-item label="管道类型"> <el-form-item label="管道类型">
<el-select v-model="form.pipeType" placeholder="请选择管道类型"> <el-select v-model="form.pipeType" placeholder="请选择管道类型" style="width: 600px">
<el-option <el-option
v-for="dict in typeOptions" v-for="dict in typeOptions"
:key="dict.dictValue" :key="dict.dictValue"
...@@ -159,8 +150,14 @@ ...@@ -159,8 +150,14 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="管道名称" prop="pipeName">
<el-input v-model="form.pipeName" placeholder="请输入管道名称" style="width: 600px"/>
</el-form-item>
<el-form-item label="管道编号" prop="pipeCode">
<el-input v-model="form.pipeCode" placeholder="请输入管道编号" style="width: 600px" />
</el-form-item>
<el-form-item label="管道压力"> <el-form-item label="管道压力">
<el-select v-model="form.pipePressure" placeholder="请选择管道压力"> <el-select v-model="form.pipePressure" placeholder="请选择管道压力" style="width: 600px">
<el-option <el-option
v-for="dict in pressureOptions" v-for="dict in pressureOptions"
:key="dict.dictValue" :key="dict.dictValue"
...@@ -169,6 +166,20 @@ ...@@ -169,6 +166,20 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所在地址" prop="pipeAddr">
<el-input v-model="form.pipeAddr" placeholder="请输入所在地址" style="width: 600px" />
</el-form-item>
<el-form-item label="管道长度" prop="pipeLength">
<el-input v-model="form.pipeLength"placeholder="请输入管道长度" style="width: 600px" />
</el-form-item>
<el-form-item label="管道坐标" prop="coordinates">
<el-col :span="18">
<el-input v-model="form.coordinates" type="textarea" placeholder="请输入坐标" />
</el-col>
<el-col :span="5">
<el-button type="primary" plain @click="MapdialogFun">选择坐标</el-button>
</el-col>
</el-form-item>
<el-form-item label="设备图片上传" prop="iconUrl"> <el-form-item label="设备图片上传" prop="iconUrl">
<MyFileUpload <MyFileUpload
listType="picture-card" listType="picture-card"
...@@ -186,7 +197,7 @@ ...@@ -186,7 +197,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" /> <el-input v-model="form.remarks" placeholder="请输入备注" style="width: 600px" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -305,6 +316,7 @@ export default { ...@@ -305,6 +316,7 @@ export default {
inspectionTime: null, inspectionTime: null,
remarks: null remarks: null
}; };
this.fileList = [];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -366,17 +378,23 @@ export default { ...@@ -366,17 +378,23 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const pipeIds = row.pipeId || this.ids; row.isDel = "1";
this.$confirm('是否确认删除管道信息编号为"' + pipeIds + '"的数据项?', "警告", { var devices = " ";
for(var i = 0; i < row.deviceInfoList.length; i++){
var obj = row.deviceInfoList[i];
devices = devices + obj.deviceName + " ";
}
this.$confirm('请确认是否删除管道名称为"' + row.pipeName + '"的数据项,该管道下包含的设备(' + devices + ')将一并被删除', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function () {
return delPipe(pipeIds); return updatePipe(row);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("已删除");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
...@@ -392,7 +410,16 @@ export default { ...@@ -392,7 +410,16 @@ export default {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
},
/** 详细信息跳转 */
showDetail(row) {
this.$router.push({
path: '/device/pipeDetail',
query: {
pipeId: row.pipeId
} }
})
},
} }
}; };
</script> </script>
<template>
<div class="app-container detail" style="background-color: rgb(238, 241, 245);">
<div style="padding-top: 10px;background: #fff;height: 100%;">
<div style="width: 5%;height: 45px;margin-left: 20px;" @click="$router.go(-1)">
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112);float: left;"
>返回</el-button>
<div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
</div>
<div style="width: 100%;height: 440px;">
<el-divider></el-divider>
<div style="color: #31EAEA;width: 30%;height: 30px;">
<ul><li>详细信息</li></ul>
</div>
<div style="float: left;width: 50%;">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;width: 50%;margin-bottom: 25px;">
<el-form-item label="管道名称:" prop="pipeName">
<font>{{form.pipeName}}</font>
</el-form-item>
<el-form-item label="管道编号:" prop="pipeCode">
<font>{{form.pipeCode}}</font>
</el-form-item>
<el-form-item label="管道类型:" prop="pipeType">
<font v-if="form.pipeType == 1">地埋管线</font>
<font v-if="form.pipeType == 2">地表管线</font>
</el-form-item>
<el-form-item label="管道压力:" prop="pipePressure">
<font v-if="form.pipePressure == 1">低压</font>
<font v-if="form.pipePressure == 2">中压</font>
<font v-if="form.pipePressure == 3">次高压</font>
<font v-if="form.pipePressure == 4">高压</font>
</el-form-item>
<el-form-item label="管道长度:" prop="pipeLength">
<font>{{form.pipeLength}}</font>
</el-form-item>
<el-form-item label="备注信息:" prop="remarks">
<font>{{form.remarks}}</font>
</el-form-item>
</el-form>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;width: 40%;">
<el-form-item label="管道地址:" prop="pipeAddr">
<font>{{form.pipeAddr}}</font>
</el-form-item>
<el-form-item label="安装时间:" prop="installationTime">
<font>{{form.installationTime}}</font>
</el-form-item>
<el-form-item label="最后巡检时间:" prop="inspectionTime">
<font>{{form.inspectionTime}}</font>
</el-form-item>
<el-form-item label="管道图片:" prop="inspectionTime">
<el-image :src="form.iconUrl" :preview-src-list="[form.iconUrl]" style="width: 90px;"></el-image>
</el-form-item>
</el-form>
</div>
<div id="marbox" style="width: 700px;height: 400px;float: left;margin-top: -25px; border: 1px solid rgb(218, 213, 213);">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import { getPipe } from "@/api/device/pipe";
import gaodeMap from "utils/gaodeMap.js";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
name: "PipeDetail",
components: {
},
data() {
return {
// 表单参数
form: { },
// 表单校验
rules: { }
};
},
created() {
// 如果是跳转来的,则接受初始化参数
this.pipeId = this.$route.query.pipeId;
this.getDetail();
},
mounted(){
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
},
methods: {
/** 获取巡检计划详情 */
getDetail (){
getPipe(this.pipeId).then(response =>{
this.form = response.data;
console.log("this.form",this.form)
this.gaoMap.resetMapCenter([this.form.longitude, this.form.latitude]);
this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
});
},
}
}
</script>
<style>
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 20px 0;
}
.feedbackTime-div{
float: left;margin-left: 150px;margin-top: 10px;
}
.feedbackTime{
height: 120px;
width: 120px;
float: left;
margin-left: 15px;
margin-top: 5px;
margin-bottom: 15px;
display: flex;
justify-content: center;
align-items: center;
}
.el-card__body {
padding: 5px 20px 20px 20px;
}
.detail .el-form{
width: 20%;
}
.detail .el-form-item{
margin-bottom: 0px;
}
.avatar-uploader{
width: 25%;
float: left;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
li{
font-size: 15px;
font-weight: 900;
}
</style>
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
// 右下角数据 跟值班人员 // 右下角数据 跟值班人员
this.rightBottomData(); this.rightBottomData();
this.backFlag = false; // this.backFlag = false;
}, },
// 获取地图上的资源 // 获取地图上的资源
...@@ -492,7 +492,7 @@ export default { ...@@ -492,7 +492,7 @@ export default {
options.lineData.alarmId = alarmId; options.lineData.alarmId = alarmId;
options.lineData.orderId = orderId; options.lineData.orderId = orderId;
if (endTime) { if (endTime) {
polyline.setOptions({ strokeColor: "#F7FE38" }); polyline.setOptions({ strokeColor: "#2EE7E7" });
options.lineData.alarmState = 0; options.lineData.alarmState = 0;
// 报警类型 // 报警类型
options.lineData.alarmType = null; options.lineData.alarmType = null;
...@@ -514,6 +514,7 @@ export default { ...@@ -514,6 +514,7 @@ export default {
}); });
} }
console.log("deviceArr", deviceArr);
// 其他设备 // 其他设备
if (deviceArr.length > 0) { if (deviceArr.length > 0) {
deviceArr.forEach((item) => { deviceArr.forEach((item) => {
...@@ -591,8 +592,7 @@ export default { ...@@ -591,8 +592,7 @@ export default {
// "ws://192.168.2.23:8903/gassafety/websocketServer" // "ws://192.168.2.23:8903/gassafety/websocketServer"
// ); // );
this.ws.onopen = (evt) => { this.ws.onopen = (evt) => {
console.log("WebSockets=======gogogog"); console.log("WebSockets开启");
// this.ws.send("WebSockets!=========================");
}; };
this.ws.onmessage = (evt) => { this.ws.onmessage = (evt) => {
console.log("推送", evt); console.log("推送", evt);
...@@ -604,9 +604,6 @@ export default { ...@@ -604,9 +604,6 @@ export default {
this.ws.onclose = () => { this.ws.onclose = () => {
console.log("ws协议关闭"); console.log("ws协议关闭");
}; };
// this.ws.onclose = function (evt) {
// console.log("关闭");
// };
}, },
// 右下角数据 // 右下角数据
...@@ -914,7 +911,7 @@ export default { ...@@ -914,7 +911,7 @@ export default {
no: index, no: index,
userId: item.userId, userId: item.userId,
userName: item.userName, userName: item.userName,
userPhone: item.phone, userPhone: item.phonenumber,
}; };
}); });
console.log("值班人员", workManArr); console.log("值班人员", workManArr);
...@@ -937,11 +934,10 @@ export default { ...@@ -937,11 +934,10 @@ export default {
); );
}); });
item.maxPage = Math.ceil(this.allList[index].length / num); item.maxPage = Math.ceil(this.allList[index].length / num);
}else{ } else {
// 如果为空,就直接把item.list写成[]; // 如果为空,就直接把item.list写成[];
item.list=[]; item.list = [];
} }
}); });
}, },
pageBack(item) { pageBack(item) {
...@@ -1099,8 +1095,9 @@ export default { ...@@ -1099,8 +1095,9 @@ export default {
// 清空左边列表 // 清空左边列表
// this.changeBtnDataClear(); // this.changeBtnDataClear();
// this.gaoMap.placeSearch.search(this.keyWord); // this.gaoMap.placeSearch.search(this.keyWord);
await this.getDeviceInfo({ deviceName: this.keyWord }); this.gaoMap.markers = [];
this.gaoMap.polyLines = []; this.gaoMap.polyLines = [];
await this.getDeviceInfo({ deviceName: this.keyWord });
await this.getPipeList({ pipeName: this.keyWord }); await this.getPipeList({ pipeName: this.keyWord });
// 值班人员 // 值班人员
await this.getInspectorLocations({ userName: this.keyWord }); await this.getInspectorLocations({ userName: this.keyWord });
...@@ -1108,8 +1105,6 @@ export default { ...@@ -1108,8 +1105,6 @@ export default {
// 设备报警 // 设备报警
this.getSelectAlarmDevice(); this.getSelectAlarmDevice();
this.pipeList(); this.pipeList();
console.log(this.changeBtnData);
console.log(this.allList)
} }
}, },
// 清空左边列表 // 清空左边列表
...@@ -1190,6 +1185,7 @@ export default { ...@@ -1190,6 +1185,7 @@ export default {
window.removeEventListener("mousedown", this.barClose); window.removeEventListener("mousedown", this.barClose);
// 关闭scoket // 关闭scoket
if (this.ws) { if (this.ws) {
console.log("socket关闭了");
this.ws.close(); this.ws.close();
this.ws = null; this.ws = null;
} }
...@@ -1205,7 +1201,6 @@ export default { ...@@ -1205,7 +1201,6 @@ export default {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
} }
.btn-wrapper { .btn-wrapper {
position: fixed; position: fixed;
right: 32px; right: 32px;
......
<template>
<div class="dashboard-editor-container">
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import PanelGroup from '../../dashboard/PanelGroup'
import LineChart from '../../dashboard/LineChart'
import RaddarChart from '../../dashboard/RaddarChart'
import PieChart from '../../dashboard/PieChart'
import BarChart from '../../dashboard/BarChart'
//报表
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
export default {
name: 'Index',
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
</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