fixed: Fixed the shortcut command selection node issue

This commit is contained in:
zhaojisen
2024-10-10 18:36:33 +08:00
parent 1b8ac9112e
commit 3b2803b9a1

View File

@@ -35,6 +35,7 @@
</template>
<script>
import $ from '@/utils/jquery-vendor.js'
import AssetTreeTable from '@/components/Apps/AssetTreeTable'
import QuickJobTerm from '@/views/ops/Adhoc/components/QuickJobTerm.vue'
import CodeEditor from '@/components/Form/FormFields/CodeEditor'
@@ -121,6 +122,8 @@ export default {
query: (query, cb) => {
const { hosts, nodes } = this.getSelectedNodesAndHosts()
console.log(hosts, nodes)
if (hosts.length === 0) {
this.$message.warning(`${this.$t('RequiredAssetOrNode')}`)
return cb([])
@@ -286,6 +289,14 @@ export default {
view: {
dblClickExpand: false,
showLine: true
},
callback: {
onCheck: function(_event, treeId, treeNode) {
const treeObj = $.fn.zTree.getZTreeObj(treeId)
if (treeNode.checked) {
treeObj.expandNode(treeNode, true, false, true)
}
}
}
},
iShowTree: true