应急指挥功能模块
parent
46393379cd
commit
b25286eaee
|
@ -3,8 +3,8 @@
|
|||
<div id="map"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { requestFN } from '@/utils/request'
|
||||
|
||||
let mapInstance
|
||||
export default {
|
||||
|
@ -13,19 +13,37 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fnMapInit()
|
||||
this.mapInit()
|
||||
},
|
||||
beforeDestroy() {
|
||||
mapInstance = null
|
||||
},
|
||||
methods: {
|
||||
fnMapInit() {
|
||||
// 地图初始化
|
||||
mapInit() {
|
||||
mapInstance = new window.BMapGL.Map('map')
|
||||
mapInstance.centerAndZoom(new window.BMapGL.Point('119.502057', '39.933306'), 15)
|
||||
mapInstance.centerAndZoom(new window.BMapGL.Point('119.645516', '39.934547'), 15)
|
||||
mapInstance.enableScrollWheelZoom(true)
|
||||
},
|
||||
addPoint() {
|
||||
|
||||
// 扎点
|
||||
addPoint(anchor) {
|
||||
if (!anchor.iconImg) throw new Error('请传入图标')
|
||||
if (!anchor.imageSize) throw new Error('请传入图片大小')
|
||||
if (!anchor.lng) throw new Error('请传入经度')
|
||||
if (!anchor.lat) throw new Error('请传入纬度')
|
||||
const imageSize = new window.BMapGL.Size(23, 30)
|
||||
const icon = new window.BMapGL.Icon(anchor.iconImg, imageSize, { imageSize })
|
||||
const point = new window.BMapGL.Point(anchor.lng, anchor.lat)
|
||||
const marker = new window.BMapGL.Marker(point, { icon })
|
||||
mapInstance.addOverlay(marker)
|
||||
},
|
||||
// 初始话定位点
|
||||
getInfo(id) {
|
||||
requestFN('/dictionaries/listTree').then((data) => {
|
||||
this.treeData = JSON.parse(data.zTreeNodes)
|
||||
}).catch((e) => {
|
||||
console.error('获取树形数据失败', e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ export default {
|
|||
return item.DICTIONARIES_ID === this.form.TYPE
|
||||
}).name
|
||||
requestFN(
|
||||
'/bi/emergency/saveOrUpdate', this.form
|
||||
'/bi/emergency/iconSaveOrUpdate', this.form
|
||||
).then((data) => {
|
||||
this.loading = false
|
||||
this.handleClose()
|
||||
|
|
|
@ -95,7 +95,7 @@ export default {
|
|||
// 获取列表
|
||||
getList() {
|
||||
this.loading = true
|
||||
requestFN('bi/emergency/list?showCount=' + this.page.limit + '¤tPage=' + this.page.page, this.form).then((data) => {
|
||||
requestFN('bi/emergency/iconList?showCount=' + this.page.limit + '¤tPage=' + this.page.page, this.form).then((data) => {
|
||||
this.loading = false
|
||||
this.list = data.varList
|
||||
this.page.total = data.page.totalResult
|
||||
|
@ -133,7 +133,7 @@ export default {
|
|||
type: 'warning'
|
||||
}).then(() => {
|
||||
requestFN(
|
||||
'/bi/emergency/delete', { id: id }
|
||||
'/bi/emergency/iconDelete', { id: id }
|
||||
).then((data) => {
|
||||
this.getList()
|
||||
this.$message({
|
||||
|
|
Loading…
Reference in New Issue