feat: 0.2.0

This commit is contained in:
夜鹰 2023-02-09 14:54:15 +08:00
parent 8d4c88179a
commit 3d18b48853
2 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "postcat",
"souceLocale": "zh-Hans",
"version": "0.1.0",
"version": "0.2.0",
"main": "out/app/electron-main/main.js",
"description": "A lightweight, extensible API tool",
"homepage": "https://github.com/eolinker/postcat.git",

View File

@ -19,6 +19,10 @@ import { ApiEffectService } from '../../../service/store/api-effect.service';
import { ApiStoreService } from '../../../service/store/api-state.service';
export type GroupAction = 'new' | 'edit' | 'delete';
const getAllAPIId = ({ id, children = [] }) => {
return [id, ...children.map(getAllAPIId)];
};
@Component({
selector: 'pc-api-group-tree',
templateUrl: './api-group-tree.component.html',
@ -135,11 +139,14 @@ export class ApiGroupTreeComponent implements OnInit {
nzTitle: title,
nzContent: ApiGroupEditComponent,
nzComponentParams: params,
nzOnOk: () =>
modal.componentInstance.submit().then(data => {
nzOnOk: () => {
console.log('this.apiGroupTree', params.group);
// const idList = getAllAPIId(params.group)
return modal.componentInstance.submit().then(data => {
if (params.action !== 'new') return;
this.expandKeys = [...(this.expandKeys || []), modal.componentInstance.group.parentId];
})
});
}
});
}
editGroup(group) {