<template>
	<div class="screen-main">
		<!--头部展示-->
		<div class="screen-header">
			<div class="header-left-bg">驾驶舱</div>
			<div class="header-right-action">
				<div class="right-action-clock">
					<span class="action-time">2022-06-22</span>
					<span class="action-time">周三下午 </span>
					<span class="action-time">17:59:52</span>
				</div>
			</div>
		</div>
		<!--图层控制-->
		<div class="screen-ctrl">
			<div class="screen-filter">
				<div class="filter-content">
					<div class="filter-ctrl" v-show="filterCtrlFocus">
						<div class="screen-check-content hoverPointer" @click="markerClick(0)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[0]}"></span>
							<span class="box-text">全部</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(1)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[1]}"></span>
							<span class="box-text">车间名称</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(2)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[2]}"></span>
							<span class="box-text">摄像头</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(3)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[3]}"></span>
							<span class="box-text">消防物资</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(4)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[4]}"></span>
							<span class="box-text">危险作业</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(5)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[5]}"></span>
							<span class="box-text">风险区域</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(6)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[6]}"></span>
							<span class="box-text">车辆</span>
						</div>
						<div class="screen-check-content hoverPointer" @click="markerClick(7)">
							<span class="box-btn box-uncheck" :class="{'box-check':markList[7]}"></span>
							<span class="box-text">人员</span>
						</div>
						<div class="caret-dropdown">
							<el-icon @click="userSelect" v-if="showUserSelect" :size="14">
								<ArrowUpBold/>
							</el-icon>
							<el-icon @click="userSelect" v-else :size="14">
								<ArrowDownBold/>
							</el-icon>
						</div>
					</div>
					<div class="drop-content" v-if="showUserSelect">
						<div @click="changeDropIndex('1')" class="drop-content-item"
							 :class="{'active':dropIndex==='1'}">全部
						</div>
						<div @click="changeDropIndex('2')" class="drop-content-item"
							 :class="{'active':dropIndex==='2'}">内部人员
						</div>
						<div @click="changeDropIndex('3')" class="drop-content-item"
							 :class="{'active':dropIndex==='3'}">承包商
						</div>
						<div @click="changeDropIndex('4')" class="drop-content-item"
							 :class="{'active':dropIndex==='4'}">访客
						</div>
					</div>
					<div class="filter-action showroam">
						<div v-if="filterCtrlFocus" class="action-shrink" @click="filterCtrlFocusChange"></div>
						<div v-else class="action-shrink shrink-hidden" @click="filterCtrlFocusChange"></div>
						<div v-if="autoRun" class="action-roam roam-pause" @click="autoRunChange"></div>
						<div v-else class="action-roam roam-play" @click="autoRunChange"></div>
					</div>
				</div>
			</div>
			<!--搜索-->
			<div class="screen-search">
				<div class="search-content"><input type="text" placeholder="输入姓名/定位卡号/车牌号进行查找" class="input-focus"><span
					class="close-btn el-icon-circle-close" style="display: none;"></span>
					<div class="search"></div>
					<div class="auto-suggestion" style="display: none;">
						<div class="suggestion-select-ul"></div>
					</div>
				</div>
			</div>
		</div>
		<!--人员统计-->
		<div class="screen-cockpit">
			<div class="cockpit-count">
				<div class="divider"></div>
				<div class="simple-title">数据统计</div>
				<div class="count-list">
					<div class="count-list-item">
						<div class="item-img item-img1"></div>
						<div class="item-info">
							<div title="外来人员" class="normal">外来人员</div>
							<div class="bottom"><span class="large">0</span>&nbsp;<span class="normal">人</span>
							</div>
						</div>
					</div>
					<div class="count-list-item">
						<div class="item-img item-img2"></div>
						<div class="item-info">
							<div title="员工" class="normal">员工</div>
							<div class="bottom">
								<span class="large">76</span>&nbsp;<span class="normal">人</span>
							</div>
						</div>
					</div>
					<div class="count-list-item">
						<div class="item-img item-img3"></div>
						<div class="item-info">
							<div title="承包商" class="normal">承包商</div>
							<div class="bottom">
								<span class="large">0</span>&nbsp;<span class="normal">人</span>
							</div>
						</div>
					</div>
					<div class="count-list-item">
						<div class="item-img item-img4"></div>
						<div class="item-info">
							<div title="内部车辆" class="normal">内部车辆</div>
							<div class="bottom">
								<span class="large">2</span>&nbsp;<span class="normal">辆</span>
							</div>
						</div>
					</div>
					<div class="count-list-item">
						<div class="item-img item-img5"></div>
						<div class="item-info">
							<div title="外部车辆" class="normal">外部车辆</div>
							<div class="bottom">
								<span class="large">0</span>&nbsp;<span class="normal">辆</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="cockpit-alarm">
				<div class="divider"></div>
				<div class="simple-title">
					<span>告警实时展示</span>
					<div class="simple-btn-bg alarm-bell danger">
						<span>9</span>&nbsp;报警
					</div>
				</div>
				<div class="alarm-content">
					<div class="content-left">
						<div class="alarm-danger"></div>
					</div>
					<div class="content-right">
						<div title="缺员报警 3" class="alarm-item alarm-item-danger"><span class="item-icon"></span><span
							class="item-name">缺员报警</span><span class="item-number" style="">3</span></div>
						<div title="超员报警 2" class="alarm-item alarm-item-danger"><span class="item-icon"></span><span
							class="item-name">超员报警</span><span class="item-number" style="">2</span></div>
						<div title="静止报警 0" class="alarm-item alarm-item-safe"><span class="item-icon"></span><span
							class="item-name">静止报警</span><span class="item-number" style="display: none;">0</span></div>
						<div title="越界报警 2" class="alarm-item alarm-item-danger"><span class="item-icon"></span><span
							class="item-name">越界报警</span><span class="item-number" style="">2</span></div>
						<div title="一键报警 0" class="alarm-item alarm-item-safe"><span class="item-icon"></span><span
							class="item-name">一键报警</span><span class="item-number" style="display: none;">0</span></div>
						<div title="滞留报警 0" class="alarm-item alarm-item-safe"><span class="item-icon"></span><span
							class="item-name">滞留报警</span><span class="item-number" style="display: none;">0</span></div>
						<div title="车辆报警 0" class="alarm-item alarm-item-safe"><span class="item-icon"></span><span
							class="item-name">车辆报警</span><span class="item-number" style="display: none;">0</span></div>
						<div title="作业报警 2" class="alarm-item alarm-item-danger"><span class="item-icon"></span><span
							class="item-name">作业报警</span><span class="item-number" style="">2</span></div>
					</div>
				</div><!----></div>
			<div class="cockpit-info">
				<div class="divider"></div>
				<div class="simple-title">
					<div class="header-tab"><span class="tab-item tab-item-active">区域信息情况</span><span class="tab-item">部门信息情况</span>
					</div>
					<div class="simple-btn-bg alarm-btn">需充电卡片0人</div>
				</div>

			</div>
		</div>
		<!--切换-->
		<div class="screen-tab">
			<div class="screen-tab-content">
				<div class="tab-menu tab-menu-item tab-menu-active"><span class="tab-menu-text">驾驶舱</span></div>
				<div class="tab-menu tab-menu-item"><span class="tab-menu-text">监控</span></div>
				<div class="tab-menu tab-menu-item"><span class="tab-menu-text">追踪</span></div>
				<div class="tab-menu tab-menu-item"><span class="tab-menu-text">最终位置</span></div>
				<div class="tab-menu tab-menu-item"><span class="tab-menu-text">疏散演练</span></div>
			</div>
		</div>
		<!--地图-->
		<div id='mapContainer'></div>
		<!--视频弹窗-->
	<!--	<div style="display: block;position:absolute;z-index: 10;top: 0;
    background: rgba(24,36,51,.7);
    padding: 0 16px 16px;box-sizing: border-box" id="vchannelWrap">
			<div class="v_title">1111111</div>
			<div class="v_masker"></div>
		</div>-->
	</div>
</template>
<script>
	export default {
		data() {
			return {
				domMarkerLayer:null,
				boxMarkerLayer: null,//风险区域
				pointMarkerLayer: null,//点位图层
				polygonMaskerLayer: null,//危险作业
				cameraMaskerLayer: null,//摄像头
				materialsMaskerLayer: null,//消防物资
				carsMaskerLayer: null,//车辆
				manMaskerLayer: null,//人员
				flyManager: null,
				dropIndex: '1',
				markList: [false, false, false, false, false, false, false, false],
				autoRun: false,
				showUserSelect: false,
				filterCtrlFocus: true,
				Vchannels: [],
				url: '',
				params: {
					json: {
						data: {
							channelId: "",
							streamType: "2",
							type: "flv"
						}
					},
					code: 'video_realtime'
				},
			}
		},
		created() {
			const scriptInfo = document.createElement("script");
			scriptInfo.setAttribute("data-callType", "callScript");
			scriptInfo.src = "https://cdn.bootcdn.net/ajax/libs/flv.js/1.6.2/flv.js";
			document.head.appendChild(scriptInfo)
		},
		mounted() {
			window.map = new jsmap.JSMap({
				mapType: jsmap.JSMapType.MAP_3D,
				container: 'mapContainer',
				mapServerURL: 'data/map',
				enableShadows: false, //是否开启阴影 默认false
				enableLighting: false, //是否开发光照 默认false
				showBuildingMarker: false,
				mapScaleLevelRange: [16, 23],//比例尺级别范围， 16级到23级,默认[1,24]
				floorControlOptions: {
					floorHeight: 20,//楼层间距
					position: jsmap.JSControlPosition.RIGHT_TOP,//控件位置
					offset: {
						x: 10,
						y: 10,
					}//控件偏移位置
				},
				imageryProvider: jsmap.JSImageryProviderType.IMAGE_TDT,
				backgroundColor: '#3798ff',  //背景颜色
				viewOptions: {
					//屏幕中心坐标
					center: {x: 114.63059258861512, y: 38.81407163905287, z: 1},
					// center: {x:120,y:30,z:10},
					//相机距屏幕中心点距离（单位m）
					distance: 400,
					// 旋转角（单位°）
					rotate: 0,
					//倾斜角（单位°）
					tilt: 45,
				}
			});
			window.map.openMapById('0000');
			window.map.on('loadComplete', e => {
				var drawTool2 = new jsmap.JSDrawToolControl({
					position: jsmap.JSControlPosition.RIGHT_TOP,  //画图工具在容器中的相对位置，当前为右上
					offset: {
						x: 80,
						y: 180
					},  //偏移量
					drawMode: jsmap.JSDrawMode.POLYGON,  //画图类型POINT:画点  POLYLINE:画线  POLYGON:画面

					//画图结束的回调，返回所画的面信息
					callback: (feature) => {
						// console.log('add', feature);
						console.log(feature.properties);//type:POLYGON;id:"";name:"";floorNo:"";floorId:""
						console.log(feature.geometry);//feature.geometry.coordinates:[[],[]]面数组
						debugger;
					},
					//移除相应面的回调，返回相应面信息
					removeCallback: (feature) => {
						// console.log('remove', feature);
					},
					//编辑相应面的回调，返回相应面信息
					editCallback: (feature) => {
						// console.log('editCallback', feature);
					},
					//定位到相应面的回调，返回相应面信息
					locateCallback: (feature) => {
						// console.log('locate..', feature);
					}
				});
				window.map.addControl(drawTool2);
				this.domMarkerLayers();
				this.boxMaskerLayers();
				this.pointMaskerLayers();
				this.cameraMaskerLayers();
				this.polygonMarkerLayers();
				this.materialsMaskerLayers();
			});
			window.map.on('mapClickNode', event => {
				if(document.getElementById(event.markers[0].id)===null){
					this.params.json.data.channelId = event.markers[0].id;
					let domMarker = new jsmap.JSDomMarker({
						id: event.markers[0].id+'mark',
						position: new jsmap.JSPoint(event.markers[0].position.x, event.markers[0].position.y, 0),
						floorId: 1,
						depthTest: true,
						content: `<div id="`+event.markers[0].id+`" style="display: block;position:absolute;z-index: 10;top: 0;background: rgba(24,36,51,.7);padding: 0 16px 16px;box-sizing: border-box" id="vchannelWrap"></div>`,
						offset: jsmap.JSControlPosition.RIGHT_CENTER,
						displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
						marginOffset: {
							x:30,
							y: -50
						},
						properties: {
							type: 0,
						},
						callback: (node) => {
							console.log(node);
						}
					});
					window.map.addMarker(domMarker);
					var otest = document.getElementById(event.markers[0].id);
					// 创建一个新dom,并设置icon，绑定点击事件
					let newEle = document.createElement("div");
					newEle.className = "v_title";
					newEle.setAttribute("style","display:flex;justify-content: space-between;padding:10px 0");
					let title = document.createElement("div");
					title.innerText = "实时监控";
					newEle.style.color = "#ffffff";
					let close = document.createElement("div");
					close.className = "v_close";
					close.setAttribute("style","width: 16px;height: 16px;background: url(.//public/img/close.png) no-repeat;background-size: 100% 100%;");
					newEle.appendChild(title);
					newEle.appendChild(close);
					let newEle2 = document.createElement("video");
					newEle2.id = event.markers[0].id+'videoPlayer';
					newEle2.setAttribute("style","width: 327px;height:183px;background:url('.//public/img/v_mask.png') no-repeat;background-size: 100% 100%;");
					// 在对应dom 下追加创建的dom
					otest.appendChild(newEle);
					otest.appendChild(newEle2);
					newEle2.onclick = () => {
						this.$API.am.video.item.req(this.params).then(res => {
							debugger;
							console.log(res);
							this.url = res.url;
							if (flvjs.isSupported()) {
								let videoElement = document.getElementById(event.markers[0].id+'videoPlayer');
								let flvPlayer = flvjs.createPlayer({
									type: 'flv',
									url: res.url
								});
								flvPlayer.attachMediaElement(videoElement);
								flvPlayer.load();
								flvPlayer.play();
							}
						})
					};
					close.onclick=()=>{
						let nodeMark = document.getElementById(event.markers[0].id);
						nodeMark.remove();
					}
				}else{}

			});
			/*
			* <div class="v_title" style="width: 327px;height: 45px;padding: 10px 0;font-size: 16px;font-weight: 700;color: #fff;position: relative;padding-left: 8px;display: flex;justify-content: space-between">
									<div>`+event.markers[0].text+`</div><div style="width: 16px;height: 16px;background: url(.//public/img/close.png) no-repeat;background-size: 100% 100%;" @click="closeVideo"></div>
									</div>
									<div class="v_masker" style="width: 327px;height: 183px;background: url(.//public/img/v_mask.png) no-repeat;background-size: 100% 100%;" @click="playVideo()"></div>
									<div id="`+event.markers[0].id+`"></div>
			* */
			this.getVchannels();

		},
		methods: {
			playVideo(){
				debugger;
				this.$API.am.video.item.req(this.params).then(res => {
					debugger;
					// console.log(res);
					this.url = res.url;
					if (flvjs.isSupported()) {
						let videoElement = document.getElementById('videoElement');
						let flvPlayer = flvjs.createPlayer({
							type: 'flv',
							url: res.url
						});
						flvPlayer.attachMediaElement(videoElement);
						flvPlayer.load();
						flvPlayer.play();
					}
				})
			},

			domMarkerLayers() {//风险区域
				this.domMarkerLayer = new jsmap.JSDomMarkerLayer({
					minimumLevel:3,
					maxmumLevel:22,
					show:true
				});
				window.map.addLayer(this.domMarkerLayer);
			},
			boxMaskerLayers() {//风险区域
				this.boxMarkerLayer = new jsmap.JSBoxMarkerLayer({
					minimumLevel: 3,
					maxmumLevel: 22,
					show: false
				});
				window.map.addLayer(this.boxMarkerLayer);
				this.showBoxMarkers();
			},
			pointMaskerLayers() {//点
				this.pointMarkerLayer = new jsmap.JSPointMarkerLayer({
					minimumLevel: 3,
					maxmumLevel: 22,
					show: false
				});
				window.map.addLayer(this.pointMarkerLayer);
				this.showPointMarkers();
			},
			cameraMaskerLayers() {//图标文字
				this.cameraMaskerLayer = new jsmap.JSIconTextMarkerLayer({
					minimumLevel: 3,
					maxmumLevel: 22,
					show: false
				});
				window.map.addLayer(this.cameraMaskerLayer);
				this.showCameraMarkers();
			},
			materialsMaskerLayers() {//消防物资
				this.materialsMaskerLayer = new jsmap.JSIconTextMarkerLayer({
					minimumLevel: 3,
					maxmumLevel: 22,
					show: false
				});
				window.map.addLayer(this.materialsMaskerLayer);
				this.showMaterialsMarkers();
			},
			polygonMarkerLayers() {//危险作业
				this.polygonMaskerLayer = new jsmap.JSPolygonMarkerLayer({
					minimumLevel: 3,
					maxmumLevel: 22,
					show: false
				});
				window.map.addLayer(this.polygonMaskerLayer);
				this.showPolygonMarkers();
			},
			//风险区域
			showBoxMarkers() {
				var boxMarker = new jsmap.JSBoxMarker({
					id: 'box',
					position: [
						{x: 114.63059258861512, y: 38.81407163905287, z: 0},
						{x: 114.63044857916901, y: 38.81396178326786, z: 0},
						{x: 114.63060812029352, y: 38.81386267832651, z: 0},
						{x: 114.63073035356713, y: 38.81395745716681, z: 0},
					],
					floorId: 1,//楼层id
					color: 'rgba(255,0,0,0.44)',//颜色
					height: 0,//基底高度
					stretchHeight: 6,//拉伸高度
					strokeColor: '#ff0000',//边线颜色
					show: true, //是否显示
					depthTest: Boolean,
					allowPicking: false, //是否允许点击
					displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),//可见范围
					callback: (marker) => {
						// console.log(marker);
					}
				});
				this.boxMarkerLayer.addMarker(boxMarker);
				var boxMarker1 = new jsmap.JSBoxMarker({
					id: 'box',
					position: [
						{x: 114.6284236353879, y: 38.81587979561416, z: 0},
						{x: 114.62920209224112, y: 38.81519905830823, z: 0},
						{x: 114.63022009284202, y: 38.81594033572247, z: 0},
						{x: 114.62938229018444, y: 38.81656925374177, z: 0},
					],
					floorId: 1,//楼层id
					color: 'rgba(134,255,78,0.44)',//颜色
					height: 0,//基底高度
					stretchHeight: 20,//拉伸高度
					strokeColor: '#87FF4F',//边线颜色
					show: true, //是否显示
					depthTest: Boolean,
					allowPicking: false, //是否允许点击
					displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),//可见范围
					callback: (marker) => {
						// console.log(marker);
					}
				});
				this.boxMarkerLayer.addMarker(boxMarker1);
			},
			showPointMarkers() {
				let pointMarker = new jsmap.JSPointMarker({
					id: 'point1',
					color: '#00FF00',  //填充颜色
					size: 10,  //尺寸
					position: new jsmap.JSPoint(114.6318495165543, 38.81301151091491, 3),  //坐标
					floorId: 1,  //楼层id,默认为1（地面）
					outlineColor: '#CD5C5C',  //边线颜色
					outlineWidth: 2,  //边线宽
					// depthTest: true,  //是否开启深度检测
					show: true,  //是否显示
					allowPicking: true,  //是否允许点击
					displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),  //可见范围
					nearFarScale: new jsmap.JSNearFarScale(0.0, 10.0, 500, 0.5),  //比例缩放
					callback: (node) => {
						// console.log(node);
					}//回调事件
				});
				this.pointMarkerLayer.addMarker(pointMarker);
			},
			//摄像头
			showCameraMarkers() {
				let that = this;
				let iconTextMarker = null;
				that.Vchannels.forEach(item => {
					let pixel = item.my_info.location;
					iconTextMarker = new jsmap.JSIconTextMarker({
						id: item.channelCode,
						position: {x: pixel[0], y: pixel[1], z: pixel[2]},  //坐标
						floorId: 1,  //楼层id,默认为1（地面）
						image: "/img/camera.svg",
						text: '摄像头',
						font: '10px sans-serif',
						fontColor: '#fff645',
						imageHeight: 16,
						imageWidth: 16,
						backgroundColor: 'rgba(0,0,0,0.3)',
						backgroundRadius: 1,
						backgroundStrokeColor: 'rgba(0,0,0,0.3)',
						backgroundStrokeWidth: 1,
						iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
						allowPicking: true,
						displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
						nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 2),
						show: true,
						callback: (marker) => {
							debugger;
							console.log(marker);
						}
					});
					that.cameraMaskerLayer.addMarker(iconTextMarker);
				})

			},
			//危险作业
			showPolygonMarkers() {
				let polygonMarker = new jsmap.JSPolygonMarker({
					id: 'polygon',//id
					position: [new jsmap.JSPoint(114.63168864138028, 38.81254802029822, 0),
						new jsmap.JSPoint(114.63185023632963, 38.81241816295427, 0),
						new jsmap.JSPoint(114.63160294240738, 38.812229296478634, 0),
						new jsmap.JSPoint(114.63143965827588, 38.81235778393449, 0),

					],//坐标集合
					floorId: 1,//楼层id
					color: 'rgba(0,0,255,.44)',//填充颜色
					strokeColor: '#2bff1d',//边线颜色
					depthTest: false,//是否开启深度检测
					// material: new jsmap.JSWaterMaterial(),  //材质，材质属性一旦设置，color属性就会失效
					allowPicking: true,  //是否允许点击
					displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),  //可见范围
					properties: {
						test: 'polygonTest'
					},//属性设置
					callback: (marker) => {
						// console.log(marker);
					}//回调
				});
				this.polygonMaskerLayer.addMarker(polygonMarker);
			},
			//消防物资
			showMaterialsMarkers() {
				let materialMarker = new jsmap.JSIconTextMarker({
					id: 'iconTextMarker',
					position: {x: 114.6302317964304, y: 38.81315596674133},  //坐标
					floorId: 1,  //楼层id,默认为1（地面）
					image: "/img/camera.svg",
					text: '消防物资',
					font: '10px sans-serif',
					fontColor: '#fff645',
					imageHeight: 16,
					imageWidth: 16,
					// fontStrokeColor: '#1f0fdd',
					fontStrokeWidth: 1,
					backgroundColor: 'rgba(0,0,0,0.3)',
					backgroundRadius: 1,
					backgroundStrokeColor: 'rgba(0,0,0,0.3)',
					backgroundStrokeWidth: 1,
					iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
					allowPicking: true,
					displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
					nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 2),
					show: true
				});
				this.materialsMaskerLayer.addMarker(materialMarker);
			},
			userSelect() {
				this.showUserSelect = !this.showUserSelect
			},
			autoRunChange() {
				this.autoRun = !this.autoRun;
				if (this.autoRun) {
					this.mapRun();
				} else {
					this.mapPause();
				}
			},
			mapRun() {
				if (this.flyManager !== null) {
					this.flyManager.restartFly();
				} else {
					//地图旋转展示
					this.flyManager = new jsmap.JSFlyManager(window.map);
					this.flyManager.flyByCircle({
						center: {x: 114.63059258861512, y: 38.81407163905287, z: 1},
						distance: 500,
						duration: 100000,
						tilt: 30
					});
				}

			},
			mapPause() {
				// this.flyManager.destroy();
				this.flyManager.pauseFly();
			},
			filterCtrlFocusChange() {
				this.filterCtrlFocus = !this.filterCtrlFocus
			},
			markerClick(index) {
				let arr = [];
				this.markList[index] = !this.markList[index];
				if (index === 0) {
					if (this.markList[0]) {
						arr = this.markList.map(value => {
							return true
						})
					} else {
						arr = this.markList.map(value => {
							return false
						})
					}
					this.markList = arr;
				} else {
					let list = this.markList.slice(1, 8);
					if (list.indexOf(true) > -1 && list.indexOf(false) < 0) {
						this.markList[0] = true;
					} else {
						this.markList[0] = false;
					}
				}
				debugger;

				if (this.markList[1]) {
					window.map.showBuildingMarker = true;
				} else {
					window.map.showBuildingMarker = false;
				}
				if (this.markList[2]) {
					this.cameraMaskerLayer.show = true;
				} else {
					this.cameraMaskerLayer.show = false;
				}
				if (this.markList[3]) {
					this.materialsMaskerLayer.show = true;
				} else {
					this.materialsMaskerLayer.show = false;
				}
				if (this.markList[4]) {
					this.polygonMaskerLayer.show = true;
				} else {
					this.polygonMaskerLayer.show = false;
				}
				if (this.markList[5]) {
					this.boxMarkerLayer.show = true;
				} else {
					this.boxMarkerLayer.show = false;
				}
			},
			changeDropIndex(index) {
				let that = this;
				that.dropIndex = index;
				setTimeout(function () {
					that.showUserSelect = false;
				}, 300)
			},
			getVchannels() {
				this.$API.am.video.list.req(this.params).then(res => {
					if (res.err_msg) {
						this.$message.error(res.err_msg);
					} else {
						this.Vchannels = res.pageData;
					}
				});
			},
			//播放视频
			playVchannel() {

			},
			//点击摄像头
			cameraClose() {

			},
			cameraOpen() {

			},
		},
		unmounted() {
			window.map.destroy();
			window.map = null;
		},
	}
</script>

<style scoped lang="scss">
	.v_title {
		width: 327px;
		height: 45px;
		line-height: 22px;
		font-size: 16px;
		font-weight: 700;
		color: #fff;
		position: relative;
		padding-left: 8px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.v_masker {
		width: 327px!important;
		height: 183px!important;
		background: url(/public/img/v_mask.png) no-repeat!important;
		background-size: 100% 100%!important;
	}

	.hoverPointer:hover {
		cursor: pointer;
	}

	.screen-main {
		.screen-header {
			width: 100% !important;
			height: 84px !important;
			position: absolute !important;
			left: 0 !important;
			top: 0 !important;
			background: linear-gradient(0deg, rgba(0, 113, 155, 0) 0, #00455f) !important;
			z-index: 2 !important;
			transition: all .5s linear !important;

			.header-left-bg {
				height: 60px;
				position: absolute;
				left: 18px;
				top: 12px;
				font-size: 40px;
				font-weight: 700;
				color: #fff;
			}

			.header-right-action {
				position: absolute;
				top: 10px;
				right: 18px;
				display: flex;
				align-items: center;

				.right-action-clock {
					:before {
						content: " ";
						display: inline;
						position: absolute;
						left: -24px;
						top: 9px;
						width: 16px;
						height: 16px;
						/*background: url(/img/screen5/clock.png) no-repeat;*/
						background-size: 100% 100%;
					}

					.action-time {
						width: 56px;
						height: 19px;
						font-size: 14px;
						font-weight: 400;
						color: #fff;
						position: relative;
						margin-right: 20px;
					}
				}

			}
		}

		.screen-cockpit {
			width: 430px;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 1;
			background: linear-gradient(90deg, #00455f, rgba(0, 113, 155, 0));
			transition: all .5s linear;

			.cockpit-count {
				position: absolute;
				top: 84px;
				left: 0;
				height: 20%;
				width: 100%;
				padding: 0 10px 0 18px;
			}

			.cockpit-alarm {
				position: absolute;
				top: calc(20% + 84px);
				left: 0;
				height: 20%;
				width: 100%;
				padding: 0 10px 0 18px;
			}

			.cockpit-info {
				position: absolute;
				top: calc(40% + 84px);
				left: 0;
				height: calc(60% - 84px);
				width: 100%;
				padding: 0 10px 0 18px;
			}

			.divider {
				display: block;
				height: 1px;
				width: 100%;
				background: hsla(0, 0%, 100%, .5);
				z-index: 2;
			}

			.simple-title {
				line-height: 22px;
				font-size: 16px;
				font-weight: 700;
				color: #fff;
				position: relative;
				padding-left: 8px;
				height: 44px;
				display: flex;
				align-items: center;
				justify-content: space-between;
			}
		}

		.screen-ctrl {
			position: absolute;
			top: 60px;
			right: 18px;
			z-index: 2;
			transition: all .5s linear;
		}

		.screen-tab {
			position: absolute;
			bottom: 0;
			left: 50%;
			z-index: 9;
			transform: translate(-50%);
			transition: all .5s linear;
		}
	}

	.screen-cockpit {
		.cockpit-count {
			.count-list {
				display: flex;
				flex-wrap: wrap;
				height: calc(100% - 50px);

				.count-list-item {
					width: 33.3333%;
					height: 50%;
					display: flex;

					.item-img {
						width: 50px;
						height: 50px;
						position: relative;
						margin-right: 6px;
						flex-shrink: 0;
					}

					item-img1 {
						background: url(/public/img/icon_wlry.png) no-repeat;
						background-size: 100% 100%;
					}

					.item-info {
						.normal {
							font-size: 12px;
							font-weight: 400;
							color: #fff;
						}

						.large {
							font-size: 36px;
							font-weight: 400;
							color: #fff;
						}
					}
				}
			}
		}

		.cockpit-alarm {
			.alarm-bell {
				padding: 0 18px 0 32px;
				position: relative;
				color: #fff;
			}

			.alarm-bell.danger {
				border: 1px solid #ffc679;
				background: #dd8000;
				box-shadow: inset 0 0 8px #fda732;
			}

			.alarm-bell.danger:hover {
				box-shadow: 0 0 8px #fda732, inset 0 0 8px #fda732;
			}

			.alarm-content {
				display: flex;
				justify-content: space-between;
				height: calc(100% - 50px);

				.content-left {
					width: 160px;
					height: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				.content-right {
					width: calc(100% - 170px);
					height: 100%;
					display: flex;
					flex-wrap: wrap;
					align-items: center;
					justify-content: center;

					.alarm-item {
						width: 50%;
						height: 25%;
						font-size: 14px;
						font-weight: 700;
						padding-left: 8px;
						position: relative;
						display: flex;
						align-items: center;

						.item-name {
							margin-right: 4px;
							flex-shrink: 0;
						}

						.item-number {
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
						}
					}

					.alarm-item-danger {
						color: #fda732;
					}

					.alarm-item-safe {
						color: #fff;
					}
				}
			}
		}

		.cockpit-info {
			.header-tab {
				width: 210px;
			}
		}
	}

	.screen-ctrl {
		.screen-filter {
			position: absolute;
			top: 0;
			right: 0;

			.filter-content {
				display: flex;
				align-items: center;
				background: rgba(24, 36, 51, .5);
				border-radius: 20px;

				.filter-ctrl {
					width: 710px;
					height: 40px;
					display: flex;
					align-items: center;
					background: transparent;
					overflow: hidden;
					padding: 0 20px;
					z-index: 8;
					transition: all .5s linear;

					.screen-check-content {
						margin-right: 16px;
					}
				}

				.caret-dropdown {
					color: #fff;
				}

				.drop-content {
					position: absolute;
					right: 50px;
					top: 44px;
					padding: 4px;
					box-shadow: inset 0 0 4px #2cedff;
					background: rgba(24, 36, 51, .8);
					border-radius: 4px;
					transition: .5s;

					.drop-content-item {
						color: #fff;
						position: relative;
						width: 110px;
						font-size: 13px;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						height: 34px;
						line-height: 34px;
						box-sizing: border-box;
						text-align: center;
						cursor: pointer;
					}

					.drop-content-item.active {
						color: rgba(44, 237, 255, .8);
						background-color: rgba(24, 36, 51, .3);
					}

					.drop-content-item:hover {
						color: rgba(44, 237, 255, .8);
						background-color: rgba(24, 36, 51, .3);
					}

				}

				.filter-action {
					width: 56px;
					height: 40px;
					padding: 0 18px;
					background: rgba(24, 36, 51, .7);
					border-radius: 20px;
					flex-shrink: 0;
					display: flex;
					align-items: center;
					justify-content: space-between;
					z-index: 2;

					.action-shrink {
						width: 20px;
						height: 20px;
						background: url(/public/img/shrink.png) no-repeat;
						background-size: 100% 100%;
						cursor: pointer;
						transition: all .5s linear;
						transform: rotate(180deg);
					}

					.action-shrink.shrink-hidden {
						transform: rotate(0deg);
						background: url(/public/img/shrink.png) no-repeat;
					}

					.roam-play {
						background: url(/public/img/play.png) no-repeat;
						background-size: 100% 100%;
					}

					.roam-pause {
						background: url(/public/img/pause.png) no-repeat;
						background-size: 100% 100%;
					}

					.action-roam {
						width: 20px;
						height: 20px;
						cursor: pointer;
					}
				}

				.filter-action.showroam {
					width: 96px;
				}
			}
		}

		.screen-search {
			position: absolute;
			top: 54px;
			right: 0;

			.search-content {
				padding: 5px;
				background: rgba(24, 36, 51, .5);
				border-radius: 20px;
				display: flex;
				align-items: center;
				position: relative;
			}

			input {
				width: 0;
				height: 30px;
				font-size: 13px;
				outline: none;
				border: none;
				padding: 0;
				margin: 0;
				background: transparent;
				color: #fff;
				transition: all .5s linear;
				opacity: 0;
			}

			.input-focus {
				width: 250px;
				opacity: 1;
				padding: 0 20px 0 12px;
			}

			.close-btn {
				position: absolute;
				top: 12px;
				right: 50px;
				width: 8px;
				height: 8px;
				cursor: pointer;
				color: #fff;
			}

			.search {
				margin: auto;
				width: 30px;
				height: 30px;
				background: #5bde0b;
				border-radius: 50%;
				transition: all 1s;
				position: relative;
			}

			.search:after {
				content: "";
				display: inline-block;
				position: absolute;
				top: 8px;
				left: 8px;
				width: 13px;
				height: 13px;
				background: url(/public/img/search.png) no-repeat;
				background-size: 100% 100%;
				cursor: pointer;
			}

			.auto-suggestion {
				position: absolute;
				left: 10px;
				top: 46px;
				background: rgba(24, 36, 51, .8);

				.suggestion-select-ul {
					padding: 4px;
					max-height: 350px;
					overflow-y: auto;
				}
			}
		}
	}

	.screen-tab {
		.screen-tab-content {
			display: flex;
			align-items: center;
		}

		.tab-menu-item {
			width: 150px;
			height: 80px;
			text-align: center;
			margin: 0 10px;
			cursor: pointer;
		}

		.tab-menu-text {
			height: 80px;
			line-height: 80px;
			font-size: 14px;
			font-weight: 400;
			color: #2cedff;
		}

		.tab-menu {
			background: url(/public/img/menu.png) no-repeat;
			background-size: 100% 100%;
		}

		.tab-menu-active {
			background: url(/public/img/menu_active.png) no-repeat;
			background-size: 100% 100%;

			.tab-menu-text {
				font-weight: 700;
				color: #fff;
			}
		}
	}

	.screen-main {
		.header-tab {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.tab-item {
				padding: 0 4px;
				text-align: center;
				font-size: 15px;
				font-weight: 400;
				color: #fff;
				position: relative;
				cursor: pointer;
			}

			.tab-item-active {
				font-weight: 700;
			}

			.tab-item-active:after {
				content: "";
				position: absolute;
				left: 0;
				bottom: -2px;
				height: 8px;
				width: 100%;
				background: linear-gradient(90deg, rgba(48, 255, 221, 0), rgba(48, 255, 221, .8) 50%, rgba(48, 255, 221, 0));
			}
		}
	}

	.screen-main {
		.simple-btn-bg {
			display: inline-block;
			height: 32px;
			line-height: 32px;
			border-radius: 16px;
			color: #fff;
			font-size: 14px;
			padding: 0 18px;
			border: 1px solid #32fde3;
			background: #007767;
			box-shadow: inset 0 0 8px #5aecf0;
			cursor: pointer;
		}

		.simple-btn-bg:hover {
			box-shadow: 0 0 8px #5aecf0, inset 0 0 8px #5aecf0;
		}

		.screen-check-content {
			display: flex;
			align-items: center;
			height: 40px;

			.box-btn {
				width: 16px;
				height: 16px;
				margin-right: 6px;
				cursor: pointer;
				border: 1px solid #5bde0b;
				border-radius: 3px;
			}

			/*.box-uncheck {
				background: url(/public/img/uncheck.png) no-repeat 100% 100%;
			}*/

			.box-text {
				font-size: 14px;
				font-weight: 400;
				line-height: 40px;
				color: #fff;
				white-space: nowrap;
			}

			.box-check {
				background: url(/public/img/check.png) no-repeat 100% 100% !important;
			}
		}

	}

	[class*=" el-icon-"], [class^=el-icon-] {
		font-family: element-icons !important;
		speak: none;
		font-style: normal;
		font-weight: 400;
		font-variant: normal;
		text-transform: none;
		line-height: 1;
		vertical-align: baseline;
		display: inline-block;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
</style>
