From ac71d3e3398a1eefc58969646f46d83a464a23f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Fri, 15 Mar 2024 14:58:46 +0800 Subject: [PATCH] 1 --- src/views/page/imageData.vue | 49 +++++++++++++++++++++++------------- src/views/page/realTime.vue | 7 +++--- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/views/page/imageData.vue b/src/views/page/imageData.vue index 487b13a..d795e5a 100644 --- a/src/views/page/imageData.vue +++ b/src/views/page/imageData.vue @@ -131,15 +131,13 @@ export default { }, 0); }, downloadImage(url, filename) { + console.log(filename); const link = document.createElement('a'); link.href = url; link.download = filename; - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - + link.click(); }, - download() { + async download() { // this.loading = this.$loading({ // lock: true, // text: '加载中', @@ -149,22 +147,39 @@ export default { var store = this.$store.state var index = store.equipmentIndex; - var data = { - deviceId: store.equipmentList[index - 1].deviceId, - startTime: this.getTime(this.dateRange[0]), - endTime: this.getTime(this.dateRange[1]), - page: this.currentPage, - pageSize: this.pageSize, - } + + // var data = { + // deviceId: store.equipmentList[index - 1].deviceId, + // startTime: this.getTime(this.dateRange[0]), + // endTime: this.getTime(this.dateRange[1]), + // page: this.currentPage, + // pageSize: this.pageSize, + // } // this.api.imageUploadImage(data).then(res=>{ // console.log(res,111); // }) - this.tableData.forEach((item, index) => { - const pictureUrl = item.pictureUrl; - const filename = `image_${item.updateTime}.jpg`; + var index = 0 + // const pictureUrl = this.tableData[index].pictureUrl; + // const filename = `image_${this.tableData[index].updateTime}.jpg`; + // this.downloadImage(pictureUrl, filename); + const timer =setInterval(() => { + index += 1 + if (index <= this.tableData.length) { + + console.log(index, this.tableData,this.tableData.length); + const pictureUrl = this.tableData[index-1].pictureUrl; + const filename = `image_${this.tableData[index-1].updateTime}.jpg`; + this.downloadImage(pictureUrl, filename); + }else{ + clearInterval(timer); + } + }, 501); + // this.tableData.forEach((item, index) => { + // const pictureUrl = item.pictureUrl; + // const filename = `image_${item.updateTime}.jpg`; - this.downloadImage(pictureUrl, filename); - }); + // this.downloadImage(pictureUrl, filename); + // }); // this.api.loadHistorydata(data).then(res => { // // 创建一个blob对象 // this.loading.close() diff --git a/src/views/page/realTime.vue b/src/views/page/realTime.vue index e2d4280..81665c2 100644 --- a/src/views/page/realTime.vue +++ b/src/views/page/realTime.vue @@ -247,7 +247,7 @@
+ v-if="item.type == 6 || item.type == 5 || item.type == 2 || item.type == 15 || item.type == 14 || item.type == 13 || item.type == 12|| item.type == 16">
@@ -716,10 +716,11 @@ export default { // 播放主题 simple-极简版; standard-标准版; security-安防版; voice-语音版; 自定义主题详见GitHub template: 'security', useHardDev: true,// 开启高性能模式 依赖需高于7.7.x 截止到2023.11.7 建议保持最新版本为7.7.6 - // plugin: ["talk"], // 加载插件,talk-对讲 非必填 + plugin: ["talk"], // 加载插件,talk-对讲 非必填 width: divW, // 播放容器宽高 也可以直接设置成数字 如 1920 单位是px height: divH, // 播放容器宽高 也可以直接设置成数字 如 1080 单位是px }) + }, getIcon(item) { var index = item.index @@ -1430,7 +1431,7 @@ export default { setTimeout(() => { this.statusList.forEach((el, index) => { - if (el.open != 0 && (el.type == 6 || el.type == 5 || el.type == 2 || el.type == 15 || el.type == 14 || el.type == 13 || el.type == 12)) { + if (el.open != 0 && (el.type == 6 || el.type == 5 || el.type == 2 || el.type == 15 || el.type == 14 ||el.type == 16 || el.type == 13 || el.type == 12)) { setTimeout(() => { statusCharts(`statusCharts${index}`, el.progress)