diff --git a/magic-boot-ui/src/components/MagicBoot/mb-dialog.vue b/magic-boot-ui/src/components/MagicBoot/mb-dialog.vue
index f95f67e..d234428 100644
--- a/magic-boot-ui/src/components/MagicBoot/mb-dialog.vue
+++ b/magic-boot-ui/src/components/MagicBoot/mb-dialog.vue
@@ -6,7 +6,7 @@
关闭
-
+
确认
@@ -37,7 +37,8 @@ export default {
},
data() {
return {
- dialogVisible: false
+ dialogVisible: false,
+ confirmLoading: false
}
},
created() {
@@ -53,7 +54,13 @@ export default {
},
methods: {
confirmClick() {
- this.$emit('confirm-click')
+ this.$emit('confirm-click', this)
+ },
+ loading(){
+ this.confirmLoading = true
+ },
+ hideLoading(){
+ this.confirmLoading = false
},
show() {
this.dialogVisible = true
diff --git a/magic-boot-ui/src/views/system/dict/dict-items.vue b/magic-boot-ui/src/views/system/dict/dict-items.vue
index d53412d..199e0af 100644
--- a/magic-boot-ui/src/views/system/dict/dict-items.vue
+++ b/magic-boot-ui/src/views/system/dict/dict-items.vue
@@ -11,7 +11,7 @@
-
+
@@ -151,10 +151,12 @@ export default {
this.$refs['dataForm'].clearValidate()
})
},
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
this.$post('dict/items/save', this.temp).then(() => {
+ d.hideLoading()
this.$refs.formDialog.hide()
this.$notify({
title: '成功',
@@ -164,7 +166,7 @@ export default {
})
this.reloadTable()
this.$common.getDictData()
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/dict/dict-list.vue b/magic-boot-ui/src/views/system/dict/dict-list.vue
index 6c32a50..ef10f2c 100644
--- a/magic-boot-ui/src/views/system/dict/dict-list.vue
+++ b/magic-boot-ui/src/views/system/dict/dict-list.vue
@@ -11,7 +11,7 @@
-
+
@@ -177,10 +177,12 @@ export default {
this.$refs['dataForm'].clearValidate()
})
},
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
this.$post('dict/save', this.temp).then((response) => {
+ d.hideLoading()
this.temp.id = response.data
this.$refs.dictDialog.hide()
this.$notify({
@@ -191,7 +193,7 @@ export default {
})
this.reloadTable()
this.$common.getDictData()
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/menu/menu-form.vue b/magic-boot-ui/src/views/system/menu/menu-form.vue
index 1d9f992..be2057a 100644
--- a/magic-boot-ui/src/views/system/menu/menu-form.vue
+++ b/magic-boot-ui/src/views/system/menu/menu-form.vue
@@ -135,9 +135,10 @@ export default {
}
},
methods: {
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
if(this.temp.pid == this.temp.id){
this.$notify({
title: '失败',
@@ -165,6 +166,7 @@ export default {
this.temp.url = ''
}
this.$post('menu/save', this.temp).then(() => {
+ d.hideLoading()
this.$notify({
title: '成功',
message: (this.dialogStatus === 'create' ? '创建' : '修改') + '成功',
@@ -172,7 +174,7 @@ export default {
duration: 2000
})
this.$emit('reload-table')
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/menu/menu-list.vue b/magic-boot-ui/src/views/system/menu/menu-list.vue
index 95edaea..de08421 100644
--- a/magic-boot-ui/src/views/system/menu/menu-list.vue
+++ b/magic-boot-ui/src/views/system/menu/menu-list.vue
@@ -24,7 +24,7 @@
-
+
diff --git a/magic-boot-ui/src/views/system/office/office-list.vue b/magic-boot-ui/src/views/system/office/office-list.vue
index a18265b..55479f6 100644
--- a/magic-boot-ui/src/views/system/office/office-list.vue
+++ b/magic-boot-ui/src/views/system/office/office-list.vue
@@ -30,7 +30,7 @@
-
+
@@ -264,9 +264,10 @@ export default {
this.$refs['dataForm'].clearValidate()
})
},
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
if(this.temp.pid == this.temp.id){
this.$notify({
title: '失败',
@@ -286,6 +287,7 @@ export default {
return
}
this.$post('office/save', this.temp).then(() => {
+ d.hideLoading()
this.reloadTable()
this.$refs.officeFormDialog.hide()
this.$notify({
@@ -294,7 +296,7 @@ export default {
type: 'success',
duration: 2000
})
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/role/role-assign-permissions.vue b/magic-boot-ui/src/views/system/role/role-assign-permissions.vue
index f848405..705238a 100644
--- a/magic-boot-ui/src/views/system/role/role-assign-permissions.vue
+++ b/magic-boot-ui/src/views/system/role/role-assign-permissions.vue
@@ -23,11 +23,13 @@ export default {
})
},
methods: {
- save() {
+ save(d) {
+ d.loading()
this.$post('role/save', {
id: this.id,
menus: this.menus
}).then((response) => {
+ d.hideLoading()
this.$notify({
title: '成功',
message: '分配成功',
@@ -35,7 +37,7 @@ export default {
duration: 2000
})
this.$emit('close')
- })
+ }).catch(() => d.hideLoading())
}
}
}
diff --git a/magic-boot-ui/src/views/system/role/role-list.vue b/magic-boot-ui/src/views/system/role/role-list.vue
index f6af8d8..4be6117 100644
--- a/magic-boot-ui/src/views/system/role/role-list.vue
+++ b/magic-boot-ui/src/views/system/role/role-list.vue
@@ -11,7 +11,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
{ $refs.assignPermissionsDialog.hide(); temp.id = '' }" />
@@ -207,10 +207,12 @@ export default {
this.$refs['dataForm'].clearValidate()
})
},
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
this.$post('role/save', this.temp).then(() => {
+ d.hideLoading()
this.reloadTable()
this.$refs.roleFormDialog.hide()
this.$notify({
@@ -219,7 +221,7 @@ export default {
type: 'success',
duration: 2000
})
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/user/user-form.vue b/magic-boot-ui/src/views/system/user/user-form.vue
index d1b19d6..fc14c2a 100644
--- a/magic-boot-ui/src/views/system/user/user-form.vue
+++ b/magic-boot-ui/src/views/system/user/user-form.vue
@@ -94,15 +94,16 @@ export default {
this.$refs['dataForm'].clearValidate()
})
},
- save() {
+ save(d) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
+ d.loading()
this.$request({
url: 'user/save',
method: 'post',
params: this.temp
- }).then((response) => {
- this.dialogVisible = false
+ }).then(() => {
+ d.hideLoading()
this.$notify({
title: '成功',
message: this.dialogTitle + '成功',
@@ -110,7 +111,7 @@ export default {
duration: 2000
})
this.$emit('reload-table')
- })
+ }).catch(() => d.hideLoading())
}
})
},
diff --git a/magic-boot-ui/src/views/system/user/user-list.vue b/magic-boot-ui/src/views/system/user/user-list.vue
index dd5d518..d6caed3 100644
--- a/magic-boot-ui/src/views/system/user/user-list.vue
+++ b/magic-boot-ui/src/views/system/user/user-list.vue
@@ -34,7 +34,7 @@
-
+