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
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;
import java.io.File;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
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 org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
......@@ -19,6 +16,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 从业人员信息Controller
......@@ -74,7 +72,7 @@ public class TEmployedPeopleInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('regulation:supervise:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
public AjaxResult add( TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
......@@ -114,4 +112,41 @@ public class TEmployedPeopleInfoController extends BaseController
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 {
private int iconType;
//下级设备数据封装类数组
private List<SubordinateEquipmentList> subordinateEquipmentList;
//压力表设备数量
private int numberPressureGauges;
......@@ -66,6 +69,80 @@ public class DeviceData {
//流量计报警中
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() {
return numberPressureGauges;
......@@ -259,7 +336,6 @@ public class DeviceData {
this.pressureFlows = pressureFlows;
}
@Override
public String toString() {
return "DeviceData{" +
......@@ -275,6 +351,7 @@ public class DeviceData {
", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", iconType=" + iconType +
", subordinateEquipmentList=" + subordinateEquipmentList +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
......@@ -287,6 +364,12 @@ public class DeviceData {
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
", detectorEquipment=" + detectorEquipment +
", detectorOnlineEquipment=" + detectorOnlineEquipment +
", detectorOfflineEquipment=" + detectorOfflineEquipment +
", detectorHistoricalAlarm=" + detectorHistoricalAlarm +
", detectorAlarmProcessed=" + detectorAlarmProcessed +
", detectorInAlarm=" + detectorInAlarm +
'}';
}
}
package com.zehong.system.domain;
import java.util.List;
public class DeviceList {
......
......@@ -14,6 +14,16 @@ public class PressureFlow {
private String deviceId;
private String iotNo;
public String getIotNo() {
return iotNo;
}
public void setIotNo(String iotNo) {
this.iotNo = iotNo;
}
public String getDeviceId() {
return deviceId;
}
......@@ -71,6 +81,7 @@ public class PressureFlow {
", deviceNum='" + deviceNum + '\'' +
", reportTime='" + reportTime + '\'' +
", 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
@Excel(name = "备注")
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)
{
this.detectorId = detectorId;
......
......@@ -27,7 +27,7 @@ public class TDeviceInfoS extends BaseEntity {
private String deviceModel;
/**
* 设备类型:1.压力表 2.流量计
* 设备类型:1.压力表 2.流量计 3.探测器
*/
private String deviceType;
......@@ -41,6 +41,19 @@ public class TDeviceInfoS extends BaseEntity {
*/
private String remarksn;
/**
* 探测介质
*/
private String detectionMedium;
public String getDetectionMedium() {
return detectionMedium;
}
public void setDetectionMedium(String detectionMedium) {
this.detectionMedium = detectionMedium;
}
public Integer getRelationDeviceDetailId() {
return relationDeviceDetailId;
......@@ -105,9 +118,10 @@ public class TDeviceInfoS extends BaseEntity {
", relationDeviceId=" + relationDeviceId +
", deviceName='" + deviceName + '\'' +
", deviceModel='" + deviceModel + '\'' +
", deviceType=" + deviceType +
", deviceType='" + deviceType + '\'' +
", iotNo='" + iotNo + '\'' +
", remarksn='" + remarksn + '\'' +
", detectionMedium='" + detectionMedium + '\'' +
'}';
}
}
......@@ -90,7 +90,27 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "备注")
private String remarks;
public void setDeviceReportDataId(Long deviceReportDataId)
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)
{
this.deviceReportDataId = deviceReportDataId;
}
......
......@@ -25,6 +25,9 @@ public class TSiteStationInfoData {
//流量计数组
private List<PressureFlow> pressureFlows;
//下级设备数据封装类数组
private List<SubordinateEquipmentList> subordinateEquipmentList;
private int iconType;
private String companyType;
......@@ -65,6 +68,79 @@ public class TSiteStationInfoData {
//流量计报警中
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() {
return numberOnlineEquipment;
......@@ -282,6 +358,7 @@ public class TSiteStationInfoData {
", buildCompany='" + buildCompany + '\'' +
", powerCompany='" + powerCompany + '\'' +
", pressureFlows=" + pressureFlows +
", subordinateEquipmentList=" + subordinateEquipmentList +
", iconType=" + iconType +
", companyType='" + companyType + '\'' +
", numberPressureGauges=" + numberPressureGauges +
......@@ -296,6 +373,12 @@ public class TSiteStationInfoData {
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", 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;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
......@@ -9,7 +10,7 @@ import java.util.Date;
* @author zhangzhizhong
*
*/
@Data
public class TDetectorAlarmInfoVO {
// 设备编号
......@@ -25,49 +26,8 @@ public class TDetectorAlarmInfoVO {
private Date alarmTime;
// 处理状态
private String handledStatus;
public String getDetectorCode() {
return detectorCode;
}
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;
}
// 销警时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cancelTime;
}
package com.zehong.system.mapper;
import com.zehong.system.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -72,4 +73,32 @@ public interface PipeInterfaceMapper {
* @return
*/
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
* @return
*/
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;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import java.util.List;
......@@ -34,10 +35,10 @@ public interface TDetectorReportDataMapper
/**
* 查询设备上报的数据列表
*
* @param tDetectorReportData 设备上报的数据
* @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据集合
*/
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportData tDetectorReportData);
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/**
* 新增设备上报的数据
......
package com.zehong.system.service;
import com.zehong.system.domain.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -69,4 +70,32 @@ public interface IPipeInterfaceService {
* @return
*/
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
* @return
*/
public Map<String,Object> selectDetectorNum(String enterpriseId);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
}
......@@ -3,6 +3,7 @@ package com.zehong.system.service;
import com.github.pagehelper.PageInfo;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import java.util.List;
......@@ -35,18 +36,18 @@ public interface ITDetectorReportDataService
/**
* 查询设备上报的数据列表
*
* @param tDetectorReportData 设备上报的数据
* @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据集合
*/
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportData tDetectorReportData);
public List<TDetectorReportData> selectTDetectorReportDataList(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/**
* 查询设备上报的数据分页列表
*
* @param tDetectorReportData 设备上报的数据
* @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据分页集合
*/
public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportData tDetectorReportData);
public PageInfo<TDetectorReportData> selectTDetectorReportDataPage(TDetectorReportDataQueryForm tDetectorReportDataQueryForm);
/**
* 新增设备上报的数据
......
......@@ -2,6 +2,7 @@ package com.zehong.system.service.impl;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.PipeInterfaceMapper;
import com.zehong.system.service.IPipeInterfaceService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -116,4 +117,48 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
List<DeviceData> pipeDates = pipeInterfaceMapper.selectvalveData();
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
public Map<String,Object> selectDetectorNum(String enterpriseId){
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;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.form.TDetectorReportDataQueryForm;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import com.zehong.system.mapper.TDetectorReportDataMapper;
import com.zehong.system.service.ITDetectorReportDataService;
......@@ -62,25 +63,25 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
/**
* 查询设备上报的数据列表
*
* @param tDetectorReportData 设备上报的数据
* @param tDetectorReportDataQueryForm 设备上报的数据
* @return 设备上报的数据
*/
@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 设备上报的数据
*/
@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 @@
<result property="deviceNo" column="device_model" />
<result property="deviceType" column="device_type" />
<result property="reportTime" column="create_time" />
<result property="iotNo" column="iot_no" />
</resultMap>
<!--场站数据-->
......@@ -102,9 +103,9 @@
</select>
<!--查询下级设备数据-->
<select id="selectPressureFlow" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_type='1'
<select id="selectPressureFlow" parameterType="java.util.List" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
where relation_device_type='1' and relation_device_id = #{deviceId}
</select>
<!--场站信息查询方法-->
......@@ -116,7 +117,7 @@
<!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
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>
<!--监控信息查询-->
......@@ -142,4 +143,42 @@
where device_type='1' and is_del='0'
</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>
......@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="detectorStatus" column="detector_status" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="beyondDevicename" column="beyondDevicename" />
<result property="enterpriseName" column="enterprise_name" />
</resultMap>
<sql id="selectTDetectorInfoVo">
......@@ -261,4 +263,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum
FROM t_detector_info WHERE is_del = 0
</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>
\ No newline at end of file
......@@ -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
</sql>
<select id="selectTDetectorReportDataList" parameterType="TDetectorReportData" resultMap="TDetectorReportDataResult">
<include refid="selectTDetectorReportDataVo"/>
<where>
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
<if test="detectorCode != null and detectorCode != ''"> and detector_code = #{detectorCode}</if>
<if test="detectorStatusId != null and detectorStatusId != ''"> and detector_status_id = #{detectorStatusId}</if>
<if test="statusName != null and statusName != ''"> and status_name = #{statusName}</if>
<if test="reportValue != null "> and report_value = #{reportValue}</if>
<if test="zhHostStatusId != null "> and zh_host_status_id = #{zhHostStatusId}</if>
<if test="netPoint != null "> and net_point = #{netPoint}</if>
<if test="signalStrength != null "> and signal_strength = #{signalStrength}</if>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<select id="selectTDetectorReportDataList" parameterType="TDetectorReportDataForm" resultType="TDetectorAlarmInfoVO">
select * from(
select rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
CONCAT_WS("#",IFNULL(u.nick_name,IFNULL(di.linkman,di.detector_addr)),di.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_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="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("#",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="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>
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 id="selectTDetectorReportDataById" parameterType="Long" resultMap="TDetectorReportDataResult">
......@@ -54,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTDetectorAlarm" resultType="TDetectorAlarmInfoVO">
select * from(
SELECT
rd.detector_code detectorCode,
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"
'未消除',
'已消除'
) handledStatus
FROM
t_detector_report_data rd
FROM t_detector_report_data rd
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' 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>
......
......@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deviceModel" column="device_model" />
<result property="deviceType" column="device_type" />
<result property="iotNo" column="iot_no" />
<result property="detectionMedium" column="detection_medium" />
<result property="remarksn" column="remarks" />
</resultMap>
......@@ -161,20 +162,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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
(#{relationDeviceId},#{deviceName},#{deviceModel},#{deviceType},#{iotNo},#{remarksn})
(#{relationDeviceId},#{detectionMedium},#{deviceName},#{deviceModel},#{deviceType},#{iotNo},#{remarksn})
</insert>
<!--获取设备详细信息列表-->
<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}
</select>
<!--查询无绑定的 关联设备信息-->
<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
<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>
......@@ -184,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--查询设备已经关联的关联设备-->
<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}
</select>
......
......@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="beyondDeviceName" column="beyondDeviceName" />
<result property="deviceType" column="device_type" />
</resultMap>
<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>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/>
<where>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and temperature = #{temperature}</if>
<if test="pressure != null "> and pressure = #{pressure}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
</where>
</select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/>
where device_report_data_id = #{deviceReportDataId}
where report.device_report_data_id = #{deviceReportDataId}
</select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
......
{
"name": "zehong",
"version": "3.5.0",
"description": "智慧管网管理系统",
"description": "智慧燃气管理系统",
"author": "泽宏",
"license": "MIT",
"scripts": {
......
/*
* @Author: your name
* @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
* @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
......@@ -25,6 +25,15 @@ export function getTyx(query) {
params: query
})
}
// 调压箱下面的设备接口
export function getTyxDevice(query) {
return request({
url: '/pipe/pipe/selectPressureFlow',
method: 'get',
params: query
})
}
// 是阀门
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) {
......@@ -44,6 +62,14 @@ export function getCz(query) {
params: query
})
}
// 场站下的设备
export function getCzDevice(query) {
return request({
url: '/pipe/pipe/selecttSiteStationInfoData',
method: 'get',
params: query
})
}
// 监控
export function getVideo(query) {
return request({
......
......@@ -81,3 +81,16 @@ export function selectDeviceNum(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) {
return request({
......@@ -18,11 +18,28 @@ export function getInfo(employedPeopleId) {
}
// 新增从业人员信息
export function addInfo(data) {
export function addInfo(file,form) {
return request({
url: '/regulation/supervise',
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
* @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
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div>
<div class="foot">
<div class="thead flex">
<div class="thead flex" v-if="list.length>0">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
......@@ -61,47 +61,36 @@
<div>已处理报警</div>
<div class="last">报警中</div>
</div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<div class="first zzz">{{ "压力表" }}</div>
<div v-unValue class="">{{ deviceData.numberPressureGauges }}</div>
<div v-unValue class="">
{{ deviceData.onlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.offlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.historicalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.alarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.inAlarm }}
</div>
</div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<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 }}
<template v-if="list.length > 0">
<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.onlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.offlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.historicalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.alarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.inAlarm }}
</div>
</div>
</div>
</template>
</div>
<div class="btn">
<div class="btn" v-if="list.length>0">
<div @click="btnClick">感知设备</div>
</div>
</div>
......@@ -109,12 +98,49 @@
<script>
import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { getCzDevice } from "@/api/bigWindow/getDevice.js";
export default {
data() {
return {
companyType,
deviceType,
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: {
......@@ -133,7 +159,8 @@ export default {
this.companyType[item.conpanyId] = item.companyName;
});
}
console.log(this.deviceData);
this.myHttp()
},
methods: {
close() {
......@@ -142,6 +169,12 @@ export default {
btnClick() {
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>
......
<!--
* @Author: your name
* @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
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div>
<div class="foot">
<div class="thead flex">
<div class="thead flex" v-if="list.length > 0">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
......@@ -61,61 +61,85 @@
<div>已处理报警</div>
<div class="last">报警中</div>
</div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<div class="first zzz">{{ "压力表" }}</div>
<div v-unValue class="">{{ deviceData.numberPressureGauges }}</div>
<div v-unValue class="">
{{ deviceData.onlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.offlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.historicalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.alarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.inAlarm }}
</div>
</div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<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 }}
<template v-if="list.length > 0">
<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.onlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.offlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.historicalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.alarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.inAlarm }}
</div>
</div>
</div>
</template>
</div>
<div class="btn">
<div @click="btnClick">感知设备</div>
<!-- <div @click="btnClick">感知设备</div> -->
</div>
</div>
</template>
<script>
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 {
data() {
return {
companyType,
deviceType,
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: {
......@@ -146,25 +170,22 @@ export default {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
},
myHttp() {
console.log(this.deviceData.iconType)
console.log(this.deviceData.iconType);
if (this.deviceData.iconType == 2) {
getTyx({ DeviceId: this.deviceData.DeviceId }).then((res) => {
if (res.code == 200) {
const data = res.data.filter(
(item) => item.deviceId == this.deviceData.deviceId
)[0].detectorCountList;
this.deviceData.detectorCountList = data;
}
getTyxDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
// 过滤设备数为0的
this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.numberPressureGauges > 0
);
console.log(this.list);
});
} else {
getFm({ DeviceId: this.deviceData.DeviceId }).then((res) => {
if (res.code == 200) {
const data = res.data.filter(
(item) => item.deviceId == this.deviceData.deviceId
)[0].detectorCountList;
this.deviceData.detectorCountList = data;
}
getFmDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
// 过滤设备数为0的
this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.numberPressureGauges > 0
);
});
}
},
......
<!--
* @Author: your name
* @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
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -80,6 +80,7 @@
<script>
import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
import { detectorUserList } from "@/api/detector/detectorUser";
export default {
......@@ -115,6 +116,7 @@ export default {
btnClick() {
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
this.vueRoot.getDetectorInfoList(
listDetectorInfo,
{ userId: this.deviceData.userId },
this.deviceData.nickName
);
......
<template>
<transition
>
<transition>
<div v-show="show" class="wrapper myCenter">
<div class="left">
<div class="title-wrapper">
......@@ -14,7 +13,6 @@
size="mini"
:data="tableData"
style="width: 100%"
class="el-bottom"
:key="Math.random()"
>
......@@ -73,12 +71,13 @@
<script>
// import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
export default {
props: {
detcetorList: {
type: Array,
default:()=>[],
default: () => [],
},
show: {
type: Boolean,
......@@ -109,7 +108,6 @@ export default {
// address: "上海市普陀区金沙江路",
// },
],
};
},
created() {
......@@ -134,6 +132,7 @@ export default {
},
handleCurrentChangvale(val) {
this.$parent.getDetectorInfoList(
listDetectorInfo,
{
userId: this.userId,
pageNum: val,
......
<template>
<div>
<!-- 基本信息 -->
<div>
<div class="item1">
<span class="dot">
......@@ -10,18 +12,21 @@
<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>
<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 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>
</div>
<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>
</div>
</div>
<!-- 安全监管 -->
<div>
<div class="item1" style="margin-top: 30px;">
<span class="dot">
......@@ -34,20 +39,30 @@
</div>
</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 class="item1" style="margin-top: 30px;">
<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="item1" style="margin-top: 25px;">
<span class="dot">
<span class="dot-inner"></span>
</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: #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 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>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeOne*100"></el-progress>
</div>
......@@ -62,7 +77,7 @@
<div class="div-el">
<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>
</div>
</div> -->
<!-- </div> -->
</div>
</template>
......@@ -164,12 +179,96 @@
selectWorkOrderNum (this.enterpriseIds).then(response => {
console.log(response);
this.allNum=response.data;
this.initdata();
});
}else {
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){
// 基于准备好的dom,初始化echarts实例
......@@ -283,7 +382,6 @@
height: 30px;
font-size: 18px;
line-height: 30px;
color: #ffffff;
padding-left: 10px;
font-weight: 700;
font-style: italic;
......@@ -348,6 +446,7 @@
background: url('../../assets/mapImages/div-p.png');
background-repeat: no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.div-el{
......@@ -402,4 +501,14 @@
::v-deep .el-progress-bar__innerText {
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>
<template>
<div style="height: 100%">
<!-- 预警信息 -->
<div>
<div class="item1">
<span class="dot">
<span class="dot-inner"></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
class="fong-div"
style="
......@@ -90,81 +92,9 @@
</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 class="item1">
<span class="dot">
......@@ -238,26 +168,81 @@
<div class="usernum">
<div class="usernumin in1">
<span></span>
<span style="color: #fff">在线数量 </span>
<span style="color: #cddbe4">在线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.changNum }}</span
>
</div>
<div class="usernumin in2">
<span></span>
<span style="color: #fff">离线数量 </span>
<span style="color: #cddbe4">离线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.liNum }}</span
>
</div>
<div class="usernumin in3">
<span></span>
<span style="color: #fff">报警数量 </span>
<span style="color: #cddbe4">报警数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.baoNum }}</span
>
</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>
</template>
......@@ -296,7 +281,7 @@ export default {
changeTimer: false,
repeatFinshed: false,
tableHeight: 230,
tableHeight: 215,
tableData: [],
scrollHeight: 0,
};
......@@ -409,8 +394,8 @@ export default {
grid: {
top: "8%",
left: "8%",
right: "8%",
bottom: "13%",
right: "4%",
bottom: "7%",
containLabel: true,
},
xAxis: {
......@@ -678,7 +663,6 @@ export default {
height: 30px;
font-size: 18px;
line-height: 30px;
color: #ffffff;
padding-left: 10px;
font-weight: 700;
font-style: italic;
......@@ -747,14 +731,14 @@ export default {
height: 100%;
text-align: center;
float: left;
color: #e8f2ff;
color: #cddbe4;
}
.outusertwo {
width: 50%;
height: 100%;
text-align: center;
float: right;
color: #e8f2ff;
color: #cddbe4;
}
.outuserspan {
font-family: "arialbd";
......@@ -790,7 +774,7 @@ export default {
margin-top: -138px;
margin-left: 172px;
font-size: 15px;
color: #fff;
color: #cddbe4;
text-align: center;
line-height: 25px;
padding: 28px 0px 0px 0px;
......
......@@ -35,7 +35,7 @@ export default {
},
data() {
return {
title: '智慧管网管理系统',
title: '智慧燃气管理系统',
logo: logoImg
}
}
......
<!--
* @Author: your name
* @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
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue
-->
<template>
<div class="home bigwindow">
<div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<div id="map"></div>
<Center :show="show" :centerData="centerData" />
......@@ -180,6 +182,7 @@ export default {
},
data() {
return {
map: null,
show: false,
centerData: null,
......@@ -351,8 +354,7 @@ export default {
},
goMap(httpFunc, addFunc, component) {
return httpFunc().then((res) => {
// 给用户加icontype
// 给用户加icontype
if (res.data && !res.data[0].iconType) {
res.data.forEach((item) => {
item.iconType = 6;
......@@ -371,6 +373,8 @@ export default {
} else {
config = { data: res.data };
}
console.log("reresresresresresresresresress",config)
addFunc(config, component);
return config.iconType;
});
......@@ -446,13 +450,12 @@ export default {
this.map.allfilter(this.selarr, this.selarr1);
},
//用户的设备center
getDetectorInfoList(queryParams, title) {
getDetectorInfoList(httpFunc,queryParams, title) {
console.log(queryParams);
return listDetectorInfo(queryParams).then((res) => {
console.log("queryParams", res);
return httpFunc(queryParams).then((res) => {
// console.log("queryParams", res);
if (res.code == 200) {
this.detcetorList = res.rows;
this.centerUserId = queryParams.userId;
// 总数据
this.centerTotal = res.total;
......@@ -500,6 +503,7 @@ export default {
if (this.formatDate) {
clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
}
// 报警
if (this.alarmTimer) {
clearInterval(this.alarmTimer);
}
......
......@@ -6,7 +6,7 @@
:rules="loginRules"
class="login-form"
>
<h3 class="title">智慧管网后台管理系统</h3>
<h3 class="title">智慧燃气后台管理系统</h3>
<el-form-item prop="username">
<el-input
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 @@
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -256,6 +257,7 @@
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
......@@ -267,6 +269,15 @@
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium" >
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
......@@ -498,6 +509,7 @@ export default {
deviceModel:'',
deviceType:'',
iotNo:'',
detectionMedium:'',
remarksn:''
},
/*动态添加输入框*/
......
......@@ -315,6 +315,7 @@
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="探测介质" align="center" prop="detectionMedium" />
<el-table-column label="物联网编号" align="center" prop="iotNo" />
<el-table-column label="备注" align="center" prop="remarksn" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -362,6 +363,7 @@
<el-select v-model="formDetailInfo.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
<el-option label="探测器" value="3" />
</el-select>
</el-form-item>
</el-col>
......@@ -373,6 +375,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="探测介质" prop="detectionMedium" >
<el-input v-model="formDetailInfo.detectionMedium" placeholder="请输入探测介质" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="备注" prop="remarksn">
......@@ -427,6 +437,7 @@ export default {
deviceModel:'',
deviceType:'',
iotNo:'',
detectionMedium:'',
remarksn:''
},
//关联设备下级数据 表单校验
......
......@@ -137,6 +137,26 @@
</el-col>
</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-col :span="11">
<el-form-item label="发证日期" prop="issueDate">
......@@ -211,7 +231,7 @@
</template>
<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 {
name: "Info",
......@@ -219,6 +239,12 @@ export default {
},
data() {
return {
//头像
fileList: [],
//头像数据
fileo :{
name: "",
url:"" },
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -271,6 +297,43 @@ export default {
this.getList();
},
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() {
this.loading = true;
......@@ -285,6 +348,7 @@ export default {
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
......@@ -359,11 +423,40 @@ export default {
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
// 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 => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
// }
}
}
});
......@@ -398,6 +491,87 @@ export default {
}).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 = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.14:8903/gassafety`,
target: `http://222.223.203.154:8092/gassafety`,
target: `http://192.168.2.14:8903/gassafety`,
// target: `http://222.223.203.154:8092/gassafety`,
changeOrigin: true,
pathRewrite: {
['^' + 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