Browse Source

接入视屏监控

xiaowang-featrue
mk 9 months ago
parent
commit
1081295420
  1. 1
      public/decoder.js
  2. BIN
      public/decoder.wasm
  3. 1
      public/index.html
  4. 637
      public/jessibuca.d.ts
  5. 1
      public/jessibuca.js
  6. 482
      src/views/dataBoard/IoTPerception/Videosurveillance/cpts/videoDialog.vue
  7. 130
      src/views/dataBoard/IoTPerception/Videosurveillance/index.vue
  8. 1
      src/views/dataBoard/IoTPerception/index.vue
  9. 385
      src/views/dataBoard/IoTPerception/more/index.vue

1
public/decoder.js

File diff suppressed because one or more lines are too long

BIN
public/decoder.wasm

Binary file not shown.

1
public/index.html

@ -9,6 +9,7 @@
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<script src="<%= BASE_URL %>jquery-3.1.1.min.js"></script>
<script src="<%= BASE_URL %>jessibuca.js"></script>
<!-- 站点配置 -->
<script>
window.SITE_CONFIG = {}

637
public/jessibuca.d.ts

@ -0,0 +1,637 @@
declare namespace Jessibuca {
/** 超时信息 */
enum TIMEOUT {
/** 当play()的时候,如果没有数据返回 */
loadingTimeout = 'loadingTimeout',
/** 当播放过程中,如果超过timeout之后没有数据渲染 */
delayTimeout = 'delayTimeout',
}
/** 错误信息 */
enum ERROR {
/** 播放错误,url 为空的时候,调用 play 方法 */
playError = 'playError',
/** http 请求失败 */
fetchError = 'fetchError',
/** websocket 请求失败 */
websocketError = 'websocketError',
/** webcodecs 解码 h265 失败 */
webcodecsH265NotSupport = 'webcodecsH265NotSupport',
/** mediaSource 解码 h265 失败 */
mediaSourceH265NotSupport = 'mediaSourceH265NotSupport',
/** wasm 解码失败 */
wasmDecodeError = 'wasmDecodeError',
}
interface Config {
/**
*
* * string document.getElementById('id')
* */
container: HTMLElement | string;
/**
*
*/
videoBuffer?: number;
/**
* worker地址
* * decoder.js文件 decoder.js decoder.wasm文件必须是放在同一个目录下面 */
decoder?: string;
/**
* 使
*/
forceNoOffscreen?: boolean;
/**
* 'visibilityState''hidden'
*/
hiddenAutoPause?: boolean;
/**
* `false`
*/
hasAudio?: boolean;
/**
* 0()180270
*/
rotate?: boolean;
/**
* 1. `true`,canvas区域,, `setScaleMode(1)`
* 2. `false`canvas区域, `setScaleMode(0)`
*/
isResize?: boolean;
/**
* 1. `true`,canvas区域,,, `setScaleMode(2)`
*/
isFullResize?: boolean;
/**
* 1. `true`ws协议不检验是否以.flv为依据
*/
isFlv?: boolean;
/**
*
*/
debug?: boolean;
/**
* 1. ,
* 2. (loading)(heart),,timeout事件
*/
timeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
heartTimeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
loadingTimeout?: number;
/**
*
*/
supportDblclickFullscreen?: boolean;
/**
*
*/
showBandwidth?: boolean;
/**
*
*/
operateBtns?: {
/** 是否显示全屏按钮 */
fullscreen?: boolean;
/** 是否显示截图按钮 */
screenshot?: boolean;
/** 是否显示播放暂停按钮 */
play?: boolean;
/** 是否显示声音按钮 */
audio?: boolean;
/** 是否显示录制按 */
record?: boolean;
};
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
*/
keepScreenOn?: boolean;
/**
*
*/
isNotMute?: boolean;
/**
*
*/
loadingText?: string;
/**
*
*/
background?: string;
/**
* MediaSource硬解码
* * H.264Safari on iOS不支持
* * forceNoOffscreen false ()
*/
useMSE?: boolean;
/**
* Webcodecs硬解码
* * H.264 (chrome 94https或者localhost环境)
* * forceNoOffscreen false )
* */
useWCS?: boolean;
/**
*
* esc -> 退arrowUp -> arrowDown ->
*/
hotKey?: boolean;
/**
* 使MSE或者Webcodecs H265的时候wasm模式
* false Error true wasm模式播放
*/
autoWasm?: boolean;
/**
* heartTimeout ,
*/
heartTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
heartTimeoutReplayTimes?: number,
/**
* loadingTimeout loading之后自动再播放,
*/
loadingTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
loadingTimeoutReplayTimes?: number
/**
* wasm解码报错之后
*/
wasmDecodeErrorReplay?: boolean,
/**
* https://github.com/langhuihui/jessibuca/issues/152 解决方案
* WebGL图像预处理默认每次取4字节的数据540x960分辨率下的UV分量宽度是540/2=2704绿
*/
openWebglAlignment?: boolean
}
}
declare class Jessibuca {
constructor(config?: Jessibuca.Config);
/**
*
@example
// 开启
jessibuca.setDebug(true)
// 关闭
jessibuca.setDebug(false)
*/
setDebug(flag: boolean): void;
/**
*
@example
jessibuca.mute()
*/
mute(): void;
/**
*
@example
jessibuca.cancelMute()
*/
cancelMute(): void;
/**
*
*
* iPhonechrome等要求自动播放时使
*
* https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
*/
audioResume(): void;
/**
*
* ,
* ,,timeout事件
@example
jessibuca.setTimeout(10)
jessibuca.on('timeout',function(){
//
});
*/
setTimeout(): void;
/**
* @param mode
* 0 canvas区域, `isResize` false
*
* 1 ,canvas区域,, `isResize` true
*
* 2 ,canvas区域,,, `isFullResize` true
@example
jessibuca.setScaleMode(0)
jessibuca.setScaleMode(1)
jessibuca.setScaleMode(2)
*/
setScaleMode(mode: number): void;
/**
*
*
* pause `play()`
@example
jessibuca.pause().then(()=>{
console.log('pause success')
jessibuca.play().then(()=>{
}).catch((e)=>{
})
}).catch((e)=>{
console.log('pause error',e);
})
*/
pause(): Promise<void>;
/**
* ,
@example
jessibuca.close();
*/
close(): void;
/**
*
@example
jessibuca.destroy()
*/
destroy(): void;
/**
*
@example
jessibuca.clearView()
*/
clearView(): void;
/**
*
@example
jessibuca.play('url').then(()=>{
console.log('play success')
}).catch((e)=>{
console.log('play error',e)
})
//
jessibuca.play()
*/
play(url?: string): Promise<void>;
/**
*
*/
resize(): void;
/**
*
*
* `videoBuffer`
*
@example
// 设置 200ms 缓冲
jessibuca.setBufferTime(0.2)
*/
setBufferTime(time: number): void;
/**
* 0() 180270
*
* > iOS没有全屏API *
@example
jessibuca.setRotate(0)
jessibuca.setRotate(90)
jessibuca.setRotate(270)
*/
setRotate(deg: number): void;
/**
*
* 0 1
*
* > mute cancelMute setVolume(0) mute方法mute setVolume(0)0
* @param volume 0;1
@example
jessibuca.setVolume(0.2)
jessibuca.setVolume(0)
jessibuca.setVolume(1)
*/
setVolume(volume: number): void;
/**
*
@example
var result = jessibuca.hasLoaded()
console.log(result) // true
*/
hasLoaded(): boolean;
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
* H5目前在chrome\edge 84, android chrome 84API, https页面
*
@example
jessibuca.setKeepScreenOn()
*/
setKeepScreenOn(): boolean;
/**
* ()
@example
jessibuca.setFullscreen(true)
//
jessibuca.setFullscreen(false)
*/
setFullscreen(flag: boolean): void;
/**
*
*
* @param filename , , `时间戳`
* @param format , png或jpeg或者webp , `png`
* @param quality , jpeg或者webp时0 ~ 1 , `0.92`
* @param type , download或者base64或者blob`download`
@example
jessibuca.screenshot("test","png",0.5)
const base64 = jessibuca.screenshot("test","png",0.5,'base64')
const fileBlob = jessibuca.screenshot("test",'blob')
*/
screenshot(filename?: string, format?: string, quality?: number, type?: string): void;
/**
*
* @param fileName
* @param fileType webmwebm mp4
@example
jessibuca.startRecord('xxx','webm')
*/
startRecord(fileName: string, fileType: string): void;
/**
*
@example
jessibuca.stopRecordAndSave()
*/
stopRecordAndSave(): void;
/**
*
@example
var result = jessibuca.isPlaying()
console.log(result) // true
*/
isPlaying(): boolean;
/**
*
@example
var result = jessibuca.isMute()
console.log(result) // true
*/
isMute(): boolean;
/**
*
@example
var result = jessibuca.isRecording()
console.log(result) // true
*/
isRecording(): boolean;
/**
* jessibuca
* @example
* jessibuca.on("load",function(){console.log('load')})
*/
on(event: 'load', callback: () => void): void;
/**
* ms
* @example
* jessibuca.on('timeUpdate',function (ts) {console.log('timeUpdate',ts);})
*/
on(event: 'timeUpdate', callback: () => void): void;
/**
* 2
* @example
* jessibuca.on("videoInfo",function(data){console.log('width:',data.width,'height:',data.width)})
*/
on(event: 'videoInfo', callback: (data: {
/** 视频宽 */
width: number;
/** 视频高 */
height: number;
}) => void): void;
/**
* 2
* @example
* jessibuca.on("audioInfo",function(data){console.log('numOfChannels:',data.numOfChannels,'sampleRate',data.sampleRate)})
*/
on(event: 'audioInfo', callback: (data: {
/** 声频通道 */
numOfChannels: number;
/** 采样率 */
sampleRate: number;
}) => void): void;
/**
*
* @example
* jessibuca.on("log",function(data){console.log('data:',data)})
*/
on(event: 'log', callback: () => void): void;
/**
*
* @example
* jessibuca.on("error",function(error){
if(error === Jessibuca.ERROR.fetchError){
//
}
else if(error === Jessibuca.ERROR.webcodecsH265NotSupport){
//
}
console.log('error:',error)
})
*/
on(event: 'error', callback: (err: Jessibuca.ERROR) => void): void;
/**
* KB 1,
* @example
* jessibuca.on("kBps",function(data){console.log('kBps:',data)})
*/
on(event: 'kBps', callback: (value: number) => void): void;
/**
*
* @example
* jessibuca.on("start",function(){console.log('start render')})
*/
on(event: 'start', callback: () => void): void;
/**
* ,
* @example
* jessibuca.on("timeout",function(error){console.log('timeout:',error)})
*/
on(event: 'timeout', callback: (error: Jessibuca.TIMEOUT) => void): void;
/**
* play()
* @example
* jessibuca.on("loadingTimeout",function(){console.log('timeout')})
*/
on(event: 'loadingTimeout', callback: () => void): void;
/**
* timeout之后没有数据渲染
* @example
* jessibuca.on("delayTimeout",function(){console.log('timeout')})
*/
on(event: 'delayTimeout', callback: () => void): void;
/**
*
* @example
* jessibuca.on("fullscreen",function(flag){console.log('is fullscreen',flag)})
*/
on(event: 'fullscreen', callback: () => void): void;
/**
*
* @example
* jessibuca.on("play",function(flag){console.log('play')})
*/
on(event: 'play', callback: () => void): void;
/**
*
* @example
* jessibuca.on("pause",function(flag){console.log('pause')})
*/
on(event: 'pause', callback: () => void): void;
/**
* boolean值
* @example
* jessibuca.on("mute",function(flag){console.log('is mute',flag)})
*/
on(event: 'mute', callback: () => void): void;
/**
* 1
* @example
* jessibuca.on("stats",function(s){console.log("stats is",s)})
*/
on(event: 'stats', callback: (stats: {
/** 当前缓冲区时长,单位毫秒 */
buf: number;
/** 当前视频帧率 */
fps: number;
/** 当前音频码率,单位byte */
abps: number;
/** 当前视频码率,单位byte */
vbps: number;
/** 当前视频帧pts,单位毫秒 */
ts: number;
}) => void): void;
/**
* 1
* @param performance 0: 表示卡顿,1: 表示流畅,2: 表示非常流程
* @example
* jessibuca.on("performance",function(performance){console.log("performance is",performance)})
*/
on(event: 'performance', callback: (performance: 0 | 1 | 2) => void): void;
/**
*
* @example
* jessibuca.on("recordStart",function(){console.log("record start")})
*/
on(event: 'recordStart', callback: () => void): void;
/**
*
* @example
* jessibuca.on("recordEnd",function(){console.log("record end")})
*/
on(event: 'recordEnd', callback: () => void): void;
/**
* 1s一次
* @example
* jessibuca.on("recordingTimestamp",function(timestamp){console.log("recordingTimestamp is",timestamp)})
*/
on(event: 'recordingTimestamp', callback: (timestamp: number) => void): void;
/**
* play方法 -> -> -> ->
* @param event
* @param callback
*/
on(event: 'playToRenderTimes', callback: (times: {
playInitStart: number, // 1 初始化
playStart: number, // 2 初始化
streamStart: number, // 3 网络请求
streamResponse: number, // 4 网络请求
demuxStart: number, // 5 解封装
decodeStart: number, // 6 解码
videoStart: number, // 7 渲染
playTimestamp: number,// playStart- playInitStart
streamTimestamp: number,// streamStart - playStart
streamResponseTimestamp: number,// streamResponse - streamStart
demuxTimestamp: number, // demuxStart - streamResponse
decodeTimestamp: number, // decodeStart - demuxStart
videoTimestamp: number,// videoStart - decodeStart
allTimestamp: number // videoStart - playInitStart
}) => void): void
/**
*
*
@example
jessibuca.on("load",function(){console.log('load')})
*/
on(event: string, callback: Function): void;
}
export default Jessibuca;

1
public/jessibuca.js

File diff suppressed because one or more lines are too long

482
src/views/dataBoard/IoTPerception/Videosurveillance/cpts/videoDialog.vue

@ -0,0 +1,482 @@
<template>
<div>
<el-dialog :destroy-on-close="true" :modal="true" :modal-append-to-body="false" :visible="showDialog"
width="686px" @close="handleClose">
<div class="main-title main-title2">
<Title text="视频监控" />
</div>
<div class="root">
<div class="container-shell">
<div class="container-shell-title"><span class="tag-version"
v-if="version">({{
version
}})</span></div>
<div id="container" ref="container">
<canvas style="width: 100%;height: 100%;"></canvas>
</div>
<div class="input" v-if="loaded" style="line-height: 30px">
<button @click="destroy">销毁</button>
<button v-if="quieting" @click="cancelMute">取消静音</button>
<template v-else>
<button @click="mute">静音</button>
音量
<select v-model="volume" @change="volumeChange">
<option value="1">100</option>
<option value="0.75">75</option>
<option value="0.5">50</option>
<option value="0.25">25</option>
</select>
</template>
<span>旋转</span>
<select v-model="rotate" @change="rotateChange">
<option value="0">0</option>
<option value="90">90</option>
<option value="270">270</option>
</select>
<button @click="fullscreen">全屏</button>
<button @click="screenShot">截图</button>
<div style="line-height: 30px">
<input type="checkbox" ref="operateBtns" v-model="showOperateBtns"
@change="restartPlay" /><span>操作按钮</span>
<!-- <input type="checkbox" ref="operateBtns" v-model="showBandwidth"
@change="restartPlay" /><span>网速</span>
<span v-if="performance">性能{{ performance }}</span> -->
</div>
</div>
<div class="input" v-if="loaded">
<!-- <input type="checkbox" ref="offscreen" v-model="useOffscreen"
@change="restartPlay('offscreen')" /><span>离屏渲染</span> -->
<select v-model="scale" @change="scaleChange">
<option value="0">完全填充(拉伸)</option>
<option value="1">等比缩放</option>
<option value="2">完全填充(未拉伸)</option>
</select>
<button v-if="!playing" @click="clearView">清屏</button>
<template v-if="playing">
<select v-model="recordType">
<option value="webm">webm</option>
<option value="mp4">mp4</option>
</select>
<button v-if="!recording" @click="startRecord">录制</button>
<button v-if="!recording" @click="stopAndSaveRecord">暂停录制</button>
</template>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Title from "@/views/dataBoard/satisfactionEval/components/Title";
import {requestPost} from "@/js/dai/request";
export default {
name: "videoDialog",
components: {
Title,
},
props: {
showDialog: {
type: Boolean,
default: false
},
monitorCode:{
type:String,
default:''
}
},
data() {
return {
user: this.$store.state.user,
jessibuca: null,
version: '',
wasm: false,
vc: "ff",
playing: false,
quieting: true,
loaded: false, // mute
showOperateBtns: false,
showBandwidth: false,
err: "",
speed: 0,
performance: "",
volume: 1,
rotate: 0,
useWCS: false,
useMSE: true,
useOffscreen: false,
recording: false,
recordType: 'webm',
scale: 0
};
},
computed: {},
watch: {
showDialog: {
handler(val,old) {
if(val){
this.$nextTick(()=>{
this.create();
})
this.getVideoUrl()
}else{
if(this.jessibuca){
this.jessibuca.destroy();
this.jessibuca = null;
}
}
},
immediate: true,
},
},
mounted() {
window.onerror = (msg) => (this.err = msg);
},
async unmounted() {
if(this.jessibuca){
await this.jessibuca.destroy();
this.jessibuca = null;
}
},
created() {
},
methods: {
async getVideoUrl(){
let {data,code} = await requestPost('/actual/base/videoMonitoring/getVideoUrl',{monitorCode:this.monitorCode})
if(code === 0){
this.url = data
this.play()
}
},
create(options) {
console.log('seeee');
options = options || {};
this.jessibuca = new window.Jessibuca(
Object.assign(
{
container: this.$refs.container,
videoBuffer: 0.2, //
isResize: false,
useWCS: this.useWCS,
useMSE: this.useMSE,
text: "",
// background: "bg.jpg",
loadingText: "疯狂加载中...",
// hasAudio:false,
debug: true,
supportDblclickFullscreen: true,
showBandwidth: this.showBandwidth, //
operateBtns: {
fullscreen: this.showOperateBtns,
screenshot: this.showOperateBtns,
play: this.showOperateBtns,
audio: this.showOperateBtns,
},
vod: this.vod,
forceNoOffscreen: !this.useOffscreen,
isNotMute: true,
timeout: 10
},
options
)
);
console.log(this.jessibuca,'seeee');
var _this = this;
this.jessibuca.on("load", function () {
console.log("on load");
});
this.jessibuca.on("log", function (msg) {
console.log("on log", msg);
});
this.jessibuca.on("record", function (msg) {
console.log("on record:", msg);
});
this.jessibuca.on("pause", function () {
console.log("on pause");
_this.playing = false;
});
this.jessibuca.on("play", function () {
console.log("on play");
_this.playing = true;
});
this.jessibuca.on("fullscreen", function (msg) {
console.log("on fullscreen", msg);
});
this.jessibuca.on("mute", function (msg) {
console.log("on mute", msg);
_this.quieting = msg;
});
this.jessibuca.on("mute", function (msg) {
console.log("on mute2", msg);
});
this.jessibuca.on("audioInfo", function (msg) {
console.log("audioInfo", msg);
});
// this.jessibuca.on("bps", function (bps) {
// // console.log('bps', bps);
// });
// let _ts = 0;
// this.jessibuca.on("timeUpdate", function (ts) {
// console.log('timeUpdate,old,new,timestamp', _ts, ts, ts - _ts);
// _ts = ts;
// });
this.jessibuca.on("videoInfo", function (info) {
console.log("videoInfo", info);
});
this.jessibuca.on("error", function (error) {
console.log("error", error);
});
this.jessibuca.on("timeout", function () {
console.log("timeout");
});
this.jessibuca.on('start', function () {
console.log('frame start');
})
this.jessibuca.on("performance", function (performance) {
var show = "卡顿";
if (performance === 2) {
show = "非常流畅";
} else if (performance === 1) {
show = "流畅";
}
_this.performance = show;
});
this.jessibuca.on('buffer', function (buffer) {
console.log('buffer', buffer);
})
this.jessibuca.on('stats', function (stats) {
console.log('stats', stats);
})
this.jessibuca.on('kBps', function (kBps) {
console.log('kBps', kBps);
});
this.jessibuca.on("play", () => {
this.playing = true;
this.loaded = true;
this.quieting = this.jessibuca.isMute();
});
this.jessibuca.on('recordingTimestamp', (ts) => {
console.log('recordingTimestamp', ts);
})
// console.log(this.jessibuca);
},
play() {
// this.jessibuca.onPlay = () => (this.playing = true);
// if (this.$refs.playUrl.value) {
this.jessibuca.play(this.url);
// }
},
mute() {
this.jessibuca.mute();
},
cancelMute() {
this.jessibuca.cancelMute();
},
pause() {
this.jessibuca.pause();
this.playing = false;
this.err = "";
this.performance = "";
},
volumeChange() {
this.jessibuca.setVolume(this.volume);
},
rotateChange() {
this.jessibuca.setRotate(this.rotate);
},
async destroy() {
if (this.jessibuca) {
await this.jessibuca.destroy();
}
this.create();
this.playing = false;
this.loaded = false;
this.performance = "";
},
fullscreen() {
this.jessibuca.setFullscreen(true);
},
clearView() {
this.jessibuca.clearView();
},
startRecord() {
const time = new Date().getTime();
this.jessibuca.startRecord(time, this.recordType);
},
stopAndSaveRecord() {
this.jessibuca.stopRecordAndSave();
},
screenShot() {
this.jessibuca.screenshot();
},
async restartPlay(type) {
if (type === 'mse') {
this.useWCS = false;
this.useOffscreen = false;
} else if (type === 'wcs') {
this.useMSE = false
} else if (type === 'offscreen') {
this.useMSE = false
}
await this.destroy();
setTimeout(() => {
this.play();
}, 100)
},
changeBuffer() {
this.jessibuca.setBufferTime(Number(this.$refs.buffer.value));
},
scaleChange() {
this.jessibuca.setScaleMode(this.scale);
},
handleClose() {
this.$emit("close", false);
this.item = {};
},
},
};
</script>
<style lang="scss" scoped src="@/assets/scss/dataBoard/popup-info.scss"></style>
<style lang="scss" scoped>
@import "@/assets/scss/modules/shequzhili/event-info.scss";
@import "@/assets/scss/dataBoard/dialog.scss";
@mixin fontStyle {
color: #fff !important;
font-size: 14px !important;
}
.title {
margin: 0 0 20px 20px;
color: #ffffff;
font-size: 18px;
}
.root {
display: flex;
place-content: center;
margin-top: 3rem;
}
.container-shell {
position: relative;
backdrop-filter: blur(5px);
background: hsla(0, 0%, 50%, 0.5);
padding: 30px 4px 10px 4px;
/* border: 2px solid black; */
width: auto;
position: relative;
border-radius: 5px;
box-shadow: 0 10px 20px;
}
.container-shell-title {
position: absolute;
color: darkgray;
top: 4px;
left: 10px;
text-shadow: 1px 1px black;
}
.tag-version {
}
#container {
background: rgba(13, 14, 27, 0.7);
width: 640px;
height: 398px;
display: flex;
justify-content: center;
align-items: center;
}
#container > canvas{
width: 100%;
height: 100%;
transform: none !important;
top: 0 !important;
left: 0 !important;
}
.input {
display: flex;
align-items: center;
margin-top: 10px;
color: white;
place-content: stretch;
}
.input2 {
bottom: 0px;
}
.input input[type='input'] {
flex: auto;
}
.err {
position: absolute;
top: 40px;
left: 10px;
color: red;
}
.option {
position: absolute;
top: 4px;
right: 10px;
display: flex;
place-content: center;
font-size: 12px;
}
.option span {
color: white;
}
@media (max-width: 720px) {
#container {
width: 90vw;
height: 52.7vw;
}
}
</style>

130
src/views/dataBoard/IoTPerception/Videosurveillance/index.vue

@ -2,64 +2,24 @@
<div class="m-jdjs">
<div class="m-jdjs-js">
<div class="video-right">
<video
ref="myVideo" src="../image/123.mp4" />
<div class="video-right" v-for="(item,index) in list" :key="index">
<img ref="myVideo" src="../image/beijing1.png" />
<div
v-if="videoPauseShow"
class="prism-big-play-btn"
@click="videoPlay"
@click="videoPlay(item.monitorCode)"
>
<div class="outter"></div>
</div>
</div>
<div class="video-right">
<video
ref="myVideo" src="../image/123.mp4" />
<div
v-if="videoPauseShow"
class="prism-big-play-btn"
@click="videoPlay"
>
<div class="outter"></div>
</div>
</div>
<div class="video-right">
<video
ref="myVideo" src="../image/123.mp4" />
<div
v-if="videoPauseShow"
class="prism-big-play-btn"
@click="videoPlay"
>
<div class="outter"></div>
</div>
</div>
<div class="video-right">
<video
ref="myVideo" src="../image/123.mp4" />
<div
v-if="videoPauseShow"
class="prism-big-play-btn"
@click="videoPlay"
>
<div class="outter"></div>
</div>
</div>
<!-- <video src="../image/123.mp4" />
<video src="../image/123.mp4" />
<video src="../image/123.mp4" /> -->
</div>
<video-dialog :showDialog="showDialog" :monitorCode="monitorCode" @close="close"></video-dialog>
</div>
</template>
<script>
import titleSmall from "@/views/dataBoard/satisfactionEval/components/Title/titleSmall.vue";
import * as echarts from "echarts";
import resiCategoryMap from "@/views/business/resi-category-map.js";
import videoDialog from "./cpts/videoDialog.vue"
export default {
name: "jdjs",
props: {
@ -71,45 +31,24 @@
data() {
return {
orgId: this.$store.state.chooseArea.chooseName,
report: "",
overview: "",
loading: false,
rffxDate:'',
event12345Num:"",
provinceSatisfactionNum:"",
selfInspectNum:"",
typeConditionList: [
{
label: "本月",
value: 1,
},
{
label: "上月",
value: 2,
},
{
label: "近三月",
value: 3,
},
{
label: "近半年",
value: 4,
},
{
label: "近一年",
value: 5,
},
],
showDialog:false,
typeCondition:5,
endTime:"",
startTime:"",
videoPauseShow: true,
startTime:"",
videoPauseShow: true,
list:[],
monitorCode:''
};
},
watch: {
currentLevelData(val) {
if (val.orgId) {
this.getReport(val);
this.getData();
this.getChartData(val);
}
@ -117,43 +56,23 @@
},
mounted() {
if (this.currentLevelData.orgId) {
this.getReport(this.currentLevelData);
this.getChartData();
this.getData()
}
},
components: {
titleSmall,
videoDialog
},
methods: {
videoPlay() {
//
this.videoPauseShow = false;
//video
this.$refs.myVideo.play();
videoPlay(code) {
this.showDialog = true;
this.monitorCode = code
},
getReport({ orgId, orgLevel }) {
this.$http
.get(
"/actual/base/streetOverview/communityOverview?orgId=" +
orgId +
"&level=" +
orgLevel
)
.then(({ data: { data } }) => {
this.overview = data;
});
this.$http
.get(
"/actual/base/streetOverview/summaryReport?orgId=" +
orgId +
"&level=" +
orgLevel
)
.then(({ data: { data } }) => {
this.report = data;
});
close(){
this.showDialog = false;
},
getChartData({ orgId, orgLevel }) {
this.loading = true
this.$http.get('/actual/base/resiCategory/categoryCountList?orgId=' +
@ -338,22 +257,11 @@
},
getData() {
this.loading = true;
let {startTime,endTime } = this
let params = {
level: this.currentLevelData.orgLevel,
orgId: this.currentLevelData.orgId,
startTime,
endTime,
};
this.$http
.get(
"/governance/satisfactionOverview/satisfactionFollowGroup?" +
this.$paramsFormat(params)
)
"/actual/base/videoMonitoring/page?page=1&limit=10")
.then(({ data: { data } }) => {
this.event12345Num = data.event12345Num;
this.provinceSatisfactionNum = data.provinceSatisfactionNum;
this.selfInspectNum = data.selfInspectNum;
this.list = data.list.splice(0,4)
this.loading = false;
});
},

1
src/views/dataBoard/IoTPerception/index.vue

@ -289,7 +289,6 @@
close(){this.showDialog=false},
close1(){this.showequipmentListMore=false},
getMore(){
console.log(123);
this.showDialog=true
}
},

385
src/views/dataBoard/IoTPerception/more/index.vue

@ -2,54 +2,32 @@
<div>
<el-dialog :destroy-on-close="true" :modal="true" :modal-append-to-body="false" :visible="showDialog"
width="993px" @close="handleClose">
<div >
<div>
<div class="main-title main-title2">
<Title text="视频监控" />
</div>
<div class="m-jdjs-js">
<div class="video-right">
<video ref="myVideo" src="../image/123.mp4" />
<div v-if="videoPauseShow" class="prism-big-play-btn" @click="videoPlay">
<div class="outter"></div>
</div>
</div>
<div class="video-right">
<video ref="myVideo" src="../image/123.mp4" />
<div v-if="videoPauseShow" class="prism-big-play-btn" @click="videoPlay">
<div class="outter"></div>
</div>
</div>
<div class="video-right">
<video ref="myVideo" src="../image/123.mp4" />
<div v-if="videoPauseShow" class="prism-big-play-btn" @click="videoPlay">
<div class="outter"></div>
</div>
<Title text="视频监控" />
</div>
<div class="video-right">
<video ref="myVideo" src="../image/123.mp4" />
<div v-if="videoPauseShow" class="prism-big-play-btn" @click="videoPlay">
<div class="outter"></div>
<div class="m-jdjs-js">
<div class="video-right" v-for="(item, index) in list" :key="index">
<img ref="myVideo" src="../image/beijing1.png" />
<div class="prism-big-play-btn" @click="videoPlay(item.monitorCode)">
<div class="outter"></div>
</div>
</div>
</div>
<!-- <video src="../image/123.mp4" />
<video src="../image/123.mp4" />
<video src="../image/123.mp4" /> -->
</div>
</div>
</el-dialog>
<video-dialog :showDialog="showDialogVideo" :monitorCode="monitorCode" @close="handleVideoClose"></video-dialog>
</div>
</template>
<script>
import Title from "@/views/dataBoard/satisfactionEval/components/Title";
import videoDialog from "../Videosurveillance/cpts/videoDialog.vue"
export default {
name: "moreDialog",
components: {
Title,
videoDialog
},
props: {
showDialog: {
@ -60,186 +38,42 @@ export default {
},
data() {
return {
bubbleList: [
{
w: 8,
x: 10
},
{
w: 9,
x: 50
},
{
w: 4,
x: 30
},
{
w: 5,
x: 80
},
{
w: 4,
x: 30
},
{
w: 4,
x: 70
},
{
w: 6,
x: 20
},
{
w: 8,
x: 50
},
{
w: 4,
x: 60
},
{
w: 6,
x: 65
}
],
list: [
{
title: '常用功能',
children: [
{
label: '物联一张图',
navigator: ''
},
{
label: '居民选举',
navigator: ''
},
{
label: '派件管理',
navigator: 'shequzhili-Delivery-index'
}, {
label: '社区宣传',
navigator: 'communityParty-comPromotion-index'
}, {
label: '社区活动',
navigator: 'volunteer-activityArchive-index'
}
]
},
{
title: '人房管理',
children: [
{
label: '房屋管理',
navigator: 'base-community-community'
},
{
label: '居民信息',
navigator: 'base-resi'
},
{
label: '居民分类',
navigator: 'base-classification'
}, {
label: '迁入记录',
navigator: 'base-huji-immigration-index'
}, {
label: '迁出记录',
navigator: 'plugins-change-changerelocation'
},
{
label: '死亡记录',
navigator: 'plugins-change-changedeath'
},
{
label: '虚拟网格居民',
navigator: 'base-virtualResi'
},
{
label: '智能导入',
navigator: 'base-smartImport'
}
]
},
{
title:'社区党建',
children:[
{
label: '党组织管理',
navigator: 'communityParty-partyOrg-orgTree'
},{
label: '党员信息',
navigator: 'communityParty-members-memberList'
},{
label: '联建单位',
navigator: 'communityParty-regionalParty-units'
},{
label: '联建活动',
navigator: 'communityParty-regionalParty-activitys'
},{
label: '社区宣传',
navigator: 'communityParty-comPromotion-index'
},{
label: '社区活动',
navigator: 'communityParty-activity-index'
}
]
}
],
loading: false,
loading1: false,
user: this.$store.state.user
user: this.$store.state.user,
showDialogVideo:false,
monitorCode:null
};
},
computed: {},
watch: {
showDialog: {
handler(val) {
if (val) {
this.bubbleList.forEach((i, index) => {
this.$set(
i,
'c',
this.forArrayValue(
[
'rgba(255,255,255,0.2)',
'rgba(255,255,255,0.4)',
'rgba(255,255,255,0.6)'
],
index
)
)
})
console.log(this.bubbleList);
} else {
}
this.getData()
},
immediate: true,
},
},
created() {
console.log('showDialog:', this.showDialog); // showDialog
console.log('type:', this.type); // type
this.bubbleList.forEach((i, index) => {
this.$set(
i,
'c',
this.forArrayValue(
[
'rgba(255,255,255,0.2)',
'rgba(255,255,255,0.4)',
'rgba(255,255,255,0.6)'
],
index
)
)
})
},
methods: {
getData() {
this.loading = true;
this.$http
.get(
"/actual/base/videoMonitoring/page?page=1&limit=10")
.then(({ data: { data } }) => {
this.list = data.list.splice(0,4)
this.loading = false;
});
},
videoPlay(code) {
console.log(code);
this.showDialogVideo = true;
this.monitorCode = code
},
forArrayValue(array, sort) {
return array[sort % array.length]
},
@ -247,14 +81,14 @@ export default {
this.$emit("close", false);
this.item = {};
},
// handelClickNavigator(navigator) {
// this.$emit('handelClickNavigator', navigator)
// }
handleVideoClose(val){
this.showDialogVideo = val
}
},
mounted() {
console.log('showDialog:', this.showDialog); // showDialog
console.log('type:', this.type); // type
}
console.log('showDialog:', this.showDialog); // showDialog
console.log('type:', this.type); // type
}
};
</script>
<style lang="scss" scoped src="@/assets/scss/dataBoard/popup-info.scss"></style>
@ -369,77 +203,78 @@ section {
}
.m-jdjs-js{
margin: 10px 16px;
display: grid;
grid-template-columns: repeat(4, 1fr); /* 每行 2 个元素,1fr 是均分空间 */
gap: 10px; /* 设置每个元素之间的间距 */
video {
width: 210px;
height: 120px;
.video-right {
// width: 400px;
// height: 350px;
position: relative;
background: #000;
.prism-big-play-btn {
position: absolute;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
width: 32px;
height: 32px;
background: url("../image/vidio.png") no-repeat;
background-size: contain;
cursor: pointer;
.outter {
border: 7px solid rgba(255, 255, 255, 0.51);
width: 32px;
height: 32px;
border-radius: 100%;
position: absolute;
box-sizing: border-box;
top: 0;
left: 0;
}
.outter:hover {
content: "";
width: 80px;
height: 80px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -40px;
margin-top: -40px;
border-radius: 50%;
//a1@keyframes web
// a2 1s 2s
// a3 css
// ++,infinite
animation: warn 1s ease-out 0s infinite;
}
// warn, "from" "to" 0% 100%
// 0% 100% 使
@keyframes warn {
0% {
// transform: scaleX/Y
transform: scale(0.5);
opacity: 1;
}
30% {
opacity: 1;
}
100% {
transform: scale(1.4);
opacity: 0;
}
}
}
}
}
}
.m-jdjs-js {
margin: 10px 16px;
display: grid;
grid-template-columns: repeat(4, 1fr);
/* 每行 2 个元素,1fr 是均分空间 */
gap: 10px;
/* 设置每个元素之间的间距 */
.video-right {
position: relative;
background: #000;
.prism-big-play-btn {
position: absolute;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
width: 32px;
height: 32px;
background: url("../image/vidio.png") no-repeat;
background-size: contain;
cursor: pointer;
.outter {
border: 7px solid rgba(255, 255, 255, 0.51);
width: 32px;
height: 32px;
border-radius: 100%;
position: absolute;
box-sizing: border-box;
top: 0;
left: 0;
}
.outter:hover {
content: "";
width: 80px;
height: 80px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -40px;
margin-top: -40px;
border-radius: 50%;
//a1@keyframes web
// a2 1s 2s
// a3 css
// ++,infinite
animation: warn 1s ease-out 0s infinite;
}
// warn, "from" "to" 0% 100%
// 0% 100% 使
@keyframes warn {
0% {
// transform: scaleX/Y
transform: scale(0.5);
opacity: 1;
}
30% {
opacity: 1;
}
100% {
transform: scale(1.4);
opacity: 0;
}
}
}
}
}
</style>
Loading…
Cancel
Save