From 5424fecb100bece19b6260ade1836954deecdc61 Mon Sep 17 00:00:00 2001
From: renqian805 <1743369777@qq.com>
Date: Wed, 3 Aug 2022 21:54:34 +0800
Subject: [PATCH] perf: tab select
---
.../browser/src/app/pages/api/test/api-test.component.html | 5 +++--
.../browser/src/app/pages/api/test/api-test.component.ts | 6 ++++++
.../api-test-result-request-body.component.ts | 7 ++-----
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/workbench/browser/src/app/pages/api/test/api-test.component.html b/src/workbench/browser/src/app/pages/api/test/api-test.component.html
index 4ec61356..2e3eecec 100644
--- a/src/workbench/browser/src/app/pages/api/test/api-test.component.html
+++ b/src/workbench/browser/src/app/pages/api/test/api-test.component.html
@@ -99,7 +99,7 @@
+ class="mt-2.5 response_container" (nzSelectChange)="handleBottomTabSelect($event)">
@@ -109,7 +109,8 @@
-
+
diff --git a/src/workbench/browser/src/app/pages/api/test/api-test.component.ts b/src/workbench/browser/src/app/pages/api/test/api-test.component.ts
index 82133ead..a1ef71d3 100644
--- a/src/workbench/browser/src/app/pages/api/test/api-test.component.ts
+++ b/src/workbench/browser/src/app/pages/api/test/api-test.component.ts
@@ -66,6 +66,7 @@ export class ApiTestComponent implements OnInit, OnDestroy {
status: 'start' | 'testing' | 'tested' = 'start';
waitSeconds = 0;
tabIndexRes = 0;
+ isRequestBodyLoaded = false;
testResult: any = {
response: {},
request: {},
@@ -199,6 +200,11 @@ export class ApiTestComponent implements OnInit, OnDestroy {
localStorage.setItem(API_TEST_DRAG_TOP_HEIGHT_KEY, leftEl.style.height);
}
}
+ handleBottomTabSelect(tab) {
+ if (tab.index === 2) {
+ this.isRequestBodyLoaded = true;
+ }
+ }
private test() {
this.scriptCache = {
beforeScript: this.beforeScript,
diff --git a/src/workbench/browser/src/app/pages/api/test/result-request-body/api-test-result-request-body.component.ts b/src/workbench/browser/src/app/pages/api/test/result-request-body/api-test-result-request-body.component.ts
index 53d4808c..4304bacb 100644
--- a/src/workbench/browser/src/app/pages/api/test/result-request-body/api-test-result-request-body.component.ts
+++ b/src/workbench/browser/src/app/pages/api/test/result-request-body/api-test-result-request-body.component.ts
@@ -1,17 +1,14 @@
-import { Component, OnInit, Input, OnChanges, AfterViewInit } from '@angular/core';
+import { Component, OnInit, Input, OnChanges } from '@angular/core';
@Component({
selector: 'eo-api-test-result-request-body',
templateUrl: './api-test-result-request-body.component.html',
styleUrls: ['./api-test-result-request-body.component.scss'],
})
-export class ApiTestResultRequestBodyComponent implements OnInit, OnChanges, AfterViewInit {
+export class ApiTestResultRequestBodyComponent implements OnInit, OnChanges {
@Input() model: { name: string; type: string; value: string }[] | string | any;
modelType: string;
constructor() {}
- ngAfterViewInit(): void {
- console.log('???????');
- }
ngOnInit(): void {}
ngOnChanges(changes) {