|
|
@ -13,8 +13,7 @@ |
|
|
|
</header> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<a-radio-group default-value="satellite" button-style="solid" size="small" @change="radioChange" |
|
|
|
class="radioBtn" v-show="radioBtnShow"> |
|
|
|
<a-radio-group default-value="satellite" button-style="solid" size="small" @change="radioChange" class="radioBtn" v-show="radioBtnShow"> |
|
|
|
<a-radio-button value="satellite"> 卫星影像</a-radio-button> |
|
|
|
<a-radio-button value="vector"> 矢量地图</a-radio-button> |
|
|
|
</a-radio-group> |
|
|
@ -30,8 +29,14 @@ |
|
|
|
<a-button @click="roamPathSet()">视频融合</a-button> |
|
|
|
</div> |
|
|
|
<!-- 视频融合 --> |
|
|
|
<VideoFusionWin v-if="VideoFusionWinShow" :cameraList="cameraList" :monitorPosition="monitorPosition" |
|
|
|
:updateModel="toItemObj.updateModel" :isUpdate="toItemObj.isUpdate" :userSave="toItemObj.userSave"> |
|
|
|
<VideoFusionWin |
|
|
|
v-if="VideoFusionWinShow" |
|
|
|
:cameraList="cameraList" |
|
|
|
:monitorPosition="monitorPosition" |
|
|
|
:updateModel="toItemObj.updateModel" |
|
|
|
:isUpdate="toItemObj.isUpdate" |
|
|
|
:userSave="toItemObj.userSave" |
|
|
|
> |
|
|
|
</VideoFusionWin> |
|
|
|
<!-- 地标弹窗 --> |
|
|
|
<!-- <div id="poiModal" class="poiModal" v-show="poiModalShow" ref="poiModal"> |
|
|
@ -50,62 +55,78 @@ |
|
|
|
</audio> |
|
|
|
|
|
|
|
<!-- 云台控制弹窗 --> |
|
|
|
<video-window :id="videoWindowProps.id" :visible.sync="videoWindowProps.visible" :title="videoWindowProps.title" |
|
|
|
:videoUrl="videoWindowProps.videoUrl" :cameraIp="videoWindowProps.cameraIp" |
|
|
|
:cameraUser="videoWindowProps.cameraUser" :cameraPwd="videoWindowProps.cameraPwd" |
|
|
|
:isAlarm="videoWindowProps.isAlarm" :playRecord="videoWindowProps.playRecord" |
|
|
|
:warnTime="videoWindowProps.warnTime" :warnEvent="videoWindowProps.warnEvent" /> |
|
|
|
<video-window |
|
|
|
:id="videoWindowProps.id" |
|
|
|
:visible.sync="videoWindowProps.visible" |
|
|
|
:title="videoWindowProps.title" |
|
|
|
:videoUrl="videoWindowProps.videoUrl" |
|
|
|
:cameraIp="videoWindowProps.cameraIp" |
|
|
|
:cameraUser="videoWindowProps.cameraUser" |
|
|
|
:cameraPwd="videoWindowProps.cameraPwd" |
|
|
|
:isAlarm="videoWindowProps.isAlarm" |
|
|
|
:playRecord="videoWindowProps.playRecord" |
|
|
|
:warnTime="videoWindowProps.warnTime" |
|
|
|
:warnEvent="videoWindowProps.warnEvent" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 左侧操作栏 --> |
|
|
|
<Toolbar v-if="toolbarShow" :setLabelStatus="setLabelStatus"></Toolbar> |
|
|
|
<AddModelWin v-if="addModelWinShow" :setLabelStatus="setLabelStatus" :czmObject="czmObject" :node="node" |
|
|
|
:type="type" :lineId="lineId" :areaCode="areaCode" :areaByNodeId="areaByNodeIdModel" |
|
|
|
:setIconByRef="setIconByRef" :el="el" :eidtId="eidtId"></AddModelWin> |
|
|
|
<AddModelWin |
|
|
|
v-if="addModelWinShow" |
|
|
|
:setLabelStatus="setLabelStatus" |
|
|
|
:czmObject="czmObject" |
|
|
|
:node="node" |
|
|
|
:type="type" |
|
|
|
:lineId="lineId" |
|
|
|
:areaCode="areaCode" |
|
|
|
:areaByNodeId="areaByNodeIdModel" |
|
|
|
:setIconByRef="setIconByRef" |
|
|
|
:el="el" |
|
|
|
:eidtId="eidtId" |
|
|
|
></AddModelWin> |
|
|
|
<AddRoamVideo v-if="addRoamVideoShow"></AddRoamVideo> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { toRefs, watch, nextTick, ref, reactive, onMounted, getCurrentInstance, onBeforeUnmount } from 'vue'; |
|
|
|
import sceneTree from '@/assets/earthMap/resjson/sc.json'; |
|
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
import earthUtils from '@/utils/earthMap/earth'; |
|
|
|
import _ from 'lodash'; |
|
|
|
import $ from 'jquery'; |
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { useEarthMapStore } from '/@/store/modules/earthMap'; |
|
|
|
import Toolbar from '@/components/earthMap/Toolbar.vue'; |
|
|
|
import AddModelWin from '@/components/earthMap/toolbar/AddModelWin.vue'; |
|
|
|
import AddRoamVideo from '@/components/earthMap/toolbar/AddRoamVideo.vue'; |
|
|
|
import VideoSplitScreen from '@/components/earthMap/VideoSplitScreen.vue'; |
|
|
|
import VideoWindow from '@/components/earthMap/VideoWindow.vue'; |
|
|
|
import WarnInfoList from '@/components/earthMap/WarnInfoList.vue'; |
|
|
|
import { getRealTime } from '@/utils/date'; |
|
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
|
import { drawInit } from '@/utils/earthMap/earthDraw'; |
|
|
|
import { keyControlInit } from '@/utils/earthMap/keyControlInit'; |
|
|
|
import redFlag from '@/assets/earthMap/redFlag.png'; |
|
|
|
import { addModel, addPin, addViewShedRadar, addShipGroundImg, addShipTrack } from '@/utils/earthMap/earthObj'; |
|
|
|
import { drawAllShips } from '@/utils/earthMap/shipDraw'; |
|
|
|
import hidePng from '@/assets/earthMap/hide.png'; |
|
|
|
import alarmImg from '@/assets/earthMap/alarm.gif'; |
|
|
|
import VideoFusionWin from './components/VideoFusionWin.vue'; |
|
|
|
import { useMessage } from "/@/hooks/web/useMessage"; |
|
|
|
|
|
|
|
import circleDot2 from '@/assets/earthMap/circleDot2.png'; |
|
|
|
import circleDot1 from '@/assets/earthMap/circleDot1.png'; |
|
|
|
import circleDot3 from '@/assets/earthMap/circleDot3.png'; |
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
const store = useEarthMapStore(); |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
const { createMessage } = useMessage(); |
|
|
|
const audio = ref() //警示音频组件 |
|
|
|
const props = defineProps({ |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
class HandleNodeType { |
|
|
|
import { toRefs, watch, nextTick, ref, reactive, onMounted, getCurrentInstance, onBeforeUnmount } from 'vue'; |
|
|
|
import sceneTree from '@/assets/earthMap/resjson/sc.json'; |
|
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
|
import earthUtils from '@/utils/earthMap/earth'; |
|
|
|
import _ from 'lodash'; |
|
|
|
import $ from 'jquery'; |
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { useEarthMapStore } from '/@/store/modules/earthMap'; |
|
|
|
import Toolbar from '@/components/earthMap/Toolbar.vue'; |
|
|
|
import AddModelWin from '@/components/earthMap/toolbar/AddModelWin.vue'; |
|
|
|
import AddRoamVideo from '@/components/earthMap/toolbar/AddRoamVideo.vue'; |
|
|
|
import VideoSplitScreen from '@/components/earthMap/VideoSplitScreen.vue'; |
|
|
|
import VideoWindow from '@/components/earthMap/VideoWindow.vue'; |
|
|
|
import WarnInfoList from '@/components/earthMap/WarnInfoList.vue'; |
|
|
|
import { getRealTime } from '@/utils/date'; |
|
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
|
import { drawInit } from '@/utils/earthMap/earthDraw'; |
|
|
|
import { keyControlInit } from '@/utils/earthMap/keyControlInit'; |
|
|
|
import redFlag from '@/assets/earthMap/redFlag.png'; |
|
|
|
import { addModel, addPin, addViewShedRadar, addShipTrack } from '@/utils/earthMap/earthObj'; |
|
|
|
import { drawAllShips } from '@/utils/earthMap/shipDraw'; |
|
|
|
import hidePng from '@/assets/earthMap/hide.png'; |
|
|
|
import alarmImg from '@/assets/earthMap/alarm.gif'; |
|
|
|
import VideoFusionWin from './components/VideoFusionWin.vue'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
|
|
|
import circleDot2 from '@/assets/earthMap/circleDot2.png'; |
|
|
|
import circleDot1 from '@/assets/earthMap/circleDot1.png'; |
|
|
|
import circleDot3 from '@/assets/earthMap/circleDot3.png'; |
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
const store = useEarthMapStore(); |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
const { createMessage } = useMessage(); |
|
|
|
const audio = ref(); //警示音频组件 |
|
|
|
const props = defineProps({}); |
|
|
|
|
|
|
|
class HandleNodeType { |
|
|
|
#sn; |
|
|
|
#sensorCallback; |
|
|
|
#modelCallback; |
|
|
@ -166,33 +187,33 @@ class HandleNodeType { |
|
|
|
this.#default ? this.#default() : null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function setClassEl(setClassEl1, setClassEl2, checked) { |
|
|
|
function setClassEl(setClassEl1, setClassEl2, checked) { |
|
|
|
if (checked) { |
|
|
|
setClassChecked(setClassEl1, setClassEl2); |
|
|
|
} else { |
|
|
|
setClassNoChecked(setClassEl1, setClassEl2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function setClassChecked(setClassEl1, setClassEl2) { |
|
|
|
function setClassChecked(setClassEl1, setClassEl2) { |
|
|
|
// node.checkStatus = 'checked' |
|
|
|
// node.disabled = '' |
|
|
|
//***设置样式为选中 */ |
|
|
|
setClassEl1.className = 'xbsj-checkbox-wrapper xbsj-checkbox-wrapper-checked xbsj-checkbox-default'; |
|
|
|
setClassEl2.className = 'xbsj-checkbox xbsj-checkbox-checked'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function setClassNoChecked(setClassEl1, setClassEl2) { |
|
|
|
function setClassNoChecked(setClassEl1, setClassEl2) { |
|
|
|
// node.checkStatus = '' |
|
|
|
// node.disabled = 'disabled' |
|
|
|
// 设置为非选中 |
|
|
|
setClassEl1.className = 'xbsj-checkbox-wrapper xbsj-checkbox-wrapper-disabled xbsj-checkbox-default'; |
|
|
|
setClassEl2.className = 'xbsj-checkbox xbsj-checkbox-disabled'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function classMutationObserver(el, el1, checkedStauts, id) { |
|
|
|
function classMutationObserver(el, el1, checkedStauts, id) { |
|
|
|
// 观察器的配置(需要观察什么变动) 属性,子节点or后代节点 |
|
|
|
const config = { attributes: true, childList: false, subtree: false }; |
|
|
|
const callback1 = function (mutationsList, observer) { |
|
|
@ -218,9 +239,9 @@ function classMutationObserver(el, el1, checkedStauts, id) { |
|
|
|
const observer1 = new MutationObserver(callback1); |
|
|
|
// 以上述配置开始观察目标节点 |
|
|
|
observer1.observe(el, config); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function disabledMutationObserver(el) { |
|
|
|
function disabledMutationObserver(el) { |
|
|
|
const config = { attributes: true, childList: false, subtree: false }; |
|
|
|
const callback1 = function (mutationsList, observer) { |
|
|
|
const el1 = mutationsList[0]; |
|
|
@ -231,23 +252,22 @@ function disabledMutationObserver(el) { |
|
|
|
const observe1 = new MutationObserver(callback1); |
|
|
|
// 以上述配置开始观察目标节点 |
|
|
|
observe1.observe(el, config); |
|
|
|
} |
|
|
|
|
|
|
|
// 地球对象 |
|
|
|
let _earth: any = undefined; |
|
|
|
let _viewer: any = undefined; |
|
|
|
} |
|
|
|
|
|
|
|
let earthTitle = '态势监控一张图'; |
|
|
|
const realTime: any = ref('……'); |
|
|
|
// 注意:Earth和Cesium的相关变量放在vue中,必须使用下划线作为前缀! |
|
|
|
// 地球对象 |
|
|
|
let _earth: any = undefined; |
|
|
|
let _viewer: any = undefined; |
|
|
|
|
|
|
|
_earthUI = undefined; |
|
|
|
_pin = undefined; |
|
|
|
let _handler: any = undefined; |
|
|
|
sceneTree: any = sceneTree; |
|
|
|
let earthTitle = '态势监控一张图'; |
|
|
|
const realTime: any = ref('……'); |
|
|
|
// 注意:Earth和Cesium的相关变量放在vue中,必须使用下划线作为前缀! |
|
|
|
|
|
|
|
_earthUI = undefined; |
|
|
|
_pin = undefined; |
|
|
|
let _handler: any = undefined; |
|
|
|
sceneTree: any = sceneTree; |
|
|
|
|
|
|
|
let url: any = { |
|
|
|
let url: any = { |
|
|
|
queryLabelList: 'military/msMapLabel/queryLabelAndDeviceList', |
|
|
|
queryLineList: 'military/msMapLine/list', |
|
|
|
queryCameraInfo: 'military/camera/site/getCameraInfoForEarth', |
|
|
@ -295,20 +315,20 @@ let url: any = { |
|
|
|
perimeterControl: '/third/api/perimeterControl', |
|
|
|
// 雷达重新发送报警信息 |
|
|
|
sendRadarAlarmByWebSocket: '/military/warn/sendRadarAlarmByWebSocket', |
|
|
|
}; |
|
|
|
let cameraData: any = {}; |
|
|
|
const cameraModalShow = ref(false); |
|
|
|
poiModalShow = false; |
|
|
|
let radioBtnShow = ref(true); |
|
|
|
glmId: any = []; |
|
|
|
let spinning = ref(false); |
|
|
|
let earthChangeSpin = ref(false); |
|
|
|
let websock: any = []; |
|
|
|
let timer: any = null; // 保活定时器 |
|
|
|
let timer2: any = null; // 时间定时器 |
|
|
|
// 报警清除-定时器 |
|
|
|
let alarmTrackClearTimer: any = null; |
|
|
|
let videoWindowProps: any = ref({ |
|
|
|
}; |
|
|
|
let cameraData: any = {}; |
|
|
|
const cameraModalShow = ref(false); |
|
|
|
poiModalShow = false; |
|
|
|
let radioBtnShow = ref(true); |
|
|
|
glmId: any = []; |
|
|
|
let spinning = ref(false); |
|
|
|
let earthChangeSpin = ref(false); |
|
|
|
let websock: any = []; |
|
|
|
let timer: any = null; // 保活定时器 |
|
|
|
let timer2: any = null; // 时间定时器 |
|
|
|
// 报警清除-定时器 |
|
|
|
let alarmTrackClearTimer: any = null; |
|
|
|
let videoWindowProps: any = ref({ |
|
|
|
visible: false, |
|
|
|
isAlarm: false, |
|
|
|
id: '', |
|
|
@ -327,62 +347,59 @@ let videoWindowProps: any = ref({ |
|
|
|
warnType: 0, |
|
|
|
warnContent: '', |
|
|
|
}, |
|
|
|
}); |
|
|
|
// 图层管理- 模型 ref 旧值 |
|
|
|
let sceneTreeOldRefValue = ''; |
|
|
|
let sceneInfo: any = null; |
|
|
|
// 区域节点By Ref划分 |
|
|
|
nodeConfigByRef = new Map(); |
|
|
|
let nodeCheckedByRef = new Map(); |
|
|
|
let areaByNodeId = new Map(); |
|
|
|
let statusByNodeId = new Map(); |
|
|
|
let imgByRef = new Map(); |
|
|
|
let radarAlarmDataMap = new Map(); |
|
|
|
wbUnifiedResponse = false; |
|
|
|
let hostDeviceMapById = new Map(); |
|
|
|
let alarmInfoMap = new Map(); |
|
|
|
toolbarShow = false; |
|
|
|
|
|
|
|
//addModelWin |
|
|
|
addModelWinShow = false; |
|
|
|
czmObject: any = null; |
|
|
|
node: any = null; |
|
|
|
type = ''; |
|
|
|
lineId = ''; |
|
|
|
areaCode = ''; |
|
|
|
areaByNodeIdModel = ''; |
|
|
|
el: any = null; |
|
|
|
eidtId: any = null; |
|
|
|
//addroamVideo |
|
|
|
addRoamVideoShow = false; |
|
|
|
|
|
|
|
// 控制窗口显示 |
|
|
|
const VideoFusionWinShow = ref(false); |
|
|
|
//传到子组件的值 |
|
|
|
toItemObj: any = { |
|
|
|
}); |
|
|
|
// 图层管理- 模型 ref 旧值 |
|
|
|
let sceneTreeOldRefValue = ''; |
|
|
|
let sceneInfo: any = null; |
|
|
|
// 区域节点By Ref划分 |
|
|
|
nodeConfigByRef = new Map(); |
|
|
|
let nodeCheckedByRef = new Map(); |
|
|
|
let areaByNodeId = new Map(); |
|
|
|
let statusByNodeId = new Map(); |
|
|
|
let imgByRef = new Map(); |
|
|
|
let radarAlarmDataMap = new Map(); |
|
|
|
wbUnifiedResponse = false; |
|
|
|
let hostDeviceMapById = new Map(); |
|
|
|
let alarmInfoMap = new Map(); |
|
|
|
toolbarShow = false; |
|
|
|
|
|
|
|
//addModelWin |
|
|
|
addModelWinShow = false; |
|
|
|
czmObject: any = null; |
|
|
|
node: any = null; |
|
|
|
type = ''; |
|
|
|
lineId = ''; |
|
|
|
areaCode = ''; |
|
|
|
areaByNodeIdModel = ''; |
|
|
|
el: any = null; |
|
|
|
eidtId: any = null; |
|
|
|
//addroamVideo |
|
|
|
addRoamVideoShow = false; |
|
|
|
|
|
|
|
// 控制窗口显示 |
|
|
|
const VideoFusionWinShow = ref(false); |
|
|
|
//传到子组件的值 |
|
|
|
toItemObj: any = { |
|
|
|
updateModel: {}, |
|
|
|
isUpdate: true, |
|
|
|
userSave: {}, |
|
|
|
}; |
|
|
|
// 节点值 |
|
|
|
domKey: any = ''; |
|
|
|
// 监控相机列表 |
|
|
|
cameraList: any = []; |
|
|
|
// 监控相机位置 |
|
|
|
monitorPosition: any = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
window.XE.ready().then(() => { |
|
|
|
}; |
|
|
|
// 节点值 |
|
|
|
domKey: any = ''; |
|
|
|
// 监控相机列表 |
|
|
|
cameraList: any = []; |
|
|
|
// 监控相机位置 |
|
|
|
monitorPosition: any = []; |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
window.XE.ready() |
|
|
|
.then(() => { |
|
|
|
// 加载标绘插件 |
|
|
|
return window.XE.HTML.loadJS('/earthsdk/XbsjEarth-Plugins/plottingSymbol/plottingSymbol.js'); |
|
|
|
}).then(async () => { |
|
|
|
}) |
|
|
|
.then(async () => { |
|
|
|
//地图初始化 |
|
|
|
await initMap() |
|
|
|
await initMap(); |
|
|
|
//随机数 |
|
|
|
window.guid = guid; |
|
|
|
//获取实时日期时间 |
|
|
@ -394,8 +411,9 @@ onMounted(async () => { |
|
|
|
return false; |
|
|
|
}; |
|
|
|
|
|
|
|
return true |
|
|
|
}).then(() => { |
|
|
|
return true; |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
//将回调延迟到下次 DOM 更新循环之后执行(针对由jq动态增加的元素绑定事件) |
|
|
|
nextTick(() => { |
|
|
|
{ |
|
|
@ -414,7 +432,7 @@ onMounted(async () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
return true |
|
|
|
return true; |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
// 轮询 |
|
|
@ -428,20 +446,19 @@ onMounted(async () => { |
|
|
|
radarAlarmTimeOutCheck(); |
|
|
|
}, 6 * 1000); |
|
|
|
} |
|
|
|
return true |
|
|
|
return true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
//地图初始化 |
|
|
|
function initMap() { |
|
|
|
//地图初始化 |
|
|
|
function initMap() { |
|
|
|
_earth = new window.XE.Earth('earthContainer'); |
|
|
|
window.$earth = _earth; |
|
|
|
window.$viewer = _viewer = window.$earth.czm.viewer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//飞入方法 |
|
|
|
async function fly() { |
|
|
|
//飞入方法 |
|
|
|
async function fly() { |
|
|
|
let position, rotation, viewDistance, duration; |
|
|
|
const sceneId = userStore.userInfo?.sceneId; |
|
|
|
await defHttp |
|
|
@ -476,16 +493,15 @@ async function fly() { |
|
|
|
_earth.camera.flyTo(position, viewDistance, rotation, duration); |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 保存更改的ref到模型和后台数据中; |
|
|
|
* @param {Object} model 当前模型 |
|
|
|
* @param {string} newRef 新的ref |
|
|
|
* @param {string} oldRef 旧的ref |
|
|
|
*/ |
|
|
|
const changeRef = _.debounce(function (model, newRef, oldRef) { |
|
|
|
const changeRef = _.debounce(function (model, newRef, oldRef) { |
|
|
|
// 当数值改变时且旧值不等于空时,更新模型的ref |
|
|
|
if (newRef !== oldRef && oldRef !== '') { |
|
|
|
// 修改后台的数据 |
|
|
@ -520,32 +536,28 @@ const changeRef = _.debounce(function (model, newRef, oldRef) { |
|
|
|
}) |
|
|
|
.run(); |
|
|
|
} |
|
|
|
}, 150); |
|
|
|
function handleNodeType(sn) { |
|
|
|
}, 150); |
|
|
|
function handleNodeType(sn) { |
|
|
|
return new HandleNodeType(sn); |
|
|
|
} |
|
|
|
// 随机数 |
|
|
|
function guid() { |
|
|
|
} |
|
|
|
// 随机数 |
|
|
|
function guid() { |
|
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { |
|
|
|
var r = (Math.random() * 16) | 0, |
|
|
|
v = c == 'x' ? r : (r & 0x3) | 0x8; |
|
|
|
return v.toString(16); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 打开视频融合 |
|
|
|
function roamPathSet() { |
|
|
|
// 打开视频融合 |
|
|
|
function roamPathSet() { |
|
|
|
// 打开视频融合 |
|
|
|
VideoFusionWinShow.value = true; |
|
|
|
// 关闭相机列表 |
|
|
|
cameraModalShow.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listenMittHandler(earthUI = null) { |
|
|
|
} |
|
|
|
|
|
|
|
function listenMittHandler(earthUI = null) { |
|
|
|
$mitt.on('winShow', function (e: any) { |
|
|
|
VideoFusionWinShow.value = e; |
|
|
|
}); |
|
|
@ -599,21 +611,18 @@ function listenMittHandler(earthUI = null) { |
|
|
|
$mitt.on('deviceCmd', (message: any) => { |
|
|
|
drawAllShips(message); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 告警模型显示/隐藏 |
|
|
|
function showAlarmPin(show) { |
|
|
|
// 告警模型显示/隐藏 |
|
|
|
function showAlarmPin(show) { |
|
|
|
alarmInfoMap.forEach((item, _index) => { |
|
|
|
item.pin.show = show; |
|
|
|
item.pin._div.hidden = !show; |
|
|
|
item.scanline.show = !show; |
|
|
|
}); |
|
|
|
} |
|
|
|
// 重命名 on-change-title 事件 使用 lodash.debounce 函数(防抖) |
|
|
|
const handleChangeTitle = _.debounce(function (options) { |
|
|
|
} |
|
|
|
// 重命名 on-change-title 事件 使用 lodash.debounce 函数(防抖) |
|
|
|
const handleChangeTitle = _.debounce(function (options) { |
|
|
|
const sn = options.item._inner.sn; |
|
|
|
const newTitle = options.title; |
|
|
|
|
|
|
@ -680,10 +689,10 @@ const handleChangeTitle = _.debounce(function (options) { |
|
|
|
}); |
|
|
|
}) |
|
|
|
.run(); |
|
|
|
}, 150); |
|
|
|
}, 150); |
|
|
|
|
|
|
|
// 右键菜单删除按钮的删除方法 |
|
|
|
function handlerModelDelete(url, params) { |
|
|
|
// 右键菜单删除按钮的删除方法 |
|
|
|
function handlerModelDelete(url, params) { |
|
|
|
// return deleteAction(url, params).then((res) => { |
|
|
|
return defHttp |
|
|
|
.delete( |
|
|
@ -700,16 +709,16 @@ function handlerModelDelete(url, params) { |
|
|
|
createMessage.error('删除失败'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取当前实时时间 |
|
|
|
function getRealTime() { |
|
|
|
// 获取当前实时时间 |
|
|
|
function getRealTime() { |
|
|
|
timer2 = setInterval(() => { |
|
|
|
realTime.value = getRealTime(); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const cameraPositionChange = _.debounce( |
|
|
|
const cameraPositionChange = _.debounce( |
|
|
|
(that) => { |
|
|
|
let height = window.$earth.camera.position[2]; |
|
|
|
if (height < 100) { |
|
|
@ -722,9 +731,9 @@ const cameraPositionChange = _.debounce( |
|
|
|
}, |
|
|
|
500, |
|
|
|
{ maxWait: 1000 } |
|
|
|
); |
|
|
|
//设置按钮颜色状态 |
|
|
|
function setIconByRef(ref, el) { |
|
|
|
); |
|
|
|
//设置按钮颜色状态 |
|
|
|
function setIconByRef(ref, el) { |
|
|
|
const status = statusByNodeId.get(ref); |
|
|
|
if (status != undefined && status != null) { |
|
|
|
let img = imgByRef.get(ref); |
|
|
@ -745,9 +754,9 @@ function setIconByRef(ref, el) { |
|
|
|
} |
|
|
|
img.setAttribute('style', 'width:16px;height:16px;margin-top:7px'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function getRandomArr(arr, count) { |
|
|
|
function getRandomArr(arr, count) { |
|
|
|
//从数组随机抽取元素 |
|
|
|
var shuffled = arr.slice(0), |
|
|
|
i = arr.length, |
|
|
@ -762,9 +771,9 @@ function getRandomArr(arr, count) { |
|
|
|
shuffled[i] = temp; |
|
|
|
} |
|
|
|
return shuffled.slice(min); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function setLoginPoint(data: any) { |
|
|
|
function setLoginPoint(data: any) { |
|
|
|
let position = [data.lon, data.lat, 0]; |
|
|
|
let rotation = [data.rotationX, data.rotationY, data.rotationZ]; |
|
|
|
let viewDistance = data.viewDistance; |
|
|
@ -799,11 +808,10 @@ function setLoginPoint(data: any) { |
|
|
|
pin.onclick = function () { |
|
|
|
_earth.camera.flyTo(position, viewDistance, rotation, duration); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//加载相机 |
|
|
|
function getCameraInfo(models, type) { |
|
|
|
//加载相机 |
|
|
|
function getCameraInfo(models, type) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
//请求电线杆信息 |
|
|
|
defHttp.get({ url: url.queryCameraInfo }, { isTransformResponse: false }).then(async (res) => { |
|
|
@ -815,10 +823,9 @@ function getCameraInfo(models, type) { |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function getPatrolRouteInfo(models) { |
|
|
|
function getPatrolRouteInfo(models) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
//执勤巡逻路线 |
|
|
|
defHttp.get({ url: url.queryPatrolRouteInfo }, { isTransformResponse: false }).then(async (res) => { |
|
|
@ -852,15 +859,14 @@ function getPatrolRouteInfo(models) { |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function removeHandler() { |
|
|
|
function removeHandler() { |
|
|
|
_handler.removeInputAction(window.Cesium.ScreenSpaceEventType.MOUSE_MOVE); //移除鼠标事件 |
|
|
|
_handler.removeInputAction(window.Cesium.ScreenSpaceEventType.LEFT_CLICK); //移除鼠标事件 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function radioChange(e) { |
|
|
|
function radioChange(e) { |
|
|
|
loadingStatus(); |
|
|
|
if (`${e.target.value}` == 'satellite') { |
|
|
|
window.$earth.sceneTree.$refs.satellite.czmObject.show = true; |
|
|
@ -869,29 +875,28 @@ function radioChange(e) { |
|
|
|
window.$earth.sceneTree.$refs.vector.czmObject.show = true; |
|
|
|
window.$earth.sceneTree.$refs.satellite.czmObject.show = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function radioChangeBtnShow(callback) { |
|
|
|
function radioChangeBtnShow(callback) { |
|
|
|
radioBtnShow.value = !radioBtnShow.value; |
|
|
|
callback(radioBtnShow.value); //回调返回当前状态 |
|
|
|
} |
|
|
|
function loadingStatus() { |
|
|
|
} |
|
|
|
function loadingStatus() { |
|
|
|
earthChangeSpin.value = !earthChangeSpin.value; //加载状态 |
|
|
|
setTimeout(() => { |
|
|
|
earthChangeSpin.value = !earthChangeSpin.value; //3秒后去除加载状态 |
|
|
|
}, 3000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function keepAlive() { |
|
|
|
defHttp.get({ url: url.keepAlive }, { isTransformResponse: false }).then((res) => { }); |
|
|
|
} |
|
|
|
function keepAlive() { |
|
|
|
defHttp.get({ url: url.keepAlive }, { isTransformResponse: false }).then((res) => {}); |
|
|
|
} |
|
|
|
|
|
|
|
function closeClient() { |
|
|
|
function closeClient() { |
|
|
|
chrome.call('close'); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function setLabelStatus(device, labelCode, id, code) { |
|
|
|
function setLabelStatus(device, labelCode, id, code) { |
|
|
|
const args = { |
|
|
|
device: device, |
|
|
|
code: code, // 命令码:0-撤防 1-布防 2-状态查询 3-其他预留 |
|
|
@ -954,8 +959,8 @@ function setLabelStatus(device, labelCode, id, code) { |
|
|
|
return err; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
function getAllModelInfo(models) { |
|
|
|
} |
|
|
|
function getAllModelInfo(models) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
//模型位置 |
|
|
|
|
|
|
@ -1148,9 +1153,9 @@ function getAllModelInfo(models) { |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 控制子元素的显示或者隐藏 |
|
|
|
function showOrHideChild(clickNode, earthUI, parentChecked) { |
|
|
|
} |
|
|
|
// 控制子元素的显示或者隐藏 |
|
|
|
function showOrHideChild(clickNode, earthUI, parentChecked) { |
|
|
|
const childs = clickNode.children; |
|
|
|
if (childs && childs.length > 0) { |
|
|
|
for (const child of childs) { |
|
|
@ -1184,12 +1189,10 @@ function showOrHideChild(clickNode, earthUI, parentChecked) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/* websocket-start */ |
|
|
|
function initWebSocket(configName) { |
|
|
|
/* websocket-start */ |
|
|
|
function initWebSocket(configName) { |
|
|
|
if ('WebSocket' in window) { |
|
|
|
let url = ''; |
|
|
|
switch (configName) { |
|
|
@ -1220,14 +1223,14 @@ function initWebSocket(configName) { |
|
|
|
} else { |
|
|
|
console.log('当前浏览器不支持websocket,请更换浏览器!'); |
|
|
|
} |
|
|
|
} |
|
|
|
function websocketonopen(e) { |
|
|
|
} |
|
|
|
function websocketonopen(e) { |
|
|
|
console.log('WebSocket连接成功'); |
|
|
|
} |
|
|
|
function websocketonerror(e) { |
|
|
|
} |
|
|
|
function websocketonerror(e) { |
|
|
|
console.log('WebSocket连接发生错误'); |
|
|
|
} |
|
|
|
let loreadAlarmInfo = _.debounce( |
|
|
|
} |
|
|
|
let loreadAlarmInfo = _.debounce( |
|
|
|
(url, eventSerialNum) => { |
|
|
|
defHttp |
|
|
|
.get( |
|
|
@ -1248,8 +1251,8 @@ let loreadAlarmInfo = _.debounce( |
|
|
|
}, |
|
|
|
2000, |
|
|
|
{ maxWait: 3000, trailing: true } |
|
|
|
); |
|
|
|
async function websocketonmessage(e) { |
|
|
|
); |
|
|
|
async function websocketonmessage(e) { |
|
|
|
//接收后端数据 |
|
|
|
var data = eval('(' + e.data + ')'); |
|
|
|
const cesium = window.Cesium; |
|
|
@ -1571,12 +1574,12 @@ async function websocketonmessage(e) { |
|
|
|
} else if (data.cmd == 'eventPublish') { |
|
|
|
window.getEventData(); |
|
|
|
} |
|
|
|
} |
|
|
|
function websocketclose(e) { |
|
|
|
} |
|
|
|
function websocketclose(e) { |
|
|
|
console.log('connection closed (' + e.code + ')'); |
|
|
|
createMessage.warn('websocket连接已断开', 3); |
|
|
|
} |
|
|
|
function websocketdosend(configName) { |
|
|
|
} |
|
|
|
function websocketdosend(configName) { |
|
|
|
//发送数据 |
|
|
|
spinning.value = !spinning.value; //加载状态 |
|
|
|
console.log('websock[configName]', websock[configName]); |
|
|
@ -1599,11 +1602,10 @@ function websocketdosend(configName) { |
|
|
|
spinning.value = !spinning.value; //加载状态 |
|
|
|
}, 3000); |
|
|
|
} |
|
|
|
} |
|
|
|
/* websocket-end */ |
|
|
|
|
|
|
|
} |
|
|
|
/* websocket-end */ |
|
|
|
|
|
|
|
function radarAlarmTimeOutCheck() { |
|
|
|
function radarAlarmTimeOutCheck() { |
|
|
|
const now = Date.now(); |
|
|
|
const timeout = 5 * 60 * 1000; |
|
|
|
// 遍历报警数据 |
|
|
@ -1616,8 +1618,8 @@ function radarAlarmTimeOutCheck() { |
|
|
|
clearAlarmModel(key); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
function clearRadarAlarmModel(radarAlarmDataMap, eventNum) { |
|
|
|
} |
|
|
|
function clearRadarAlarmModel(radarAlarmDataMap, eventNum) { |
|
|
|
if (radarAlarmDataMap.has(eventNum)) { |
|
|
|
let alarmData = radarAlarmDataMap.get(eventNum); |
|
|
|
for (let target of alarmData.target) { |
|
|
@ -1629,8 +1631,8 @@ function clearRadarAlarmModel(radarAlarmDataMap, eventNum) { |
|
|
|
} |
|
|
|
radarAlarmDataMap.delete(eventNum); |
|
|
|
} |
|
|
|
} |
|
|
|
function clearAlarmModel(eventNum) { |
|
|
|
} |
|
|
|
function clearAlarmModel(eventNum) { |
|
|
|
// let alarmInfoMapCopy = alarmInfoMap; |
|
|
|
// let radarAlarmDataMapCopy = radarAlarmDataMap; |
|
|
|
if (alarmInfoMap.has(eventNum)) { |
|
|
@ -1642,11 +1644,10 @@ function clearAlarmModel(eventNum) { |
|
|
|
alarmInfoMap.delete(eventNum); |
|
|
|
} |
|
|
|
clearRadarAlarmModel(radarAlarmDataMap, eventNum); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 根据经纬度获取高度 |
|
|
|
async function getHeigthByLonLat(lon = 88.8296258, lat = 27.4061859) { |
|
|
|
// 根据经纬度获取高度 |
|
|
|
async function getHeigthByLonLat(lon = 88.8296258, lat = 27.4061859) { |
|
|
|
var positions = [window.Cesium.Cartographic.fromDegrees(lon, lat)]; |
|
|
|
// var promise = Cesium.sampleTerrain(this._viewer.terrainProvider, 13, positions); |
|
|
|
var promise = window.Cesium.sampleTerrainMostDetailed(_viewer.terrainProvider, positions); |
|
|
@ -1659,9 +1660,9 @@ async function getHeigthByLonLat(lon = 88.8296258, lat = 27.4061859) { |
|
|
|
/* var terCartographic = new Cesium.Cartographic(1.5503694435245020004000376611976, 0.47832817936864542131039019315313, 0) |
|
|
|
var terHigh = this._viewer.scene.globe.getHeight(terCartographic); |
|
|
|
return terHigh; */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function cloneModel(modelObject: any) { |
|
|
|
function cloneModel(modelObject: any) { |
|
|
|
if (modelObject.czmObject.xbsjType === 'Model') { |
|
|
|
const modelConfig = { |
|
|
|
ref: '', |
|
|
@ -1713,8 +1714,8 @@ function cloneModel(modelObject: any) { |
|
|
|
} |
|
|
|
|
|
|
|
// return model |
|
|
|
} |
|
|
|
function cloneShamNode(oldRef, id, title) { |
|
|
|
} |
|
|
|
function cloneShamNode(oldRef, id, title) { |
|
|
|
const shamNode = window.$earth.sceneTree.$refs['node_' + oldRef]; |
|
|
|
const newShamNode = { |
|
|
|
ref: 'node_' + id, |
|
|
@ -1724,8 +1725,8 @@ function cloneShamNode(oldRef, id, title) { |
|
|
|
}; |
|
|
|
// that.currentModel = response.result |
|
|
|
shamNode.parent.children.push(newShamNode); |
|
|
|
} |
|
|
|
function getAreaCode(item) { |
|
|
|
} |
|
|
|
function getAreaCode(item) { |
|
|
|
const currentRef = item._inner.sn.ref; |
|
|
|
if (!areaByNodeId.has(currentRef)) { |
|
|
|
if (item.parent) { |
|
|
@ -1734,9 +1735,9 @@ function getAreaCode(item) { |
|
|
|
} else { |
|
|
|
return areaByNodeId.get(currentRef); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function setAllLabelStatus(selectRef, item, wbUnifiedResponse) { |
|
|
|
function setAllLabelStatus(selectRef, item, wbUnifiedResponse) { |
|
|
|
//监控点 |
|
|
|
if (selectRef.startsWith('monitor')) { |
|
|
|
let grandsons: any = []; |
|
|
@ -1801,7 +1802,8 @@ function setAllLabelStatus(selectRef, item, wbUnifiedResponse) { |
|
|
|
{ |
|
|
|
url: url.setDefenseArea, |
|
|
|
params: args, |
|
|
|
}, { isTransformResponse: false } |
|
|
|
}, |
|
|
|
{ isTransformResponse: false } |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
if (!response.success) { |
|
|
@ -1886,12 +1888,10 @@ function setAllLabelStatus(selectRef, item, wbUnifiedResponse) { |
|
|
|
// break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 资源销毁 |
|
|
|
onBeforeUnmount(() => { |
|
|
|
// 资源销毁 |
|
|
|
onBeforeUnmount(() => { |
|
|
|
// vue程序销毁时,需要清理相关资源 |
|
|
|
_earth = _earth && _earth.destroy(); |
|
|
|
websocketclose(null); |
|
|
@ -1899,6 +1899,5 @@ onBeforeUnmount(() => { |
|
|
|
clearInterval(timer); |
|
|
|
clearInterval(timer2); |
|
|
|
clearInterval(alarmTrackClearTimer); |
|
|
|
}) |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|