diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue index 8825cbc..55e90e6 100644 --- a/src/views/doc/manage.vue +++ b/src/views/doc/manage.vue @@ -349,36 +349,38 @@ function onDBclickMatter(row:matterInfo){ //树节点展开 function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, reject: () => void) { + let cuuid ="root" if ((node.data as matterTree).uuid) { - const cuuid = (node.data as matterTree).uuid + cuuid= (node.data as matterTree).uuid currentNode.value = node.data - - let _page: matterPage = { - page: 0, - pageSize: 50, - orderCreateTime: "DESC", - orderDir: "DESC", - puuid: cuuid, - deleted: false - }; - - getMatterList(uid, _page).then((resp) => { - paginInfo.value = { total: resp.data.totalPages, page: resp.data.page } - matterList.value = resp.data.data - // .filter((item)=>{ - // return !item.dir - // }) - let node_data = resp.data.data.filter((item) => { - return item.dir - }).map((val) => { - const copy = structuredClone(val) - copy.dir = !copy.dir - return copy - }) - - resolve(node_data) - }).catch(() => reject()) } + + let _page: matterPage = { + page: 0, + pageSize: 50, + orderCreateTime: "DESC", + orderDir: "DESC", + puuid: cuuid, + deleted: false + }; + + getMatterList(uid, _page).then((resp) => { + paginInfo.value = { total: resp.data.totalPages, page: resp.data.page } + matterList.value = resp.data.data + // .filter((item)=>{ + // return !item.dir + // }) + let node_data = resp.data.data.filter((item) => { + return item.dir + }).map((val) => { + const copy = structuredClone(val) + copy.dir = !copy.dir + return copy + }) + + resolve(node_data) + }).catch(() => reject()) + } //树节点单击 function onNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ @@ -528,7 +530,7 @@ async function handleFolderFile(option:File){ const _path = option.webkitRelativePath const _dir=_path.replace(/\/[^/]+\w+$/,"") //只保留文件夹目录,[^/]就是用来限制,只能是最后一个目录 const node = matterList.value.filter((item)=>{ - return item.dir && item.path?.endsWith(_dir) + return item.dir && _dir.endsWith(item.name!) }) let puuid="" @@ -536,10 +538,11 @@ async function handleFolderFile(option:File){ if(node.length==0){ const subs= await doCreateMultyDir(_dir,currentNode.value.uuid) matterList.value.push(...subs) //这里如果子文件夹多的时候,可能会造成第一级路径多次创建,只是造成资源浪费,问题不大 - + const newnodes=matterList.value.filter((item)=>{ - return item.dir && item.path?.endsWith(_dir) + return item.dir && _dir.endsWith(item.name!) }) + if(newnodes.length>0){ puuid=newnodes[0].uuid }else{ @@ -567,6 +570,13 @@ async function doCreateMultyDir(path:string,uuid:string){ const list=[]; const dirs=path.split("/") for(let i=0;i{ + return item.dir && dirs[i].endsWith(item.name!) + }) + if(node.length>0) { + uuid = node[0].uuid + continue; + } await postCreateDir(uid,{ userUuid:uid, puuid:uuid, @@ -724,10 +734,10 @@ function onSpacePManage(row:matterInfo){ //http://172.20.2.87:6010/api/alien/preview/5a10aaf6-396e-4d9a-7e87-3c5c8029d4db/123.png?ir=fill_100_100 //渲染完页面再执行 onMounted(() => { - treeRef.value.append( - {name:'个人空间',uuid:'root',dir:false}, - currentNode.value.uuid - ) + // treeRef.value.append( + // {name:'个人空间',uuid:'root',dir:false}, + // currentNode.value.uuid + // ) //加载我的空间列表 getMySpaces(uid,{roles:Departs.value}).then((resp)=>{ resp.data.forEach((item)=>{ @@ -753,7 +763,10 @@ const handleSelectionChange = (val:matterInfo[]) => { -
共享空间
+
+ 共享空间 + +
{ @@ -800,6 +816,9 @@ const handleSelectionChange = (val:matterInfo[]) => { +
+ 回收站 +
@@ -947,6 +966,19 @@ const handleSelectionChange = (val:matterInfo[]) => { --el-tree-expand-icon-color:#4c4c4e; } } +.area_header{ + display: flex; + margin-top: 9px; + padding: 12px 7px; + background-color: #e1e1e1; + align-items: center; + .area_name{ + align-content: center; + margin-left: 8px; + color: #686854; + font-weight: bold; + } +} .tree-item{ display: flex; @@ -975,7 +1007,7 @@ const handleSelectionChange = (val:matterInfo[]) => { .search{ margin-left: auto; - margin-right: 20px; + margin-right: 26px; display:inherit; } .shareDialog{ diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue index de14972..2dee641 100644 --- a/src/views/doc/space.vue +++ b/src/views/doc/space.vue @@ -410,7 +410,7 @@ async function handleFolderFile(option:File){ const _path = option.webkitRelativePath const _dir=_path.replace(/\/[^/]+\w+$/,"") //只保留文件夹目录,[^/]就是用来限制,只能是最后一个目录 const node = matterList.value.filter((item)=>{ - return item.dir && item.path?.endsWith(_dir) + return item.dir && _dir.endsWith(item.name!) }) let puuid="" @@ -420,7 +420,7 @@ async function handleFolderFile(option:File){ matterList.value.push(...subs) //这里如果子文件夹多的时候,可能会造成第一级路径多次创建,只是造成资源浪费,问题不大 const newnodes=matterList.value.filter((item)=>{ - return item.dir && item.path?.endsWith(_dir) + return item.dir && _dir.endsWith(item.name!) //item.path?.endsWith(_dir) }) if(newnodes.length>0){ puuid=newnodes[0].uuid @@ -451,6 +451,13 @@ async function doCreateMultyDir(path:string,uuid:string){ const list=[]; const dirs=path.split("/") for(let i=0;i{ + return item.dir && dirs[i].endsWith(item.name!) + }) + if(node.length>0) { + uuid = node[0].uuid + continue; + } await doCreateSpaceDir(props.uid,{ puuid:uuid, name:dirs[i], @@ -744,7 +751,7 @@ function isOwner(){ } .search{ margin-left: auto; - margin-right: 20px; + margin-right: -4px; display:inherit; }