Commit f5ccdb7c authored by 王晓倩's avatar 王晓倩

Merge remote-tracking branch 'origin/master'

parents 5ce8f322 e8ee48b8
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeId" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeId" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -152,6 +152,7 @@ export default { ...@@ -152,6 +152,7 @@ export default {
form: { form: {
deviceType: "3", deviceType: "3",
}, },
type: DEVICE_TYPE.FLOWMETER,
dialogVisible: false, dialogVisible: false,
fileList: [], fileList: [],
// 表单校验 // 表单校验
...@@ -210,16 +211,35 @@ export default { ...@@ -210,16 +211,35 @@ export default {
this.form.iconUrl = res.url; this.form.iconUrl = res.url;
}, },
submitForm() { submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form流量计",this.form)
// return;
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false; if (response.code == 200) {
this.map.remove(this.obj); this.dialogVisible = false;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form); const index = this.gaoMap.markers.indexOf(this.obj);
this.msgSuccess("修改成功"); 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 { } else {
addDeviceInfo(this.form).then((response) => { addDeviceInfo(this.form).then((response) => {
...@@ -227,12 +247,18 @@ export default { ...@@ -227,12 +247,18 @@ export default {
this.remove(); this.remove();
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; 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.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
} else { } else {
this.msgSuccess("新增失败"); // this.msgSuccess("新增失败");
} }
}); });
} }
......
...@@ -152,6 +152,7 @@ export default { ...@@ -152,6 +152,7 @@ export default {
form: { form: {
deviceType: "4", deviceType: "4",
}, },
type: DEVICE_TYPE.PRESSUREGAGE,
dialogVisible: false, dialogVisible: false,
fileList: [], fileList: [],
// 表单校验 // 表单校验
...@@ -208,16 +209,33 @@ export default { ...@@ -208,16 +209,33 @@ export default {
this.form.iconUrl = res.url; this.form.iconUrl = res.url;
}, },
submitForm() { submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form)",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
if (response.code == 200) { if (response.code == 200) {
this.dialogVisible = false; 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.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("修改成功"); this.msgSuccess("修改成功");
} }
}); });
...@@ -227,12 +245,18 @@ export default { ...@@ -227,12 +245,18 @@ export default {
this.remove(); this.remove();
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; 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.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
} else { } else {
this.msgSuccess("新增失败"); // this.msgSuccess("新增失败");
} }
}); });
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeId" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
...@@ -152,6 +152,7 @@ export default { ...@@ -152,6 +152,7 @@ export default {
form: { form: {
deviceType: "1", deviceType: "1",
}, },
type: DEVICE_TYPE.REGEULATORBOX,
dialogVisible: false, dialogVisible: false,
fileList: [], fileList: [],
map: null, map: null,
...@@ -208,15 +209,35 @@ export default { ...@@ -208,15 +209,35 @@ export default {
this.form.iconUrl = res.url; this.form.iconUrl = res.url;
}, },
submitForm() { submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false; if (response.code == 200) {
this.map.remove(this.obj); this.dialogVisible = false;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form); const index = this.gaoMap.markers.indexOf(this.obj);
this.msgSuccess("修改成功"); 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 { } else {
addDeviceInfo(this.form).then((response) => { addDeviceInfo(this.form).then((response) => {
...@@ -224,12 +245,18 @@ export default { ...@@ -224,12 +245,18 @@ export default {
this.remove(); this.remove();
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; 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.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
} else { } else {
this.msgSuccess("新增失败"); // this.msgSuccess("新增失败");
} }
}); });
} }
......
...@@ -151,6 +151,7 @@ export default { ...@@ -151,6 +151,7 @@ export default {
form: { form: {
deviceType: "2", deviceType: "2",
}, },
type: DEVICE_TYPE.VALUEWELL,
dialogVisible: false, dialogVisible: false,
fileList: [], fileList: [],
map: null, map: null,
...@@ -206,14 +207,35 @@ export default { ...@@ -206,14 +207,35 @@ export default {
this.form.iconUrl = res.url; this.form.iconUrl = res.url;
}, },
submitForm() { submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
this.dialogVisible = false; if (response.code == 200) {
this.map.remove(this.obj); this.dialogVisible = false;
this.gaoMap.addMarker(this.gaoMap.deviceType, this.form); const index = this.gaoMap.markers.indexOf(this.obj);
this.msgSuccess("修改成功"); 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 { } else {
addDeviceInfo(this.form).then((response) => { addDeviceInfo(this.form).then((response) => {
...@@ -221,12 +243,18 @@ export default { ...@@ -221,12 +243,18 @@ export default {
this.remove(); this.remove();
this.map.remove(this.obj); this.map.remove(this.obj);
this.form.deviceId = response.data; 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.placeSearch.clear();
this.gaoMap.closeAddMarker(); this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
} else { } else {
this.msgSuccess("新增失败"); // this.msgSuccess("新增失败");
} }
}); });
} }
......
...@@ -71,7 +71,6 @@ class gaodeMap { ...@@ -71,7 +71,6 @@ class gaodeMap {
this.newLineObj = null; this.newLineObj = null;
this.lineFlag = false; this.lineFlag = false;
this.createNewLine(); this.createNewLine();
console.log("map点击事件新建"); console.log("map点击事件新建");
}) })
.catch(() => {}); .catch(() => {});
...@@ -171,6 +170,7 @@ class gaodeMap { ...@@ -171,6 +170,7 @@ class gaodeMap {
addMarker(markerType, data, func) { addMarker(markerType, data, func) {
let that = this; let that = this;
that.markerType = markerType; that.markerType = markerType;
console.log(markerType);
let infoWindow = new AMap.InfoWindow({ let infoWindow = new AMap.InfoWindow({
isCustom: true, isCustom: true,
offset: new AMap.Pixel(24, -38), offset: new AMap.Pixel(24, -38),
...@@ -245,6 +245,11 @@ class gaodeMap { ...@@ -245,6 +245,11 @@ class gaodeMap {
that.markers.splice(ind, 1); that.markers.splice(ind, 1);
console.log(that.markers); console.log(that.markers);
} }
const arr = that.markers.map(item => {
return item.getExtData();
});
that.view.deviceClassify(arr);
that.view.pipeList();
} }
}); });
}) })
...@@ -286,7 +291,13 @@ class gaodeMap { ...@@ -286,7 +291,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.setZoom("11");
//map.setFitView(); //map.setFitView();
...@@ -491,12 +502,12 @@ class gaodeMap { ...@@ -491,12 +502,12 @@ class gaodeMap {
lineData: item lineData: item
} }
}); });
// 如果是修改后包装,有记录的index 就在原位置插入,如果没有,就直接在最后插入 // 如果是修改后包装,有记录的index 就在原位置插入,如果没有,就直接在最后插入
if (this.changePolineListNum===null) { if (this.changePolineListNum === null) {
this.polyLines.push(polyline); this.polyLines.push(polyline);
}else{ } else {
this.polyLines.splice(this.changePolineListNum,0,polyline); this.polyLines.splice(this.changePolineListNum, 0, polyline);
this.changePolineListNum=null; this.changePolineListNum = null;
} }
// 信息窗体 // 信息窗体
const dom = createPop(lineInfoWindow, { const dom = createPop(lineInfoWindow, {
...@@ -756,6 +767,16 @@ class gaodeMap { ...@@ -756,6 +767,16 @@ class gaodeMap {
} }
} }
map.remove(obj); 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({ vue.$message({
type: "success", type: "success",
......
...@@ -516,24 +516,30 @@ export default { ...@@ -516,24 +516,30 @@ export default {
this.leftBarNum = [1, 2, 3, 4, 7]; this.leftBarNum = [1, 2, 3, 4, 7];
// map.remove(this.gaodeMap.markerOverlays); // map.remove(this.gaodeMap.markerOverlays);
}, },
search() { async search() {
this.searchClear(); this.searchClear();
map.clearMap(); map.clearMap();
this.gaoMap.placeSearch.clear(); this.gaoMap.placeSearch.clear();
if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) { if (!(!this.gaoMap.searchSelectAdcode && !this.gaoMap.searchSelectName)) {
this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode); this.gaoMap.placeSearch.setCity(this.gaoMap.searchSelectAdcode);
this.gaoMap.placeSearch.search(this.gaoMap.searchSelectName); 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.gaoMap.polyLines = [];
this.getPipeList({ pipeName: this.gaoMap.searchSelectName }); await this.getPipeList({ pipeName: this.gaoMap.searchSelectName });
this.gaoMap.searchSelectAdcode = undefined; this.gaoMap.searchSelectAdcode = undefined;
this.gaoMap.searchSelectName = undefined; this.gaoMap.searchSelectName = undefined;
} else { } else {
this.gaoMap.placeSearch.search(this.keyWord); this.gaoMap.placeSearch.search(this.keyWord);
this.getDeviceInfo({ deviceName: this.keyWord }); this.gaoMap.markers = [];
await this.getDeviceInfo({ deviceName: this.keyWord });
this.gaoMap.polyLines = []; this.gaoMap.polyLines = [];
this.getPipeList({ pipeName: this.keyWord }); await this.getPipeList({ pipeName: this.keyWord });
} }
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.pipeList();
}, },
// 新建下拉列表关闭 window点击事件 // 新建下拉列表关闭 window点击事件
barClose() { barClose() {
...@@ -556,10 +562,15 @@ export default { ...@@ -556,10 +562,15 @@ export default {
this.createValue = 0; this.createValue = 0;
this.createLabel = "新建"; this.createLabel = "新建";
this.targetNum = 0; this.targetNum = 0;
map.clearMap(); map.clearMap();
this.initMap();
this.leftBarNum = [1, 2, 3, 4, 7];
this.keyWord = ""; this.keyWord = "";
this.arrowRightNum = [];
this.leftBarNum = [1, 2, 3, 4, 7];
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.initMap();
}, },
// 向右的箭头的动画 // 向右的箭头的动画
......
...@@ -449,6 +449,9 @@ ...@@ -449,6 +449,9 @@
url: this.form.iconUrl, url: this.form.iconUrl,
}); });
} }
if(this.form.coordinates){
this.str = this.form.coordinates;
}
this.open = true; this.open = true;
this.title = "修改管道信息"; this.title = "修改管道信息";
}); });
......
...@@ -810,7 +810,7 @@ export default { ...@@ -810,7 +810,7 @@ export default {
// 工作人员 // 工作人员
this.workerManInfoWindowShow(iten, lat, lng); this.workerManInfoWindowShow(iten, lat, lng);
} else if (item.value == 8) { } else if (item.value == 8) {
this.trouleInfoWindowShow(iten, lat, lng) this.trouleInfoWindowShow(iten, lat, lng);
} else { } else {
// 其他设备 // 其他设备
this.diveceInfoWindowShow(iten, lat, lng); this.diveceInfoWindowShow(iten, lat, lng);
...@@ -1196,7 +1196,7 @@ export default { ...@@ -1196,7 +1196,7 @@ export default {
// 左边全选 // 左边全选
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9]; this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
// 右转箭头的样式active判定 // 右转箭头的样式active判定
this.arrowRightNum = []; // this.arrowRightNum = [];
// 清空左边列表 // 清空左边列表
// this.changeBtnDataClear(); // this.changeBtnDataClear();
// this.gaoMap.placeSearch.search(this.keyWord); // this.gaoMap.placeSearch.search(this.keyWord);
...@@ -1208,9 +1208,11 @@ export default { ...@@ -1208,9 +1208,11 @@ export default {
await this.getInspectorLocations({ userName: this.keyWord }); await this.getInspectorLocations({ userName: this.keyWord });
await this.getMapHiddenTroublelist({ troubleName: this.keyWord }); await this.getMapHiddenTroublelist({ troubleName: this.keyWord });
// 设备报警 // 设备报警
this.getSelectAlarmDevice(); this.getSelectAlarmDevice();
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
this.pipeList(); this.pipeList();
} }
}, },
...@@ -1245,13 +1247,17 @@ export default { ...@@ -1245,13 +1247,17 @@ export default {
}, },
refreshMap() { refreshMap() {
// this.changeBtnDataClear(); // this.changeBtnDataClear();
this.keyWord=""; this.keyWord = "";
this.arrowRightNum=[]; this.arrowRightNum = [];
this.iconClass = "icon-create"; this.iconClass = "icon-create";
this.createValue = 0; this.createValue = 0;
this.createLabel = "新建"; this.createLabel = "新建";
this.targetNum = 0; this.targetNum = 0;
this.changeBtnData.forEach((item) => {
item.nowPage = 1;
});
map.clearMap(); map.clearMap();
this.leftBarNum = [1, 2, 3, 4, 7, 8, 9]; this.leftBarNum = [1, 2, 3, 4, 7, 8, 9];
this.initMap(); this.initMap();
}, },
......
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