Skip to content

Commit

Permalink
Merge branch 'feat/scripts' of github.com:eolinker/eoapi into feat/sc…
Browse files Browse the repository at this point in the history
…ripts
  • Loading branch information
kungfuboy committed Jul 15, 2022
2 parents 2219aca + f4c3ac2 commit e42ef23
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<span i18n>{{ panel.nzActive ? 'Shrink' : 'Expand' }}</span>
<span class="iconfont icon-chevron-{{ panel.nzActive ? 'up' : 'down' }}"></span>
</ng-template>
<nz-tabset [nzAnimated]="false" [nzSelectedIndex]="1" class="mt10">
<nz-tabset [nzAnimated]="false" [(nzSelectedIndex)]="nzSelectedIndex" class="mt10">
<!-- Request Headers -->
<nz-tab [nzTitle]="headerTitleTmp" [nzForceRender]="true">
<ng-template #headerTitleTmp>
Expand Down Expand Up @@ -86,24 +86,6 @@
</ng-template>
<eo-api-edit-rest class="eo_theme_iblock bbd bld brd" [model]="apiData.restParams"></eo-api-edit-rest>
</nz-tab>
<nz-tab [nzTitle]="preScriptTitleTmp" [nzForceRender]="true">
<ng-template #preScriptTitleTmp>
Prescript
<span class="eo-tab-icon" *ngIf="bindGetApiParamNum(apiData.restParams)">{{
apiData.restParams | apiParamsNum
}}</span>
</ng-template>
<eo-api-script class="eo_theme_iblock bbd"></eo-api-script>
</nz-tab>
<nz-tab [nzTitle]="suffixScriptTitleTmp" [nzForceRender]="true">
<ng-template #suffixScriptTitleTmp>
Post script
<span class="eo-tab-icon" *ngIf="bindGetApiParamNum(apiData.restParams)">{{
apiData.restParams | apiParamsNum
}}</span>
</ng-template>
<eo-api-script class="eo_theme_iblock bbd"></eo-api-script>
</nz-tab>
</nz-tabset>
</nz-collapse-panel>
</nz-collapse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class ApiEditComponent implements OnInit, OnDestroy {
expandKeys: string[];
REQUEST_METHOD = objectToArray(RequestMethod);
REQUEST_PROTOCOL = objectToArray(RequestProtocol);
nzSelectedIndex = 1;

private destroy$: Subject<void> = new Subject<void>();
private changeGroupID$: Subject<string | number> = new Subject();
Expand Down Expand Up @@ -117,7 +118,7 @@ export class ApiEditComponent implements OnInit, OnDestroy {
if (typeof this.apiData[tableName] !== 'object') {
return;
}
formData[tableName] = (this.apiData[tableName]||[]).filter((val) => val.name);
formData[tableName] = (this.apiData[tableName] || []).filter((val) => val.name);
if (['requestBody', 'responseBody'].includes(tableName)) {
if (['xml', 'json'].includes(formData[`${tableName}Type`])) {
formData[tableName] = listToTreeHasLevel(formData[tableName]);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.eo-api-script {
::ng-deep .ant-tree-indent {
width: 20px;
}
::ng-deep .ant-tree-switcher {
width: 0;
}
::ng-deep .ant-tree-treenode-switcher-open {
.ant-tree-indent {
width: 0;
}
.ant-tree-switcher {
width: 20px;
}
}
::ng-deep .ant-tree-treenode-switcher-close {
.ant-tree-indent {
width: 0;
}
.ant-tree-switcher {
width: 20px;
}
}
}

0 comments on commit e42ef23

Please sign in to comment.