diff --git a/upload-file-frontend/src/components/SelectDir/SelectDir.vue b/upload-file-frontend/src/components/SelectDir/SelectDir.vue
new file mode 100644
index 0000000..6cf4d13
--- /dev/null
+++ b/upload-file-frontend/src/components/SelectDir/SelectDir.vue
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ node.label }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/upload-file-frontend/src/components/Toolbox/tools/FileTree.vue b/upload-file-frontend/src/components/Toolbox/tools/FileTree.vue
index 96e2516..9393727 100644
--- a/upload-file-frontend/src/components/Toolbox/tools/FileTree.vue
+++ b/upload-file-frontend/src/components/Toolbox/tools/FileTree.vue
@@ -2,11 +2,12 @@
-
+ />
import { getFileTree } from '@/utils/api';
+import SelectDir from '@/components/SelectDir/SelectDir.vue';
export default {
name: 'FileTreeComponent',
+ components: {
+ SelectDir
+ },
data() {
return {
directoryPath: '',
filterText: '',
showFiles: true,
showFolders: true,
- maxDepth: 3, // 默认深度为 0,表示无限制
+ maxDepth: 3, // 默认深度为 3
fileTreeData: [],
textTree: '',
defaultProps: {
@@ -100,9 +105,13 @@ export default {
},
},
methods: {
+ handlePathChange(path) {
+ this.directoryPath = path;
+ this.fetchFileTree();
+ },
async fetchFileTree() {
if (!this.directoryPath) {
- this.$message.warning('请输入目录路径');
+ this.$message.warning('请选择目录路径');
return;
}
try {