|
|
@@ -150,21 +150,26 @@ export default {
|
|
|
return addTenant(this.group)
|
|
|
},
|
|
|
onDel (group) {
|
|
|
- const loading = this.$showLoading()
|
|
|
- unbindDevices(group.path).then(() => {
|
|
|
- return deleteGroup(group).then(() => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功'
|
|
|
+ this.$confirm(
|
|
|
+ `删除 ${group.remark} ?`,
|
|
|
+ { type: 'warning' }
|
|
|
+ ).then(() => {
|
|
|
+ const loading = this.$showLoading()
|
|
|
+ unbindDevices(group.path).then(() => {
|
|
|
+ return deleteGroup(group).then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功'
|
|
|
+ })
|
|
|
+ if (group.parentGroup) {
|
|
|
+ this.$refs.table.pageTo()
|
|
|
+ } else {
|
|
|
+ this.$refs.table.decrease(1)
|
|
|
+ }
|
|
|
})
|
|
|
- if (group.parentGroup) {
|
|
|
- this.$refs.table.pageTo()
|
|
|
- } else {
|
|
|
- this.$refs.table.decrease(1)
|
|
|
- }
|
|
|
+ }).finally(() => {
|
|
|
+ this.$closeLoading(loading)
|
|
|
})
|
|
|
- }).finally(() => {
|
|
|
- this.$closeLoading(loading)
|
|
|
})
|
|
|
}
|
|
|
}
|