资料中心 - 提交按钮loading

This commit is contained in:
yanyizhou
2021-12-20 10:18:41 +08:00
parent c967003fdb
commit 2fe29d3f10
@@ -182,6 +182,7 @@
size="mini" size="mini"
icon="el-icon-check" icon="el-icon-check"
@click="saveInfo" @click="saveInfo"
:loading="submitLoading"
>提交 >提交
</el-button </el-button
> >
@@ -205,6 +206,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
submitLoading: false,
fileList: [], fileList: [],
attributeTitle: '', attributeTitle: '',
showInfoModal: false, showInfoModal: false,
@@ -376,6 +378,7 @@ export default {
// this.attributeEO.attachFileId = fileIdList.join(',') // this.attributeEO.attachFileId = fileIdList.join(',')
}, },
saveInfo() { saveInfo() {
this.submitLoading = true
this.$refs['attributeEO'].validate((valid) => { this.$refs['attributeEO'].validate((valid) => {
if (valid && this.attributeEO.attachFileId !== '') { if (valid && this.attributeEO.attachFileId !== '') {
if (this.attributeTitle === '新增'){ if (this.attributeTitle === '新增'){
@@ -388,6 +391,7 @@ export default {
(res) => { (res) => {
if (res.ok) { if (res.ok) {
this.$message.success('新增成功') this.$message.success('新增成功')
this.submitLoading = false
this.cancelModel() this.cancelModel()
this.searchInfo() this.searchInfo()
} }
@@ -403,6 +407,7 @@ export default {
(res) => { (res) => {
if (res.ok) { if (res.ok) {
this.$message.success('修改成功') this.$message.success('修改成功')
this.submitLoading = false
this.cancelModel() this.cancelModel()
this.searchInfo() this.searchInfo()
} }
@@ -412,6 +417,7 @@ export default {
} else { } else {
this.$message.error('附件不能为空') this.$message.error('附件不能为空')
this.submitLoading = false
} }
}) })