fix: 编辑页-按钮loading
This commit is contained in:
@@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<div class="drawer-footer">
|
||||
<el-button icon="el-icon-check" type="primary" @click="onSubmit" :loading="isSubmit">提交</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose">取消</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose" :loading="isSubmit">取消</el-button>
|
||||
</div>
|
||||
<TopicsTable ref="TopicsTableRef" @dragIn="dragIn"></TopicsTable>
|
||||
</el-drawer>
|
||||
@@ -352,6 +352,7 @@ export default {
|
||||
onSubmit () {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.isSubmit = true
|
||||
if (this.title === '新增') {
|
||||
this.$http._postData(this.api.add, this.form).then(res => {
|
||||
if (res.ok) {
|
||||
@@ -359,6 +360,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
} else {
|
||||
this.$http._putData(this.api.update, this.form).then(res => {
|
||||
@@ -367,6 +370,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@
|
||||
</div>
|
||||
<div class="drawer-footer">
|
||||
<el-button icon="el-icon-check" type="primary" @click="saveOrUpdateStands" :loading="isSubmit">提交</el-button>
|
||||
<el-button icon="el-icon-close" @click="resetForm">取消</el-button>
|
||||
<el-button icon="el-icon-close" @click="resetForm" :loading="isSubmit">取消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<Role-tree
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
</div>
|
||||
<div class="drawer-footer">
|
||||
<el-button icon="el-icon-check" type="primary" @click="onSubmit" :loading="isSubmit">提交</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose">取消</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose" :loading="isSubmit">取消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@@ -538,6 +538,7 @@ export default {
|
||||
onSubmit () {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.isSubmit = true
|
||||
if (this.title === '新增') {
|
||||
this.$http._postData(this.api.add, this.form).then(res => {
|
||||
if (res.ok) {
|
||||
@@ -545,6 +546,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
} else {
|
||||
this.$http._putData(this.api.update, this.form).then(res => {
|
||||
@@ -553,6 +556,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</div>
|
||||
<div class="drawer-footer">
|
||||
<el-button icon="el-icon-check" type="primary" @click="onSubmit" :loading="isSubmit">提交</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose">取消</el-button>
|
||||
<el-button icon="el-icon-close" @click="onClose" :loading="isSubmit">取消</el-button>
|
||||
</div>
|
||||
<Role-tree
|
||||
:is-title="choiceTitle"
|
||||
@@ -270,6 +270,7 @@ export default {
|
||||
onSubmit () {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.isSubmit = true
|
||||
if (this.title === '新增') {
|
||||
this.$http._postData(this.url.add, this.form, { _this: this, loading: 'isSubmit' }).then(res => {
|
||||
if (res.ok) {
|
||||
@@ -277,6 +278,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
} else {
|
||||
this.$http._putData(this.url.update, this.form,{ _this: this, loading: 'isSubmit' }).then(res => {
|
||||
@@ -285,6 +288,8 @@ export default {
|
||||
this.onClose()
|
||||
this.$emit('load')
|
||||
}
|
||||
}).finally(() => {
|
||||
this.isSubmit = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user