表单防止重复点击重复提交
1 relationAdd(formName) { 2 this.$refs[formName].validate((valid) => { 3 if (valid) { 4 const loadingObj=this.$loading({ 5 lock:true, 6 text:"提交中...", 7 spinner:"el-icon-loading", 8 background:"rgba(0,0,0,0.5)", 9 target:document.querySelector(".submit-test-dialog") 10 }) 11 this.isDisabled = true 12 13 this.$post(window.SITE_CONFIG['***'] + '/***?versionId='+ this.versionId, json).then(data => { 14 this.$message.success('保存成功') 15 loadingObj.close() 16 }).catch(() => { 17 this.isDisabled = false 18 loadingObj.close() 19 }) 20 } else { 21 return false; 22 } 23 }) 24 },