| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 16:18:17 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-07 10:35:40 |
| | | * @LastEditTime: 2023-03-07 16:42:58 |
| | | * @FilePath: \srs-police-affairs\src\views\activity\index.vue |
| | | * @Description: 安保活 |
| | | * |
| | |
| | | <div class="category-value"> |
| | | <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" |
| | | @change="activityTimeChange"></el-date-picker> |
| | | start-placeholder="开始日期" end-placeholder="结束日期" @change="activityTimeChange"></el-date-picker> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog :title="policeChooseCarTitle" :modal="false" :visible.sync="policeChooseCarVisible" |
| | | <el-dialog title="选择警车" :modal="false" :visible.sync="policeChooseCarVisible" |
| | | :before-close="policeChooseCarBeforeClose" :close-on-click-modal="true" class="choose-policeCar-box"> |
| | | <div> |
| | | <el-select size="small" v-model="policeType" placeholder="请选择" :disabled="isChoosePoliceElementDisabled"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :title="policeChooseTitle" :modal="false" :visible.sync="policeChooseVisible" |
| | | :before-close="policeChooseBeforeClose" :close-on-click-modal="true" class="choose-police-box"> |
| | | <el-dialog title="选择警员" :modal="false" :visible.sync="policeChooseVisible" :before-close="policeChooseBeforeClose" |
| | | :close-on-click-modal="true" class="choose-police-box"> |
| | | <div> |
| | | <el-input ref="searchTreeInput" v-model="searchPoliceTreeName" @input="searchInputTree" |
| | | @focus="searchTreeShowFlag = true" @blur="searchTreeShowFlag = false" placeholder="请选择警员" |
| | |
| | | |
| | | let loading = null |
| | | |
| | | let overlayObj = {} |
| | | let lineObjdata = null |
| | | let plotOverlayData = null |
| | | let policecarOption = [] |
| | | |
| | | |
| | | export default { |
| | | inject: ['userInfo'], |
| | | |
| | | data () { |
| | | return { |
| | | boxShow: true, |
| | | selectTime: '', |
| | | searchActivity: '', |
| | | isShowActivityClearBtn: false, |
| | | currentPage: 1, |
| | | pagesize: 4, |
| | | pagesCount: 1, |
| | | activityList: [], |
| | | currentClickIndex: '', |
| | | |
| | | |
| | | activityOptions: [ |
| | | { |
| | | dictKey: '', |
| | |
| | | ], |
| | | policeOption: [], |
| | | policemanOption: [], |
| | | policecarOption: [], |
| | | activityType: '', |
| | | policeType: '', |
| | | searchActivity: '', |
| | | selectTime: '', |
| | | navType: 0, |
| | | treeData: [{ |
| | | id: 1, |
| | | label: '数据地图', |
| | |
| | | label: 'label' |
| | | }, |
| | | dialogVisible: false, |
| | | currentClickIndex: '', |
| | | policeSwitch: true, |
| | | arrowBtnSwitch: true, |
| | | polylineBtnSwitch: false, |
| | | activityList: [], |
| | | activityDetails: {}, |
| | | boxShow: true, |
| | | policeChooseTitle: '选择警员', |
| | | policeChooseCarTitle: '选择警车', |
| | | policeChooseVisible: false, |
| | | policeChooseCarVisible: false, |
| | | overlayObj: {}, |
| | | isTrackBtnShow: false, |
| | | |
| | | showingSecurityId: '', |
| | | policeIconIsCreated: false, |
| | | policeIconId: {}, |
| | |
| | | |
| | | isHavePoliceCar: false, |
| | | isHavePoliceMan: false, |
| | | |
| | | isHaveArrow: false, |
| | | isHaveLine: false, |
| | | //当前登录用户的数据 |
| | | userInfo: {}, |
| | | |
| | | isShowActivityClearBtn: false, |
| | | |
| | | lineEditVisible: false, |
| | | lineEditTitle: '修改巡逻路线', |
| | |
| | | isShowActivityEditBox: false, |
| | | editPlotVisible: false, |
| | | plotId: '', |
| | | polygonPosition: '', |
| | | cameraList: [], |
| | | policeTreeData: [], |
| | | policeDefaultProps: { |
| | |
| | | searchPoliceTreeName: '', |
| | | searchPoliceTreeId: '', |
| | | searchTreeShowFlag: false, |
| | | plotOverlayData: null, |
| | | lineObjdata: null, |
| | | |
| | | |
| | | isNeedName: false, |
| | | plotSaveType: 1, |
| | | arrowPositionSre: '', |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // 时间选中值触发 |
| | | activityTimeChange () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.currentPage, this.pagesize, this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | // 获取活动列表 |
| | | getSecurityList (current, size, type, name, startTime, endTime) { |
| | | this.loading() |
| | | var deptId = "" |
| | | if (this.userInfo.dept_id != '1123598813738675201') { |
| | | deptId = this.userInfo.dept_id |
| | | } |
| | | |
| | | getSecurityList(current, size, type, name, startTime, endTime, deptId).then(res => { |
| | | this.activityList = res.data.data.records.map(item => { |
| | | item.startTime = item.startTime.substring(0, 16) |
| | | item.endTime = item.endTime.substring(0, 16) |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.pagesCount = res.data.data.pages |
| | | |
| | | this.addActivityPoint() |
| | | |
| | | loading.close() |
| | | }) |
| | | }, |
| | | |
| | | // 添加活动图标 |
| | | addActivityPoint () { |
| | | this.activityList.forEach(item => { |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'activityLayers', |
| | | type: "billboard", |
| | | params: positionObj, |
| | | incident: this.houseSiteClick |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | inputChange (e) { |
| | | if (this.searchActivity == '') { |
| | | this.isShowActivityClearBtn = false |
| | | } else { |
| | | this.isShowActivityClearBtn = true |
| | | } |
| | | }, |
| | | |
| | | clearActivitySearchValue () { |
| | | this.searchActivity = '' |
| | | this.inputChange() |
| | | this.searchClick() |
| | | }, |
| | | |
| | | // 点击搜索 |
| | | searchClick () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.currentPage, this.pagesize, this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | /** |
| | | * @description: 点击活动列表活动 |
| | | * @param {*} item |
| | | * @param {*} index |
| | | * @return {*} |
| | | */ |
| | | activityListClick (item, index) { |
| | | if (this.currentClickIndex !== '' && this.currentClickIndex == index) { |
| | | return |
| | | } |
| | | |
| | | this.policeSwitch = true |
| | | this.arrowBtnSwitch = true |
| | | this.polylineBtnSwitch = false |
| | | |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | this.$refs.DRAWBTNBOX.removeDrawArrow() |
| | | |
| | | arrowsListLayer != null && arrowsListLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'polygonLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.showingSecurityId = item.id |
| | | |
| | | // 加载当前活动面 |
| | | if (item.activityArea && item.activityArea.length > 0) { |
| | | let polyGonData = item.activityArea.slice(11, item.activityArea.length - 1) |
| | | polyGonData = polyGonData.replace(/,/g, ";") |
| | | polyGonData = polyGonData.replace(/ /g, ",") |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'polygonLayer', |
| | | positions: polyGonData, |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes(139, 195, 74, 100) |
| | | }) |
| | | } |
| | | |
| | | // 警力资源 |
| | | this.getSecurityPoliceList(item.id, this.policeSwitch) |
| | | this.getSecurityCarList(item.id, this.policeSwitch, this.polylineBtnSwitch) |
| | | // 作战标绘 |
| | | this.getSecurityPlotList(item.id, this.arrowBtnSwitch) |
| | | |
| | | this.activityDetails = item |
| | | |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == item.deptId) { |
| | | this.isShowActivityEditBox = true |
| | | } else { |
| | | this.isShowActivityEditBox = false |
| | | } |
| | | this.activityDeptId = item.deptId |
| | | |
| | | this.currentClickIndex = index |
| | | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: positionObj.lng, |
| | | siteWd: positionObj.lat, |
| | | siteGd: 1500 |
| | | }) |
| | | |
| | | this.dialogVisible = true |
| | | }, |
| | | |
| | | // 分页页码变化事件 |
| | | handleCurrentChange: function (currentPage) { |
| | | this.currentPage = currentPage |
| | | this.currentClickIndex = '' |
| | | this.getSecurityList(this.currentPage, this.pagesize) |
| | | }, |
| | | |
| | | |
| | | // 切换轨警力资源显示 |
| | | switchChange (e) { |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, 'car') |
| | | this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }, |
| | | |
| | | // 切换作战标绘 |
| | | switchArrowBtnChange (e) { |
| | | this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch) |
| | | }, |
| | | |
| | | // 切换轨迹播放控件 |
| | | switchBtnChange (e) { |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, 'line') |
| | | }, |
| | | |
| | | // 获取活动标绘箭头列表 |
| | | getSecurityPlotList (securityId, arrowShow) { |
| | | arrowsListLayer.clear() |
| | | this.$refs.DRAWBTNBOX.removeDrawArrow() |
| | | |
| | | if (!arrowShow) return |
| | | getSecurityPlotList(securityId).then(res => { |
| | | this.isHaveArrow = res.data.data.some(item => { |
| | | return item |
| | | }) |
| | | let plotList = res.data.data |
| | | res.data.data.forEach(item => { |
| | | let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let chooseArrow = null |
| | | // let nameLabel = null |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 69, 0, 173) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | let a = Math.floor(Number(item.color.split(',')[1]) * 2.55) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | } |
| | | if (item.type == 1) { |
| | | chooseArrow = new global.DC.AttackArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 2) { |
| | | chooseArrow = new global.DC.DoubleArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 3) { |
| | | chooseArrow = new global.DC.FineArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 4) { |
| | | chooseArrow = new global.DC.TailedAttackArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 5) { |
| | | chooseArrow = new global.DC.Polygon(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | // 缓存区的话需要扣去包含的核心区 |
| | | if (item.areaType == 2) { |
| | | let itemPositionArr = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',').split(';') |
| | | itemPositionArr.push(itemPositionArr[0]) |
| | | itemPositionArr = itemPositionArr.map(item => { |
| | | return item.split(',').map(Number) |
| | | }) |
| | | let cachePolygon = this.$turf.polygon([itemPositionArr]) |
| | | plotList.forEach(inItem => { |
| | | // 查询被包含的核心区 |
| | | if (inItem.areaType == 1 && inItem.type == 5) { |
| | | let inItemPositionArr = inItem.position.slice(11, inItem.position.length - 1).replace(/,/g, ';').replace(/ /g, ',').split(';') |
| | | inItemPositionArr.push(inItemPositionArr[0]) |
| | | inItemPositionArr = inItemPositionArr.map(item => { |
| | | return item.split(',').map(Number) |
| | | }) |
| | | let carePolygon = this.$turf.polygon([inItemPositionArr]) |
| | | let isContains = this.$turf.booleanContains(cachePolygon, carePolygon) |
| | | // 如果完全包含就作为洞面扣去 |
| | | if (isContains) { |
| | | chooseArrow.holes = [inItem.position.slice(11, inItem.position.length - 1).replace(/,/g, ';').replace(/ /g, ',')] |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | // let center = this.getCenter(item.position) |
| | | // let centerPosition = new global.DC.Position(center[0], center[1]) |
| | | // nameLabel = new global.DC.Label(centerPosition, item.name) |
| | | // arrowsListLayer.addOverlay(nameLabel) |
| | | // nameLabel.setStyle({ |
| | | // "font": "30px", |
| | | // }) |
| | | } else if (item.type == 6) { |
| | | let iconImgName = '' |
| | | if (item.type == 6) { |
| | | iconImgName = 'icon1' |
| | | } |
| | | position = position.split(';')[0].split(',') |
| | | position = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | chooseArrow = new global.DC.Billboard(position, `/img/icon/${iconImgName}.png`) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | | }) |
| | | chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | // let point = new global.DC.Point(pointPosition) |
| | | // arrowsListLayer.addOverlay(point) |
| | | // point.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | // point.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | // point.setStyle({ |
| | | // "color": color, //颜色 |
| | | // "outlineColor": color, //边框颜色 |
| | | // "outlineWidth": 0, //边框大小, |
| | | // "pixelSize": 32, |
| | | // }) |
| | | } |
| | | |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | | }) |
| | | chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | |
| | | // let position1 = new global.DC.Position(117.94218262137659, 28.434842894894153) |
| | | // let Label = new global.DC.Label(position1, 'test') |
| | | // Label.on(global.DC.MouseEventType.LEFT_DOWN, this.reeditArrowLeftDown) |
| | | // Label.on(global.DC.MouseEventType.LEFT_UP, this.reeditArrowLeftUp) |
| | | // // Label.on(global.DC.MouseEventType.MOUSE_MOVE, this.reeditArrowMouseMove) |
| | | // arrowsListLayer.addOverlay(Label) |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 获取活动警员分布信息 |
| | | getSecurityPoliceList (securityId, pointShow) { |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | if (pointCircleCarLayer != null) { |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | |
| | | if (pointShow == false) return |
| | | |
| | | getSecurityPoliceList(securityId).then(res => { |
| | | this.isHavePoliceMan = res.data.data.some(item => { |
| | | return item.type == 3 |
| | | }) |
| | | |
| | | this.addMapCarAndPersonLayers( |
| | | res.data.data.filter(item => item.type == 3), |
| | | 'policeman', |
| | | pointCircleCarLayer, |
| | | 'newDrawLayers') |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * @description: 警力资源警车和巡逻路线的 |
| | | * @param {*} securityId |
| | | * @param {*} pointShow |
| | | * @param {*} polylineShow |
| | | * @return {*} |
| | | */ |
| | | getSecurityCarList (securityId, pointShow, polylineShow, type = 'all') { |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | |
| | | if (type == 'car') { |
| | | pointCircleManLayer != null && pointCircleManLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | } else if (type == 'line') { |
| | | lineLayer != null && lineLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | } else { |
| | | pointCircleManLayer != null && pointCircleManLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | lineLayer != null && lineLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | } |
| | | |
| | | getSecurityCarList(securityId).then(res => { |
| | | this.isHavePoliceCar = res.data.data.some(item => { |
| | | return item.type == 3 |
| | | }) |
| | | |
| | | this.isHaveLine = res.data.data.some(item => { |
| | | return item.type == 1 |
| | | }) |
| | | console.log(type, pointShow, res.data.data.filter(item => item.type == 3)) |
| | | |
| | | type == 'car' && pointShow && this.addMapCarAndPersonLayers( |
| | | res.data.data.filter(item => item.type == 3), |
| | | 'policecar', |
| | | pointCircleManLayer, |
| | | 'newCarDrawLayers') |
| | | type == 'line' && polylineShow && this.addMapLineLayers(res.data.data.filter(item => item.type == 1)) |
| | | if (type == 'all') { |
| | | pointShow && this.addMapCarAndPersonLayers( |
| | | res.data.data.filter(item => item.type == 3), |
| | | 'policecar', |
| | | pointCircleManLayer, |
| | | 'newCarDrawLayers') |
| | | polylineShow && this.addMapLineLayers(res.data.data.filter(item => item.type == 1)) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * @description: 警力资源地图添加 |
| | | * @param {*} data |
| | | * @param {*} type |
| | | * @param {*} curLayer |
| | | * @param {*} mapLayer |
| | | * @return {*} |
| | | */ |
| | | addMapCarAndPersonLayers (data, type, curLayer, mapLayer) { |
| | | data.forEach(item => { |
| | | let positionObj = this.convertBillboardPositionDate(item, type) |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | point.attrParams = positionObj |
| | | curLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | point.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.pointMouseOut) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: mapLayer, |
| | | type: 'billboard', |
| | | params: positionObj, |
| | | incident: this.overlayTypeClick, |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * @description: 巡逻路线地图添加 |
| | | * @param {*} data |
| | | * @return {*} |
| | | */ |
| | | addMapLineLayers (data) { |
| | | data.forEach(item => { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | // 线坐标字符串 |
| | | item.linePositionStr = positionNewArr |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionNewArr, item.width != -1 ? item.width : 100) |
| | | let color = '' |
| | | let lineColor = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | |
| | | let positionStr = '' |
| | | coords.forEach(item => { |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | }) |
| | | |
| | | item.polygonPositionStr = positionStr |
| | | |
| | | let lineObj = new global.DC.Polyline(positionNewArr) |
| | | lineLayer.addOverlay(lineObj) |
| | | lineObj.setStyle({ |
| | | 'material': lineColor, |
| | | 'width': 3 |
| | | }) |
| | | item.lineObj = lineObj |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: positionStr, |
| | | material: color, |
| | | params: item, |
| | | incident: this.lineOverlayTypeClick |
| | | }) |
| | | |
| | | }) |
| | | }, |
| | | |
| | | lookStartVideo () { |
| | | this.$refs.VIDEOCONTROLBOX.watchVideo() |
| | | }, |
| | |
| | | event.preventDefault() |
| | | }, |
| | | |
| | | inputChange (e) { |
| | | if (this.searchActivity == '') { |
| | | this.isShowActivityClearBtn = false |
| | | } else { |
| | | this.isShowActivityClearBtn = true |
| | | } |
| | | }, |
| | | |
| | | // 点击搜索 |
| | | searchClick () { |
| | | let startTime = '' |
| | | let endTime = '' |
| | | if (this.selectTime) { |
| | | startTime = this.selectTime[0] |
| | | endTime = this.selectTime[1] |
| | | } |
| | | this.getSecurityList(this.currentPage, this.pagesize, this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | |
| | | |
| | | // 下拉选择值变化 |
| | | activityTypeChange () { |
| | |
| | | this.getSecurityList(this.currentPage, this.pagesize, 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.currentPage, this.pagesize, this.activityType, this.searchActivity, startTime, endTime) |
| | | }, |
| | | |
| | | // 获取活动警员分布信息 |
| | | getSecurityPoliceList (securityId, pointShow) { |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if (pointCircleCarLayer != null) { |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | getSecurityPoliceList(securityId).then(res => { |
| | | this.isHavePoliceMan = res.data.data.some(item => { |
| | | return item.type == 3 |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | if (item.type == 1) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | this.$EventBus.$emit('layerPolylineAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.ORANGE.withAlpha(0.6), |
| | | width: 4, |
| | | params: { |
| | | id: item.id, |
| | | policemanId: item.policemanId |
| | | }, |
| | | // incident: this.overlayTypeClick |
| | | }) |
| | | } else if (item.type == 2) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newDrawLayers', |
| | | positions: positionNewArr, |
| | | material: global.DC.Color.ORANGE.withAlpha(0.6), |
| | | params: { |
| | | id: item.id, |
| | | policemanId: item.policemanId |
| | | }, |
| | | // incident: this.overlayTypeClick |
| | | }) |
| | | |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item, 'policeman') |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | point.attrParams = positionObj |
| | | pointCircleCarLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | point.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.pointMouseOut) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'billboard', |
| | | params: positionObj, |
| | | incident: this.overlayTypeClick, |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 扁平化树状数据 |
| | | platFn (list) { |
| | |
| | | return null |
| | | }).filter(o => o instanceof Array && o.length > 0)) |
| | | return res |
| | | }, |
| | | |
| | | // 获取活动警车分布信息 |
| | | getSecurityCarList (securityId, pointShow, polylineShow) { |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | if (polylineAreaLayer != null) { |
| | | polylineAreaLayer.clear() |
| | | } |
| | | if (lineLayer != null) { |
| | | lineLayer.clear() |
| | | } |
| | | if (pointCircleManLayer != null) { |
| | | pointCircleManLayer.clear() |
| | | } |
| | | |
| | | getSecurityCarList(securityId).then(res => { |
| | | this.isHavePoliceCar = res.data.data.some(item => { |
| | | return item.type == 3 |
| | | }) |
| | | this.isHaveLine = res.data.data.some(item => { |
| | | return item.type == 1 |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | if (item.type == 1 && polylineShow) { |
| | | let positionNewArr = this.convertPolylineOrPolygonPositionDate(item.position, item.type) |
| | | // 线坐标字符串 |
| | | item.linePositionStr = positionNewArr |
| | | let coords = global.DC.GeoTools.polylineBuffer(positionNewArr, item.width != -1 ? item.width : 100) |
| | | let polygon = new global.DC.Polygon(coords) |
| | | let color = '' |
| | | let lineColor = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | let position = '' |
| | | // 面坐标字符串 |
| | | polygon._positions.forEach(item => { |
| | | position += item._lng + ',' + item._lat + ';' |
| | | }) |
| | | item.polygonPositionStr = position |
| | | |
| | | // polylineAreaLayer.show = false |
| | | let positionStr = '' |
| | | coords.forEach(item => { |
| | | positionStr += item[0] + ',' + item[1] + ';' |
| | | }) |
| | | let lineObj = new global.DC.Polyline(positionNewArr) |
| | | lineLayer.addOverlay(lineObj) |
| | | lineObj.setStyle({ |
| | | 'material': lineColor, |
| | | 'width': 3 |
| | | }) |
| | | item.lineObj = lineObj |
| | | // this.$EventBus.$emit('layerPolylineAdd', { |
| | | // layerName: 'newCarDrawLayers', |
| | | // positions: positionNewArr, |
| | | // material: global.DC.Color.RED.withAlpha(0.8), |
| | | // width: 3, |
| | | // params: item, |
| | | // }) |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'newCarDrawLineLayers', |
| | | positions: position, |
| | | material: color, |
| | | params: item, |
| | | incident: this.lineOverlayTypeClick |
| | | }) |
| | | } 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 |
| | | }, |
| | | }) |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item, 'policecar') |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255) |
| | | } |
| | | point.attrParams = positionObj |
| | | pointCircleManLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | | "outlineColor": color, //边框颜色 |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | point.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick) |
| | | point.on(global.DC.MouseEventType.MOUSE_OVER, this.pointMouseOver) |
| | | point.on(global.DC.MouseEventType.MOUSE_OUT, this.pointMouseOut) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'billboard', |
| | | params: positionObj, |
| | | incident: this.overlayTypeClick, |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 获取活动列表 |
| | | getSecurityList (current, size, type, name, startTime, endTime) { |
| | | this.loading() |
| | | var deptId = "" |
| | | if (this.userInfo.dept_id != '1123598813738675201') { |
| | | deptId = this.userInfo.dept_id |
| | | } |
| | | |
| | | getSecurityList(current, size, type, name, startTime, endTime, deptId).then(res => { |
| | | this.activityList = res.data.data.records.map(item => { |
| | | item.startTime = item.startTime.substring(0, 16) |
| | | item.endTime = item.endTime.substring(0, 16) |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.pagesCount = res.data.data.pages |
| | | |
| | | this.addActivityPoint() |
| | | |
| | | loading.close() |
| | | }) |
| | | }, |
| | | |
| | | // 获取警员列表,生成下拉数据 |
| | |
| | | getCarList () { |
| | | getCarList().then(res => { |
| | | res.data.data.forEach(item => { |
| | | this.policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}`, carType: `${item.carType}` }) |
| | | policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}`, carType: `${item.carType}` }) |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | type: 'error' |
| | | }) |
| | | } |
| | | this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch, params.type == 1 ? 'line' : 'car') |
| | | }) |
| | | }, |
| | | |
| | | // 添加活动图标 |
| | | addActivityPoint () { |
| | | this.activityList.forEach(item => { |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'activityLayers', |
| | | type: "billboard", |
| | | params: positionObj, |
| | | incident: this.houseSiteClick |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 活动添加警员 |
| | | // policemanId警车id, position坐标, securityId活动id, type线面类型 |
| | |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * @description: 点击活动列表活动 |
| | | * @param {*} item |
| | | * @param {*} index |
| | | * @return {*} |
| | | */ |
| | | activityListClick (item, index) { |
| | | if (this.currentClickIndex !== '' && this.currentClickIndex == index) { |
| | | return |
| | | } |
| | | |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | this.$refs.DRAWBTNBOX.removeDrawArrow() |
| | | arrowsListLayer != null && arrowsListLayer.clear() |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'polygonLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'monitoringLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'polylineLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.showingSecurityId = item.id |
| | | |
| | | // 加载当前活动面 |
| | | if (item.activityArea && item.activityArea.length > 0) { |
| | | let polyGonData = item.activityArea.slice(11, item.activityArea.length - 1) |
| | | polyGonData = polyGonData.replace(/,/g, ";") |
| | | polyGonData = polyGonData.replace(/ /g, ",") |
| | | |
| | | this.$EventBus.$emit('layerPolygonAdd', { |
| | | layerName: 'polygonLayer', |
| | | positions: polyGonData, |
| | | material: global.DC.Namespace.Cesium.Color.fromBytes(139, 195, 74, 100) |
| | | }) |
| | | } |
| | | |
| | | // 警力资源 |
| | | this.getSecurityPoliceList(item.id, this.policeSwitch) |
| | | // 作战标绘 |
| | | this.getSecurityPlotList(item.id, this.arrowBtnSwitch) |
| | | // 巡逻路线 |
| | | this.getSecurityCarList(item.id, this.policeSwitch, this.polylineBtnSwitch) |
| | | |
| | | this.activityDetails = item |
| | | |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == item.deptId) { |
| | | this.isShowActivityEditBox = true |
| | | } else { |
| | | this.isShowActivityEditBox = false |
| | | } |
| | | this.activityDeptId = item.deptId |
| | | |
| | | this.currentClickIndex = index |
| | | |
| | | this.$EventBus.$emit('toPosition', { |
| | | siteJd: positionObj.lng, |
| | | siteWd: positionObj.lat, |
| | | siteGd: 1500 |
| | | }) |
| | | |
| | | this.dialogVisible = true |
| | | }, |
| | | |
| | | // 切换轨警力资源显示 |
| | | switchChange (e) { |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch) |
| | | }, |
| | | |
| | | // 切换作战标绘 |
| | | switchArrowBtnChange (e) { |
| | | this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch) |
| | | }, |
| | | |
| | | // 切换轨迹播放控件 |
| | | switchBtnChange (e) { |
| | | this.isTrackBtnShow = e |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | }, |
| | | |
| | | // 分页页码变化事件 |
| | | handleCurrentChange: function (currentPage) { |
| | | this.currentPage = currentPage |
| | | this.currentClickIndex = -1 |
| | | this.getSecurityList(this.currentPage, this.pagesize) |
| | | }, |
| | | |
| | | // 关闭活动详情弹窗 |
| | | closeActivityDetails () { |
| | | this.dialogVisible = false |
| | | this.polylineBtnSwitch = false |
| | | this.isTrackBtnShow = false |
| | | this.closeVideo() |
| | | this.currentClickIndex = '' |
| | | arrowsListLayer.clear() |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'polylineLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'VectorLayer' |
| | |
| | | this.policeIconIsCreated = false |
| | | this.policeChooseVisible = false |
| | | this.policeChooseCarVisible = false |
| | | this.overlayObj2 = {} |
| | | overlayObj = {} |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | }, |
| | | |
| | |
| | | if (!this.policeIconIsCreated) { |
| | | let type = '' |
| | | let position = '' |
| | | if (this.overlayObj.drawType == 'billboard') { |
| | | if (overlayObj.drawType == 'billboard') { |
| | | type = 3 |
| | | position = this.overlayObj._position._lng + ' ' + this.overlayObj._position._lat |
| | | } else if (this.overlayObj.drawType == 'polyline') { |
| | | position = overlayObj._position._lng + ' ' + overlayObj._position._lat |
| | | } else if (overlayObj.drawType == 'polyline') { |
| | | type = 1 |
| | | this.overlayObj._positions.forEach(item => { |
| | | overlayObj._positions.forEach(item => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position = position.slice(0, position.length - 1) |
| | | } else if (this.overlayObj.drawType == 'polygon') { |
| | | } else if (overlayObj.drawType == 'polygon') { |
| | | type = 2 |
| | | this.overlayObj._positions.forEach(item => { |
| | | overlayObj._positions.forEach(item => { |
| | | position += item._lng + ' ' + item._lat + ',' |
| | | }) |
| | | position += this.overlayObj._positions[0]._lng + ' ' + this.overlayObj._positions[0]._lat + ',' |
| | | position += overlayObj._positions[0]._lng + ' ' + overlayObj._positions[0]._lat + ',' |
| | | position = position.slice(0, position.length - 1) |
| | | } |
| | | if (this.policeChooseCarVisible == true) { |
| | |
| | | }) |
| | | } else { |
| | | this.policeChooseCarVisible = false |
| | | this.addCarAndRange({ carId: this.policeType, position: position, securityId: this.showingSecurityId, type: type, color: this.chooseCarColor }) |
| | | this.addCarAndRange({ |
| | | carId: this.policeType, |
| | | position: position, |
| | | securityId: this.showingSecurityId, |
| | | type: type, |
| | | color: this.chooseCarColor |
| | | }) |
| | | this.policeIconIsCreated = false |
| | | } |
| | | |
| | |
| | | this.policeIconIsCreated = true |
| | | this.policeChooseVisible = true |
| | | } else if ('carId' in e.overlay.attrParams.data) { |
| | | this.policeOption = this.policecarOption |
| | | this.policeOption = policecarOption |
| | | this.policeIconId = e.overlay.attrParams.data.id |
| | | this.policeType = e.overlay.attrParams.data.carId |
| | | this.chooseCarColor = e.overlay.attrParams.data.color != '' ? e.overlay.attrParams.data.color : '#FF0000' |
| | |
| | | this.$refs.VIDEOCONTROLBOX.closeVideo() |
| | | |
| | | this.lineWidth = e.overlay.attrParams.width != -1 ? e.overlay.attrParams.width : 100 |
| | | |
| | | this.chooseColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#1CA085' |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.linePosition = e.overlay.attrParams.linePositionStr |
| | | this.lineObjdata = e.overlay.attrParams.lineObj |
| | | this.polygonPosition = e.overlay.attrParams.polygonPositionStr |
| | | |
| | | lineObjdata = e.overlay.attrParams.lineObj |
| | | |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) { |
| | | this.lineEditTitle = '修改巡逻路线' |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 获取活动标绘箭头列表 |
| | | getSecurityPlotList (securityId, arrowShow) { |
| | | arrowsListLayer.clear() |
| | | this.$refs.DRAWBTNBOX.removeDrawArrow() |
| | | if (!arrowShow) return |
| | | getSecurityPlotList(securityId).then(res => { |
| | | this.isHaveArrow = res.data.data.some(item => { |
| | | return item |
| | | }) |
| | | let plotList = res.data.data |
| | | res.data.data.forEach(item => { |
| | | let position = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',') |
| | | let chooseArrow = null |
| | | // let nameLabel = null |
| | | let color = '' |
| | | if (item.color == '') { |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(255, 69, 0, 173) |
| | | } else { |
| | | let r = parseInt(item.color.slice(1, 3), 16) |
| | | let g = parseInt(item.color.slice(3, 5), 16) |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | let a = Math.floor(Number(item.color.split(',')[1]) * 2.55) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | } |
| | | if (item.type == 1) { |
| | | chooseArrow = new global.DC.AttackArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 2) { |
| | | chooseArrow = new global.DC.DoubleArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 3) { |
| | | chooseArrow = new global.DC.FineArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 4) { |
| | | chooseArrow = new global.DC.TailedAttackArrow(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | } else if (item.type == 5) { |
| | | chooseArrow = new global.DC.Polygon(position) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | // 缓存区的话需要扣去包含的核心区 |
| | | if (item.areaType == 2) { |
| | | let itemPositionArr = item.position.slice(11, item.position.length - 1).replace(/,/g, ';').replace(/ /g, ',').split(';') |
| | | itemPositionArr.push(itemPositionArr[0]) |
| | | itemPositionArr = itemPositionArr.map(item => { |
| | | return item.split(',').map(Number) |
| | | }) |
| | | let cachePolygon = this.$turf.polygon([itemPositionArr]) |
| | | plotList.forEach(inItem => { |
| | | // 查询被包含的核心区 |
| | | if (inItem.areaType == 1 && inItem.type == 5) { |
| | | let inItemPositionArr = inItem.position.slice(11, inItem.position.length - 1).replace(/,/g, ';').replace(/ /g, ',').split(';') |
| | | inItemPositionArr.push(inItemPositionArr[0]) |
| | | inItemPositionArr = inItemPositionArr.map(item => { |
| | | return item.split(',').map(Number) |
| | | }) |
| | | let carePolygon = this.$turf.polygon([inItemPositionArr]) |
| | | let isContains = this.$turf.booleanContains(cachePolygon, carePolygon) |
| | | // 如果完全包含就作为洞面扣去 |
| | | if (isContains) { |
| | | chooseArrow.holes = [inItem.position.slice(11, inItem.position.length - 1).replace(/,/g, ';').replace(/ /g, ',')] |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | // let center = this.getCenter(item.position) |
| | | // let centerPosition = new global.DC.Position(center[0], center[1]) |
| | | // nameLabel = new global.DC.Label(centerPosition, item.name) |
| | | // arrowsListLayer.addOverlay(nameLabel) |
| | | // nameLabel.setStyle({ |
| | | // "font": "30px", |
| | | // }) |
| | | } else if (item.type == 6) { |
| | | let iconImgName = '' |
| | | if (item.type == 6) { |
| | | iconImgName = 'icon1' |
| | | } |
| | | position = position.split(';')[0].split(',') |
| | | position = new global.DC.Position(Number(position[0]), Number(position[1])) |
| | | chooseArrow = new global.DC.Billboard(position, `/img/icon/${iconImgName}.png`) |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | | }) |
| | | chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | // let point = new global.DC.Point(pointPosition) |
| | | // arrowsListLayer.addOverlay(point) |
| | | // point.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | // point.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | // point.setStyle({ |
| | | // "color": color, //颜色 |
| | | // "outlineColor": color, //边框颜色 |
| | | // "outlineWidth": 0, //边框大小, |
| | | // "pixelSize": 32, |
| | | // }) |
| | | } |
| | | |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item } |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | | }) |
| | | chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick) |
| | | |
| | | // let position1 = new global.DC.Position(117.94218262137659, 28.434842894894153) |
| | | // let Label = new global.DC.Label(position1, 'test') |
| | | // Label.on(global.DC.MouseEventType.LEFT_DOWN, this.reeditArrowLeftDown) |
| | | // Label.on(global.DC.MouseEventType.LEFT_UP, this.reeditArrowLeftUp) |
| | | // // Label.on(global.DC.MouseEventType.MOUSE_MOVE, this.reeditArrowMouseMove) |
| | | // arrowsListLayer.addOverlay(Label) |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | // 双击修改箭头 |
| | | reeditArrowDbClick (e) { |
| | |
| | | |
| | | // 单击。标绘箭头 |
| | | reeditArrowClick (e) { |
| | | this.plotOverlayData = e |
| | | plotOverlayData = e |
| | | |
| | | this.choosePlotColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color.slice(0, 7) : '#409EFF' |
| | | this.choosePlotColorAlpha = e.overlay.attrParams.color != '' ? Number(e.overlay.attrParams.color.split(',')[1]) : 48 |
| | | |
| | | if (e.overlay.attrParams.item.type == 5) { |
| | | this.polygonAreaType = e.overlay.attrParams.item.areaType != '' ? e.overlay.attrParams.item.areaType : 1 |
| | | this.isNeedPolygonType = true |
| | | } else { |
| | | this.isNeedPolygonType = false |
| | | } |
| | | |
| | | // this.polygonName = e.overlay.attrParams.name |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) { |
| | | this.plotId = e.overlay.attrParams.id |
| | |
| | | // 编辑标绘 |
| | | editPlot () { |
| | | this.editPlotVisible = false |
| | | this.reeditArrowDbClick(this.plotOverlayData) |
| | | this.reeditArrowDbClick(plotOverlayData) |
| | | }, |
| | | |
| | | // 保存标绘修改 |
| | | savePlot () { |
| | | // this.updateSecurityPlot({ id: this.plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha, name: this.polygonName }) |
| | | this.$refs.DRAWBTNBOX.updateSecurityPlot({ id: this.plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.$refs.DRAWBTNBOX.updateSecurityPlot({ id: plotOverlayData.overlay.attrParams.id, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.editPlotVisible = false |
| | | }, |
| | | |
| | |
| | | }) |
| | | }, |
| | | |
| | | clearActivitySearchValue () { |
| | | this.searchActivity = '' |
| | | this.inputChange() |
| | | this.searchClick() |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 保存巡逻路线信息 |
| | |
| | | |
| | | // 新增巡逻路线信息 |
| | | addLineInfo () { |
| | | this.addCarAndRange({ position: this.addLinePosition, securityId: this.showingSecurityId, type: 1, color: this.chooseColor, width: this.lineWidth }) |
| | | this.addCarAndRange({ |
| | | position: this.addLinePosition, |
| | | securityId: this.showingSecurityId, |
| | | type: 1, |
| | | color: this.chooseColor, |
| | | width: this.lineWidth |
| | | }) |
| | | this.cancelSaveLine() |
| | | }, |
| | | |
| | |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$refs.DRAWBTNBOX.plotEdit(this.lineObjdata, 'line') |
| | | this.$refs.DRAWBTNBOX.plotEdit(lineObjdata, 'line') |
| | | }, |
| | | |
| | | // 点击区域 |
| | |
| | | }, |
| | | |
| | | // 删除警车 |
| | | deleteActivityCar (id) { |
| | | deleteActivityCar (id, type) { |
| | | deleteActivityCar(id).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | |
| | | type: 'error' |
| | | }) |
| | | } |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch) |
| | | this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, type) |
| | | }) |
| | | }, |
| | | |
| | |
| | | this.deleteActivityPolice(this.policeIconId) |
| | | this.policeChooseVisible = false |
| | | } else if (this.policeChooseCarVisible == true) { |
| | | this.deleteActivityCar(this.policeIconId) |
| | | this.deleteActivityCar(this.policeIconId, 'car') |
| | | this.policeChooseCarVisible = false |
| | | } |
| | | }, |
| | | |
| | | // 删除巡逻路线 |
| | | deleteLine () { |
| | | this.deleteActivityCar(this.policeIconId) |
| | | this.deleteActivityCar(this.policeIconId, 'line') |
| | | this.lineEditVisible = false |
| | | }, |
| | | |
| | |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUP', true) |
| | | let hoverData = {} |
| | | if ('carId' in e.overlay.attrParams.data) { |
| | | hoverData = this.policecarOption.filter(item => item.value == e.overlay.attrParams.data.carId)[0] |
| | | hoverData = policecarOption.filter(item => item.value == e.overlay.attrParams.data.carId)[0] |
| | | hoverData.policeData = { 'name': 'none' } |
| | | hoverData.policeStationName = 'none' |
| | | } else { |
| | |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'polylineLayer', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'activeHeatLayer', |
| | | type: 'HeatLayer' |
| | | }) |
| | |
| | | layerName: 'newCarDrawLineLayers', |
| | | type: 'VectorLayer' |
| | | }) |
| | | |
| | | |
| | | |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'polygonLayer', |
| | |
| | | if (pointCircleCarLayer != null) { |
| | | pointCircleCarLayer.remove() |
| | | } |
| | | this.$refs.DRAWBTNBOX.removeDraw() |
| | | this.$refs.DRAWBTNBOX.removeDrawArrow() |
| | | |
| | | if (polylineAreaLayer) { |
| | | polylineAreaLayer.remove() |