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

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

parents a3024198 9bdbfdcb
......@@ -27,7 +27,12 @@
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="设备图片上传" prop="iconUrl">
<FileUpload :fileArr="fileList" @resFun="getFileInfo"/>
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileArr"
/>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
......@@ -58,7 +63,7 @@
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import FileUpload from '@/components/FileUpload';
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
......@@ -78,11 +83,12 @@
},
map : null,
obj : null,
gaoMap : null
gaoMap : null,
fileArr: []
}
},
components: {
FileUpload,
MyFileUpload,
},
methods: {
show () {
......@@ -99,6 +105,7 @@
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then(response => {
this.dialogVisible = false;
this.msgSuccess("修改成功");
});
} else {
......@@ -109,6 +116,7 @@
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......@@ -120,6 +128,10 @@
},
handleClose(done) {
done();
},
listRemove(e) {
this.form.url = "";
this.fileArr = [];
}
}
}
......
......@@ -27,7 +27,12 @@
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="设备图片上传" prop="iconUrl">
<FileUpload :fileArr="fileList" @resFun="getFileInfo"/>
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileArr"
/>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
......@@ -57,9 +62,7 @@
<script>
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import FileUpload from '@/components/FileUpload';
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
export default {
......@@ -77,15 +80,13 @@
rules: {
},
map : null,
obj : null,
gaoMap : null
obj : Object,
gaoMap : null,
fileArr: []
}
},
mounted(){
console.log(this.form.longitude,"===============")
},
components: {
FileUpload,
MyFileUpload
},
methods: {
show () {
......@@ -102,6 +103,7 @@
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then(response => {
this.dialogVisible = false;
this.msgSuccess("修改成功");
});
} else {
......@@ -112,6 +114,7 @@
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......@@ -121,6 +124,10 @@
}
});
},
listRemove(e) {
this.form.url = "";
this.fileArr = [];
},
handleClose(done) {
done();
}
......
......@@ -27,7 +27,12 @@
<el-input v-model="form.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="设备图片上传" prop="iconUrl">
<FileUpload :fileArr="fileList" @resFun="getFileInfo"/>
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileArr"
/>
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
......@@ -58,7 +63,7 @@
import { getAllDeviceInfo ,addDeviceInfo, updateDeviceInfo } from "@/api/device/deviceInfo";
import FileUpload from '@/components/FileUpload';
import MyFileUpload from "@/components/MyFileUpload";
import { DEVICE_TYPE } from "utils/gaodeMap.js";
......@@ -78,11 +83,12 @@
},
map : null,
obj : null,
gaoMap : null
gaoMap : null,
fileArr: []
}
},
components: {
FileUpload,
MyFileUpload,
},
methods: {
show () {
......@@ -99,6 +105,7 @@
if (valid) {
if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then(response => {
this.dialogVisible = false;
this.msgSuccess("修改成功");
});
} else {
......@@ -109,6 +116,7 @@
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......@@ -120,6 +128,10 @@
},
handleClose(done) {
done();
},
listRemove(e) {
this.form.url = "";
this.fileArr = [];
}
}
}
......
......@@ -116,6 +116,7 @@ class gaodeMap {
marker.setExtData(data);
that.deviceType = markerType;
let editWindow = that.createInfowindow();
editWindow.fileArr = data.iconUrl != "" && data.iconUrl != undefined ? [{ url: data.iconUrl }] : [];
marker.on("click", function(e) {
if ("edit" == that.mapOperateType) {
editWindow.form = e.target.getExtData();
......@@ -567,14 +568,15 @@ class gaodeMap {
//监听draw事件可获取画好的覆盖物
this.overlays = [];
let that = this;
this.markerOverlays = [];
this.mouseTool.on("draw", function(e) {
if (e.obj.getExtData().type != "newLine") {
map.remove(that.markerOverlays);
const device = that.createInfowindow();
device.map = map;
device.obj = e.obj;
device.gaoMap = that;
e.obj.on("click", function(aa) {
console.log(aa,"fdsfdsfdsa===click")
let postion = aa.target._position;
//兼容拖拽后单击事件,拖拽后点击事件返回位置为数组
if(postion instanceof Array){
......@@ -587,6 +589,7 @@ class gaodeMap {
device.show();
});
that.markerOverlays.push(e.obj);
}
if (e.obj.getExtData().type == "newLine") {
......@@ -594,12 +597,13 @@ class gaodeMap {
that.newLineAddEvent(e.obj);
// 右键菜单
// that.addEditorAndMenu(e.obj)
}
that.overlays.push(e.obj);
}
// if(e.obj.getExtData().type=="line"){
// return;
// }
that.mouseTool.close();
//that.mouseTool.close();
});
}
......@@ -716,5 +720,10 @@ class gaodeMap {
placeSearch.search(keyWord); //关键字查询查询
})
}
closeAddMarker(){
this.mouseTool.close();
map.remove(this.markerOverlays);
}
}
export default gaodeMap;
......@@ -274,9 +274,6 @@ export default {
this.gaoMap.lineType=1;
this.gaoMap.createNewLine();
}else {
console.log(this.createValue,"rewrewqrew===========")
console.log(this.targetNum,"rewrewqrew===========1111111111")
this.gaoMap.draw(this.createValue.toString());
}
},
......@@ -298,6 +295,7 @@ export default {
this.gaoMap.mapOperateType = "edit";
this.gaoMap.addMarkerDragg();
this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
},
deleteDevice() {
this.targetNum = this.targetNum != 3 ? 3 : 0;
......@@ -308,6 +306,7 @@ export default {
this.gaoMap.mapOperateType = "delete";
this.gaoMap.removeMarkerDragg();
this.gaoMap.placeSearch.clear();
this.gaoMap.closeAddMarker();
},
selectDeviceType(val) {
// if("add" == this.operationType){
......
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