| | |
| | | import catalogEdit from './catalogEdit.vue' |
| | | export default { |
| | | name: 'chooseChannelForCatalog', |
| | | props: ['platformId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], |
| | | props: ['platformId', 'platformDeviceId', 'platformName', 'defaultCatalogId', 'catalogIdChange', 'treeType'], |
| | | created() { |
| | | this.chooseId = this.defaultCatalogId; |
| | | this.defaultCatalogIdSign = this.defaultCatalogId; |
| | |
| | | let that = this; |
| | | this.$axios({ |
| | | method:"get", |
| | | url:`/api/platform/catalog`, |
| | | url:`./api/platform/catalog`, |
| | | params: { |
| | | platformId: that.platformId, |
| | | parentId: parentId |
| | |
| | | removeCatalog: function (id, node){ |
| | | this.$axios({ |
| | | method:"delete", |
| | | url:`/api/platform/catalog/del`, |
| | | url:`./api/platform/catalog/del`, |
| | | params: { |
| | | id: id, |
| | | platformId: this.platformId, |
| | |
| | | setDefaultCatalog: function (id){ |
| | | this.$axios({ |
| | | method:"post", |
| | | url:`/api/platform/catalog/default/update`, |
| | | url:`./api/platform/catalog/default/update`, |
| | | params: { |
| | | platformId: this.platformId, |
| | | catalogId: 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 |
| | | } |
| | | ]); |
| | |
| | | onClick: () => { |
| | | this.$axios({ |
| | | method:"delete", |
| | | url:"/api/platform/catalog/relation/del", |
| | | url:"./api/platform/catalog/relation/del", |
| | | data: data |
| | | }).then((res)=>{ |
| | | console.log("移除成功") |
| | |
| | | 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); |