Commit fb6fdeb2 authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of http://111.61.77.35:9999/gengdidi/gassafety into master

parents 10b74a55 ce3b9d97
...@@ -77,7 +77,8 @@ public class CommonController ...@@ -77,7 +77,8 @@ public class CommonController
// String fileName = FileUploadUtils.upload(filePath, file); // String fileName = FileUploadUtils.upload(filePath, file);
// String url = serverConfig.getUrl() + fileName; // String url = serverConfig.getUrl() + fileName;
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file); String fileServer = serverConfig.getUrl().contains("127") && serverConfig.getUrl().contains("8093") && !filePath.contains("/data")? serverConfig.getUrl() : serverConfig.getUrl().replace("127.0.0.1:8903","36.148.23.59:8901");
String url = fileServer + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName); ajax.put("fileName", fileName);
ajax.put("url", url); ajax.put("url", url);
......
package com.zehong.web.controller.dataMonitoring;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TDeviceAlarm;
import com.zehong.system.service.ITDeviceAlarmService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 报警信息Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/dataMonitoring/deviceAlarm")
public class TDeviceAlarmController extends BaseController
{
@Autowired
private ITDeviceAlarmService tDeviceAlarmService;
/**
* 查询报警信息列表
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:list')")
@GetMapping("/list")
public TableDataInfo list(TDeviceAlarm tDeviceAlarm)
{
startPage();
List<TDeviceAlarm> list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm);
return getDataTable(list);
}
/**
* 导出报警信息列表
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:export')")
@Log(title = "报警信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDeviceAlarm tDeviceAlarm)
{
List<TDeviceAlarm> list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm);
ExcelUtil<TDeviceAlarm> util = new ExcelUtil<TDeviceAlarm>(TDeviceAlarm.class);
return util.exportExcel(list, "报警信息数据");
}
/**
* 获取报警信息详细信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:query')")
@GetMapping(value = "/{alarmId}")
public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId)
{
return AjaxResult.success(tDeviceAlarmService.selectTDeviceAlarmById(alarmId));
}
/**
* 新增报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:add')")
@Log(title = "报警信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TDeviceAlarm tDeviceAlarm)
{
return toAjax(tDeviceAlarmService.insertTDeviceAlarm(tDeviceAlarm));
}
/**
* 修改报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:edit')")
@Log(title = "报警信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDeviceAlarm tDeviceAlarm)
{
return toAjax(tDeviceAlarmService.updateTDeviceAlarm(tDeviceAlarm));
}
/**
* 删除报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:remove')")
@Log(title = "报警信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{alarmIds}")
public AjaxResult remove(@PathVariable Long[] alarmIds)
{
return toAjax(tDeviceAlarmService.deleteTDeviceAlarmByIds(alarmIds));
}
}
package com.zehong.web.controller.device; package com.zehong.web.controller.device;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.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;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService; import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import org.springframework.beans.factory.annotation.Autowired;
import com.zehong.common.core.page.TableDataInfo; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/** /**
* 设备信息Controller * 设备信息Controller
...@@ -48,6 +40,16 @@ public class TDeviceInfoController extends BaseController ...@@ -48,6 +40,16 @@ public class TDeviceInfoController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取所有设备信息
* @param tDeviceInfo
* @return
*/
@GetMapping("/deviceListInfo")
public AjaxResult deviceListInfo(TDeviceInfo tDeviceInfo){
return AjaxResult.success(tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo));
}
/** /**
* 导出设备信息列表 * 导出设备信息列表
*/ */
...@@ -79,7 +81,11 @@ public class TDeviceInfoController extends BaseController ...@@ -79,7 +81,11 @@ public class TDeviceInfoController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TDeviceInfo tDeviceInfo) public AjaxResult add(@RequestBody TDeviceInfo tDeviceInfo)
{ {
return toAjax(tDeviceInfoService.insertTDeviceInfo(tDeviceInfo)); int result = tDeviceInfoService.insertTDeviceInfo(tDeviceInfo);
if(result<=0){
new Exception("设备信息插入失败");
}
return AjaxResult.success(tDeviceInfo.getDeviceId());
} }
/** /**
......
package com.zehong.web.controller.deviceInspection;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.service.ITInspectionPlanService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 巡检计划Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/deviceInspection/inspectionPlan")
public class TInspectionPlanController extends BaseController
{
@Autowired
private ITInspectionPlanService tInspectionPlanService;
/**
* 查询巡检计划列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:list')")
@GetMapping("/list")
public TableDataInfo list(TInspectionPlan tInspectionPlan)
{
startPage();
List<TInspectionPlan> list = tInspectionPlanService.selectTInspectionPlanList(tInspectionPlan);
return getDataTable(list);
}
/**
* 导出巡检计划列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:export')")
@Log(title = "巡检计划", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInspectionPlan tInspectionPlan)
{
List<TInspectionPlan> list = tInspectionPlanService.selectTInspectionPlanList(tInspectionPlan);
ExcelUtil<TInspectionPlan> util = new ExcelUtil<TInspectionPlan>(TInspectionPlan.class);
return util.exportExcel(list, "巡检计划数据");
}
/**
* 获取巡检计划详细信息
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:query')")
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") Long planId)
{
return AjaxResult.success(tInspectionPlanService.selectTInspectionPlanById(planId));
}
/**
* 新增巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:add')")
@Log(title = "巡检计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInspectionPlan tInspectionPlan)
{
return toAjax(tInspectionPlanService.insertTInspectionPlan(tInspectionPlan));
}
/**
* 修改巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:edit')")
@Log(title = "巡检计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInspectionPlan tInspectionPlan)
{
return toAjax(tInspectionPlanService.updateTInspectionPlan(tInspectionPlan));
}
/**
* 删除巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:remove')")
@Log(title = "巡检计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable Long[] planIds)
{
return toAjax(tInspectionPlanService.deleteTInspectionPlanByIds(planIds));
}
}
package com.zehong.web.controller.deviceInspection;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TInspector;
import com.zehong.system.service.ITInspectorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 巡检员Controller
*
* @author zehong
* @date 2021-07-08
*/
@RestController
@RequestMapping("/deviceInspection/inspector")
public class TInspectorController extends BaseController
{
@Autowired
private ITInspectorService tInspectorService;
/**
* 查询巡检员列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:list')")
@GetMapping("/list")
public TableDataInfo list(TInspector tInspector)
{
startPage();
List<TInspector> list = tInspectorService.selectTInspectorList(tInspector);
return getDataTable(list);
}
/**
* 导出巡检员列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:export')")
@Log(title = "巡检员", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInspector tInspector)
{
List<TInspector> list = tInspectorService.selectTInspectorList(tInspector);
ExcelUtil<TInspector> util = new ExcelUtil<TInspector>(TInspector.class);
return util.exportExcel(list, "巡检员数据");
}
/**
* 获取巡检员详细信息
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:query')")
@GetMapping(value = "/{inspectorId}")
public AjaxResult getInfo(@PathVariable("inspectorId") Long inspectorId)
{
return AjaxResult.success(tInspectorService.selectTInspectorById(inspectorId));
}
/**
* 新增巡检员
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:add')")
@Log(title = "巡检员", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInspector tInspector)
{
return toAjax(tInspectorService.insertTInspector(tInspector));
}
/**
* 修改巡检员
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:edit')")
@Log(title = "巡检员", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInspector tInspector)
{
return toAjax(tInspectorService.updateTInspector(tInspector));
}
/**
* 删除巡检员
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspector:remove')")
@Log(title = "巡检员", businessType = BusinessType.DELETE)
@DeleteMapping("/{inspectorIds}")
public AjaxResult remove(@PathVariable Long[] inspectorIds)
{
return toAjax(tInspectorService.deleteTInspectorByIds(inspectorIds));
}
}
package com.zehong.web.controller.riskManagement;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.service.ITHiddenTroubleService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 隐患信息Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/riskManagement/hiddenTrouble")
public class THiddenTroubleController extends BaseController
{
@Autowired
private ITHiddenTroubleService tHiddenTroubleService;
/**
* 查询隐患信息列表
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:list')")
@GetMapping("/list")
public TableDataInfo list(THiddenTrouble tHiddenTrouble)
{
startPage();
List<THiddenTrouble> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
return getDataTable(list);
}
/**
* 导出隐患信息列表
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:export')")
@Log(title = "隐患信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(THiddenTrouble tHiddenTrouble)
{
List<THiddenTrouble> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
ExcelUtil<THiddenTrouble> util = new ExcelUtil<THiddenTrouble>(THiddenTrouble.class);
return util.exportExcel(list, "隐患信息数据");
}
/**
* 获取隐患信息详细信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:query')")
@GetMapping(value = "/{troubleId}")
public AjaxResult getInfo(@PathVariable("troubleId") Long troubleId)
{
return AjaxResult.success(tHiddenTroubleService.selectTHiddenTroubleById(troubleId));
}
/**
* 新增隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:add')")
@Log(title = "隐患信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THiddenTrouble tHiddenTrouble)
{
return toAjax(tHiddenTroubleService.insertTHiddenTrouble(tHiddenTrouble));
}
/**
* 修改隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:edit')")
@Log(title = "隐患信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THiddenTrouble tHiddenTrouble)
{
return toAjax(tHiddenTroubleService.updateTHiddenTrouble(tHiddenTrouble));
}
/**
* 删除隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:remove')")
@Log(title = "隐患信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{troubleIds}")
public AjaxResult remove(@PathVariable Long[] troubleIds)
{
return toAjax(tHiddenTroubleService.deleteTHiddenTroubleByIds(troubleIds));
}
}
...@@ -3,6 +3,7 @@ package com.zehong.web.controller.workOrder; ...@@ -3,6 +3,7 @@ package com.zehong.web.controller.workOrder;
import java.util.List; import java.util.List;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.vo.WorkOrderVo;
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.GetMapping;
...@@ -43,7 +44,7 @@ public class TWorkOrderController extends BaseController ...@@ -43,7 +44,7 @@ public class TWorkOrderController extends BaseController
public TableDataInfo list(TWorkOrder tWorkOrder) public TableDataInfo list(TWorkOrder tWorkOrder)
{ {
startPage(); startPage();
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
return getDataTable(list); return getDataTable(list);
} }
...@@ -55,8 +56,8 @@ public class TWorkOrderController extends BaseController ...@@ -55,8 +56,8 @@ public class TWorkOrderController extends BaseController
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder) public AjaxResult export(TWorkOrder tWorkOrder)
{ {
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
ExcelUtil<TWorkOrder> util = new ExcelUtil<TWorkOrder>(TWorkOrder.class); ExcelUtil<WorkOrderVo> util = new ExcelUtil<WorkOrderVo>(WorkOrderVo.class);
return util.exportExcel(list, "工单基础信息数据"); return util.exportExcel(list, "工单基础信息数据");
} }
......
...@@ -8,8 +8,8 @@ zehong: ...@@ -8,8 +8,8 @@ zehong:
copyrightYear: 2021 copyrightYear: 2021
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath) # 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /data/zehong/uploadPath)
profile: D:/zehong/uploadPath profile: /data/zehong/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 报警信息对象 t_device_alarm
*
* @author zehong
* @date 2021-07-21
*/
public class TDeviceAlarm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long alarmId;
/** 设备id */
@Excel(name = "设备id")
private Long deviceId;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 报警类型 */
@Excel(name = "报警类型")
private String alarmType;
/** 报警值(报警信息) */
@Excel(name = "报警值", readConverterExp = "报警信息")
private String alarmValue;
/** 报警开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报警开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 报警结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报警结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setAlarmId(Long alarmId)
{
this.alarmId = alarmId;
}
public Long getAlarmId()
{
return alarmId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setAlarmType(String alarmType)
{
this.alarmType = alarmType;
}
public String getAlarmType()
{
return alarmType;
}
public void setAlarmValue(String alarmValue)
{
this.alarmValue = alarmValue;
}
public String getAlarmValue()
{
return alarmValue;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("alarmId", getAlarmId())
.append("deviceId", getDeviceId())
.append("orderId", getOrderId())
.append("alarmType", getAlarmType())
.append("alarmValue", getAlarmValue())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 隐患信息对象 t_hidden_trouble
*
* @author zehong
* @date 2021-07-21
*/
public class THiddenTrouble extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 隐患信息id */
private Long troubleId;
/** 设备id */
@Excel(name = "设备id")
private Long deviceId;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1=不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setTroubleId(Long troubleId)
{
this.troubleId = troubleId;
}
public Long getTroubleId()
{
return troubleId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("troubleId", getTroubleId())
.append("deviceId", getDeviceId())
.append("orderId", getOrderId())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain; package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel; import com.zehong.common.annotation.Excel;
...@@ -13,7 +9,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -13,7 +9,7 @@ import com.zehong.common.core.domain.BaseEntity;
* 巡检记录对象 t_inspection_data * 巡检记录对象 t_inspection_data
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public class TInspectionData extends BaseEntity public class TInspectionData extends BaseEntity
{ {
...@@ -22,22 +18,17 @@ public class TInspectionData extends BaseEntity ...@@ -22,22 +18,17 @@ public class TInspectionData extends BaseEntity
/** 巡检记录id */ /** 巡检记录id */
private Long dataId; private Long dataId;
/** 巡检员id */ /** 巡检计划id */
@Excel(name = "巡检员id") @Excel(name = "巡检计划id")
private Long inspectorId; private Long planId;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */ /** 设备id */
@Excel(name = "纬度") @Excel(name = "设备id")
private BigDecimal latitude; private Long deviceId;
/** 创建时间 */ /** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") @Excel(name = "处理状态", readConverterExp = "1=不需处理,2已处理完成,3未处理完成")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") private String dealStatus;
private Date createTime;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
...@@ -52,32 +43,32 @@ public class TInspectionData extends BaseEntity ...@@ -52,32 +43,32 @@ public class TInspectionData extends BaseEntity
{ {
return dataId; return dataId;
} }
public void setInspectorId(Long inspectorId) public void setPlanId(Long planId)
{ {
this.inspectorId = inspectorId; this.planId = planId;
} }
public Long getInspectorId() public Long getPlanId()
{ {
return inspectorId; return planId;
} }
public void setLongitude(BigDecimal longitude) public void setDeviceId(Long deviceId)
{ {
this.longitude = longitude; this.deviceId = deviceId;
} }
public BigDecimal getLongitude() public Long getDeviceId()
{ {
return longitude; return deviceId;
} }
public void setLatitude(BigDecimal latitude) public void setDealStatus(String dealStatus)
{ {
this.latitude = latitude; this.dealStatus = dealStatus;
} }
public BigDecimal getLatitude() public String getDealStatus()
{ {
return latitude; return dealStatus;
} }
public void setRemarks(String remarks) public void setRemarks(String remarks)
{ {
...@@ -89,21 +80,14 @@ public class TInspectionData extends BaseEntity ...@@ -89,21 +80,14 @@ public class TInspectionData extends BaseEntity
return remarks; return remarks;
} }
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dataId", getDataId()) .append("dataId", getDataId())
.append("inspectorId", getInspectorId()) .append("planId", getPlanId())
.append("longitude", getLongitude()) .append("deviceId", getDeviceId())
.append("latitude", getLatitude()) .append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("remarks", getRemarks()) .append("remarks", getRemarks())
.toString(); .toString();
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 巡检计划对象 t_inspection_plan
*
* @author zehong
* @date 2021-07-21
*/
public class TInspectionPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 巡检计划id */
private Long planId;
/** 巡检计划名称 */
@Excel(name = "巡检计划名称")
private String planName;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 状态 */
@Excel(name = "状态")
private String planStatus;
/** 计划描述 */
@Excel(name = "计划描述")
private String remarks;
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setPlanName(String planName)
{
this.planName = planName;
}
public String getPlanName()
{
return planName;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setPlanStatus(String planStatus)
{
this.planStatus = planStatus;
}
public String getPlanStatus()
{
return planStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planId", getPlanId())
.append("planName", getPlanName())
.append("orderId", getOrderId())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("planStatus", getPlanStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 巡检员对象 t_inspector
*
* @author zehong
* @date 2021-07-08
*/
public class TInspector extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 巡检员id */
private Long inspectorId;
/** 企业id */
@Excel(name = "企业id")
private Long enterpriseId;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setInspectorId(Long inspectorId)
{
this.inspectorId = inspectorId;
}
public Long getInspectorId()
{
return inspectorId;
}
public void setEnterpriseId(Long enterpriseId)
{
this.enterpriseId = enterpriseId;
}
public Long getEnterpriseId()
{
return enterpriseId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("inspectorId", getInspectorId())
.append("enterpriseId", getEnterpriseId())
.append("name", getName())
.append("phone", getPhone())
.append("remarks", getRemarks())
.toString();
}
}
...@@ -33,8 +33,8 @@ public class TOrderFeedback extends BaseEntity ...@@ -33,8 +33,8 @@ public class TOrderFeedback extends BaseEntity
private String contents; private String contents;
/** 反馈时间 */ /** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "反馈时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "反馈时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime; private Date feedbackTime;
/** 是否存在隐患(0正常,1存在隐患) */ /** 是否存在隐患(0正常,1存在隐患) */
......
...@@ -50,7 +50,7 @@ public class TWorkOrder extends BaseEntity ...@@ -50,7 +50,7 @@ public class TWorkOrder extends BaseEntity
private Long actualInspector; private Long actualInspector;
/** 实际接收时间 */ /** 实际接收时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualTime; private Date actualTime;
......
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 工单基础信息对象 t_work_order
*
* @author zehong
* @date 2021-07-19
*/
public class WorkOrderVo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工单id */
private String orderId;
/** 工单类型(1巡检信息,2隐患信息,3报警信息) */
@Excel(name = "工单类型", readConverterExp = "1=巡检信息,2隐患信息,3报警信息")
private String orderType;
/** 源id */
@Excel(name = "源id")
private Long resourceId;
/** 工单名称 */
@Excel(name = "工单名称")
private String orderName;
/** 工单状态(0未下发,1已下发,2已接受,3进行中,4已反馈,5已归档) */
@Excel(name = "工单状态", readConverterExp = "0未下发,1已下发,2已接受,3进行中,4已反馈,5已归档")
private String orderStatus;
/** 指定执行人员(巡检员id) */
private Long appointInspector;
/** 指定执行人员姓名 */
@Excel(name = "指定执行人员")
private String appointInspectorName;
/** 下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date allotTime;
/** 实际接收人员(巡检员id) */
private Long actualInspector;
/** 实际接收人员姓名 */
@Excel(name = "实际接收人员")
private String actualInspectorName;
/** 实际接收时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public Long getResourceId() {
return resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
public void setOrderName(String orderName)
{
this.orderName = orderName;
}
public String getOrderName()
{
return orderName;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setAppointInspector(Long appointInspector)
{
this.appointInspector = appointInspector;
}
public Long getAppointInspector()
{
return appointInspector;
}
public void setAllotTime(Date allotTime)
{
this.allotTime = allotTime;
}
public Date getAllotTime()
{
return allotTime;
}
public void setActualInspector(Long actualInspector)
{
this.actualInspector = actualInspector;
}
public Long getActualInspector()
{
return actualInspector;
}
public void setActualTime(Date actualTime)
{
this.actualTime = actualTime;
}
public Date getActualTime()
{
return actualTime;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public String getAppointInspectorName() {
return appointInspectorName;
}
public void setAppointInspectorName(String appointInspectorName) {
this.appointInspectorName = appointInspectorName;
}
public String getActualInspectorName() {
return actualInspectorName;
}
public void setActualInspectorName(String actualInspectorName) {
this.actualInspectorName = actualInspectorName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("orderId", getOrderId())
.append("orderType", getOrderType())
.append("orderName", getOrderName())
.append("orderStatus", getOrderStatus())
.append("createTime", getCreateTime())
.append("appointInspector", getAppointInspector())
.append("appointInspectorName", getAppointInspectorName())
.append("allotTime", getAllotTime())
.append("actualInspector", getActualInspector())
.append("actualInspectorName", getActualInspectorName())
.append("actualTime", getActualTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TDeviceAlarm;
/**
* 报警信息Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface TDeviceAlarmMapper
{
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId);
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息集合
*/
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm);
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 删除报警信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmById(Long alarmId);
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的数据ID
* @return 结果
*/
public int deleteTDeviceAlarmByIds(Long[] alarmIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
/**
* 隐患信息Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface THiddenTroubleMapper
{
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
public THiddenTrouble selectTHiddenTroubleById(Long troubleId);
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息集合
*/
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 删除隐患信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleById(Long troubleId);
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的数据ID
* @return 结果
*/
public int deleteTHiddenTroubleByIds(Long[] troubleIds);
}
...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData; ...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData;
* 巡检记录Mapper接口 * 巡检记录Mapper接口
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public interface TInspectionDataMapper public interface TInspectionDataMapper
{ {
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInspectionPlan;
/**
* 巡检计划Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface TInspectionPlanMapper
{
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
public TInspectionPlan selectTInspectionPlanById(Long planId);
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划集合
*/
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan);
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 删除巡检计划
*
* @param planId 巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanById(Long planId);
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的数据ID
* @return 结果
*/
public int deleteTInspectionPlanByIds(Long[] planIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInspector;
/**
* 巡检员Mapper接口
*
* @author zehong
* @date 2021-07-08
*/
public interface TInspectorMapper
{
/**
* 查询巡检员
*
* @param inspectorId 巡检员ID
* @return 巡检员
*/
public TInspector selectTInspectorById(Long inspectorId);
/**
* 查询巡检员列表
*
* @param tInspector 巡检员
* @return 巡检员集合
*/
public List<TInspector> selectTInspectorList(TInspector tInspector);
/**
* 新增巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
public int insertTInspector(TInspector tInspector);
/**
* 修改巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
public int updateTInspector(TInspector tInspector);
/**
* 删除巡检员
*
* @param inspectorId 巡检员ID
* @return 结果
*/
public int deleteTInspectorById(Long inspectorId);
/**
* 批量删除巡检员
*
* @param inspectorIds 需要删除的数据ID
* @return 结果
*/
public int deleteTInspectorByIds(Long[] inspectorIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDeviceAlarm;
/**
* 报警信息Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITDeviceAlarmService
{
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId);
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息集合
*/
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm);
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmByIds(Long[] alarmIds);
/**
* 删除报警信息信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmById(Long alarmId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
/**
* 隐患信息Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITHiddenTroubleService
{
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
public THiddenTrouble selectTHiddenTroubleById(Long troubleId);
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息集合
*/
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleByIds(Long[] troubleIds);
/**
* 删除隐患信息信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleById(Long troubleId);
}
...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData; ...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData;
* 巡检记录Service接口 * 巡检记录Service接口
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public interface ITInspectionDataService public interface ITInspectionDataService
{ {
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TInspectionPlan;
/**
* 巡检计划Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITInspectionPlanService
{
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
public TInspectionPlan selectTInspectionPlanById(Long planId);
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划集合
*/
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan);
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanByIds(Long[] planIds);
/**
* 删除巡检计划信息
*
* @param planId 巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanById(Long planId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TInspector;
/**
* 巡检员Service接口
*
* @author zehong
* @date 2021-07-08
*/
public interface ITInspectorService
{
/**
* 查询巡检员
*
* @param inspectorId 巡检员ID
* @return 巡检员
*/
public TInspector selectTInspectorById(Long inspectorId);
/**
* 查询巡检员列表
*
* @param tInspector 巡检员
* @return 巡检员集合
*/
public List<TInspector> selectTInspectorList(TInspector tInspector);
/**
* 新增巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
public int insertTInspector(TInspector tInspector);
/**
* 修改巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
public int updateTInspector(TInspector tInspector);
/**
* 批量删除巡检员
*
* @param inspectorIds 需要删除的巡检员ID
* @return 结果
*/
public int deleteTInspectorByIds(Long[] inspectorIds);
/**
* 删除巡检员信息
*
* @param inspectorId 巡检员ID
* @return 结果
*/
public int deleteTInspectorById(Long inspectorId);
}
...@@ -2,6 +2,7 @@ package com.zehong.system.service; ...@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.WorkOrderVo;
/** /**
* 工单基础信息Service接口 * 工单基础信息Service接口
...@@ -24,7 +25,7 @@ public interface ITWorkOrderService ...@@ -24,7 +25,7 @@ public interface ITWorkOrderService
* @param orderId 工单基础信息ID * @param orderId 工单基础信息ID
* @return 工单基础信息 * @return 工单基础信息
*/ */
public TWorkOrder selectTWorkOrderById(String orderId); public WorkOrderVo selectTWorkOrderById(String orderId);
/** /**
* 查询工单基础信息列表 * 查询工单基础信息列表
...@@ -32,7 +33,7 @@ public interface ITWorkOrderService ...@@ -32,7 +33,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息 * @param tWorkOrder 工单基础信息
* @return 工单基础信息集合 * @return 工单基础信息集合
*/ */
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder); public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder);
/** /**
* 新增工单基础信息 * 新增工单基础信息
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceAlarmMapper;
import com.zehong.system.domain.TDeviceAlarm;
import com.zehong.system.service.ITDeviceAlarmService;
/**
* 报警信息Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
{
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
@Override
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId)
{
return tDeviceAlarmMapper.selectTDeviceAlarmById(alarmId);
}
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息
*/
@Override
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm)
{
return tDeviceAlarmMapper.selectTDeviceAlarmList(tDeviceAlarm);
}
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
@Override
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm)
{
tDeviceAlarm.setCreateTime(DateUtils.getNowDate());
return tDeviceAlarmMapper.insertTDeviceAlarm(tDeviceAlarm);
}
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
@Override
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm)
{
tDeviceAlarm.setUpdateTime(DateUtils.getNowDate());
return tDeviceAlarmMapper.updateTDeviceAlarm(tDeviceAlarm);
}
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的报警信息ID
* @return 结果
*/
@Override
public int deleteTDeviceAlarmByIds(Long[] alarmIds)
{
return tDeviceAlarmMapper.deleteTDeviceAlarmByIds(alarmIds);
}
/**
* 删除报警信息信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
@Override
public int deleteTDeviceAlarmById(Long alarmId)
{
return tDeviceAlarmMapper.deleteTDeviceAlarmById(alarmId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.THiddenTroubleMapper;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.service.ITHiddenTroubleService;
/**
* 隐患信息Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
{
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
@Override
public THiddenTrouble selectTHiddenTroubleById(Long troubleId)
{
return tHiddenTroubleMapper.selectTHiddenTroubleById(troubleId);
}
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息
*/
@Override
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble)
{
return tHiddenTroubleMapper.selectTHiddenTroubleList(tHiddenTrouble);
}
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
@Override
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble)
{
tHiddenTrouble.setCreateTime(DateUtils.getNowDate());
return tHiddenTroubleMapper.insertTHiddenTrouble(tHiddenTrouble);
}
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
@Override
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble)
{
tHiddenTrouble.setUpdateTime(DateUtils.getNowDate());
return tHiddenTroubleMapper.updateTHiddenTrouble(tHiddenTrouble);
}
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的隐患信息ID
* @return 结果
*/
@Override
public int deleteTHiddenTroubleByIds(Long[] troubleIds)
{
return tHiddenTroubleMapper.deleteTHiddenTroubleByIds(troubleIds);
}
/**
* 删除隐患信息信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
@Override
public int deleteTHiddenTroubleById(Long troubleId)
{
return tHiddenTroubleMapper.deleteTHiddenTroubleById(troubleId);
}
}
...@@ -12,7 +12,7 @@ import com.zehong.system.service.ITInspectionDataService; ...@@ -12,7 +12,7 @@ import com.zehong.system.service.ITInspectionDataService;
* 巡检记录Service业务层处理 * 巡检记录Service业务层处理
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
@Service @Service
public class TInspectionDataServiceImpl implements ITInspectionDataService public class TInspectionDataServiceImpl implements ITInspectionDataService
...@@ -66,6 +66,7 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService ...@@ -66,6 +66,7 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService
@Override @Override
public int updateTInspectionData(TInspectionData tInspectionData) public int updateTInspectionData(TInspectionData tInspectionData)
{ {
tInspectionData.setUpdateTime(DateUtils.getNowDate());
return tInspectionDataMapper.updateTInspectionData(tInspectionData); return tInspectionDataMapper.updateTInspectionData(tInspectionData);
} }
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TInspectionPlanMapper;
import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.service.ITInspectionPlanService;
/**
* 巡检计划Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class TInspectionPlanServiceImpl implements ITInspectionPlanService
{
@Autowired
private TInspectionPlanMapper tInspectionPlanMapper;
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
@Override
public TInspectionPlan selectTInspectionPlanById(Long planId)
{
return tInspectionPlanMapper.selectTInspectionPlanById(planId);
}
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划
*/
@Override
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan)
{
return tInspectionPlanMapper.selectTInspectionPlanList(tInspectionPlan);
}
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
@Override
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan)
{
tInspectionPlan.setCreateTime(DateUtils.getNowDate());
return tInspectionPlanMapper.insertTInspectionPlan(tInspectionPlan);
}
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
@Override
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan)
{
tInspectionPlan.setUpdateTime(DateUtils.getNowDate());
return tInspectionPlanMapper.updateTInspectionPlan(tInspectionPlan);
}
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的巡检计划ID
* @return 结果
*/
@Override
public int deleteTInspectionPlanByIds(Long[] planIds)
{
return tInspectionPlanMapper.deleteTInspectionPlanByIds(planIds);
}
/**
* 删除巡检计划信息
*
* @param planId 巡检计划ID
* @return 结果
*/
@Override
public int deleteTInspectionPlanById(Long planId)
{
return tInspectionPlanMapper.deleteTInspectionPlanById(planId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TInspectorMapper;
import com.zehong.system.domain.TInspector;
import com.zehong.system.service.ITInspectorService;
/**
* 巡检员Service业务层处理
*
* @author zehong
* @date 2021-07-08
*/
@Service
public class TInspectorServiceImpl implements ITInspectorService
{
@Autowired
private TInspectorMapper tInspectorMapper;
/**
* 查询巡检员
*
* @param inspectorId 巡检员ID
* @return 巡检员
*/
@Override
public TInspector selectTInspectorById(Long inspectorId)
{
return tInspectorMapper.selectTInspectorById(inspectorId);
}
/**
* 查询巡检员列表
*
* @param tInspector 巡检员
* @return 巡检员
*/
@Override
public List<TInspector> selectTInspectorList(TInspector tInspector)
{
return tInspectorMapper.selectTInspectorList(tInspector);
}
/**
* 新增巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
@Override
public int insertTInspector(TInspector tInspector)
{
return tInspectorMapper.insertTInspector(tInspector);
}
/**
* 修改巡检员
*
* @param tInspector 巡检员
* @return 结果
*/
@Override
public int updateTInspector(TInspector tInspector)
{
return tInspectorMapper.updateTInspector(tInspector);
}
/**
* 批量删除巡检员
*
* @param inspectorIds 需要删除的巡检员ID
* @return 结果
*/
@Override
public int deleteTInspectorByIds(Long[] inspectorIds)
{
return tInspectorMapper.deleteTInspectorByIds(inspectorIds);
}
/**
* 删除巡检员信息
*
* @param inspectorId 巡检员ID
* @return 结果
*/
@Override
public int deleteTInspectorById(Long inspectorId)
{
return tInspectorMapper.deleteTInspectorById(inspectorId);
}
}
...@@ -52,6 +52,13 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -52,6 +52,13 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
@Override @Override
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{ {
Long deviceId = tOrderFeedback.getDeviceId();
// 更改巡检记录状态
if(deviceId != 0L){
String dealStatus = tOrderFeedback.getDealStatus();
}
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback); return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
} }
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.ExceptionUtil; import com.zehong.common.utils.ExceptionUtil;
import com.zehong.common.utils.StringUtils; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.vo.WorkOrderVo;
import com.zehong.system.mapper.SysUserMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TWorkOrderMapper; import com.zehong.system.mapper.TWorkOrderMapper;
...@@ -21,6 +27,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -21,6 +27,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
{ {
@Autowired @Autowired
private TWorkOrderMapper tWorkOrderMapper; private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* 获取工单基础信息id * 获取工单基础信息id
...@@ -40,9 +48,35 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -40,9 +48,35 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息 * @return 工单基础信息
*/ */
@Override @Override
public TWorkOrder selectTWorkOrderById(String orderId) public WorkOrderVo selectTWorkOrderById(String orderId)
{ {
return tWorkOrderMapper.selectTWorkOrderById(orderId); WorkOrderVo workOrderVo = new WorkOrderVo();
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(orderId);
BeanUtils.copyProperties(tWorkOrder, workOrderVo);
// 获取巡检员姓名
SysUser appointInspector = sysUserMapper.selectUserById(tWorkOrder.getAppointInspector());
workOrderVo.setAppointInspectorName(appointInspector.getNickName());
if(tWorkOrder.getActualInspector() != tWorkOrder.getAppointInspector() && tWorkOrder.getActualInspector() != null){
SysUser actualInspector = sysUserMapper.selectUserById(tWorkOrder.getActualInspector());
workOrderVo.setActualInspectorName(actualInspector.getNickName());
} else {
workOrderVo.setActualInspectorName(appointInspector.getNickName());
}
// 获取源数据(1巡检信息,2隐患信息,3报警信息)
String orderType = tWorkOrder.getOrderType();
if("1".equals(orderType)){
} else if("2".equals(orderType)) {
} else {
}
return workOrderVo;
} }
/** /**
...@@ -52,9 +86,32 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -52,9 +86,32 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息 * @return 工单基础信息
*/ */
@Override @Override
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder) public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder)
{ {
return tWorkOrderMapper.selectTWorkOrderList(tWorkOrder); List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
if(workOrderList.size() != 0){
for(TWorkOrder workOrder : workOrderList){
WorkOrderVo workOrderVo = new WorkOrderVo();
BeanUtils.copyProperties(workOrder, workOrderVo);
// 获取巡检员姓名
SysUser appointInspector = sysUserMapper.selectUserById(workOrder.getAppointInspector());
workOrderVo.setAppointInspectorName(appointInspector.getNickName());
if(workOrder.getActualInspector() != workOrder.getAppointInspector() && workOrder.getActualInspector() != null){
SysUser actualInspector = sysUserMapper.selectUserById(tWorkOrder.getActualInspector());
workOrderVo.setActualInspectorName(actualInspector.getNickName());
} else {
workOrderVo.setActualInspectorName(appointInspector.getNickName());
}
workOrderVoList.add(workOrderVo);
}
}
return workOrderVoList;
} }
/** /**
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TDeviceAlarmMapper">
<resultMap type="TDeviceAlarm" id="TDeviceAlarmResult">
<result property="alarmId" column="alarm_id" />
<result property="deviceId" column="device_id" />
<result property="orderId" column="order_id" />
<result property="alarmType" column="alarm_type" />
<result property="alarmValue" column="alarm_value" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTDeviceAlarmVo">
select alarm_id, device_id, order_id, alarm_type, alarm_value, start_time, end_time, deal_status, update_time, create_time, remarks from t_device_alarm
</sql>
<select id="selectTDeviceAlarmList" parameterType="TDeviceAlarm" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
<if test="alarmValue != null and alarmValue != ''"> and alarm_value = #{alarmValue}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTDeviceAlarmById" parameterType="Long" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
where alarm_id = #{alarmId}
</select>
<insert id="insertTDeviceAlarm" parameterType="TDeviceAlarm" useGeneratedKeys="true" keyProperty="alarmId">
insert into t_device_alarm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="orderId != null">order_id,</if>
<if test="alarmType != null">alarm_type,</if>
<if test="alarmValue != null">alarm_value,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="alarmType != null">#{alarmType},</if>
<if test="alarmValue != null">#{alarmValue},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTDeviceAlarm" parameterType="TDeviceAlarm">
update t_device_alarm
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="alarmType != null">alarm_type = #{alarmType},</if>
<if test="alarmValue != null">alarm_value = #{alarmValue},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where alarm_id = #{alarmId}
</update>
<delete id="deleteTDeviceAlarmById" parameterType="Long">
delete from t_device_alarm where alarm_id = #{alarmId}
</delete>
<delete id="deleteTDeviceAlarmByIds" parameterType="String">
delete from t_device_alarm where alarm_id in
<foreach item="alarmId" collection="array" open="(" separator="," close=")">
#{alarmId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.THiddenTroubleMapper">
<resultMap type="THiddenTrouble" id="THiddenTroubleResult">
<result property="troubleId" column="trouble_id" />
<result property="deviceId" column="device_id" />
<result property="orderId" column="order_id" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTHiddenTroubleVo">
select trouble_id, device_id, order_id, longitude, latitude, deal_status, update_time, create_time, remarks from t_hidden_trouble
</sql>
<select id="selectTHiddenTroubleList" parameterType="THiddenTrouble" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTHiddenTroubleById" parameterType="Long" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
where trouble_id = #{troubleId}
</select>
<insert id="insertTHiddenTrouble" parameterType="THiddenTrouble" useGeneratedKeys="true" keyProperty="troubleId">
insert into t_hidden_trouble
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="orderId != null">order_id,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTHiddenTrouble" parameterType="THiddenTrouble">
update t_hidden_trouble
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where trouble_id = #{troubleId}
</update>
<delete id="deleteTHiddenTroubleById" parameterType="Long">
delete from t_hidden_trouble where trouble_id = #{troubleId}
</delete>
<delete id="deleteTHiddenTroubleByIds" parameterType="String">
delete from t_hidden_trouble where trouble_id in
<foreach item="troubleId" collection="array" open="(" separator="," close=")">
#{troubleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -6,23 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,23 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TInspectionData" id="TInspectionDataResult"> <resultMap type="TInspectionData" id="TInspectionDataResult">
<result property="dataId" column="data_id" /> <result property="dataId" column="data_id" />
<result property="inspectorId" column="inspector_id" /> <result property="planId" column="plan_id" />
<result property="longitude" column="longitude" /> <result property="deviceId" column="device_id" />
<result property="latitude" column="latitude" /> <result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
</resultMap> </resultMap>
<sql id="selectTInspectionDataVo"> <sql id="selectTInspectionDataVo">
select data_id, inspector_id, longitude, latitude, create_time, remarks from t_inspection_data select data_id, plan_id, device_id, deal_status, update_time, create_time, remarks from t_inspection_data
</sql> </sql>
<select id="selectTInspectionDataList" parameterType="TInspectionData" resultMap="TInspectionDataResult"> <select id="selectTInspectionDataList" parameterType="TInspectionData" resultMap="TInspectionDataResult">
<include refid="selectTInspectionDataVo"/> <include refid="selectTInspectionDataVo"/>
<where> <where>
<if test="inspectorId != null "> and inspector_id = #{inspectorId}</if> <if test="planId != null "> and plan_id = #{planId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if> <if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="latitude != null "> and latitude = #{latitude}</if> <if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
</select> </select>
...@@ -36,17 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,17 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into t_inspection_data insert into t_inspection_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataId != null">data_id,</if> <if test="dataId != null">data_id,</if>
<if test="inspectorId != null">inspector_id,</if> <if test="planId != null">plan_id,</if>
<if test="longitude != null">longitude,</if> <if test="deviceId != null">device_id,</if>
<if test="latitude != null">latitude,</if> <if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dataId != null">#{dataId},</if> <if test="dataId != null">#{dataId},</if>
<if test="inspectorId != null">#{inspectorId},</if> <if test="planId != null">#{planId},</if>
<if test="longitude != null">#{longitude},</if> <if test="deviceId != null">#{deviceId},</if>
<if test="latitude != null">#{latitude},</if> <if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
</trim> </trim>
...@@ -55,9 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,9 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTInspectionData" parameterType="TInspectionData"> <update id="updateTInspectionData" parameterType="TInspectionData">
update t_inspection_data update t_inspection_data
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="inspectorId != null">inspector_id = #{inspectorId},</if> <if test="planId != null">plan_id = #{planId},</if>
<if test="longitude != null">longitude = #{longitude},</if> <if test="deviceId != null">device_id = #{deviceId},</if>
<if test="latitude != null">latitude = #{latitude},</if> <if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
</trim> </trim>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TInspectionPlanMapper">
<resultMap type="TInspectionPlan" id="TInspectionPlanResult">
<result property="planId" column="plan_id" />
<result property="planName" column="plan_name" />
<result property="orderId" column="order_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="planStatus" column="plan_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTInspectionPlanVo">
select plan_id, plan_name, order_id, start_time, end_time, plan_status, update_time, create_time, remarks from t_inspection_plan
</sql>
<select id="selectTInspectionPlanList" parameterType="TInspectionPlan" resultMap="TInspectionPlanResult">
<include refid="selectTInspectionPlanVo"/>
<where>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTInspectionPlanById" parameterType="Long" resultMap="TInspectionPlanResult">
<include refid="selectTInspectionPlanVo"/>
where plan_id = #{planId}
</select>
<insert id="insertTInspectionPlan" parameterType="TInspectionPlan" useGeneratedKeys="true" keyProperty="planId">
insert into t_inspection_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planName != null">plan_name,</if>
<if test="orderId != null">order_id,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="planStatus != null">plan_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planName != null">#{planName},</if>
<if test="orderId != null">#{orderId},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="planStatus != null">#{planStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTInspectionPlan" parameterType="TInspectionPlan">
update t_inspection_plan
<trim prefix="SET" suffixOverrides=",">
<if test="planName != null">plan_name = #{planName},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="planStatus != null">plan_status = #{planStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where plan_id = #{planId}
</update>
<delete id="deleteTInspectionPlanById" parameterType="Long">
delete from t_inspection_plan where plan_id = #{planId}
</delete>
<delete id="deleteTInspectionPlanByIds" parameterType="String">
delete from t_inspection_plan where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TInspectorMapper">
<resultMap type="TInspector" id="TInspectorResult">
<result property="inspectorId" column="inspector_id" />
<result property="enterpriseId" column="enterprise_id" />
<result property="name" column="name" />
<result property="phone" column="phone" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTInspectorVo">
select inspector_id, enterprise_id, name, phone, remarks from t_inspector
</sql>
<select id="selectTInspectorList" parameterType="TInspector" resultMap="TInspectorResult">
<include refid="selectTInspectorVo"/>
<where>
<if test="enterpriseId != null "> and enterprise_id = #{enterpriseId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTInspectorById" parameterType="Long" resultMap="TInspectorResult">
<include refid="selectTInspectorVo"/>
where inspector_id = #{inspectorId}
</select>
<insert id="insertTInspector" parameterType="TInspector" useGeneratedKeys="true" keyProperty="inspectorId">
insert into t_inspector
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id,</if>
<if test="name != null">name,</if>
<if test="phone != null">phone,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="name != null">#{name},</if>
<if test="phone != null">#{phone},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTInspector" parameterType="TInspector">
update t_inspector
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
<if test="name != null">name = #{name},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where inspector_id = #{inspectorId}
</update>
<delete id="deleteTInspectorById" parameterType="Long">
delete from t_inspector where inspector_id = #{inspectorId}
</delete>
<delete id="deleteTInspectorByIds" parameterType="String">
delete from t_inspector where inspector_id in
<foreach item="inspectorId" collection="array" open="(" separator="," close=")">
#{inspectorId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request' import request from '@/utils/request'
// 查询巡检员列表 // 查询报警信息列表
export function listInspector(query) { export function listDeviceAlarm(query) {
return request({ return request({
url: '/deviceInspection/inspector/list', url: '/dataMonitoring/deviceAlarm/list',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询巡检员详细 // 查询报警信息详细
export function getInspector(inspectorId) { export function getDeviceAlarm(alarmId) {
return request({ return request({
url: '/deviceInspection/inspector/' + inspectorId, url: '/dataMonitoring/deviceAlarm/' + alarmId,
method: 'get' method: 'get'
}) })
} }
// 新增巡检员 // 新增报警信息
export function addInspector(data) { export function addDeviceAlarm(data) {
return request({ return request({
url: '/deviceInspection/inspector', url: '/dataMonitoring/deviceAlarm',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 修改巡检员 // 修改报警信息
export function updateInspector(data) { export function updateDeviceAlarm(data) {
return request({ return request({
url: '/deviceInspection/inspector', url: '/dataMonitoring/deviceAlarm',
method: 'put', method: 'put',
data: data data: data
}) })
} }
// 删除巡检员 // 删除报警信息
export function delInspector(inspectorId) { export function delDeviceAlarm(alarmId) {
return request({ return request({
url: '/deviceInspection/inspector/' + inspectorId, url: '/dataMonitoring/deviceAlarm/' + alarmId,
method: 'delete' method: 'delete'
}) })
} }
// 导出巡检员 // 导出报警信息
export function exportInspector(query) { export function exportDeviceAlarm(query) {
return request({ return request({
url: '/deviceInspection/inspector/export', url: '/dataMonitoring/deviceAlarm/export',
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file
...@@ -9,6 +9,15 @@ export function listDeviceInfo(query) { ...@@ -9,6 +9,15 @@ export function listDeviceInfo(query) {
}) })
} }
// 查询设备信息列表
export function getAllDeviceInfo(query) {
return request({
url: '/device/deviceInfo/deviceListInfo',
method: 'get',
params: query
})
}
// 查询设备信息详细 // 查询设备信息详细
export function getDeviceInfo(deviceId) { export function getDeviceInfo(deviceId) {
return request({ return request({
......
import request from '@/utils/request'
// 查询巡检计划列表
export function listInspectionPlan(query) {
return request({
url: '/deviceInspection/inspectionPlan/list',
method: 'get',
params: query
})
}
// 查询巡检计划详细
export function getInspectionPlan(planId) {
return request({
url: '/deviceInspection/inspectionPlan/' + planId,
method: 'get'
})
}
// 新增巡检计划
export function addInspectionPlan(data) {
return request({
url: '/deviceInspection/inspectionPlan',
method: 'post',
data: data
})
}
// 修改巡检计划
export function updateInspectionPlan(data) {
return request({
url: '/deviceInspection/inspectionPlan',
method: 'put',
data: data
})
}
// 删除巡检计划
export function delInspectionPlan(planId) {
return request({
url: '/deviceInspection/inspectionPlan/' + planId,
method: 'delete'
})
}
// 导出巡检计划
export function exportInspectionPlan(query) {
return request({
url: '/deviceInspection/inspectionPlan/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询隐患信息列表
export function listHiddenTrouble(query) {
return request({
url: '/riskManagement/hiddenTrouble/list',
method: 'get',
params: query
})
}
// 查询隐患信息详细
export function getHiddenTrouble(troubleId) {
return request({
url: '/riskManagement/hiddenTrouble/' + troubleId,
method: 'get'
})
}
// 新增隐患信息
export function addHiddenTrouble(data) {
return request({
url: '/riskManagement/hiddenTrouble',
method: 'post',
data: data
})
}
// 修改隐患信息
export function updateHiddenTrouble(data) {
return request({
url: '/riskManagement/hiddenTrouble',
method: 'put',
data: data
})
}
// 删除隐患信息
export function delHiddenTrouble(troubleId) {
return request({
url: '/riskManagement/hiddenTrouble/' + troubleId,
method: 'delete'
})
}
// 导出隐患信息
export function exportHiddenTrouble(query) {
return request({
url: '/riskManagement/hiddenTrouble/export',
method: 'get',
params: query
})
}
\ No newline at end of file
<template>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-form ref="editForm" :model="editForm" label-width="120px" size="mini">
<el-form-item label="所属燃气公司" prop="a">
<el-input></el-input>
</el-form-item>
<el-form-item label="姓名" prop="d">
<el-input></el-input>
</el-form-item>
<el-form-item label="电话" prop="e">
<el-input></el-input>
</el-form-item>
<el-form-item label="备注信息" prop="l">
<el-input type="textarea"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
title: { type: String }
},
data () {
return {
// isShow: false,
editForm : {},
dialogVisible : false
}
},
methods: {
show () {
this.dialogVisible = true;
},
hide () {
this.remove()
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.remove();
//done();
})
.catch(_ => {});
}
}
}
</script>
<template>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-form ref="editForm" :model="editForm" label-width="120px" size="mini">
<el-form-item label="所属燃气公司" prop="enterpriseId">
<el-input v-model="editForm.enterpriseId"></el-input>
</el-form-item>
<el-form-item label="名称" prop="deviceName">
<el-input v-model="editForm.deviceName"></el-input>
</el-form-item>
<el-form-item label="地址" prop="deviceAddr">
<el-input v-model="editForm.deviceAddr"></el-input>
</el-form-item>
<el-form-item label="所属管道" prop="pipeId">
<el-input v-model="editForm.pipeId"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="editForm.linkman"></el-input>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="editForm.phone"></el-input>
</el-form-item>
<el-form-item label="型号" prop="deviceModel">
<el-input v-model="editForm.deviceModel"></el-input>
</el-form-item>
<el-form-item label="经纬度" prop="deviceModel">
<el-row>
<el-col :span="6" style="margin-right: 10px">
<el-input v-model="editForm.longitude"></el-input>
</el-col>
<el-col :span="6">
<el-input v-model="editForm.latitude"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="安装日期" prop="installationTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.installationTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="最后巡检日期" prop="inspectionTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.inspectionTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="备注信息" prop="remarks">
<el-input type="textarea" v-model="editForm.remarks"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
title: { type: String }
},
data () {
return {
// isShow: false,
editForm : {},
dialogVisible : false
}
},
methods: {
show () {
this.dialogVisible = true;
},
hide () {
this.remove()
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.remove();
//done();
})
.catch(_ => {});
}
}
}
</script>
<template>
<div class="wrapper">
<div class="top display-default">
<div class="left text">裕华路地埋管线</div>
<div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" />
</div>
</div>
<!-- 设备信息 -->
<div class="eq-content display-default">
<div class="text-wrapper">
<div class="eq-text">设备编号:<span>aa</span></div>
<div class="eq-text">设备名称:<span>裕华路地埋管线</span></div>
<div class="eq-text">监测介质:<span>甲烷</span></div>
<div class="eq-text">设备状态:<span>报警</span></div>
<div class="eq-text">用户信息:<span>中厨燃气</span></div>
</div>
<div class="pic">
<img src="" alt="" />
</div>
</div>
<!-- 维修人员 -->
<div class="maintain-content">
<div>姓名: <span>高雄</span></div>
<div>电话: <span>13512451234</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<!-- 报警状态 -->
<div class="warn-content">
<div>报警状态 <span>报警</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<div class="btn">
<el-button class="elbtn" type="primary">生成工单</el-button>
</div>
</div>
</template>
<script>
//line移入时的的infowindow
export default {
props: {
obj: { typs: Object },
},
};
</script>
<style lang="scss" scoped>
.wrapper {
width: 406px;
height: 488px;
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
.text {
font-weight: 600;
font-size: 16px;
color: #ffffff;
line-height: 51px;
}
.left {
padding-left: 22px;
}
.right {
padding-right: 16px;
}
}
.eq-content {
height: 156px;
box-sizing: border-box;
padding: 13px 16px 13px 22px;
border-bottom: 1px solid #e2e2e2;
.text-wrapper {
padding-top: 1px;
& > div {
margin-bottom: 6px;
}
.eq-text {
font-size: 14px;
font-weight: 400;
color: #1d1d1d;
opacity: 1;
}
}
.pic {
width: 177px;
height: 129px;
background-color: black;
img {
width: 100%;
}
}
}
.maintain-content {
width: 100%;
height: 109px;
padding-left: 22px;
padding-top: 16px;
box-sizing: border-box;
border-bottom: 1px solid #e2e2e2;
& > div {
margin-bottom: 8px;
font-size: 14px;
font-weight: 400;
}
}
.warn-content {
height: 82px;
box-sizing: border-box;
padding: 8px 0 0 22px;
border-bottom: 1px solid #e2e2e2;
& > div {
font-size: 14px;
font-weight: 400;
margin-bottom: 8px;
}
}
.btn {
padding-top: 32px;
text-align: center;
.elbtn {
background-color: #053b6a;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
width: 95px;
height: 33px;
}
}
}
.display-default {
display: flex;
justify-content: space-between;
}
</style>
\ No newline at end of file
<template>
<div class="wrapper">
<div class="top display-default">
<div class="left text">裕华路地埋管线1111</div>
<div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" />
</div>
</div>
<!-- 设备信息 -->
<div class="eq-content display-default">
<div class="text-wrapper">
<div class="eq-text">设备编号:<span>aa</span></div>
<div class="eq-text">设备名称:<span>裕华路地埋管线</span></div>
<div class="eq-text">监测介质:<span>甲烷</span></div>
<div class="eq-text">设备状态:<span>报警</span></div>
<div class="eq-text">用户信息:<span>中厨燃气</span></div>
</div>
<div class="pic">
<img src="" alt="" />
</div>
</div>
<!-- 维修人员 -->
<div class="maintain-content">
<div>姓名: <span>高雄</span></div>
<div>电话: <span>13512451234</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<!-- 报警状态 -->
<div class="warn-content">
<div>报警状态 <span>报警</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<div class="btn">
<el-button class="elbtn" type="primary">生成工单</el-button>
</div>
</div>
</template>
<script>
//line移入时的的infowindow
export default {
props: {
obj: { typs: Object },
},
};
</script>
<style lang="scss" scoped>
.wrapper {
width: 406px;
height: 488px;
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
.text {
font-weight: 600;
font-size: 16px;
color: #ffffff;
line-height: 51px;
}
.left {
padding-left: 22px;
}
.right {
padding-right: 16px;
}
}
.eq-content {
height: 156px;
box-sizing: border-box;
padding: 13px 16px 13px 22px;
border-bottom: 1px solid #e2e2e2;
.text-wrapper {
padding-top: 1px;
& > div {
margin-bottom: 6px;
}
.eq-text {
font-size: 14px;
font-weight: 400;
color: #1d1d1d;
opacity: 1;
}
}
.pic {
width: 177px;
height: 129px;
background-color: black;
img {
width: 100%;
}
}
}
.maintain-content {
width: 100%;
height: 109px;
padding-left: 22px;
padding-top: 16px;
box-sizing: border-box;
border-bottom: 1px solid #e2e2e2;
& > div {
margin-bottom: 8px;
font-size: 14px;
font-weight: 400;
}
}
.warn-content {
height: 82px;
box-sizing: border-box;
padding: 8px 0 0 22px;
border-bottom: 1px solid #e2e2e2;
& > div {
font-size: 14px;
font-weight: 400;
margin-bottom: 8px;
}
}
.btn {
padding-top: 32px;
text-align: center;
.elbtn {
background-color: #053b6a;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
width: 95px;
height: 33px;
}
}
}
.display-default {
display: flex;
justify-content: space-between;
}
</style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="editForm" :model="editForm" label-width="120px" size="mini"> <el-form ref="editForm" :model="editForm" label-width="120px" size="mini">
<el-form-item label="所属燃气公司" prop="a"> <el-form-item label="所属燃气公司" prop="a">
<el-input></el-input> <el-input v-model="editForm.title"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="b"> <el-form-item label="名称" prop="b">
<el-input ></el-input> <el-input ></el-input>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> <el-button type="primary" @click="ok">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
export default { export default {
props: { props: {
title: { type: String }, title: { type: String },
lineOkCallBack:{ type:Function},
gaodeMap:{type:Object},
target:{type:Object},
//message: { type: String }, //message: { type: String },
//duration: { type: Number, default: 2000 } //duration: { type: Number, default: 2000 }
}, },
...@@ -56,10 +60,14 @@ ...@@ -56,10 +60,14 @@
return { return {
// isShow: false, // isShow: false,
editForm : {}, editForm : {},
dialogVisible : false dialogVisible : false,
} }
}, },
methods: { methods: {
ok(){
this.dialogVisible =false;
this.lineOkCallBack.call(this.gaodeMap,this.target);
},
show () { show () {
//this.isShow = true; //this.isShow = true;
this.dialogVisible = true; this.dialogVisible = true;
...@@ -78,6 +86,7 @@ ...@@ -78,6 +86,7 @@
}) })
.catch(_ => {}); .catch(_ => {});
} }
} }
} }
</script> </script>
......
<template>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-form ref="editForm" :model="editForm" label-width="120px" size="mini">
<el-form-item label="所属燃气公司" prop="enterpriseId">
<el-input v-model="editForm.enterpriseId"></el-input>
</el-form-item>
<el-form-item label="名称" prop="deviceName">
<el-input v-model="editForm.deviceName"></el-input>
</el-form-item>
<el-form-item label="地址" prop="deviceAddr">
<el-input v-model="editForm.deviceAddr"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="editForm.linkman"></el-input>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="editForm.phone"></el-input>
</el-form-item>
<el-form-item label="型号" prop="deviceModel">
<el-input v-model="editForm.deviceModel"></el-input>
</el-form-item>
<el-form-item label="经纬度" prop="deviceModel">
<el-row>
<el-col :span="6" style="margin-right: 10px">
<el-input v-model="editForm.longitude"></el-input>
</el-col>
<el-col :span="6">
<el-input v-model="editForm.latitude"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="安装日期" prop="installationTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.installationTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="最后巡检日期" prop="inspectionTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.inspectionTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="备注信息" prop="remarks">
<el-input type="textarea" v-model="editForm.remarks"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
title: { type: String }
},
data () {
return {
// isShow: false,
editForm : {},
dialogVisible : false
}
},
methods: {
show () {
this.dialogVisible = true;
},
hide () {
this.remove()
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.remove();
//done();
})
.catch(_ => {});
}
}
}
</script>
<template>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose">
<el-form ref="editForm" :model="editForm" label-width="120px" size="mini">
<el-form-item label="所属燃气公司" prop="enterpriseId">
<el-input v-model="editForm.enterpriseId"></el-input>
</el-form-item>
<el-form-item label="名称" prop="deviceName">
<el-input v-model="editForm.deviceName"></el-input>
</el-form-item>
<el-form-item label="地址" prop="deviceAddr">
<el-input v-model="editForm.deviceAddr"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="editForm.linkman"></el-input>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="editForm.phone"></el-input>
</el-form-item>
<el-form-item label="型号" prop="deviceModel">
<el-input v-model="editForm.deviceModel"></el-input>
</el-form-item>
<el-form-item label="经纬度" prop="deviceModel">
<el-row>
<el-col :span="6" style="margin-right: 10px">
<el-input v-model="editForm.longitude"></el-input>
</el-col>
<el-col :span="6">
<el-input v-model="editForm.latitude"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="安装日期" prop="installationTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.installationTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="最后巡检日期" prop="inspectionTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.inspectionTime" style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="备注信息" prop="remarks">
<el-input type="textarea" v-model="editForm.remarks"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
title: { type: String }
},
data () {
return {
// isShow: false,
editForm : {},
dialogVisible : false
}
},
methods: {
show () {
this.dialogVisible = true;
},
hide () {
this.remove()
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.remove();
//done();
})
.catch(_ => {});
}
}
}
</script>
...@@ -65,9 +65,10 @@ Vue.use(Element, { ...@@ -65,9 +65,10 @@ Vue.use(Element, {
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ let vue =new Vue({
el: '#app', el: '#app',
router, router,
store, store,
render: h => h(App) render: h => h(App)
}) })
export default vue
\ No newline at end of file
import createPop from "./createPop"; import createPop from "./createPop";
import regulatorBoxOrValveWell from "../components/PopWindow/regulatorBoxOrValveWell.vue" import regulatorBox from "../components/PopWindow/regulatorBox.vue";
import valveWell from "../components/PopWindow/valveWell.vue";
import flowMeter from "../components/PopWindow/flowMeter.vue";
import dutyPerson from "../components/PopWindow/dutyPerson.vue";
import pipelineView from "../components/PopWindow/pipelineView.vue";
import lineInfoWindow from "../components/PopWindow/lineInfoWindow.vue";
import markerInfoWindow from "../components/PopWindow/markerInfoWindow.vue";
import vue from "../main";
let defaultCenter = "石家庄"; let defaultCenter = "石家庄";
export let map; export let map;
export const DEVICE_TYPE = {
PIPEPLINE: "1",
REGEULATORBOX: "2",
VALUEWELL: "3",
FLOWMETER: "4",
DUTYPERSON: "5"
};
class gaodeMap { class gaodeMap {
// 所有线的数组
polyLines = [];
// 是否开启新增
lineType = 0;
// 创建一个新的lineObj
newLineObj = null;
mouseTool = null;
//构造函数中设置中央点默认值 //构造函数中设置中央点默认值
constructor(center) { constructor(center) {
this.center = center?center:defaultCenter; this.markers = [];
map = new AMap.Map('container', { this.center = center ? center : defaultCenter;
map = new AMap.Map("container", {
//mask: addMask(result.districtList[0].boundaries), //mask: addMask(result.districtList[0].boundaries),
center: [114.72995, 38.37417], center: [114.72995, 38.37417],
// resizeEnable: true, // resizeEnable: true,
disableSocket: true, disableSocket: true,
viewMode: '3D', viewMode: "3D",
showLabel: true, showLabel: true,
// labelzIndex: 110, // labelzIndex: 110,
pitch: 8, pitch: 8,
zoom: 9, zoom: 9
//mapStyle: 'amap://styles/darkblue', //mapStyle: 'amap://styles/darkblue',
// mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae', // mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae',
}); });
...@@ -26,7 +48,7 @@ class gaodeMap { ...@@ -26,7 +48,7 @@ class gaodeMap {
* 获取map * 获取map
* @returns {AMap.Map} * @returns {AMap.Map}
*/ */
get getMap(){ get getMap() {
return this.map; return this.map;
} }
...@@ -34,7 +56,7 @@ class gaodeMap { ...@@ -34,7 +56,7 @@ class gaodeMap {
* 重新设置中央点 * 重新设置中央点
* @param value * @param value
*/ */
set setCenter(value){ set setCenter(value) {
this.center = value; this.center = value;
this.districtBoundaries(); this.districtBoundaries();
} }
...@@ -42,76 +64,79 @@ class gaodeMap { ...@@ -42,76 +64,79 @@ class gaodeMap {
/** /**
* 设置城市边界 * 设置城市边界
*/ */
districtBoundaries(){
let that = this; districtBoundaries() {
let opts = { let that = this;
subdistrict: 0, let opts = {
extensions: 'all', subdistrict: 0,
level: 'city' extensions: "all",
}; level: "city"
let district = new AMap.DistrictSearch(opts); };
district.search(that.center, function (status, result) { let district = new AMap.DistrictSearch(opts);
if(status == "complete"){ district.search(that.center, function(status, result) {
let defaultCenter = []; if (status == "complete") {
defaultCenter.push(result.districtList[0].center.lng); let defaultCenter = [];
defaultCenter.push(result.districtList[0].center.lat); defaultCenter.push(result.districtList[0].center.lng);
map.setCenter(defaultCenter); defaultCenter.push(result.districtList[0].center.lat);
let bounds =result.districtList[0].boundaries; map.setCenter(defaultCenter);
for (let i = 0; i < bounds.length; i += 1) { let bounds = result.districtList[0].boundaries;
new AMap.Polyline({ for (let i = 0; i < bounds.length; i += 1) {
path: bounds[i], new AMap.Polyline({
strokeColor: '#0088ff', path: bounds[i],
strokeWeight: 5, strokeColor: "#0088ff",
strokeOpacity: 7, strokeWeight: 5,
map: map, strokeOpacity: 7,
}); map: map
} });
} }
}) }
} });
}
/** /**
* 添加Market * 添加Market
* @param markerType
* @param lnglats * @param lnglats
*/ */
addMarker(lnglats){ addMarker(markerType, data) {
let infoWindow = new AMap.InfoWindow({offset: new AMap.Pixel(-13, -70)}); let that = this;
for (let i = 0; i < lnglats.length; i++) { that.markerType = markerType;
let marker = new AMap.Marker({ let infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(-13, -70) });
position: lnglats[i], let marker = new AMap.Marker({
map: map, position: [data.longitude,data.latitude],
offset: new AMap.Pixel(-13, -30), map: map,
// 设置是否可以拖拽 offset: new AMap.Pixel(-13, -30)
draggable: true, });
cursor: 'move', marker.content = this.getMarketContent(data);
// 设置拖拽效果 this.setMarkerIcon(marker);
raiseOnDrag: true marker.on("mouseover", infoOpen);
}); marker.on("mouseout", infoClose);
marker.content = '<h4>我是第' + (i + 1) + '个XXX</h4>'; that.deviceType = markerType;
marker.content += '<h6>经度:'+lnglats[i][0]+'</h6>'; let editWindow = that.createInfowindow();
marker.content += '<h6>纬度:'+lnglats[i][1]+'</h6>'; marker.on("click", function(e) {
marker.content += '<button class="btn btn-success btn-xs">历史轨迹</button>'; if ("edit" == that.mapOperateType) {
marker.content += '<button class="btn btn-warning btn-xs">实时跟踪 </button>'; editWindow.show();
marker.content += '<button class="btn btn-danger btn-xs">设置</button>'; } else if ("delete" == that.mapOperateType) {
if (confirm("确认删除") == true) {
marker.on('mouseover', infoOpen); map.remove(marker);
//注释后打开地图时默认关闭信息窗体 }
//marker.emit('mouseover', {target: marker}); } else {
map.setZoomAndCenter(13, e.target.getPosition());
marker.on('mouseout', infoClose); let infoWindow = new AMap.InfoWindow({
marker.on('click', newMAp); offset: new AMap.Pixel(-13, -70)
marker.on('dragend', moveMarker); });
} infoWindow.setContent(e.target.content);
map.setFitView(); infoWindow.open(map, e.target.getPosition());
}
//鼠标点击事件,设置地图中心点及放大显示级别 });
function newMAp(e) { marker.on("dragend", function(e) {
//map.setCenter(e.target.getPosition()); editWindow.editForm.longitude = e.lnglat.lng;
map.setZoomAndCenter(13, e.target.getPosition()); editWindow.editForm.latitude = e.lnglat.lat;
let infoWindow = new AMap.InfoWindow({offset: new AMap.Pixel(-13, -70)}); console.log(e.lnglat, "rrrr====");
infoWindow.setContent(e.target.content); });
infoWindow.open(map, e.target.getPosition()); this.markers.push(marker);
} map.setZoom("11");
//map.setFitView();
function infoClose(e) { function infoClose(e) {
infoWindow.close(map, e.target.getPosition()); infoWindow.close(map, e.target.getPosition());
...@@ -121,9 +146,120 @@ class gaodeMap { ...@@ -121,9 +146,120 @@ class gaodeMap {
infoWindow.setContent(e.target.content); infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition()); infoWindow.open(map, e.target.getPosition());
} }
}
/**
* marker添加拖拽事件
*/
addMarkerDragg() {
for (var i = 0; i < this.markers.length; i++) {
this.markers[i].setDraggable(true);
}
}
/**
* marker移除拖拽事件
*/
removeMarkerDragg() {
for (var i = 0; i < this.markers.length; i++) {
this.markers[i].setDraggable(false);
}
}
/**
* 添加marker信息
* @param data
* @returns {string}
*/
getMarketContent(data) {
/* const dom = createPop(markerInfoWindow,{});
const html = dom.$el;
dom.remove();
switch (this.markerType) {
case DEVICE_TYPE.REGEULATORBOX: {
return html;
}
case DEVICE_TYPE.VALUEWELL: {
return html;
}
case DEVICE_TYPE.FLOWMETER: {
return html;
}
case DEVICE_TYPE.DUTYPERSON: {
return html;
}
}*/
let html = "<div>" +
"<table>" +
"<tr>" +
"<td>所属燃气公司</td>" +
"<td>正元</td>" +
"</tr>" +
"<tr>" +
"<td>名称</td>" +
"<td>1234</td>" +
"</tr>" +
"<tr>" +
"<td>地址</td>" +
"<td>石家庄市新华区</td>" +
"</tr>" +
"</table>" +
"</div>";
switch (this.markerType){
case DEVICE_TYPE.REGEULATORBOX :{
return html;
}
case DEVICE_TYPE.VALUEWELL :{
return html;
}
case DEVICE_TYPE.FLOWMETER :{
return html;
}
case DEVICE_TYPE.DUTYPERSON :{
return html;
}
}
}
function moveMarker(e) { /**
alert(e.lnglat); * 设置设备图标
* @param marker
*/
setMarkerIcon(marker){
switch (this.markerType) {
case DEVICE_TYPE.REGEULATORBOX: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/tiaoyaxiang.png"),
});
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.VALUEWELL: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/famenjing.png"),
});
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.FLOWMETER: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/liuliangji.png"),
});
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.DUTYPERSON: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/tiaoyaxiang.png"),
});
marker.setIcon(icon);
break;
}
} }
} }
...@@ -131,9 +267,10 @@ class gaodeMap { ...@@ -131,9 +267,10 @@ class gaodeMap {
* 添加折线 * 添加折线
* @param path * @param path
*/ */
addPolyline(path){ addPolyline(path) {
let polylines = []; console.log(path);
for(let i = 0;i< path.length; i++){ // this` polyLines = [];
for (let i = 0; i < path.length; i++) {
let polyline = new AMap.Polyline({ let polyline = new AMap.Polyline({
path: path[i], path: path[i],
strokeColor: "green", strokeColor: "green",
...@@ -141,104 +278,318 @@ class gaodeMap { ...@@ -141,104 +278,318 @@ class gaodeMap {
strokeOpacity: 0.9, strokeOpacity: 0.9,
zIndex: 50, zIndex: 50,
bubble: true, bubble: true,
}) geodesic: true,
polylines.push(polyline); extData: {
let polyEditor = new AMap.PolyEditor(map, polyline); type: "line",
//创建右键菜单 //当前line状态 0:正常状态 1:正在编辑状态
let contextMenu = new AMap.ContextMenu(); isState: 0
//右键放大 }
contextMenu.addItem("编辑Polyline", function () { });
polyEditor.setTarget(polyline); this.polyLines.push(polyline);
// 信息窗体
const dom = createPop(lineInfoWindow, {
obj: { a: 123 }
});
console.log("dom", dom.$el);
var infoWindow = new AMap.InfoWindow({
isCustom: true,
content: dom.$el,
//信息船体偏移量
offset: new AMap.Pixel(20, -20),
anchor: "left-top"
});
this.newLineAddEvent(polyline);
// // 编辑状态
// let polyEditor = new AMap.PolyEditor(map, polyline);
// //创建右键菜单
// let contextMenu = new AMap.ContextMenu();
// //菜单选择
// contextMenu.addItem(
// "编辑Polyline",
// function() {
// polyEditor.setTarget(polyline);
// polyEditor.open();
// contextMenu.close();
// },
// 0
// );
// // 结束编辑
// contextMenu.addItem(
// "结束编辑",
// function() {
// polyEditor.close();
// contextMenu.close();
// },
// 0
// );
// contextMenu.addItem(
// "保存信息",
// function() {
// console.log("折线数组", polyline.getPath());
// // polyEditor.close();
// // contextMenu.close()
// },
// 0
// );
//添加事件
polyline.on("mouseover", e => {
polyline.setOptions({ strokeColor: "red" });
infoWindow.open(map, e.lnglat);
});
polyline.on("mouseout", e => {
polyline.setOptions({ strokeColor: "green" });
infoWindow.close();
});
// polyline.on("rightclick", e => {
// console.log(this.lineType);
// // if(!this.lineFlag==0) return;
// // lineFlag 1新建 2编辑 3删除 0啥也不让干
// switch (this.lineType) {
// case 2: {
// contextMenu.open(map, e.lnglat);
// break;
// }
// default:
// break;
// }
// });
}
map.add(this.polyLines);
// 缩放地图到合适的视野级别
// map.setFitView();
}
// 创建一条新的线
createNewLine() {
this.mouseTool.polyline({
strokeWeight: 9,
strokeColor: "#80d8ff",
extData: {
type: "newLine",
//当前line状态 0:正常状态 1:正在编辑状态
isState: 0
}
//同Polyline的Option设置
});
}
// 新建line增加编辑以及右键菜单
addEditorAndMenu(obj) {
let polyEditor = new AMap.PolyEditor(map, obj);
let contextMenu = new AMap.ContextMenu();
contextMenu.addItem(
"编辑",
function() {
polyEditor.setTarget(obj);
polyEditor.open(); polyEditor.open();
}, 0); contextMenu.close();
contextMenu.addItem("结束编辑", function () { },
0
);
contextMenu.addItem(
"结束编辑",
function() {
polyEditor.close(); polyEditor.close();
}, 0); contextMenu.close();
//添加事件 console.log(obj.getPath());
polyline.on("rightclick",function (e) { },
0
);
contextMenu.addItem(
"保存",
() => {
polyEditor.close();
contextMenu.close();
this.addPolyline([obj.getPath()]);
map.remove(obj);
},
0
);
contextMenu.addItem(
"删除",
function() {
polyEditor.setTarget(obj);
polyEditor.open();
contextMenu.close();
},
0
);
obj.on("rightclick", e => {
if (this.lineType == 1) {
contextMenu.open(map, e.lnglat); contextMenu.open(map, e.lnglat);
}) }
});
}
// 新line与老line添加点击事件
newLineAddEvent(obj) {
obj.polyEditor = new AMap.PolyEditor(map, obj);
obj.on("click", () => {
// 获取当前状态 0普通状态,1是正编辑状态
const { isState, type } = obj.getExtData();
// 如果不是新线的时候并且没点编辑,点击是无效的
if (type != "newLine" && this.lineType != 2) return;
if (isState == 0) {
// 如果是0,就打开编辑,变成编辑状态
obj.polyEditor.open();
let opstions = obj.getExtData();
opstions.isState = 1;
console.log(opstions);
obj.setExtData(opstions);
} else {
this.infoWindowPipelineView({ obj, lineType: type });
}
});
}
// 传进组件的会调 点确认的时候调
lineOkCallBack(target) {
target.polyEditor.close();
const index = this.polyLines.indexOf(target);
// 如果是老线,就要线删除原来的,然后重新包装一遍
if (index >= 0) {
this.polyLines.splice(index, 1);
} }
map.add(polylines); this.addPolyline([target.getPath()]);
// 缩放地图到合适的视野级别 map.remove(target);
map.setFitView(); // console.log('polyLines',this.polyLines)
} }
// 上传服务器用的组件
infoWindowPipelineView(options) {
const notice = createPop(pipelineView, {
title: "管道",
//线是新线还是老线
lineType: options.lineType,
target: options.obj,
//把当前对象当作that传进去
gaodeMap: this,
lineOkCallBack: this.lineOkCallBack
});
notice.show();
}
/** /**
* 添加鼠标事件 * 添加鼠标事件
*/ */
addMouseTool(){ addMouseTool() {
this.mouseTool = new AMap.MouseTool(map); this.mouseTool = new AMap.MouseTool(map);
//监听draw事件可获取画好的覆盖物 //监听draw事件可获取画好的覆盖物
this.overlays = []; this.overlays = [];
let that = this; let that = this;
this.mouseTool.on('draw',function(e){ this.mouseTool.on("draw", function(e) {
e.obj.on("click",function (aa) { if (e.obj.getExtData().type != "newLine") {
console.log(aa.target._position) const device = that.createInfowindow();
that.openInfowindow(); e.obj.on("click", function(aa) {
}) let postion = aa.target._position;
device.editForm.longitude = postion.lng;
device.editForm.latitude = postion.lat;
device.show();
});
}
if (e.obj.getExtData().type == "newLine") {
console.log("挂上菜单");
that.newLineAddEvent(e.obj);
// 右键菜单
// that.addEditorAndMenu(e.obj)
}
that.overlays.push(e.obj); that.overlays.push(e.obj);
// if(e.obj.getExtData().type=="line"){
// return;
// }
that.mouseTool.close(); that.mouseTool.close();
}); });
} }
openInfowindow(){ /**
const notice = createPop(regulatorBoxOrValveWell, { * 创建弹框事件
title: '调压箱' */
}) createInfowindow() {
notice.show() switch (this.deviceType) {
} case DEVICE_TYPE.PIPEPLINE: {
draw(type){
let that = this;
switch(type){
case 'marker':{
that.mouseTool.marker({
draggable: true
});
break; break;
} }
case 'polyline':{ case DEVICE_TYPE.REGEULATORBOX: {
that.mouseTool.polyline({ return createPop(regulatorBox, {
strokeWeight: 9, title: "调压箱"
strokeColor:'#80d8ff' });
//同Polyline的Option设置 }
case DEVICE_TYPE.VALUEWELL: {
return createPop(valveWell, {
title: "阀门井"
});
}
case DEVICE_TYPE.FLOWMETER: {
return createPop(flowMeter, {
title: "流量计"
});
}
case DEVICE_TYPE.DUTYPERSON: {
return createPop(dutyPerson, {
title: "值班人员"
}); });
break;
} }
} }
} }
/** /**
* 添加地图控件 * 鼠标画图事件
* @param deviceType 设备类型
*/ */
addMapControl(){ draw(deviceType) {
AMap.plugin([ let that = this;
'AMap.ToolBar', that.deviceType = deviceType;
'AMap.Scale', if (
'AMap.HawkEye', DEVICE_TYPE.REGEULATORBOX == deviceType ||
'AMap.MapType', DEVICE_TYPE.VALUEWELL == deviceType ||
'AMap.Geolocation', DEVICE_TYPE.FLOWMETER == deviceType ||
], function(){ DEVICE_TYPE.DUTYPERSON == deviceType
// 在图面添加工具条控件,工具条控件集成了缩放、平移、定位等功能按钮在内的组合控件 ) {
//map.addControl(new AMap.ToolBar()); that.mouseTool.marker({
draggable: true
// 在图面添加比例尺控件,展示地图在当前层级和纬度下的比例尺 });
map.addControl(new AMap.Scale()); }
if (DEVICE_TYPE.PIPEPLINE == deviceType) {
// 在图面添加鹰眼控件,在地图右下角显示地图的缩略图 that.mouseTool.polyline({
map.addControl(new AMap.HawkEye({isOpen:true})); strokeWeight: 9,
strokeColor: "#80d8ff"
// 在图面添加类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制 //同Polyline的Option设置
map.addControl(new AMap.MapType({position :{top: '10px',left: '100px'}})); });
}
// 在图面添加定位控件,用来获取和展示用户主机所在的经纬度位置
// map.addControl(new AMap.Geolocation());
});
} }
/**
* 添加地图控件
*/
addMapControl() {
AMap.plugin(
[
"AMap.ToolBar",
"AMap.Scale",
"AMap.HawkEye",
"AMap.MapType",
"AMap.Geolocation"
],
function() {
// 在图面添加工具条控件,工具条控件集成了缩放、平移、定位等功能按钮在内的组合控件
//map.addControl(new AMap.ToolBar());
// 在图面添加比例尺控件,展示地图在当前层级和纬度下的比例尺
map.addControl(new AMap.Scale());
// 在图面添加鹰眼控件,在地图右下角显示地图的缩略图
map.addControl(new AMap.HawkEye({ isOpen: true }));
// 在图面添加类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制
map.addControl(
new AMap.MapType({ position: { top: "10px", left: "100px" } })
);
// 在图面添加定位控件,用来获取和展示用户主机所在的经纬度位置
// map.addControl(new AMap.Geolocation());
}
);
}
} }
export default gaodeMap; export default gaodeMap;
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备id" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="queryParams.alarmType" placeholder="请选择报警类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input
v-model="queryParams.alarmValue"
placeholder="请输入报警值"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择
处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dataMonitoring:deviceAlarm:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dataMonitoring:deviceAlarm:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dataMonitoring:deviceAlarm:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['dataMonitoring:deviceAlarm:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceAlarmList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="备注" align="center" prop="alarmId" />
<el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" />
<el-table-column label="报警开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="报警结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="
处理状态" align="center" prop="dealStatus" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报警信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="form.alarmType" placeholder="请选择报警类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input v-model="form.alarmValue" placeholder="请输入报警值" />
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态">
<el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDeviceAlarm, getDeviceAlarm, delDeviceAlarm, addDeviceAlarm, updateDeviceAlarm, exportDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
export default {
name: "DeviceAlarm",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 报警信息表格数据
deviceAlarmList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
orderId: null,
alarmType: null,
alarmValue: null,
startTime: null,
endTime: null,
dealStatus: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报警信息列表 */
getList() {
this.loading = true;
listDeviceAlarm(this.queryParams).then(response => {
this.deviceAlarmList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
alarmId: null,
deviceId: null,
orderId: null,
alarmType: null,
alarmValue: null,
startTime: null,
endTime: null,
dealStatus: "0",
updateTime: null,
createTime: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.alarmId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报警信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmId = row.alarmId || this.ids
getDeviceAlarm(alarmId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报警信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.alarmId != null) {
updateDeviceAlarm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceAlarm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmIds = row.alarmId || this.ids;
this.$confirm('是否确认删除报警信息编号为"' + alarmIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delDeviceAlarm(alarmIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有报警信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDeviceAlarm(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="巡检计划名称" prop="planName">
<el-input
v-model="queryParams.planName"
placeholder="请输入巡检计划名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="计划描述" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入计划描述"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['deviceInspection:inspectionPlan:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['deviceInspection:inspectionPlan:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['deviceInspection:inspectionPlan:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['deviceInspection:inspectionPlan:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="inspectionPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="巡检计划id" align="center" prop="planId" />
<el-table-column label="巡检计划名称" align="center" prop="planName" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="planStatus" />
<el-table-column label="计划描述" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['deviceInspection:inspectionPlan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['deviceInspection:inspectionPlan:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改巡检计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="巡检计划名称" prop="planName">
<el-input v-model="form.planName" placeholder="请输入巡检计划名称" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.planStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="计划描述" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入计划描述" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInspectionPlan, getInspectionPlan, delInspectionPlan, addInspectionPlan, updateInspectionPlan, exportInspectionPlan } from "@/api/deviceInspection/inspectionPlan";
export default {
name: "InspectionPlan",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 巡检计划表格数据
inspectionPlanList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
planName: null,
orderId: null,
startTime: null,
endTime: null,
planStatus: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询巡检计划列表 */
getList() {
this.loading = true;
listInspectionPlan(this.queryParams).then(response => {
this.inspectionPlanList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
planId: null,
planName: null,
orderId: null,
startTime: null,
endTime: null,
planStatus: "0",
updateTime: null,
createTime: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.planId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加巡检计划";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const planId = row.planId || this.ids
getInspectionPlan(planId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改巡检计划";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.planId != null) {
updateInspectionPlan(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInspectionPlan(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const planIds = row.planId || this.ids;
this.$confirm('是否确认删除巡检计划编号为"' + planIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInspectionPlan(planIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有巡检计划数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInspectionPlan(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
<template> <template>
<div> <div>
<div style="width: 100vw;height: 100vh" id="container"></div> <div style="width: 100vw; height: 100vh" id="container"></div>
<!-- <div class="input-card" style='width: 24rem;'> <!-- <div class="input-card" style='width: 24rem;'>
<div class="input-item"> <div class="input-item">
<input type="radio" name='func' value='marker'><span class="input-text">画点</span> <input type="radio" name='func' value='marker'><span class="input-text">画点</span>
<input type="radio" name='func' value='polyline'><span class="input-text">画折线</span> <input type="radio" name='func' value='polyline'><span class="input-text">画折线</span>
...@@ -16,156 +16,218 @@ ...@@ -16,156 +16,218 @@
<input id="close" type="button" class="btn" value="关闭绘图" /> <input id="close" type="button" class="btn" value="关闭绘图" />
</div> </div>
</div>--> </div>-->
<el-button type="primary" style="position: absolute;top: 100px;left: 75%" @click="addDevice">新增</el-button> <el-button
<el-button type="primary" style="position: absolute;top: 100px;left: 82%" @click="editDevice">编辑</el-button> type="primary"
<el-button type="primary" style="position: absolute;top: 100px;left: 90%" @click="deleteDevice">删除</el-button> style="position: absolute; top: 100px; left: 75%"
<el-select v-model="value" placeholder="请选择..." @change="selectDeviceType" style="position: absolute;top: 150px;left: 75%" v-if="deviceType"> @click="addDevice"
>新增</el-button
>
<el-button
type="primary"
style="position: absolute; top: 100px; left: 82%"
@click="editDevice"
>编辑</el-button
>
<el-button
type="primary"
style="position: absolute; top: 100px; left: 90%"
@click="deleteDevice"
>删除</el-button
>
<el-select
v-model="value"
placeholder="请选择..."
@change="selectDeviceType"
style="position: absolute; top: 150px; left: 75%"
v-if="deviceType"
>
<el-option label="管道" value="1"></el-option> <el-option label="管道" value="1"></el-option>
<el-option label="调压箱" value="2"></el-option> <el-option label="调压箱" value="2"></el-option>
<el-option label="阀门井" value="3"></el-option> <el-option label="阀门井" value="3"></el-option>
<el-option label="流量计" value="4"></el-option> <el-option label="流量计" value="4"></el-option>
<el-option label="物联网燃气表" value="5"></el-option> <el-option label="值班人员" value="5"></el-option>
<el-option label="值班人员" value="6"></el-option>
</el-select> </el-select>
</div> </div>
</template> </template>
<script> <script>
import gaodeMap from "utils/gaodeMap.js" import gaodeMap from "utils/gaodeMap.js";
import {map} from "utils/gaodeMap.js" import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
export default { import { getAllDeviceInfo } from "@/api/device/deviceInfo";
data() { export default {
return { data() {
gaoMap : null, return {
deviceType : false, gaoMap: null,
value : "", deviceType: false,
operateType : "" value: "",
}; operateType: "",
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
pipeId: null,
deviceName: null,
deviceAddr: null,
deviceModel: null,
deviceType: null,
longitude: null,
latitude: null,
iotNo: null,
iconUrl: null,
linkman: null,
phone: null,
installationTime: null,
inspectionTime: null,
remarks: null
},
};
},
mounted() {
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
let path = [
[
[114.436698, 38.083306],
[114.57952, 38.065468],
[114.57952, 38.002732],
[114.440131, 38.006519],
[114.436698, 38.083306],
],
[
[114.528708, 38.075198],
[114.530768, 38.00165],
],
];
gaoMap.addPolyline(path);
gaoMap.addMouseTool();
this.getDeviceInfo();
},
methods: {
addDevice() {
this.deviceType = true;
this.gaoMap.mapOperateType = "add";
this.gaoMap.removeMarkerDragg();
}, },
mounted() { editDevice() {
let gaoMap = new gaodeMap("石家庄"); this.deviceType = false;
this.gaoMap = gaoMap; this.gaoMap.lineType =2;
let lnglats = [ this.gaoMap.mapOperateType = "edit";
[114.497949,38.121129], this.gaoMap.addMarkerDragg();
[114.595972,38.114511],
[114.443193,37.990963],
[114.588419,37.969449],
[114.522668,38.042962],
[114.383966,38.091548]
];
gaoMap.addMarker(lnglats)
let path = [
[
[114.436698,38.083306],
[114.57952,38.065468],
[114.57952,38.002732],
[114.440131,38.006519],
[114.436698,38.083306]
],
[
[114.528708,38.075198],
[114.530768,38.00165]
]
]
gaoMap.addPolyline(path);
gaoMap.addMouseTool();
}, },
methods:{ deleteDevice() {
addDevice(){ this.deviceType = false;
this.deviceType = true; this.gaoMap.mapOperateType = "delete";
this.operationType = "add"; this.gaoMap.removeMarkerDragg();
}, },
editDevice(){ selectDeviceType(val) {
this.deviceType = true; // if("add" == this.operationType){
this.operationType = "edit"; this.gaoMap.draw(val);
}, // }
deleteDevice(){ this.deviceType = false;
this.deviceType = true; this.value = "";
this.operationType = "delete"; // 如果选择的是新建管道
}, if (val == 1) {
selectDeviceType(val){ this.gaoMap.lineType = 1;
if("add" == this.operationType){ this.gaoMap.createNewLine();
this.gaoMap.draw("marker")
}
this.deviceType = false;
this.value = "";
} }
},
getDeviceInfo(){
this.loading = true;
getAllDeviceInfo(this.queryParams).then(response => {
if(response.code == 200){
for(var i = 0;i < response.data.length; i++){
if("1" == response.data[i].deviceType){
this.gaoMap.addMarker(DEVICE_TYPE.REGEULATORBOX,response.data[i])
}
if("2" == response.data[i].deviceType){
this.gaoMap.addMarker(DEVICE_TYPE.VALUEWELL,response.data[i])
}
if("3" == response.data[i].deviceType){
this.gaoMap.addMarker(DEVICE_TYPE.FLOWMETER,response.data[i])
}
}
}
this.loading = false;
});
} }
}; },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.input-card { .input-card {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-width: 0; min-width: 0;
word-wrap: break-word; word-wrap: break-word;
background-color: #fff; background-color: #fff;
background-clip: border-box; background-clip: border-box;
border-radius: .25rem; border-radius: 0.25rem;
width: 22rem; width: 22rem;
border-width: 0; border-width: 0;
border-radius: 0.4rem; border-radius: 0.4rem;
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5); box-shadow: 0 2px 6px 0 rgba(114, 124, 245, 0.5);
position: fixed; position: fixed;
bottom: 1rem; bottom: 1rem;
right: 1rem; right: 1rem;
-ms-flex: 1 1 auto; -ms-flex: 1 1 auto;
flex: 1 1 auto; flex: 1 1 auto;
padding: 0.75rem 1.25rem; padding: 0.75rem 1.25rem;
} }
.input-item { .input-item {
position: relative; position: relative;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
-ms-flex-wrap: wrap; -ms-flex-wrap: wrap;
flex-wrap: wrap; flex-wrap: wrap;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 2.2rem; height: 2.2rem;
} }
input[type=checkbox], input[type=radio] { input[type="checkbox"],
box-sizing: border-box; input[type="radio"] {
padding: 0; box-sizing: border-box;
-webkit-box-sizing: border-box; padding: 0;
box-sizing: border-box; -webkit-box-sizing: border-box;
padding: 0; box-sizing: border-box;
margin: 0 0.5rem 0 0; padding: 0;
} margin: 0 0.5rem 0 0;
.btn { }
display: inline-block; .btn {
font-weight: 400; display: inline-block;
text-align: center; font-weight: 400;
white-space: nowrap; text-align: center;
vertical-align: middle; white-space: nowrap;
-webkit-user-select: none; vertical-align: middle;
-moz-user-select: none; -webkit-user-select: none;
-ms-user-select: none; -moz-user-select: none;
user-select: none; -ms-user-select: none;
border: 1px solid transparent; user-select: none;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; border: 1px solid transparent;
background-color: transparent; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
background-image: none; border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
color: #25A5F7; background-color: transparent;
border-color: #25A5F7; background-image: none;
padding: .25rem .5rem; color: #25a5f7;
line-height: 1.5; border-color: #25a5f7;
border-radius: 1rem; padding: 0.25rem 0.5rem;
-webkit-appearance: button; line-height: 1.5;
cursor:pointer; border-radius: 1rem;
width: 6rem; -webkit-appearance: button;
margin: 0 1rem 0 2rem; cursor: pointer;
} width: 6rem;
margin: 0 1rem 0 2rem;
}
.btn:hover { .btn:hover {
color: #fff; color: #fff;
background-color: #25A5F7; background-color: #25a5f7;
border-color: #25A5F7 border-color: #25a5f7;
} }
.input-text{ .input-text {
width: 4rem; width: 4rem;
margin-right:1rem; margin-right: 1rem;
} }
</style> </style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name"> <el-form-item label="设备id" prop="deviceId">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.deviceId"
placeholder="请输入姓名" placeholder="请输入设备id"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="电话" prop="phone"> <el-form-item label="工单id" prop="orderId">
<el-input <el-input
v-model="queryParams.phone" v-model="queryParams.orderId"
placeholder="请输入电话" placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input
v-model="queryParams.latitude"
placeholder="请输入纬度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
...@@ -33,7 +65,7 @@ ...@@ -33,7 +65,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['device:inspector:add']" v-hasPermi="['riskManagement:hiddenTrouble:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -44,7 +76,7 @@ ...@@ -44,7 +76,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['device:inspector:edit']" v-hasPermi="['riskManagement:hiddenTrouble:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -55,7 +87,7 @@ ...@@ -55,7 +87,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['device:inspector:remove']" v-hasPermi="['riskManagement:hiddenTrouble:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -66,18 +98,20 @@ ...@@ -66,18 +98,20 @@
size="mini" size="mini"
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
v-hasPermi="['device:inspector:export']" v-hasPermi="['riskManagement:hiddenTrouble:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="inspectorList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="hiddenTroubleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" align="center" /> <el-table-column label="隐患信息id" align="center" prop="troubleId" />
<el-table-column label="企业" align="center" prop="enterpriseId" /> <el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="电话" align="center" prop="phone" /> <el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="处理状态" align="center" prop="dealStatus" />
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -86,19 +120,19 @@ ...@@ -86,19 +120,19 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['device:inspector:edit']" v-hasPermi="['riskManagement:hiddenTrouble:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['device:inspector:remove']" v-hasPermi="['riskManagement:hiddenTrouble:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
...@@ -107,14 +141,25 @@ ...@@ -107,14 +141,25 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改巡检员对话框 --> <!-- 添加或修改隐患信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="name"> <el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.name" placeholder="请输入姓名" /> <el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item> </el-form-item>
<el-form-item label="电话" prop="phone"> <el-form-item label="处理状态">
<el-input v-model="form.phone" placeholder="请输入电话" /> <el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" /> <el-input v-model="form.remarks" placeholder="请输入备注" />
...@@ -129,10 +174,10 @@ ...@@ -129,10 +174,10 @@
</template> </template>
<script> <script>
import { listInspector, getInspector, delInspector, addInspector, updateInspector, exportInspector } from "@/api/deviceInspection/inspector"; import { listHiddenTrouble, getHiddenTrouble, delHiddenTrouble, addHiddenTrouble, updateHiddenTrouble, exportHiddenTrouble } from "@/api/riskManagement/hiddenTrouble";
export default { export default {
name: "Inspector", name: "HiddenTrouble",
components: { components: {
}, },
data() { data() {
...@@ -151,8 +196,8 @@ export default { ...@@ -151,8 +196,8 @@ export default {
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 巡检员表格数据 // 隐患信息表格数据
inspectorList: [], hiddenTroubleList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -161,9 +206,11 @@ export default { ...@@ -161,9 +206,11 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
enterpriseId: null, deviceId: null,
name: null, orderId: null,
phone: null, longitude: null,
latitude: null,
dealStatus: null,
remarks: null remarks: null
}, },
// 表单参数 // 表单参数
...@@ -177,11 +224,11 @@ export default { ...@@ -177,11 +224,11 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询巡检员列表 */ /** 查询隐患信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listInspector(this.queryParams).then(response => { listHiddenTrouble(this.queryParams).then(response => {
this.inspectorList = response.rows; this.hiddenTroubleList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
...@@ -194,10 +241,14 @@ export default { ...@@ -194,10 +241,14 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
inspectorId: null, troubleId: null,
enterpriseId: null, deviceId: null,
name: null, orderId: null,
phone: null, longitude: null,
latitude: null,
dealStatus: "0",
updateTime: null,
createTime: null,
remarks: null remarks: null
}; };
this.resetForm("form"); this.resetForm("form");
...@@ -214,7 +265,7 @@ export default { ...@@ -214,7 +265,7 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.inspectorId) this.ids = selection.map(item => item.troubleId)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
...@@ -222,30 +273,30 @@ export default { ...@@ -222,30 +273,30 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加巡检员"; this.title = "添加隐患信息";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const inspectorId = row.inspectorId || this.ids const troubleId = row.troubleId || this.ids
getInspector(inspectorId).then(response => { getHiddenTrouble(troubleId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改巡检员"; this.title = "修改隐患信息";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.inspectorId != null) { if (this.form.troubleId != null) {
updateInspector(this.form).then(response => { updateHiddenTrouble(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addInspector(this.form).then(response => { addHiddenTrouble(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -256,13 +307,13 @@ export default { ...@@ -256,13 +307,13 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const inspectorIds = row.inspectorId || this.ids; const troubleIds = row.troubleId || this.ids;
this.$confirm('是否确认删除巡检员编号为"' + inspectorIds + '"的数据项?', "警告", { this.$confirm('是否确认删除隐患信息编号为"' + troubleIds + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function() {
return delInspector(inspectorIds); return delHiddenTrouble(troubleIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
...@@ -271,13 +322,13 @@ export default { ...@@ -271,13 +322,13 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有巡检员数据项?', "警告", { this.$confirm('是否确认导出所有隐患信息数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportInspector(queryParams); return exportHiddenTrouble(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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