监控修改

pull/32/head
孙萌 2023-11-14 16:44:09 +08:00
parent e9b0ccc21f
commit 1f51575bb0
8 changed files with 11155 additions and 81 deletions

11080
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
"core-js": "^3.8.3", "core-js": "^3.8.3",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"element-ui": "^2.15.14", "element-ui": "^2.15.14",
"ezuikit-js": "^7.7.7",
"flv.js": "^1.6.2", "flv.js": "^1.6.2",
"video.js": "^7.21.5", "video.js": "^7.21.5",
"videojs-contrib-hls": "^5.15.0", "videojs-contrib-hls": "^5.15.0",

View File

@ -1564,26 +1564,27 @@
.realTime .page-content .realTime-list .seamless-warp .list-view { .realTime .page-content .realTime-list .seamless-warp .list-view {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view img { .realTime .page-content .realTime-list .seamless-warp .list-view img {
width: 80px; width: 60px;
height: 80px; height: 60px;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view .text { .realTime .page-content .realTime-list .seamless-warp .list-view .text {
text-align: center;
margin: 5px 0; margin: 5px 0;
font-size: 14px;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view .number { .realTime .page-content .realTime-list .seamless-warp .list-view .number {
width: 106px; width: 80px;
height: 40px; height: 30px;
background: url(../image/real-time-text.png) no-repeat center; background: url(../image/real-time-text.png) no-repeat center;
background-size: 100% 100%; background-size: 100% 100%;
font-size: 20px; font-size: 16px;
font-family: Arial; font-family: Arial;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
@ -1599,7 +1600,7 @@
} }
.realTime .page-content .realTime-bottom { .realTime .page-content .realTime-bottom {
height: 440px; height: 300px;
margin-top: 30px; margin-top: 30px;
} }
@ -1607,8 +1608,8 @@
flex-shrink: 0; flex-shrink: 0;
} }
.realTime .page-content .realTime-bottom .left { .realTime .page-content .realTime-bottom .left-view {
width: 43%; width: 35%;
height: 100%; height: 100%;
background: rgba(0, 132, 255, 0.15); background: rgba(0, 132, 255, 0.15);
border: 2px solid rgba(0, 186, 255, 0.35); border: 2px solid rgba(0, 186, 255, 0.35);
@ -1618,18 +1619,18 @@
padding: 10px; padding: 10px;
} }
.realTime .page-content .realTime-bottom .left > div { .realTime .page-content .realTime-bottom .left-view > div {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.realTime .page-content .realTime-bottom .left > div .video-js { .realTime .page-content .realTime-bottom .left-view > div .video-js {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.realTime .page-content .realTime-bottom .right { .realTime .page-content .realTime-bottom .right {
width: calc(100% - 43%); width: calc(100% - 35%);
min-width: 230px; min-width: 230px;
height: 100%; height: 100%;
} }

File diff suppressed because one or more lines are too long

View File

@ -1647,26 +1647,28 @@
.list-view { .list-view {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; // flex-direction: column;
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
img { img {
width: 80px; width: 60px;
height: 80px; height: 60px;
} }
.text { .text {
text-align: center;
margin: 5px 0; margin: 5px 0;
font-size: 14px;
} }
.number { .number {
width: 106px; width: 80px;
height: 40px; height: 30px;
background: url(../image/real-time-text.png) no-repeat center; background: url(../image/real-time-text.png) no-repeat center;
background-size: 100% 100%; background-size: 100% 100%;
font-size: 20px; font-size: 16px;
font-family: Arial; font-family: Arial;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
@ -1689,15 +1691,15 @@
} }
.realTime-bottom { .realTime-bottom {
height: 440px; height: 300px;
margin-top: 30px; margin-top: 30px;
>div { >div {
flex-shrink: 0; flex-shrink: 0;
} }
.left { .left-view {
width: 43%; width: 35%;
height: 100%; height: 100%;
background: rgba(0, 132, 255, 0.15); background: rgba(0, 132, 255, 0.15);
border: 2px solid rgba(0, 186, 255, 0.35); border: 2px solid rgba(0, 186, 255, 0.35);
@ -1718,7 +1720,7 @@
} }
.right { .right {
width: calc(100% - 43%); width: calc(100% - 35%);
min-width: 230px; min-width: 230px;
height: 100%; height: 100%;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -71,7 +71,10 @@ export default {
{ name: '数据分析', router: '', index: 1, routerList: [''], img: require('../assets/image/header-img4.png') }, { name: '数据分析', router: '', index: 1, routerList: [''], img: require('../assets/image/header-img4.png') },
{ name: '设备菜单', router: '', routerList: [], img: require('../assets/image/header-img5.png') }, { name: '设备菜单', router: '', routerList: [], img: require('../assets/image/header-img5.png') },
//systemManage systemManage //systemManage systemManage
{ name: '管理', router: '', routerList: [''], img: require('../assets/image/header-img6.png') }], { name: '管理', router: '', routerList: [''], img: require('../assets/image/header-img6.png') },
{ name: '大数据', router: '', routerList: [''], img: require('../assets/image/header-img8.png') }
],
activeNames: [3], activeNames: [3],
leftList: [ leftList: [
{ name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, }, { name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, },

View File

@ -1,16 +1,16 @@
<template> <template>
<div class="formula realTime"> <div class="formula realTime">
<div class="page-content"> <div class="page-content">
<div class="control-view" v-if="deviceName == 10"> <div class="control-view" v-if="deviceName == 10">
<div class="title">气象站:</div> <div class="title">气象站:</div>
<vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1"> <vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1">
<div class="list-view" v-for="item, index in controlList " :key="index"> <div class="list-view" v-for="item, index in controlList " :key="index">
<img class="icon" :src="item.img" alt=""> <img class="icon" :src="item.img" alt="">
{{ item.environmentDataId {{ item.environmentDataId
}}:{{ getControlData(item) }} }}:{{ getControlData(item) }}
</div> </div>
</vue-seamless> </vue-seamless>
</div> </div>
<!-- <div class="control-list" > <!-- <div class="control-list" >
<div v-for="(item, index) in controlList" :key="index"> <div v-for="(item, index) in controlList" :key="index">
@ -23,7 +23,7 @@
<img src="../../assets/image/real-time.png" alt="" /> <img src="../../assets/image/real-time.png" alt="" />
实时数据 实时数据
<!-- <div class="tips">种植作物1</div> --> <!-- <div class="tips">种植作物1</div> -->
</div> </div>
<div class="timeNow" v-if="list.length"> <div class="timeNow" v-if="list.length">
<!-- {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS <!-- {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS
@ -44,16 +44,19 @@
<vue-seamless class="seamless-warp" :data="list" :class-option="defaultOption"> <vue-seamless class="seamless-warp" :data="list" :class-option="defaultOption">
<div class="list-view" v-for="item, index in list " :key="index"> <div class="list-view" v-for="item, index in list " :key="index">
<img :src="item.img" alt=""> <img :src="item.img" alt="">
<div class="text">{{ item.name }}</div> <div>
<div class="number">{{ item.num }}</div> <div class="text">{{ item.name }}</div>
<div class="number">{{ item.num }}</div>
</div>
</div> </div>
</vue-seamless> </vue-seamless>
</div> </div>
<div class="flex-list realTime-bottom"> <div class="flex-list realTime-bottom">
<div class="left"> <div class="left-view">
<div class="monitor" id="monitor"> <div ref="monitor" class="monitor" id="monitor">
<video ref="videoPlayer" class="video-js"></video> <!-- <video ref="videoPlayer" class="video-js" id="video-js"></video> -->
<div ref="videoPlayer" class="video-js" id="video-js"></div>
</div> </div>
</div> </div>
<div class="right" id="realTime-line"></div> <div class="right" id="realTime-line"></div>
@ -62,11 +65,13 @@
</div> </div>
</template> </template>
<script> <script>
import EZUIKit from 'ezuikit-js';
import { getnowtime } from '../../assets/js/nowTime' import { getnowtime } from '../../assets/js/nowTime'
import { realTimeLine } from '@/assets/js/charts' import { realTimeLine } from '@/assets/js/charts'
import videojs from 'video.js'; import videojs from 'video.js';
import video_zhCN from 'video.js/dist/lang/zh-CN.json' import video_zhCN from 'video.js/dist/lang/zh-CN.json'
import vueSeamless from 'vue-seamless-scroll' import vueSeamless from 'vue-seamless-scroll'
export default { export default {
components: { vueSeamless }, components: { vueSeamless },
computed: { computed: {
@ -115,7 +120,15 @@ export default {
this.indexs = this.$route.query.index ? this.$route.query.index : store.equipmentIndex; this.indexs = this.$route.query.index ? this.$route.query.index : store.equipmentIndex;
this.deviceName = store.equipmentList[this.indexs - 1].deviceName this.deviceName = store.equipmentList[this.indexs - 1].deviceName
setTimeout(() => { setTimeout(() => {
if(this.player){
this.player.stop()
that.player.destroy()
that.player=null
}
that.dataInit(); that.dataInit();
}, 0); }, 0);
}, },
}, },
@ -139,12 +152,33 @@ export default {
const that = this; const that = this;
// //
if (this.player) { if (this.player) {
this.player.dispose(); // this.player.dispose();
this.player.stop()
this.player.destroy()
this.player=null
} }
that.timer && clearInterval(that.timer) that.timer && clearInterval(that.timer)
this.$bus.$off('refreshTime') this.$bus.$off('refreshTime')
}, },
methods: { methods: {
createVideoNew() {
// divWdivH 使div
let divW = this.$refs.monitor.clientWidth
let divH = this.$refs.monitor.clientHeight
this.player = new EZUIKit.EZUIKitPlayer({
id: 'video-js', // ID
accessToken: 'at.757ro68z1ur26g6f1ondfwl1cl1bivxy-4ckiflya3u-1192hd2-ucup11mjb',
url: this.url,
// urlezopen://open.ys7.com/G39444019/1.live .live GitHub
// simple-; standard-; security-; voice-; GitHub
template: 'security',
useHardDev: true,// 7.7.x 2023.11.7 7.7.6
// plugin: ["talk"], // talk-
width: divW, // 1920 px
height: divH, // 1080 px
})
console.log(this.player);
},
createVideo() { createVideo() {
// //
videojs.addLanguage('zh-CN', video_zhCN) videojs.addLanguage('zh-CN', video_zhCN)
@ -271,7 +305,7 @@ export default {
}) })
}) })
} else { } else {
this.$message.error(res.data.msg); // this.$message.error(res.data.msg);
} }
}); });
var data1 = store.equipmentList[this.indexs - 1].deviceId var data1 = store.equipmentList[this.indexs - 1].deviceId
@ -281,7 +315,7 @@ export default {
var chartsData = res.data.data var chartsData = res.data.data
realTimeLine('realTime-line', chartsData) realTimeLine('realTime-line', chartsData)
} else { } else {
this.$message.error(res.data.msg); // this.$message.error(res.data.msg);
} }
}) })
var nowDevice = store.equipmentList[this.indexs - 1] var nowDevice = store.equipmentList[this.indexs - 1]
@ -295,12 +329,15 @@ export default {
// cameraid: 'L18357958', // cameraid: 'L18357958',
// channelid: '1' // channelid: '1'
// } // }
this.api.getGethls(data2).then(res => { if (!this.player) {
this.api.getGethls(data2).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.url = res.data.msg this.url = res.data.msg
this.createVideo() this.createVideoNew()
} }
}) })
}
} else if (this.deviceName == 10) { } else if (this.deviceName == 10) {
this.api.getControlRtdata(equipmentId).then((res) => { this.api.getControlRtdata(equipmentId).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
@ -348,7 +385,7 @@ export default {
}) })
}) })
} else { } else {
this.$message.error(res.data.msg); // this.$message.error(res.data.msg);
} }
}); });
this.api.getControlRtDatastation(formData).then(res => { this.api.getControlRtDatastation(formData).then(res => {
@ -376,7 +413,7 @@ export default {
var chartsData = res.data.data var chartsData = res.data.data
realTimeLine('realTime-line', chartsData) realTimeLine('realTime-line', chartsData)
} else { } else {
this.$message.error(res.data.msg); // this.$message.error(res.data.msg);
} }
}) })
var nowDevice = store.equipmentList[this.indexs - 1] var nowDevice = store.equipmentList[this.indexs - 1]
@ -390,13 +427,15 @@ export default {
// cameraid: 'L18357958', // cameraid: 'L18357958',
// channelid: '1' // channelid: '1'
// } // }
this.api.getGethls(data2).then(res => { if (!this.player) {
// console.log(res.data, 11); this.api.getGethls(data2).then(res => {
if (res.data.code == 200) { // console.log(res.data, 11);
this.url = res.data.msg if (res.data.code == 200) {
this.createVideo() this.url = res.data.msg
} this.createVideoNew()
}) }
})
}
} }
}, },
@ -411,4 +450,8 @@ export default {
} }
</script> </script>
<style lang="scss"></style> <style lang="scss">
.video-js-select-quality-item {
color: rgba(0, 0, 0, 0.85) !important;
}
</style>