|
@@ -20,8 +20,12 @@ import icon_map_yjsj from '@/assets/icons/home/yjsj.svg';
|
|
|
/** @ts-ignore */
|
|
|
import icon_map_yjdw from '@/assets/icons/home/yjdw.svg';
|
|
|
/** @ts-ignore */
|
|
|
+import icon_map_yjdw_w from '@/assets/icons/home/icon_map_yjdw_w.svg';
|
|
|
+/** @ts-ignore */
|
|
|
import icon_map_yjck from '@/assets/icons/home/yjck.svg';
|
|
|
/** @ts-ignore */
|
|
|
+import icon_map_yjck_w from '@/assets/icons/home/icon_map_yjck_w.svg';
|
|
|
+/** @ts-ignore */
|
|
|
import icon_map_spjk from '@/assets/icons/home/spjk.svg';
|
|
|
/** @ts-ignore */
|
|
|
import icon_map_dcz from '@/assets/icons/home/dcz.svg';
|
|
@@ -30,7 +34,6 @@ import icon_map_dpf from '@/assets/icons/home/dpf.svg';
|
|
|
/** @ts-ignore */
|
|
|
import icon_map_dbsb from '@/assets/icons/home/dbsb.svg';
|
|
|
|
|
|
-
|
|
|
import './index.scss';
|
|
|
import {
|
|
|
GET_INCIDENT_DIALOG_HTML,
|
|
@@ -58,7 +61,7 @@ const MARKER_MAP_TYPES = [
|
|
|
'应急队伍',
|
|
|
'应急仓库',
|
|
|
'应急事件',
|
|
|
- '单兵'
|
|
|
+ '单兵',
|
|
|
] as const;
|
|
|
|
|
|
export type MarkerMapType = typeof MARKER_MAP_TYPES[number];
|
|
@@ -82,6 +85,21 @@ interface ActionType {
|
|
|
remove: Function;
|
|
|
}
|
|
|
|
|
|
+// locationType + resourceType
|
|
|
+const RESOURCE_ICON_MAP = {
|
|
|
+ '11': icon_map_yjck_w, // 水上 仓库
|
|
|
+ '21': icon_map_yjck, // 陆上 仓库
|
|
|
+ '12': icon_map_yjdw_w, // 水上 队伍
|
|
|
+ '22': icon_map_yjdw, // 陆上 队伍
|
|
|
+ '13': icon_map_yjcl, // 水上 车辆
|
|
|
+ '23': icon_map_yjcl, // 陆上 车辆
|
|
|
+};
|
|
|
+
|
|
|
+const getResourceIcon = (locationType: string, resourceType: string) => {
|
|
|
+ // @ts-ignore
|
|
|
+ return RESOURCE_ICON_MAP[locationType + resourceType] || '';
|
|
|
+};
|
|
|
+
|
|
|
// 路况信息刷新间隔
|
|
|
const REFRESH_TRAFFIC_TIME = 60000;
|
|
|
|
|
@@ -184,7 +202,7 @@ export default defineComponent({
|
|
|
action: () =>
|
|
|
handleAddMarkers('单兵', store.singleDevice, icon_map_dbsb),
|
|
|
remove: () => handleRemoveMarkers('单兵', store.singleDevice),
|
|
|
- }
|
|
|
+ },
|
|
|
]);
|
|
|
|
|
|
const getMarkerPopupHTML = (type: MarkerMapType, marker: MarkerType) => {
|
|
@@ -199,177 +217,188 @@ export default defineComponent({
|
|
|
handleSetDetailMarker(marker);
|
|
|
store.currentIncident = marker;
|
|
|
});
|
|
|
- case '单兵': {
|
|
|
+ case '单兵': {
|
|
|
var callback = () => {
|
|
|
- console.log(marker["deviceCode"])
|
|
|
- console.log(marker["userId"])
|
|
|
+ console.log(marker['deviceCode']);
|
|
|
+ console.log(marker['userId']);
|
|
|
const self = this;
|
|
|
-
|
|
|
- daHuaStore.DAHUAUserObj(marker["userId"]).then(deviceUser=>{
|
|
|
- console.log(deviceUser);
|
|
|
- let memberObj = {
|
|
|
- userName:deviceUser.userName,
|
|
|
- userId:deviceUser.userCode,
|
|
|
- region:deviceUser.paasId,
|
|
|
- type:'single',
|
|
|
- // speak:'true',
|
|
|
- number:deviceUser.userPhone,
|
|
|
- deviceId:marker["deviceCode"],
|
|
|
- channelId:marker["channelId"],
|
|
|
- }
|
|
|
- let meetObj = JSON.parse(localStorage.getItem('meeting'));
|
|
|
- let memberList = [];
|
|
|
- memberList.push(meetObj.member[0]);
|
|
|
- memberList.push(memberObj);
|
|
|
- meetObj.member = memberList
|
|
|
- console.log(meetObj);
|
|
|
- daHuaStore.DAHUAMeetingMember(meetObj).then(data=>{
|
|
|
- // console.log(11111111)
|
|
|
- daHuaStore.DAHUAMeetingUser(meetObj.meetId);
|
|
|
- daHuaStore.DAHUAUserInfo().then(u => {
|
|
|
- console.log(u,'+++++++');
|
|
|
- // initSocket(u.userCode,memberObj);
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- // console.log(memberObj);
|
|
|
- // meetObj.mebmber.push(memberObj);
|
|
|
|
|
|
- });
|
|
|
+ const DAHUA = document.getElementById('DAHUA') as HTMLIFrameElement;
|
|
|
+ DAHUA?.contentWindow?.postMessage(
|
|
|
+ {
|
|
|
+ key: 'danbing',
|
|
|
+ value: marker['userId'],
|
|
|
+ deviceId: marker['deviceCode'],
|
|
|
+ channelId: marker['channelId'],
|
|
|
+ },
|
|
|
+ '*',
|
|
|
+ );
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+ marker['userId'] &&
|
|
|
+ daHuaStore.DAHUAUserObj(marker['userId']).then((deviceUser) => {
|
|
|
+ console.log(deviceUser);
|
|
|
+ let memberObj = {
|
|
|
+ userName: deviceUser.userName,
|
|
|
+ userId: deviceUser.userCode,
|
|
|
+ region: deviceUser.paasId,
|
|
|
+ type: 'single',
|
|
|
+ // speak:'true',
|
|
|
+ number: deviceUser.userPhone,
|
|
|
+ deviceId: marker['deviceCode'],
|
|
|
+ channelId: marker['channelId'],
|
|
|
+ };
|
|
|
+ let meetObj = JSON.parse(
|
|
|
+ localStorage.getItem('meeting') ?? '{}',
|
|
|
+ );
|
|
|
+ let memberList = [];
|
|
|
+ memberList.push(meetObj.member[0]);
|
|
|
+ memberList.push(memberObj);
|
|
|
+ meetObj.member = memberList;
|
|
|
+ console.log(meetObj);
|
|
|
+ daHuaStore.DAHUAMeetingMember(meetObj).then((data) => {
|
|
|
+ // daHuaStore.DAHUAMeetingUser(meetObj.meetId);
|
|
|
+ initSocket(meetObj.user.userCode, memberObj);
|
|
|
+ });
|
|
|
+
|
|
|
+ // console.log(memberObj);
|
|
|
+ // meetObj.mebmber.push(memberObj);
|
|
|
+ });
|
|
|
// console.log(daHuaStore.deviceUser);
|
|
|
};
|
|
|
- return GET_SINGLE_DEVICE_DIALOG_HTML(marker as SingleDeviceItem,callback);
|
|
|
+ return GET_SINGLE_DEVICE_DIALOG_HTML(
|
|
|
+ marker as SingleDeviceItem,
|
|
|
+ callback,
|
|
|
+ );
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
case '应急仓库':
|
|
|
- return GET_WAREHOUSE_DIALOG_HTML({
|
|
|
- name: '应急仓库 111',
|
|
|
- address: 'suqian',
|
|
|
- manageUnit: 'xxxx',
|
|
|
- contactName: '张三',
|
|
|
- contactPhone: '138 1234 1234',
|
|
|
- });
|
|
|
+ return GET_WAREHOUSE_DIALOG_HTML(marker);
|
|
|
case '应急车辆':
|
|
|
- return GET_VEHICLES_DIALOG_HTML({
|
|
|
- name: '苏A· 12345',
|
|
|
- manageUnit: 'xxxx',
|
|
|
- });
|
|
|
+ return GET_VEHICLES_DIALOG_HTML(marker);
|
|
|
case '应急队伍':
|
|
|
- return GET_TEAM_DIALOG_HTML({
|
|
|
- name: 'Team 1',
|
|
|
- manageUnit: 'xxxxx',
|
|
|
- // carryGoods: '水, 饮料',
|
|
|
- // num: '2',
|
|
|
- contactName: '张三',
|
|
|
- contactPhone: '138 1234 1234',
|
|
|
- });
|
|
|
+ return GET_TEAM_DIALOG_HTML(marker);
|
|
|
|
|
|
case '视频监控':
|
|
|
- return GET_VIDEO_DIALOG_HTML(
|
|
|
- {
|
|
|
- name: '12312313',
|
|
|
- addr: 'su qian',
|
|
|
- link: '',
|
|
|
- },
|
|
|
- () => {
|
|
|
- if (route.query.id) {
|
|
|
- store.livevideovisible = true;
|
|
|
- const idx = store.livevideos.findIndex(
|
|
|
- (item) => item.locations === marker.locations,
|
|
|
- );
|
|
|
- if (idx < 0) {
|
|
|
- store.livevideos.length === 6
|
|
|
- ? (store.livevideos = [
|
|
|
- marker,
|
|
|
- ...store.livevideos.slice(1, 6),
|
|
|
- ])
|
|
|
- : store.livevideos.push(marker);
|
|
|
- } else {
|
|
|
- ElMessage.info({ message: '该点位已经打开~' });
|
|
|
- }
|
|
|
+ return GET_VIDEO_DIALOG_HTML(marker, () => {
|
|
|
+ if (route.query.id) {
|
|
|
+ store.livevideovisible = true;
|
|
|
+ const idx = store.livevideos.findIndex(
|
|
|
+ (item) => item.locations === marker.locations,
|
|
|
+ );
|
|
|
+ if (idx < 0) {
|
|
|
+ store.livevideos.length === 6
|
|
|
+ ? (store.livevideos = [
|
|
|
+ marker,
|
|
|
+ ...store.livevideos.slice(1, 6),
|
|
|
+ ])
|
|
|
+ : store.livevideos.push(marker);
|
|
|
+ } else {
|
|
|
+ ElMessage.info({ message: '该点位已经打开~' });
|
|
|
}
|
|
|
- },
|
|
|
- );
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const videoplay =(item)=>{
|
|
|
+ const videoplay = (item: { type: string; userId: any; channelId: any }) => {
|
|
|
console.log('播放视频');
|
|
|
- console.log(item);
|
|
|
- if (!theSocket.websocket) {
|
|
|
- this.$Message.warning("请先打开视频插件");
|
|
|
+ console.log(item);
|
|
|
+ if (!window.theSocket.websocket) {
|
|
|
+ ElMessage.warning('请先打开视频插件');
|
|
|
return;
|
|
|
}
|
|
|
- if (item.type == "client") {
|
|
|
- this.slectOptionmini(item.userId).then((arr) => {
|
|
|
+ if (item.type == 'client') {
|
|
|
+ window.slectOptionmini(item.userId).then((arr: any) => {
|
|
|
if (arr) {
|
|
|
- // this.vPlayArea.openAppVideo(arr);
|
|
|
+ window.vPlayArea.openAppVideo(arr);
|
|
|
}
|
|
|
});
|
|
|
- } else if (item.type == "single") { //播放单兵视频
|
|
|
+ } else if (item.type == 'single') {
|
|
|
+ //播放单兵视频
|
|
|
pullFlow(item.channelId);
|
|
|
- } else if (item.type == "vehicle") { //播放车载视频
|
|
|
+ } else if (item.type == 'vehicle') {
|
|
|
+ //播放车载视频
|
|
|
pullFlow(item.channelId);
|
|
|
- } else if (item.type == "uav_dev") { //播放无人机视频
|
|
|
+ } else if (item.type == 'uav_dev') {
|
|
|
+ //播放无人机视频
|
|
|
pullFlow(item.channelId);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- const pullFlow = (chinnelId) => {
|
|
|
- if (chinnelId) {
|
|
|
- window.vPlayArea&&window.vPlayArea.realTimeVideo([{"channelId": chinnelId}]);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const pullFlow = (channelId: any) => {
|
|
|
+ channelId &&
|
|
|
+ window.vPlayArea &&
|
|
|
+ window.vPlayArea.realTimeVideo([{ channelId }]);
|
|
|
+ };
|
|
|
|
|
|
- const initSocket =(userCode,memberObj) => {
|
|
|
+ const initSocket = (
|
|
|
+ userCode: string,
|
|
|
+ memberObj: {
|
|
|
+ userName?: any;
|
|
|
+ userId: any;
|
|
|
+ region?: any;
|
|
|
+ type: string;
|
|
|
+ number?: any;
|
|
|
+ deviceId?: any;
|
|
|
+ channelId: any;
|
|
|
+ },
|
|
|
+ ) => {
|
|
|
const self = this;
|
|
|
console.log(userCode);
|
|
|
- localStorage.setItem("userId",userCode);
|
|
|
+ localStorage.setItem('userId', userCode);
|
|
|
//初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
|
|
|
- window.theSocket = new InitWebSocketClass(
|
|
|
- userCode,localStorage.getItem("DAHUA_token"), {
|
|
|
+ window.theSocket = new window.InitWebSocketClass(
|
|
|
+ userCode,
|
|
|
+ localStorage.getItem('DAHUA_token'),
|
|
|
+ {
|
|
|
//客户端登陆成功通知;
|
|
|
- loginSuccess: (v)=> {
|
|
|
+ loginSuccess: (v: any) => {
|
|
|
console.log(2222222222222222);
|
|
|
- console.log("loginSuccess-->", v);
|
|
|
+ console.log('loginSuccess-->', v);
|
|
|
initWnd();
|
|
|
},
|
|
|
//客户端窗口被拉起通知
|
|
|
- onCreateVideoSuccess: v => {
|
|
|
- console.log("客户端onCreateVideoSuccess-----", v);
|
|
|
+ onCreateVideoSuccess: (v: any) => {
|
|
|
+ console.log('客户端onCreateVideoSuccess-----', v);
|
|
|
},
|
|
|
//重点:统一分发客户端ws消息;vue 可以统一用$bus分发.第三方消息分发自定
|
|
|
- onSocketBackInfos: data => {
|
|
|
+ onSocketBackInfos: (data: {
|
|
|
+ method: string;
|
|
|
+ params: { result: number; handleName: string };
|
|
|
+ }) => {
|
|
|
//视频窗口创建成功通知
|
|
|
- if (data && data.method === "createVideoDialogReuslt" && data.params.result === 0) {
|
|
|
- if (
|
|
|
- data.params.handleName === "#vPlayArea") {
|
|
|
+ if (
|
|
|
+ data &&
|
|
|
+ data.method === 'createVideoDialogReuslt' &&
|
|
|
+ data.params.result === 0
|
|
|
+ ) {
|
|
|
+ if (data.params.handleName === '#vPlayArea') {
|
|
|
//客户端窗口创建好后,界面显示窗口;
|
|
|
window.vPlayArea.resize();
|
|
|
- ElMessage.warning("视频窗口创建成功!");
|
|
|
+ ElMessage.warning('视频窗口创建成功!');
|
|
|
videoplay(memberObj);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
);
|
|
|
- console.log(theSocket);
|
|
|
+ // console.log(theSocket);
|
|
|
//socket实例初始化websocket回调方法;
|
|
|
window.theSocket
|
|
|
.initWebSocket()
|
|
|
- .then(v => {
|
|
|
- console.log();
|
|
|
+ .then((v: any) => {
|
|
|
if (v) {
|
|
|
- ElMessage.warning("视频插件登陆完成!");
|
|
|
+ ElMessage.warning('视频插件登陆完成!');
|
|
|
}
|
|
|
})
|
|
|
- .catch(v => {
|
|
|
- ElMessage.warning("若要观看实时视频,请先安装视频插件");
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage.warning('若要观看实时视频,请先安装视频插件');
|
|
|
});
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
- const initWnd =() => {
|
|
|
+ const initWnd = () => {
|
|
|
console.log(1111);
|
|
|
//左边窗口类型参数 分割 2行2列
|
|
|
const typeObj = {
|
|
@@ -380,18 +409,18 @@ export default defineComponent({
|
|
|
playerCtrlBarEnable: false,
|
|
|
displayMode: 0,
|
|
|
playMode: 0,
|
|
|
- playParams: {}
|
|
|
+ playParams: {},
|
|
|
};
|
|
|
//左边窗口实例
|
|
|
window.vPlayArea = new window.VideoPlay(
|
|
|
- "#vPlayArea",
|
|
|
- window.theSocket.websocket,//一个浏览器tab页面公用一个
|
|
|
- window.theSocket.socketCode,//一个浏览器tab页面公用一个
|
|
|
- typeObj
|
|
|
+ '#vPlayArea',
|
|
|
+ window.theSocket.websocket, //一个浏览器tab页面公用一个
|
|
|
+ window.theSocket.socketCode, //一个浏览器tab页面公用一个
|
|
|
+ typeObj,
|
|
|
);
|
|
|
//左边窗口初始化
|
|
|
- window.vPlayArea.init();
|
|
|
- }
|
|
|
+ window.vPlayArea.init();
|
|
|
+ };
|
|
|
|
|
|
const updateTrafficSource = () => {
|
|
|
if (state.map.getSource('Traffic')) {
|
|
@@ -441,7 +470,14 @@ export default defineComponent({
|
|
|
state.markers.push(
|
|
|
...markers.map((i) => {
|
|
|
const nextImage =
|
|
|
- type === '应急事件' ? getIncidentImage(i?.status) : image;
|
|
|
+ type === '应急事件'
|
|
|
+ ? getIncidentImage(i?.status)
|
|
|
+ : i.locationType && i.resourceType
|
|
|
+ ? getResourceIcon(
|
|
|
+ i.locationType.toString(),
|
|
|
+ i.resourceType.toString(),
|
|
|
+ )
|
|
|
+ : image;
|
|
|
const popup = new window.minemap.Popup({
|
|
|
anchor: 'left',
|
|
|
closeOnClick: true,
|
|
@@ -643,9 +679,12 @@ export default defineComponent({
|
|
|
// 如果存在id
|
|
|
await incidentStore.getIncidentItem(route.query.id as string);
|
|
|
handleSetDetailMarker(incidentStore.incidentDetail.baseInfo ?? {});
|
|
|
-
|
|
|
- document.getElementById("vPlayArea").style.height = (window.innerHeight - 20) + "px";
|
|
|
- window.theSocket && window.theSocket.resize();
|
|
|
+
|
|
|
+ const vPlayAreaEl = document.getElementById('vPlayArea');
|
|
|
+
|
|
|
+ vPlayAreaEl &&
|
|
|
+ (vPlayAreaEl.style.height = window.innerHeight - 20 + 'px');
|
|
|
+ window.theSocket && window.theSocket.resize();
|
|
|
});
|
|
|
|
|
|
watch(
|
|
@@ -697,7 +736,7 @@ export default defineComponent({
|
|
|
return () => (
|
|
|
<div class="task-map-container">
|
|
|
<MapView v-model:map={state.map} />
|
|
|
- <div id='vPlayArea' />
|
|
|
+ <div id="vPlayArea" />
|
|
|
<div
|
|
|
class={clsx('address-type-card-container', {
|
|
|
['in-detail']: props.readonly,
|