mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-28 19:32:01 +00:00
Merge pull request #747 from jumpserver/pr@dev@fix_create_asset_node_lost
fix(assets): 修复选中资产创建时,没有默认选中节点的问题
This commit is contained in:
commit
2bc4b53159
@ -100,15 +100,19 @@ export default {
|
|||||||
if (this.setting.url.indexOf('?') !== -1) {
|
if (this.setting.url.indexOf('?') !== -1) {
|
||||||
combinator = '&'
|
combinator = '&'
|
||||||
}
|
}
|
||||||
|
let url = ''
|
||||||
|
const query = Object.assign({}, this.$route.query)
|
||||||
if (treeNode.meta.type === 'node') {
|
if (treeNode.meta.type === 'node') {
|
||||||
this.currentNode = treeNode
|
this.currentNode = treeNode
|
||||||
this.currentNodeId = treeNode.meta.node.id
|
this.currentNodeId = treeNode.meta.node.id
|
||||||
this.$route.query['node'] = this.currentNodeId
|
query['node'] = this.currentNodeId
|
||||||
this.$emit('urlChange', `${this.setting.url}${combinator}node_id=${treeNode.meta.node.id}&show_current_asset=${show_current_asset}`)
|
url = `${this.setting.url}${combinator}node_id=${treeNode.meta.node.id}&show_current_asset=${show_current_asset}`
|
||||||
} else if (treeNode.meta.type === 'asset') {
|
} else if (treeNode.meta.type === 'asset') {
|
||||||
this.$route.query['asset'] = treeNode.meta.asset.id
|
query['asset'] = treeNode.meta.asset.id
|
||||||
this.$emit('urlChange', `${this.setting.url}${combinator}asset_id=${treeNode.meta.asset.id}&show_current_asset=${show_current_asset}`)
|
url = `${this.setting.url}${combinator}asset_id=${treeNode.meta.asset.id}&show_current_asset=${show_current_asset}`
|
||||||
}
|
}
|
||||||
|
this.$router.push({ query })
|
||||||
|
this.$emit('urlChange', url)
|
||||||
},
|
},
|
||||||
removeTreeNode: function() {
|
removeTreeNode: function() {
|
||||||
this.hideRMenu()
|
this.hideRMenu()
|
||||||
@ -242,7 +246,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
|
|
||||||
},
|
},
|
||||||
getSelectedNodes: function() {
|
getSelectedNodes: function() {
|
||||||
return this.zTree.getSelectedNodes()
|
return this.zTree.getSelectedNodes()
|
||||||
|
@ -72,7 +72,6 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
treeConfig: {
|
treeConfig: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user