This commit is contained in:
sjl
2025-03-07 13:17:11 +08:00
parent 8db814dba4
commit f68da773ab
5 changed files with 86 additions and 13 deletions

View File

@@ -6,8 +6,10 @@
:props="defaultProps"
style="width: 100%"
:expand-on-click-node="false"
:highlight-current="true"
@node-click="handleNodeClick"
show-checkbox
show-checkbox
@check-change="handleCheckChange"
>
<template #default="{ node, data }">
<el-tooltip effect="dark" :content="data.sourceDesc || data.scriptTypeName" placement="top" :hide-after="0">
@@ -38,6 +40,7 @@ const defaultProps = {
const activeName = ref('')
const childActiveName = ref('')
const handleNodeClick = (data, node) => {
console.log('handleNodeClick', data, node)
let code = ['Base', 'VOL', 'Freq', 'Harm', 'Base_0_10', 'Base_20_85', 'Base_110_200']
const parents = getParentNodes(node, [])
parents.pop()
@@ -92,7 +95,16 @@ function findTargetCodes(data: any[], targetCodes: string[]) {
// return result
}
onMounted(() => {})
function handleCheckChange(data, checked) {
if (checked) {
// Uncheck all other nodes
props.treeData.forEach((node) => {
if (node.id !== data.id) {
node.checked = false;
}
});
}
}
// // 对外映射
// defineExpose({ init })
</script>