perf(用户管理): 编辑页面保存时增加页面遮罩

This commit is contained in:
fit2cloud-chenyw 2023-02-20 15:01:22 +08:00
parent ad645717e5
commit d9b664f86d
2 changed files with 5 additions and 1 deletions

View File

@ -35,6 +35,7 @@ export const addUser = (data) => {
return request({
url: pathMap.createPath,
method: 'post',
loading: true,
data
})
}

View File

@ -1,5 +1,6 @@
<template>
<el-dialog
v-loading="loading"
:title="formType == 'add' ? $t('user.create') : $t('user.modify')"
:visible.sync="dialogVisible"
class="user-editer-form"
@ -229,6 +230,7 @@ import { pluginLoaded, defaultPwd, wecomStatus, dingtalkStatus, larkStatus } fro
export default {
data() {
return {
loading: false,
defaultProps: {
children: 'children',
label: 'label',
@ -553,12 +555,13 @@ export default {
save() {
this.$refs.createUserForm.validate((valid) => {
if (valid) {
// !this.form.deptId && (this.form.deptId = 0)
this.loading = true
const method = this.formType === 'add' ? addUser : editUser
method(this.form).then((res) => {
this.$success(this.$t('commons.save_success'))
this.reset()
this.$emit('saved')
this.loading = false
})
} else {
return false