提交按钮防止多次点击调用接口
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
<!-- -->
|
||||
<!-- </a-popconfirm>-->
|
||||
<a-button style="margin-right: .8rem" @click="handleCancel">取消</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading" :disabled="confirmLoading">提交</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
@@ -402,10 +402,10 @@ export default {
|
||||
handleSubmit() {
|
||||
console.log("username",this.form.getFieldValue('username'))
|
||||
const that = this;
|
||||
that.confirmLoading = true;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
if (that.fileList != '') {
|
||||
formData.avatar = that.fileList;
|
||||
@@ -453,6 +453,8 @@ export default {
|
||||
that.userDepartModel.departIdList = {userId: '', departIdList: []};
|
||||
})
|
||||
|
||||
}else {
|
||||
that.confirmLoading = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user