Commit 2157333f authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 1f7a0a80 5a70583d
package com.zehong.web.controller.operationMonitor;
import java.util.List;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
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.TDetectorReportData;
import com.zehong.system.service.ITDetectorReportDataService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 燃气用户设备上报的数据Controller
*
* @author zehong
* @date 2022-03-04
*/
@RestController
@RequestMapping("/detector/detectorReportData")
public class TDetectorReportDataController extends BaseController
{
@Autowired
private ITDetectorReportDataService tDetectorReportDataService;
/**
* 查询燃气用户设备上报的数据列表
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:list')")
@GetMapping("/list")
public TableDataInfo list(TDetectorReportDataQueryForm tDetectorReportDataQueryForm)
{
startPage();
List<TDetectorReportData> list = tDetectorReportDataService.selectTDetectorReportDataList(tDetectorReportDataQueryForm);
return getDataTable(list);
}
/**
* 导出燃气用户设备上报的数据列表
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:export')")
@Log(title = "燃气用户设备上报的数据", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDetectorReportDataQueryForm tDetectorReportDataQueryForm)
{
List<TDetectorReportData> list = tDetectorReportDataService.selectTDetectorReportDataList(tDetectorReportDataQueryForm);
ExcelUtil<TDetectorReportData> util = new ExcelUtil<TDetectorReportData>(TDetectorReportData.class);
return util.exportExcel(list, "燃气用户设备上报的数据数据");
}
/**
* 获取燃气用户设备上报的数据详细信息
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tDetectorReportDataService.selectTDetectorReportDataById(id));
}
/**
* 新增燃气用户设备上报的数据
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:add')")
@Log(title = "燃气用户设备上报的数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TDetectorReportData tDetectorReportData)
{
return toAjax(tDetectorReportDataService.insertTDetectorReportData(tDetectorReportData));
}
/**
* 修改燃气用户设备上报的数据
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:edit')")
@Log(title = "燃气用户设备上报的数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDetectorReportData tDetectorReportData)
{
return toAjax(tDetectorReportDataService.updateTDetectorReportData(tDetectorReportData));
}
/**
* 删除燃气用户设备上报的数据
*/
@PreAuthorize("@ss.hasPermi('detector:detectorReportData:remove')")
@Log(title = "燃气用户设备上报的数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tDetectorReportDataService.deleteTDetectorReportDataByIds(ids));
}
}
...@@ -152,4 +152,16 @@ public class TDetectorInfoController extends BaseController ...@@ -152,4 +152,16 @@ public class TDetectorInfoController extends BaseController
return AjaxResult.success(map); return AjaxResult.success(map);
} }
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@GetMapping("/selectDetectorMointor")
public TableDataInfo selectDetectorMointor(TDetectorInfo tDetectorInfo){
startPage();
List<TDetectorInfo> list = tDetectorInfoService.selectDetectorMointor(tDetectorInfo);
return getDataTable(list);
}
} }
package com.zehong.web.controller.supervise; package com.zehong.web.controller.supervise;
import java.io.File;
import java.text.ParseException; import java.text.ParseException;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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.annotation.Log;
import com.zehong.common.core.controller.BaseController; import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult; import com.zehong.common.core.domain.AjaxResult;
...@@ -19,6 +16,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo; ...@@ -19,6 +16,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo;
import com.zehong.system.service.ITEmployedPeopleInfoService; import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo; import com.zehong.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 从业人员信息Controller * 从业人员信息Controller
...@@ -74,7 +72,7 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -74,7 +72,7 @@ public class TEmployedPeopleInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('regulation:supervise:add')") @PreAuthorize("@ss.hasPermi('regulation:supervise:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT) @Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException { public AjaxResult add( TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
//根据企业id查询企业名称 //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName); tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
...@@ -114,4 +112,41 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -114,4 +112,41 @@ public class TEmployedPeopleInfoController extends BaseController
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise()); return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise());
} }
/**
* 图片上传接口
* @param file
* @return
*/
@ResponseBody
@RequestMapping("/addParent")
public String upFile(@RequestParam("file") MultipartFile file) {
String path = "D:\\img";
String fileName = file.getOriginalFilename();//获取文件名称
String suffixName=fileName.substring(fileName.lastIndexOf("."));//获取文件后缀
//uuid+文件名
fileName= UUID.randomUUID().toString().replace("-", "").toLowerCase()+suffixName;//重新生成文件名
System.out.println(fileName);
System.out.println("type::" + suffixName);
System.out.println("filename::" + fileName);
File targetFile = new File(path);
if (!targetFile.exists()) {
// 判断文件夹是否未空,空则创建
targetFile.mkdirs();
}
File saveFile = new File(targetFile, fileName);
try {
//指定本地存入路径
file.transferTo(saveFile);
System.out.println("执行成功");
String path1 = path + fileName;
//图片存储地址
System.out.println(path1);
return path1;
} catch (Exception e) {
e.printStackTrace();
System.out.println("执行失败");
return "failed";
}
}
} }
...@@ -30,6 +30,9 @@ public class DeviceData { ...@@ -30,6 +30,9 @@ public class DeviceData {
private int iconType; private int iconType;
//下级设备数据封装类数组
private List<SubordinateEquipmentList> subordinateEquipmentList;
//压力表设备数量 //压力表设备数量
private int numberPressureGauges; private int numberPressureGauges;
...@@ -66,6 +69,80 @@ public class DeviceData { ...@@ -66,6 +69,80 @@ public class DeviceData {
//流量计报警中 //流量计报警中
private int numberInAlarm; private int numberInAlarm;
//探测器设备数量
private int detectorEquipment;
//探测器在线设备
private int detectorOnlineEquipment;
//探测器离线设备
private int detectorOfflineEquipment;
//探测器历史报警
private int detectorHistoricalAlarm;
//探测器已处理报警
private int detectorAlarmProcessed;
//探测器报警中
private int detectorInAlarm;
public List<SubordinateEquipmentList> getSubordinateEquipmentList() {
return subordinateEquipmentList;
}
public void setSubordinateEquipmentList(List<SubordinateEquipmentList> subordinateEquipmentList) {
this.subordinateEquipmentList = subordinateEquipmentList;
}
public int getDetectorEquipment() {
return detectorEquipment;
}
public void setDetectorEquipment(int detectorEquipment) {
this.detectorEquipment = detectorEquipment;
}
public int getDetectorOnlineEquipment() {
return detectorOnlineEquipment;
}
public void setDetectorOnlineEquipment(int detectorOnlineEquipment) {
this.detectorOnlineEquipment = detectorOnlineEquipment;
}
public int getDetectorOfflineEquipment() {
return detectorOfflineEquipment;
}
public void setDetectorOfflineEquipment(int detectorOfflineEquipment) {
this.detectorOfflineEquipment = detectorOfflineEquipment;
}
public int getDetectorHistoricalAlarm() {
return detectorHistoricalAlarm;
}
public void setDetectorHistoricalAlarm(int detectorHistoricalAlarm) {
this.detectorHistoricalAlarm = detectorHistoricalAlarm;
}
public int getDetectorAlarmProcessed() {
return detectorAlarmProcessed;
}
public void setDetectorAlarmProcessed(int detectorAlarmProcessed) {
this.detectorAlarmProcessed = detectorAlarmProcessed;
}
public int getDetectorInAlarm() {
return detectorInAlarm;
}
public void setDetectorInAlarm(int detectorInAlarm) {
this.detectorInAlarm = detectorInAlarm;
}
public int getNumberPressureGauges() { public int getNumberPressureGauges() {
return numberPressureGauges; return numberPressureGauges;
...@@ -259,7 +336,6 @@ public class DeviceData { ...@@ -259,7 +336,6 @@ public class DeviceData {
this.pressureFlows = pressureFlows; this.pressureFlows = pressureFlows;
} }
@Override @Override
public String toString() { public String toString() {
return "DeviceData{" + return "DeviceData{" +
...@@ -275,6 +351,7 @@ public class DeviceData { ...@@ -275,6 +351,7 @@ public class DeviceData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' + ", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", iconType=" + iconType + ", iconType=" + iconType +
", subordinateEquipmentList=" + subordinateEquipmentList +
", numberPressureGauges=" + numberPressureGauges + ", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment + ", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment + ", offlineEquipment=" + offlineEquipment +
...@@ -287,6 +364,12 @@ public class DeviceData { ...@@ -287,6 +364,12 @@ public class DeviceData {
", numberHistoricalAlarm=" + numberHistoricalAlarm + ", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed + ", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm + ", numberInAlarm=" + numberInAlarm +
", detectorEquipment=" + detectorEquipment +
", detectorOnlineEquipment=" + detectorOnlineEquipment +
", detectorOfflineEquipment=" + detectorOfflineEquipment +
", detectorHistoricalAlarm=" + detectorHistoricalAlarm +
", detectorAlarmProcessed=" + detectorAlarmProcessed +
", detectorInAlarm=" + detectorInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.domain; package com.zehong.system.domain;
import java.util.List; import java.util.List;
public class DeviceList { public class DeviceList {
......
...@@ -14,6 +14,16 @@ public class PressureFlow { ...@@ -14,6 +14,16 @@ public class PressureFlow {
private String deviceId; private String deviceId;
private String iotNo;
public String getIotNo() {
return iotNo;
}
public void setIotNo(String iotNo) {
this.iotNo = iotNo;
}
public String getDeviceId() { public String getDeviceId() {
return deviceId; return deviceId;
} }
...@@ -71,6 +81,7 @@ public class PressureFlow { ...@@ -71,6 +81,7 @@ public class PressureFlow {
", deviceNum='" + deviceNum + '\'' + ", deviceNum='" + deviceNum + '\'' +
", reportTime='" + reportTime + '\'' + ", reportTime='" + reportTime + '\'' +
", deviceId='" + deviceId + '\'' + ", deviceId='" + deviceId + '\'' +
", iotNo='" + iotNo + '\'' +
'}'; '}';
} }
} }
package com.zehong.system.domain;
/**
* 首页- 调压箱/阀门井 列表数据封装类
*/
public class PressureFlowList {
//设备编号
private String iotNo;
//设备名称
private String deviceName;
//探测介质
private String detectionMedium;
//联系人
private String linkman;
//联系电话
private String phone;
//设备状态 0正常 1掉线
private String detectorStatus;
public String getIotNo() {
return iotNo;
}
public void setIotNo(String iotNo) {
this.iotNo = iotNo;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDetectionMedium() {
return detectionMedium;
}
public void setDetectionMedium(String detectionMedium) {
this.detectionMedium = detectionMedium;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getDetectorStatus() {
return detectorStatus;
}
public void setDetectorStatus(String detectorStatus) {
this.detectorStatus = detectorStatus;
}
@Override
public String toString() {
return "PressureFlowList{" +
"iotNo='" + iotNo + '\'' +
", deviceName='" + deviceName + '\'' +
", detectionMedium='" + detectionMedium + '\'' +
", linkman='" + linkman + '\'' +
", phone='" + phone + '\'' +
", detectorStatus='" + detectorStatus + '\'' +
'}';
}
}
package com.zehong.system.domain;
/**
* 首页下级设备数据封装类
*/
public class SubordinateEquipmentList {
//设备数量
private int numberPressureGauges;
//在线设备
private int onlineEquipment;
//离线设备
private int offlineEquipment;
//历史报警
private int historicalAlarm;
//已处理报警
private int alarmProcessed;
//报警中
private int inAlarm;
//类型 1压力表 2流量计 3探测器
private int dataType;
public int getDataType() {
return dataType;
}
public void setDataType(int dataType) {
this.dataType = dataType;
}
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
@Override
public String toString() {
return "SubordinateEquipmentList{" +
"numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", dataType=" + dataType +
'}';
}
}
...@@ -84,6 +84,28 @@ public class TDetectorInfo extends BaseEntity ...@@ -84,6 +84,28 @@ public class TDetectorInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
/**所属设备名称*/
private String beyondDevicename;
public String getBeyondDevicename() {
return beyondDevicename;
}
public void setBeyondDevicename(String beyondDevicename) {
this.beyondDevicename = beyondDevicename;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
/**所属企业名称*/
private String enterpriseName;
public void setDetectorId(Long detectorId) public void setDetectorId(Long detectorId)
{ {
this.detectorId = detectorId; this.detectorId = detectorId;
......
...@@ -27,7 +27,7 @@ public class TDeviceInfoS extends BaseEntity { ...@@ -27,7 +27,7 @@ public class TDeviceInfoS extends BaseEntity {
private String deviceModel; private String deviceModel;
/** /**
* 设备类型:1.压力表 2.流量计 * 设备类型:1.压力表 2.流量计 3.探测器
*/ */
private String deviceType; private String deviceType;
...@@ -41,6 +41,19 @@ public class TDeviceInfoS extends BaseEntity { ...@@ -41,6 +41,19 @@ public class TDeviceInfoS extends BaseEntity {
*/ */
private String remarksn; private String remarksn;
/**
* 探测介质
*/
private String detectionMedium;
public String getDetectionMedium() {
return detectionMedium;
}
public void setDetectionMedium(String detectionMedium) {
this.detectionMedium = detectionMedium;
}
public Integer getRelationDeviceDetailId() { public Integer getRelationDeviceDetailId() {
return relationDeviceDetailId; return relationDeviceDetailId;
...@@ -105,9 +118,10 @@ public class TDeviceInfoS extends BaseEntity { ...@@ -105,9 +118,10 @@ public class TDeviceInfoS extends BaseEntity {
", relationDeviceId=" + relationDeviceId + ", relationDeviceId=" + relationDeviceId +
", deviceName='" + deviceName + '\'' + ", deviceName='" + deviceName + '\'' +
", deviceModel='" + deviceModel + '\'' + ", deviceModel='" + deviceModel + '\'' +
", deviceType=" + deviceType + ", deviceType='" + deviceType + '\'' +
", iotNo='" + iotNo + '\'' + ", iotNo='" + iotNo + '\'' +
", remarksn='" + remarksn + '\'' + ", remarksn='" + remarksn + '\'' +
", detectionMedium='" + detectionMedium + '\'' +
'}'; '}';
} }
} }
...@@ -90,6 +90,26 @@ public class TDeviceReportData extends BaseEntity ...@@ -90,6 +90,26 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
private String beyondDeviceName;
private String deviceType;
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getBeyondDeviceName() {
return beyondDeviceName;
}
public void setBeyondDeviceName(String beyondDeviceName) {
this.beyondDeviceName = beyondDeviceName;
}
public void setDeviceReportDataId(Long deviceReportDataId) public void setDeviceReportDataId(Long deviceReportDataId)
{ {
this.deviceReportDataId = deviceReportDataId; this.deviceReportDataId = deviceReportDataId;
......
...@@ -25,6 +25,9 @@ public class TSiteStationInfoData { ...@@ -25,6 +25,9 @@ public class TSiteStationInfoData {
//流量计数组 //流量计数组
private List<PressureFlow> pressureFlows; private List<PressureFlow> pressureFlows;
//下级设备数据封装类数组
private List<SubordinateEquipmentList> subordinateEquipmentList;
private int iconType; private int iconType;
private String companyType; private String companyType;
...@@ -65,6 +68,79 @@ public class TSiteStationInfoData { ...@@ -65,6 +68,79 @@ public class TSiteStationInfoData {
//流量计报警中 //流量计报警中
private int numberInAlarm; private int numberInAlarm;
//探测器设备数量
private int detectorEquipment;
//探测器在线设备
private int detectorOnlineEquipment;
//探测器离线设备
private int detectorOfflineEquipment;
//探测器历史报警
private int detectorHistoricalAlarm;
//探测器已处理报警
private int detectorAlarmProcessed;
//探测器报警中
private int detectorInAlarm;
public List<SubordinateEquipmentList> getSubordinateEquipmentList() {
return subordinateEquipmentList;
}
public void setSubordinateEquipmentList(List<SubordinateEquipmentList> subordinateEquipmentList) {
this.subordinateEquipmentList = subordinateEquipmentList;
}
public int getDetectorEquipment() {
return detectorEquipment;
}
public void setDetectorEquipment(int detectorEquipment) {
this.detectorEquipment = detectorEquipment;
}
public int getDetectorOnlineEquipment() {
return detectorOnlineEquipment;
}
public void setDetectorOnlineEquipment(int detectorOnlineEquipment) {
this.detectorOnlineEquipment = detectorOnlineEquipment;
}
public int getDetectorOfflineEquipment() {
return detectorOfflineEquipment;
}
public void setDetectorOfflineEquipment(int detectorOfflineEquipment) {
this.detectorOfflineEquipment = detectorOfflineEquipment;
}
public int getDetectorHistoricalAlarm() {
return detectorHistoricalAlarm;
}
public void setDetectorHistoricalAlarm(int detectorHistoricalAlarm) {
this.detectorHistoricalAlarm = detectorHistoricalAlarm;
}
public int getDetectorAlarmProcessed() {
return detectorAlarmProcessed;
}
public void setDetectorAlarmProcessed(int detectorAlarmProcessed) {
this.detectorAlarmProcessed = detectorAlarmProcessed;
}
public int getDetectorInAlarm() {
return detectorInAlarm;
}
public void setDetectorInAlarm(int detectorInAlarm) {
this.detectorInAlarm = detectorInAlarm;
}
public int getNumberOnlineEquipment() { public int getNumberOnlineEquipment() {
return numberOnlineEquipment; return numberOnlineEquipment;
...@@ -282,6 +358,7 @@ public class TSiteStationInfoData { ...@@ -282,6 +358,7 @@ public class TSiteStationInfoData {
", buildCompany='" + buildCompany + '\'' + ", buildCompany='" + buildCompany + '\'' +
", powerCompany='" + powerCompany + '\'' + ", powerCompany='" + powerCompany + '\'' +
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", subordinateEquipmentList=" + subordinateEquipmentList +
", iconType=" + iconType + ", iconType=" + iconType +
", companyType='" + companyType + '\'' + ", companyType='" + companyType + '\'' +
", numberPressureGauges=" + numberPressureGauges + ", numberPressureGauges=" + numberPressureGauges +
...@@ -296,6 +373,12 @@ public class TSiteStationInfoData { ...@@ -296,6 +373,12 @@ public class TSiteStationInfoData {
", numberHistoricalAlarm=" + numberHistoricalAlarm + ", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed + ", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm + ", numberInAlarm=" + numberInAlarm +
", detectorEquipment=" + detectorEquipment +
", detectorOnlineEquipment=" + detectorOnlineEquipment +
", detectorOfflineEquipment=" + detectorOfflineEquipment +
", detectorHistoricalAlarm=" + detectorHistoricalAlarm +
", detectorAlarmProcessed=" + detectorAlarmProcessed +
", detectorInAlarm=" + detectorInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class TDetectorReportDataQueryForm
{
//设备编号
private String detectorCode;
//状态名称
private String statusName;
//是否销警
private String isCancelAlarm;
/** 发现起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTimeStart;
/** 发现截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTimeEnd;
/** 发现起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cancelTimeStart;
/** 发现截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cancelTimeEnd;
}
package com.zehong.system.domain.vo; package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -9,7 +10,7 @@ import java.util.Date; ...@@ -9,7 +10,7 @@ import java.util.Date;
* @author zhangzhizhong * @author zhangzhizhong
* *
*/ */
@Data
public class TDetectorAlarmInfoVO { public class TDetectorAlarmInfoVO {
// 设备编号 // 设备编号
...@@ -25,49 +26,8 @@ public class TDetectorAlarmInfoVO { ...@@ -25,49 +26,8 @@ public class TDetectorAlarmInfoVO {
private Date alarmTime; private Date alarmTime;
// 处理状态 // 处理状态
private String handledStatus; private String handledStatus;
// 销警时间
public String getDetectorCode() { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
return detectorCode; private Date cancelTime;
}
public void setDetectorCode(String detectorCode) {
this.detectorCode = detectorCode;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getDetectorType() {
return detectorType;
}
public void setDetectorType(String detectorType) {
this.detectorType = detectorType;
}
public String getStatusName() {
return statusName;
}
public void setStatusName(String statusName) {
this.statusName = statusName;
}
public Date getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Date alarmTime) {
this.alarmTime = alarmTime;
}
public String getHandledStatus() {
return handledStatus;
}
public void setHandledStatus(String handledStatus) {
this.handledStatus = handledStatus;
}
} }
package com.zehong.system.mapper; package com.zehong.system.mapper;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -72,4 +73,32 @@ public interface PipeInterfaceMapper { ...@@ -72,4 +73,32 @@ public interface PipeInterfaceMapper {
* @return * @return
*/ */
List<DeviceData> selectvalveData(); List<DeviceData> selectvalveData();
/**
* 查询下级在线设备数量
* @param pressureList
* @return
*/
int selectOnlineQuantity(@Param("pressureList")List<PressureFlow> pressureList,@Param("isOnLine")int isOnLine);
/**
* 查询历史报警数量
* @param pressureList
* @return
*/
int selectHistoricalAlarm(List<PressureFlow> pressureList);
/**
* 查询已处理报警
* @param pressureList
* @return
*/
int selectProcessAlarm(List<PressureFlow> pressureList);
/**
* 查询报警中
* @param pressureList
* @return
*/
int selectInAlarm(List<PressureFlow> pressureList);
} }
...@@ -79,4 +79,11 @@ public interface TDetectorInfoMapper ...@@ -79,4 +79,11 @@ public interface TDetectorInfoMapper
* @return * @return
*/ */
public Map<String,Object> selectDetectorNum(@Param("enterpriseIds")String[] enterpriseIds); public Map<String,Object> selectDetectorNum(@Param("enterpriseIds")String[] enterpriseIds);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
} }
...@@ -2,6 +2,7 @@ package com.zehong.system.mapper; ...@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import com.zehong.system.domain.TDetectorInfo; import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData; import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO; import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import java.util.List; import java.util.List;
...@@ -34,10 +35,10 @@ public interface TDetectorReportDataMapper ...@@ -34,10 +35,10 @@ public interface TDetectorReportDataMapper
/** /**
* 查询设备上报的数据列表 * 查询设备上报的数据列表
* *
* @param tDetectorReportData 设备上报的数据 * @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据集合 * @return 设备上报的数据集合
*/ */
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportData tDetectorReportData); public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/** /**
* 新增设备上报的数据 * 新增设备上报的数据
......
package com.zehong.system.service; package com.zehong.system.service;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -69,4 +70,32 @@ public interface IPipeInterfaceService { ...@@ -69,4 +70,32 @@ public interface IPipeInterfaceService {
* @return * @return
*/ */
List<DeviceData> selectvalveData(); List<DeviceData> selectvalveData();
/**
* 查询下级在线设备数量
* @param pressureList
* @return
*/
int selectOnlineQuantity(List<PressureFlow> pressureList,@Param("isOnLine") int isOnLine);
/**
* 查询历史报警数量
* @param pressureList
* @return
*/
int selectHistoricalAlarm(List<PressureFlow> pressureList);
/**
* 查询已处理报警
* @param pressureList
* @return
*/
int selectProcessAlarm(List<PressureFlow> pressureList);
/**
* 查询报警中
* @param pressureList
* @return
*/
int selectInAlarm(List<PressureFlow> pressureList);
} }
...@@ -86,4 +86,11 @@ public interface ITDetectorInfoService ...@@ -86,4 +86,11 @@ public interface ITDetectorInfoService
* @return * @return
*/ */
public Map<String,Object> selectDetectorNum(String enterpriseId); public Map<String,Object> selectDetectorNum(String enterpriseId);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
} }
...@@ -3,6 +3,7 @@ package com.zehong.system.service; ...@@ -3,6 +3,7 @@ package com.zehong.system.service;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.zehong.system.domain.TDetectorInfo; import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData; import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO; import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import java.util.List; import java.util.List;
...@@ -35,18 +36,18 @@ public interface ITDetectorReportDataService ...@@ -35,18 +36,18 @@ public interface ITDetectorReportDataService
/** /**
* 查询设备上报的数据列表 * 查询设备上报的数据列表
* *
* @param tDetectorReportData 设备上报的数据 * @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据集合 * @return 设备上报的数据集合
*/ */
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportData tDetectorReportData); public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/** /**
* 查询设备上报的数据分页列表 * 查询设备上报的数据分页列表
* *
* @param tDetectorReportData 设备上报的数据 * @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据分页集合 * @return 设备上报的数据分页集合
*/ */
public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportData tDetectorReportData); public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/** /**
* 新增设备上报的数据 * 新增设备上报的数据
......
...@@ -2,6 +2,7 @@ package com.zehong.system.service.impl; ...@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.mapper.PipeInterfaceMapper; import com.zehong.system.mapper.PipeInterfaceMapper;
import com.zehong.system.service.IPipeInterfaceService; import com.zehong.system.service.IPipeInterfaceService;
import org.apache.ibatis.annotations.Param;
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 java.util.List; import java.util.List;
...@@ -116,4 +117,48 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService { ...@@ -116,4 +117,48 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
List<DeviceData> pipeDates = pipeInterfaceMapper.selectvalveData(); List<DeviceData> pipeDates = pipeInterfaceMapper.selectvalveData();
return pipeDates; return pipeDates;
} }
/**
* 查询下级在线设备数量
* @param pressureList
* @return
*/
@Override
public int selectOnlineQuantity(List<PressureFlow> pressureList, int isOnLine) {
int i = pipeInterfaceMapper.selectOnlineQuantity(pressureList,isOnLine);
return i;
}
/**
* 查询历史报警数量
* @param pressureList
* @return
*/
@Override
public int selectHistoricalAlarm(List<PressureFlow> pressureList) {
int i = pipeInterfaceMapper.selectHistoricalAlarm(pressureList);
return i;
}
/**
* 查询已处理报警
* @param pressureList
* @return
*/
@Override
public int selectProcessAlarm(List<PressureFlow> pressureList) {
int i = pipeInterfaceMapper.selectProcessAlarm(pressureList);
return i;
}
/**
* 查询报警中
* @param pressureList
* @return
*/
@Override
public int selectInAlarm(List<PressureFlow> pressureList) {
int i = pipeInterfaceMapper.selectInAlarm(pressureList);
return i;
}
} }
...@@ -156,4 +156,14 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService ...@@ -156,4 +156,14 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
public Map<String,Object> selectDetectorNum(String enterpriseId){ public Map<String,Object> selectDetectorNum(String enterpriseId){
return tDetectorInfoMapper.selectDetectorNum(enterpriseId.split(",")); return tDetectorInfoMapper.selectDetectorNum(enterpriseId.split(","));
} }
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@Override
public List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo){
return tDetectorInfoMapper.selectDetectorMointor(tDetectorInfo);
}
} }
...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; ...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorInfo; import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData; import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO; import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import com.zehong.system.mapper.TDetectorReportDataMapper; import com.zehong.system.mapper.TDetectorReportDataMapper;
import com.zehong.system.service.ITDetectorReportDataService; import com.zehong.system.service.ITDetectorReportDataService;
...@@ -62,25 +63,25 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi ...@@ -62,25 +63,25 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
/** /**
* 查询设备上报的数据列表 * 查询设备上报的数据列表
* *
* @param tDetectorReportData 设备上报的数据 * @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据 * @return 设备上报的数据
*/ */
@Override @Override
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportData tDetectorReportData) public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportDataQueryForm tDetectorReportDataQueryForm)
{ {
return tDetectorReportDataMapper.selectTDetectorReportDataList(tDetectorReportData); return tDetectorReportDataMapper.selectTDetectorReportDataList(tDetectorReportDataQueryForm);
} }
/** /**
* 查询设备上报的数据分页列表 * 查询设备上报的数据分页列表
* *
* @param tDetectorReportData 设备上报的数据 * @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据 * @return 设备上报的数据
*/ */
@Override @Override
public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportData tDetectorReportData) public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportDataQueryForm tDetectorReportDataQueryForm)
{ {
return new PageInfo(tDetectorReportDataMapper.selectTDetectorReportDataList(tDetectorReportData)); return new PageInfo(tDetectorReportDataMapper.selectTDetectorReportDataList(tDetectorReportDataQueryForm));
} }
/** /**
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<result property="deviceNo" column="device_model" /> <result property="deviceNo" column="device_model" />
<result property="deviceType" column="device_type" /> <result property="deviceType" column="device_type" />
<result property="reportTime" column="create_time" /> <result property="reportTime" column="create_time" />
<result property="iotNo" column="iot_no" />
</resultMap> </resultMap>
<!--场站数据--> <!--场站数据-->
...@@ -102,9 +103,9 @@ ...@@ -102,9 +103,9 @@
</select> </select>
<!--查询下级设备数据--> <!--查询下级设备数据-->
<select id="selectPressureFlow" parameterType="DeviceData" resultMap="PressureFlowResult"> <select id="selectPressureFlow" parameterType="java.util.List" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
where relation_device_type='1' where relation_device_type='1' and relation_device_id = #{deviceId}
</select> </select>
<!--场站信息查询方法--> <!--场站信息查询方法-->
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
<!--查询场站下级数据--> <!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult"> <select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_type='2' where relation_device_type='2' and relation_device_id = #{deviceId}
</select> </select>
<!--监控信息查询--> <!--监控信息查询-->
...@@ -142,4 +143,42 @@ ...@@ -142,4 +143,42 @@
where device_type='1' and is_del='0' where device_type='1' and is_del='0'
</select> </select>
<!--查询在线下级设备数量-->
<select id="selectOnlineQuantity" parameterType="java.util.List" resultType="java.lang.Integer">
select count(detector_id) as id from t_detector_info
where is_del ='0' and detector_status=#{isOnLine} and detector_code in
(
<foreach collection="pressureList" item="item" index="index" separator=",">
#{item.iotNo}
</foreach>
)
</select>
<!--查询历史报警数量-->
<select id="selectHistoricalAlarm" parameterType="java.util.List" resultType="java.lang.Integer">
select count(id) from t_detector_report_data
where detector_code in
<foreach collection="list" item="pressureList" open="(" close=")" index="index" separator=",">
#{pressureList.iotNo}
</foreach>
</select>
<!--查询已处理报警-->
<select id="selectProcessAlarm" parameterType="java.util.List" resultType="java.lang.Integer">
select count(id) from t_detector_report_data
where is_cancel_alarm !='0' and detector_code in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.iotNo}
</foreach>
</select>
<!--查询报警中-->
<select id="selectInAlarm" parameterType="java.util.List" resultType="java.lang.Integer">
select count(id) from t_detector_report_data
where is_cancel_alarm ='0' and detector_code in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.iotNo}
</foreach>
</select>
</mapper> </mapper>
...@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="detectorStatus" column="detector_status" /> <result property="detectorStatus" column="detector_status" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="beyondDevicename" column="beyondDevicename" />
<result property="enterpriseName" column="enterprise_name" />
</resultMap> </resultMap>
<sql id="selectTDetectorInfoVo"> <sql id="selectTDetectorInfoVo">
...@@ -261,4 +263,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -261,4 +263,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum
FROM t_detector_info WHERE is_del = 0 FROM t_detector_info WHERE is_del = 0
</select> </select>
<select id="selectDetectorMointor" parameterType="TDetectorInfo" resultMap="TDetectorInfoResult">
SELECT
device.device_name AS beyondDevicename,
detector.detector_name,
detector.detector_code,
enterprise.enterprise_name,
detector.medium,
detector.detector_status,
detector.update_time AS reportTime
FROM
t_relation_device_detail_info relation
INNER JOIN t_detector_info detector ON detector.detector_code = relation.iot_no
INNER JOIN t_device_info device ON device.device_id = relation.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = device.beyond_enterprise_id
<where>
relation.device_type = '3' AND relation.is_del = '0'
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise.enterprise_id = #{enterpriseId}</if>
<if test="detectorName != null and detectorName != ''"> and detector.detector_name like concat('%', #{detectorName}, '%')</if>
<if test="detectorCode != null and detectorCode != ''"> and detector.detector_code like concat('%', #{detectorCode}, '%')</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,21 +24,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -24,21 +24,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, source_id, detector_code, detector_status_id, status_name, report_value, zh_host_status_id, net_point, signal_strength, ip_address, create_time, is_cancel_alarm, cancel_time from t_detector_report_data select id, source_id, detector_code, detector_status_id, status_name, report_value, zh_host_status_id, net_point, signal_strength, ip_address, create_time, is_cancel_alarm, cancel_time from t_detector_report_data
</sql> </sql>
<select id="selectTDetectorReportDataList" parameterType="TDetectorReportData" resultMap="TDetectorReportDataResult"> <select id="selectTDetectorReportDataList" parameterType="TDetectorReportDataForm" resultType="TDetectorAlarmInfoVO">
<include refid="selectTDetectorReportDataVo"/> select * from(
<where> select rd.id,
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if> rd.cancel_time cancelTime,
<if test="detectorCode != null and detectorCode != ''"> and detector_code = #{detectorCode}</if> rd.detector_code detectorCode,
<if test="detectorStatusId != null and detectorStatusId != ''"> and detector_status_id = #{detectorStatusId}</if> CONCAT_WS("#",IFNULL(u.nick_name,IFNULL(di.linkman,di.detector_addr)),di.linkman) unitName,
<if test="statusName != null and statusName != ''"> and status_name = #{statusName}</if> di.detector_type detectorType,
<if test="reportValue != null "> and report_value = #{reportValue}</if> rd.status_name statusName,
<if test="zhHostStatusId != null "> and zh_host_status_id = #{zhHostStatusId}</if> rd.create_time alarmTime,
<if test="netPoint != null "> and net_point = #{netPoint}</if> rd.is_cancel_alarm handledStatus
<if test="signalStrength != null "> and signal_strength = #{signalStrength}</if> FROM t_detector_report_data rd
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if> LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_detector_user u ON u.user_id = di.user_id
<where> u.is_del = '0' and di.is_del = '0'
<if test="detectorCode != null and detectorCode != ''"> and rd.detector_code = #{detectorCode}</if>
<if test="statusName != null and statusName != ''"> and rd.status_name = #{statusName}</if>
<if test="createTimeStart != null "> and rd.create_time &gt;= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and rd.create_time &lt;= #{createTimeEnd}</if>
<if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if> <if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if>
<if test="cancelTime != null "> and cancel_time = #{cancelTime}</if> <if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where> </where>
union
SELECT rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
CONCAT_WS("#",ti.device_name,ti.linkman) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
rd.is_cancel_alarm handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ri ON rd.detector_code = ri.iot_no
LEFT JOIN t_device_info ti ON ri.relation_device_id = ti.device_id
<where> ri.relation_device_type = '1' and ri.is_del = '0' and ti.is_del = '0'
<if test="detectorCode != null and detectorCode != ''"> and rd.detector_code = #{detectorCode}</if>
<if test="statusName != null and statusName != ''"> and rd.status_name = #{statusName}</if>
<if test="createTimeStart != null "> and rd.create_time &gt;= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and rd.create_time &lt;= #{createTimeEnd}</if>
<if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if>
<if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where>
union
SELECT rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
CONCAT_WS("#",si.site_station_name,si.build_unit) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
rd.is_cancel_alarm handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ti ON rd.detector_code = ti.iot_no
LEFT JOIN t_site_station_info si ON ti.relation_device_id = si.site_station_id
<where> ti.relation_device_type = '2' and ti.is_del = '0' and si.is_del = '0'
<if test="detectorCode != null and detectorCode != ''"> and rd.detector_code = #{detectorCode}</if>
<if test="statusName != null and statusName != ''"> and rd.status_name = #{statusName}</if>
<if test="createTimeStart != null "> and rd.create_time &gt;= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and rd.create_time &lt;= #{createTimeEnd}</if>
<if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if>
<if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where>
)t
ORDER BY t.alarmTime DESC
</select> </select>
<select id="selectTDetectorReportDataById" parameterType="Long" resultMap="TDetectorReportDataResult"> <select id="selectTDetectorReportDataById" parameterType="Long" resultMap="TDetectorReportDataResult">
...@@ -54,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectTDetectorAlarm" resultType="TDetectorAlarmInfoVO"> <select id="selectTDetectorAlarm" resultType="TDetectorAlarmInfoVO">
select * from(
SELECT SELECT
rd.detector_code detectorCode, rd.detector_code detectorCode,
CONCAT_WS("#",IFNULL(u.nick_name,IFNULL(di.linkman,di.detector_addr)),di.linkman) unitName, CONCAT_WS("#",IFNULL(u.nick_name,IFNULL(di.linkman,di.detector_addr)),di.linkman) unitName,
...@@ -65,12 +119,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -65,12 +119,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'未消除', '未消除',
'已消除' '已消除'
) handledStatus ) handledStatus
FROM FROM t_detector_report_data rd
t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_detector_user u ON u.user_id = di.user_id LEFT JOIN t_detector_user u ON u.user_id = di.user_id
WHERE u.is_del = '0' and di.is_del = '0' and rd.is_cancel_alarm = '0' WHERE u.is_del = '0' and di.is_del = '0' and rd.is_cancel_alarm = '0'
ORDER BY rd.create_time DESC LIMIT 50 union
SELECT
rd.detector_code detectorCode,
CONCAT_WS("#",ti.device_name,ti.linkman) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
IF (
rd.is_cancel_alarm = 0,
'未消除',
'已消除'
) handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ri ON rd.detector_code = ri.iot_no
LEFT JOIN t_device_info ti ON ri.relation_device_id = ti.device_id
WHERE ri.relation_device_type = '1' and ri.is_del = '0' and ti.is_del = '0' and rd.is_cancel_alarm = '0'
union
SELECT
rd.detector_code detectorCode,
CONCAT_WS("#",si.site_station_name,si.build_unit) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
IF (
rd.is_cancel_alarm = 0,
'未消除',
'已消除'
) handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ti ON rd.detector_code = ti.iot_no
LEFT JOIN t_site_station_info si ON ti.relation_device_id = si.site_station_id
WHERE ti.relation_device_type = '2' and ti.is_del = '0' and si.is_del = '0' and rd.is_cancel_alarm = '0'
)t
ORDER BY t.alarmTime DESC LIMIT 50
</select> </select>
......
...@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deviceModel" column="device_model" /> <result property="deviceModel" column="device_model" />
<result property="deviceType" column="device_type" /> <result property="deviceType" column="device_type" />
<result property="iotNo" column="iot_no" /> <result property="iotNo" column="iot_no" />
<result property="detectionMedium" column="detection_medium" />
<result property="remarksn" column="remarks" /> <result property="remarksn" column="remarks" />
</resultMap> </resultMap>
...@@ -161,20 +162,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -161,20 +162,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertDeviceDetailInfo"> <insert id="insertDeviceDetailInfo">
INSERT INTO t_relation_device_detail_info (relation_device_id,device_name,device_model,device_type,iot_no,remarks) INSERT INTO t_relation_device_detail_info (relation_device_id,detection_medium,device_name,device_model,device_type,iot_no,remarks)
VALUES VALUES
(#{relationDeviceId},#{deviceName},#{deviceModel},#{deviceType},#{iotNo},#{remarksn}) (#{relationDeviceId},#{detectionMedium},#{deviceName},#{deviceModel},#{deviceType},#{iotNo},#{remarksn})
</insert> </insert>
<!--获取设备详细信息列表--> <!--获取设备详细信息列表-->
<select id="getdeviceDetailInfo" resultMap="TDeviceInfoResultS"> <select id="getdeviceDetailInfo" resultMap="TDeviceInfoResultS">
select relation_device_detail_id,relation_device_id,device_name,device_model,device_type,iot_no,remarks select relation_device_detail_id,relation_device_id,device_name,device_model,device_type,iot_no,remarks,detection_medium
from t_relation_device_detail_info where relation_device_id =#{deviceId} from t_relation_device_detail_info where relation_device_id =#{deviceId}
</select> </select>
<!--查询无绑定的 关联设备信息--> <!--查询无绑定的 关联设备信息-->
<select id="selectDetailInfo" resultMap="TDeviceInfoResultS"> <select id="selectDetailInfo" resultMap="TDeviceInfoResultS">
select relation_device_detail_id,relation_device_id,device_name,device_model,iot_no,remarks, (CASE device_type WHEN '1' THEN '压力表' WHEN '2' THEN '流量计' end) as device_type select relation_device_detail_id,detection_medium,relation_device_id,device_name,device_model,iot_no,remarks, (CASE device_type WHEN '1' THEN '压力表' WHEN '2' THEN '流量计' WHEN '3' THEN '探测器' end) as device_type
from t_relation_device_detail_info where is_del='0' and relation_device_id is null from t_relation_device_detail_info where is_del='0' and relation_device_id is null
<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="deviceModel != null and deviceModel != ''"> and device_model like concat('%', #{deviceModel}, '%')</if> <if test="deviceModel != null and deviceModel != ''"> and device_model like concat('%', #{deviceModel}, '%')</if>
...@@ -184,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -184,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--查询设备已经关联的关联设备--> <!--查询设备已经关联的关联设备-->
<select id="selectDetailInfoList" resultMap="TDeviceInfoResultS"> <select id="selectDetailInfoList" resultMap="TDeviceInfoResultS">
select relation_device_detail_id,relation_device_id,device_name,device_model,iot_no,remarks, (CASE device_type WHEN '1' THEN '压力表' WHEN '2' THEN '流量计' end) as device_type select relation_device_detail_id,detection_medium,relation_device_id,device_name,device_model,iot_no,remarks, (CASE device_type WHEN '1' THEN '压力表' WHEN '2' THEN '流量计' WHEN '3' THEN '探测器' end) as device_type
from t_relation_device_detail_info where relation_device_id=#{id} and relation_device_type=#{relationDeviceType} from t_relation_device_detail_info where relation_device_id=#{id} and relation_device_type=#{relationDeviceType}
</select> </select>
......
...@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="beyondDeviceName" column="beyondDeviceName" />
<result property="deviceType" column="device_type" />
</resultMap> </resultMap>
<sql id="selectTDeviceReportDataVo"> <sql id="selectTDeviceReportDataVo">
select device_report_data_id, device_name, device_num, standard_condition_accumulation, working_condition_accumulation, backing_standard_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, beyond_enterprise_id, beyond_enterprise_name, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data SELECT
report.device_report_data_id,
report.device_name,
report.device_num,
report.standard_condition_accumulation,
report.working_condition_accumulation,
report.backing_standard_condition_accumulation,
report.residual_quantity,
report.standard_condition_flow,
report.working_condition_flow,
report.temperature,
report.pressure,
report.report_time,
report.communication_status,
report.device_status,
report.beyond_enterprise_id,
enterprise.enterprise_name AS beyond_enterprise_name,
report.create_by,
report.create_time,
report.update_by,
report.update_time,
report.is_del,
report.remarks,
device.device_name AS beyondDeviceName
FROM
t_device_report_data report
INNER JOIN t_relation_device_detail_info detail ON detail.iot_no = report.device_num
INNER JOIN t_device_info device ON device.device_id = detail.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = report.beyond_enterprise_id
</sql> </sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
<where> <where>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if> <if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and device_num like concat('%', #{deviceNum}, '%')</if> <if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if> <if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if> <if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if> <if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and residual_quantity = #{residualQuantity}</if> <if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and standard_condition_flow = #{standardConditionFlow}</if> <if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and working_condition_flow = #{workingConditionFlow}</if> <if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and temperature = #{temperature}</if> <if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and pressure = #{pressure}</if> <if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if> <if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if> <if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if> <if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
</where> </where>
</select> </select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
where device_report_data_id = #{deviceReportDataId} where report.device_report_data_id = #{deviceReportDataId}
</select> </select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
......
{ {
"name": "zehong", "name": "zehong",
"version": "3.5.0", "version": "3.5.0",
"description": "智慧管网管理系统", "description": "智慧燃气管理系统",
"author": "泽宏", "author": "泽宏",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-02-23 15:28:07 * @Date: 2022-02-23 15:28:07
* @LastEditTime: 2022-03-01 15:54:19 * @LastEditTime: 2022-03-04 17:16:53
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js * @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js
...@@ -25,6 +25,15 @@ export function getTyx(query) { ...@@ -25,6 +25,15 @@ export function getTyx(query) {
params: query params: query
}) })
} }
// 调压箱下面的设备接口
export function getTyxDevice(query) {
return request({
url: '/pipe/pipe/selectPressureFlow',
method: 'get',
params: query
})
}
// 是阀门 // 是阀门
export function getFm(query) { export function getFm(query) {
...@@ -35,6 +44,15 @@ export function getFm(query) { ...@@ -35,6 +44,15 @@ export function getFm(query) {
}) })
} }
// 阀门下面的设备接口
export function getFmDevice(query) {
return request({
url: '/pipe/pipe/selectPressureFlow',
method: 'get',
params: query
})
}
// 厂站 // 厂站
export function getCz(query) { export function getCz(query) {
...@@ -44,6 +62,14 @@ export function getCz(query) { ...@@ -44,6 +62,14 @@ export function getCz(query) {
params: query params: query
}) })
} }
// 场站下的设备
export function getCzDevice(query) {
return request({
url: '/pipe/pipe/selecttSiteStationInfoData',
method: 'get',
params: query
})
}
// 监控 // 监控
export function getVideo(query) { export function getVideo(query) {
return request({ return request({
......
...@@ -81,3 +81,16 @@ export function selectDeviceNum(query) { ...@@ -81,3 +81,16 @@ export function selectDeviceNum(query) {
params: query params: query
}) })
} }
//数据监控获取探测器数据
export function selectDetectorMointor(query){
return request({
url: '/detector/detectorInfo/selectDetectorMointor',
method: 'get',
params: {
pageNum: 1,
pageSize: 20,
...query,
},
})
}
import request from '@/utils/request'
// 查询燃气用户设备上报的数据列表
export function listDetectorReportData(query) {
return request({
url: '/detector/detectorReportData/list',
method: 'get',
params: query
})
}
// 查询燃气用户设备上报的数据详细
export function getDetectorReportData(id) {
return request({
url: '/detector/detectorReportData/' + id,
method: 'get'
})
}
// 新增燃气用户设备上报的数据
export function addDetectorReportData(data) {
return request({
url: '/detector/detectorReportData',
method: 'post',
data: data
})
}
// 修改燃气用户设备上报的数据
export function updateDetectorReportData(data) {
return request({
url: '/detector/detectorReportData',
method: 'put',
data: data
})
}
// 删除燃气用户设备上报的数据
export function delDetectorReportData(id) {
return request({
url: '/detector/detectorReportData/' + id,
method: 'delete'
})
}
// 导出燃气用户设备上报的数据
export function exportDetectorReportData(query) {
return request({
url: '/detector/detectorReportData/export',
method: 'get',
params: query
})
}
import request from '@/utils/request' import request from '@/utils/request';
import qs from 'qs'
// 查询从业人员信息列表 // 查询从业人员信息列表
export function listInfo(query) { export function listInfo(query) {
return request({ return request({
...@@ -18,11 +18,28 @@ export function getInfo(employedPeopleId) { ...@@ -18,11 +18,28 @@ export function getInfo(employedPeopleId) {
} }
// 新增从业人员信息 // 新增从业人员信息
export function addInfo(data) { export function addInfo(file,form) {
return request({ return request({
url: '/regulation/supervise', url: '/regulation/supervise',
method: 'post', method: 'post',
data: data data: {
file:file,
tEmployedPeopleInfo:form,
},
headers: {
"Content-Type": "multipart/form-data"
},
})
}
//传图片
export function addFile(file){
return request({
url: '/regulation/supervise/addParent',
method: 'post',
data: file,
headers: {
'Content-type': 'multipart/form-data'
},
}) })
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-28 18:05:19 * @LastEditTime: 2022-03-07 18:09:02
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div> <div class="middle">{{ profile }}</div>
<div class="foot"> <div class="foot">
<div class="thead flex"> <div class="thead flex" v-if="list.length>0">
<div class="first">设备类型</div> <div class="first">设备类型</div>
<div>设备数量</div> <div>设备数量</div>
<div>在线设备</div> <div>在线设备</div>
...@@ -61,8 +61,15 @@ ...@@ -61,8 +61,15 @@
<div>已处理报警</div> <div>已处理报警</div>
<div class="last">报警中</div> <div class="last">报警中</div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)"> <template v-if="list.length > 0">
<div class="first zzz">{{ "压力表" }}</div> <div
class="tbody flex"
v-for="deviceData in list"
:key="deviceData.inAlarm+Math.random()"
>
<div v-unValue class="first zzz">
{{ typeList[deviceData.dataType] }}
</div>
<div v-unValue class="">{{ deviceData.numberPressureGauges }}</div> <div v-unValue class="">{{ deviceData.numberPressureGauges }}</div>
<div v-unValue class=""> <div v-unValue class="">
{{ deviceData.onlineEquipment }} {{ deviceData.onlineEquipment }}
...@@ -80,28 +87,10 @@ ...@@ -80,28 +87,10 @@
{{ deviceData.inAlarm }} {{ deviceData.inAlarm }}
</div> </div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)"> </template>
<div class="first zzz">{{ "流量计" }}</div>
<div v-unValue class="">{{ deviceData.numberEquipment }}</div>
<div v-unValue class="">
{{ deviceData.numberOnlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberOfflineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberHistoricalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.numberAlarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.numberInAlarm }}
</div>
</div>
</div> </div>
<div class="btn"> <div class="btn" v-if="list.length>0">
<div @click="btnClick">感知设备</div> <div @click="btnClick">感知设备</div>
</div> </div>
</div> </div>
...@@ -109,12 +98,49 @@ ...@@ -109,12 +98,49 @@
<script> <script>
import { companyType, deviceType } from "@/utils/mapClass/config.js"; import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { getCzDevice } from "@/api/bigWindow/getDevice.js";
export default { export default {
data() { data() {
return { return {
companyType, companyType,
deviceType, deviceType,
profile: "暂无", profile: "暂无",
typeList: {
// 1压力表 2流量计 3探测器
1: "压力表",
2: "流量计",
3: "探测器",
},
list: [
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 1,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 2,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 3,
// },
],
}; };
}, },
computed: { computed: {
...@@ -133,7 +159,8 @@ export default { ...@@ -133,7 +159,8 @@ export default {
this.companyType[item.conpanyId] = item.companyName; this.companyType[item.conpanyId] = item.companyName;
}); });
} }
console.log(this.deviceData); this.myHttp()
}, },
methods: { methods: {
close() { close() {
...@@ -142,6 +169,12 @@ export default { ...@@ -142,6 +169,12 @@ export default {
btnClick() { btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows); this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
}, },
myHttp() {
getCzDevice({ deviceId: this.deviceData.siteStationId }).then((res) => {
this.list = res.data[0].subordinateEquipmentList.filter(item=>item.numberPressureGauges>0);
console.log("resresres",res)
});
},
}, },
}; };
</script> </script>
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-03 11:51:13 * @LastEditTime: 2022-03-07 18:06:31
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div> <div class="middle">{{ profile }}</div>
<div class="foot"> <div class="foot">
<div class="thead flex"> <div class="thead flex" v-if="list.length > 0">
<div class="first">设备类型</div> <div class="first">设备类型</div>
<div>设备数量</div> <div>设备数量</div>
<div>在线设备</div> <div>在线设备</div>
...@@ -61,8 +61,15 @@ ...@@ -61,8 +61,15 @@
<div>已处理报警</div> <div>已处理报警</div>
<div class="last">报警中</div> <div class="last">报警中</div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)"> <template v-if="list.length > 0">
<div class="first zzz">{{ "压力表" }}</div> <div
class="tbody flex"
v-for="deviceData in list"
:key="deviceData.inAlarm + Math.random()"
>
<div v-unValue class="first zzz">
{{ typeList[deviceData.dataType] }}
</div>
<div v-unValue class="">{{ deviceData.numberPressureGauges }}</div> <div v-unValue class="">{{ deviceData.numberPressureGauges }}</div>
<div v-unValue class=""> <div v-unValue class="">
{{ deviceData.onlineEquipment }} {{ deviceData.onlineEquipment }}
...@@ -80,42 +87,59 @@ ...@@ -80,42 +87,59 @@
{{ deviceData.inAlarm }} {{ deviceData.inAlarm }}
</div> </div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)"> </template>
<div class="first zzz">{{ "流量计" }}</div>
<div v-unValue class="">{{ deviceData.numberEquipment }}</div>
<div v-unValue class="">
{{ deviceData.numberOnlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberOfflineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberHistoricalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.numberAlarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.numberInAlarm }}
</div>
</div>
</div> </div>
<div class="btn"> <div class="btn">
<div @click="btnClick">感知设备</div> <!-- <div @click="btnClick">感知设备</div> -->
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { companyType, deviceType } from "@/utils/mapClass/config.js"; import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { getTyx, getFm } from "@/api/bigWindow/getDevice.js"; import { getTyxDevice, getFmDevice } from "@/api/bigWindow/getDevice.js";
export default { export default {
data() { data() {
return { return {
companyType, companyType,
deviceType, deviceType,
profile: "暂无", profile: "暂无",
typeList: {
// 1压力表 2流量计 3探测器
1: "压力表",
2: "流量计",
3: "探测器",
},
list: [
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 1,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 2,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 3,
// },
],
}; };
}, },
computed: { computed: {
...@@ -146,25 +170,22 @@ export default { ...@@ -146,25 +170,22 @@ export default {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows); this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
}, },
myHttp() { myHttp() {
console.log(this.deviceData.iconType) console.log(this.deviceData.iconType);
if (this.deviceData.iconType == 2) { if (this.deviceData.iconType == 2) {
getTyx({ DeviceId: this.deviceData.DeviceId }).then((res) => { getTyxDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
if (res.code == 200) { // 过滤设备数为0的
const data = res.data.filter( this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.deviceId == this.deviceData.deviceId (item) => item.numberPressureGauges > 0
)[0].detectorCountList; );
this.deviceData.detectorCountList = data; console.log(this.list);
}
}); });
} else { } else {
getFm({ DeviceId: this.deviceData.DeviceId }).then((res) => { getFmDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
if (res.code == 200) { // 过滤设备数为0的
const data = res.data.filter( this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.deviceId == this.deviceData.deviceId (item) => item.numberPressureGauges > 0
)[0].detectorCountList; );
this.deviceData.detectorCountList = data;
}
}); });
} }
}, },
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-03 11:51:48 * @LastEditTime: 2022-03-07 14:02:43
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<script> <script>
import { companyType, deviceType } from "@/utils/mapClass/config.js"; import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
import { detectorUserList } from "@/api/detector/detectorUser"; import { detectorUserList } from "@/api/detector/detectorUser";
export default { export default {
...@@ -115,6 +116,7 @@ export default { ...@@ -115,6 +116,7 @@ export default {
btnClick() { btnClick() {
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows); // this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
this.vueRoot.getDetectorInfoList( this.vueRoot.getDetectorInfoList(
listDetectorInfo,
{ userId: this.deviceData.userId }, { userId: this.deviceData.userId },
this.deviceData.nickName this.deviceData.nickName
); );
......
<template> <template>
<transition <transition>
>
<div v-show="show" class="wrapper myCenter"> <div v-show="show" class="wrapper myCenter">
<div class="left"> <div class="left">
<div class="title-wrapper"> <div class="title-wrapper">
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
size="mini" size="mini"
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
class="el-bottom" class="el-bottom"
:key="Math.random()" :key="Math.random()"
> >
...@@ -73,12 +71,13 @@ ...@@ -73,12 +71,13 @@
<script> <script>
// import Velocity from "velocity-animate"; // import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm"; // import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
export default { export default {
props: { props: {
detcetorList: { detcetorList: {
type: Array, type: Array,
default:()=>[], default: () => [],
}, },
show: { show: {
type: Boolean, type: Boolean,
...@@ -109,7 +108,6 @@ export default { ...@@ -109,7 +108,6 @@ export default {
// address: "上海市普陀区金沙江路", // address: "上海市普陀区金沙江路",
// }, // },
], ],
}; };
}, },
created() { created() {
...@@ -134,6 +132,7 @@ export default { ...@@ -134,6 +132,7 @@ export default {
}, },
handleCurrentChangvale(val) { handleCurrentChangvale(val) {
this.$parent.getDetectorInfoList( this.$parent.getDetectorInfoList(
listDetectorInfo,
{ {
userId: this.userId, userId: this.userId,
pageNum: val, pageNum: val,
......
<template> <template>
<div> <div>
<!-- 基本信息 -->
<div> <div>
<div class="item1"> <div class="item1">
<span class="dot"> <span class="dot">
...@@ -13,15 +15,18 @@ ...@@ -13,15 +15,18 @@
</div> </div>
<div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;"> <div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;">
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">从业人员数</div> <div class="div-p" @click="$router.push('/regulation/supervise')">从业人员数</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.peopleNum}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.peopleNum}}</span>
</div> </div>
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">管道长度(m)</div> <div class="div-p" @click="$router.push('/regulation/pipe')">管道长度(m)</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.allPipeLength}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.allPipeLength}}</span>
</div> </div>
</div> </div>
<!-- 安全监管 -->
<div> <div>
<div class="item1" style="margin-top: 30px;"> <div class="item1" style="margin-top: 30px;">
<span class="dot"> <span class="dot">
...@@ -34,20 +39,30 @@ ...@@ -34,20 +39,30 @@
</div> </div>
</div> </div>
<div id="main1" style="width: 100%;height: 280px;"></div> <div id="main1" style="width: 100%;height: 280px;"></div>
<!-- <div class="echarts-two" style="margin-top: 30px;width: 430px;margin-left: 10px;"> -->
<!-- 任务完成率 -->
<div> <div>
<div class="item1" style="margin-top: 30px;"> <div class="item1" style="margin-top: 25px;">
<span class="dot"> <span class="dot">
<span class="dot-inner"></span> <span class="dot-inner"></span>
</span> </span>
<span style="letter-spacing :3px;color:#cddbe4">任务完成率</span> <span style="letter-spacing :3px;color:#cddbe4;cursor:pointer;" @click="$router.push('/operationMonitor/workOrder')">任务完成率</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
</div> </div>
</div> </div>
<div id="myCharttwo" :style="{width: '450px', height: '250px'}"></div>
<div class="titleTex">
<span :style="{color: '#00ffff'}"> ● 已完成:{{allNum.typeOne}}</span>
<span :style="{color: '#0099ff'}"> ● 未完成:{{allNum.typeTwo}}</span>
</div>
<!-- <div class="echarts-two" style="margin-top: 30px;width: 430px;margin-left: 10px;"> -->
<div class="div-el">
<!-- <div class="div-el">
<div class="el-left">入户安检</div> <div class="el-left">入户安检</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeOne*100"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeOne*100"></el-progress>
</div> </div>
...@@ -62,7 +77,7 @@ ...@@ -62,7 +77,7 @@
<div class="div-el"> <div class="div-el">
<div class="el-left">其他</div> <div class="el-left">其他</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeFor*100" status="exception"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeFor*100" status="exception"></el-progress>
</div> </div> -->
<!-- </div> --> <!-- </div> -->
</div> </div>
</template> </template>
...@@ -164,12 +179,96 @@ ...@@ -164,12 +179,96 @@
selectWorkOrderNum (this.enterpriseIds).then(response => { selectWorkOrderNum (this.enterpriseIds).then(response => {
console.log(response); console.log(response);
this.allNum=response.data; this.allNum=response.data;
this.initdata();
}); });
}else { }else {
this.allNum = this.zeroNum; this.allNum = this.zeroNum;
this.initdata();
} }
}, },
initdata(){
// 基于准备好的dom,初始化echarts实例
//console.log(data.renwu[0]+"=-=-=-"+data.renwu[1])
let myChart2 = this.$echarts.init(document.getElementById('myCharttwo'))
// 绘制图表
myChart2.setOption({
title: {
text: '任务总数量:'+(this.allNum.typeOne+this.allNum.typeTwo),
left: 'center',
top :20,
textStyle:{
color: "#00ffff"
}
},
grid: {
bottom: "7%",
containLabel: true,
},
tooltip: {
trigger: 'item',
},
series: [
{
name: '任务概况',
type: 'pie',
radius: '60%',
center: ['50%','58%'],
data: [
{
value: this.allNum.typeTwo,
name: '未完成',
itemStyle: { color: '#09f' }
},
{
value: this.allNum.typeOne,
name: '已完成' ,
itemStyle: { color: '#00ffff' }
},
],
labelLine:{
length:20,
length2:50,
},
label:{
color:'#fff',
fontSize: 14,
// formatter:"{b}\n\n",
// padding:[0,-55],
normal: {
show: true,
position: 'outer',
// formatter: '{d}%, {c} \n\n',
//模板变量有 {a}, {b},{c},{d},{e},分别表示系列名,数据名,数据值等。
formatter: "{a_set|{b}}\n{b_set|{d}%}\n\n\n",
// formatter: "{a_set|{b}}\n{c_set|{d}%}\n{b|}\n\n",
borderWidth: 20,
borderRadius: 4,
padding: [0, -55],
rich: {
a_set: {
color: "#cddbe4",
lineHeight: 20,
align: "center",
padding: [55, -40, -15, -40],
},
b_set:{
color: "auto",
},
}
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
});
},
//折线图 //折线图
drawLine(data){ drawLine(data){
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
...@@ -283,7 +382,6 @@ ...@@ -283,7 +382,6 @@
height: 30px; height: 30px;
font-size: 18px; font-size: 18px;
line-height: 30px; line-height: 30px;
color: #ffffff;
padding-left: 10px; padding-left: 10px;
font-weight: 700; font-weight: 700;
font-style: italic; font-style: italic;
...@@ -348,6 +446,7 @@ ...@@ -348,6 +446,7 @@
background: url('../../assets/mapImages/div-p.png'); background: url('../../assets/mapImages/div-p.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
cursor: pointer;
} }
.div-el{ .div-el{
...@@ -402,4 +501,14 @@ ...@@ -402,4 +501,14 @@
::v-deep .el-progress-bar__innerText { ::v-deep .el-progress-bar__innerText {
color: #1e516f; color: #1e516f;
} }
.titleTex{
width: 100%;
height: 20px;
margin-top: 0px;
font-size: 15px;
display: flex;
justify-content: space-around;
align-items: center;
padding: 0px 30px;
}
</style> </style>
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<!-- 预警信息 -->
<div> <div>
<div class="item1"> <div class="item1">
<span class="dot"> <span class="dot">
<span class="dot-inner"></span> <span class="dot-inner"></span>
</span> </span>
<span style="letter-spacing: 3px; color: #cddbe4">警信息</span> <span style="letter-spacing: 3px; color: #cddbe4;cursor: pointer;" @click="$router.push('/operationMonitor/operationMonitor')">警信息</span>
<div <div
class="fong-div" class="fong-div"
style=" style="
...@@ -90,81 +92,9 @@ ...@@ -90,81 +92,9 @@
</div> </div>
</div> </div>
<!-- <div style="width: 100%;height: 200px;background-color: #44d7dc;">
<el-table
size="mini"
:data="tableData"
style="width: 100%"
:height="tableHeight"
class="el-bottom"
ref="table"
>
<el-table-column prop="unitName" label="所在单位" width="100">
</el-table-column>
<el-table-column prop="detectorType" label="设备类型" width="">
</el-table-column>
<el-table-column prop="statusName" label="预警信息" width="">
</el-table-column>
<el-table-column prop="alarmTime" label="预警时间" width="160">
</el-table-column>
<el-table-column prop="handledStatus" label="状态" width="">
</el-table-column>
</el-table>
</div> -->
<div>
<div class="item1" style="margin-top: 10px">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span style="letter-spacing: 3px; color: #cddbe4">资源统计</span>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #2c888899;
float: right;
margin-top: 10px;
transform: skewX(-25deg);
"
></div>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #24b1b1b3;
float: right;
margin-top: 10px;
margin-right: 10px;
transform: skewX(-25deg);
"
></div>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #11e9e9b3;
float: right;
margin-top: 10px;
margin-right: 10px;
transform: skewX(-25deg);
"
></div>
</div>
</div>
<div
class="echarts-one"
style="margin-top: 10px; width: 430px; margin-left: 10px"
>
<div id="myChartone" :style="{ width: '420px', height: '240px' }"></div>
</div>
<!-- 用户安全监控设备 -->
<div> <div>
<div class="item1"> <div class="item1">
<span class="dot"> <span class="dot">
...@@ -238,26 +168,81 @@ ...@@ -238,26 +168,81 @@
<div class="usernum"> <div class="usernum">
<div class="usernumin in1"> <div class="usernumin in1">
<span></span> <span></span>
<span style="color: #fff">在线数量 </span> <span style="color: #cddbe4">在线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px"> <span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.changNum }}</span : {{ diviceNum.changNum }}</span
> >
</div> </div>
<div class="usernumin in2"> <div class="usernumin in2">
<span></span> <span></span>
<span style="color: #fff">离线数量 </span> <span style="color: #cddbe4">离线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px"> <span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.liNum }}</span : {{ diviceNum.liNum }}</span
> >
</div> </div>
<div class="usernumin in3"> <div class="usernumin in3">
<span></span> <span></span>
<span style="color: #fff">报警数量 </span> <span style="color: #cddbe4">报警数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px"> <span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.baoNum }}</span : {{ diviceNum.baoNum }}</span
> >
</div> </div>
</div> </div>
<!-- 资源统计 -->
<div>
<div class="item1" style="margin-top: 15px">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span style="letter-spacing: 3px; color: #cddbe4;cursor: pointer;" @click="$router.push('/regulation/station')">资源统计</span>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #2c888899;
float: right;
margin-top: 10px;
transform: skewX(-25deg);
"
></div>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #24b1b1b3;
float: right;
margin-top: 10px;
margin-right: 10px;
transform: skewX(-25deg);
"
></div>
<div
class="fong-div"
style="
width: 8px;
height: 12px;
background-color: #11e9e9b3;
float: right;
margin-top: 10px;
margin-right: 10px;
transform: skewX(-25deg);
"
></div>
</div>
</div>
<div
class="echarts-one"
style="margin-top: 10px; width: 430px; margin-left: 10px"
>
<div id="myChartone" :style="{ width: '420px', height: '240px' }"></div>
</div>
</div> </div>
</template> </template>
...@@ -296,7 +281,7 @@ export default { ...@@ -296,7 +281,7 @@ export default {
changeTimer: false, changeTimer: false,
repeatFinshed: false, repeatFinshed: false,
tableHeight: 230, tableHeight: 215,
tableData: [], tableData: [],
scrollHeight: 0, scrollHeight: 0,
}; };
...@@ -409,8 +394,8 @@ export default { ...@@ -409,8 +394,8 @@ export default {
grid: { grid: {
top: "8%", top: "8%",
left: "8%", left: "8%",
right: "8%", right: "4%",
bottom: "13%", bottom: "7%",
containLabel: true, containLabel: true,
}, },
xAxis: { xAxis: {
...@@ -678,7 +663,6 @@ export default { ...@@ -678,7 +663,6 @@ export default {
height: 30px; height: 30px;
font-size: 18px; font-size: 18px;
line-height: 30px; line-height: 30px;
color: #ffffff;
padding-left: 10px; padding-left: 10px;
font-weight: 700; font-weight: 700;
font-style: italic; font-style: italic;
...@@ -747,14 +731,14 @@ export default { ...@@ -747,14 +731,14 @@ export default {
height: 100%; height: 100%;
text-align: center; text-align: center;
float: left; float: left;
color: #e8f2ff; color: #cddbe4;
} }
.outusertwo { .outusertwo {
width: 50%; width: 50%;
height: 100%; height: 100%;
text-align: center; text-align: center;
float: right; float: right;
color: #e8f2ff; color: #cddbe4;
} }
.outuserspan { .outuserspan {
font-family: "arialbd"; font-family: "arialbd";
...@@ -790,7 +774,7 @@ export default { ...@@ -790,7 +774,7 @@ export default {
margin-top: -138px; margin-top: -138px;
margin-left: 172px; margin-left: 172px;
font-size: 15px; font-size: 15px;
color: #fff; color: #cddbe4;
text-align: center; text-align: center;
line-height: 25px; line-height: 25px;
padding: 28px 0px 0px 0px; padding: 28px 0px 0px 0px;
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
data() { data() {
return { return {
title: '智慧管网管理系统', title: '智慧燃气管理系统',
logo: logoImg logo: logoImg
} }
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:44:17 * @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-03-03 16:23:01 * @LastEditTime: 2022-03-07 15:40:59
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue * @FilePath: /test/hello-world/src/views/Home.vue
--> -->
<template> <template>
<div class="home bigwindow"> <div class="home bigwindow">
<div class="goSystem" @click="$router.push('/index')">进入管理系统</div> <div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<div id="map"></div> <div id="map"></div>
<Center :show="show" :centerData="centerData" /> <Center :show="show" :centerData="centerData" />
...@@ -180,6 +182,7 @@ export default { ...@@ -180,6 +182,7 @@ export default {
}, },
data() { data() {
return { return {
map: null, map: null,
show: false, show: false,
centerData: null, centerData: null,
...@@ -352,7 +355,6 @@ export default { ...@@ -352,7 +355,6 @@ export default {
goMap(httpFunc, addFunc, component) { goMap(httpFunc, addFunc, component) {
return httpFunc().then((res) => { return httpFunc().then((res) => {
// 给用户加icontype // 给用户加icontype
if (res.data && !res.data[0].iconType) { if (res.data && !res.data[0].iconType) {
res.data.forEach((item) => { res.data.forEach((item) => {
item.iconType = 6; item.iconType = 6;
...@@ -371,6 +373,8 @@ export default { ...@@ -371,6 +373,8 @@ export default {
} else { } else {
config = { data: res.data }; config = { data: res.data };
} }
console.log("reresresresresresresresresress",config)
addFunc(config, component); addFunc(config, component);
return config.iconType; return config.iconType;
}); });
...@@ -446,13 +450,12 @@ export default { ...@@ -446,13 +450,12 @@ export default {
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
}, },
//用户的设备center //用户的设备center
getDetectorInfoList(queryParams, title) { getDetectorInfoList(httpFunc,queryParams, title) {
console.log(queryParams); console.log(queryParams);
return listDetectorInfo(queryParams).then((res) => { return httpFunc(queryParams).then((res) => {
console.log("queryParams", res); // console.log("queryParams", res);
if (res.code == 200) { if (res.code == 200) {
this.detcetorList = res.rows; this.detcetorList = res.rows;
this.centerUserId = queryParams.userId; this.centerUserId = queryParams.userId;
// 总数据 // 总数据
this.centerTotal = res.total; this.centerTotal = res.total;
...@@ -500,6 +503,7 @@ export default { ...@@ -500,6 +503,7 @@ export default {
if (this.formatDate) { if (this.formatDate) {
clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器 clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
} }
// 报警
if (this.alarmTimer) { if (this.alarmTimer) {
clearInterval(this.alarmTimer); clearInterval(this.alarmTimer);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:rules="loginRules" :rules="loginRules"
class="login-form" class="login-form"
> >
<h3 class="title">智慧管网后台管理系统</h3> <h3 class="title">智慧燃气后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryParams" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="设备编号" prop="detectorCode">
<el-input
v-model="queryParams.detectorCode"
placeholder="请输入设备编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="isCancelAlarm">
<el-select v-model="queryParams.isCancelAlarm" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="预警时间" prop="createTime">
<el-date-picker clearable size="small"
v-model="queryParams.createTimeStart"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择起始时间">
</el-date-picker><span style="color: #bebfc3"> - </span>
<el-date-picker clearable size="small"
v-model="queryParams.createTimeEnd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择截止时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="detectorReportDataList">
<el-table-column label="所在单位" align="center" prop="unitName" />
<el-table-column label="设备编号" align="center" prop="detectorCode" />
<el-table-column label="设备类型" align="center" prop="detectorType">
<template slot-scope="scope">
<span v-if="scope.row.detectorType == '1'">家用探测器</span>
<span v-if="scope.row.detectorType == '2'">工业探测器</span>
</template>
</el-table-column>
<el-table-column label="预警信息" align="center" prop="statusName" />
<el-table-column label="预警时间" align="center" prop="alarmTime">
<template slot-scope="scope">
<span>{{ scope.row.alarmTime }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="handledStatus">
<template slot-scope="scope">
<span v-if="scope.row.handledStatus == '0'">未销警</span>
<span v-if="scope.row.handledStatus == '1'">自动消警</span>
<span v-if="scope.row.handledStatus == '2'">手动消警</span>
</template>
</el-table-column>
<el-table-column label="消警时间" align="center" prop="cancelTime">
<template slot-scope="scope">
<span>{{ scope.row.cancelTime }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listDetectorReportData } from "@/api/detector/detectorReportData";
export default {
name: "DetectorReportData",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 燃气用户设备上报的数据表格数据
detectorReportDataList: [],
// 字典
typeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
detectorCode: null,
statusName: null,
isCancelAlarm: null,
createTimeStart: null,
createTimeEnd: null
},
};
},
created() {
this.getList();
this.getDicts("t_detector_report_status").then(response => {
this.typeOptions = response.data;
});
},
methods: {
/** 查询燃气用户设备上报的数据列表 */
getList() {
this.loading = true;
listDetectorReportData(this.queryParams).then(response => {
this.detectorReportDataList = response.rows;
console.log(this.detectorReportDataList);
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
detectorCode: null,
statusName: null,
isCancelAlarm: null,
createTimeStart: null,
createTimeEnd: null
}
this.resetForm("queryParams");
this.handleQuery();
},
}
};
</script>
<template>
<div class="detectorTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDevicename"/>
<el-table-column label="设备名称" align="center" prop="detectorName"/>
<el-table-column label="设备编号" align="center" prop="detectorCode"/>
<el-table-column label="所属企业" align="center" prop="enterpriseName" />
<el-table-column label="探测介质" align="center" prop="medium">
<template slot-scope="scope">
<span v-if="scope.row.medium == 1">甲烷</span>
<span v-if="scope.row.medium == 2">氨气</span>
<span v-if="scope.row.medium == 3">一氧化碳</span>
<span v-if="scope.row.medium == 4">可燃气体</span>
<span v-if="scope.row.medium == 5">有毒气体</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="detectorStatus">
<template slot-scope="scope">
<span v-if="scope.row.detectorStatus == 0">正常</span>
<span v-if="scope.row.detectorStatus == 1">离线</span>
<span v-if="scope.row.detectorStatus == 2">报警</span>
</template>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="workingConditionAccumulation" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { selectDetectorMointor } from "@/api/detector/detectorInfo"
export default {
props:{
childrenQueryParams: {}
},
name: "DetectorTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: 0,
detectorName: "",
detectorCode: ""
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.queryParams.enterpriseId = this.childrenQueryParams.beyondEnterpriseId;
this.queryParams.detectorName = this.childrenQueryParams.deviceName;
this.queryParams.detectorCode = this.childrenQueryParams.deviceNum;
selectDetectorMointor(this.queryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
detectorHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.detectorTab{
margin-bottom: 20px;
}
</style>
<template>
<div class="flowmeterTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName" width="155"/>
<el-table-column label="设备名称" align="center" prop="deviceName" width="155"/>
<el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/>
<el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
<el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" />
<el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "FlowmeterTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '2';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
flowmeterHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.flowmeterTab {
margin-bottom: 20px;
}
</style>
<template>
<div class="pressureTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName"/>
<el-table-column label="设备名称" align="center" prop="deviceName"/>
<el-table-column label="设备编号" align="center" prop="deviceNum"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName"/>
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "PressureTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '1';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
pressureHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.pressureTab{
margin-bottom: 20px;
}
</style>
...@@ -211,6 +211,7 @@ ...@@ -211,6 +211,7 @@
<el-table-column label="设备名称" align="center" prop="deviceName" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" /> <el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" /> <el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" /> <el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" /> <el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
...@@ -256,6 +257,7 @@ ...@@ -256,6 +257,7 @@
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型"> <el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" /> <el-option label="压力表" value="1" />
<el-option label="流量计" value="2" /> <el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -267,6 +269,15 @@ ...@@ -267,6 +269,15 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium" >
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="备注" prop="remarksn"> <el-form-item label="备注" prop="remarksn">
...@@ -498,6 +509,7 @@ export default { ...@@ -498,6 +509,7 @@ export default {
deviceModel:'', deviceModel:'',
deviceType:'', deviceType:'',
iotNo:'', iotNo:'',
detectionMedium:'',
remarksn:'' remarksn:''
}, },
/*动态添加输入框*/ /*动态添加输入框*/
......
...@@ -315,6 +315,7 @@ ...@@ -315,6 +315,7 @@
<el-table-column label="设备名称" align="center" prop="deviceName" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" /> <el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" /> <el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" /> <el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" /> <el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
...@@ -362,6 +363,7 @@ ...@@ -362,6 +363,7 @@
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型"> <el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" /> <el-option label="压力表" value="1" />
<el-option label="流量计" value="2" /> <el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -373,6 +375,14 @@ ...@@ -373,6 +375,14 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium" >
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="备注" prop="remarksn"> <el-form-item label="备注" prop="remarksn">
...@@ -427,6 +437,7 @@ export default { ...@@ -427,6 +437,7 @@ export default {
deviceModel:'', deviceModel:'',
deviceType:'', deviceType:'',
iotNo:'', iotNo:'',
detectionMedium:'',
remarksn:'' remarksn:''
}, },
//关联设备下级数据 表单校验 //关联设备下级数据 表单校验
......
...@@ -137,6 +137,26 @@ ...@@ -137,6 +137,26 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="22">
<el-form-item label="上传头像" prop="idCard">
<el-upload
class="upload-demo"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="fileChange"
:before-upload="beforeUploadFile"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/jpeg/png格式,且不超过10MB</div>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="发证日期" prop="issueDate"> <el-form-item label="发证日期" prop="issueDate">
...@@ -211,7 +231,7 @@ ...@@ -211,7 +231,7 @@
</template> </template>
<script> <script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, selectTEnterprise} from "@/api/regulation/supervise"; import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, selectTEnterprise,addFile} from "@/api/regulation/supervise";
export default { export default {
name: "Info", name: "Info",
...@@ -219,6 +239,12 @@ export default { ...@@ -219,6 +239,12 @@ export default {
}, },
data() { data() {
return { return {
//头像
fileList: [],
//头像数据
fileo :{
name: "",
url:"" },
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
...@@ -271,6 +297,43 @@ export default { ...@@ -271,6 +297,43 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/**上传头像方法*/
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
// 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传
beforeUploadFile(file) {
let extension = file.name.substring(file.name.lastIndexOf('.') + 1);
let size = file.size / 1024 / 1024;
const isIMG =
file.type === 'image/jpg' ||
file.type === 'image/jpeg' ||
file.type === 'image/png'
if (!isIMG) {
this.$message.error('上传头像图片只支持jpg、jpeg、png格式!')
}
if (size > 10) {
this.$message.warning('图片大小不得超过10M');
}
},
// 文件状态改变时的钩子
fileChange(file, fileList) {
this.fileList = [];
this.fileo.name=file.name;
this.fileo.url=file.raw;
this.fileList.push(this.fileo);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
this.fileList = [];
},
/** 查询从业人员信息列表 */ /** 查询从业人员信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -285,6 +348,7 @@ export default { ...@@ -285,6 +348,7 @@ export default {
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
this.fileList = [];
}, },
// 表单重置 // 表单重置
reset() { reset() {
...@@ -359,11 +423,40 @@ export default { ...@@ -359,11 +423,40 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
// if (this.fileList.length === 0) {
// this.$message.warning('请上传图片');
// } else {
let file= new FormData();
file.append('file', this.fileList[0]);
// axios({
// method: "post",
// url: `${this.url}/transferRelationshipFile`,
// headers: {
// 'Content-type': 'multipart/form-data'
// },
// data: form
// }).then(function (response) {
// loading.close()
// that.$message({
// message: '图片上传完成',
// type: 'success'
// });
// })
//先传图片 返回图片存储地址
addFile(file).then(response => {
//传form表单
addInfo(this.form).then(response => { addInfo(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
});
// }
} }
} }
}); });
...@@ -398,6 +491,87 @@ export default { ...@@ -398,6 +491,87 @@ export default {
}).catch(() => {}); }).catch(() => {});
}, },
/**
* 文件提交方法
*/
uploadFile() {
let that = this;
//是否清空数据
let accumulate;
if (this.fileList.length === 0) {
this.$message.warning('请上传文件');
} else {
this.$confirm('是否清空现有数据?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
/**
* 这个是清空方法 走这个
*/
}).then(() => {
accumulate = 0;
this.$message({
type: 'success',
message: '已清空'
});
let form = new FormData();
form.append('file', this.fileList[0]);
const loading = this.$loading({
lock: true,
text: '数据正在上传中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
axios({
method: "post",
url: `${this.url}/transferRelationshipFile?Accumulate=` + accumulate,
headers: {
'Content-type': 'multipart/form-data'
},
data: form
}).then(function (response) {
loading.close()
that.$message({
message: '数据上传完成',
type: 'success'
});
})
/**
* 这个是取消清空方法 走这个
*/
}).catch(() => {
accumulate = 1;
this.$message({
type: 'success',
message: '取消清空',
});
let form = new FormData();
form.append('file', this.fileList[0]);
const loading = this.$loading({
lock: true,
text: '数据正在上传中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
axios({
method: "post",
url: `${this.url}/transferRelationshipFile?Accumulate=` + accumulate,
headers: {
'Content-type': 'multipart/form-data'
},
data: form
}).then(function (response) {
loading.close()
that.$message({
message: '数据上传完成',
type: 'success'
});
})
});
}
},
} }
}; };
......
...@@ -34,8 +34,8 @@ module.exports = { ...@@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.14:8903/gassafety`, target: `http://192.168.2.14:8903/gassafety`,
target: `http://222.223.203.154:8092/gassafety`, // target: `http://222.223.203.154:8092/gassafety`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
......
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