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