Skip to content

Commit 9b46d29

Browse files
committed
refactor: lark document
1 parent 6630589 commit 9b46d29

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

ui/src/views/dataset/ImportDocumentDataset.vue

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,30 @@
5353
>
5454
<template #default="{ node, data }">
5555
<div class="custom-tree-node flex align-center lighter">
56-
<el-icon v-if="data.type === 'folder'"><FolderOpened /></el-icon>
57-
<el-icon v-else><Document /></el-icon>
56+
<el-icon v-if="data.type === 'folder'">
57+
<FolderOpened />
58+
</el-icon>
59+
<el-icon v-else-if="data.type === 'docx'">
60+
<Document />
61+
</el-icon>
62+
<el-icon class="xlsx-icon" v-else-if="data.type === 'sheet'">
63+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64+
<!-- 文件轮廓 -->
65+
<path
66+
d="M5 3H14L19 8V19C19 20.1 18.1 21 17 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3Z"
67+
fill="white"
68+
stroke="currentColor"
69+
stroke-width="1.2"
70+
/>
71+
<!-- 放大后的 X 符号(占比提升30%) -->
72+
<path
73+
d="M7 9L17 19M17 9L7 19"
74+
stroke="currentColor"
75+
stroke-width="2.5"
76+
stroke-linecap="round"
77+
/>
78+
</svg>
79+
</el-icon>
5880
<span class="ml-4">{{ node.label }}</span>
5981
</div>
6082
</template>
@@ -93,6 +115,7 @@ const loading = ref(false)
93115
const disabled = ref(false)
94116
const allCheck = ref(false)
95117
const treeRef = ref<any>(null)
118+
96119
interface Tree {
97120
name: string
98121
leaf?: boolean
@@ -125,13 +148,12 @@ const loadNode = (node: Node, resolve: (nodeData: Tree[]) => void) => {
125148
.getLarkDocumentList(datasetId, token, {}, loading)
126149
.then((res: any) => {
127150
const nodes = res.data.files as Tree[]
128-
151+
resolve(nodes)
129152
nodes.forEach((childNode) => {
130153
if (childNode.is_exist) {
131-
treeRef.value?.setchecked(childNode.token, true, false)
154+
treeRef.value?.setChecked(childNode.token, true, false)
132155
}
133156
})
134-
resolve(nodes)
135157
})
136158
137159
.catch((err) => {
@@ -206,4 +228,12 @@ function back() {
206228
margin-bottom: 20px;
207229
}
208230
}
231+
.xlsx-icon {
232+
svg {
233+
width: 24px;
234+
height: 24px;
235+
stroke: #000000 !important;
236+
fill: #ffffff !important;
237+
}
238+
}
209239
</style>

0 commit comments

Comments
 (0)