| | |
| | | <div class="category-value">{{ item.name }}</div> |
| | | </div> |
| | | <div> |
| | | <div class="category">申报人数:</div> |
| | | <div class="category-value">{{ item.number }}</div> |
| | | </div> |
| | | <div> |
| | | <div class="category">活动时间:</div> |
| | | <div |
| | | class="category-value" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getSecurityList, getPoliceList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice } from '@/api/activity/index.js' |
| | | import { getSecurityList, getPoliceList, getCarList, addCarAndRange, addActivityPolice, getSecurityPoliceList, getSecurityCarList, updateActivityPolice, updateActivityCar } from '@/api/activity/index.js' |
| | | |
| | | let analyseLayer = null |
| | | let analysePolygon = null |
| | |
| | | return { |
| | | activityOptions: [{ |
| | | value: '选项1', |
| | | label: '黄金糕' |
| | | label: '教育活动' |
| | | }, { |
| | | value: '选项2', |
| | | label: '双皮奶' |
| | | label: '科技活动' |
| | | }, { |
| | | value: '选项3', |
| | | label: '蚵仔煎' |
| | | label: '公益活动' |
| | | }, { |
| | | value: '选项4', |
| | | label: '龙须面' |
| | | label: '组织活动' |
| | | }, { |
| | | value: '选项5', |
| | | label: '北京烤鸭' |
| | | label: '文娱活动' |
| | | }, { |
| | | value: '选项6', |
| | | label: '体育活动' |
| | | }], |
| | | policeOption: [], |
| | | policemanOption: [], |
| | | policecarOption: [], |
| | | activityType: '', |
| | | policeType: '', |
| | | searchActivity: '', |
| | |
| | | }, |
| | | created () { |
| | | this.getPoliceList() |
| | | // this.addCarAndRange('1595988751891415042', '1 2,3 4', 1, 1) |
| | | // this.addActivityPolice() |
| | | this.getCarList() |
| | | this.getSecurityList() |
| | | // this.getSecurityPoliceList() |
| | | // this.getSecurityCarList() |
| | | }, |
| | | mounted () { |
| | | |
| | |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.RED, |
| | | material: global.DC.Color.RED.withAlpha(0.4), |
| | | width: 4, |
| | | params: { |
| | | id: item.id, |
| | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.RED, |
| | | material: global.DC.Color.RED.withAlpha(0.4), |
| | | params: { |
| | | id: item.id, |
| | | policemanId: item.policemanId |
| | |
| | | }) |
| | | |
| | | } else if (item.type == 3) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'police', item.id, item.policemanId) |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policeman', item.id, item.policemanId) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'billboard', |
| | |
| | | |
| | | // 获取活动警车分布信息 |
| | | getSecurityCarList (securityId) { |
| | | this.removeAll() |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | getSecurityCarList(securityId).then(res => { |
| | | console.log('活动警车列表', res.data.data) |
| | | res.data.data.forEach(item => { |
| | | if (item.type == 1) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.BLUE.withAlpha(0.4), |
| | | width: 4, |
| | | params: { |
| | | id: item.id, |
| | | carId: item.carId |
| | | }, |
| | | incident: this.overlayTypeClick |
| | | }) |
| | | } else if (item.type == 2) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.BLUE.withAlpha(0.4), |
| | | params: { |
| | | id: item.id, |
| | | carId: item.carId |
| | | }, |
| | | incident: this.overlayTypeClick |
| | | }) |
| | | |
| | | } else if (item.type == 3) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policecar', item.id, item.carId) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'billboard', |
| | | params: positionObj, |
| | | incident: this.overlayTypeClick |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取活动列表 |
| | |
| | | getSecurityList().then(res => { |
| | | this.activityList = res.data.data |
| | | this.addActivityPoint() |
| | | console.log('活动列表', res.data.data) |
| | | }) |
| | | }, |
| | | |
| | | // 获取警员列表,生成下拉数据 |
| | | getPoliceList () { |
| | | getPoliceList().then(res => { |
| | | console.log('警员列表', res.data.data) |
| | | res.data.data.forEach(item => { |
| | | this.policeOption.push({ value: `${item.id}`, label: `${item.name}` }) |
| | | this.policemanOption.push({ value: `${item.id}`, label: `${item.name}` }) |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 获取警车列表,生成下拉数据 |
| | | getCarList () { |
| | | getCarList().then(res => { |
| | | res.data.data.forEach(item => { |
| | | this.policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}` }) |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 修改活动警车 |
| | | updateActivityCar (id, carId) { |
| | | updateActivityCar(id, carId).then(res => { |
| | | this.getSecurityCarList(this.showingSecurityId) |
| | | }) |
| | | }, |
| | | |
| | | // 活动添加警车和范围 |
| | | addCarAndRange (carId, position, securityId, type) { |
| | | addCarAndRange(carId, position, securityId, type).then(res => { |
| | | console.log(res, 2323) |
| | | this.getSecurityCarList(securityId) |
| | | }) |
| | | }, |
| | | |
| | |
| | | // 活动添加警员 |
| | | addActivityPolice (policemanId, position, securityId, type) { |
| | | addActivityPolice(policemanId, position, securityId, type).then(res => { |
| | | console.log(res, 3333) |
| | | this.getSecurityPoliceList(securityId) |
| | | }) |
| | | }, |
| | | |
| | | // 转换 点 坐标数据 |
| | | convertBillboardPositionDate (data, iconName, plotId, policemanId) { |
| | | convertBillboardPositionDate (data, iconName, plotId, policeId) { |
| | | let positionStr = data |
| | | positionStr = data.slice(6, positionStr.length - 1) |
| | | let positionArr = positionStr.split(" ") |
| | | let positionObj = {} |
| | | if (iconName == 'activity') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/icon/activity.png' } |
| | | } else { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/policeIcon.png', id: plotId, policemanId: policemanId } |
| | | } else if (iconName == 'policeman') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/policeIcon.png', id: plotId, policemanId: policeId } |
| | | } else if (iconName == 'policecar') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/policeCar.png', id: plotId, carId: policeId } |
| | | } |
| | | return positionObj |
| | | }, |
| | |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.getSecurityPoliceList(item.id) |
| | | this.getSecurityCarList(item.id) |
| | | if (this.currentClickIndex !== '' && this.currentClickIndex == index) { |
| | | return |
| | | } |
| | |
| | | if (poltType == 'billboard' && policeType == 'policeman') { |
| | | overlay.icon = '/img/policeIcon.png' |
| | | } else if (poltType == 'billboard' && policeType == 'policecar') { |
| | | overlay.icon = '/img/policeCar.png' |
| | | overlay.icon = '/img/policeCar.jfif' |
| | | } |
| | | |
| | | if (overlay) { |
| | |
| | | flag = true |
| | | overlay.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick) |
| | | overlay.drawType = poltType |
| | | overlay.policeType = policeType |
| | | this.overlayObj = overlay |
| | | document.oncontextmenu = function () { |
| | | if (flag == true) { |
| | | if (policeType == 'policeman') { |
| | | that.policeChooseTitle = '选择警员' |
| | | that.policeOption = that.policemanOption |
| | | } else if (policeType == 'policecar') { |
| | | that.policeChooseTitle = '选择警车' |
| | | that.policeOption = that.policecarOption |
| | | } |
| | | that.policeChooseVisible = true |
| | | flag = false |
| | | } |
| | |
| | | position += this.overlayObj._positions[0]._lng + ' ' + this.overlayObj._positions[0]._lat + ',' |
| | | position = position.slice(0, position.length - 1) |
| | | } |
| | | |
| | | this.addActivityPolice(this.policeType, position, this.showingSecurityId, type) |
| | | if (this.overlayObj.policeType == 'policeman') { |
| | | this.addActivityPolice(this.policeType, position, this.showingSecurityId, type) |
| | | } else if (this.overlayObj.policeType == 'policecar') { |
| | | this.addCarAndRange(this.policeType, position, this.showingSecurityId, type) |
| | | } |
| | | this.policeChooseVisible = false |
| | | this.policeIconIsCreated = false |
| | | } else { |
| | | this.updateActivityPolice(this.policeIconId, this.policeType) |
| | | if (this.policeChooseTitle == '选择警员') { |
| | | this.updateActivityPolice(this.policeIconId, this.policeType) |
| | | } else if (this.policeChooseTitle == '选择警车') { |
| | | this.updateActivityCar(this.policeIconId, this.policeType) |
| | | } |
| | | this.policeChooseVisible = false |
| | | this.policeIconIsCreated = false |
| | | } |
| | |
| | | |
| | | // 地图绘制元素点击事件 |
| | | overlayTypeClick (e) { |
| | | // console.log('点击了元素', e.overlay.attrParams) |
| | | this.policeIconIsCreated = true |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.policemanId |
| | | if ('policemanId' in e.overlay.attrParams) { |
| | | this.policeChooseTitle = '选择警员' |
| | | this.policeOption = this.policemanOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.policemanId |
| | | } else if ('carId' in e.overlay.attrParams) { |
| | | this.policeChooseTitle = '选择警车' |
| | | this.policeOption = this.policecarOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.carId |
| | | } |
| | | this.policeChooseVisible = true |
| | | } |
| | | }, |
| | |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | analyseLayer.clear() |
| | | |