diff --git a/src/apps/AppIntelligentSecurity/SlwVideo.vue b/src/apps/AppIntelligentSecurity/SlwVideo.vue index 24b705d6..69dbd677 100644 --- a/src/apps/AppIntelligentSecurity/SlwVideo.vue +++ b/src/apps/AppIntelligentSecurity/SlwVideo.vue @@ -119,10 +119,7 @@ }, onDateChange (e) { - console.log(e) this.date = `${e.result}` - // this.date = `${e.year}-${e.month}-${e.day}` - this.getSlwPlaybackTime() }, @@ -176,8 +173,8 @@ const times = res.data[0].times this.times = times.map(item => { - const startTime = (item.startTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 - const endTime = (item.endTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 + const startTime = (item.startTime - new Date(this.date.replaceAll('-', '/') + ' 00:00:00').getTime()) / 1000 + const endTime = (item.endTime - new Date(this.date.replaceAll('-', '/') + ' 00:00:00').getTime()) / 1000 return { startTime: Number(startTime.toFixed(0)), diff --git a/src/apps/AppIntelligentSecurity/components/Timeline.vue b/src/apps/AppIntelligentSecurity/components/Timeline.vue index f4f0bd84..29b9c096 100644 --- a/src/apps/AppIntelligentSecurity/components/Timeline.vue +++ b/src/apps/AppIntelligentSecurity/components/Timeline.vue @@ -78,7 +78,7 @@ this.isHide = false if (!this.isChoose) return - this.x = e.clientX - canvasInfo.left - 4 + this.x = e.clientX - canvasInfo.left this.ratioW = this.x / this.canvasWidth } else { this.isHide = true @@ -176,12 +176,13 @@ drawLine(ctx, options) { const { beginX, beginY, endX, endY, lineColor, lineWidth } = options - ctx.beginPath() ctx.lineWidth = lineWidth + ctx.strokeStyle = lineColor + ctx.beginPath() ctx.moveTo(beginX, beginY) ctx.lineTo(endX, endY) - ctx.strokeStyle = lineColor ctx.stroke() + ctx.closePath() }, renderPlayback () { @@ -197,7 +198,7 @@ lineWidth: item.endTime * unit - item.startTime * unit }) }) - ctx.draw() + ctx.draw(true) }, renderTimeLine () { @@ -250,6 +251,7 @@ user-select: none; cursor: e-resize; -webkit-user-drag: none; + transform: translateX(-50%); } .time-scale {