| | |
| | | } |
| | | }, |
| | | //树刷新 |
| | | flushed() { |
| | | async flushed() { |
| | | this.loading = true; |
| | | this.getAttr() |
| | | .then(() => { |
| | | this.loading = false; |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | }) |
| | | .catch(error => { |
| | | this.loading = false; |
| | | console.error(error); |
| | | }); |
| | | try { |
| | | await this.getAttr() |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | //启用和停用都先判断状态 |
| | | //启用 |
| | |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeEnable(this.nodeClickList); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '启用成功!' |
| | | }); |
| | | await TreeEnable(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '启用成功!' |
| | | }); |
| | | }) |
| | | await this.getAttr(); |
| | | |
| | | } else { |
| | |
| | | type: 'warning' |
| | | }); |
| | | if (confirmResult) { |
| | | await TreeDeactivate(this.nodeClickList); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '停用成功!' |
| | | }); |
| | | await TreeDeactivate(this.nodeClickList).then(res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '停用成功!' |
| | | }); |
| | | }) |
| | | this.nodeClickList['flag'] = true; |
| | | await this.getAttr(); |
| | | } else { |