Browse Source

图片下载

beijing
jingbowen 2 years ago
parent
commit
8d99ee508d
  1. 27
      src/app/pages/down-image/down-image.component.ts

27
src/app/pages/down-image/down-image.component.ts

@ -29,6 +29,7 @@ export class DownImageComponent implements OnInit {
this.getAllOrganization();
}
result;
resultList=[];
resultString;
list = [
"车辆进场",
@ -42,6 +43,7 @@ export class DownImageComponent implements OnInit {
];
onClick() {
console.log(this.validateForm.value);
this.resultList=[]
let params = {
StartTime: this.validateForm.value.StartTime
? moment(this.validateForm.value.StartTime).format(
@ -59,16 +61,25 @@ export class DownImageComponent implements OnInit {
params: params,
})
.subscribe((data: any) => {
this.result = data.result.split("\n");
this.result.forEach((element, k) => {
if (element.indexOf("http") === -1 && element.indexOf("/api") === -1) {
this.result[k] = window.location.origin + "/" + element;
}else if(element.indexOf("http") === -1 && element.indexOf("/api") != -1){
this.result[k] = window.location.origin + element;
console.log(data);
this.result = data.result;
this.result.forEach((element:any,i) => {
element.urlList.forEach((e:any,k)=>{
if (e && e.indexOf("http") === -1 && e.indexOf("/api") === -1) {
this.result[i].urlList[k] = window.location.origin + "/" + e;
}else if(e && e.indexOf("http") === -1 && e.indexOf("/api") != -1){
this.result[i].urlList[k] = window.location.origin + e;
}
})
console.log(element,i);
this.resultList.push(element.station.stationName,...element.urlList)
});
this.result = [...this.result];
this.resultString=this.result.join('\n')
this.resultList = [...this.resultList];
console.log(this.resultList);
this.resultString=this.resultList.join('\n')
});
}

Loading…
Cancel
Save