diff --git a/src/views/emergen_cyrescue/emergency_map/components/mapAssembly.vue b/src/views/emergen_cyrescue/emergency_map/components/mapAssembly.vue index 3147d31..45c54ef 100644 --- a/src/views/emergen_cyrescue/emergency_map/components/mapAssembly.vue +++ b/src/views/emergen_cyrescue/emergency_map/components/mapAssembly.vue @@ -170,6 +170,7 @@ export default { '0': [ { id: '9b3b9451cf9a86b1e8a44c9a9b0de826', + code: '0', label: '资料装备库', imgUrl: require('../../../../assets/map/emergency_rescue/i1.png'), check_img: require('../../../../assets/map/emergency_rescue/i1_on.png'), @@ -177,6 +178,7 @@ export default { }, { id: 'f61af43a0af59c86187913f9fe084588', + code: '1', label: '应急避难场所', imgUrl: require('../../../../assets/map/emergency_rescue/i2.png'), check_img: require('../../../../assets/map/emergency_rescue/i2_on.png'), @@ -184,6 +186,7 @@ export default { }, { id: '7a38cf58e55995c0a5ce2c8e1f5bcc79', + code: '2', label: '排水井', imgUrl: require('../../../../assets/map/emergency_rescue/i3.png'), check_img: require('../../../../assets/map/emergency_rescue/i3_on.png'), @@ -191,6 +194,7 @@ export default { }, { id: 'a0fd60946978e28dac5b8a2965e00a2b', + code: '3', label: '封闭卡口', imgUrl: require('../../../../assets/map/emergency_rescue/i4.png'), check_img: require('../../../../assets/map/emergency_rescue/i4_on.png'), @@ -200,6 +204,7 @@ export default { '1': [ { id: '1768cf2b0fb0844dedbb6db1dca3cc79', + code: '4', label: '消防控制室', imgUrl: require('../../../../assets/map/emergency_rescue/i5.png'), check_img: require('../../../../assets/map/emergency_rescue/i5_on.png'), @@ -207,6 +212,7 @@ export default { }, { id: '18849e29cce63a9408117ca26186203b', + code: '5', label: '消防泵房', imgUrl: require('../../../../assets/map/emergency_rescue/i6.png'), check_img: require('../../../../assets/map/emergency_rescue/i6_on.png'), @@ -214,6 +220,7 @@ export default { }, { id: 'da52ba25c3f15ad932b18fbd4d028062', + code: '6', label: '消防水源', imgUrl: require('../../../../assets/map/emergency_rescue/i7.png'), check_img: require('../../../../assets/map/emergency_rescue/i7_on.png'), @@ -221,6 +228,7 @@ export default { }, { id: 'e241e3ef479ac7fb217c7b496816dc7e', + code: '7', label: '消防点位', imgUrl: require('../../../../assets/map/emergency_rescue/i8.png'), check_img: require('../../../../assets/map/emergency_rescue/i8_on.png'), @@ -230,6 +238,7 @@ export default { '2': [ { id: '93f7e01c8e4d906053916d314e1d3a2a', + code: '8', label: '人员定位', imgUrl: require('../../../../assets/map/emergency_rescue/i9.png'), check_img: require('../../../../assets/map/emergency_rescue/i9_on.png'), @@ -237,6 +246,7 @@ export default { }, { id: '30fcda69c3eae93adbab78dea360b6b0', + code: '9', label: '人员轨迹', imgUrl: require('../../../../assets/map/emergency_rescue/i10.png'), check_img: require('../../../../assets/map/emergency_rescue/i10_on.png'), @@ -246,6 +256,7 @@ export default { '3': [ { id: '6ac1fc24fde38671ee70d7aebeed5276', + code: '10', label: '摄像头', imgUrl: require('../../../../assets/map/emergency_rescue/i11.png'), check_img: require('../../../../assets/map/emergency_rescue/i11_on.png'), @@ -255,6 +266,7 @@ export default { '4': [ { id: '3f858ab418dbf791353ba6ff87c59e85', + code: '12', label: '气象站', imgUrl: require('../../../../assets/map/emergency_rescue/i12.png'), check_img: require('../../../../assets/map/emergency_rescue/i12_on.png'), @@ -262,6 +274,7 @@ export default { }, { id: '997392774d64efd8507c7c518c23fc44', + code: '11', label: '风速站', imgUrl: require('../../../../assets/map/emergency_rescue/i13.png'), check_img: require('../../../../assets/map/emergency_rescue/i13_on.png'), @@ -316,13 +329,13 @@ export default { }, /** 扎点方法 */ addPoint(anchor) { - if (!anchor.iconUrl) throw new Error('请传入图标') - // if (!anchor.imageSize) throw new Error('请传入图片大小') - if (!anchor.longitude) throw new Error('请传入经度') - if (!anchor.latitude) throw new Error('请传入纬度') + console.log(anchor) + if (!anchor.icon) throw new Error('请传入图标') + if (!anchor.y) throw new Error('请传入经度') + if (!anchor.x) throw new Error('请传入纬度') const imageSize = new window.BMapGL.Size(23, 30) - const icon = new window.BMapGL.Icon(config.fileUrl + anchor.iconUrl, imageSize, { imageSize }) - const point = new window.BMapGL.Point(anchor.longitude, anchor.latitude) + const icon = new window.BMapGL.Icon(config.fileUrl + anchor.icon, imageSize, { imageSize }) + const point = new window.BMapGL.Point(anchor.y, anchor.x) const marker = new window.BMapGL.Marker(point, { icon }) // 创建标注 marker.addEventListener('click', async() => { this.infoDialog.visible = true @@ -331,13 +344,12 @@ export default { }, /** 给地图扎点标记事件事故 */ addPointCallback(anchor) { - if (!anchor.iconUrl) throw new Error('请传入图标') - if (!anchor.LONGITUDE) throw new Error('请传入经度') - if (!anchor.LATITUDE) throw new Error('请传入纬度') - const { LONGITUDE, LATITUDE } = anchor + if (!anchor.icon) throw new Error('请传入图标') + if (!anchor.y) throw new Error('请传入经度') + if (!anchor.x) throw new Error('请传入纬度') const imageSize = new window.BMapGL.Size(33, 40) - const icon = new window.BMapGL.Icon(config.fileUrl + anchor.iconUrl, imageSize, { imageSize }) // 创建 icon 图标 - var point = new window.BMapGL.Point(LONGITUDE, LATITUDE) + const icon = new window.BMapGL.Icon(config.fileUrl + anchor.icon, imageSize, { imageSize }) // 创建 icon 图标 + var point = new window.BMapGL.Point(anchor.y, anchor.x) const marker = new window.BMapGL.Marker(point, { icon }) // 创建标注 mapInstance.addOverlay(marker) // 将标注添加到地图中 // 处理标注事件点击行为 @@ -434,6 +446,8 @@ export default { }, // 二级坐标点位点击事件 subToggleCheck(sos, ind) { + mapInstance.clearOverlays() + this.initPoint(sos) this.currSubControlPoint.forEach((item, idx) => { if (idx === ind) { item.check = true @@ -502,6 +516,30 @@ export default { console.log('链接已断开') } }, 3000) + }, + initPoint(row) { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + requestFN( + '/bi/emergency/getPoint', + { + code: row.code + } + ).then((data) => { + if (data.result === 'success') { + for (let i = 0; i < data.list.length; i++) { + this.addPoint(data.list[i]) + } + } + loading.close() + }).catch((e) => { + console.log(e) + loading.close() + }) } } } diff --git a/src/views/emergen_cyrescue/emergency_map_icon/components/add.vue b/src/views/emergen_cyrescue/emergency_map_icon/components/add.vue index b826ea3..c0a5fe7 100644 --- a/src/views/emergen_cyrescue/emergency_map_icon/components/add.vue +++ b/src/views/emergen_cyrescue/emergency_map_icon/components/add.vue @@ -4,7 +4,7 @@ - + { - if (valid) { - this.loading = true - const formData = new FormData() - if (this.form.file[0] && this.form.file[0].raw) { - for (let i = 0; i < this.form.file.length; i++) { - if (this.form.file[i].raw) { - formData.append('FFILE', this.form.file[i].raw) - } - } - upload('/file/upload', formData).then((data) => { - this.confirm(data.fileurl) - }).catch((e) => { - console.log(e) - }) - } else { - this.confirm(this.form.FILE_PATH) + this.loading = true + const formData = new FormData() + if (this.form.file[0] && this.form.file[0].raw) { + for (let i = 0; i < this.form.file.length; i++) { + if (this.form.file[i].raw) { + formData.append('FFILE', this.form.file[i].raw) } - } else { - return false } - }) + upload('/file/upload', formData).then((data) => { + this.confirm(data.fileurl) + }).catch((e) => { + console.log(e) + }) + } else { + this.confirm(this.form.FILE_PATH) + } }, confirm(filePath) { this.form.FILE_PATH = filePath - // 翻译type类型 - this.form.TYPE_NAME = this.typeList.find((item) => { - return item.DICTIONARIES_ID === this.form.TYPE - }).name requestFN( '/bi/emergency/iconSaveOrUpdate', this.form ).then((data) => { diff --git a/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue b/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue index 5b7402e..a224f80 100644 --- a/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue +++ b/src/views/emergen_cyrescue/emergency_map_icon/components/list.vue @@ -24,7 +24,7 @@ - +