From ef693f74032969bc6ecde3a32c147532e72850c5 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 11 Jun 2021 14:21:44 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap

---
 widgets/searchL/Widget.js |   70 +++++++++++++++++++++--------------
 1 files changed, 42 insertions(+), 28 deletions(-)

diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
index 43880d5..6a3e36b 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -35,8 +35,7 @@
 				//关键词&&坐标
 				$("#i-f-gjz").click(function () {
 					that.states = 'one';
-					// console.log("gjz");
-					$("#i-f-zb").css({ 'backgroundColor': '#fff', 'color': '#000' });
+					$("#i-f-zb").css({ 'backgroundColor': '#fff', 'color': '#969696' });
 					$("#i-f-gjz").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
 					// $("#inputTwo").css({ 'display': 'none' });
 					// $("#local_data").css({ 'display': 'inline-block' });
@@ -45,8 +44,7 @@
 				})
 				$("#i-f-zb").click(function () {
 					that.states = 'two';
-					// console.log("zb");
-					$("#i-f-gjz").css({ 'backgroundColor': '#fff', 'color': '#000' });
+					$("#i-f-gjz").css({ 'backgroundColor': '#fff', 'color': '#969696' });
 					$("#i-f-zb").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
 					// $("#local_data").css({ 'display': 'none' });
 					// $("#inputTwo").css({ 'display': 'inline-block' });
@@ -55,9 +53,7 @@
 				})
 
 				$(".searchImg").click(function () {
-					// console.log(2324345)
 					that.getInputData();
-					// console.log(that.searchDatas)
 					if (typeof that.searchDatas == 'string') {
 						var han = /^[\u4e00-\u9fa5]+$/;
 						if (han.test(that.searchDatas) || that.searchDatas == '  ') {
@@ -76,7 +72,6 @@
 						}
 					} else {
 						if (that.searchDatas[0] && that.searchDatas[1]) {
-							console.log(that.searchDatas);
 						} else {
 							layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){
 								//得到各种内置组件
@@ -104,7 +99,6 @@
 			getData: function (index, val) {
 				val = val == '  ' ? '' : val;
 				var d = $('.searchLMain').find('.layui-tab-item').hide;
-				// console.log(d)
 				var that = this,
 					url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${index}`
 					// url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=&start&limit&type=${index}`
@@ -117,7 +111,6 @@
 				}).then((res) => {
 					if (res.data.code == 200) {
 						var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || [];
-						// console.log(data)
 
 						var val = index;//数据的2和1对调
 						if (index == 1) {
@@ -150,7 +143,6 @@
 						this.shiti(d[k], +n + 1);
 					}
 					var data = d;
-					console.log(data)
 					if (n == 0) {
 						this.beginLayUi(data);
 					} else if (n == 1) {
@@ -197,7 +189,6 @@
 
 			},
 			goOnPosition(arr, i, data) {
-				console.log(data)
 				this.map.camera.flyTo({
 					// destination: Cesium.Cartesian3.fromDegrees(Number(lng), Number(lat), Number(gaodu))
 					destination: Cesium.Cartesian3.fromDegrees(Number(arr[0]), Number(arr[1]), Number(8000))
@@ -231,8 +222,8 @@
 						// image: 'images/addL/监测.png',
 						image: imgs,
 						// image: entityConfig.img,
-						width: 40,
-						// height: 80,
+						width: 27,
+						height: 40,
 						clampToGround: true,
 						heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
 						disableDepthTestDistance: Number.POSITIVE_INFINITY,
@@ -241,8 +232,6 @@
 				})
 			},
 			beginLayUi: function (data = 1, data1 = 1, data2 = 1) {
-				// data.push(...data)
-				// console.log(data)
 				var that = this;
 				layui.use(function () {
 					var element = layui.element
@@ -285,7 +274,6 @@
 							if (layEvent === 'detail') {
 								//   layer.msg('查看操作');
 								window.open(obj.data.panAddress);
-								// console.log(obj.data.panAddress)
 							} else if (layEvent === 'edit') {
 								that.goOnPosition([obj.data.lon, obj.data.lat], 1, obj.data);
 							}
@@ -323,23 +311,52 @@
 							var data = obj.data //获得当前行数据
 								, layEvent = obj.event; //获得 lay-event 对应的值
 							if (layEvent === 'detail') {
-								//   layer.msg('查看操作');
-								var dom = $('#poput-m-t-video'),
-									str = `
-									<div class="header">${obj.data.name}--实时视频</div>
-									<video id="video1" class="video-js vjs-default-skin" width="100%" height="100%"
-										data-setup='{"controls" : true, "autoplay" : true, "preload" : "auto"}'>
-										<source src="${obj.data.flv}" type="video/x-flv">
-									</video>`;
+								var dom = $('.header'),
+									str = `${obj.data.name}--实时视频`;
 								dom.empty();
 								dom.append(str);
+								if (obj.data.flv) {
+									var dom = $('#poput-m-t-video'),
+									// <div id="poput-m-t-video-login"><i class="layui-icon">&#xe63e;</i></div>
+										str = `
+											<video id="poput-m-t-video-video" ></video>
+									`;
+									dom.empty();
+									dom.append(str);
+
+									// console.log(obj.data.name);
+									// console.log(obj.data.flv);
+									
+									if (flvjs.isSupported()) {
+										var videoElement = document.getElementById('poput-m-t-video-video');
+										var flvPlayer = flvjs.createPlayer({
+											type: 'flv',
+											url: obj.data.flv
+										});
+										flvPlayer.attachMediaElement(videoElement);
+										flvPlayer.load();
+										flvPlayer.play();
+									}
+									window.$myVideoFlvplayer = flvPlayer;
+									// var time = setTimeout(() => {
+										
+									// }, 2000);
+								} else {
+									var dom = $('#poput-m-t-video'),
+										str = `
+											<div id="poput-m-t-video-none" >·暂无视频</div>
+									`;
+									dom.empty();
+									dom.append(str);
+								}
+
+
 
 								$('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
 								$('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
 							} else if (layEvent === 'edit') {
 								that.goOnPosition([obj.data.lon, obj.data.lat], 2, obj.data);
 							}
-							// console.log(obj.data.name)
 						});
 					}
 					if (data2 != 1) {
@@ -380,15 +397,12 @@
 								// 监测、测站详情 表格
 
 
-								// console.log(obj.data.stcd)
-								// console.log(axios)
 								that.setXiangqing(obj);//渲染详情
 								that.getshuiwen(obj.data.stcd)//水文实时渲染
 								that.setbiaoti(obj.data)//表格各分部标题渲染
 
 								$('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
 								$('.jimu-widget-searchTabaPopup').find('.p-main').eq(1).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
-								// console.log(obj.data.name)
 							} else if (layEvent === 'edit') {
 								that.goOnPosition([obj.data.lon, obj.data.lat], 3, obj.data);
 							}

--
Gitblit v1.9.3