2024-07-01 23:57:01 +08:00
|
|
|
<template>
|
2024-07-02 13:00:59 +08:00
|
|
|
<FillPage>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="container-main">
|
|
|
|
|
<div class="left-box">
|
|
|
|
|
<a-scrollbar style="height: 100%; overflow: auto" outer-class="scrollbar">
|
2024-07-02 18:55:30 +08:00
|
|
|
<div class="left-tree-box">
|
2024-07-03 13:02:39 +08:00
|
|
|
<a-tree :data="treeData" :show-line="true">
|
|
|
|
|
<template #icon="node">
|
|
|
|
|
<SvgIcon name="folder-close" :size="16" v-if="!node.isLeaf && !node.expanded"></SvgIcon>
|
|
|
|
|
<SvgIcon name="folder-open" :size="16" v-if="!node.isLeaf && node.expanded"></SvgIcon>
|
|
|
|
|
<SvgIcon name="txt" :size="16" v-if="node.isLeaf"></SvgIcon>
|
|
|
|
|
</template>
|
|
|
|
|
</a-tree>
|
2024-07-02 18:55:30 +08:00
|
|
|
</div>
|
2024-07-02 13:00:59 +08:00
|
|
|
</a-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right-box"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</FillPage>
|
2024-07-01 23:57:01 +08:00
|
|
|
</template>
|
|
|
|
|
|
2024-07-02 18:55:30 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const treeData = ref([
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 1",
|
|
|
|
|
key: "0-0",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 1-0",
|
|
|
|
|
key: "0-0-0",
|
|
|
|
|
children: [
|
|
|
|
|
{ title: "leaf", key: "0-0-0-0" },
|
|
|
|
|
{
|
|
|
|
|
title: "leaf",
|
|
|
|
|
key: "0-0-0-1",
|
|
|
|
|
children: [{ title: "leaf", key: "0-0-0-1-0" }]
|
|
|
|
|
},
|
|
|
|
|
{ title: "leaf", key: "0-0-0-2" }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 1-1",
|
|
|
|
|
key: "0-0-1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 1-2",
|
|
|
|
|
key: "0-0-2",
|
|
|
|
|
children: [
|
|
|
|
|
{ title: "leaf", key: "0-0-2-0" },
|
|
|
|
|
{
|
|
|
|
|
title: "leaf",
|
|
|
|
|
key: "0-0-2-1"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 2",
|
|
|
|
|
key: "0-1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 3",
|
|
|
|
|
key: "0-2",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "Trunk 3-0",
|
|
|
|
|
key: "0-2-0",
|
|
|
|
|
children: [
|
|
|
|
|
{ title: "leaf", key: "0-2-0-0" },
|
|
|
|
|
{ title: "leaf", key: "0-2-0-1" }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
</script>
|
2024-07-01 23:57:01 +08:00
|
|
|
|
2024-07-02 13:00:59 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.container {
|
|
|
|
|
height: 100%;
|
|
|
|
|
padding: $padding;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.container-main {
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
.left-box {
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: 100%;
|
2024-07-02 18:55:30 +08:00
|
|
|
background: $color-bg-1;
|
2024-07-02 13:00:59 +08:00
|
|
|
.scrollbar {
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
2024-07-02 18:55:30 +08:00
|
|
|
.left-tree-box {
|
|
|
|
|
padding: $padding;
|
|
|
|
|
}
|
2024-07-02 13:00:59 +08:00
|
|
|
}
|
|
|
|
|
.right-box {
|
|
|
|
|
margin-left: $padding;
|
|
|
|
|
width: calc(100% - 220px - $padding);
|
|
|
|
|
height: 100%;
|
2024-07-02 18:55:30 +08:00
|
|
|
background: $color-bg-1;
|
2024-07-02 13:00:59 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|