pull/135/head
孙萌 2024-03-15 14:58:46 +08:00
parent ba3c63e15c
commit ac71d3e339
2 changed files with 36 additions and 20 deletions

View File

@ -131,15 +131,13 @@ export default {
}, 0); }, 0);
}, },
downloadImage(url, filename) { downloadImage(url, filename) {
console.log(filename);
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.download = filename; link.download = filename;
document.body.appendChild(link) link.click();
link.click()
document.body.removeChild(link)
}, },
download() { async download() {
// this.loading = this.$loading({ // this.loading = this.$loading({
// lock: true, // lock: true,
// text: '', // text: '',
@ -149,22 +147,39 @@ export default {
var store = this.$store.state var store = this.$store.state
var index = store.equipmentIndex; var index = store.equipmentIndex;
var data = {
deviceId: store.equipmentList[index - 1].deviceId, // var data = {
startTime: this.getTime(this.dateRange[0]), // deviceId: store.equipmentList[index - 1].deviceId,
endTime: this.getTime(this.dateRange[1]), // startTime: this.getTime(this.dateRange[0]),
page: this.currentPage, // endTime: this.getTime(this.dateRange[1]),
pageSize: this.pageSize, // page: this.currentPage,
} // pageSize: this.pageSize,
// }
// this.api.imageUploadImage(data).then(res=>{ // this.api.imageUploadImage(data).then(res=>{
// console.log(res,111); // console.log(res,111);
// }) // })
this.tableData.forEach((item, index) => { var index = 0
const pictureUrl = item.pictureUrl; // const pictureUrl = this.tableData[index].pictureUrl;
const filename = `image_${item.updateTime}.jpg`; // 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 => { // this.api.loadHistorydata(data).then(res => {
// // blob // // blob
// this.loading.close() // this.loading.close()

View File

@ -247,7 +247,7 @@
</div> </div>
</div> </div>
<div class="status-true-charts" <div class="status-true-charts"
v-if="item.type == 6 || item.type == 5 || item.type == 2 || item.type == 15 || item.type == 14 || item.type == 13 || item.type == 12"> 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">
<img src="../../assets/img/status-true-charts-icon.png" alt=""> <img src="../../assets/img/status-true-charts-icon.png" alt="">
<div :id="'statusCharts' + index"></div> <div :id="'statusCharts' + index"></div>
</div> </div>
@ -716,10 +716,11 @@ export default {
// simple-; standard-; security-; voice-; GitHub // simple-; standard-; security-; voice-; GitHub
template: 'security', template: 'security',
useHardDev: true,// 7.7.x 2023.11.7 7.7.6 useHardDev: true,// 7.7.x 2023.11.7 7.7.6
// plugin: ["talk"], // talk- plugin: ["talk"], // talk-
width: divW, // 1920 px width: divW, // 1920 px
height: divH, // 1080 px height: divH, // 1080 px
}) })
}, },
getIcon(item) { getIcon(item) {
var index = item.index var index = item.index
@ -1430,7 +1431,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.statusList.forEach((el, index) => { 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(() => { setTimeout(() => {
statusCharts(`statusCharts${index}`, el.progress) statusCharts(`statusCharts${index}`, el.progress)