Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
<img slot="prefix" src="https://cdn.cunwuyun.cn/slw2.0/images/fp.png">
|
<img slot="prefix" src="https://cdn.cunwuyun.cn/slw2.0/images/fp.png">
|
||||||
<el-option v-for="(op,i) in splitOps" :key="i" v-bind="op"/>
|
<el-option v-for="(op,i) in splitOps" :key="i" v-bind="op"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="headerBar-item" v-if="monitors.length > 1" @click="isShowBar = !isShowBar" :class="[isShowBar ? '' : 'cancel-xt']">
|
<div class="headerBar-item" v-if="monitors.length > 1" @click="playbackUrls = [], isShowBar = !isShowBar" :class="[isShowBar ? '' : 'cancel-xt']">
|
||||||
<img src="https://cdn.cunwuyun.cn/slw2.0/images/xt.png">
|
<img src="https://cdn.cunwuyun.cn/slw2.0/images/xt.png">
|
||||||
<span>{{ isShowBar ? '视频协同' : '取消协同' }}</span>
|
<span>{{ isShowBar ? '视频协同' : '取消协同' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="synergr" :id="videoId" v-if="isInit" @mousemove.stop="onMousemove" @mouseup="onMouseUp" @mouseleave="isHide = true">
|
<div class="synergr" :id="videoId" v-if="isInit" @mouseleave="isHide = true" @mousemove.stop="onMousemove" @mouseup="onMouseUp">
|
||||||
<canvas
|
<canvas
|
||||||
id="synergr-canvas"
|
id="synergr-canvas"
|
||||||
:style="{height: '28px'}"
|
:style="{height: '28px'}"
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
:width="canvasWidth"
|
:width="canvasWidth"
|
||||||
height="28">
|
height="28">
|
||||||
</canvas>
|
</canvas>
|
||||||
<div class="time" v-show="!isHide" :style="{left: left + 'px'}">{{ time }}</div>
|
<div class="time" v-show="!isHide && left > 100" :style="{left: (left) + 'px'}">{{ time }}</div>
|
||||||
<img
|
<img
|
||||||
@mousedown="onDragDown"
|
@mousedown="onDragDown"
|
||||||
class="drag-img"
|
class="drag-img"
|
||||||
:style="{left: x + 'px'}"
|
:style="{left: (x) + 'px'}"
|
||||||
src="https://cdn.cunwuyun.cn/slw2.0/images/drag.png" />
|
src="https://cdn.cunwuyun.cn/slw2.0/images/drag.png" />
|
||||||
<div class="slw-bottom">
|
<div class="slw-bottom">
|
||||||
<div class="action-bar">
|
<div class="action-bar">
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
isInit: false,
|
isInit: false,
|
||||||
left: 0,
|
left: 0,
|
||||||
date: '',
|
date: '',
|
||||||
scale: 4,
|
scale: 3,
|
||||||
width: '',
|
width: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
x: 0,
|
x: 0,
|
||||||
@@ -152,14 +152,16 @@
|
|||||||
onMousemove (e) {
|
onMousemove (e) {
|
||||||
const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect()
|
const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect()
|
||||||
const seconds = 24 * 60 * 60
|
const seconds = 24 * 60 * 60
|
||||||
const x = e.clientX - canvasInfo.left
|
const x = e.clientX - canvasInfo.left + 100
|
||||||
const unit = seconds / this.canvasWidth * x
|
if (x < 100) return
|
||||||
|
|
||||||
|
const unit = seconds / this.canvasWidth * (x - 100)
|
||||||
this.left = x
|
this.left = x
|
||||||
this.time = this.secTotime(unit)
|
this.time = this.secTotime(unit)
|
||||||
this.isHide = false
|
this.isHide = false
|
||||||
|
|
||||||
if (!this.isChoose) return
|
if (!this.isChoose) return
|
||||||
this.x = e.clientX - canvasInfo.left - 4
|
this.x = e.clientX - canvasInfo.left + 100
|
||||||
this.ratioW = this.x / this.canvasWidth
|
this.ratioW = this.x / this.canvasWidth
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -175,6 +177,9 @@
|
|||||||
this.$emit('backLiveing')
|
this.$emit('backLiveing')
|
||||||
this.isLiveing = true
|
this.isLiveing = true
|
||||||
this.initNowTime()
|
this.initNowTime()
|
||||||
|
this.form.date = this.$moment(new Date()).format('YYYY-MM-DD')
|
||||||
|
this.date = this.$moment(new Date()).format('YYYY-MM-DD')
|
||||||
|
this.getSlwPlaybackTime()
|
||||||
},
|
},
|
||||||
|
|
||||||
onMouseUp () {
|
onMouseUp () {
|
||||||
@@ -183,7 +188,7 @@
|
|||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
this.timer = null
|
this.timer = null
|
||||||
this.isChoose = false
|
this.isChoose = false
|
||||||
const time = this.secTotime((24 * 60 * 60) / this.canvasWidth * this.x)
|
const time = this.secTotime((24 * 60 * 60) / this.canvasWidth * (this.x - 100))
|
||||||
this.$emit('replay', {
|
this.$emit('replay', {
|
||||||
startTime: `${this.form.date} ${time}`,
|
startTime: `${this.form.date} ${time}`,
|
||||||
endTime: this.form.date + ` ${Number(time.substr(0, 2)) + 6 > 9 ? Number(time.substr(0, 2)) + 6 : '0' + (Number(time.substr(0, 2)) + 6)}:59:59`
|
endTime: this.form.date + ` ${Number(time.substr(0, 2)) + 6 > 9 ? Number(time.substr(0, 2)) + 6 : '0' + (Number(time.substr(0, 2)) + 6)}:59:59`
|
||||||
@@ -196,13 +201,13 @@
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.isInit = true
|
this.isInit = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.canvasWidth = document.querySelector(`#${this.videoId}`).offsetWidth
|
this.canvasWidth = document.querySelector(`#${this.videoId}`).offsetWidth - 116
|
||||||
this.canvasHeight = document.querySelector(`#${this.videoId}`).offsetHeight
|
this.canvasHeight = document.querySelector(`#${this.videoId}`).offsetHeight
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const el = document.querySelector(`#synergr-canvas`)
|
const el = document.querySelector(`#synergr-canvas`)
|
||||||
this.ctx = el.getContext('2d')
|
this.ctx = el.getContext('2d')
|
||||||
this.ctx.width = document.querySelector(`#${this.videoId}`).offsetWidth
|
this.ctx.width = document.querySelector(`#${this.videoId}`).offsetWidth - 116
|
||||||
this.ctx.height = document.querySelector(`#${this.videoId}`).offsetHeight
|
this.ctx.height = document.querySelector(`#${this.videoId}`).offsetHeight
|
||||||
|
|
||||||
if (this.x > 0) {
|
if (this.x > 0) {
|
||||||
@@ -236,10 +241,10 @@
|
|||||||
|
|
||||||
onClick (e) {
|
onClick (e) {
|
||||||
const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect()
|
const canvasInfo = document.querySelector(`#synergr-canvas`).getBoundingClientRect()
|
||||||
this.x = e.clientX - canvasInfo.left - 4
|
this.x = e.clientX - canvasInfo.left + 100
|
||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
this.timer = null
|
this.timer = null
|
||||||
const time = this.secTotime((24 * 60 * 60) / this.canvasWidth * this.x)
|
const time = this.secTotime((24 * 60 * 60) / this.canvasWidth * (this.x - 100))
|
||||||
this.$emit('replay', {
|
this.$emit('replay', {
|
||||||
startTime: `${this.form.date} ${time}`,
|
startTime: `${this.form.date} ${time}`,
|
||||||
endTime: this.form.date + ` ${Number(time.substr(0, 2)) + 6 > 9 ? Number(time.substr(0, 2)) + 6 : '0' + (Number(time.substr(0, 2)) + 6)}:00:00`
|
endTime: this.form.date + ` ${Number(time.substr(0, 2)) + 6 > 9 ? Number(time.substr(0, 2)) + 6 : '0' + (Number(time.substr(0, 2)) + 6)}:00:00`
|
||||||
@@ -256,21 +261,23 @@
|
|||||||
ctx.font = '12px Arial'
|
ctx.font = '12px Arial'
|
||||||
const w = this.canvasWidth / 24
|
const w = this.canvasWidth / 24
|
||||||
|
|
||||||
for (let i = 1; i < 25; i ++) {
|
for (let i = 0; i < 25; i ++) {
|
||||||
this.drawLine(ctx, {
|
this.drawLine(ctx, {
|
||||||
beginX: i * w,
|
beginX: i * w,
|
||||||
beginY: 28,
|
beginY: 28,
|
||||||
endX: i * w,
|
endX: i * w,
|
||||||
endY: i % this.scale === 0 ? 22 : 24,
|
endY: (i % this.scale === 0 || i === 0) ? 22 : 24,
|
||||||
lineColor: i % this.scale === 0 ? '#000' : '#000',
|
lineColor: (i % this.scale === 0 || i === 0) ? '#000' : '#000',
|
||||||
lineWidth: i % this.scale === 0 ? 1 : 1
|
lineWidth: (i % this.scale === 0 || i === 0) ? 1 : 1
|
||||||
})
|
})
|
||||||
|
|
||||||
if (i % this.scale === 0) {
|
if ((i % this.scale === 0 || i === 0)) {
|
||||||
const text = (i < 10 ? '0' + i : i) + ': 00'
|
const text = (i < 10 ? '0' + i : i) + ': 00'
|
||||||
const textWidth = ctx.measureText(text).width
|
const textWidth = ctx.measureText(text).width
|
||||||
if (i === 24) {
|
if (i === 24) {
|
||||||
ctx.fillText(text, i * w - textWidth, 21)
|
ctx.fillText(text, i * w - textWidth, 21)
|
||||||
|
} else if (i === 0) {
|
||||||
|
ctx.fillText(text, 0, 21)
|
||||||
} else {
|
} else {
|
||||||
ctx.fillText(text, i * w - textWidth / 2, 21)
|
ctx.fillText(text, i * w - textWidth / 2, 21)
|
||||||
}
|
}
|
||||||
@@ -376,6 +383,10 @@
|
|||||||
font-size: 0;
|
font-size: 0;
|
||||||
background: rgba(40, 43, 58, 1);
|
background: rgba(40, 43, 58, 1);
|
||||||
|
|
||||||
|
#synergr-canvas {
|
||||||
|
margin: 0 0 0 100px;
|
||||||
|
}
|
||||||
|
|
||||||
.playback {
|
.playback {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -438,8 +449,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
padding: 0 8px 0 0;
|
width: 60px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -474,6 +486,7 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: e-resize;
|
cursor: e-resize;
|
||||||
-webkit-user-drag: none;
|
-webkit-user-drag: none;
|
||||||
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
|
|||||||
Reference in New Issue
Block a user