应急指挥功能模块

liujun0703-新项目开发
liujun 2024-07-19 16:32:36 +08:00
parent 46393379cd
commit b25286eaee
3 changed files with 27 additions and 9 deletions

View File

@ -3,8 +3,8 @@
<div id="map"/> <div id="map"/>
</div> </div>
</template> </template>
<script> <script>
import { requestFN } from '@/utils/request'
let mapInstance let mapInstance
export default { export default {
@ -13,19 +13,37 @@ export default {
} }
}, },
mounted() { mounted() {
this.fnMapInit() this.mapInit()
}, },
beforeDestroy() { beforeDestroy() {
mapInstance = null mapInstance = null
}, },
methods: { methods: {
fnMapInit() { //
mapInit() {
mapInstance = new window.BMapGL.Map('map') 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) 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)
})
} }
} }
} }

View File

@ -104,7 +104,7 @@ export default {
return item.DICTIONARIES_ID === this.form.TYPE return item.DICTIONARIES_ID === this.form.TYPE
}).name }).name
requestFN( requestFN(
'/bi/emergency/saveOrUpdate', this.form '/bi/emergency/iconSaveOrUpdate', this.form
).then((data) => { ).then((data) => {
this.loading = false this.loading = false
this.handleClose() this.handleClose()

View File

@ -95,7 +95,7 @@ export default {
// //
getList() { getList() {
this.loading = true this.loading = true
requestFN('bi/emergency/list?showCount=' + this.page.limit + '&currentPage=' + this.page.page, this.form).then((data) => { requestFN('bi/emergency/iconList?showCount=' + this.page.limit + '&currentPage=' + this.page.page, this.form).then((data) => {
this.loading = false this.loading = false
this.list = data.varList this.list = data.varList
this.page.total = data.page.totalResult this.page.total = data.page.totalResult
@ -133,7 +133,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
requestFN( requestFN(
'/bi/emergency/delete', { id: id } '/bi/emergency/iconDelete', { id: id }
).then((data) => { ).then((data) => {
this.getList() this.getList()
this.$message({ this.$message({