diff --git a/packages/IntelligentSecurity/AppISManage/AppISManage.vue b/packages/IntelligentSecurity/AppISManage/AppISManage.vue index d175e201..4ad73237 100644 --- a/packages/IntelligentSecurity/AppISManage/AppISManage.vue +++ b/packages/IntelligentSecurity/AppISManage/AppISManage.vue @@ -3,7 +3,7 @@ -
+
@@ -21,10 +21,27 @@ v-for="(m, i) in monitors" :key="m.id" :style="currentSplitStyle"> - + +
- + +
@@ -69,7 +86,13 @@ let per = this.splitOps.find(e => e.value == this.splitScreen)?.per || "100%" return {width: per, height: per} }, - ...mapState(['user']) + ...mapState(['user']), + + ids () { + if (!this.monitors.length) return '' + + return this.monitors.map(v => v.id).join(',') + } }, data() { @@ -80,11 +103,13 @@ monitors: [], dialog: false, locate: false, + isLoading: false, isShowBar: true, selected: { areaId: '' }, videoUrl: '', + playbackUrls: [], latlng: null, disabledLevel: 0, rules: { @@ -137,6 +162,27 @@ }) }, + onReplay (e) { + this.isLoading = true + this.instance.post(`/app/appzyvideoequipment/getSlwPlaybackUrl`, null, { + params: { + ids: this.ids, + startTime: e.startTime, + endTime: e.endTime, + nvrCodes: this.ids + } + }).then(res => { + if (res.code == 0) { + if (res.data && res.data.length) { + this.playbackUrls = res.data + this.isLoading = false + } + } + }).catch(() => { + this.isLoading = false + }) + }, + removeMonitor(i) { this.monitors.splice(i, 1) }, diff --git a/packages/IntelligentSecurity/components/AiSlwVideo.vue b/packages/IntelligentSecurity/components/AiSlwVideo.vue index e4d04d29..1ff1d84b 100644 --- a/packages/IntelligentSecurity/components/AiSlwVideo.vue +++ b/packages/IntelligentSecurity/components/AiSlwVideo.vue @@ -12,7 +12,7 @@ :id="iframeId" allow="autoplay *; microphone *; fullscreen *" allowfullscreen allowtransparency key="" allowusermedia frameBorder="no" style="width: 100%; height: 100%;" - :src="`https://cdn.cunwuyun.cn/slw2.0/index.html?url=${isLiveing ? src : replayUrl}`"> + :src="`https://cdn.cunwuyun.cn/slw2.0/index.html?url=${src}`">
@@ -45,9 +45,9 @@
直播中 - {{ form.date }} + {{ date }}
-
回到直播
+
回到直播
@@ -86,7 +86,7 @@ import Timeline from './Timeline' export default { - props: ['name', 'isShowBar', 'instance', 'id', 'deviceId'], + props: ['name', 'isShowBar', 'instance', 'id', 'playbackUrls'], name: 'slwVideo', @@ -105,7 +105,6 @@ form: { date: '' }, - src: '', isLoading: false, times: [], date: '', @@ -115,7 +114,22 @@ videoId: `slwvideo-${new Date().getTime()}`, iframeId: `video-${new Date().getTime()}`, isFullscreen: false, - replayUrl: '' + replayUrl: '', + liveingUrl: '' + } + }, + + computed: { + src () { + if (this.playbackUrls.length) { + return this.playbackUrls.filter(v => v.id === this.id)[0].playbackUrl + } + + if (this.isLiveing) { + return this.liveingUrl + } + + return this.replayUrl } }, @@ -129,9 +143,7 @@ this.isShow = true }) } - }, - immediate: true, - deep: true + } } }, @@ -155,7 +167,7 @@ document.removeEventListener('fullscreenchange', this.fullScreenChange) }, - backLiving () { + backLiveing () { this.getLiveingUrl() }, @@ -163,7 +175,7 @@ this.isLoading = true this.instance.post(`/app/appzyvideoequipment/getWebSdkUrl?deviceId=${this.id}`).then(res => { if (res.data) { - this.src = res.data + this.liveingUrl = res.data this.isLiveing = true } @@ -179,7 +191,7 @@ params: { ids: this.id, startTime: `${this.form.date} ${e}`, - endTime: this.form.date + ` ${Number(e.substr(0, 2)) + 6 > 9 ? Number(e.substr(0, 2)) + 6 : '0' + (Number(e.substr(0, 2)) + 6)}:59:59`, + endTime: this.form.date + ` ${Number(e.substr(0, 2)) + 6 > 9 ? Number(e.substr(0, 2)) + 6 : '0' + (Number(e.substr(0, 2)) + 6)}:00:00`, nvrCodes: '' } }).then(res => { @@ -259,6 +271,7 @@ onConfirm () { this.$refs.form.validate((valid) => { if (valid) { + this.date = this.form.date this.isShowDate = false this.getSlwPlaybackTime() } diff --git a/packages/IntelligentSecurity/components/PlaybackTime.vue b/packages/IntelligentSecurity/components/PlaybackTime.vue new file mode 100644 index 00000000..db4368cc --- /dev/null +++ b/packages/IntelligentSecurity/components/PlaybackTime.vue @@ -0,0 +1,134 @@ + + + + + \ No newline at end of file diff --git a/packages/IntelligentSecurity/components/Synergy.vue b/packages/IntelligentSecurity/components/Synergy.vue index 3ce9f38c..2792ebe6 100644 --- a/packages/IntelligentSecurity/components/Synergy.vue +++ b/packages/IntelligentSecurity/components/Synergy.vue @@ -1,9 +1,13 @@