From ba90ddf7618567877f1211f671ae1b34c378faad Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 17 十一月 2023 16:14:21 +0800
Subject: [PATCH] 整合代码
---
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 45 ++++++++++++++++++++++-----------------------
1 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index eb6a5c5..21a9cb1 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -1284,20 +1284,17 @@
}
},
//鏍戝埛鏂�
- flushed() {
+ async flushed() {
this.loading = true;
- this.getAttr()
- .then(() => {
- this.loading = false;
- this.$refs.tree.setCurrentKey(null);
- this.nodeClickList = {}
- this.TreeList = []
- this.TreeFlagCode = true;
- })
- .catch(error => {
- this.loading = false;
- console.error(error);
- });
+ try {
+ await this.getAttr()
+ this.$refs.tree.setCurrentKey(null);
+ this.nodeClickList = {}
+ this.TreeList = []
+ this.TreeFlagCode = true;
+ } finally {
+ this.loading = false;
+ }
},
//鍚敤鍜屽仠鐢ㄩ兘鍏堝垽鏂姸鎬�
//鍚敤
@@ -1321,11 +1318,12 @@
type: 'warning'
});
if (confirmResult) {
- await TreeEnable(this.nodeClickList);
- this.$message({
- type: 'success',
- message: '鍚敤鎴愬姛!'
- });
+ await TreeEnable(this.nodeClickList).then(res => {
+ this.$message({
+ type: 'success',
+ message: '鍚敤鎴愬姛!'
+ });
+ })
await this.getAttr();
} else {
@@ -1363,11 +1361,12 @@
type: 'warning'
});
if (confirmResult) {
- await TreeDeactivate(this.nodeClickList);
- this.$message({
- type: 'success',
- message: '鍋滅敤鎴愬姛!'
- });
+ await TreeDeactivate(this.nodeClickList).then(res => {
+ this.$message({
+ type: 'success',
+ message: '鍋滅敤鎴愬姛!'
+ });
+ })
this.nodeClickList['flag'] = true;
await this.getAttr();
} else {
--
Gitblit v1.9.3