|
|
@@ -223,24 +223,28 @@ export default {
|
|
|
this.version.fileId = id
|
|
|
},
|
|
|
chooseDevices () {
|
|
|
+ this.getTopGroups().then(({ data }) => {
|
|
|
+ if (data.length) {
|
|
|
+ this.choosingDevice = true
|
|
|
+ this.groups = data
|
|
|
+ this.group = this.groups[0]
|
|
|
+ this.$slectedDevices = []
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tree.setCurrentKey(this.group.path)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请先添加租户'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTopGroups () {
|
|
|
if (this.groups.length === 0) {
|
|
|
- getTopGroups().then(({ data }) => {
|
|
|
- if (data.length) {
|
|
|
- this.choosingDevice = true
|
|
|
- this.groups = data
|
|
|
- this.group = this.groups[0]
|
|
|
- this.$slectedDevices = []
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.tree.setCurrentKey(this.group.path)
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '请先添加租户'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ return getTopGroups()
|
|
|
}
|
|
|
+ return Promise.resolve({ data: this.groups })
|
|
|
},
|
|
|
onGroupTreeClick (group) {
|
|
|
if (!this.group || this.group.id !== group.id) {
|