|
|
|
@ -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<dirs.length;i++){ |
|
|
|
const node = matterList.value.filter((item)=>{ |
|
|
|
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[]) => { |
|
|
|
<template> |
|
|
|
<div style="display:grid;grid-template-columns:1fr 4fr; width: 100%;height: 100%;"> |
|
|
|
<div class="menus_tree"> |
|
|
|
<el-tree |
|
|
|
<div class="area_header"> |
|
|
|
<el-icon :size="20"><House /></el-icon><span class="area_name" > 个人空间</span> |
|
|
|
</div> |
|
|
|
<el-tree |
|
|
|
ref="treeRef" |
|
|
|
style="max-width: 600px" |
|
|
|
:data="treeData" |
|
|
|
@ -772,7 +785,10 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-tree> |
|
|
|
<div style="display:flex;margin-top: 9px;background-color: white;"><span style="align-content: center;margin-left: 21px;color: #686854;">共享空间</span> <el-button style="margin: 10px 0px 10px auto;" :icon="Plus" @click="onNewSpace"> </el-button></div> |
|
|
|
<div class="area_header"> |
|
|
|
<el-icon :size="20"><Collection /></el-icon> <span class="area_name" > 共享空间</span> |
|
|
|
<el-button size="small" style="margin: 0 5px 0 auto;" :icon="Plus" @click="onNewSpace"> </el-button> |
|
|
|
</div> |
|
|
|
<el-tree |
|
|
|
ref="spaceTreeRef" |
|
|
|
style="max-width: 600px" |
|
|
|
@ -790,9 +806,9 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
<el-button size="small" :icon="Setting" circle ></el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onAccessManage(data)}">空间成员管理</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onDelSpaceMatter(data)}">删除</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onAccessManage(data)}">成员管理</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onSpacePManage(data)}">权限管理</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onDelSpaceMatter(data)}">删除</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
@ -800,6 +816,9 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-tree> |
|
|
|
<div class="area_header"> |
|
|
|
<el-icon :size="20"><Delete /></el-icon><span class="area_name" > 回收站</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="PRIVATESPACE" class="app_container"> |
|
|
|
@ -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{ |
|
|
|
|