Commit fc5e5068 authored by zhangjianqian's avatar zhangjianqian

安检管线实时加载,同步按钮控制显隐

parent f5aa81f1
...@@ -77,6 +77,16 @@ public class TPipeTaskInspect extends BaseEntity ...@@ -77,6 +77,16 @@ public class TPipeTaskInspect extends BaseEntity
//坐标线 //坐标线
private List<List<String>> coordinates; private List<List<String>> coordinates;
private String pipeType;
public String getPipeType() {
return pipeType;
}
public void setPipeType(String pipeType) {
this.pipeType = pipeType;
}
public List<List<String>> getCoordinates() { public List<List<String>> getCoordinates() {
return coordinates; return coordinates;
} }
......
...@@ -168,8 +168,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -168,8 +168,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</insert> </insert>
<select id="selectTPipeInspectList" parameterType="String" resultMap="TPipeTaskInspectResult"> <select id="selectTPipeInspectList" parameterType="String" resultMap="TPipeTaskInspectResult">
SELECT inspect.id,inspect.status,inspect.task_id,p.pipe_id,p.longitude,p.latitude FROM t_pipe_task_inspect inspect SELECT inspect.id,inspect.status,inspect.task_id,p.pipe_id,p.longitude,p.latitude,pin.pipe_type as pipeType FROM t_pipe_task_inspect inspect
LEFT JOIN t_pipe_point p on p.id = inspect.point LEFT JOIN t_pipe_point p on p.id = inspect.point
LEFT JOIN t_pipe_info pin ON pin.`pipe_id` = p.`pipe_id`
WHERE task_id IN ( WHERE task_id IN (
SELECT id FROM t_pipe_task WHERE push_time =#{datastr} or #{datastr} BETWEEN push_time AND task_end_time SELECT id FROM t_pipe_task WHERE push_time =#{datastr} or #{datastr} BETWEEN push_time AND task_end_time
) )
......
...@@ -38,7 +38,10 @@ export class EditorMap { ...@@ -38,7 +38,10 @@ export class EditorMap {
// 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组 // 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组
allDevice = {}; allDevice = {};
// 存放所有的管道 // 存放所有的管道
pipeArr = {}; pipeArr = [];
//已检管线
pipeArr2 = [];
pipeArrold = [];
// 报警设备的对象 // 报警设备的对象
alarmObj = {}; alarmObj = {};
// 当前的infowindow的组件 // 当前的infowindow的组件
...@@ -455,6 +458,7 @@ export class EditorMap { ...@@ -455,6 +458,7 @@ export class EditorMap {
infowindowComponentChange(data) { infowindowComponentChange(data) {
this.infowindowComponent.deviceData = data; this.infowindowComponent.deviceData = data;
} }
// 创建marker // 创建marker
createMarker(MarkerOptions) { createMarker(MarkerOptions) {
return new AMap.Marker(MarkerOptions); return new AMap.Marker(MarkerOptions);
...@@ -469,19 +473,30 @@ export class EditorMap { ...@@ -469,19 +473,30 @@ export class EditorMap {
path: eval(path), path: eval(path),
strokeWeight: objData.strokeWeight || 4, strokeWeight: objData.strokeWeight || 4,
strokeColor: color, strokeColor: color,
strokeOpacity: pipePressure==5?1:0.6,
extData: objData, extData: objData,
cursor: "pointer", cursor: "pointer",
zIndex: pipePressure==5?20:10
}); });
if(objData.ishidden==1){
pipe.hide();
}
this.map.add(pipe); this.map.add(pipe);
// pipe.hide(); // pipe.hide();
if (!Array.isArray(this.pipeArr[iconType])) { // if (!Array.isArray(this.pipeArr[iconType])) {
this.pipeArr[iconType] = []; // this.pipeArr[iconType] = [];
// }
if(pipePressure==5){
this.pipeArr2.push(pipe);
}else{
this.pipeArr.push(pipe);
this.pipeEvent(pipe, component);
} }
this.pipeArr[iconType].push(pipe);
// console.log(this.pipeArr); // console.log(this.pipeArr);
// this.map.panTo([path[0][0], path[0][1]]); // this.map.panTo([path[0][0], path[0][1]]);
this.pipeEvent(pipe, component);
} }
createPipeLine(pipeLineOptions) { createPipeLine(pipeLineOptions) {
return new AMap.Polyline(pipeLineOptions); return new AMap.Polyline(pipeLineOptions);
...@@ -556,6 +571,43 @@ export class EditorMap { ...@@ -556,6 +571,43 @@ export class EditorMap {
}); });
this.infowindow.open(this.map); this.infowindow.open(this.map);
} }
/**
* 管线类型过滤
* @param companyArr
* @param typeArr
*/
pipefilter(ind, type) {
this.pipeArr.forEach((pipe) => {
const data = pipe.getExtData();
if(type == data.pipePressure-1){
if (ind>=0){
pipe.hide();
} else {
pipe.show();
}
}
});
this.pipeArr2.forEach((pipe) => {
const data = pipe.getExtData();
if(type == data.pipeType-1){
if (ind>=0){
pipe.hide();
} else {
pipe.show();
}
}
});
}
/**
* 清除管线
*/
clearPipe(){
this.map.remove(this.pipeArrold);
}
infowindowClose() { infowindowClose() {
if (!this.infowindow) return; if (!this.infowindow) return;
this.infowindow.close(); this.infowindow.close();
......
...@@ -48,7 +48,9 @@ export default { ...@@ -48,7 +48,9 @@ export default {
PipeInfo PipeInfo
}, },
data() { data() {
return {}; return {
pipeArr:[0,1,2],
};
}, },
computed: {}, computed: {},
watch: {}, watch: {},
...@@ -83,6 +85,14 @@ export default { ...@@ -83,6 +85,14 @@ export default {
this.getList(); this.getList();
this.getpipe(); this.getpipe();
this.getPointList(); this.getPointList();
setInterval(() => {
this.gaoMap.pipeArrold = this.gaoMap.pipeArr2;
this.gaoMap.pipeArr2 = [];
console.log(this.gaoMap.pipeArrold)
this.getPointList();
setTimeout(() =>{this.gaoMap.clearPipe()},1000)
}, 60000)
}, },
getpipe(){ getpipe(){
...@@ -101,11 +111,15 @@ export default { ...@@ -101,11 +111,15 @@ export default {
getPointList(){ getPointList(){
pointList().then((res) => { pointList().then((res) => {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
console.log('yida',res.data)
res.data.forEach((item) => { res.data.forEach((item) => {
item.path = item.coordinates; item.path = item.coordinates;
item.pipePressure = 5; item.pipePressure = 5;
item.strokeWeight = 4; item.strokeWeight = 2;
if(this.pipeArr.includes(item.pipeType-1)){
item.ishidden = 0
}else{
item.ishidden = 1
}
this.gaoMap.addPipeLine(item, PipeInfo); this.gaoMap.addPipeLine(item, PipeInfo);
}); });
} }
...@@ -178,8 +192,11 @@ export default { ...@@ -178,8 +192,11 @@ export default {
// this.showMarker(item.val); // this.showMarker(item.val);
// } // }
// }, // },
change(ind,val){ change(ind,val,arr){
console.log(ind,val) this.pipeArr = arr;
if(val<3){
this.gaoMap.pipefilter(ind,val);
}
if(ind>=0){ if(ind>=0){
if(val==3){ if(val==3){
this.gaoMap.tyxlabelsLayer.hide(); this.gaoMap.tyxlabelsLayer.hide();
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
} else { } else {
this.activeArr1.push(val); this.activeArr1.push(val);
} }
this.$emit("change", this.activeArr1, this.activeArr2); this.$emit("change", ind, val,this.activeArr1);
}, },
activeChange2(val) { activeChange2(val) {
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
} else { } else {
this.activeArr2.push(val); this.activeArr2.push(val);
} }
this.$emit("change", ind, val); this.$emit("change", ind, val,this.activeArr1);
}, },
}, },
}; };
......
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