This commit is contained in:
caozehui
2024-12-31 19:54:27 +08:00
parent 5e8dda0b75
commit aa52778e99

View File

@@ -35,9 +35,18 @@
</div>
<div class="content-tree">
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="id"
:data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick"/>
:data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick"
class="custom-tree">
<template #default="{ node, data }">
<span class="custom-tree-node">{{ data.scriptName }}</span>
</template>
</el-tree>
<el-tree v-if="switchItem === 1" :default-expanded-keys="defaultExpandedKeys" node-key="id"
:data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick"/>
:data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick" class="custom-tree">
<template #default="{ node, data }">
<span class="custom-tree-node">{{ data.scriptName }}</span>
</template>
</el-tree>
</div>
</div>
@@ -184,7 +193,8 @@ const handleSwitchChange = async (data: any) => {
} else {
// 发起请求,查询该测试项的检测结果
// const result = await getTreeData({checkStore.scriptId,deviceId, formContent.chnNum+'', scriptType,1})
treeDataAll = [{
treeDataAll = [
{
"id": "1",
"scriptName": "频率准确度检测",
"children": [
@@ -235,7 +245,8 @@ const handleSwitchChange = async (data: any) => {
]
}
]
}]
},
]
}
@@ -505,13 +516,19 @@ defineExpose({
padding: 10px 0;
border: 1px solid #ccc;
overflow: auto;
overflow-y: auto;
.content-tree {
min-width: 100%;
width: 100%;
height: 100%;
max-height: 100%;
margin-top: 10px;
.custom-tree-node {
overflow-x: hidden !important; // 溢出部分隐藏
white-space: nowrap !important; //禁止自动换行
text-overflow: ellipsis !important; // 使溢出部分以省略号显示
}
}
}