diff --git a/src/app/pages/down-image/down-image.component.ts b/src/app/pages/down-image/down-image.component.ts index 0616616..5f03c82 100644 --- a/src/app/pages/down-image/down-image.component.ts +++ b/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') }); }