|
@@ -0,0 +1,199 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="video-player-container" v-if="visible">
|
|
|
|
|
+ <div class="video-player-title">
|
|
|
|
|
+ <span class="title-text">{{ taskInfo?.securityPatrolName }}</span>
|
|
|
|
|
+ <img src="@/assets/image/common/close.png" style="cursor: pointer" alt="" @click="closeVideoDialog" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="video-info">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">责任人:{{ taskInfo?.responsiblePerson }}</div>
|
|
|
|
|
+ <div class="col">已巡查时间:{{ formatTime(currentTime) }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col">巡查点位数:{{ taskInfo?.countPatrolPoints}}个</div>
|
|
|
|
|
+ <div class="col">预计剩余时间:{{ formatTime(remainingTime) }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-12">任务内容:{{ taskInfo?.securityPatrolContext }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="video-player-area">
|
|
|
|
|
+ <div class="title">当前巡查点:{{ devName }}</div>
|
|
|
|
|
+ <EasyPlayer
|
|
|
|
|
+ ref="playerRef"
|
|
|
|
|
+ playerName="测试"
|
|
|
|
|
+ :videoUrl="option.url"
|
|
|
|
|
+ class="video-player screenshot"
|
|
|
|
|
+ live
|
|
|
|
|
+ speed
|
|
|
|
|
+ :easyStretch="true"
|
|
|
|
|
+ :muted="true"
|
|
|
|
|
+ :has-audio="false"
|
|
|
|
|
+ :reconnection="true"
|
|
|
|
|
+ @click.native.stop
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="video-btn">
|
|
|
|
|
+ <div class="left">
|
|
|
|
|
+ <div class="nextBtn" @click="toNext">下一个</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="right">
|
|
|
|
|
+ <el-button type="primary" @click="closeVideoDialog">停止巡河</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'InspectVideoPlayerPopup',
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ visible: false,
|
|
|
|
|
+ currentTime: 0,
|
|
|
|
|
+ totalTime: 20,
|
|
|
|
|
+ isRunning: false,
|
|
|
|
|
+ timer: null,
|
|
|
|
|
+ option: { url: '' },
|
|
|
|
|
+ style: {
|
|
|
|
|
+ width: '600px',
|
|
|
|
|
+ height: '350px'
|
|
|
|
|
+ },
|
|
|
|
|
+ securityPatrolName: '',
|
|
|
|
|
+ responsiblePerson: '',
|
|
|
|
|
+ securityPatrolContext: '',
|
|
|
|
|
+ taskInfo:{},
|
|
|
|
|
+ nextName:'',
|
|
|
|
|
+ num: 0,
|
|
|
|
|
+ devName: '',
|
|
|
|
|
+ type: 'add'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ remainingTime() {
|
|
|
|
|
+ return this.totalTime - this.currentTime
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.$globalEventBus.$on('clickVideoInspectPlay', (data) => {
|
|
|
|
|
+ console.info(data.taskInfo)
|
|
|
|
|
+ this.type = data.type
|
|
|
|
|
+ this.taskInfo = data.taskInfo
|
|
|
|
|
+ this.devName = data.point && data.point.devName ? data.point.devName : ''
|
|
|
|
|
+ this.nextName = data.nextName
|
|
|
|
|
+ const url = data.point && data.point.url ? data.point.url : ''
|
|
|
|
|
+ this.$set(this.option, 'url', url)
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.visible = data.visible
|
|
|
|
|
+ this.startTimer()
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ destroyed() {
|
|
|
|
|
+ this.$globalEventBus.$off('clickVideoInspectPlay')
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ startTimer() {
|
|
|
|
|
+ if (this.isRunning) return
|
|
|
|
|
+
|
|
|
|
|
+ this.isRunning = true
|
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
|
+ if (this.currentTime < this.totalTime) {
|
|
|
|
|
+ this.currentTime += 1
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.pauseTimer()
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ formatTime(time) {
|
|
|
|
|
+ return time + 's'
|
|
|
|
|
+ },
|
|
|
|
|
+ pauseTimer() {
|
|
|
|
|
+ this.isRunning = false
|
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
|
+ },
|
|
|
|
|
+ toNext() {
|
|
|
|
|
+ if (this.type == 'add') {
|
|
|
|
|
+ this.$globalEventBus.$emit('toPlayNextVideoAdd')
|
|
|
|
|
+ } else if (this.type == 'xc') {
|
|
|
|
|
+ this.$globalEventBus.$emit('toPlayNextVideo')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ closeVideoDialog() {
|
|
|
|
|
+ this.visible = false
|
|
|
|
|
+ if (this.type == 'add') {
|
|
|
|
|
+ this.$globalEventBus.$emit('closeVideoPlayAdd')
|
|
|
|
|
+ } else if (this.type == 'xc') {
|
|
|
|
|
+ this.$globalEventBus.$emit('closeVideoPlay')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.video-player-container {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 8%;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translate(-50%, 0%);
|
|
|
|
|
+ width: px-to-rem(600);
|
|
|
|
|
+ background-color: rgba(35, 61, 108, 0.8);
|
|
|
|
|
+ z-index: 9999;
|
|
|
|
|
+ .video-player-title {
|
|
|
|
|
+ background: url('@/assets/image/common/popup_title_bg.png') no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ height: px-to-rem(39);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 0 px-to-rem(20);
|
|
|
|
|
+ font-size: px-to-rem(16);
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ margin-left: px-to-rem(20);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .video-player-area {
|
|
|
|
|
+ width: px-to-rem(600);
|
|
|
|
|
+ height: px-to-rem(350);
|
|
|
|
|
+ padding: px-to-rem(13) px-to-rem(20);
|
|
|
|
|
+ }
|
|
|
|
|
+ .video-info {
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ font-size: px-to-rem(16);
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ padding: px-to-rem(13) px-to-rem(20);
|
|
|
|
|
+ padding-bottom: px-to-rem(5);
|
|
|
|
|
+ border-bottom: 1px solid #4d628b;
|
|
|
|
|
+ .row {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ margin-bottom: px-to-rem(10);
|
|
|
|
|
+ .col {
|
|
|
|
|
+ width: 40%;
|
|
|
|
|
+ }
|
|
|
|
|
+ .col-12 {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .video-btn {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ font-weight: 400;
|
|
|
|
|
+ font-size: px-to-rem(16);
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ padding: px-to-rem(10) px-to-rem(20);
|
|
|
|
|
+ .left {
|
|
|
|
|
+ .nextBtn {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ color: #4f9fff;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|