Browse Source

按钮可持续点击问题。

soft5566 2 years ago
parent
commit
c23f3021fb
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/views/businessInfo/index.vue

+ 10 - 3
src/views/businessInfo/index.vue

@@ -114,6 +114,7 @@
 				<el-button class="add-user-confirm-btn" @click="handle_update_article"> 确定 </el-button>
 				<el-button class="add-user-confirm-btn" @click="handle_update_article"> 确定 </el-button>
 			</div>
 			</div>
 		</el-dialog>
 		</el-dialog>
+		<!-- 获取文章 -->
 		<el-dialog custom-class="dialog-have-no-title" :visible.sync="dialog_get_article" :close-on-click-modal="false" :close-on-press-escape="false"
 		<el-dialog custom-class="dialog-have-no-title" :visible.sync="dialog_get_article" :close-on-click-modal="false" :close-on-press-escape="false"
 			:show-close="false">
 			:show-close="false">
 			<div slot="" class="dialog-have-no-title-body">
 			<div slot="" class="dialog-have-no-title-body">
@@ -122,7 +123,7 @@
 			</div>
 			</div>
 			<div slot="footer" class="dialog-footer">
 			<div slot="footer" class="dialog-footer">
 				<el-button class="add-user-cancel-btn" @click="dialog_get_article = false"> 取消 </el-button>
 				<el-button class="add-user-cancel-btn" @click="dialog_get_article = false"> 取消 </el-button>
-				<el-button class="add-user-confirm-btn" @click="handle_get_article"> 确定 </el-button>
+				<el-button :class="dialog_get_article_btn_disable?'':'add-user-confirm-btn'" :loading="dialog_get_article_btn_disable" @click="handle_get_article" :disabled="dialog_get_article_btn_disable"> 确定 </el-button>
 			</div>
 			</div>
 		</el-dialog>
 		</el-dialog>
 		<!-- 资讯详情 -->
 		<!-- 资讯详情 -->
@@ -206,6 +207,7 @@
 				dialog_update_article: false,
 				dialog_update_article: false,
 				update_ids: [],
 				update_ids: [],
 				dialog_get_article: false,
 				dialog_get_article: false,
+				dialog_get_article_btn_disable: false,
 				dialog_show_article: false,
 				dialog_show_article: false,
 				article_detail: {
 				article_detail: {
 					title: '',
 					title: '',
@@ -314,7 +316,8 @@
 			},
 			},
 			// 获取文章
 			// 获取文章
 			handle_get_article() {
 			handle_get_article() {
-				var that = this
+				var that = this;
+				this.dialog_get_article_btn_disable = true;
 				getArticle().then((res) => {
 				getArticle().then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (res.code === 200) {
 					if (res.code === 200) {
@@ -322,12 +325,15 @@
 						that.get_table_data('list')
 						that.get_table_data('list')
 						that.dialog_get_article = false
 						that.dialog_get_article = false
 						that.$message.success(res.message)
 						that.$message.success(res.message)
+						that.dialog_get_article_btn_disable = false;
 					} else {
 					} else {
 						that.dialog_get_article = false
 						that.dialog_get_article = false
 						that.$message.warning(res.message)
 						that.$message.warning(res.message)
+						that.dialog_get_article_btn_disable = false;
 					}
 					}
 				}).catch((err) => {
 				}).catch((err) => {
-					that.$message.error(err.message)
+					that.$message.error(err.message);
+					that.dialog_get_article_btn_disable = false;
 				});
 				});
 			},
 			},
 			// 移除文章内容中的html标签
 			// 移除文章内容中的html标签
@@ -684,4 +690,5 @@
 		border-radius: 5px !important;
 		border-radius: 5px !important;
 		margin-left: 28px !important;
 		margin-left: 28px !important;
 	}
 	}
+	
 </style>
 </style>