点位初始话功能补全

liujun0703-新项目开发
liujun 2024-08-09 17:16:30 +08:00
parent 79772b5eda
commit 2579966357
3 changed files with 67 additions and 39 deletions

View File

@ -170,6 +170,7 @@ export default {
'0': [ '0': [
{ {
id: '9b3b9451cf9a86b1e8a44c9a9b0de826', id: '9b3b9451cf9a86b1e8a44c9a9b0de826',
code: '0',
label: '资料装备库', label: '资料装备库',
imgUrl: require('../../../../assets/map/emergency_rescue/i1.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i1.png'),
check_img: require('../../../../assets/map/emergency_rescue/i1_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i1_on.png'),
@ -177,6 +178,7 @@ export default {
}, },
{ {
id: 'f61af43a0af59c86187913f9fe084588', id: 'f61af43a0af59c86187913f9fe084588',
code: '1',
label: '应急避难场所', label: '应急避难场所',
imgUrl: require('../../../../assets/map/emergency_rescue/i2.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i2.png'),
check_img: require('../../../../assets/map/emergency_rescue/i2_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i2_on.png'),
@ -184,6 +186,7 @@ export default {
}, },
{ {
id: '7a38cf58e55995c0a5ce2c8e1f5bcc79', id: '7a38cf58e55995c0a5ce2c8e1f5bcc79',
code: '2',
label: '排水井', label: '排水井',
imgUrl: require('../../../../assets/map/emergency_rescue/i3.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i3.png'),
check_img: require('../../../../assets/map/emergency_rescue/i3_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i3_on.png'),
@ -191,6 +194,7 @@ export default {
}, },
{ {
id: 'a0fd60946978e28dac5b8a2965e00a2b', id: 'a0fd60946978e28dac5b8a2965e00a2b',
code: '3',
label: '封闭卡口', label: '封闭卡口',
imgUrl: require('../../../../assets/map/emergency_rescue/i4.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i4.png'),
check_img: require('../../../../assets/map/emergency_rescue/i4_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i4_on.png'),
@ -200,6 +204,7 @@ export default {
'1': [ '1': [
{ {
id: '1768cf2b0fb0844dedbb6db1dca3cc79', id: '1768cf2b0fb0844dedbb6db1dca3cc79',
code: '4',
label: '消防控制室', label: '消防控制室',
imgUrl: require('../../../../assets/map/emergency_rescue/i5.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i5.png'),
check_img: require('../../../../assets/map/emergency_rescue/i5_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i5_on.png'),
@ -207,6 +212,7 @@ export default {
}, },
{ {
id: '18849e29cce63a9408117ca26186203b', id: '18849e29cce63a9408117ca26186203b',
code: '5',
label: '消防泵房', label: '消防泵房',
imgUrl: require('../../../../assets/map/emergency_rescue/i6.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i6.png'),
check_img: require('../../../../assets/map/emergency_rescue/i6_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i6_on.png'),
@ -214,6 +220,7 @@ export default {
}, },
{ {
id: 'da52ba25c3f15ad932b18fbd4d028062', id: 'da52ba25c3f15ad932b18fbd4d028062',
code: '6',
label: '消防水源', label: '消防水源',
imgUrl: require('../../../../assets/map/emergency_rescue/i7.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i7.png'),
check_img: require('../../../../assets/map/emergency_rescue/i7_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i7_on.png'),
@ -221,6 +228,7 @@ export default {
}, },
{ {
id: 'e241e3ef479ac7fb217c7b496816dc7e', id: 'e241e3ef479ac7fb217c7b496816dc7e',
code: '7',
label: '消防点位', label: '消防点位',
imgUrl: require('../../../../assets/map/emergency_rescue/i8.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i8.png'),
check_img: require('../../../../assets/map/emergency_rescue/i8_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i8_on.png'),
@ -230,6 +238,7 @@ export default {
'2': [ '2': [
{ {
id: '93f7e01c8e4d906053916d314e1d3a2a', id: '93f7e01c8e4d906053916d314e1d3a2a',
code: '8',
label: '人员定位', label: '人员定位',
imgUrl: require('../../../../assets/map/emergency_rescue/i9.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i9.png'),
check_img: require('../../../../assets/map/emergency_rescue/i9_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i9_on.png'),
@ -237,6 +246,7 @@ export default {
}, },
{ {
id: '30fcda69c3eae93adbab78dea360b6b0', id: '30fcda69c3eae93adbab78dea360b6b0',
code: '9',
label: '人员轨迹', label: '人员轨迹',
imgUrl: require('../../../../assets/map/emergency_rescue/i10.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i10.png'),
check_img: require('../../../../assets/map/emergency_rescue/i10_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i10_on.png'),
@ -246,6 +256,7 @@ export default {
'3': [ '3': [
{ {
id: '6ac1fc24fde38671ee70d7aebeed5276', id: '6ac1fc24fde38671ee70d7aebeed5276',
code: '10',
label: '摄像头', label: '摄像头',
imgUrl: require('../../../../assets/map/emergency_rescue/i11.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i11.png'),
check_img: require('../../../../assets/map/emergency_rescue/i11_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i11_on.png'),
@ -255,6 +266,7 @@ export default {
'4': [ '4': [
{ {
id: '3f858ab418dbf791353ba6ff87c59e85', id: '3f858ab418dbf791353ba6ff87c59e85',
code: '12',
label: '气象站', label: '气象站',
imgUrl: require('../../../../assets/map/emergency_rescue/i12.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i12.png'),
check_img: require('../../../../assets/map/emergency_rescue/i12_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i12_on.png'),
@ -262,6 +274,7 @@ export default {
}, },
{ {
id: '997392774d64efd8507c7c518c23fc44', id: '997392774d64efd8507c7c518c23fc44',
code: '11',
label: '风速站', label: '风速站',
imgUrl: require('../../../../assets/map/emergency_rescue/i13.png'), imgUrl: require('../../../../assets/map/emergency_rescue/i13.png'),
check_img: require('../../../../assets/map/emergency_rescue/i13_on.png'), check_img: require('../../../../assets/map/emergency_rescue/i13_on.png'),
@ -316,13 +329,13 @@ export default {
}, },
/** 扎点方法 */ /** 扎点方法 */
addPoint(anchor) { addPoint(anchor) {
if (!anchor.iconUrl) throw new Error('请传入图标') console.log(anchor)
// if (!anchor.imageSize) throw new Error('') if (!anchor.icon) throw new Error('请传入图标')
if (!anchor.longitude) throw new Error('请传入经度') if (!anchor.y) throw new Error('请传入经度')
if (!anchor.latitude) throw new Error('请传入纬度') if (!anchor.x) throw new Error('请传入纬度')
const imageSize = new window.BMapGL.Size(23, 30) const imageSize = new window.BMapGL.Size(23, 30)
const icon = new window.BMapGL.Icon(config.fileUrl + anchor.iconUrl, imageSize, { imageSize }) const icon = new window.BMapGL.Icon(config.fileUrl + anchor.icon, imageSize, { imageSize })
const point = new window.BMapGL.Point(anchor.longitude, anchor.latitude) const point = new window.BMapGL.Point(anchor.y, anchor.x)
const marker = new window.BMapGL.Marker(point, { icon }) // const marker = new window.BMapGL.Marker(point, { icon }) //
marker.addEventListener('click', async() => { marker.addEventListener('click', async() => {
this.infoDialog.visible = true this.infoDialog.visible = true
@ -331,13 +344,12 @@ export default {
}, },
/** 给地图扎点标记事件事故 */ /** 给地图扎点标记事件事故 */
addPointCallback(anchor) { addPointCallback(anchor) {
if (!anchor.iconUrl) throw new Error('请传入图标') if (!anchor.icon) throw new Error('请传入图标')
if (!anchor.LONGITUDE) throw new Error('请传入经度') if (!anchor.y) throw new Error('请传入经度')
if (!anchor.LATITUDE) throw new Error('请传入纬度') if (!anchor.x) throw new Error('请传入纬度')
const { LONGITUDE, LATITUDE } = anchor
const imageSize = new window.BMapGL.Size(33, 40) const imageSize = new window.BMapGL.Size(33, 40)
const icon = new window.BMapGL.Icon(config.fileUrl + anchor.iconUrl, imageSize, { imageSize }) // icon const icon = new window.BMapGL.Icon(config.fileUrl + anchor.icon, imageSize, { imageSize }) // icon
var point = new window.BMapGL.Point(LONGITUDE, LATITUDE) var point = new window.BMapGL.Point(anchor.y, anchor.x)
const marker = new window.BMapGL.Marker(point, { icon }) // const marker = new window.BMapGL.Marker(point, { icon }) //
mapInstance.addOverlay(marker) // mapInstance.addOverlay(marker) //
// //
@ -434,6 +446,8 @@ export default {
}, },
// //
subToggleCheck(sos, ind) { subToggleCheck(sos, ind) {
mapInstance.clearOverlays()
this.initPoint(sos)
this.currSubControlPoint.forEach((item, idx) => { this.currSubControlPoint.forEach((item, idx) => {
if (idx === ind) { if (idx === ind) {
item.check = true item.check = true
@ -502,6 +516,30 @@ export default {
console.log('链接已断开') console.log('链接已断开')
} }
}, 3000) }, 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()
})
} }
} }
} }

View File

@ -4,7 +4,7 @@
<el-form-item label="图标名称:" prop="NAME"> <el-form-item label="图标名称:" prop="NAME">
<el-input v-model="form.NAME" prop="NAME" style="width: 300px"/> <el-input v-model="form.NAME" prop="NAME" style="width: 300px"/>
</el-form-item> </el-form-item>
<el-form-item label="类型:" prop="TYPE"> <el-form-item v-if="false" label="类型:" prop="TYPE">
<el-select v-model="form.TYPE" prop="TYPE" style="width: 300px"> <el-select v-model="form.TYPE" prop="TYPE" style="width: 300px">
<el-option <el-option
v-for="item in typeList" v-for="item in typeList"
@ -74,35 +74,25 @@ export default {
this.$parent.activeName = 'list' this.$parent.activeName = 'list'
}, },
uploadFile() { uploadFile() {
this.$refs.form.validate((valid) => { this.loading = true
if (valid) { const formData = new FormData()
this.loading = true if (this.form.file[0] && this.form.file[0].raw) {
const formData = new FormData() for (let i = 0; i < this.form.file.length; i++) {
if (this.form.file[0] && this.form.file[0].raw) { if (this.form.file[i].raw) {
for (let i = 0; i < this.form.file.length; i++) { formData.append('FFILE', this.form.file[i].raw)
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)
} }
} 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) { confirm(filePath) {
this.form.FILE_PATH = filePath this.form.FILE_PATH = filePath
// type
this.form.TYPE_NAME = this.typeList.find((item) => {
return item.DICTIONARIES_ID === this.form.TYPE
}).name
requestFN( requestFN(
'/bi/emergency/iconSaveOrUpdate', this.form '/bi/emergency/iconSaveOrUpdate', this.form
).then((data) => { ).then((data) => {

View File

@ -24,7 +24,7 @@
<el-table-column :reserve-selection="true" type="selection" width="55" align="center"/> <el-table-column :reserve-selection="true" type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50" align="center"/> <el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="NAME" label="名称"/> <el-table-column prop="NAME" label="名称"/>
<el-table-column prop="TYPE_NAME" label="类型名称"/> <el-table-column prop="EMERGENCY_ICON_ID" label="编码"/>
<el-table-column prop="FILE_PATH" label="图标类型"> <el-table-column prop="FILE_PATH" label="图标类型">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-image <el-image
@ -35,7 +35,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="220"> <el-table-column label="操作" align="center" width="220">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" plain @click="handleDelete(row.EMERGENCY_ICON_ID)"> <el-button v-if="false" type="danger" icon="el-icon-delete" plain @click="handleDelete(row.EMERGENCY_ICON_ID)">
</el-button> </el-button>
<el-button type="primary" icon="el-icon-edit" @click="goDetail(row)"></el-button> <el-button type="primary" icon="el-icon-edit" @click="goDetail(row)"></el-button>
</template> </template>