fix: api group tree sort not save

This commit is contained in:
renqian805 2022-08-04 00:14:27 +08:00
parent df9036011d
commit 9339351f34
2 changed files with 10 additions and 3 deletions

View File

@ -349,7 +349,9 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
* @param data GroupApiDataModel
*/
updateoperateApiEvent(data: GroupApiDataModel) {
let count = 0;
if (data.group.length > 0) {
count++;
console.log('data.group', data.group);
this.storage.run(
'groupBulkUpdate',
@ -361,11 +363,14 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
})),
],
(result: StorageRes) => {
this.buildGroupTreeData();
if (--count === 0) {
this.buildGroupTreeData();
}
}
);
}
if (data.api.length > 0) {
count++;
console.log('data.api', data.api);
this.storage.run(
'apiDataBulkUpdate',
@ -377,7 +382,9 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
})),
],
(result: StorageRes) => {
this.buildGroupTreeData();
if (--count === 0) {
this.buildGroupTreeData();
}
}
);
}

View File

@ -26,7 +26,7 @@ import { EoMessageService } from 'eo/workbench/browser/src/app/eoui/message/eo-m
import { transferFileToDataUrl } from 'eo/workbench/browser/src/app/utils';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { EoMonacoEditorComponent } from 'eo/workbench/browser/src/app/shared/components/monaco-editor/monaco-editor.component';
import { EditorOptions, JoinedEditorOptions } from 'ng-zorro-antd/code-editor';
import { EditorOptions } from 'ng-zorro-antd/code-editor';
@Component({
selector: 'eo-api-test-body',