| 
					
				 | 
			
			
				@@ -31,7 +31,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <div class="search"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <a-input v-model:value="fileName" placeholder="请输入文件名称" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <a-button type="primary" preIcon="ant-design:search-outlined" @click="onSearch">查询</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <!-- <a-button type="primary" style="float: right; right: 15px" preIcon="ant-design:cloud-upload-outlined">文件上传</a-button> --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <a-upload :before-upload="beforeUpload" :remove="handleRemove" :multiple="false" :file-list="fileList"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <a-button type="primary" preIcon="ant-design:cloud-upload-outlined">文件上传</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </a-upload> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -44,12 +43,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             :nodeParam="nodeParam" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             :columns="columns" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             :list="getTree" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            :formSchema="formSchema" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             :deleteById="deleteById" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             :downLoad="downLoad" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             designScope="file-detail" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             title="文件详情" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            :showTab="false" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <div class="bd-b"></div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </div> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -58,16 +55,18 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script lang="ts" setup name="system-user"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { useMessage } from '/@/hooks/web/useMessage'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import fileSystem from './commen/fileSystem.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import icon from './commen/Icon/index.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import treeIcon from './commen/Icon/treeIcon.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import { ref, onMounted, reactive, provide, nextTick } from 'vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { ref, onMounted, reactive, nextTick } from 'vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import NormalTable from '../comment/NormalTable.vue'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import { columns, formSchema } from './fileDetail.data'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { columns } from './fileDetail.data'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import { getTree, createFile, editMenu, delMenu, uploadApi, downLoad, deleteById } from './fileDetail.api'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   components: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     fileSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const { createMessage } = useMessage(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   let fileName = ref(''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   let fileList = reactive<any[]>([]); //上传文件列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   // let uploadParam = reactive({}); //上传文件参数 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -87,10 +86,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   //递归遍历左侧菜单数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   let list2tree = (list) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    let flag = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     list.forEach((child) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const pid = child.parentId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      if (pid && pid !== 'root') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (pid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         list.forEach((parent) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if (parent.id === pid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             parent.children = parent.children || []; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -100,20 +98,32 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             parent.children.push({ id: child.id, isFolder: true, title: child.fileName, pid: child.parentId }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } else if (pid == 'root') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        flag = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        child.isFolder = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        child.title = child.fileName; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        child.pid = child.parentId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    return flag ? list : list.filter((n) => !n.parentId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(list, '999999999'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return list.filter((n) => n.parentId == 'root'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  let list2trees = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let arr = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 0, name: 1, parentId: 'root' }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 1, name: 1, parentId: 0 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 2, name: 1, parentId: 0 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 3, name: 1, parentId: 2 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 4, name: 1, parentId: 2 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 5, name: 1, parentId: 3 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 6, name: 1, parentId: 3 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 7, name: 1, parentId: 5 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 8, name: 1, parentId: 5 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 9, name: 1, parentId: 7 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      { id: 10, name: 1, parentId: 7 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   //获取左侧菜单树数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   let getTreeList = async () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    listArr.length = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let data = await getTree({ parentId: '' }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     let list = list2tree(data.records); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(list, 'list'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     listArr.push(...list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     console.log(listArr, '树节点数据'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -154,10 +164,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   // 删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const onDeltet = (node) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     console.log(node, '删除菜单'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    delMenu({ id: node.id }).then((res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      console.log(res, '删除文件'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      getTreeList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (node.pid == 'root') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      createMessage.warning('根节点不能被删除!'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      delMenu({ id: node.id }).then((res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        console.log(res, '删除文件'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        getTreeList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   //查询列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   let onSearch = () => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -194,6 +208,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   onMounted(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getTreeList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    list2trees(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |