| | |
| | | </div> |
| | | </div> --> |
| | | <div class="line"> |
| | | <div class="value-name-box">选择类型:</div> |
| | | <div class="select-type"> |
| | | <el-select size="small" v-model="polygonAreaType" placeholder="请选择区域类型"> |
| | | <el-option v-for="item in polygonAreaOption" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div class="line"> |
| | | <div class="value-name-box">设置透明度:</div> |
| | | <div class="alpha"> |
| | | <el-slider v-model="choosePlotColorAlpha" :format-tooltip="formatTooltip"></el-slider> |
| | |
| | | video3: false, |
| | | video4: false, |
| | | }, |
| | | polygonAreaType:1, |
| | | polygonAreaOption:[{ |
| | | value: 1, |
| | | label: '核心区' |
| | | }, { |
| | | value: 2, |
| | | label: '缓冲区' |
| | | }] |
| | | } |
| | | }, |
| | | |
| | |
| | | if (flag) { |
| | | that.choosePlotColor = '#409EFF' |
| | | that.choosePlotColorAlpha = 48 |
| | | that.polygonAreaType = 1 |
| | | that.isNeedName = true |
| | | that.polygonName = '' |
| | | that.polygonAddVisible = true |
| | |
| | | }, |
| | | |
| | | // 保存活动标绘箭头 |
| | | // securityId活动id, position坐标, type标绘类型, name多边形名称,color标绘颜色 |
| | | // securityId活动id, position坐标, type标绘类型, name多边形名称,color标绘颜色,aera_type多边形类型 |
| | | addSecurityPlot (params) { |
| | | addSecurityPlot(params).then(res => { |
| | | if (res.data.success) { |
| | |
| | | this.isHaveArrow = res.data.data.some(item => { |
| | | return item |
| | | }) |
| | | console.log(res.data.data,1111); |
| | | 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 nameLabel = null |
| | | if (item.type == 1) { |
| | | chooseArrow = new global.DC.AttackArrow(position) |
| | | } else if (item.type == 2) { |
| | |
| | | chooseArrow = new global.DC.TailedAttackArrow(position) |
| | | } else if (item.type == 5) { |
| | | chooseArrow = new global.DC.Polygon(position) |
| | | // 缓存区的话需要扣去包含的核心区 |
| | | 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) |
| | |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a) |
| | | } |
| | | // chooseArrow.attrParams = { 'id': item.id, 'color': item.color, 'name': item.name } |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color } |
| | | chooseArrow.attrParams = { 'id': item.id, 'color': item.color,item } |
| | | arrowsListLayer.addOverlay(chooseArrow) |
| | | chooseArrow.setStyle({ |
| | | "material": color, |
| | |
| | | this.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 |
| | | console.log(e.overlay.attrParams.color,this.choosePlotColorAlpha,666); |
| | | if(e.overlay.attrParams.item.type == 5){ |
| | | this.polygonAreaType = e.overlay.attrParams.item.areaType != '' ? e.overlay.attrParams.item.areaType : 1 |
| | | } |
| | | // this.polygonName = e.overlay.attrParams.name |
| | | if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) { |
| | | this.plotId = e.overlay.attrParams.id |
| | |
| | | // 保存绘制区域 |
| | | savePolygonInfo () { |
| | | if (this.isNeedName) { |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.polygonPositionStr, type: 5, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.polygonPositionStr, type: 5, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha,areaType:this.polygonAreaType }) |
| | | this.polygonAddVisible = false |
| | | } else { |
| | | this.addSecurityPlot({ securityId: this.showingSecurityId, position: this.arrowPositionStr, type: this.plotSaveType, color: this.choosePlotColor + ',' + this.choosePlotColorAlpha }) |