Commit a57ba27b by zeyang

解决iframe刷新多次的问题

parent b96196fa
......@@ -211,10 +211,8 @@
</div>
</div>
<!-- SFP咨询问卷 -->
<iframe class="content" *ngIf="selectedId===2 && isSfpShow == true" [src]="transform(iframeUrl)"
style="width: 100%;flex-grow: 1;border: medium none;">
</iframe>
<!-- 客户告知书 -->
<div class="content" *ngIf="selectedId===5">
<ydlife-e-notice [agreeFlag]="false"></ydlife-e-notice>
......@@ -347,6 +345,12 @@
</Modal>
</div>
</div>
<!-- SFP咨询问卷 -->
<div id="iframeDiv" style="width: 100%;flex-grow: 1;border: medium none;display:flex" >
<!-- <iframe [src]="transform(iframeUrl)"
style="width: 100%;flex-grow: 1;border: medium none;">
</iframe> -->
</div>
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
<ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert>
\ No newline at end of file
......@@ -201,11 +201,31 @@ export class MyBusinessDetailComponent implements OnInit {
}
selectTab(id) {
if(id==this.selectedId){
return;
}
if (this.clickFlag == true) {
this.selectedId = id;
} else {
this.selectedId = 1;
}
if(this.selectedId===2 && this.isSfpShow == true){
let iframe = document.createElement('iframe');
// iframe.src = this.transform(this.iframeUrl);
iframe.src = this.iframeUrl;
iframe.width = '100%';
iframe.frameBorder = 'medium none';
iframe.setAttribute("style","flex-grow:1");
document.getElementById("iframeDiv").appendChild(iframe);
}else{
let iframeDiv=document.getElementById("iframeDiv");
let iframe= document.getElementsByTagName("iframe");
if(iframe.length!=0){
iframeDiv.removeChild(iframe[0]);
}
}
}
// 查看报告
viewReport() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment