Compare commits

...

2 Commits

10 changed files with 430 additions and 408 deletions

BIN
public/img/gridwater.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

11
sh.exe.stackdump Normal file
View File

@ -0,0 +1,11 @@
Stack trace:
Frame Function Args
000FFFFB540 00180064365 (00180275F10, 00180266FD1, 000FFFFCA60, 000FFFFBA20)
000FFFFBA70 001800499D2 (00100002000, 0018034EBC8, 00000000001, 00000000158)
000FFFFCA80 00180049A11 (00000000001, 0018034EED8, 000FFFFCA60, 00000000008)
000FFFFCB10 0018005CFCD (00000000000, 000FFFFCC40, 001800DC3EF, 00000000000)
000FFFFCBF0 0018005D12B (000FFFFCDF0, 00000000000, FFFFFFFFFFFFFFD7, 00000000000)
000FFFFCCE0 0018004A1A8 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFCDA0 00180048A2A (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFCE50 00180048AEC (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace

View File

@ -105,18 +105,18 @@
<div class="legendBox" v-if="findsourceShow" v-drag>
<div class="legend-title"> </div>
<div class="legend-container flex">
<div class="flex-1 flex column fc-w fz-16">
<div class="flex ai-c jc-c" style="margin-top:20px;" v-for="(item,index) in lebendLeftArr" :key="index">
<div class="flex-1 flex column fc-w fz-14 jc-c">
<div class="flex ai-c jc-c" style="margin-bottom:10px;" v-for="(item,index) in lebendLeftArr" :key="index">
<div class="flex-1 flex jc-e">
<div class="legend-line mr-1" :style="{ 'background': item.color}"></div>
<div class="legend-line mr-1" :style="{ 'background': item.color,'height': index==4?'15px':'2px','border':index==4?'3px solid #45AA3A':'none'}"></div>
</div>
<div class="flex-1">{{ item.name }}</div>
</div>
</div>
<div class="flex-1 flex column fc-w fz-16 ai-c jc-c">
<div class="flex ai-c jc-c" style="margin-bottom:20px;" v-for="(item,index) in lebendRightArr" :key="index">
<div class="flex-1 flex jc-e">
<div class="legend-icon mr-2">
<div class="flex-1 flex column fc-w fz-14 ai-c jc-c">
<div class="flex ai-c jc-c" style="margin-bottom:10px;width:100%" v-for="(item,index) in lebendRightArr" :key="index">
<div class="flex jc-c ai-c" style="width: 40px;">
<div class="legend-icon">
<img :src='item.icon' style="width:100%" />
</div>
</div>
@ -126,9 +126,8 @@
</div>
</div>
<!-- 路网 -->
<roadCheckBox v-if="findsourceShow" :waterCenter="waterCenter" :gridMap="aroundArr[4].status"></roadCheckBox>
<!-- 水网 -->
<roadWaterCheckBox v-if="findsourceShow" :waterCenter="waterCenter" :gridMap="aroundArr[3].status"></roadWaterCheckBox>
<roadCheckBox v-show="findsourceShow" :visible="findsourceShow" :gridMap1="aroundArr[3].status" :gridMap2="aroundArr[4].status" :gridMap3="aroundArr[5].status"></roadCheckBox>
<div class="water-container" v-if="findsourceShow" v-drag>
<div class="box-name">防灭火资源</div>
<div class="close-button" @click="aroundClose">
@ -146,10 +145,18 @@
<div class="around-box flex">
<div class="around-label">资源列表</div>
<div v-for="(item,index) in aroundArr" :key="index" class="box-name-li listr" :class="aroundIndex == index ? 'active':''">
<div v-if="index < 3" @click="aroundClick(index)">{{ item.name }}</div>
</div>
<div v-if="index < 3" @click="aroundClick(index)">{{ item.name }}</div>
</div>
</div>
<div style="height:calc(100% - 130px)">
<div class="around-box flex">
<div class="around-label">重点资源</div>
<div class="flex-1 flex importantbox">
<el-checkbox-group v-model="importantservecheckList" @change="handleCheckedImportantServeChange">
<el-checkbox v-for="(item,index) in importantServeArr" :key="index" :label="item">{{ item.name }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
<div style="height:calc(100% - 180px)">
<div style="height:100%" v-show="aroundIndex==0">
<waterbox :waterCenter="waterCenter" :firePopup="firePopupClosed" :gridMap="aroundArr[0].status" :visible='waterVisible'></waterbox>
</div>
@ -346,7 +353,7 @@ import { getModules } from "@/api/modules.js";
import AppConfigInfo from "../../../public/config/app.json";
import widgetJson from "../../../public/config/widget.json";
import feixianConfigJson from "../../../public/config/feixianConfig.json";
import { clearRouterFunc,clearWaterRouterFunc,clearRoadRouterFunc } from './lib/routePath'
import { clearRouterFunc } from './lib/routePath'
import $ from "jquery";
import Map from "@/components/mars3d/Map.vue";
@ -363,7 +370,7 @@ import monitorwarning from "./widget/monitorwarning.vue";
import goodsbox from "./widget/goodsbox.vue";
import barrackbox from "./widget/barrackbox.vue";
import roadCheckBox from "./widget/roadcheck.vue";
import roadWaterCheckBox from "./widget/roadwatercheck.vue";
import taskbox from "./widget/taskbox.vue";
// import gridbox from './widget/gridbox.vue';
@ -412,7 +419,6 @@ export default {
goodsbox,
barrackbox,
roadCheckBox,
roadWaterCheckBox,
reportlist,
monitorwarning,
taskbox,
@ -513,21 +519,28 @@ export default {
{ name: '水源' , status: true },
{ name: '物资' , status: false },
{ name: '营房' , status: false },
{ name: '水网' , status: false },
{ name: '路网' , status: true }
{ name: '防火通道' , status: true },
{ name: '三轮通道' , status: false },
{ name: '步行道' , status: false }
],
aroundIndex: 0,
lebendLeftArr:[
{ name: '防火通道' , color: '#E6472B' },
{ name: '三轮车道' , color: '#1F5FDE' },
{ name: '步行道' , color: '#9C9C9C' },
{ name: '水网' , color: '#56C3F9' }
{ name: '防火通道' , color: '#191970' },
{ name: '三轮车道' , color: '#4E78F5' },
{ name: '步行道' , color: '#929590' },
{ name: '生态隔离网' , color: '#A50324' },
{ name: '针叶林' , color: '#B1DE8A' },
],
lebendRightArr:[
{ name: '水源' , icon: '/img/watercircle.png' },
{ name: '物资' , icon: '/img/wuzichubei.png' },
{ name: '营房' , icon: '/img/yingfangcircle.png' },
]
{ name: '山体标注' , icon: '/img/qizhi.png' },
{ name: '生态隔离网进出口' , icon: '/img/jinchukou.png' },
],
importantServeArr:[],
importantservecheckList:[]
};
},
@ -558,6 +571,8 @@ export default {
//
this.getNetWorkState();
this.getImportatServer()
//
window.hiddenReadData = function (e) {
e.innerHTML = e
@ -580,6 +595,70 @@ export default {
window.editlayerinfo = this.editlayerinfo;
},
methods: {
handleCheckedImportantServeChange(){
console.log('newValcccc',this.importantservecheckList)
console.log('newValqqqq',this.importantServeArr)
let arr = []
this.importantServeArr.forEach(item =>{
arr.push(item.id)
})
let newArr = arr.filter((item)=>{
return this.importantservecheckList.every((item1)=>{
return item != item1.id;
})
})
this.importantservecheckList.forEach(item =>{
let layer = window.globalmap.getLayerById(item.id)
let options = layer.options;
if(options.show){
return
}
options.show = true
let tileLayer
if(item.type == 'wms'){
tileLayer = new mars3d.layer.WmsLayer(options)
}
if(item.type == 'geojson'){
tileLayer = new mars3d.layer.GeoJsonLayer(options)
}
window.globalmap.addLayer(tileLayer);
})
newArr.forEach(item =>{
let layer = window.globalmap.getLayerById(item)
let options = layer.options;
options.show = false
layer.setOptions(options)
layer.remove();
})
},
getImportatServer(){
axios({
method: "get",
url: AppConfigInfo[localStorage.getItem("areaName")].layerurl,
}).then((res) => {
let rel = res.data.data
let configLayers = []
rel.forEach(item =>{
if (item.children && item.serverName=='重点资源' && item.children.length > 0) {
item.children.forEach((it, idx) => {
let attribute = JSON.parse(it.attribute);
if(attribute.symbol && attribute.symbol.styleOptions && attribute.symbol.styleOptions.label){
attribute.symbol.styleOptions.label.pixelOffsetY = -40
}
// 223
attribute.url = attribute.url.replace("http://223.99.16.253:9007","http://221.2.83.254:9007")
//
delete attribute.highlight;
configLayers.unshift(attribute);
});
}
})
this.importantServeArr = configLayers
});
},
aroundClick(index){
this.waterVisible = true
this.goodsVisible = true
@ -600,10 +679,6 @@ export default {
this.waterVisible = false
this.goodsVisible = false
this.barrackVisible = false
clearRouterFunc()
clearWaterRouterFunc()
clearRoadRouterFunc()
setTimeout(()=>{
this.findsourceShow = false
@ -956,7 +1031,7 @@ export default {
</div>
<div class="data-li">
<div class="data-value">
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >查找预案</span>
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >防灭火资源</span>
<span id="lablCSFM2" onclick="delFirePoint(${item.id})" class="label-tag data-value-status-3" title="删除火点">删除火点</span>
</div>
</div>
@ -1144,7 +1219,7 @@ export default {
}
},
{
text: "查找预案",
text: "防灭火资源",
show: function (e) {
return Cesium.defined(e.cartesian);
},
@ -1794,11 +1869,11 @@ export default {
.water-container{
width: 603px;
height: 457px;
height: 520px;
position: absolute;
top: 100px;
left: 20px;
background-image: url(/img/goods.png);
background-image: url(/img/gridwater.png);
background-size: 100% 100%;
transform: translate(0, 0);
z-index: 2000;
@ -2229,12 +2304,13 @@ export default {
}
.box-name-li{
padding: 0 10px;
padding-right: 15px;
cursor: pointer;
background: none;
display: flex;
flex-direction: row;
align-items: center;
height:25px;
}
.box-name-li.listr{
padding: 0 15px;
@ -2269,7 +2345,7 @@ export default {
background: linear-gradient(160deg, #062D2D 0%, rgba(7,64,64,0.97) 100%, rgba(8,41,41,0.64) 100%);
border: 1px solid #0F6E6F;
position: absolute;
top: 580px;
top: 630px;
left: 20px;
}
.legend-title{
@ -2291,4 +2367,53 @@ export default {
.legend-icon{
width: 25px;
}
.importantbox{
display: flex;
flex-wrap: wrap;
max-height: 55px;
overflow: auto;
color: #fff
}
.importantbox .el-checkbox{
color:#fff;
margin-right: 20px;
}
.mb-1{
margin-bottom: 10px;
}
.nowrap{
white-space: nowrap;
}
::-webkit-scrollbar {
height: 10px;
width: 10px;
background: transparent;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
padding-top: 100px;
-webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1),
inset -1px -1px 0 rgba(0, 0, 0, 0.07);
background-color: #797979;
min-height: 28px;
border-radius: 4px;
background-clip: padding-box;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
border: 0;
}
::-webkit-scrollbar-thumb:hover {
-webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25);
background-color: rgba(0, 0, 0, 0.4);
}
::-webkit-scrollbar-thumb:active {
-webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35);
background-color: rgba(0, 0, 0, 0.5);
}
</style>

View File

@ -14,6 +14,8 @@ let pathGraphicLayers = null
let pathOneGraphicLayers= null
let pathWaterGraphicLayers = null
let pathRoadGraphicLayers = null
let pathRoadGraphicLayers1 = null
let pathRoadGraphicLayers2 = null
//导航寻路
export const getRouterFunc = (params, method = 'postgis') => {
@ -298,9 +300,7 @@ export const drawRoutersFuncGrid = (pathObject) => {
if (pathRoadGraphicLayers == null) {
pathRoadGraphicLayers = new mars3d.layer.GraphicLayer();
window.globalmap.addLayer(pathRoadGraphicLayers);
} else {
}
}
//当只有两组数据时,说明没有导航的路线,直接使用虚线连接
if (pointArr.length == 2) {
@ -308,17 +308,46 @@ export const drawRoutersFuncGrid = (pathObject) => {
} else {
// 导航数据路段
let pathGraphic
if(Type == 1){
pathGraphic = drawLineFlowEntityColor1(pointArr, '#E6472B')
}else if(Type == 2){
pathGraphic = drawLineFlowEntityColor2(pointArr, '#1F5FDE')
}else{
pathGraphic = drawLineFlowEntityColor2(pointArr, '#9C9C9C')
}
let pathGraphic;
pathGraphic = drawLineFlowEntityColor1(pointArr, '#E6472B')
pathRoadGraphicLayers.addGraphic(pathGraphic);
}
}
export const drawRoutersFuncGrid1 = (pathObject) => {
let { pointArr, Type } = pathObject
// 添加graphic
if (pathRoadGraphicLayers1 == null) {
pathRoadGraphicLayers1 = new mars3d.layer.GraphicLayer();
window.globalmap.addLayer(pathRoadGraphicLayers1);
}
//当只有两组数据时,说明没有导航的路线,直接使用虚线连接
if (pointArr.length == 2) {
} else {
// 导航数据路段
let pathGraphic1;
pathGraphic1 = drawLineFlowEntityColor2(pointArr, '#1F5FDE')
pathRoadGraphicLayers1.addGraphic(pathGraphic1);
}
}
export const drawRoutersFuncGrid2 = (pathObject) => {
let { pointArr, Type } = pathObject
// 添加graphic
if (pathRoadGraphicLayers2 == null) {
pathRoadGraphicLayers2 = new mars3d.layer.GraphicLayer();
window.globalmap.addLayer(pathRoadGraphicLayers2);
}
//当只有两组数据时,说明没有导航的路线,直接使用虚线连接
if (pointArr.length == 2) {
} else {
// 导航数据路段
let pathGraphic2;
pathGraphic2 = drawLineFlowEntityColor2(pointArr, '#9C9C9C')
pathRoadGraphicLayers2.addGraphic(pathGraphic2);
}
}
@ -493,6 +522,20 @@ export const clearRoadRouterFunc = () => {
pathRoadGraphicLayers.clear();
}
}
export const clearRoadRouterFunc1 = () => {
if (pathRoadGraphicLayers1 == null) {
return false
} else {
pathRoadGraphicLayers1.clear();
}
}
export const clearRoadRouterFunc2 = () => {
if (pathRoadGraphicLayers2 == null) {
return false
} else {
pathRoadGraphicLayers2.clear();
}
}
//计算最近路线
const getMinimumRoute = (pathObject) => {

View File

@ -22,12 +22,7 @@
<div class="flex column">
<div class="flex jc-sb">
<div>
<span style="color: #35cf8c" class="fz-16 mr-2">{{
item.street
}}</span>
<span class="fz-14 mr-2" style="font-weight: bold">{{
item.name
}}</span>
<span style="color: #35cf8c" class="fz-16 mr-2">{{ item.dwmc }}</span>
<span class="mr-2">{{ item.distance }}km</span>
<span style="color: #cee800">预计到达时间{{ item.time }}分钟</span>
</div>
@ -35,6 +30,10 @@
定位
</el-button>
</div>
<div class="line" style="margin: 10px 0"></div>
<div>装备情况{{ item.zbqk }}</div>
<div class="line" style="margin: 10px 0"></div>
<div>队伍驻地{{ item.dwzd }}</div>
</div>
</div>
</div>
@ -43,7 +42,7 @@
</template>
<script>
import { parse } from "../lib/handleGeojson";
import axios from "axios";
import * as turf from "@turf/turf";
import { getMethodCommon } from "../../../api/common";
import { getRouterFunc, drawRouterFunc, clearRouterFunc, } from '../lib/routePath'
@ -154,42 +153,40 @@
}
},
getWuziList() {
let params = {
lng: this.endLngLat[0],
lat: this.endLngLat[1]
}
getMethodCommon("/FireGrideResource/GetGridInfoByLngLat",params).then( value=>{
console.log('1122',value.result)
let rel = value.result
if(rel == null){
this.goodsListData = []
}else{
this.gridIsShow = false
getMethodCommon("/FireGrideResource/GetWg_Barrack",{id:rel.Id}).then( res=>{
console.log('11224',res)
let reldata = res.result
let arr = []
reldata.forEach(item =>{
arr.push({
name: item.Name,
geom: item.geom
})
})
let separators = ["(", " ", ")"]
arr.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
})
this.goodsListData = arr;
this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
(wz) => {
this.nestWuziPoints = wz;
this.radioChange();
}
);
})
}
// axios({
// method: "get",
// url: "http://192.168.10.126:9007/api/FireGrideResource/GetAllYingFang",
// }).then((res) => {
// let reldata = res.data.result
// let separators = ["(", " ", ")"]
// reldata.forEach(item =>{
// let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
// item.coordinates = [ coord[1] , coord[2] ]
// })
// this.goodsListData = reldata;
// this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
// (wz) => {
// this.nestWuziPoints = wz;
// this.radioChange();
// }
// );
// });
getMethodCommon("/FireGrideResource/GetAllYingFang").then( value=>{
let reldata = res.result
let separators = ["(", " ", ")"]
reldata.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
})
this.goodsListData = reldata;
this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
(wz) => {
this.nestWuziPoints = wz;
this.radioChange();
}
);
})
},
@ -203,10 +200,18 @@
let options = { units: "kilometers" };
let distance = turf.distance(from, to, options);
let obj = {
id: item.dwzd,
lngLat: item.coordinates,
distance: distance.toFixed(2),
time: this.getAroundTime(distance.toFixed(2) * 60 + 5 * 60),
name: item.name,
dwmc: item.dwmc,
dwzd: item.dwzd,
lsdw: item.lsdw,
dzxm: item.dzxm,
lxfs: item.lxfs,
syrs: item.syrs,
zbqk: item.zbqk,
tbr: item.tbr
};
nestWuziPoints.push(obj);
});
@ -243,7 +248,7 @@
areaname: localStorage.getItem("areaName"),
};
getRouterFunc(params).then(res => {
drawRouterFunc(res)
// drawRouterFunc(res)
}).catch(err => {
clearRouterFunc()
})
@ -293,7 +298,7 @@
<div class="b-l"></div>
<div class="arrow-rb"></div>
<div class="label-wrap">
<div class="title">${item.name}</div>
<div class="title">${item.dwmc}</div>
<div class="label-content">
<div class="data-li">
<div class="data-label" >距离</div>
@ -358,7 +363,7 @@
.box-container {
width: calc(100% - 0px);
padding: 0px 12px;
height: calc(100% - 90px);
height: calc(100% - 45px);
}
.table-header {

View File

@ -4,19 +4,7 @@
<div class="close-button" @click="close">
<i class="el-icon el-icon-close"></i>
</div> -->
<div class="flex flex-1 ai-c" style="margin: 10px 0" v-if="!gridIsShow">
<span style="width: 120px; text-align: right; color: #fff">距离</span>
<div class="flex ai-c">
<el-radio-group v-model="distanceradio" @input="radioChange">
<el-radio :label="1" class="mr-1">1km内</el-radio>
<el-radio :label="2" class="mr-1">5km内</el-radio>
<el-radio :label="3" class="mr-1">10km内</el-radio>
<el-radio :label="4" class="mr-1">20km内</el-radio>
<el-radio :label="5">全部</el-radio>
</el-radio-group>
</div>
</div>
<div class="box-title flex column" v-if="gridIsShow">
<div class="box-title flex column">
<div class="flex-1 flex ai-c">
<el-input type="text" size="mini" style="width: 300px; margin-right: 12px; margin-left: 60px"
v-model="listQuery.wuzi"></el-input>
@ -35,7 +23,7 @@
</div>
</div>
</div>
<div class="box-container" :style="{'height': gridIsShow?'calc(100% - 90px)':'calc(100% - 30px)'}">
<div class="box-container" style="height:calc(100% - 100px)">
<div class="table-body">
<div class="item" v-for="(item, index) in goodsListData" :key="index">
<div class="flex column">
@ -85,8 +73,7 @@ export default {
goodsGraphicLayer: null,
goodsGraphicLayerArr: [],
distanceradio: 4,
allData: [],
gridIsShow: true
allData: []
};
},
watch: {
@ -104,7 +91,6 @@ export default {
},
roadStatus: {
handler(newVal, oldVal) {
console.log('newVal',newVal)
if(newVal){
this.getWuziList()
}else{
@ -184,75 +170,33 @@ export default {
}
},
getWuziList() {
let params = {
lng: this.endLngLat[0],
lat: this.endLngLat[1]
}
getMethodCommon("/FireGrideResource/GetGridInfoByLngLat",params).then( value=>{
console.log('1122',value.result)
let rel = value.result
if(rel == null){
getMethodCommon("/FirePrevention/Loadwuzichubei", this.listQuery).then((res) => {
if (!res.data.length) {
this.goodsGraphicLayerArr.forEach((item) => {
this.goodsGraphicLayer.removeGraphic(item);
});
if (this.pathPointGraphicLayer) {
this.pathPointGraphicLayer.clear();
}
} else {
this.goodsListData = res.data;
let separators = ["(", " ", ")"]
this.goodsListData.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
this.startLngLat = [ coord[1] , coord[2] ]
})
getMethodCommon("/FirePrevention/Loadwuzichubei", this.listQuery).then(
(res) => {
if (!res.data.length) {
this.goodsGraphicLayerArr.forEach((item) => {
this.goodsGraphicLayer.removeGraphic(item);
});
if (this.pathPointGraphicLayer) {
this.pathPointGraphicLayer.clear();
}
} else {
this.goodsListData = res.data;
let separators = ["(", " ", ")"]
this.goodsListData.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
this.startLngLat = [ coord[1] , coord[2] ]
this.getRoutePath()
})
this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
(wz) => {
this.nestWuziPoints = wz;
this.radioChange();
}
);
}
this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
(wz) => {
this.nestWuziPoints = wz;
this.radioChange();
}
);
}else{
this.gridIsShow = false
getMethodCommon("/FireGrideResource/GetMaterials",{id:rel.Id}).then( res=>{
console.log('11224',res)
let reldata = res.result
let arr = []
reldata.forEach(item =>{
arr.push({
id: item.Id,
info: item.Info,
name: item.Name,
type: item.Type,
geom: item.geom
})
})
let separators = ["(", " ", ")"]
arr.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
})
this.goodsListData = arr;
this.getNestPoint(this.endLngLat[0], this.endLngLat[1]).then(
(wz) => {
this.nestWuziPoints = wz;
this.radioChange();
}
);
})
}
})
}
);
},
@ -291,14 +235,13 @@ export default {
},
flyToPosition(item) {
console.log('item11',item)
this.startLngLat = item.lngLat;
// this.getRoutePath();
window.globalmap.flyToPoint(item.lngLat, { radius: 4000, pitch: -90 });
},
getRoutePath() {
// 线
console.log('startLngLat',this.startLngLat)
let startCoor = this.startLngLat;
let endCoor = this.endLngLat;
let params = {
@ -311,7 +254,7 @@ export default {
getRouterFunc(params).then(res => {
drawRouterFunc(res)
}).catch(err => {
console.log('startLngLat111')
clearRouterFunc()
})
},

View File

@ -150,6 +150,7 @@ export default {
method: "get",
url: "http://221.2.83.254:9006/applicationMars/getApplicationInfo/feixian"
}).then(res=>{
console.log('newValsssss',res)
this.listData = res.data.data
this.listData.forEach(item =>{
item.children.forEach(val =>{

View File

@ -271,7 +271,7 @@ export default {
<div class="data-li">
<div class="data-value">
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >查找预案</span>
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >防灭火资源</span>
<span id="lablSBZT1" onclick="jiankong('${item.createId}')" style="display:${jiankongDisplay}" class="label-tag data-value-status-1" title="视频监控">视频监控</span>
</div>
</div>
@ -318,7 +318,7 @@ export default {
</div>
<div class="data-li">
<div class="data-value">
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >查找预案</span>
<span id="lablCSFM3" onclick="aroundYuAn([${item.lng},${item.lat}])" class="label-tag data-value-status-2" >防灭火资源</span>
<span id="lablSBZT1" onclick="jiankong('${item.createId}')" style="display:${jiankongDisplay}" class="label-tag data-value-status-1" title="视频监控">视频监控</span>
</div>
</div>

View File

@ -4,38 +4,69 @@
<script>
import axios from "axios";
import { clearRoadRouterFunc,drawRoutersFuncGrid } from '../lib/routePath'
import { clearRoadRouterFunc,clearRoadRouterFunc1,clearRoadRouterFunc2,drawRoutersFuncGrid,drawRoutersFuncGrid1,drawRoutersFuncGrid2 } from '../lib/routePath'
let pathOneGraphicLayers
let pathOneGraphicLayers1
let pathOneGraphicLayers2
let BASE_URL = process.env.VUE_APP_BASE_API;
export default {
name: "monitorbox",
props: ["waterCenter", "visible","gridMap"],
props: ["visible","gridMap1","gridMap2","gridMap3"],
data() {
return {
tileLayer1:null,
tileLayer2:[],
tileLayer3:[]
};
},
watch: {
visible: {
gridMap1: {
handler(newVal, oldVal) {
if (newVal == false) {
this.close();
}
},
},
gridMap: {
handler(newVal, oldVal) {
console.log('newVal111',newVal)
if(newVal){
this.getGridList();
this.getListDatas();
}else{
this.close();
this.close()
}
},
},
waterCenter: {
gridMap2: {
handler(newVal, oldVal) {
this.getGridList();
console.log('newVal222',newVal)
if(newVal){
this.getListDatas1();
}else{
this.close1();
}
},
},
gridMap3: {
handler(newVal, oldVal) {
if(newVal){
this.getListDatas2();
}else{
this.close2();
}
},
},
visible: {
handler(newVal, oldVal) {
console.log('newVal11122',newVal)
if(newVal){
if(this.gridMap1){
this.getListDatas()
}
if(this.gridMap2){
this.getListDatas1()
}
if(this.gridMap3){
this.getListDatas2()
}
}else{
this.close();
this.close1();
this.close2();
}
},
immediate: true,
// deep
@ -44,68 +75,79 @@ export default {
},
created() {
this.getGridList();
if(this.gridMap1){
this.getListDatas()
}
if(this.gridMap2){
this.getListDatas1()
}
if(this.gridMap3){
this.getListDatas2()
}
},
methods: {
close() {
clearRoadRouterFunc()
window.globalmap.removeLayer(this.tileLayer1)
},
getGridList() {
axios({
method: "get",
params: {
lng: this.waterCenter[0],
lat: this.waterCenter[1],
},
url: BASE_URL + "/FireGrideResource/GetGridInfoByLngLat",
}).then((res) => {
let rel = res.data.result
if(rel == null){
}else{
axios({
method: "get",
params: {
id: rel.Id
},
url: BASE_URL + "/FireGrideResource/GetWaterResource",
}).then((res) => {
if(this.gridMap){
this.getGridRoute(rel.Id);
}
});
}
});
close1() {
window.globalmap.removeLayer(this.tileLayer2)
},
getGridRoute(Id){
axios({
method: "get",
params: {
id: Id
close2() {
window.globalmap.removeLayer(this.tileLayer3)
},
getListDatas(){
this.tileLayer1 = new mars3d.layer.WmsLayer({
url: "http://221.2.83.254:9007/geoserver/ksp/wms",
parameters: {
SERVICE: 'WMS',
STYLES: '',
VERSION: '1.1.1',
REQUEST: 'GetMap',
FORMAT: 'image/png',
TRANSPARENT: true,
LAYERS: 'ksp:beibudaolufenlei',
exceptions: 'application/vnd.ogc.se_inimage',
CQL_FILTER: "qufen='行车路'",
SRS: 'EPSG:4326',
},
url: BASE_URL + "/FireGrideResource/GetWgRoad",
}).then((res) => {
let rel = res.data.result
let separators = ["((", ",", "))"]
rel.forEach(item =>{
item.pointArr = []
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
coord.forEach((val,index) =>{
if(index > 1 && index < (coord.length - 2) ){
item.pointArr.push([
val.split(' ')[0],val.split(' ')[1]
])
}
})
})
rel.forEach((item,index) =>{
if(index !== 35){
drawRoutersFuncGrid(item)
}
})
});
})
window.globalmap.addLayer(this.tileLayer1);
},
getListDatas1(){
this.tileLayer2 = new mars3d.layer.WmsLayer({
url: "http://221.2.83.254:9007/geoserver/ksp/wms",
parameters: {
SERVICE: 'WMS',
STYLES: '',
VERSION: '1.1.1',
REQUEST: 'GetMap',
FORMAT: 'image/png',
TRANSPARENT: true,
LAYERS: 'ksp:beibudaolufenlei',
exceptions: 'application/vnd.ogc.se_inimage',
CQL_FILTER: "qufen='三轮车路'",
SRS: 'EPSG:4326',
},
})
window.globalmap.addLayer(this.tileLayer2)
},
getListDatas2(){
this.tileLayer3 = new mars3d.layer.WmsLayer({
url: "http://221.2.83.254:9007/geoserver/ksp/wms",
parameters: {
SERVICE: 'WMS',
STYLES: '',
VERSION: '1.1.1',
REQUEST: 'GetMap',
FORMAT: 'image/png',
TRANSPARENT: true,
LAYERS: 'ksp:beibudaolufenlei',
exceptions: 'application/vnd.ogc.se_inimage',
CQL_FILTER: "qufen='步行路'",
SRS: 'EPSG:4326',
},
})
window.globalmap.addLayer(this.tileLayer3)
},
},
};

View File

@ -5,7 +5,7 @@
<i class="el-icon el-icon-close"></i>
</div> -->
<!-- <div class="box-container"> -->
<div style="height:calc(100% - 10px)">
<div style="height:calc(100% - 35px)">
<div class="flex" style="margin: 10px 0">
<span style="width: 120px; text-align: right; color: #fff">距离</span>
<div>
@ -249,44 +249,12 @@ export default {
getWaterList() {
axios({
method: "get",
params: {
lng: this.waterCenter[0],
lat: this.waterCenter[1],
},
url: BASE_URL + "/FireGrideResource/GetGridInfoByLngLat",
url: appConfig[localStorage.getItem("areaName")].waterUrl,
}).then((res) => {
let rel = res.data.result
if(rel == null){
axios({
method: "get",
url: appConfig[localStorage.getItem("areaName")].waterUrl,
}).then((res) => {
this.waterPoints = res.data;
this.gridIsShow = true
this.getNestPoint(this.waterCenter[0], this.waterCenter[1]);
this.radioChange();
});
}else{
axios({
method: "get",
params: {
id: rel.Id
},
url: BASE_URL + "/FireGrideResource/GetWaterResource",
}).then((res) => {
this.gridIsShow = false
this.waterPoints = res.data.result;
let separators = ["(", " ", ")"]
this.waterPoints.forEach(item =>{
let coord = item.geom.split( (new RegExp("[" + separators.join('') + "]")) )
item.coordinates = [ coord[1] , coord[2] ]
})
this.getNestPointGrid(this.waterCenter[0], this.waterCenter[1]);
this.radioChange();
});
}
this.waterPoints = res.data;
this.gridIsShow = true
this.getNestPoint(this.waterCenter[0], this.waterCenter[1]);
this.radioChange();
});
},
@ -296,28 +264,6 @@ export default {
var m = parseInt((a % 3600) / 60);
var s = parseInt((a % 3600) % 60);
return h + "小时" + m + "分" + s + "秒";
},
getNestPointGrid(lng, lat) {
let from = turf.point([lng, lat]);
this.nestWaterPoints = [];
this.waterPoints.forEach((item, index) => {
let to = turf.point(item.coordinates);
let options = { units: "kilometers" };
let distance = turf.distance(from, to, options);
let obj = {
id: item.Id,
lngLat: item.coordinates,
distance: distance.toFixed(2),
time: this.getAroundTime(distance.toFixed(2) * 60 + 5 * 60),
};
this.nestWaterPoints.push(obj);
});
this.nestWaterPoints.sort((a, b) => {
return a.distance - b.distance;
});
this.allData = this.nestWaterPoints;
},
//
getNestPoint(lng, lat) {
@ -506,100 +452,6 @@ export default {
clearRouterFunc()
})
},
getEchartsOption(lng,lat,nestWaterPoints) {
const beijinCoord = [lng, lat]
const symbolPoint = "image://img/symbol1.png"
const linePoint = "image://img/linePoint1.png"
const pointArr = []
const pathArr = [];
for(let i=0;i<15;i++){
pointArr.push({
name: nestWaterPoints[i].distance+"km",
value: nestWaterPoints[i].lngLat,
symbol: symbolPoint
})
pathArr.push({
name: i,
toname: "当前位置",
coords: [nestWaterPoints[i].lngLat, beijinCoord]
})
}
const option = {
animation: false,
clampToGround:true,
series: [
{
name: "",
type: "lines",
coordinateSystem: "mars3dMap",
zlevel: 1,
data: pathArr,
// 线
effect: {
show: true,
smooth: false,
trailLength: 0,
symbol: linePoint,
symbolSize: [10, 30],
period: 4
},
lineStyle: {
normal: {
width: 3,
color: "#1c67d6",
curveness: 0.2
}
}
},
{
type: "effectScatter",
coordinateSystem: "mars3dMap",
zlevel: 3,
data: [
{
name: "当前位置",
value: beijinCoord.concat(200)
}
],
rippleEffect: {
period: 10,
scale: 5,
brushType: "fill"
}
},
{
type: "effectScatter",
coordinateSystem: "mars3dMap",
symbolSize: [20, 20],
symbolOffset: [0, -10],
zlevel: 3,
circular: {
rotateLabel: true
},
label: {
normal: {
show: true,
position: "bottom",
formatter: "{b}",
fontSize: 14,
color: "#fff",
textBorderColor: "#2aa4e8",
offset: [0, 10]
}
},
itemStyle: {
normal: {
shadowColor: "none"
}
},
data: pointArr
}
]
}
return option
},
},
};
</script>