| | |
| | | if (typeof(callback) === 'function') { |
| | | callback(res.data.data) |
| | | } |
| | | // |
| | | |
| | | // if (typeof (this.$refs.tree.setCurrentKey) == "undefined") { |
| | | // this.$refs.tree.setCurrentKey(this.defaultCatalogId) |
| | | // let data = this.$refs.tree.getCurrentNode() |
| | | // if (data != null && data.id === this.defaultCatalogId) { |
| | | // this.currentCatalogChange(data, this.$refs.tree.getNode(data.id)) |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | |
| | | node.loaded = false |
| | | node.expand(); |
| | | }, |
| | | refreshCatalogById: function (id, nodeIds) { |
| | | refreshCatalogById: function (id) { |
| | | if (id) { |
| | | console.log("refreshCatalogById: " + id) |
| | | let node = this.$refs.tree.getNode(id); |
| | | console.log(node) |
| | | this.refreshCatalog(node); |
| | | } |
| | | if (nodeIds !== null) { |
| | | let refreshNode = {} |
| | | for (let i = 0; i < nodeIds.length; i++) { |
| | | let node = this.$refs.tree.getNode(nodeIds[i]); |
| | | refreshNode[node.parent.data.id] = node.parent |
| | | } |
| | | if (Object.values(refreshNode).length > 0) { |
| | | for (let j = 0; j < Object.values(refreshNode).length; j++) { |
| | | this.refreshCatalog(Object.values(refreshNode)[j]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | editCatalog: function (data, node){ |
| | |
| | | console.log("移除成功") |
| | | node.parent.loaded = false |
| | | node.parent.expand(); |
| | | if(this.defaultCatalogId === id) { |
| | | this.defaultCatalogId = this.platformId; |
| | | } |
| | | } |
| | | }) |
| | | .catch(function (error) { |