|  |  | 
 |  |  | import catalogEdit from './catalogEdit.vue' | 
 |  |  | export default { | 
 |  |  |     name: 'chooseChannelForCatalog', | 
 |  |  |     props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange'], | 
 |  |  |     props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], | 
 |  |  |     created() { | 
 |  |  |         this.chooseId = this.defaultCatalogId; | 
 |  |  |         this.defaultCatalogIdSign = this.defaultCatalogId; | 
 |  |  | 
 |  |  |                         platformId: that.platformId, | 
 |  |  |                         parentId: parentId | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |                 .then((res)=> { | 
 |  |  |                 }).then((res)=> { | 
 |  |  |                   if (res.data.code === 0) { | 
 |  |  |                     if (typeof(callback) === 'function') { | 
 |  |  |                       callback(res.data.data) | 
 |  |  | 
 |  |  |         }, | 
 |  |  |         addCatalog: function (parentId, node){ | 
 |  |  |           let that = this; | 
 |  |  |           console.log(this.treeType) | 
 |  |  |           // 打开添加弹窗 | 
 |  |  |           that.$refs.catalogEdit.openDialog(false, null, null, parentId, ()=>{ | 
 |  |  |           that.$refs.catalogEdit.openDialog(false, null, null, parentId, this.treeType, node.level, ()=>{ | 
 |  |  |             node.loaded = false | 
 |  |  |             node.expand(); | 
 |  |  |           }); | 
 |  |  | 
 |  |  |               id: id, | 
 |  |  |               platformId: this.platformId, | 
 |  |  |             } | 
 |  |  |           }) | 
 |  |  |             .then((res) => { | 
 |  |  |           }).then((res) => { | 
 |  |  |               if (res.data.code === 0) { | 
 |  |  |                 console.log("移除成功") | 
 |  |  |                 node.parent.loaded = false | 
 |  |  | 
 |  |  |               platformId: this.platformId, | 
 |  |  |               catalogId: id, | 
 |  |  |             } | 
 |  |  |           }) | 
 |  |  |             .then((res)=> { | 
 |  |  |           }).then((res)=> { | 
 |  |  |               if (res.data.code === 0) { | 
 |  |  |                 this.defaultCatalogIdSign = id; | 
 |  |  |               } | 
 |  |  | 
 |  |  |             }); | 
 |  |  |         }, | 
 |  |  |         loadNode: function(node, resolve){ | 
 |  |  |           console.log("this.platformDeviceId: " + this.platformDeviceId) | 
 |  |  |           if (node.level === 0) { | 
 |  |  |             resolve([ | 
 |  |  |               { | 
 |  |  | 
 |  |  |               type:  -1 | 
 |  |  |               },{ | 
 |  |  |                 name: this.platformName, | 
 |  |  |                 id:  this.platformId, | 
 |  |  |                 id:   this.platformDeviceId, | 
 |  |  |                 type:  0 | 
 |  |  |               } | 
 |  |  |             ]); | 
 |  |  | 
 |  |  |         return false; | 
 |  |  |       }, | 
 |  |  |       nodeClickHandler: function (data, node, tree){ | 
 |  |  |           console.log(data) | 
 |  |  |           console.log(node) | 
 |  |  |        this.chooseId = data.id; | 
 |  |  |        this.chooseName = data.name; | 
 |  |  |        if (this.catalogIdChange)this.catalogIdChange(this.chooseId, this.chooseName); |