|
|
@ -6,11 +6,11 @@ |
|
|
|
:height="height" :expand-on-click-node="true"> |
|
|
|
<template #default="{ node }"> |
|
|
|
<div style="width: 100%;text-align-last:left;" :class="node.data.id === nodeClickId ? 'selectedNode' : ''"> |
|
|
|
<!-- <el-tooltip effect="dark" :content="node.label" placement="right" v-if="node.label.length > textLength"> |
|
|
|
<span>{{ node.label.slice(0, textLength) }}</span> |
|
|
|
<el-tooltip effect="dark" :content="node.label" placement="right" v-if="node.label.length > textLength"> |
|
|
|
<span>{{ node.label.slice(0, textLength) }}...</span> |
|
|
|
</el-tooltip> |
|
|
|
<span v-else>{{ node.label }}</span> --> |
|
|
|
<span>{{ node.label }}</span> |
|
|
|
<span v-else>{{ node.label }}</span> |
|
|
|
<!-- <span>{{ node.label }}</span> --> |
|
|
|
<span style="position: absolute;right: 8px;" v-if="node.level === 1"> |
|
|
|
<el-button :type="node.data.id === nodeClickId ? 'success' : 'primary'" link |
|
|
|
@click="e => editxiangmu(e, node)"> |
|
|
@ -77,7 +77,7 @@ export default { |
|
|
|
return { |
|
|
|
_: _, |
|
|
|
dayjs: dayjs, |
|
|
|
textLength: 14, |
|
|
|
textLength: 15, |
|
|
|
nodeClickId: "" |
|
|
|
} |
|
|
|
}, |
|
|
@ -99,7 +99,13 @@ export default { |
|
|
|
this.$emit("delxiangmu", node) |
|
|
|
} |
|
|
|
}, |
|
|
|
async mounted() { }, |
|
|
|
async mounted() { |
|
|
|
console.log(103, window.innerHeight); |
|
|
|
window.onresize = () => { |
|
|
|
let width = document.getElementsByClassName("treeClass")[0].clientWidth |
|
|
|
this.textLength = Math.floor((width - 310) / 15) + 14 |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
computed: {} |
|
|
|
} |
|
|
|