Browse Source

修复文件夹上传功能

space2
han2015 3 months ago
parent
commit
158b81507f
  1. 56
      src/views/doc/manage.vue
  2. 13
      src/views/doc/space.vue

56
src/views/doc/manage.vue

@ -349,9 +349,11 @@ function onDBclickMatter(row:matterInfo){
// //
function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, reject: () => void) { function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, reject: () => void) {
let cuuid ="root"
if ((node.data as matterTree).uuid) { if ((node.data as matterTree).uuid) {
const cuuid = (node.data as matterTree).uuid cuuid= (node.data as matterTree).uuid
currentNode.value = node.data currentNode.value = node.data
}
let _page: matterPage = { let _page: matterPage = {
page: 0, page: 0,
@ -378,7 +380,7 @@ function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, rej
resolve(node_data) resolve(node_data)
}).catch(() => reject()) }).catch(() => reject())
}
} }
// //
function onNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ function onNodeClick(data:matterTree,node:TreeNode,self:any,env:any){
@ -528,7 +530,7 @@ async function handleFolderFile(option:File){
const _path = option.webkitRelativePath const _path = option.webkitRelativePath
const _dir=_path.replace(/\/[^/]+\w+$/,"") //,[^/] const _dir=_path.replace(/\/[^/]+\w+$/,"") //,[^/]
const node = matterList.value.filter((item)=>{ const node = matterList.value.filter((item)=>{
return item.dir && item.path?.endsWith(_dir) return item.dir && _dir.endsWith(item.name!)
}) })
let puuid="" let puuid=""
@ -538,8 +540,9 @@ async function handleFolderFile(option:File){
matterList.value.push(...subs) // matterList.value.push(...subs) //
const newnodes=matterList.value.filter((item)=>{ const newnodes=matterList.value.filter((item)=>{
return item.dir && item.path?.endsWith(_dir) return item.dir && _dir.endsWith(item.name!)
}) })
if(newnodes.length>0){ if(newnodes.length>0){
puuid=newnodes[0].uuid puuid=newnodes[0].uuid
}else{ }else{
@ -567,6 +570,13 @@ async function doCreateMultyDir(path:string,uuid:string){
const list=[]; const list=[];
const dirs=path.split("/") const dirs=path.split("/")
for(let i=0;i<dirs.length;i++){ 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,{ await postCreateDir(uid,{
userUuid:uid, userUuid:uid,
puuid:uuid, 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 //http://172.20.2.87:6010/api/alien/preview/5a10aaf6-396e-4d9a-7e87-3c5c8029d4db/123.png?ir=fill_100_100
// //
onMounted(() => { onMounted(() => {
treeRef.value.append( // treeRef.value.append(
{name:'个人空间',uuid:'root',dir:false}, // {name:'',uuid:'root',dir:false},
currentNode.value.uuid // currentNode.value.uuid
) // )
// //
getMySpaces(uid,{roles:Departs.value}).then((resp)=>{ getMySpaces(uid,{roles:Departs.value}).then((resp)=>{
resp.data.forEach((item)=>{ resp.data.forEach((item)=>{
@ -753,6 +763,9 @@ const handleSelectionChange = (val:matterInfo[]) => {
<template> <template>
<div style="display:grid;grid-template-columns:1fr 4fr; width: 100%;height: 100%;"> <div style="display:grid;grid-template-columns:1fr 4fr; width: 100%;height: 100%;">
<div class="menus_tree"> <div class="menus_tree">
<div class="area_header">
<el-icon :size="20"><House /></el-icon><span class="area_name" > </span>
</div>
<el-tree <el-tree
ref="treeRef" ref="treeRef"
style="max-width: 600px" style="max-width: 600px"
@ -772,7 +785,10 @@ const handleSelectionChange = (val:matterInfo[]) => {
</div> </div>
</template> </template>
</el-tree> </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 <el-tree
ref="spaceTreeRef" ref="spaceTreeRef"
style="max-width: 600px" style="max-width: 600px"
@ -790,9 +806,9 @@ const handleSelectionChange = (val:matterInfo[]) => {
<el-button size="small" :icon="Setting" circle ></el-button> <el-button size="small" :icon="Setting" circle ></el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onAccessManage(data)}">空间成员管理</el-dropdown-item> <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(); onSpacePManage(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> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@ -800,6 +816,9 @@ const handleSelectionChange = (val:matterInfo[]) => {
</template> </template>
</el-tree> </el-tree>
<div class="area_header">
<el-icon :size="20"><Delete /></el-icon><span class="area_name" > </span>
</div>
</div> </div>
<div v-if="PRIVATESPACE" class="app_container"> <div v-if="PRIVATESPACE" class="app_container">
@ -947,6 +966,19 @@ const handleSelectionChange = (val:matterInfo[]) => {
--el-tree-expand-icon-color:#4c4c4e; --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{ .tree-item{
display: flex; display: flex;
@ -975,7 +1007,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
.search{ .search{
margin-left: auto; margin-left: auto;
margin-right: 20px; margin-right: 26px;
display:inherit; display:inherit;
} }
.shareDialog{ .shareDialog{

13
src/views/doc/space.vue

@ -410,7 +410,7 @@ async function handleFolderFile(option:File){
const _path = option.webkitRelativePath const _path = option.webkitRelativePath
const _dir=_path.replace(/\/[^/]+\w+$/,"") //,[^/] const _dir=_path.replace(/\/[^/]+\w+$/,"") //,[^/]
const node = matterList.value.filter((item)=>{ const node = matterList.value.filter((item)=>{
return item.dir && item.path?.endsWith(_dir) return item.dir && _dir.endsWith(item.name!)
}) })
let puuid="" let puuid=""
@ -420,7 +420,7 @@ async function handleFolderFile(option:File){
matterList.value.push(...subs) // matterList.value.push(...subs) //
const newnodes=matterList.value.filter((item)=>{ 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){ if(newnodes.length>0){
puuid=newnodes[0].uuid puuid=newnodes[0].uuid
@ -451,6 +451,13 @@ async function doCreateMultyDir(path:string,uuid:string){
const list=[]; const list=[];
const dirs=path.split("/") const dirs=path.split("/")
for(let i=0;i<dirs.length;i++){ 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 doCreateSpaceDir(props.uid,{ await doCreateSpaceDir(props.uid,{
puuid:uuid, puuid:uuid,
name:dirs[i], name:dirs[i],
@ -744,7 +751,7 @@ function isOwner(){
} }
.search{ .search{
margin-left: auto; margin-left: auto;
margin-right: 20px; margin-right: -4px;
display:inherit; display:inherit;
} }

Loading…
Cancel
Save