| | |
| | | <div> |
| | | <div class="category">活动类型:</div> |
| | | <div class="category-value"> |
| | | <el-select size="small" v-model="activityType" placeholder="请选择"> |
| | | <el-select |
| | | size="small" |
| | | v-model="activityType" |
| | | placeholder="请选择" |
| | | @change="activityTypeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in activityOptions" |
| | | :key="item.value" |
| | |
| | | <div class="category">活动名称:</div> |
| | | <div class="category-value"> |
| | | <input type="text" placeholder="请输入搜索条件" v-model="searchActivity" /> |
| | | <button class="el-icon-search"></button> |
| | | <button class="el-icon-search" @click="searchClick"></button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div class="category">选择时间:</div> |
| | | <div class="category-value"> |
| | | <el-date-picker |
| | | <!-- <el-date-picker |
| | | size="small" |
| | | v-model="selectTime" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | style="width:268px" |
| | | ></el-date-picker>--> |
| | | <el-date-picker |
| | | v-model="selectTime" |
| | | type="daterange" |
| | | align="right" |
| | | unlink-panels |
| | | format="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :picker-options="pickerOptions" |
| | | style="width:268px" |
| | | @change="activityTimeChange" |
| | | ></el-date-picker> |
| | | </div> |
| | | </div> |
| | |
| | | <div> |
| | | <div class="category">活动名称:</div> |
| | | <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="draw-btn-box" v-show="dialogVisible"> |
| | | <ul> |
| | | <!-- <li> |
| | | <button @click="draw('point')">点</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('billboard')">图标点</button> |
| | | </li>--> |
| | | <li> |
| | | <button @click="draw('billboard','policeman')">警员</button> |
| | | </li> |
| | |
| | | <li> |
| | | <button @click="draw('polygon','policecar')">警车范围</button> |
| | | </li> |
| | | <!-- <li> |
| | | <button @click="draw('circle')">圆</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('rectangle')">矩形</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('attack_arrow')">进攻箭头</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('double_arrow')">双箭头</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('fine_arrow')">直箭头</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('tailed_attack_arrow')">燕尾箭头</button> |
| | | </li> |
| | | <li> |
| | | <button @click="draw('gathering_place')">聚集地</button> |
| | | </li> |
| | | <li> |
| | | <button @click="removeAll()">清除</button> |
| | | </li>--> |
| | | </ul> |
| | | </div> |
| | | |
| | |
| | | </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 |
| | |
| | | data () { |
| | | return { |
| | | activityOptions: [{ |
| | | value: '选项1', |
| | | label: '黄金糕' |
| | | value: '1', |
| | | label: '教育活动' |
| | | }, { |
| | | value: '选项2', |
| | | label: '双皮奶' |
| | | value: '2', |
| | | label: '科技活动' |
| | | }, { |
| | | value: '选项3', |
| | | label: '蚵仔煎' |
| | | value: '3', |
| | | label: '公益活动' |
| | | }, { |
| | | value: '选项4', |
| | | label: '龙须面' |
| | | value: '4', |
| | | label: '组织活动' |
| | | }, { |
| | | value: '选项5', |
| | | label: '北京烤鸭' |
| | | value: '5', |
| | | 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 () { |
| | | |
| | |
| | | }) |
| | | }, |
| | | |
| | | updated () { }, |
| | | updated () { |
| | | }, |
| | | |
| | | methods: { |
| | | // 生成热力图坐标 |
| | |
| | | list.push(new global.DC.Position(lng, lat)) |
| | | } |
| | | return list |
| | | }, |
| | | |
| | | // 点击搜索 |
| | | searchClick () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | // 下拉选择值变化 |
| | | activityTypeChange () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | // 时间选中值触发 |
| | | activityTimeChange () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | // 获取活动警员分布信息 |
| | |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.RED, |
| | | material: global.DC.Color.ORANGE.withAlpha(0.6), |
| | | width: 4, |
| | | params: { |
| | | id: item.id, |
| | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.RED, |
| | | material: global.DC.Color.ORANGE.withAlpha(0.6), |
| | | 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: 8, |
| | | 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 () { |
| | | getSecurityList().then(res => { |
| | | this.activityList = res.data.data |
| | | getSecurityList (type, name, startTime, endTime) { |
| | | getSecurityList(type, name, startTime, endTime).then(res => { |
| | | this.activityList = res.data.data.records |
| | | 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/icon/police.png', id: plotId, policemanId: policeId } |
| | | } else if (iconName == 'policecar') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 100, url: '/img/icon/car.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 |
| | | } |
| | | }, |
| | |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | |
| | | .row-box { |
| | | margin: 10px; |
| | | padding: 10px; |
| | | background: rgba(29, 38, 105, 1); |
| | | background: rgba(25, 23, 99, 0.7); |
| | | cursor: pointer; |
| | | font-size: 14px; |
| | | |
| | |
| | | } |
| | | |
| | | .row-box:hover { |
| | | background-color: $table-header-bg-color; |
| | | // background-color: $table-header-bg-color; |
| | | background-color: rgba(0, 0, 138, 0.8); |
| | | } |
| | | |
| | | .row-box.on { |
| | | background: $table-header-bg-color; |
| | | // background: $table-header-bg-color; |
| | | background-color: rgba(0, 0, 138, 0.8); |
| | | } |
| | | |
| | | :deep(.el-dialog) { |