|
@@ -81,7 +81,7 @@ $(function () {
|
|
|
"pageNum": params.cPage,
|
|
|
"pageSize": params.pSize,
|
|
|
"searchKey": "",
|
|
|
- "userId": ""
|
|
|
+ "userId": "77547f7af360c5d8e14932866b844d53"
|
|
|
}),
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
@@ -235,9 +235,103 @@ $(function () {
|
|
|
option && myChart.setOption(option, true);
|
|
|
}
|
|
|
|
|
|
- loadTemperature({
|
|
|
- id:"temperature",//dom Id
|
|
|
- val:50 //度数
|
|
|
+ window.loadAirConditioner = function (params={}) {
|
|
|
+ let {id="air-conditioner",val,type} = params
|
|
|
+ //加载温度计
|
|
|
+ var chartDom = document.getElementById(id);
|
|
|
+ var myChart = echarts.init(chartDom);
|
|
|
+
|
|
|
+
|
|
|
+ let option = {
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "Indicator",
|
|
|
+ type: "gauge",
|
|
|
+ data: [{
|
|
|
+ value: val,
|
|
|
+ name:type,
|
|
|
+ itemStyle:{
|
|
|
+ color: "#23EACF",
|
|
|
+ fontSize:14
|
|
|
+ },
|
|
|
+ detail: {
|
|
|
+ offsetCenter: ['0%', '0'],
|
|
|
+ formatter: "{value}℃",
|
|
|
+ color: "#fff",
|
|
|
+ fontSize:22
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ offsetCenter: ['0%', '26%'],
|
|
|
+ color: "#fff",
|
|
|
+ fontSize:16
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ radius: "100%",
|
|
|
+ startAngle: 220,
|
|
|
+ endAngle: -40,
|
|
|
+ progress: {
|
|
|
+ show: true,
|
|
|
+ roundCap:true,
|
|
|
+ itemStyle:{
|
|
|
+ color: "#23EACF"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: true,
|
|
|
+ roundCap:true,
|
|
|
+ lineStyle:{
|
|
|
+ color: [[1, '#ffffff']]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisTick:{
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ pointer: {
|
|
|
+ show: false,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ option && myChart.setOption(option, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ window.loadMonitor = function (params={}) {
|
|
|
+ let {id,url} = params
|
|
|
+ console.log(id,url);
|
|
|
+ var video = document.getElementById(id);
|
|
|
+ if (Hls.isSupported()) {
|
|
|
+ var hls = new Hls();
|
|
|
+ hls.loadSource(url||'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8');
|
|
|
+ hls.attachMedia(video);
|
|
|
+ hls.on(Hls.Events.MEDIA_ATTACHED, function () {
|
|
|
+ video.play();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
|
|
|
+ // When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
|
|
|
+ // This is using the built-in support of the plain video element, without using hls.js.
|
|
|
+ else if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
|
|
+ video.src = url||'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8';
|
|
|
+ video.addEventListener('canplay', function () {
|
|
|
+ video.play();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ loadMonitor({
|
|
|
+ id:"monitor",
|
|
|
+ url:'http://14.215.216.123:18080/rtp/00A153DF/hls.m3u8'
|
|
|
})
|
|
|
|
|
|
+ loadAirConditioner({
|
|
|
+ id:"air-conditioner",
|
|
|
+ val:50,
|
|
|
+ type:'冷风'
|
|
|
+ })
|
|
|
});
|