29258
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['times'],
|
props: ['times', 'deviceId'],
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
canvasHeight: '',
|
canvasHeight: '',
|
||||||
isInit: false,
|
isInit: false,
|
||||||
wrapper: `canvas-${new Date().getTime()}`,
|
wrapper: `canvas-${new Date().getTime()}`,
|
||||||
id: `timeline-${new Date().getTime()}`,
|
id: `timeline-${new Date().getTime()}-${this.deviceId}`,
|
||||||
timer: null
|
timer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -49,6 +49,10 @@
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init () {
|
||||||
|
if (this.ctx) {
|
||||||
|
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
|
||||||
|
}
|
||||||
|
this.isInit = false
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.isInit = true
|
this.isInit = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -60,16 +64,7 @@
|
|||||||
this.ctx = el.getContext('2d')
|
this.ctx = el.getContext('2d')
|
||||||
this.ctx.width = document.querySelector('.canvas').offsetWidth
|
this.ctx.width = document.querySelector('.canvas').offsetWidth
|
||||||
this.ctx.height = document.querySelector('.canvas').offsetHeight
|
this.ctx.height = document.querySelector('.canvas').offsetHeight
|
||||||
|
|
||||||
if (this.x > 0) {
|
|
||||||
// this.x = this.canvasWidth * this.ratioW
|
|
||||||
} else {
|
|
||||||
// this.initNowTime()
|
|
||||||
}
|
|
||||||
|
|
||||||
this.renderPlayback()
|
this.renderPlayback()
|
||||||
|
|
||||||
// this.countdown()
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<div class="playback-item" v-for="(item, index) in times" :key="index">
|
<div class="playback-item" v-for="(item, index) in times" :key="index">
|
||||||
<el-checkbox :label="item.id">
|
<el-checkbox :label="item.id">
|
||||||
<span>通道{{ index + 1 }}</span>
|
<span>通道{{ index + 1 }}</span>
|
||||||
<PlaybackTime class="playback-item__timeline" :key="'PlaybackTime' + index" :times="item.times"></PlaybackTime>
|
<PlaybackTime class="playback-item__timeline" :key="'PlaybackTime' + index" v-if="item.times.length" :deviceId="item.id" :times="item.times"></PlaybackTime>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
|
|||||||
Reference in New Issue
Block a user