|
|
|
@ -52,17 +52,24 @@ const currentHoverRow=ref("") //table 行的按钮控制 |
|
|
|
const selectedValue = ref("sixhour") //分享弹窗的世间变量 |
|
|
|
const tabSelected=ref<matterInfo[]>([]) //table组件多选数据维护 |
|
|
|
//to support tree mode refactor |
|
|
|
const treeData=ref<matterTree[]>([{name:'个人空间',uuid:'root',children:[]}]) |
|
|
|
const treeData=ref<matterTree[]>([])//{name:'个人空间',uuid:'root',children:[]} |
|
|
|
const treeRef = ref(); |
|
|
|
const currentNode=ref<matterTree>({}) //打开的路径层次 |
|
|
|
const officeHost=import.meta.env.VITE_OFFICE_HOST |
|
|
|
const dynamicVNode = ref<VNode | null>(null) //permission 组件的父组件 |
|
|
|
|
|
|
|
|
|
|
|
const multipleTableRef = ref<TableInstance>() |
|
|
|
const paginInfo = ref({ page: 0, total: 0 }) |
|
|
|
|
|
|
|
const PRIVATESPACE = ref(true) //是空间状态的控制 2种:私有云盘和共享空间 |
|
|
|
const SpaceID= ref<{name:string,uuid:string,userUuid:string}>({}) //当前space的id |
|
|
|
const SpaceList=ref<{name:string,uuid:string,userUuid:string}[]>([]) |
|
|
|
const spaceEleRef = ref() //space组件的引用,它与spaceTreeRef没有父子关系,反而是为了处理spaceTree的操作而创建的该变量 |
|
|
|
const spaceTreeData=ref<matterTree[]>([])//{name:'个人空间',uuid:'root',children:[]} |
|
|
|
const spaceTreeRef = ref(); //space的树树组件的引用 |
|
|
|
let spaceNodeUid="" //用来判断树组件的展开和关闭,如何只是展开和关闭的点击事件不在刷新,通currentNode的作用 |
|
|
|
|
|
|
|
const Departs = computed(() => { |
|
|
|
return `${userStore.userInfoCont.company},${userStore.userInfoCont.department},${userStore.userInfoCont.organization}` |
|
|
|
}) |
|
|
|
@ -307,7 +314,7 @@ function onCreateDir(){ |
|
|
|
{uuid:resp.data.uuid,dir:false,name:resp.data.name,puuid:resp.data.puuid}, |
|
|
|
currentNode.value.uuid |
|
|
|
) |
|
|
|
onLoadMatterList() |
|
|
|
//onLoadMatterList() |
|
|
|
}) |
|
|
|
.catch((e)=>{ |
|
|
|
ElMessage.error(e.msg) |
|
|
|
@ -353,6 +360,8 @@ function onNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ |
|
|
|
if (currentNode.value.uuid === data.uuid) return; |
|
|
|
const cuuid = data.uuid |
|
|
|
currentNode.value = data |
|
|
|
onLoadMatterList() |
|
|
|
return |
|
|
|
let _page: matterPage = { |
|
|
|
page: 0, |
|
|
|
pageSize: 50, |
|
|
|
@ -441,14 +450,51 @@ function onNewSpace(){ |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function onSpaceNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ |
|
|
|
//如果在单个组件上重复点击,不在刷新请求 |
|
|
|
if(spaceNodeUid==data.uuid) return; |
|
|
|
spaceNodeUid=data.uuid |
|
|
|
|
|
|
|
if(data.uuid.startsWith("s0") && data.uuid!=SpaceID.value.uuid){ //切换空间 |
|
|
|
SpaceID.value={ |
|
|
|
name: data.name ?? "", |
|
|
|
uuid: data.uuid ?? "", |
|
|
|
userUuid: data.userUuid ?? "" |
|
|
|
}; |
|
|
|
PRIVATESPACE.value=false; |
|
|
|
}else{ |
|
|
|
let matter= { |
|
|
|
uuid:data.uuid==SpaceID.value.uuid?"root":data.uuid, |
|
|
|
puuid: data.puuid, |
|
|
|
name:data.name, |
|
|
|
agent:data.agent, |
|
|
|
dir:true |
|
|
|
} |
|
|
|
//打开具体的节点 |
|
|
|
spaceEleRef.value.handleDoubleClick(matter) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function flushSpaceTree(uuid:string,data:matterTree[]){ |
|
|
|
if(uuid==="root") uuid=SpaceID.value.uuid |
|
|
|
spaceTreeRef.value.updateKeyChildren(uuid,data) |
|
|
|
} |
|
|
|
|
|
|
|
//------------------------------------------------------ |
|
|
|
//http://172.20.2.87:6010/api/alien/preview/5a10aaf6-396e-4d9a-7e87-3c5c8029d4db/123.png?ir=fill_100_100 |
|
|
|
//渲染完页面再执行 |
|
|
|
onMounted(() => { |
|
|
|
onNodeClick(treeData.value[0], null as unknown as TreeNode, null, null) |
|
|
|
treeRef.value.append( |
|
|
|
{name:'个人空间',uuid:'root',dir:false}, |
|
|
|
currentNode.value.uuid |
|
|
|
) |
|
|
|
|
|
|
|
//加载我的空间列表 |
|
|
|
getMySpaces(uid,{roles:Departs}).then((resp)=>{ |
|
|
|
SpaceList.value=resp.data |
|
|
|
//SpaceList.value=resp.data |
|
|
|
resp.data.forEach((item)=>{ |
|
|
|
spaceTreeRef.value.append({name:item.name,uuid:item.uuid,dir:false,userUuid:item.userUuid}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
@ -466,6 +512,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
style="max-width: 600px" |
|
|
|
:data="treeData" |
|
|
|
node-key="uuid" |
|
|
|
highlight-current |
|
|
|
lazy |
|
|
|
:props="{label: 'name',children:'children',isLeaf:'dir'}" |
|
|
|
:load="onNodeExpand" |
|
|
|
@ -473,7 +520,18 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
@node-click="onNodeClick" |
|
|
|
/> |
|
|
|
<el-button style="margin: 10px 0;" :icon="Plus" @click="onNewSpace"> 共享空间</el-button> |
|
|
|
<ul style="background-color: white;"> |
|
|
|
<el-tree |
|
|
|
ref="spaceTreeRef" |
|
|
|
style="max-width: 600px" |
|
|
|
:data="spaceTreeData" |
|
|
|
node-key="uuid" |
|
|
|
accordion |
|
|
|
highlight-current |
|
|
|
lazy |
|
|
|
:props="{label: 'name',children:'children',isLeaf:'dir'}" |
|
|
|
@node-click="onSpaceNodeClick" |
|
|
|
/> |
|
|
|
<ul style="background-color: white;max-width: 600px;"> |
|
|
|
<li class="spaceitem" v-for="sp in SpaceList" @click="()=>{SpaceID=sp; PRIVATESPACE=false;}">{{ sp.name }}</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
@ -565,8 +623,10 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
<div v-else class="app_container"> |
|
|
|
<space :uid="uid" :spaceid="SpaceID.uuid" :roles="Departs" :spacename="SpaceID.name" :owner="SpaceID.userUuid" |
|
|
|
:officeHost="officeHost" :site-host="siteHost" :api-u-r-l="apiURL"></space> |
|
|
|
<space ref="spaceEleRef" :uid="uid" :tree="spaceTreeRef" |
|
|
|
:spaceid="SpaceID.uuid" :roles="Departs" :spacename="SpaceID.name" :owner="SpaceID.userUuid" |
|
|
|
:officeHost="officeHost" :site-host="siteHost" :api-u-r-l="apiURL" |
|
|
|
:flushSpaceTree="flushSpaceTree"></space> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
@ -582,7 +642,8 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
height: 100%; |
|
|
|
overflow-y: auto; |
|
|
|
.el-tree{ |
|
|
|
--el-tree-node-hover-bg-color:#d9dadb; |
|
|
|
--el-color-primary-light-9:#6eb3f8; |
|
|
|
--el-tree-node-hover-bg-color:#a1c7ee; |
|
|
|
--el-tree-node-content-height:43px; |
|
|
|
--el-tree-expand-icon-color:#4c4c4e; |
|
|
|
} |
|
|
|
@ -593,7 +654,9 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
height: calc(100% - 10px); |
|
|
|
overflow: hidden; |
|
|
|
overflow-y: auto; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.search{ |
|
|
|
margin-right: 20px; |
|
|
|
display:inherit; |
|
|
|
|