mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-11-30 10:47:41 +08:00
fix: request body code real time
This commit is contained in:
parent
669c8b1ac6
commit
efc43a6a50
@ -312,6 +312,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
|
||||
const groupApiData: GroupApiDataModel = { group: [], api: [] };
|
||||
if (children?.length) {
|
||||
const targetIndex = children.findIndex((n) => n.key === dragNode.key);
|
||||
|
||||
if (targetIndex === dragNode.origin.weight) {
|
||||
return;
|
||||
}
|
||||
@ -340,7 +341,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
|
||||
this.updateoperateApiEvent(groupApiData);
|
||||
}
|
||||
|
||||
replaceGroupKey(key: string) {
|
||||
private replaceGroupKey(key: string) {
|
||||
return Number(key.replace('group-', ''));
|
||||
}
|
||||
/**
|
||||
|
@ -67,8 +67,8 @@ export class ApiTestBodyComponent implements OnInit, OnChanges, AfterViewInit, O
|
||||
this.beforeChangeBodyByType(val[0]);
|
||||
});
|
||||
this.initListConf();
|
||||
this.rawChange$.pipe(debounceTime(300), takeUntil(this.destroy$)).subscribe(() => {
|
||||
this.modelChange.emit(this.model);
|
||||
this.rawChange$.pipe(debounceTime(400), takeUntil(this.destroy$)).subscribe((code) => {
|
||||
this.modelChange.emit(code);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -193,11 +193,11 @@ export class EoMonacoEditorComponent implements AfterViewInit, OnInit, OnChanges
|
||||
});
|
||||
|
||||
this.codeEdtor.onDidChangeModelContent((e) => {
|
||||
this.codeChange.emit(this.codeEdtor.getValue());
|
||||
this.handleChange();
|
||||
});
|
||||
|
||||
this.codeEdtor.onDidBlurEditorText((e) => {
|
||||
this.codeChange.emit(this.codeEdtor.getValue());
|
||||
this.handleBlur();
|
||||
});
|
||||
|
||||
let prevHeight = 0;
|
||||
@ -224,10 +224,14 @@ export class EoMonacoEditorComponent implements AfterViewInit, OnInit, OnChanges
|
||||
console.log('ace event', event, txt);
|
||||
}
|
||||
handleBlur() {
|
||||
this.codeChange.emit(this.$$code);
|
||||
Promise.resolve().then(() => {
|
||||
this.codeChange.emit(this.$$code);
|
||||
});
|
||||
}
|
||||
handleChange() {
|
||||
this.codeChange.emit(this.$$code);
|
||||
Promise.resolve().then(() => {
|
||||
this.codeChange.emit(this.$$code);
|
||||
});
|
||||
}
|
||||
rerenderEditor() {
|
||||
this.codeEdtor?.layout?.();
|
||||
|
@ -18,8 +18,8 @@
|
||||
(nzOnCancel)="handleCancel()">
|
||||
<div *nzModalContent>
|
||||
<pre class="eg" i18n>Import like this:<br />{{ eg }}</pre>
|
||||
<eo-editor [(code)]="paramCode" [editorType]="contenTypeEditor" [hiddenList]="['type']"
|
||||
[eventList]="['type', 'format', 'copy', 'search', 'replace']"></eo-editor>
|
||||
<eo-monaco-editor [(code)]="paramCode" [editorType]="contenTypeEditor" [hiddenList]="['type']" [maxLine]="16"
|
||||
[eventList]="['type', 'format', 'copy', 'search', 'replace']"></eo-monaco-editor>
|
||||
</div>
|
||||
<div *nzModalFooter style="text-align: left">
|
||||
<button nz-button nzType="default" (click)="handleImport('mixin')" i18n>Replace Changed</button>
|
||||
|
@ -3,7 +3,7 @@ import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { ParamsImportComponent } from './params-import.component';
|
||||
|
||||
import { EouiModule } from '../../../eoui/eoui.module';
|
||||
import { SharedModule } from 'eo/workbench/browser/src/app/shared/shared.module';
|
||||
|
||||
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
|
||||
import { NzModalModule } from 'ng-zorro-antd/modal';
|
||||
@ -12,7 +12,7 @@ import { EoIconparkIconModule } from 'eo/workbench/browser/src/app/eoui/iconpark
|
||||
|
||||
@NgModule({
|
||||
declarations: [ParamsImportComponent],
|
||||
imports: [FormsModule, EoIconparkIconModule, NzDropDownModule, NzModalModule, NzButtonModule, EouiModule],
|
||||
imports: [FormsModule, EoIconparkIconModule, NzDropDownModule, NzModalModule, NzButtonModule, SharedModule],
|
||||
exports: [ParamsImportComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user