From 8d99ee508d01ce35e42efed9b601bdc02a73a4d4 Mon Sep 17 00:00:00 2001 From: jingbowen <970029315@qq.com> Date: Fri, 24 Feb 2023 11:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/down-image/down-image.component.ts | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) 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') }); }