|
53 | 53 | > |
54 | 54 | <template #default="{ node, data }"> |
55 | 55 | <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> |
58 | 80 | <span class="ml-4">{{ node.label }}</span> |
59 | 81 | </div> |
60 | 82 | </template> |
@@ -93,6 +115,7 @@ const loading = ref(false) |
93 | 115 | const disabled = ref(false) |
94 | 116 | const allCheck = ref(false) |
95 | 117 | const treeRef = ref<any>(null) |
| 118 | +
|
96 | 119 | interface Tree { |
97 | 120 | name: string |
98 | 121 | leaf?: boolean |
@@ -125,13 +148,12 @@ const loadNode = (node: Node, resolve: (nodeData: Tree[]) => void) => { |
125 | 148 | .getLarkDocumentList(datasetId, token, {}, loading) |
126 | 149 | .then((res: any) => { |
127 | 150 | const nodes = res.data.files as Tree[] |
128 | | -
|
| 151 | + resolve(nodes) |
129 | 152 | nodes.forEach((childNode) => { |
130 | 153 | if (childNode.is_exist) { |
131 | | - treeRef.value?.setchecked(childNode.token, true, false) |
| 154 | + treeRef.value?.setChecked(childNode.token, true, false) |
132 | 155 | } |
133 | 156 | }) |
134 | | - resolve(nodes) |
135 | 157 | }) |
136 | 158 |
|
137 | 159 | .catch((err) => { |
@@ -206,4 +228,12 @@ function back() { |
206 | 228 | margin-bottom: 20px; |
207 | 229 | } |
208 | 230 | } |
| 231 | +.xlsx-icon { |
| 232 | + svg { |
| 233 | + width: 24px; |
| 234 | + height: 24px; |
| 235 | + stroke: #000000 !important; |
| 236 | + fill: #ffffff !important; |
| 237 | + } |
| 238 | +} |
209 | 239 | </style> |
0 commit comments