Commit fc5e5068 authored by zhangjianqian's avatar zhangjianqian

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

parent f5aa81f1
......@@ -77,6 +77,16 @@ public class TPipeTaskInspect extends BaseEntity
//坐标线
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() {
return coordinates;
}
......
......@@ -168,8 +168,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<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_info pin ON pin.`pipe_id` = p.`pipe_id`
WHERE task_id IN (
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 {
// 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组
allDevice = {};
// 存放所有的管道
pipeArr = {};
pipeArr = [];
//已检管线
pipeArr2 = [];
pipeArrold = [];
// 报警设备的对象
alarmObj = {};
// 当前的infowindow的组件
......@@ -455,6 +458,7 @@ export class EditorMap {
infowindowComponentChange(data) {
this.infowindowComponent.deviceData = data;
}
// 创建marker
createMarker(MarkerOptions) {
return new AMap.Marker(MarkerOptions);
......@@ -469,19 +473,30 @@ export class EditorMap {
path: eval(path),
strokeWeight: objData.strokeWeight || 4,
strokeColor: color,
strokeOpacity: pipePressure==5?1:0.6,
extData: objData,
cursor: "pointer",
zIndex: pipePressure==5?20:10
});
if(objData.ishidden==1){
pipe.hide();
}
this.map.add(pipe);
// pipe.hide();
if (!Array.isArray(this.pipeArr[iconType])) {
this.pipeArr[iconType] = [];
// if (!Array.isArray(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);
// this.map.panTo([path[0][0], path[0][1]]);
this.pipeEvent(pipe, component);
}
createPipeLine(pipeLineOptions) {
return new AMap.Polyline(pipeLineOptions);
......@@ -556,6 +571,43 @@ export class EditorMap {
});
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() {
if (!this.infowindow) return;
this.infowindow.close();
......
......@@ -48,7 +48,9 @@ export default {
PipeInfo
},
data() {
return {};
return {
pipeArr:[0,1,2],
};
},
computed: {},
watch: {},
......@@ -83,6 +85,14 @@ export default {
this.getList();
this.getpipe();
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(){
......@@ -101,15 +111,19 @@ export default {
getPointList(){
pointList().then((res) => {
if (res.code == 200 && res.data) {
console.log('yida',res.data)
res.data.forEach((item) => {
item.path = item.coordinates;
item.pipePressure = 5;
item.strokeWeight = 4;
this.gaoMap.addPipeLine(item, PipeInfo);
});
}
});
res.data.forEach((item) => {
item.path = item.coordinates;
item.pipePressure = 5;
item.strokeWeight = 2;
if(this.pipeArr.includes(item.pipeType-1)){
item.ishidden = 0
}else{
item.ishidden = 1
}
this.gaoMap.addPipeLine(item, PipeInfo);
});
}
});
},
/** 查询工业用户列表 */
getList() {
......@@ -178,8 +192,11 @@ export default {
// this.showMarker(item.val);
// }
// },
change(ind,val){
console.log(ind,val)
change(ind,val,arr){
this.pipeArr = arr;
if(val<3){
this.gaoMap.pipefilter(ind,val);
}
if(ind>=0){
if(val==3){
this.gaoMap.tyxlabelsLayer.hide();
......
......@@ -79,7 +79,7 @@ export default {
} else {
this.activeArr1.push(val);
}
this.$emit("change", this.activeArr1, this.activeArr2);
this.$emit("change", ind, val,this.activeArr1);
},
activeChange2(val) {
......@@ -89,7 +89,7 @@ export default {
} else {
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