Commit df1a3dac authored by 耿迪迪's avatar 耿迪迪

Merge branch 'master' of ssh://111.61.77.35:15/gengdidi/gassafety

parents 516f4fd4 534d911c
......@@ -2,6 +2,7 @@ package com.zehong.web.controller.riskManagement;
import java.util.List;
import com.zehong.system.domain.form.HiddenTroubleForm;
import com.zehong.system.domain.vo.HiddenTroubleVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -40,10 +41,10 @@ public class THiddenTroubleController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:list')")
@GetMapping("/list")
public TableDataInfo list(THiddenTrouble tHiddenTrouble)
public TableDataInfo list(HiddenTroubleForm hiddenTroubleForm)
{
startPage();
List<HiddenTroubleVo> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
List<HiddenTroubleVo> list = tHiddenTroubleService.selectTHiddenTroubleList(hiddenTroubleForm);
return getDataTable(list);
}
......@@ -65,10 +66,10 @@ public class THiddenTroubleController extends BaseController
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:export')")
@Log(title = "隐患信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(THiddenTrouble tHiddenTrouble)
public AjaxResult export(HiddenTroubleForm hiddenTroubleForm)
{
tHiddenTrouble.setDealStatus("3");
List<HiddenTroubleVo> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
hiddenTroubleForm.setDealStatus("3");
List<HiddenTroubleVo> list = tHiddenTroubleService.selectTHiddenTroubleList(hiddenTroubleForm);
ExcelUtil<HiddenTroubleVo> util = new ExcelUtil<HiddenTroubleVo>(HiddenTroubleVo.class);
return util.exportExcel(list, "隐患信息数据");
}
......
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* 隐患信息对象 t_hidden_trouble
*
* @author zehong
* @date 2021-08-20
*/
public class HiddenTroubleForm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 隐患信息id */
private Integer troubleId;
/** 隐患类型 */
@Excel(name = "隐患类型")
private String troubleType;
/** 隐患名称 */
@Excel(name = "隐患名称")
private String troubleName;
/** 隐患级别 */
@Excel(name = "隐患级别")
private String troubleLevel;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 设备id */
@Excel(name = "设备id")
private Integer deviceId;
/** 设备类型(0管道,1调压阀,2阀门井,3流量计,4压力表) */
@Excel(name = "设备类型", readConverterExp = "0=管道,1调压阀,2阀门井,3流量计,4压力表")
private String deviceType;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 是否作废(0正常,1作废) */
@Excel(name = "是否作废(0正常,1作废)")
private String isDel;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 备注 */
@Excel(name = "备注")
private String remarks;
/** 图片地址 */
@Excel(name = "图片地址")
private String pictureUrl;
/** 上报人(用户id) */
@Excel(name = "上报人", readConverterExp = "用户id")
private Long reportMan;
/** 创建起始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startCreateTime;
/** 创建截止时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endCreateTime;
public void setTroubleId(Integer troubleId)
{
this.troubleId = troubleId;
}
public Integer getTroubleId()
{
return troubleId;
}
public String getTroubleName() {
return troubleName;
}
public void setTroubleName(String troubleName) {
this.troubleName = troubleName;
}
public void setTroubleType(String troubleType)
{
this.troubleType = troubleType;
}
public String getTroubleType()
{
return troubleType;
}
public void setDeviceId(Integer deviceId)
{
this.deviceId = deviceId;
}
public Integer getDeviceId()
{
return deviceId;
}
public void setTroubleLevel(String troubleLevel)
{
this.troubleLevel = troubleLevel;
}
public String getTroubleLevel()
{
return troubleLevel;
}
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 setDeviceType(String deviceType)
{
this.deviceType = deviceType;
}
public String getDeviceType()
{
return deviceType;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setPictureUrl(String pictureUrl)
{
this.pictureUrl = pictureUrl;
}
public String getPictureUrl()
{
return pictureUrl;
}
public void setReportMan(Long reportMan)
{
this.reportMan = reportMan;
}
public Long getReportMan()
{
return reportMan;
}
public Date getStartCreateTime() {
return startCreateTime;
}
public void setStartCreateTime(Date startCreateTime) {
this.startCreateTime = startCreateTime;
}
public Date getEndCreateTime() {
return endCreateTime;
}
public void setEndCreateTime(Date endCreateTime) {
this.endCreateTime = endCreateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("troubleId", getTroubleId())
.append("troubleType", getTroubleType())
.append("deviceId", getDeviceId())
.append("troubleLevel", getTroubleLevel())
.append("orderId", getOrderId())
.append("longitude", getLongitude())
.append("deviceType", getDeviceType())
.append("latitude", getLatitude())
.append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("address", getAddress())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.append("pictureUrl", getPictureUrl())
.append("reportMan", getReportMan())
.toString();
}
}
......@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.domain.form.HiddenTroubleForm;
/**
* 隐患信息Mapper接口
......@@ -22,10 +23,10 @@ public interface THiddenTroubleMapper
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @param hiddenTroubleForm 隐患信息
* @return 隐患信息集合
*/
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
public List<THiddenTrouble> selectTHiddenTroubleList(HiddenTroubleForm hiddenTroubleForm);
/**
* 地图显示隐患信息列表
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInspectionData;
import org.apache.ibatis.annotations.Param;
/**
* 巡检记录Mapper接口
......@@ -22,10 +24,11 @@ public interface TInspectionDataMapper
/**
* 查询巡检记录
*
* @param deviceId 设备id
* @param planId
* @param deviceId
* @return 巡检记录
*/
public TInspectionData selectTInspectionDataByDeviceId(int deviceId);
public TInspectionData selectTInspectionDataByDeviceId(@Param("planId")int planId, @Param("deviceId")int deviceId);
/**
* 查询巡检记录
......
......@@ -2,6 +2,7 @@ package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.domain.form.HiddenTroubleForm;
import com.zehong.system.domain.vo.HiddenTroubleVo;
/**
......@@ -23,10 +24,10 @@ public interface ITHiddenTroubleService
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @param hiddenTroubleForm 隐患信息
* @return 隐患信息集合
*/
public List<HiddenTroubleVo> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
public List<HiddenTroubleVo> selectTHiddenTroubleList(HiddenTroubleForm hiddenTroubleForm);
/**
* 地图显示隐患信息列表
......
......@@ -8,6 +8,7 @@ import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.*;
import com.zehong.system.domain.form.HiddenTroubleForm;
import com.zehong.system.domain.vo.HiddenTroubleVo;
import com.zehong.system.mapper.*;
import com.zehong.system.service.ISysDictTypeService;
......@@ -85,14 +86,14 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @param hiddenTroubleForm 隐患信息
* @return 隐患信息
*/
@Override
public List<HiddenTroubleVo> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble)
public List<HiddenTroubleVo> selectTHiddenTroubleList(HiddenTroubleForm hiddenTroubleForm)
{
List<HiddenTroubleVo> list = new ArrayList<>();
List<THiddenTrouble> tHiddenTroubleList = tHiddenTroubleMapper.selectTHiddenTroubleList(tHiddenTrouble);
List<THiddenTrouble> tHiddenTroubleList = tHiddenTroubleMapper.selectTHiddenTroubleList(hiddenTroubleForm);
if(tHiddenTroubleList.size() != 0) {
for (THiddenTrouble trouble : tHiddenTroubleList) {
......
......@@ -140,6 +140,11 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
@Override
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan) throws Exception
{
tInspectionPlan.setPlanStatus("0");
tInspectionPlan.setCreateTime(DateUtils.getNowDate());
tInspectionPlanMapper.insertTInspectionPlan(tInspectionPlan);
int planId = tInspectionPlan.getPlanId();
String deviceIds = tInspectionPlan.getDeviceIds();
String[] stringArr = deviceIds.split("],");
String deviceType = null;
......@@ -158,7 +163,7 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
} else {
Integer deviceId = Integer.valueOf(m.replaceAll("").trim());
TInspectionData data = new TInspectionData();
data.setPlanId(tInspectionPlan.getPlanId());
data.setPlanId(planId);
data.setDeviceId(deviceId);
data.setDeviceType(deviceType);
data.setCreateTime(DateUtils.getNowDate());
......@@ -167,9 +172,7 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
}
}
}
tInspectionPlan.setPlanStatus("0");
tInspectionPlan.setCreateTime(DateUtils.getNowDate());
return tInspectionPlanMapper.insertTInspectionPlan(tInspectionPlan);
return 1;
}
/**
......
package com.zehong.system.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
......@@ -25,6 +27,8 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private TInspectionPlanMapper tInspectionPlanMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
......@@ -79,8 +83,11 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
String orderType = order.getOrderType();
if("1".equals(orderType)){
TInspectionPlan tInspectionPlan = tInspectionPlanMapper.selectTInspectionPlanById(order.getResourceId());
Integer planId = tInspectionPlan.getPlanId();
Integer deviceId = tOrderFeedback.getDeviceId();
TInspectionData data = tInspectionDataMapper.selectTInspectionDataByDeviceId(deviceId);
TInspectionData data = tInspectionDataMapper.selectTInspectionDataByDeviceId(planId, deviceId);
data.setDealStatus(dealStatus);
data.setIsHiddenDanger(isHiddenDanger);
data.setUpdateTime(DateUtils.getNowDate());
......
......@@ -75,8 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no
<where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="deviceCode != null and deviceCode != ''"> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null and deviceType != ''"> and d.device_type = #{deviceType}</if>
<if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
......@@ -112,8 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from t_device_report_data t
LEFT JOIN t_device_info d on t.device_num = d.iot_no
<where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="deviceCode != null and deviceCode != ''"> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null and deviceType != ''"> and d.device_type = #{deviceType}</if>
<if test="deviceType == null "> and (d.device_type = '3' or d.device_type = '4')</if>
<if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
......
......@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select trouble_id, trouble_name, trouble_type, device_id, trouble_level, order_id, longitude, device_type, latitude, is_del, deal_status, update_time, address, create_time, remarks, picture_url, report_man from t_hidden_trouble
</sql>
<select id="selectTHiddenTroubleList" parameterType="THiddenTrouble" resultMap="THiddenTroubleResult">
<select id="selectTHiddenTroubleList" parameterType="HiddenTroubleForm" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
<where>
and is_del = '0'
......@@ -40,11 +40,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="dealStatus != null and dealStatus != '' and dealStatus != -2 and dealStatus != -1"> and deal_status = #{dealStatus}</if>
<if test="dealStatus == -1"> and order_id is null</if>
<if test="dealStatus == -2"> and order_id is not null and deal_status is null</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
<if test="reportMan != null "> and report_man = #{reportMan}</if>
<if test="startCreateTime != null "> and create_time &gt;= #{startCreateTime}</if>
<if test="endCreateTime != null "> and create_time &lt;= #{endCreateTime}</if>
</where>
order by create_time desc
</select>
......
......@@ -43,9 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where data_id = #{dataId}
</select>
<select id="selectTInspectionDataByDeviceId" parameterType="int" resultMap="TInspectionDataResult">
<select id="selectTInspectionDataByDeviceId" parameterType="map" resultMap="TInspectionDataResult">
<include refid="selectTInspectionDataVo"/>
where device_id = #{deviceId}
where device_id = #{deviceId} and plan_id = #{planId}
</select>
<insert id="insertTInspectionData" parameterType="TInspectionData">
......
......@@ -19,12 +19,12 @@
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
// transform: translateX(-30px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
// transform: translateX(30px);
}
/* breadcrumb transition */
......@@ -36,7 +36,7 @@
.breadcrumb-enter,
.breadcrumb-leave-active {
opacity: 0;
transform: translateX(20px);
// transform: translateX(20px);
}
.breadcrumb-move {
......@@ -44,5 +44,5 @@
}
.breadcrumb-leave-active {
position: absolute;
// position: absolute;
}
......@@ -18,7 +18,7 @@
v-for="item in pipeList"
:key="item.pipeId"
:label="item.pipeName"
:value="item.pipeId"
:value="item.pipeId"
>
</el-option>
</el-select>
......@@ -152,6 +152,7 @@ export default {
form: {
deviceType: "3",
},
type: DEVICE_TYPE.FLOWMETER,
dialogVisible: false,
fileList: [],
// 表单校验
......@@ -210,16 +211,35 @@ export default {
this.form.iconUrl = res.url;
},
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
// console.log("this.form流量计",this.form)
// return;
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false;
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.msgSuccess("修改成功");
if (response.code == 200) {
this.dialogVisible = false;
const index = this.gaoMap.markers.indexOf(this.obj);
if (index >= 0) {
this.gaoMap.markers.splice(index, 1);
this.gaoMap.changePolineListNum = index;
}
this.map.remove(this.obj);
this.gaoMap.addMarker(
// this.form.deviceType,
//这个是上图用的type,跟后台的type不一致
this.type,
this.form,
() => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
console.log(arr);
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
}
);
this.msgSuccess("修改成功");
}
});
} else {
addDeviceInfo(this.form).then((response) => {
......@@ -227,12 +247,18 @@ export default {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.gaoMap.addMarker(this.type, this.form, () => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
});
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
} else {
this.msgSuccess("新增失败");
// this.msgSuccess("新增失败");
}
});
}
......
......@@ -59,11 +59,7 @@
<el-col :span="13">
<div>
<span>最后巡检日期:</span>
<span>{{
obj.inspectionTime
? obj.inspectionTime
: "-"
}}</span>
<span>{{ obj.inspectionTime ? obj.inspectionTime : "-" }}</span>
</div>
</el-col>
......@@ -73,7 +69,7 @@
</div>
<div>
<span>备注信息:</span>
<span>{{ obj.remarks }} </span>
<span v-un-content>{{ obj.remarks }}</span>
</div>
</div>
<template v-if="!obj.editorPage">
......@@ -140,6 +136,19 @@ export default {
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
// overflow: hidden;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #053b6a;
}
.top {
width: 100%;
height: 51px;
......
......@@ -2,41 +2,51 @@
<div class="wrapper">
<span class="dot-left"></span>
<div class="top display-default">
<div class="left text">{{data.deviceName}}</div>
<div class="left text">{{ data.deviceName }}</div>
<div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" @click="map.clearInfoWindow()"/>
<img
src="../../assets/images/closeBtn.png"
alt=""
@click="map.clearInfoWindow()"
/>
</div>
</div>
<!-- 设备信息 -->
<div class="content">
<div class="eq-content display-default">
<div class="text-wrapper">
<div class="eq-text">设备类型:<span>{{title}}</span></div>
<div class="eq-text">设备型号:<span>{{data.deviceModel}}</span></div>
<div class="eq-text">所属管道:<span>{{data.pipeName}}</span></div>
<div class="eq-text">物联网编号:<span>{{data.iotNo}}</span></div>
<div class="eq-text">
设备类型:<span>{{ title }}</span>
</div>
<div class="eq-text">
设备型号:<span>{{ data.deviceModel }}</span>
</div>
<div class="eq-text">
所属管道:<span>{{ data.pipeName }}</span>
</div>
<div class="eq-text">
物联网编号:<span>{{ data.iotNo }}</span>
</div>
</div>
<div class="pic">
<img v-bind:src="data.iconUrl" alt="" />
</div>
</div>
<!-- 维修人员 -->
<div class="maintain-content">
<div class="maintain-content">
<el-col :span="11">
<div>
<span>安装日期:</span>
<span>{{ moment(data.installationTime).format("YYYY-MM-DD") }}</span>
<span>{{
moment(data.installationTime).format("YYYY-MM-DD")
}}</span>
</div>
</el-col>
<el-col :span="13">
<div>
<span>最后巡检日期:</span>
<span>{{
data.inspectionTime
? data.inspectionTime
: "-"
}}</span>
<span>{{ data.inspectionTime ? data.inspectionTime : "-" }}</span>
</div>
</el-col>
......@@ -46,7 +56,7 @@
</div>
<div>
<span>备注信息:</span>
<span>{{ data.remarks }} </span>
<span v-un-content> {{ data.remarks }}</span>
</div>
</div>
<!-- 报警状态 -->
......@@ -55,24 +65,22 @@
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>-->
</div>
</div>
</template>
<script>
import moment from "moment"
import moment from "moment";
//line移入时的的infowindow
export default {
props: {
obj: { typs: Object },
title: "",
data: {},
map: null
map: null,
},
methods:{
methods: {
moment,
}
},
};
</script>
......@@ -88,6 +96,19 @@ export default {
width: 100%;
height: 51px;
background-color: #053b6a;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #053b6a;
}
.text {
font-weight: 600;
font-size: 16px;
......@@ -199,5 +220,4 @@ export default {
display: flex;
justify-content: space-between;
}
</style>
......@@ -152,6 +152,7 @@ export default {
form: {
deviceType: "4",
},
type: DEVICE_TYPE.PRESSUREGAGE,
dialogVisible: false,
fileList: [],
// 表单校验
......@@ -208,16 +209,33 @@ export default {
this.form.iconUrl = res.url;
},
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
// console.log("this.form)",this.form)
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => {
if (response.code == 200) {
this.dialogVisible = false;
const index = this.gaoMap.markers.indexOf(this.obj);
if (index >= 0) {
this.gaoMap.markers.splice(index, 1);
this.gaoMap.changePolineListNum = index;
}
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.gaoMap.addMarker(
// this.form.deviceType,
//这个是上图用的type,跟后台的type不一致
this.type,
this.form,
() => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
console.log(arr);
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
}
);
this.msgSuccess("修改成功");
}
});
......@@ -227,12 +245,18 @@ export default {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.gaoMap.addMarker(this.type, this.form, () => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
});
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
} else {
this.msgSuccess("新增失败");
// this.msgSuccess("新增失败");
}
});
}
......
......@@ -14,7 +14,7 @@
placeholder="请选择所属管道"
style="width: 100%"
>
<el-option
<el-option
v-for="item in pipeList"
:key="item.pipeId"
:label="item.pipeName"
......@@ -152,6 +152,7 @@ export default {
form: {
deviceType: "1",
},
type: DEVICE_TYPE.REGEULATORBOX,
dialogVisible: false,
fileList: [],
map: null,
......@@ -208,15 +209,35 @@ export default {
this.form.iconUrl = res.url;
},
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
// console.log("this.form",this.form)
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false;
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.msgSuccess("修改成功");
if (response.code == 200) {
this.dialogVisible = false;
const index = this.gaoMap.markers.indexOf(this.obj);
if (index >= 0) {
this.gaoMap.markers.splice(index, 1);
this.gaoMap.changePolineListNum = index;
}
this.map.remove(this.obj);
this.gaoMap.addMarker(
// this.form.deviceType,
//这个是上图用的type,跟后台的type不一致
this.type,
this.form,
() => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
console.log(arr);
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
}
);
this.msgSuccess("修改成功");
}
});
} else {
addDeviceInfo(this.form).then((response) => {
......@@ -224,12 +245,18 @@ export default {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.gaoMap.addMarker(this.type, this.form, () => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
});
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
} else {
this.msgSuccess("新增失败");
// this.msgSuccess("新增失败");
}
});
}
......
......@@ -151,6 +151,7 @@ export default {
form: {
deviceType: "2",
},
type: DEVICE_TYPE.VALUEWELL,
dialogVisible: false,
fileList: [],
map: null,
......@@ -206,14 +207,35 @@ export default {
this.form.iconUrl = res.url;
},
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false;
this.map.remove(this.obj);
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.msgSuccess("修改成功");
if (response.code == 200) {
this.dialogVisible = false;
const index = this.gaoMap.markers.indexOf(this.obj);
if (index >= 0) {
this.gaoMap.markers.splice(index, 1);
this.gaoMap.changePolineListNum = index;
}
this.map.remove(this.obj);
this.gaoMap.addMarker(
// this.form.deviceType,
//这个是上图用的type,跟后台的type不一致
this.type,
this.form,
() => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
console.log(arr);
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
}
);
this.msgSuccess("修改成功");
}
});
} else {
addDeviceInfo(this.form).then((response) => {
......@@ -221,12 +243,18 @@ export default {
this.remove();
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form);
this.gaoMap.addMarker(this.type, this.form, () => {
const arr = this.gaoMap.markers.map((item) => {
return item.getExtData();
});
this.gaoMap.view.deviceClassify(arr);
this.gaoMap.view.pipeList();
});
//this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
} else {
this.msgSuccess("新增失败");
// this.msgSuccess("新增失败");
}
});
}
......
......@@ -128,15 +128,17 @@ export default {
},
close() {
this.obj.polyline.infoWindow.close();
// window底部的数据拦
this.obj.polyline.getExtData().class.view.bottomDataShow = true;
},
deviceMore() {
console.log(this.obj.polyline.getExtData().lineData)
console.log(this.obj.polyline.getExtData().lineData);
this.obj.polyline.getExtData().class.view.$router.push({
path: "/dataMonitoring/realtimedetail",
query: {
deviceId: this.obj.polyline.getExtData().lineData.pipeId,
//这里是传数字
deviceType:"0",
deviceType: "0",
},
});
},
......@@ -151,11 +153,25 @@ export default {
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
// overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #053b6a;
position: relative;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #053b6a;
}
.text {
font-weight: 600;
font-size: 16px;
......
......@@ -194,12 +194,13 @@ export default {
path: "/dataMonitoring/alarmdetail",
query: {
alarmId: this.obj.polyline.getExtData().lineData.alarmId,
deviceType:"管道"
deviceType: "管道",
},
});
},
close() {
this.obj.polyline.infoWindow.close();
this.obj.polyline.getExtData().class.view.bottomDataShow = true;
},
},
};
......@@ -212,11 +213,24 @@ export default {
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
// overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #ff5a67;
}
.text {
font-weight: 600;
font-size: 16px;
......
......@@ -4,11 +4,7 @@
<div class="top display-default">
<div class="left text">{{ data.deviceName }}</div>
<div class="right text">
<img
src="../../assets/images/closeBtn.png"
alt=""
@click="map.clearInfoWindow()"
/>
<img src="../../assets/images/closeBtn.png" alt="" @click="close" />
</div>
</div>
<!-- 设备信息 -->
......@@ -98,6 +94,10 @@ export default {
},
});
},
close() {
this.map.clearInfoWindow();
this.data.class.view.bottomDataShow = true;
},
},
};
</script>
......@@ -109,11 +109,24 @@ export default {
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
// overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #053b6a;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #053b6a;
}
.text {
font-weight: 600;
font-size: 16px;
......
......@@ -7,7 +7,7 @@
<img
src="../../assets/images/closeBtn.png"
alt=""
@click="map.clearInfoWindow()"
@click="close"
/>
</div>
</div>
......@@ -137,6 +137,10 @@ export default {
type: "device",
});
},
close(){
this.map.clearInfoWindow();
this.data.class.view.bottomDataShow = true;
},
// CreateWorkCallBack(e) {
// // console.log("生成工单后传过来的参数", e);
// // console.log("markerCallBack");
......@@ -181,11 +185,24 @@ export default {
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
// overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #ff5a67;
}
.text {
font-weight: 600;
font-size: 16px;
......
......@@ -4,11 +4,7 @@
<div class="top display-default">
<div class="left text">{{ data.troubleName }}</div>
<div class="right text">
<img
src="../../assets/images/closeBtn.png"
alt=""
@click="map.clearInfoWindow()"
/>
<img src="../../assets/images/closeBtn.png" alt="" @click="close" />
</div>
</div>
<!-- 设备信息 -->
......@@ -72,7 +68,9 @@
关联设备:<span>{{ data.deviceName ? data.deviceName : "-" }}</span>
</div>
<div>
设备类型:<span>{{ data.deviceType ? this.deviceType[data.deviceType] : "-" }}</span>
设备类型:<span>{{
data.deviceType ? this.deviceType[data.deviceType] : "-"
}}</span>
</div>
<div v-if="!orderId">
工单编号:<span>{{ data.orderId }}</span>
......@@ -83,11 +81,7 @@
<el-button class="elbtn" type="primary">隐患详情</el-button>
</span>
<span v-if="orderId" @mousedown.stop="createWork">
<el-button
class="elbtn"
type="primary"
>生成工单</el-button
>
<el-button class="elbtn" type="primary">生成工单</el-button>
</span>
<span v-else @mousedown.stop="checkWork">
<el-button class="elbtn" type="primary">查看工单</el-button>
......@@ -121,7 +115,7 @@ export default {
computed: {
orderId() {
// 如果已经生成过工单,就不能再次生成了
console.log("orderId",this.data.orderId)
console.log("orderId", this.data.orderId);
// return this.data.orderId ? false : true;
return this.data.orderId ? false : true;
},
......@@ -131,15 +125,20 @@ export default {
createWork() {
// 控制外层弹框
// console.log(this.data.view.$refs.CreateWork);
this.data.class.view.$refs.CreateWorkTrouble.form.troubleId = this.data.troubleId;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleName = this.data.troubleName;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleType = this.data.troubleType;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleLevel = this.data.troubleLevel;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleId =
this.data.troubleId;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleName =
this.data.troubleName;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleType =
this.data.troubleType;
this.data.class.view.$refs.CreateWorkTrouble.form.troubleLevel =
this.data.troubleLevel;
this.data.class.view.$refs.CreateWorkTrouble.open = true;
this.data.class.view.$refs.CreateWorkTrouble.gaoMap = this.data.class.view.gaoMap;
this.data.class.view.$refs.CreateWorkTrouble.gaoMap =
this.data.class.view.gaoMap;
// 改变外层回调
// this.data.view.CreateWorkCallBack = this.CreateWorkCallBack;
this.data.class.view.troubleObjChange({troubleId:this.data.troubleId});
this.data.class.view.troubleObjChange({ troubleId: this.data.troubleId });
},
// CreateWorkCallBack(e) {
// // console.log("生成工单后传过来的参数", e);
......@@ -153,6 +152,10 @@ export default {
// options.orderId = e;
// marker.setExtData(options);
// },
close() {
this.map.clearInfoWindow();
this.data.class.view.bottomDataShow = true;
},
deviceMore() {
this.data.class.view.$router.push({
path: "/riskManagement/hiddenTroubleDetail",
......@@ -185,11 +188,24 @@ export default {
background: #fff;
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
overflow: hidden;
// overflow: hidden;
.top {
width: 100%;
height: 51px;
background-color: #e6a23c;
&:before {
content: "";
position: absolute;
left: -20px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #e6a23c;
}
.text {
font-weight: 600;
font-size: 16px;
......
<template>
<div class="wrapper">
<span class="left">姓名: {{ data.userName }}</span>
<span class="right">时间: {{ data.createTime }}</span>
<div class="content">
<span class="left">姓名: {{ data.userName }}</span>
<span class="right">时间: {{ data.createTime }}</span>
</div>
<div class=""></div>
</div>
</template>
......@@ -29,14 +33,26 @@ export default {
padding: 7px 7px 7px 8px;
box-shadow: 0 0 20px -5px #0d4f88;
border-radius: 4px;
span {
word-break: break-all;
display: block;
// vertical-align: top;
// &.right {
// width: 90px;
// padding-left: 4px;
// }
position: relative;
&:before {
content: "";
position: absolute;
left: -10px;
top: 5px;
width: 0px;
height: 0px;
/* border: 20px solid red; */
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
/* border-left: 50px solid greenyellow; */
border-right: 30px solid #0d4f88;
z-index: -1;
}
.content {
span {
word-break: break-all;
display: block;
}
}
}
</style>
\ No newline at end of file
......@@ -146,7 +146,7 @@ export default {
} else {
// 显示左侧联动菜单
path = this.activeRoutes(key);
console.log(path);
// console.log("path",this.$store.state.permission.topbarRouters);
console.log(this.$route.path);
if (this.$route.path != path[0].path) {
if (path[0].path) {
......@@ -235,6 +235,7 @@ export default {
.el-menu--horizontal > .el-submenu .el-submenu__title {
height: 50px !important;
line-height: 50px !important;
border:none !important;
margin-left:15px;
}
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
......
import hasRole from './hasRole'
import hasPermi from './hasPermi'
import unContent from './unContent'
const install = function(Vue) {
Vue.directive('hasRole', hasRole)
Vue.directive('hasPermi', hasPermi)
Vue.directive('un-content', unContent)
}
if (window.Vue) {
......
/**
* 无内容显示-
* Copyright (c) 2021 gassafety
*/
export default {
inserted(el, binding, vnode) {
el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
}
};
......@@ -51,8 +51,17 @@ router.beforeEach((to, from, next) => {
});
router.afterEach((to, from) => {
// console.log('全局后置钩子',to, from)
if (to.path == "/enterprise/mapView") {
// 查找只有一个菜单的目录
const parentPath = to.matched[0].path;
let arr = store.state.permission.topbarRouters.filter(item=>{
return item.path == parentPath;
})[0].children.filter(item=>{
return item.hidden == false
})
if (arr.length==1 ||to.path == "/enterprise/mapView") {
store.dispatch("app/toggleDevice", "mobile");
store.dispatch("app/closeSideBar", { withoutAnimation: true });
......
import { constantRoutes } from '@/router'
import { getRouters } from '@/api/menu'
import Layout from '@/layout/index'
import ParentView from '@/components/ParentView';
import { constantRoutes } from "@/router";
import { getRouters } from "@/api/menu";
import Layout from "@/layout/index";
import ParentView from "@/components/ParentView";
import router from "../../router";
const permission = {
state: {
......@@ -10,30 +11,44 @@ const permission = {
defaultRoutes: [],
topbarRouters: [],
sidebarRouters: [],
mySidebarRouters:[],
mySidebarRouters: []
},
mutations: {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
state.addRoutes = routes;
state.routes = constantRoutes.concat(routes);
},
SET_DEFAULT_ROUTES: (state, routes) => {
state.defaultRoutes = constantRoutes.concat(routes)
state.defaultRoutes = constantRoutes.concat(routes);
},
SET_TOPBAR_ROUTES: (state, routes) => {
// 顶部导航菜单默认添加统计报表栏指向首页
const index = [{
path: 'index',
meta: { title: '统计报表', icon: 'dashboard'}
}]
// const index = [{
// path: 'index',
// meta: { title: '统计报表', icon: 'dashboard'}
// }]
// 首页是gis地图
const index = [
{
path: "",
meta: { title: "Gis地图", icon: "dashboard" },
children: [
{
path: "enterprise/mapView",
meta: { title: "Gis地图", icon: "dashboard" }
}
]
}
];
// state.topbarRouters = routes.concat(index);
state.topbarRouters = routes;
const arr = [...index, ...routes];
state.topbarRouters = arr;
// state.topbarRouters = routes;
},
SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes;
state.mySidebarRouters = routes;
},
}
},
actions: {
// 生成路由
......@@ -41,74 +56,75 @@ const permission = {
return new Promise(resolve => {
// 向后端请求路由数据
getRouters().then(res => {
const sdata = JSON.parse(JSON.stringify(res.data))
const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata)
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
commit('SET_ROUTES', rewriteRoutes)
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
resolve(rewriteRoutes)
})
})
const sdata = JSON.parse(JSON.stringify(res.data));
const rdata = JSON.parse(JSON.stringify(res.data));
const sidebarRoutes = filterAsyncRouter(sdata);
const rewriteRoutes = filterAsyncRouter(rdata, false, true);
rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true });
commit("SET_ROUTES", rewriteRoutes);
commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes));
commit("SET_DEFAULT_ROUTES", sidebarRoutes);
commit("SET_TOPBAR_ROUTES", sidebarRoutes);
resolve(rewriteRoutes);
});
});
}
}
}
};
// 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return asyncRouterMap.filter(route => {
if (type && route.children) {
route.children = filterChildren(route.children)
route.children = filterChildren(route.children);
}
if (route.component) {
// Layout ParentView 组件特殊处理
if (route.component === 'Layout') {
route.component = Layout
} else if (route.component === 'ParentView') {
route.component = ParentView
if (route.component === "Layout") {
route.component = Layout;
} else if (route.component === "ParentView") {
route.component = ParentView;
} else {
route.component = loadView(route.component)
route.component = loadView(route.component);
}
}
if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type)
route.children = filterAsyncRouter(route.children, route, type);
} else {
delete route['children']
delete route['redirect']
delete route["children"];
delete route["redirect"];
}
return true
})
return true;
});
}
function filterChildren(childrenMap, lastRouter = false) {
var children = []
var children = [];
childrenMap.forEach((el, index) => {
if (el.children && el.children.length) {
if (el.component === 'ParentView') {
if (el.component === "ParentView") {
el.children.forEach(c => {
c.path = el.path + '/' + c.path
c.path = el.path + "/" + c.path;
if (c.children && c.children.length) {
children = children.concat(filterChildren(c.children, c))
return
children = children.concat(filterChildren(c.children, c));
return;
}
children.push(c)
})
return
children.push(c);
});
return;
}
}
if (lastRouter) {
el.path = lastRouter.path + '/' + el.path
el.path = lastRouter.path + "/" + el.path;
}
children = children.concat(el)
})
return children
children = children.concat(el);
});
return children;
}
export const loadView = (view) => { // 路由懒加载
return (resolve) => require([`@/views/${view}`], resolve)
}
export const loadView = view => {
// 路由懒加载
return resolve => require([`@/views/${view}`], resolve);
};
export default permission
export default permission;
......@@ -37,6 +37,8 @@ class gaodeMap {
view = null;
// 地图移动结束后出现infowindow用的函数
handleInfoWindowOpenFunc = null;
// 点击左侧抽屉的时候,改变的flag
leftListClick = false;
//构造函数中设置中央点默认值
constructor(center) {
......@@ -59,6 +61,8 @@ class gaodeMap {
this.myMap.on("click", e => {
// if (this.lineType !=1 || this.lineFlag) return;
this.closeInfoWindow();
this.polyLinesColorClear();
if (this.lineType != 1 || this.lineFlag) return;
// 除了这里,还要利用vue页面的window事件辅助,当组件出来的时候,就得利用window事件
......@@ -71,7 +75,6 @@ class gaodeMap {
this.newLineObj = null;
this.lineFlag = false;
this.createNewLine();
console.log("map点击事件新建");
})
.catch(() => {});
......@@ -82,17 +85,23 @@ class gaodeMap {
// 地图开始平移删除infowindow
this.myMap.on("movestart", () => {
// console.log("地图平移");
this.closeInfoWindow();
// 抽屉点击的时候让infowindow隐藏
if (this.leftListClick) {
console.log("moveStart");
this.closeInfoWindow();
}
});
// 地图开始缩放删除infowindow
this.myMap.on("zoomstart", () => {
// console.log("缩放开始")
this.closeInfoWindow();
});
this.myMap.on("moveend", () => {
if (this.handleInfoWindowOpenFunc) {
this.handleInfoWindowOpenFunc();
this.handleInfoWindowOpenFunc = null;
// 移动结束之后,leftListClick变成false
this.leftListClick = false;
}
// console.log("缩放开始")
if (!this.onceFlag) {
......@@ -171,6 +180,7 @@ class gaodeMap {
addMarker(markerType, data, func) {
let that = this;
that.markerType = markerType;
console.log(markerType);
let infoWindow = new AMap.InfoWindow({
isCustom: true,
offset: new AMap.Pixel(24, -38),
......@@ -198,6 +208,7 @@ class gaodeMap {
) {
marker.content = this.getMarketContent(data);
marker.on("mouseover", this.infoOpen);
marker.on("click", this.infoOpen);
marker.on("mouseout", infoClose);
marker.infoWindow = infoWindow;
marker.setExtData(data);
......@@ -245,6 +256,11 @@ class gaodeMap {
that.markers.splice(ind, 1);
console.log(that.markers);
}
const arr = that.markers.map(item => {
return item.getExtData();
});
that.view.deviceClassify(arr);
that.view.pipeList();
}
});
})
......@@ -286,7 +302,13 @@ class gaodeMap {
});
}
this.markers.push(marker);
if (this.changePolineListNum === null) {
// this.polyLines.push(polyline);
this.markers.push(marker);
} else {
this.markers.splice(this.changePolineListNum, 0, marker);
this.changePolineListNum = null;
}
map.setZoom("11");
//map.setFitView();
......@@ -302,6 +324,13 @@ class gaodeMap {
}
// 其他设备
infoOpen = e => {
// 如果是无状态并且鼠标mouseover
if (this.view.targetNum == 0 && e.type == "mouseover") {
return;
}
// 如果是新建状态 不出弹框
if (this.view.targetNum == 1) return;
console.log(e.target);
let options = map.getStatus();
options.scrollWheel = false;
map.setStatus(options);
......@@ -478,11 +507,12 @@ class gaodeMap {
let path = coordinates ? eval(coordinates) : [];
let polyline = new AMap.Polyline({
path,
strokeColor: "#F7FE38",
strokeColor: "#2EE7E7",
strokeWeight: 4,
strokeOpacity: 0.9,
zIndex: 50,
bubble: true,
cursor: "pointer",
bubble: false,
geodesic: true,
extData: {
type: "line",
......@@ -491,12 +521,12 @@ class gaodeMap {
lineData: item
}
});
// 如果是修改后包装,有记录的index 就在原位置插入,如果没有,就直接在最后插入
if (this.changePolineListNum===null) {
// 如果是修改后包装,有记录的index 就在原位置插入,如果没有,就直接在最后插入
if (this.changePolineListNum === null) {
this.polyLines.push(polyline);
}else{
this.polyLines.splice(this.changePolineListNum,0,polyline);
this.changePolineListNum=null;
} else {
this.polyLines.splice(this.changePolineListNum, 0, polyline);
this.changePolineListNum = null;
}
// 信息窗体
const dom = createPop(lineInfoWindow, {
......@@ -516,7 +546,7 @@ class gaodeMap {
});
let infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: false,
autoMove: true,
content: dom.$el,
//信息船体偏移量
offset: new AMap.Pixel(0, 0),
......@@ -527,8 +557,12 @@ class gaodeMap {
polyline.infoWindow = infoWindow;
//添加事件
polyline.on("mouseover", this.polylineMouseOver);
polyline.on("click", this.polylineMouseOver);
polyline.on("mousedown", e => {
this.polyLinesColorClear(polyline);
});
polyline.on("mouseout", e => {
polyline.setOptions({ strokeColor: "#F7FE38" });
polyline.setOptions({ strokeColor: "#2EE7E7" });
// infoWindow.close();
});
// 计算info的位置
......@@ -543,8 +577,19 @@ class gaodeMap {
}
// 鼠标移入管道
polylineMouseOver = e => {
console.log(e.type);
let polyline = e.target;
if (this.lineType == 1) return;
// 如果是无状态或者是新建并且是鼠标移入
if (this.view.targetNum == 0 && e.type == "mouseover") {
polyline.setOptions({ strokeColor: "#F7FE38" });
return;
}
// 当选择的是新建的时候,线是点不了的
if (this.lineType == 1 || this.view.targetNum == 1) return;
if((this.view.targetNum==2||this.view.targetNum==3)&&e.type=="mouseover"){
this.polyLinesColorClear(polyline);
}
// 上方导航的高
let X = 20,
Y = -20;
......@@ -588,20 +633,63 @@ class gaodeMap {
console.log("靠下了");
Y = -infoWindowHeight - 20;
}
polyline.setOptions({ strokeColor: "#FF5A67" });
X = 23;
Y = -20;
// polyline.setOptions({ strokeColor: "#FF5A67" });
// 浮动的时候为新建时,不变色
if (this.view.targetNum != 1) {
polyline.setOptions({ strokeColor: "#F7FE38" });
}
}
polyline.infoWindow.setOffset(new AMap.Pixel(X, Y));
polyline.infoWindow.open(map, e.lnglat);
// 如果是戍边浮动出现infowindow 就让窗口在固定的位置出现,这样就不显得乱了
if (e.type == "mouseover") {
const coordinates = polyline.getPath().map(item => {
return [item.lng, item.lat];
});
// const { coordinates } = polyline.getExtData().lineData;
// 计算出前两个点的中点
const arr1 = coordinates[0];
const arr2 = coordinates[1];
const a = this.centerNum(arr1[0], arr2[0]);
const b = this.centerNum(arr1[1], arr2[1]);
const a2 = this.centerNum(a, arr1[0]);
const b2 = this.centerNum(b, arr1[1]);
// polyline.infoWindow.open(map, [a2, b2]);
polyline.infoWindow.open(map, e.lnglat);
} else {
console.log("windowOpen");
// 变成异步,最后执行
polyline.infoWindow.open(map, e.lnglat);
// setTimeout(() => {
// console.log(polyline.infoWindow.getIsOpen())
// polyline.infoWindow.open(map, e.lnglat);
// }, 0);
// console.log(polyline.infoWindow.)
}
// polyline.infoWindow=infoWindow;
this.showInfoWindow = polyline.infoWindow;
// const
};
polyLinesColorClear(polylines) {
this.polyLines.forEach(item => {
if (item != polylines) {
item.setOptions({ strokeColor: "#2EE7E7" });
}
});
}
centerNum(num1, num2) {
return (Number(num1) + Number(num2)) / 2;
}
// 创建一条新的线
createNewLine() {
map.remove(this.markerOverlays);
console.log("创造一条线了啊");
this.mouseTool.polyline({
// bubbles:false,
strokeWeight: 4,
......@@ -639,6 +727,7 @@ class gaodeMap {
// obj.polyEditor.on('adjust',(e)=>{
// console.log("addnode")
// })
obj.on("mousedown", e => {
console.log(e.originEvent);
console.log("lineType", this.lineType);
......@@ -706,28 +795,24 @@ class gaodeMap {
const {
lineData: { pipeName, deviceInfoList }
} = obj.getExtData();
console.log("deviceInfoList", deviceInfoList);
var devices = " ";
for (var i = 0; i < deviceInfoList.length; i++) {
var item = deviceInfoList[i];
devices = devices + item.deviceName + " ";
let devices = " ";
let content;
if (deviceInfoList) {
for (var i = 0; i < deviceInfoList.length; i++) {
var item = deviceInfoList[i];
devices = devices + item.deviceName + " ";
}
content = `请确认是否删除管道名称为 + ${pipeName} +的数据项,该管道下包含的设备( ${devices} )将一并删除`;
} else {
content = `请确认是否删除管道名称为 ${pipeName} 的数据项,该管道下不包含任何设备`;
}
vue
.$confirm(
'请确认是否删除管道名称为"' +
pipeName +
'"的数据项,该管道下包含的设备(' +
devices +
")将一并删除",
"提示",
{
// confirmButtonText: "确定",
// cancelButtonText: "取消",
type: "warning"
// center: true
}
)
.$confirm(content, "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
type: "warning"
// center: true
})
.then(() => {
const { lineData } = obj.getExtData();
// updatePipe
......@@ -740,22 +825,35 @@ class gaodeMap {
// 如果是老线,就要线删除原来的,然后重新包装一遍
if (index >= 0) {
this.polyLines.splice(index, 1);
// 删除管道的时候,与管道管理额的设备也要删除
for (var i = 0; i < deviceInfoList.length; i++) {
const item = deviceInfoList[i];
for (let j = 0; j < this.markers.length; j++) {
const item2 = this.markers[j];
if (item.deviceId == item2.getExtData().deviceId) {
map.remove(item2);
const ind = this.markers.indexOf(item2);
if (ind >= 0) {
this.markers.splice(ind, 1);
// 删除管道的时候,与管道管理额的设备也要删除,
// 如果管道存在下级设备,也一并删除
if (deviceInfoList) {
for (var i = 0; i < deviceInfoList.length; i++) {
const item = deviceInfoList[i];
for (let j = 0; j < this.markers.length; j++) {
const item2 = this.markers[j];
if (item.deviceId == item2.getExtData().deviceId) {
map.remove(item2);
const ind = this.markers.indexOf(item2);
if (ind >= 0) {
this.markers.splice(ind, 1);
}
break;
}
break;
}
}
}
map.remove(obj);
// 列表变化
const pipeArr = this.polyLines.map(item => {
return item.getExtData().lineData;
});
const markerArr = this.markers.map(item => {
return item.getExtData();
});
this.view.pipeClassify(pipeArr);
this.view.deviceClassify(markerArr);
this.view.pipeList();
}
vue.$message({
type: "success",
......@@ -788,7 +886,8 @@ class gaodeMap {
item.setExtData(opstions);
let attr = item.getOptions();
attr.strokeColor = "#F7FE38";
// attr.strokeColor = "#F7FE38";
attr.strokeColor = "#2EE7E7";
item.setOptions(attr);
});
}
......@@ -854,7 +953,6 @@ class gaodeMap {
device.form.longitude = postion.lng;
device.form.latitude = postion.lat;
}
device.show();
});
e.obj.on("mouseover", function() {
......@@ -871,6 +969,12 @@ class gaodeMap {
if (e.obj && e.obj.getExtData().type == "newLine") {
console.log("挂上事件");
that.newLineAddEvent(e.obj);
e.obj.on("mouseover", () => {
e.obj.setOptions({ strokeColor: "#F7FE38" });
});
e.obj.on("mouseout", () => {
e.obj.setOptions({ strokeColor: "#80d8ff" });
});
// 记录这条线
// console.log(e.obj.getPath().length)
// 如果只有一个点,并没有连成线的时候就不close 大于一个点的时候才执行clse
......
......@@ -53,9 +53,9 @@ class gaodeMap {
markerPassedPolylineInfoWindow = null;
view = null;
handleInfoWindowOpenFunc = null;
onceFlag = false;
// 用来判断点击左边抽屉列表的时候移动才消失
leftListClick = false;
//构造函数中设置中央点默认值
constructor(center) {
this.markers = [];
......@@ -74,11 +74,14 @@ class gaodeMap {
// mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae',
});
this.myMap = map;
this.myMap.on("click", e => {
this.myMap.on("mousedown", e => {
console.log(e);
// if (this.lineType !=1 || this.lineFlag) return;
if (this.lineType != 1 || this.lineFlag) return;
this.closeInfoWindow();
this.polyLinesColorClear();
this.view.bottomDataShow = true;
if (this.lineType != 1 || this.lineFlag) return;
// 除了这里,还要利用vue页面的window事件辅助,当组件出来的时候,就得利用window事件
if (this.newLineObj) {
vue
......@@ -89,19 +92,22 @@ class gaodeMap {
this.newLineObj = null;
this.lineFlag = false;
this.createNewLine();
//console.log("map点击事件新建");
})
.catch(() => {});
}
// //console.log("抬起来了");
});
// 地图开始平移删除infowindow
this.myMap.on("movestart", () => {
// console.log("地图平移");
this.closeInfoWindow();
if (this.leftListClick) {
console.log("moveStart");
this.closeInfoWindow();
}
// this.closeInfoWindow();
});
// 地图开始缩放删除infowindow
this.myMap.on("zoomstart", () => {
// console.log("缩放开始")
......@@ -259,6 +265,10 @@ class gaodeMap {
marker.data = data;
marker.infoWindow = infoWindow;
marker.on("mouseover", this.wokerManOpen);
marker.on("mouseout", e => {
e.target.infoWindow.close();
});
marker.on("mousedown", e => {
// console.log(data);
that.closeInfoWindow();
......@@ -279,7 +289,7 @@ class gaodeMap {
marker.markerType = markerType;
marker.data = data;
marker.infoWindow = infoWindow;
marker.on("mouseover", this.troubleOpen);
marker.on("mousedown", this.troubleOpen);
marker.setExtData(data);
this.troubles.push(marker);
}
......@@ -292,7 +302,7 @@ class gaodeMap {
) {
// marker.content = this.getMarketContent(data, markerInfoWindow);
marker.infoWindow = infoWindow;
marker.on("mouseover", that.infoOpen);
marker.on("mousedown", that.infoOpen);
marker.on("mouseout", infoClose);
marker.setExtData(data);
that.deviceType = markerType;
......@@ -380,8 +390,10 @@ class gaodeMap {
this.markerType = e.target.markerType;
e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()", e.target.getExtData());
e.target.infoWindow.setOffset(new AMap.Pixel(24, -38));
e.target.infoWindow.open(map, e.target.getExtData().pos);
console.log("e.target.getPosition()", e.target.getExtData().pos);
console.log("offset", e.target.infoWindow.getOffset());
this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow);
// infoWindow.close();
......@@ -699,12 +711,13 @@ class gaodeMap {
marker.passedPolyline = new AMap.Polyline({
map: map,
strokeColor: "#AF5", //线颜色
cursor: "pointer",
strokeWeight: 6 //线宽
});
// removeLineInfoWindow
marker.passedPolyline.on("mouseover", e => {
marker.passedPolyline.on("mousedown", e => {
const dom = createPop(removeLineInfoWindow, {
map: this,
marker
......@@ -717,13 +730,13 @@ class gaodeMap {
// offset: new AMap.Pixel(20, 20),
anchor: "left-top"
});
marker.infoWindow.setOffset(new AMap.Pixel(10, -20));
marker.infoWindow.open(map, e.lnglat);
// infoWindow.on("mousedown",(e)=>{
// e.stopPropagation();
// })
this.markerPassedPolylineInfoWindow = marker.infoWindow;
console.log(e.lnglat);
});
marker.moveMarker.on("moving", function(e) {
......@@ -778,7 +791,6 @@ class gaodeMap {
// //console.log("coordinates",coordinates)
// let path = coordinates ? getArray(coordinates) :[];
// 字符串转二维数组
let path = coordinates ? eval(coordinates) : [];
let polyline = new AMap.Polyline({
path,
......@@ -786,8 +798,9 @@ class gaodeMap {
strokeWeight: 4,
strokeOpacity: 0.9,
zIndex: 50,
bubble: true,
bubble: false,
geodesic: true,
cursor: "pointer",
extData: {
type: "line",
//当前line状态 0:正常状态 1:正在编辑状态
......@@ -801,12 +814,17 @@ class gaodeMap {
// 信息窗体
this.newLineAddEvent(polyline);
//添加事件
polyline.on("mouseover", this.polylineMouseOver);
polyline.on("mousedown", this.polylineMouseOver);
polyline.on("mouseover", () => {
polyline.setOptions({ strokeColor: "#F7FE38" });
});
polyline.on("mouseout", e => {
// console.log("polyline.getExtData().lineData.alarmState",polyline.getExtData().lineData.alarmState)
if (polyline.getExtData().lineData.alarmState == 1) return;
polyline.setOptions({ strokeColor: "#2EE7E7" });
if (polyline.getExtData().lineData.alarmState == 1) {
polyline.setOptions({ strokeColor: "#ff0000" });
} else {
polyline.setOptions({ strokeColor: "#2EE7E7" });
}
// infoWindow.close();
});
// 计算info的位置
......@@ -830,11 +848,11 @@ class gaodeMap {
} else {
infoWindow = this.lineMouseOver(polyline, lineInfoWindow, item);
}
infoWindow.open(map, e.lnglat);
console.log(infoWindow);
// 如果是鼠标真正移入,则计算位置,如果不是鼠标真正移入,是人为执行出现infowindow,则不计算位置
console.log("e.originEvent", e.originEvent);
if (e.originEvent) {
if (e.originEvent && 0) {
// 上方导航的高
const topBar = 81;
// 坐标导航的宽
......@@ -884,11 +902,26 @@ class gaodeMap {
infoWindow.setOffset(new AMap.Pixel(X, Y));
} else {
infoWindow.setOffset(new AMap.Pixel(20, -20));
this.polyLinesColorClear(polyline);
// polyline.setOptions({ strokeColor: "#F7FE38" });
}
this.boxCollision(infoWindow.dom);
this.showInfoWindow = infoWindow;
// const
};
// 所有的线的颜色归位,如果是报警的,就红色,不是就蓝色
polyLinesColorClear(polyline) {
this.polyLines.forEach(item => {
if (item != polyline) {
if (item.getExtData().lineData.alarmState == 1) {
item.setOptions({ strokeColor: "#ff0000" });
} else {
item.setOptions({ strokeColor: "#2EE7E7" });
}
}
});
}
lineMouseOver(polyline, lineInfoWindow, item) {
let dom = createPop(lineInfoWindow, {
......@@ -906,11 +939,11 @@ class gaodeMap {
});
let infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: false,
autoMove: true,
content: dom.$el,
//信息船体偏移量
offset: new AMap.Pixel(0, 0),
anchor: "left-top"
// offset: new AMap.Pixel(0, 0),
anchor: "left-topr"
});
polyline.infoWindow = infoWindow;
return infoWindow;
......
<template>
<div class="app-container">
<div v-if="fromGisMap">
<div
style="width: 5%; height: 45px; margin-left: 20px"
@click="$router.go(-1)"
>
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112); float: left"
>返回</el-button
>
<div style="float: left; margin-top: 8px; margin-left: 5px">
<img
src="../../../assets/logo/fanhui.png"
style="width: 25px"
alt=""
/>
</div>
</div>
</div>
<el-form
:model="queryParams"
ref="queryForm"
......@@ -42,6 +21,7 @@
v-model="queryParams.alarmType"
placeholder="请选择报警类型"
clearable
filterable
size="small"
>
<el-option
......@@ -92,14 +72,19 @@
</el-form>
<el-table v-loading="loading" :data="deviceAlarmList.slice((pageNum-1)*pageSize,pageNum*pageSize)" @selection-change="handleSelectionChange" >
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="设备名称" align="center" prop="deviceName" width="280px"/>
<el-table-column label="设备编号" align="center" prop="deviceCode" width="240px"/>
<el-table-column label="设备类型" align="center" prop="deviceType"/>
<el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" />
<el-table-column label="报警开始时间" align="center" prop="startTime" />
<el-table-column label="报警结束时间" align="center" prop="endTime" />
<el-table-column label="处理状态" align="center" prop="dealStatus">
<el-table-column label="报警值" align="center" prop="alarmValue" width="150px"/>
<el-table-column label="报警开始时间" align="center" prop="startTime" width="220px"/>
<el-table-column label="报警结束时间" align="center" prop="endTime" width="220px">
<template slot-scope="scope">
<span v-if="scope.row.endTime == null || scope.row.endTime == ''">-</span>
<span v-if="scope.row.endTime != null && scope.row.endTime != ''">{{scope.row.endTime}}</span>
</template>
</el-table-column>
<el-table-column label="处理状态" align="center" prop="dealStatus" width="150px">
<template slot-scope="scope">
<span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span>
<span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') &&
......@@ -152,10 +137,10 @@
<font>{{ form.alarmValue }}</font>
</el-form-item>
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
<el-input v-model="form.orderName" placeholder="请输入工单名称" style="width: 590px" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable filterable size="small" @change="setUserId" style="width: 590px">
<el-option
v-for="item in inspector"
:key="item.userId"
......@@ -165,7 +150,7 @@
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks">
<el-input type="textarea" v-model="form.remarks" placeholder="请输入工单描述" />
<el-input type="textarea" v-model="form.remarks" placeholder="请输入工单描述" style="width: 590px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......
......@@ -11,9 +11,13 @@
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
<el-option label="流量计" value="3" />
<el-option label="压力表" value="4" />
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" filterable clearable size="small">
<el-option
v-for="temp in typeOptions"
:key="temp.value"
:label="temp.label"
:value="temp.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
......@@ -93,6 +97,11 @@ export default {
pageSize: 10,
// 设备监控表格数据
dataList: [],
// 处理状态字典
typeOptions: [
{'label':'流量计','value':'3'},
{'label':'压力表','value':'4'},
],
// 弹出层标题
title: "",
// 是否显示弹出层
......
......@@ -11,11 +11,36 @@
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
<el-option label="流量计" value="3" />
<el-option label="压力表" value="4" />
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" filterable clearable size="small">
<el-option
v-for="temp in typeOptions"
:key="temp.value"
:label="temp.label"
:value="temp.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="上报时间" prop="startReportTime">
<el-date-picker
clearable size="small"
v-model="queryParams.startReportTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择起始时间"
align="right">
</el-date-picker>
<font color="#C0C4CC"></font>
</el-form-item>
<el-form-item label="" prop="endReportTime">
<el-date-picker
clearable size="small"
v-model="queryParams.endReportTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择截止时间"
align="right">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
......@@ -81,6 +106,11 @@ export default {
pageSize: 10,
// 设备监控表格数据
dataList: [],
// 处理状态字典
typeOptions: [
{'label':'流量计','value':'3'},
{'label':'压力表','value':'4'},
],
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -98,6 +128,8 @@ export default {
reportTime: null,
communicationStatus: null,
deviceStatus: null,
startReportTime: null,
endReportTime: null,
},
// 表单参数
form: {},
......
......@@ -20,7 +20,7 @@
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" size="small">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" filterable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -143,7 +143,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-col :span="11">
<el-form-item label="所属管道" prop="pipeId">
<el-select v-model="form.pipeId" placeholder="请选择所属管道" style="width: 100%" >
<el-select v-model="form.pipeId" placeholder="请选择所属管道" filterable style="width: 100%" >
<el-option
v-for="item in options"
:key="item.pipeId"
......@@ -163,7 +163,7 @@
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" style="width: 100%" >
<el-select v-model="form.deviceType" placeholder="请选择设备类型" filterable style="width: 100%" >
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备" prop="deviceId">
<el-select v-model="queryParams.deviceId" placeholder="请选择设备">
<el-select v-model="queryParams.deviceId" placeholder="请选择设备" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......@@ -21,7 +21,7 @@
/>
</el-form-item>
<el-form-item label="关联管道" prop="relationPipeId">
<el-select v-model="queryParams.relationPipeId" placeholder="请选择关联管道">
<el-select v-model="queryParams.relationPipeId" placeholder="请选择关联管道" filterable>
<el-option
v-for="dict in pipes"
:key="dict.pipeId"
......@@ -40,7 +40,7 @@
/>
</el-form-item>
<el-form-item label="关联设备" prop="relationDeviceId">
<el-select v-model="queryParams.relationDeviceId" placeholder="请选择关联设备">
<el-select v-model="queryParams.relationDeviceId" placeholder="请选择关联设备" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......@@ -160,7 +160,7 @@
<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-select v-model="form.deviceId" placeholder="请选择设备">
<el-select v-model="form.deviceId" placeholder="请选择设备" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......@@ -174,7 +174,7 @@
</el-form-item>
<el-form-item label="关联管道id" prop="relationPipeId">
<!--<el-input v-model="form.relationPipeId" placeholder="请输入关联管道id" />-->
<el-select v-model="form.relationPipeId" placeholder="请选择关联管道">
<el-select v-model="form.relationPipeId" placeholder="请选择关联管道" filterable>
<el-option
v-for="dict in pipes"
:key="dict.pipeId"
......@@ -188,7 +188,7 @@
</el-form-item>
<el-form-item label="关联设备id" prop="relationDeviceId">
<!-- <el-input v-model="form.relationDeviceId" placeholder="请输入关联设备id" />-->
<el-select v-model="form.relationDeviceId" placeholder="请选择关联设备">
<el-select v-model="form.relationDeviceId" placeholder="请选择关联设备" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......@@ -212,7 +212,7 @@
<el-row :gutter="50">
<span>新增设备</span>
<!--<el-input placeholder="请输入设备名称" style="width: 260px;margin-left: 20px;"></el-input>-->
<el-select v-model="subForm.deviceId" placeholder="请选择设备名称">
<el-select v-model="subForm.deviceId" placeholder="请选择设备名称" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......@@ -230,7 +230,7 @@
<el-col :span="20" style="float: left;box-shadow: rgb(233, 229, 229) 3px 3px 7px 2px;padding-top: 20px;padding-left: 15px;">
<el-form-item label="关联管道:" prop="pipeCode">
<!--<el-input v-model="item.sss" placeholder="请输入关联管道名称" style="width: 40%;margin-left: 20px;"></el-input>-->
<el-select v-model="item.relationPipeId" placeholder="请选择关联管道名称">
<el-select v-model="item.relationPipeId" placeholder="请选择关联管道名称" filterable>
<el-option
v-for="dict in pipes"
:key="dict.pipeId"
......@@ -242,7 +242,7 @@
</el-form-item>
<el-form-item label="关联设备:" prop="pipeCode">
<!-- <el-input v-model="item.qqq" placeholder="请输入关联设备名称" style="width: 40%;margin-left: 20px;"></el-input>-->
<el-select v-model="item.relationDeviceId" placeholder="请选择关联设备名称">
<el-select v-model="item.relationDeviceId" placeholder="请选择关联设备名称" filterable>
<el-option
v-for="dict in devices"
:key="dict.deviceId"
......
<template>
<div>
<div style="width: 100vw; height: 100vh" id="container"></div>
<div
:style="{ height: `${boxHeight}px`, width: `${boxWidth}px` }"
id="container"
></div>
<div class="btn-wrapper">
<div class="myBtn">
<div
......@@ -98,6 +101,7 @@
ref="drawer"
class="drawer"
:class="{ back: backFlag, opacity: drawerOpacity }"
@click.stop="drawerdrawer"
>
<div class="switch" @click="backFlag = !backFlag">
<img v-if="!backFlag" src="@/assets/images/l.png" alt="" />
......@@ -107,7 +111,7 @@
<div class="scroll" :style="{ height: `${boxHeight}px` }">
<el-input
v-model="keyWord"
placeholder="点击输入"
placeholder="点击输入设备名称"
id="tipinput"
class="search-input"
>
......@@ -164,7 +168,7 @@
<template v-if="item.value != 9">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
<div class="no"></div>
<div class="code">设备编号</div>
<div class="name">设备名称</div>
</div>
......@@ -238,6 +242,7 @@ export default {
backFlag: true,
// 抽屉内的滚动条的高需要赋值赋值
boxHeight: "",
boxWidth: "",
drawerOpacity: false,
// 左边的bar的active判定
leftBarNum: [1, 2, 3, 4, 7],
......@@ -295,14 +300,21 @@ export default {
};
},
mounted() {
this.onResize();
window.removeEventListener("resize", this.onResize);
window.addEventListener("resize", this.onResize);
this.initMap();
this.boxHeight = document.body.clientHeight - 81;
},
methods: {
onResize() {
this.boxHeight = document.body.clientHeight - 81;
this.boxWidth = document.body.clientWidth - 100;
},
async initMap() {
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
this.gaoMap.view = this;
window.removeEventListener("click", this.barClose);
window.addEventListener("click", this.barClose);
gaoMap.addMouseTool();
gaoMap.searchTips("tipinput");
......@@ -313,7 +325,10 @@ export default {
// 左边的Bar修改值
leftBarChange(item) {
// this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
// 关闭infowindow
this.gaoMap.closeInfoWindow();
// 恢复颜色
this.gaoMap.polyLinesColorClear();
const index = this.leftBarNum.indexOf(item.value);
if (index >= 0) {
this.leftBarNum.splice(index, 1);
......@@ -374,6 +389,8 @@ export default {
}
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
// 清除所有线的颜色
this.gaoMap.polyLinesColorClear();
this.deviceType = !this.deviceType;
this.gaoMap.mapOperateType = "add";
......@@ -392,6 +409,7 @@ export default {
// 0是初始,1是新建 2是编辑 3删除
this.gaoMap.lineType = 1;
if (this.gaoMap.newLineObj == null) {
console.log(this.gaoMap.newLineObj);
this.gaoMap.createNewLine();
}
} else {
......@@ -432,6 +450,8 @@ export default {
}
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
// 清空管道颜色
this.gaoMap.polyLinesColorClear();
this.createReset();
},
deleteDevice() {
......@@ -453,6 +473,8 @@ export default {
}
// 关闭当前的infowindow
this.gaoMap.closeInfoWindow();
// 清空管道颜色
this.gaoMap.polyLinesColorClear();
this.createReset();
},
selectDeviceType(val) {
......@@ -516,32 +538,42 @@ export default {
this.leftBarNum = [1, 2, 3, 4, 7];
// map.remove(this.gaodeMap.markerOverlays);
},
search() {
async search() {
this.searchClear();
map.clearMap();
this.gaoMap.placeSearch.clear();
if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName);
this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
this.gaoMap.markers = [];
await this.getDeviceInfo({ deviceName: this.gaoMap.searchSelectName });
this.gaoMap.polyLines = [];
this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
await this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
this.gaoMap.searchSelectAdcode = undefined;
this.gaoMap.searchSelectName = undefined;
} else {
this.gaoMap.placeSearch.search(this.keyWord);
this.getDeviceInfo({ deviceName: this.keyWord });
this.gaoMap.markers = [];
await this.getDeviceInfo({ deviceName: this.keyWord });
this.gaoMap.polyLines = [];
this.getPipeList({ pipeName: this.keyWord });
await this.getPipeList({ pipeName: this.keyWord });
}
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.pipeList();
},
// 新建下拉列表关闭 window点击事件
barClose() {
console.log("window");
this.deviceType = false;
// 关闭当前线条的infowindow
this.gaoMap.closeInfoWindow();
// 如果当前状态只有是编辑跟删除状态才会关闭
if (this.targetNum == 2 || this.targetNum == 3) {
this.gaoMap.closeInfoWindow();
}
// 如果没有选择的时候点window 则高亮消失
console.log(this.targetNum);
if (this.targetNum == 1 && this.iconClass == "icon-create") {
this.targetNum = 0;
}
......@@ -556,14 +588,28 @@ export default {
this.createValue = 0;
this.createLabel = "新建";
this.targetNum = 0;
map.clearMap();
this.initMap();
this.leftBarNum = [1, 2, 3, 4, 7];
this.keyWord = "";
this.arrowRightNum = [];
this.leftBarNum = [1, 2, 3, 4, 7];
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.initMap();
},
drawerdrawer() {
// 关闭infowindow
this.gaoMap.closeInfoWindow();
// 恢复颜色
this.gaoMap.polyLinesColorClear();
},
// 向右的箭头的动画
arrowRightChange(item) {
// 关闭infowindow
this.gaoMap.closeInfoWindow();
// 恢复颜色
this.gaoMap.polyLinesColorClear();
const index = this.arrowRightNum.indexOf(item.value);
if (index >= 0) {
this.arrowRightNum.splice(index, 1);
......@@ -691,39 +737,64 @@ export default {
this.pipeList();
},
panTo(item, bool) {
this.gaoMap.myMap.setZoom(12);
if (item.list.length > 0) {
if (this.leftBarNum.includes(item.value)) {
this.gaoMap.panTo(item.list[0].path);
let path;
// 线条
if (item.value == 1) {
const a =
(Number(item.list[0].lnglat[0]) + Number(item.list[0].path[0])) /
2;
const b =
(Number(item.list[0].lnglat[1]) + Number(item.list[0].path[1])) /
2;
path = [a, b - 0.06];
} else {
path = [item.list[0].path[0], item.list[0].path[1] - 0.06];
}
this.gaoMap.panTo(path);
}
}
},
panToo(iten, item) {
// 如果没打对勾,就啥也不干
if (!this.leftBarNum.includes(item.value)) return;
// 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
this.gaoMap.myMap.setZoom(11);
// 所有线条颜色还原
this.gaoMap.leftListClick = true;
this.gaoMap.polyLinesColorClear();
this.gaoMap.myMap.setZoom(12);
if (item.list.length > 0) {
if (this.leftBarNum.includes(item.value)) {
this.gaoMap.panTo(iten.path);
let path;
if (item.value == 1) {
const a = (Number(iten.lnglat[0]) + Number(iten.path[0])) / 2;
const b = (Number(iten.lnglat[1]) + Number(iten.path[1])) / 2;
//屏幕移动的位置
path = [a, b - 0.06];
// 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
iten.infoPath = [a.toFixed(6), b.toFixed(6)];
} else {
path = [iten.path[0], iten.path[1] - 0.06];
}
this.gaoMap.panTo(path);
}
}
// 当前地图中心点
const { lat, lng } = this.gaoMap.myMap.getCenter();
// 管道是这个方法,因为管道比较特殊
if (item.value == 1) {
this.polylineInfoWindowShow(iten, lat, lng);
} else if (item.value == 9) {
// 工作人员
// this.workerManInfoWindowShow(iten, lat, lng);
} else if (item.value == 8) {
// this.trouleInfoWindowShow(iten, lat, lng);
} else {
// 其他设备
this.diveceInfoWindowShow(iten, lat, lng);
}
},
// 如果是线条飞过去出现infowindow
polylineInfoWindowShow(iten, lat, lng) {
const target = this.gaoMap.polyLines.filter((item) => {
......@@ -732,16 +803,28 @@ export default {
console.log("target", target);
const e = {
target,
lnglat: iten.lnglat,
lnglat: iten.infoPath,
};
// console.log(target.getOptions());
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
// console.log(iten.infoPath, lng, lat + 0.1);
// 因为计算问题,误差小于0.00001就没动
if (
iten.infoPath[0] - lng >= -0.00001 &&
iten.infoPath[0] - lng <= 0.00001 &&
iten.infoPath[1] - (lat + 0.06) >= -0.00001 &&
iten.infoPath[1] - (lat + 0.06) <= 0.00001
) {
this.gaoMap.leftListClick = false;
target.setOptions({ strokeColor: "#F7FE38" });
this.gaoMap.polylineMouseOver(e);
return;
}
// 因为地图移动的时候infowindow无法显示
this.gaoMap.handleInfoWindowOpenFunc = () => {
this.gaoMap.polylineMouseOver(e);
target.setOptions({ strokeColor: "#F7FE38" });
};
},
// 这个是其他设备的infowindow
......@@ -755,7 +838,8 @@ export default {
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
if (iten.path[0] == lng && iten.path[1] >= (lat + 0.06)-0.000001) {
console.log("9999999999");
this.gaoMap.infoOpen(e);
return;
}
......@@ -769,6 +853,7 @@ export default {
beforeDestroy() {
console.log("移除window事件");
window.removeEventListener("click", this.barClose);
window.removeEventListener("resize", this.onResize);
},
};
</script>
......@@ -1139,12 +1224,14 @@ input[type="radio"] {
}
}
.no {
width: 50px;
width: 25px;
font-weight: 700;
}
.name {
// border-right: none;
flex: 1;
text-align: center;
margin-left:10px;
}
.code {
width: 112px;
......
......@@ -20,7 +20,7 @@
/>
</el-form-item>
<el-form-item label="管道类型" prop="pipeType">
<el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" size="small">
<el-select v-model="queryParams.pipeType" placeholder="请选择管道类型" filterable clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......
......@@ -11,7 +11,7 @@
/>
</el-form-item>
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable size="small">
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" filterable clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -53,11 +53,11 @@
<el-table-column label="地址" align="center" prop="address"/>
<el-table-column label="计划描述" align="center" prop="remarks">
<template slot-scope="scope">
<span v-if="scope.row.remarks != null">{{ scope.row.remarks }}</span>
<span v-if="scope.row.remarks == null">-</span>
<span v-if="scope.row.remarks != null && scope.row.remarks != ''">{{ scope.row.remarks }}</span>
<span v-if="scope.row.remarks == null || scope.row.remarks == ''">-</span>
</template>
</el-table-column>
<el-table-column label="计划状态" align="center" prop="planStatus">
<el-table-column label="计划状态" align="center" prop="planStatus" width="200px">
<template slot-scope="scope">
<span v-if="scope.row.planStatus == 0">未生成工单</span>
<span v-if="scope.row.planStatus == 1">已生成工单</span>
......@@ -116,11 +116,15 @@
<!-- 添加或修改巡检计划对话框 -->
<el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @close="cancel">
<el-form ref="form1" :model="form1" :rules="rules1" label-width="120px">
<el-col :span="23">
<el-form-item label="巡检计划名称" prop="planName">
<el-input v-model="form1.planName" placeholder="请输入巡检计划名称"/>
<el-input v-model="form1.planName" placeholder="请输入巡检计划名称" style="width: 600px"/>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="巡检设备" prop="devices">
<el-cascader
placeholder="请选择巡检设备"
v-model="form1.devices"
:options="options"
:props="props"
......@@ -128,9 +132,11 @@
@change="handleChange"
filterable
clearable
style="width: 640px"
style="width: 600px"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form1.startTime"
......@@ -139,6 +145,8 @@
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form1.endTime"
......@@ -147,12 +155,17 @@
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="地址" prop="address">
<el-input v-model="form1.address" type="textarea" placeholder="请输入地址"/>
<el-input v-model="form1.address" type="textarea" placeholder="请输入地址" style="width: 600px"/>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="计划描述" prop="remarks">
<el-input type="textarea" v-model="form1.remarks" placeholder="请输入计划描述"/>
<el-input type="textarea" v-model="form1.remarks" placeholder="请输入计划描述" style="width: 600px"/>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
......@@ -160,7 +173,7 @@
</div>
</el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="800px" append-to-body @close="cancel">
<el-form ref="form2" :model="form2" :rules="rules2" label-width="120px">
<el-form ref="form2" :model="form2" :rules="rules2" label-width="130px">
<el-form-item label="巡检计划名称">
<font>{{form2.planName}}</font>
</el-form-item>
......@@ -172,10 +185,10 @@
<font>{{form2.address}}</font>
</el-form-item>
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form2.orderName" placeholder="请输入工单名称" />
<el-input v-model="form2.orderName" placeholder="请输入工单名称" style="width: 590px" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form2.appointInspector" placeholder="请选择执行人员" clearable size="small" >
<el-select v-model="form2.appointInspector" placeholder="请选择执行人员" filterable clearable size="small" style="width: 590px" >
<el-option
v-for="item in inspector"
:key="item.userId"
......@@ -185,7 +198,7 @@
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks">
<el-input type="textarea" v-model="form2.remarks" placeholder="请输入工单描述" />
<el-input type="textarea" v-model="form2.remarks" placeholder="请输入工单描述" style="width: 590px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......
......@@ -4,6 +4,11 @@
<div class="top">
<span>设备报警最新记录</span>
<span @click="repeatClick" class="repeat">刷新</span>
<transition name="fade">
<span v-show="repeatFinshed" class="repeat2"> 数据刷新成功</span>
</transition>
<span @click="moreClick" class="more">更多>></span>
</div>
......@@ -73,6 +78,8 @@ export default {
},
data() {
return {
timer: null,
repeatFinshed: false,
typeName: {
1: "调压箱",
2: "阀门井",
......@@ -153,10 +160,12 @@ export default {
this.$router.push("/dataMonitoring/deviceAlarm");
// route.push(`dataMonitoring/deviceAlarm`)
},
repeatClick(){
this.getList();
repeatClick() {
// this.tableData=[];
if(this.repeatFinshed) return;
this.getList(true);
},
getList() {
getList(bool) {
this.loading = true;
listDeviceAlarm({ pageNum: 1, pageSize: 10 }).then((res) => {
if (res.code == 200) {
......@@ -176,8 +185,14 @@ export default {
alarmValue,
};
});
console.log(arr);
this.tableData=arr
this.tableData = arr;
if (bool) {
this.timer = null;
this.repeatFinshed = true;
this.timer = setTimeout(() => {
this.repeatFinshed = false;
}, 1000);
}
}
});
},
......@@ -213,6 +228,7 @@ export default {
line-height: 32px;
padding-left: 12px;
// position: relative;
span {
display: inline-block;
}
......@@ -223,6 +239,10 @@ export default {
color: #2788ea;
}
}
.repeat2 {
margin-left: 20px;
color:#67c23a;
}
.more {
float: right;
margin-right: 20px;
......@@ -290,5 +310,18 @@ export default {
.iconFontSize {
font-size: 50px !important;
}
.fade-enter-to,
.fade-leave {
opacity: 1;
}
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter-active {
transition: opacity 0s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
}
</style>
\ No newline at end of file
<template>
<div>
<div style="width: 100vw; height: 100vh" id="container"></div>
<div
:style="{ height: `${boxHeight}px`, width: `${boxWidth}px` }"
id="container"
></div>
<div v-show="false" class="btn-wrapper">
<div class="myBtn">
<div
......@@ -86,6 +89,7 @@
ref="drawer"
class="drawer"
:class="{ back: backFlag, opacity: drawerOpacity }"
@click.stop="drawerClick"
>
<div class="switch" @click="backFlag = !backFlag">
<img v-if="!backFlag" src="@/assets/images/l.png" alt="" />
......@@ -95,7 +99,7 @@
<div class="scroll" :style="{ height: `${boxHeight}px` }">
<el-input
v-model="keyWord"
placeholder="点击输入"
placeholder="点击输入设备名称"
id="tipinput"
class="search-input"
>
......@@ -122,7 +126,7 @@
active: leftBarNum.indexOf(item.value) >= 0,
firstbox: index == 0,
}"
@click.stop="arrowRightChange(item)"
@click="arrowRightChange(item)"
>
<span class="upPic"> 上图 </span>
<div class="left">
......@@ -152,7 +156,7 @@
<template v-if="item.value != 8 && item.value != 9">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
<div class="no"></div>
<div class="code">设备编号</div>
<div class="name">设备名称</div>
</div>
......@@ -161,7 +165,7 @@
:class="{ topActive: index == 0 }"
v-for="(iten, index) in item.list"
:key="iten.deviceId + `` + index"
@mousedown.stop="panToo(iten, item)"
@click.stop="panToo(iten, item)"
>
<div class="no">{{ iten.no + 1 }}</div>
<div :title="iten.code" class="code">
......@@ -177,7 +181,7 @@
<template v-else-if="item.value == 8">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
<div class="no"></div>
<div class="code">隐患等级</div>
<div class="name">隐患名称</div>
</div>
......@@ -186,7 +190,7 @@
:class="{ topActive: index == 0 }"
v-for="(iten, index) in item.list"
:key="iten.deviceId + `` + index"
@mousedown.stop="panToo(iten, item)"
@click.stop="panToo(iten, item)"
>
<div class="no">{{ iten.no + 1 }}</div>
<div :title="iten.troubleLevel" class="code">
......@@ -202,7 +206,7 @@
<template v-else-if="item.value == 9">
<div class="list-wrapper">
<div class="thead">
<div class="no">序号</div>
<div class="no"></div>
<div class="code">人员姓名</div>
<div class="name">联系电话</div>
</div>
......@@ -231,7 +235,7 @@
class="btn backPage"
type="mini"
:disabled="item.nowPage == 1"
@click.stop="pageBack(item, index)"
@click="pageBack(item, index)"
icon="el-icon-arrow-left"
/>
<span class="btn-w-num">{{ item.nowPage }}</span>
......@@ -239,7 +243,7 @@
class="btn goPage"
type="mini"
:disabled="item.nowPage == item.maxPage"
@click.stop="pageGo(item, index)"
@click="pageGo(item, index)"
icon="el-icon-arrow-right"
/>
</div>
......@@ -378,6 +382,7 @@ export default {
// 左边抽屉 内嵌scroll盒子的高
boxHeight: "",
boxWidth: "",
drawerOpacity: false,
//抽屉是否收回
backFlag: true,
......@@ -390,8 +395,13 @@ export default {
},
mounted() {
// this.$nextTick(() => {
this.onResize();
window.removeEventListener("resize", this.onResize);
window.addEventListener("resize", this.onResize);
this.initMap();
this.boxHeight = document.body.clientHeight - 81;
// });
},
watch: {
changeBtnData: {
......@@ -401,9 +411,15 @@ export default {
},
},
methods: {
onResize() {
this.boxHeight = document.body.clientHeight - 81;
this.boxWidth = document.body.clientWidth;
console.log("挂在");
},
initMap() {
let gaoMap = new gaodeMap("石家庄");
this.gaoMap = gaoMap;
window.removeEventListener("mousedown", this.barClose);
window.addEventListener("mousedown", this.barClose);
gaoMap.addMouseTool();
gaoMap.searchTips("tipinput");
......@@ -721,6 +737,8 @@ export default {
// 左边的Bar修改值 左边抽屉
leftBarChange(item) {
// this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
this.gaoMap.closeInfoWindow();
this.gaoMap.polyLinesColorClear();
const index = this.leftBarNum.indexOf(item.value);
if (index >= 0) {
this.leftBarNum.splice(index, 1);
......@@ -730,7 +748,6 @@ export default {
}
// 1,2,3,4,7分别对应数据库type5,1,2,3,4
// console.log(this.leftBarNum);
if (this.leftBarNum.includes(1)) {
this.gaoMap.lineShow(true);
// this.panTo(item);
......@@ -783,34 +800,66 @@ export default {
}
},
panTo(item, bool) {
this.gaoMap.myMap.setZoom(12);
if (item.list.length > 0) {
if (this.leftBarNum.includes(item.value)) {
this.gaoMap.panTo(item.list[0].path);
let path;
// 线条
if (item.value == 1) {
const a =
(Number(item.list[0].lnglat[0]) + Number(item.list[0].path[0])) /
2;
const b =
(Number(item.list[0].lnglat[1]) + Number(item.list[0].path[1])) /
2;
path = [a, b - 0.08];
} else {
path = [item.list[0].path[0], item.list[0].path[1] - 0.08];
}
this.gaoMap.panTo(path);
}
}
},
panToo(iten, item) {
// 如果没打对勾,就啥也不干
if (!this.leftBarNum.includes(item.value)) return;
// 点击的时候允许infowindow消失
this.gaoMap.leftListClick = true;
// 如果地图太大了就吸纳是不出来infowindow了,所以要固定缩放比例
this.gaoMap.myMap.setZoom(11);
// 所有线条颜色还原
this.gaoMap.polyLinesColorClear();
this.gaoMap.myMap.setZoom(12);
if (item.list.length > 0) {
if (this.leftBarNum.includes(item.value)) {
this.gaoMap.panTo(iten.path);
let path;
if (item.value == 1) {
const a = (Number(iten.lnglat[0]) + Number(iten.path[0])) / 2;
const b = (Number(iten.lnglat[1]) + Number(iten.path[1])) / 2;
//屏幕移动的位置
path = [a, b - 0.08];
// 线条infowindow显示中间,保留六位转换字符串,否则有时候会出现一些问题
iten.infoPath = [a.toFixed(6), b.toFixed(6)];
console.log(path);
} else {
path = [iten.path[0], iten.path[1] - 0.08];
}
// const path =
// item.value == 1
// ? [iten.lnglat[0], iten.lnglat[1] - 0.1]
// : [iten.path[0], iten.path[1] - 0.1];
this.gaoMap.panTo(path);
}
}
// 当前地图中心点
const { lat, lng } = this.gaoMap.myMap.getCenter();
// 管道是这个方法,因为管道比较特殊
if (item.value == 1) {
this.polylineInfoWindowShow(iten, lat, lng);
} else if (item.value == 9) {
// 工作人员
this.workerManInfoWindowShow(iten, lat, lng);
} else if (item.value == 8) {
this.trouleInfoWindowShow(iten, lat, lng)
this.trouleInfoWindowShow(iten, lat, lng);
} else {
// 其他设备
this.diveceInfoWindowShow(iten, lat, lng);
......@@ -825,16 +874,29 @@ export default {
console.log("target", target);
const e = {
target,
lnglat: iten.lnglat,
lnglat: iten.infoPath,
};
// console.log(target.getOptions());
console.log(iten.infoPath[0] - lng, iten.infoPath[1] - (lat + 0.1));
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
// if (iten.infoPath[0] == lng && iten.infoPath[1] == lat + 0.1) {
if (
iten.infoPath[0] - lng >= -0.00001 &&
iten.infoPath[0] - lng <= 0.00001 &&
iten.infoPath[1] - (lat + 0.08) >= -0.00001 &&
iten.infoPath[1] - (lat + 0.08) <= 0.00001
) {
this.gaoMap.leftListClick = false;
this.gaoMap.polylineMouseOver(e);
target.setOptions({ strokeColor: "#F7FE38" });
return;
}
// 因为地图移动的时候infowindow无法显示
this.gaoMap.handleInfoWindowOpenFunc = () => {
this.gaoMap.polylineMouseOver(e);
target.setOptions({ strokeColor: "#F7FE38" });
};
},
// 这个是其他设备的infowindow
......@@ -848,7 +910,9 @@ export default {
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
// if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
this.gaoMap.leftListClick = false;
this.gaoMap.infoOpen(e);
return;
}
......@@ -868,7 +932,9 @@ export default {
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
// if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
this.gaoMap.leftListClick = false;
this.gaoMap.troubleOpen(e);
return;
}
......@@ -889,7 +955,10 @@ export default {
lnglat: iten.path,
};
// 如果是原地不动,就直接执行
if (iten.path[0] == lng && iten.path[1] == lat) {
// if (iten.path[0] == lng && iten.path[1] == lat + 0.08) {
// console.log(iten.path[0] , iten.path[1] ,lat+0.06,lng)
if (iten.path[0] == lng && iten.path[1] >= lat + 0.08 - 0.000001) {
this.gaoMap.leftListClick = false;
this.gaoMap.wokerManOpen(e);
return;
}
......@@ -1196,7 +1265,7 @@ export default {
// 左边全选
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
// 右转箭头的样式active判定
this.arrowRightNum = [];
// this.arrowRightNum = [];
// 清空左边列表
// this.changeBtnDataClear();
// this.gaoMap.placeSearch.search(this.keyWord);
......@@ -1208,9 +1277,11 @@ export default {
await this.getInspectorLocations({ userName: this.keyWord });
await this.getMapHiddenTroublelist({ troubleName: this.keyWord });
// 设备报警
this.getSelectAlarmDevice();
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.pipeList();
}
},
......@@ -1227,12 +1298,14 @@ export default {
// 新建下拉列表关闭 window点击事件
barClose() {
// 一点windowbottomData显示
this.bottomDataShow = true;
// this.bottomDataShow = true;
// return;
console.log("window");
// 颜色恢复
this.deviceType = false;
// 关闭当前线条的infowindow
this.gaoMap.closeInfoWindow();
// this.gaoMap.closeInfoWindow();
// 如果没有选择的时候点window 则高亮消失
if (this.targetNum == 1 && this.iconClass == "icon-create") {
this.targetNum = 0;
......@@ -1245,13 +1318,17 @@ export default {
},
refreshMap() {
// this.changeBtnDataClear();
this.keyWord="";
this.arrowRightNum=[];
this.keyWord = "";
this.arrowRightNum = [];
this.iconClass = "icon-create";
this.createValue = 0;
this.createLabel = "新建";
this.targetNum = 0;
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
map.clearMap();
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
this.initMap();
},
......@@ -1307,6 +1384,12 @@ export default {
troubleObjChange(obj) {
this.troubleObj = obj;
},
drawerClick() {
console.log("drawerClick");
this.gaoMap.polyLinesColorClear();
this.gaoMap.closeInfoWindow();
},
},
beforeDestroy() {
......@@ -1314,6 +1397,8 @@ export default {
console.log("移除window事件");
map.clearMap();
window.removeEventListener("mousedown", this.barClose);
window.removeEventListener("resize", this.onResize);
// 关闭scoket
if (this.ws) {
console.log("socket关闭了");
......@@ -1551,6 +1636,7 @@ input[type="radio"] {
color: #053b6a;
font-weight: 600;
}
}
.deviceList {
cursor: pointer;
......@@ -1581,14 +1667,17 @@ input[type="radio"] {
white-space: nowrap;
// border-right: 1px solid #cccccc;
}
}
.no {
width: 50px;
width: 25px;
font-weight: 700;
}
.name {
// border-right: none;
flex: 1;
text-align: center;
margin-left:10px;
}
.code {
width: 112px;
......
......@@ -2,10 +2,10 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="隐患名称" prop="troubleName">
<el-input v-model="queryParams.troubleName" placeholder="请输入隐患名称"/>
<el-input v-model="queryParams.troubleName" placeholder="请输入隐患名称" style="width: 170px"/>
</el-form-item>
<el-form-item label="隐患类型" prop="troubleType">
<el-select v-model="queryParams.troubleType" placeholder="请选择隐患类型" clearable size="small">
<el-select v-model="queryParams.troubleType" placeholder="请选择隐患类型" filterable clearable size="small" style="width: 170px">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -14,11 +14,39 @@
></el-option>
</el-select>
</el-form-item>
<!--<el-form-item label="状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择状态" clearable size="small">
<el-option label="" value="0" />
<el-form-item label="处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择状态" filterable clearable size="small" style="width: 170px">
<el-option
v-for="temp in statusOptions"
:key="temp.value"
:label="temp.label"
:value="temp.value"
></el-option>
</el-select>
</el-form-item>-->
</el-form-item>
<el-form-item label="上报时间" prop="startCreateTime">
<el-date-picker
clearable size="small"
v-model="queryParams.startCreateTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择起始时间"
align="right"
style="width: 200px">
</el-date-picker>
<font color="#C0C4CC"></font>
</el-form-item>
<el-form-item label="" prop="endCreateTime">
<el-date-picker
clearable size="small"
v-model="queryParams.endCreateTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="请选择截止时间"
align="right"
style="width: 200px">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
......@@ -40,7 +68,7 @@
</el-row>
<el-table v-loading="loading" :data="hiddenTroubleList.slice((pageNum-1)*pageSize,pageNum*pageSize)" @selection-change="handleSelectionChange">
<el-table-column label="隐患名称" align="center" prop="troubleName" />
<el-table-column label="隐患名称" align="center" prop="troubleName" width="400px"/>
<el-table-column label="隐患类型" align="center" prop="troubleType" >
<template slot-scope="scope">
<span v-if="scope.row.troubleType == 1">设备老化</span>
......@@ -54,9 +82,10 @@
<span v-if="scope.row.troubleLevel == 3">Ⅲ级</span>
</template>
</el-table-column>
<el-table-column label="图片" align="center" prop="pictureUrl" >
<el-table-column label="图片" align="center" prop="pictureUrl" style="text-align:center;">
<template slot-scope="scope">
<el-image :src="scope.row.pictureUrl" :preview-src-list="[scope.row.pictureUrl]" v-if="scope.row.pictureUrl != '' && scope.row.pictureUrl != null" style="width: 16px;"></el-image>
<img :src="scope.row.pictureUrl" style="width: 20%;vertical-align:middle" @click="showPicture(scope.row)"/>
<el-image :ref="'a'+scope.row.troubleId" :src="scope.row.pictureUrl" v-show="false" :preview-src-list="[scope.row.pictureUrl]" v-if="scope.row.pictureUrl != '' && scope.row.pictureUrl != null"></el-image>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportManName" />
......@@ -121,14 +150,14 @@
<!-- 添加或修改隐患信息对话框 -->
<el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @close="cancel">
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-col>
<el-form-item label="隐患名称" prop="troubleName" style="width: 720px">
<el-input v-model="form1.troubleName" placeholder="请输入隐患名称" />
<el-col :span="23">
<el-form-item label="隐患名称" prop="troubleName">
<el-input v-model="form1.troubleName" placeholder="请输入隐患名称" style="width: 600px" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隐患类型" prop="troubleType">
<el-select v-model="form1.troubleType" placeholder="请选择隐患类型">
<el-select v-model="form1.troubleType" placeholder="请选择隐患类型" filterable style="width: 220px">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -138,9 +167,9 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="12">
<el-form-item label="隐患级别" prop="troubleLevel">
<el-select v-model="form1.troubleLevel" placeholder="请选择隐患级别">
<el-select v-model="form1.troubleLevel" placeholder="请选择隐患级别" filterable style="width: 220px">
<el-option
v-for="dict in levelOptions"
:key="dict.dictValue"
......@@ -152,7 +181,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="上报人" prop="reportMan">
<el-select v-model="form1.reportMan" placeholder="请选择上报人" clearable size="small" >
<el-select v-model="form1.reportMan" placeholder="请选择上报人" filterable style="width: 220px">
<el-option
v-for="item in userList"
:key="item.userId"
......@@ -162,7 +191,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="12">
<el-form-item label="隐患设备" prop="device">
<el-cascader
v-model="form1.device"
......@@ -172,15 +201,16 @@
@change="handleChange"
filterable
clearable
style="width: 220px"
></el-cascader>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="地址" prop="address" style="width: 720px">
<el-input v-model="form1.address" type="textarea" placeholder="请输入地址" />
<el-col :span="23">
<el-form-item label="地址" prop="address">
<el-input v-model="form1.address" type="textarea" placeholder="请输入地址" style="width: 600px" />
</el-form-item>
</el-col>
<el-col>
<el-col :span="23">
<el-form-item label="经纬度" prop="longitude">
<el-row>
<el-col :span="8">
......@@ -195,7 +225,7 @@
</el-row>
</el-form-item>
</el-col>
<el-col>
<el-col :span="23">
<el-form-item label="图片上传" prop="pictureUrl">
<MyFileUpload
listType="picture-card"
......@@ -206,9 +236,9 @@
<el-input v-show="false" disabled v-model="form1.pictureUrl"></el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="隐患信息" prop="remarks" style="width: 720px">
<el-input v-model="form1.remarks" type="textarea" placeholder="请输入隐患信息" />
<el-col :span="23">
<el-form-item label="隐患信息" prop="remarks">
<el-input v-model="form1.remarks" type="textarea" placeholder="请输入隐患信息" style="width: 600px" />
</el-form-item>
</el-col>
</el-form>
......@@ -231,11 +261,11 @@
<font v-if="form2.troubleLevel == 2">Ⅱ级</font>
<font v-if="form2.troubleLevel == 3">Ⅲ级</font>
</el-form-item>
<el-form-item label="工单名称" prop="orderName" style="width: 720px">
<el-input v-model="form2.orderName" placeholder="请输入工单名称" />
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form2.orderName" placeholder="请输入工单名称" style="width: 600px" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector" >
<el-select v-model="form2.appointInspector" placeholder="请选择执行人员" clearable size="small" style="width: 600px">
<el-select v-model="form2.appointInspector" placeholder="请选择执行人员" filterable clearable size="small" style="width: 600px">
<el-option
v-for="item in inspector"
:key="item.userId"
......@@ -244,8 +274,8 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks" style="width: 720px">
<el-input type="textarea" v-model="form2.remarks" placeholder="请输入工单描述" />
<el-form-item label="工单描述" prop="remarks">
<el-input type="textarea" v-model="form2.remarks" placeholder="请输入工单描述" style="width: 600px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -303,6 +333,14 @@ export default {
typeOptions: [],
// 隐患等级字典
levelOptions: [],
// 处理状态字典
statusOptions: [
{'label':'未生成工单','value':'-1'},
{'label':'暂未处理','value':'-2'},
{'label':'不需处理','value':'1'},
{'label':'已处理完成','value':'2'},
{'label':'未处理完成','value':'3'}
],
// 上传文件列表
fileList: [],
// 地图
......@@ -339,6 +377,8 @@ export default {
deviceType: null,
latitude: null,
dealStatus: null,
startCreateTime: null,
endCreateTime: null,
address: null,
remarks: null,
pictureUrl: null,
......@@ -506,6 +546,10 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
showPicture(row){
this.$refs['a'+row.troubleId].showViewer = true;
console.log("===",row.troubleId);
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
......
......@@ -2,7 +2,7 @@
<div class="app-container basicsInfo">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<!-- <el-form-item label="工单类型" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型" clearable size="small">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型" filterable clearable size="small">
<el-option
v-for="dict in ordertypeOptions"
:key="dict.dictValue"
......@@ -21,7 +21,7 @@
/>
</el-form-item>
<el-form-item label="工单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable size="small">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" filterable clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -59,6 +59,7 @@
<el-table v-loading="loading" :data="basicsInfoList.slice((pageNum-1)*pageSize,pageNum*pageSize)" @selection-change="handleSelectionChange">
<el-table-column label="工单编号" align="center" prop="orderId" />
<el-table-column label="工单名称" align="center" prop="orderName" width="350px"/>
<el-table-column label="工单类型" align="center" prop="orderType" >
<template slot-scope="scope">
<el-button type="primary" v-if="scope.row.orderType == 1">巡检信息</el-button>
......@@ -66,32 +67,24 @@
<el-button type="danger" v-if="scope.row.orderType == 3">报警信息</el-button>
</template>
</el-table-column>
<el-table-column label="指定执行人员" align="center" prop="appointInspectorName">
</el-table-column>
<el-table-column label="工单名称" align="center" prop="orderName" />
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<span type="info" v-if="scope.row.orderStatus == 0">未接收</span>
<span type="warning" v-if="scope.row.orderStatus == 1">已接收</span>
<span type="primary" v-if="scope.row.orderStatus == 2">已反馈</span>
<span type="success" v-if="scope.row.orderStatus == 3">已归档</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="allotTime" width="180">
<el-table-column label="指定执行人员" align="center" prop="appointInspectorName" />
<el-table-column label="创建时间" align="center" prop="allotTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.allotTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="actualTime" width="180">
<el-table-column label="更新时间" align="center" prop="actualTime">
<template slot-scope="scope">
<span v-if="scope.row.actualTime != null">{{ scope.row.actualTime }}</span>
<span v-if="scope.row.actualTime == null">-</span>
</template>
</el-table-column>
<el-table-column label="工单描述" align="center" prop="remarks" >
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<span v-if="scope.row.remarks != null">{{ scope.row.remarks }}</span>
<span v-if="scope.row.remarks == null">-</span>
<span type="info" v-if="scope.row.orderStatus == 0">未接收</span>
<span type="warning" v-if="scope.row.orderStatus == 1">已接收</span>
<span type="primary" v-if="scope.row.orderStatus == 2">已反馈</span>
<span type="success" v-if="scope.row.orderStatus == 3">已归档</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -132,14 +125,14 @@
<!-- 归档或修改工单基础信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<div v-if="this.title == '工单信息修改'">
<el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
<el-input v-model="form.orderName" placeholder="请输入工单名称" style="width: 600px" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" filterable clearable size="small" @change="setUserId" style="width: 600px">
<el-option
v-for="item in inspector"
:key="item.userId"
......@@ -149,7 +142,7 @@
</el-select>
</el-form-item>
<el-form-item label="工单描述" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入工单描述" />
<el-input v-model="form.remarks" type="textarea" placeholder="请输入工单描述" style="width: 600px" />
</el-form-item>
</div>
<div v-if="this.title == '工单信息归档'">
......@@ -165,7 +158,7 @@
<font>{{form.orderId}}</font>
</el-form-item>
<el-form-item label="归档信息" prop="archiving">
<el-input v-model="form.archiving" type="textarea" placeholder="请输入归档信息" />
<el-input v-model="form.archiving" type="textarea" placeholder="请输入归档信息" style="width: 600px" />
</el-form-item>
</div>
</el-form>
......
......@@ -129,7 +129,7 @@
</el-row>
<el-divider></el-divider>
</div>
<!-- 反馈信息 -->
<div style="width: 100%;font-weight: 600;" v-if="form.feedbackList != null">
<div style="color: #31EAEA;width: 100%;height: 40px;">
......@@ -255,7 +255,7 @@
<el-input v-model="form.orderName" placeholder="请输入工单名称" />
</el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" filterable clearable size="small" @change="setUserId">
<el-option
v-for="item in inspector"
:key="item.userId"
......
......@@ -2,7 +2,7 @@
<div class="app-container basicsInfo">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<!-- <el-form-item label="工单类型" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型" clearable size="small">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型" filterable clearable size="small">
<el-option
v-for="dict in ordertypeOptions"
:key="dict.dictValue"
......@@ -21,7 +21,7 @@
/>
</el-form-item>
<el-form-item label="工单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable size="small">
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" filterable clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
......@@ -59,6 +59,7 @@
<el-table v-loading="loading" :data="basicsInfoList.slice((pageNum-1)*pageSize,pageNum*pageSize)" @selection-change="handleSelectionChange">
<el-table-column label="工单编号" align="center" prop="orderId" />
<el-table-column label="工单名称" align="center" prop="orderName" width="350px"/>
<el-table-column label="工单类型" align="center" prop="orderType" >
<template slot-scope="scope">
<span type="primary" v-if="scope.row.orderType == 1">巡检信息</span>
......@@ -66,30 +67,23 @@
<span type="primary" v-if="scope.row.orderType == 3">报警信息</span>
</template>
</el-table-column>
<el-table-column label="工单名称" align="center" prop="orderName" />
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<el-button type="info" v-if="scope.row.orderStatus == 0">未接收</el-button>
<el-button type="warning" v-if="scope.row.orderStatus == 1">已接收</el-button>
<el-button type="primary" v-if="scope.row.orderStatus == 2">已反馈</el-button>
<el-button type="success" v-if="scope.row.orderStatus == 3">已归档</el-button>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="allotTime" width="180">
<el-table-column label="创建时间" align="center" prop="allotTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.allotTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="actualTime" width="180">
<el-table-column label="更新时间" align="center" prop="actualTime">
<template slot-scope="scope">
<span v-if="scope.row.actualTime != null">{{ scope.row.actualTime }}</span>
<span v-if="scope.row.actualTime == null">-</span>
</template>
</el-table-column>
<el-table-column label="工单描述" align="center" prop="remarks" >
<el-table-column label="工单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<span v-if="scope.row.remarks != null">{{ scope.row.remarks }}</span>
<span v-if="scope.row.remarks == null">-</span>
<el-button type="info" v-if="scope.row.orderStatus == 0">未接收</el-button>
<el-button type="warning" v-if="scope.row.orderStatus == 1">已接收</el-button>
<el-button type="primary" v-if="scope.row.orderStatus == 2">已反馈</el-button>
<el-button type="success" v-if="scope.row.orderStatus == 3">已归档</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -130,7 +124,7 @@
<!-- 工单反馈对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="工单名称" prop="orderName">
<font>{{form.orderName}}</font>
</el-form-item>
......@@ -143,7 +137,7 @@
<font>{{form.orderId}}</font>
</el-form-item>
<el-form-item label="设备列表" prop="deviceId" v-if="form.orderType == '1'">
<el-select v-model="form.deviceId" placeholder="请选择设备" clearable size="small" filterable >
<el-select v-model="form.deviceId" placeholder="请选择设备" filterable clearable size="small" filterable style="width: 600px" >
<el-option
v-for="device in form.deviceInfoList"
:key="device.deviceId"
......@@ -168,14 +162,14 @@
</el-switch>
</el-form-item>
<el-form-item label="处理结果" prop="dealStatus" v-if="isHiddenDanger == true">
<el-radio-group v-model="form.dealStatus">
<el-radio :label="2">已处理完成</el-radio>
<el-radio :label="3">未处理完成</el-radio>
<el-radio :label="1">不需处理</el-radio>
<el-radio-group v-model="dealStatus">
<el-radio label="2">已处理完成</el-radio>
<el-radio label="3">未处理完成</el-radio>
<el-radio label="1">不需处理</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="反馈信息" prop="contents">
<el-input v-model="form.contents" type="textarea" placeholder="请输入反馈信息" />
<el-input v-model="form.contents" type="textarea" placeholder="请输入反馈信息" style="width: 600px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -200,6 +194,7 @@
data() {
return {
isHiddenDanger: false,
dealStatus: '2',
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -311,6 +306,8 @@
dealStatus: null,
contents: null
};
this.isHiddenDanger = false;
this.dealStatus = '2';
this.resetForm("form");
},
/** 搜索按钮操作 */
......@@ -348,7 +345,6 @@
},
/** 反馈按钮操作 */
handleFeedback(row) {
this.open = true;
const orderId = row.orderId || this.ids
getBasicsInfo(orderId).then(response => {
this.form = response.data;
......@@ -372,6 +368,7 @@
} else {
this.form.isHiddenDanger = "1";
}
this.form.dealStatus = this.dealStatus;
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.orderStatus == '1' || this.form.orderStatus == '2'){
......
......@@ -217,7 +217,7 @@
<font>{{form.orderId}}</font>
</el-form-item>
<el-form-item label="设备列表" prop="deviceCode" v-if="form.orderType == '1'">
<el-select v-model="form.deviceId" placeholder="请选择设备" clearable size="small" filterable >
<el-select v-model="form.deviceId" placeholder="请选择设备" filterable clearable size="small" filterable >
<el-option
v-for="device in form.deviceInfoList"
:key="device.deviceId"
......
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