From dfb4d9f04947cbfb2bf966e80f088f2d9cd989b0 Mon Sep 17 00:00:00 2001
From: Nguyendream <728115857@qq.com>
Date: 星期一, 05 七月 2021 08:39:29 +0800
Subject: [PATCH] 修复 按钮loading卡死的问题
---
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm | 10 ++++++----
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
index d43c2ce..de04567 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
@@ -300,8 +300,8 @@
},
data() {
return {
- //鎸夐挳loading
- buttonLoading: false,
+ // 鎸夐挳loading
+ buttonLoading: false,
// 閬僵灞�
loading: true,
// 鏄剧ず鎼滅储鏉′欢
@@ -510,17 +510,19 @@
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
- this.buttonLoading = false;
this.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
} else {
add${BusinessName}(this.form).then(response => {
- this.buttonLoading = false;
this.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
}
}
diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
index abc799e..12bb288 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
@@ -351,8 +351,8 @@
},
data() {
return {
- //鎸夐挳loading
- buttonLoading: false,
+ // 鎸夐挳loading
+ buttonLoading: false,
// 閬僵灞�
loading: true,
// 瀵煎嚭閬僵灞�
@@ -567,17 +567,19 @@
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
- this.buttonLoading = false;
this.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
} else {
add${BusinessName}(this.form).then(response => {
- this.buttonLoading = false;
this.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
}
}
--
Gitblit v1.9.3