2025-02-13 16:15:26 +08:00
|
|
|
<template>
|
2025-02-19 16:54:54 +08:00
|
|
|
<el-tree node-key="id" default-expand-all :data="props.treeData" :props="defaultProps" style="width: 100%">
|
2025-02-17 08:39:18 +08:00
|
|
|
<template #default="{ node, data }">
|
2025-02-19 16:54:54 +08:00
|
|
|
<el-tooltip effect="dark" :content="data.scriptTypeName || data.sourceDesc" placement="top" :hide-after="0">
|
2025-02-17 08:39:18 +08:00
|
|
|
<div class="custom-tree-node">
|
2025-02-19 16:54:54 +08:00
|
|
|
{{ data.scriptTypeName || data.sourceDesc }}
|
2025-02-17 08:39:18 +08:00
|
|
|
</div>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
</el-tree>
|
2025-02-13 16:15:26 +08:00
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, reactive } from 'vue'
|
2025-02-19 16:54:54 +08:00
|
|
|
|
2025-02-13 16:15:26 +08:00
|
|
|
import { CheckData } from '@/api/check/interface'
|
2025-02-17 16:44:02 +08:00
|
|
|
const props = defineProps({
|
2025-02-19 16:54:54 +08:00
|
|
|
treeData: {
|
|
|
|
|
type: Array,
|
2025-02-17 16:44:02 +08:00
|
|
|
required: true
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-02-13 16:15:26 +08:00
|
|
|
const dataTree = ref<CheckData.TreeItem[]>([])
|
|
|
|
|
const defaultProps = {
|
|
|
|
|
children: 'children',
|
|
|
|
|
label: 'scriptTypeName',
|
|
|
|
|
pid: 'pid'
|
|
|
|
|
}
|
2025-02-19 16:54:54 +08:00
|
|
|
|
|
|
|
|
onMounted(() => {})
|
|
|
|
|
// // 对外映射
|
|
|
|
|
// defineExpose({ init })
|
2025-02-13 16:15:26 +08:00
|
|
|
</script>
|
2025-02-17 08:39:18 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.custom-tree-node {
|
|
|
|
|
max-width: 230px;
|
|
|
|
|
overflow-x: hidden !important;
|
|
|
|
|
white-space: nowrap !important;
|
|
|
|
|
text-overflow: ellipsis !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|