Browse Source

双击打开和右键按钮

space2
han2015 3 months ago
parent
commit
795d14f6de
  1. 3
      src/api/doc/type.ts
  2. 47
      src/views/doc/manage.vue
  3. 55
      src/views/doc/space.vue

3
src/api/doc/type.ts

@ -63,9 +63,10 @@ export type matterTreeList = PageResult<matterTree[]>
export type matterResutList = PageResult<matterInfo[]>
export interface createDir{
userUuid:string;
userUuid?:string;
puuid:string;
name:string;
space?:string;
}
export interface createShare{

47
src/views/doc/manage.vue

@ -337,6 +337,14 @@ function onCreateDir(){
})
}
function onDBclickMatter(row:matterInfo){
if(row.dir){
onNodeClick(row as matterTree,null,null,null)
}else{
onPrivateView(row)
}
}
//
function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, reject: () => void) {
if ((node.data as matterTree).uuid) {
@ -627,7 +635,7 @@ function onSpaceNodeClick(data:matterTree,node:TreeNode,self:any,env:any){
uuid: data.uuid ?? "",
userUuid: data.userUuid ?? "",
manager: data.manager ?? false,
permits:data.permits ??{}
permits:data.permits ?? { id: 0, MatterUuid: '', data: '' }
};
PRIVATESPACE.value=false;
}else{
@ -768,7 +776,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
<div v-if="PRIVATESPACE" class="app_container">
<el-row :gutter="24" style="margin: 12px 0px;">
<el-link v-if="currentNode.name!=='root'" @click="onNodeClick(treeData[0], null as unknown as TreeNode, null, null)">
<span style="font-weight: bold;margin-right: 5px;">根目录</span>/
<span style="font-weight: bold;margin-right: 5px;align-content: center;">根目录</span>/
</el-link>
<span style="font-weight: bold;margin:0 5px;align-content:center;">{{ currentNode.name }}</span>
@ -821,7 +829,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
<el-table-column width="450" property="name" label="文件名">
<template #default="scope">
<input v-if="scope.row.name===''" v-model="newdirName" type="text" autofocus placeholder="文件夹名" style="border:groove;height:30px;" @change="onCreateDir" />
<div v-else style="display: flex; align-items: center;">
<div v-else style="display: flex; align-items: center;" @dblclick="onDBclickMatter(scope.row)">
<svg-icon v-if="scope.row.dir" icon-class="folder-icon" size="30px"/>
<el-image v-else-if="getFileIcon(scope.row.name)==='img'" style="width: 30px;" :preview-src-list="[getImageDownloadURL(scope.row.uuid,scope.row.name)]" :src="getImagePreivewURL(scope.row.uuid,scope.row.name)" />
<svg-icon v-else :icon-class="getFileIcon(scope.row.name)+'-icon'" size="30px" />
@ -858,20 +866,20 @@ const handleSelectionChange = (val:matterInfo[]) => {
<input v-model="newdirName" type="text" autofocus placeholder="文件夹名" style="border:groove;height:30px;" @change="onCreateDir" />
</div>
<div v-else class="grid-box" @click="handleMouseEnter(row)">
<div v-else class="grid-box" @dblclick="onDBclickMatter(row)" @contextmenu.prevent="handleMouseEnter(row)" >
<svg-icon v-if="row.dir" icon-class="folder-icon" size="80px"/>
<el-image v-else-if="getFileIcon(row.name)==='img'" style="width: 80px;" :preview-src-list="[getImageDownloadURL(row.uuid,row.name)]" :src="getImagePreivewURL(row.uuid,row.name)" />
<svg-icon v-else :icon-class="getFileIcon(row.name)+'-icon'" size="80px"/>
<span style="margin: 5px 0;text-wrap-mode:nowrap;">{{ row.name }}</span>
</div>
</div>
<div v-if="row.name!=''" class="grid-menus" v-show="currentHoverRow === row.name">
<el-button v-if="getFileIcon(row.name)!='img'" size="small" :icon="View" circle @click="onPrivateView(row)"></el-button>
<el-button size="small" :icon="Share" circle @click="onShareMatter(row)"></el-button>
<el-button size="small" :icon="Download" circle @click="onDownload(row)"></el-button>
<el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(row)"></el-button>
<el-button size="small" :icon="Delete" circle @click="onDelMatter(row)"></el-button>
</div>
<ul v-if="row.name!=''" class="grid-menus" v-show="currentHoverRow === row.name" @mouseleave="currentHoverRow=''">
<li v-if="getFileIcon(row.name)!='img'" @click="onPrivateView(row)">预览</li>
<li size="small" :icon="Share" @click="onShareMatter(row)">分享</li>
<li size="small" :icon="Download" @click="onDownload(row)">下载</li>
<li size="small" :icon="Edit" @click="onlyOfficeEdit(row)">编辑</li>
<li size="small" :icon="Delete" @click="onDelMatter(row)">删除</li>
</ul>
</div>
</div>
</el-row>
@ -969,10 +977,10 @@ const handleSelectionChange = (val:matterInfo[]) => {
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */
.grid-item{
position: relative;
height: 134px;
width: 134px;
width: 134px;
margin: 5px;
.grid-box{
height: 150px;
display: flex;
flex-direction: column;
overflow: hidden;
@ -982,9 +990,16 @@ const handleSelectionChange = (val:matterInfo[]) => {
.grid-menus{
position: absolute;
top: 10px;
button{
color: #000000;
margin: 4px;
left: 72px;
background-color: #ffffff;
width: 60px;
line-height: 27px;
text-align: center;
color: #878989;
box-shadow:0px 0px 12px rgba(0,0,0,0.12);
li{
cursor: pointer;
border-bottom: 1px solid #ccc;
}
}
.grid{

55
src/views/doc/space.vue

@ -67,7 +67,6 @@ const props = withDefaults(defineProps<{
siteHost:string,
owner:string,
apiURL:string,
roles:string,
listOrGrid:boolean,
ismanager:boolean,
spacePermit:matterPermit,
@ -101,7 +100,7 @@ function onAccessManage(){
let permited = btoa(_list.join("|"))
doAccessManage(props.uid,{
"space":props.spaceid,
"roles":permited,
"roles":permited,
"owner":props.owner,
"len":_list.length
}).then(()=>{
@ -138,7 +137,6 @@ function onDelMatter(row:matterInfo){
doDelSpaceMatter(props.uid,{
"uuid":row.uuid,
"space":props.spaceid,
"roles":props.roles,
}).then(()=>{
currentNode.value.uuid = row.puuid ?? ""
currentNode.value.name = row.path ? row.path.replace(`/${row.name}`,'').match(/[^/]+$/g)?.pop() :"上级目录"
@ -172,7 +170,6 @@ function onLoadMatterList(){
puuid:currentNode.value.uuid,
deleted:false,
space:props.spaceid,
roles:props.roles,
};
getSpaceMatterList(props.uid,_page).then((resp)=>{
@ -245,7 +242,6 @@ function onCreateDir(){
puuid:currentNode.value.uuid,
name:newdirName.value,
space:props.spaceid,
roles:props.roles,
}).then((resp)=> {
newdirName.value=""
onLoadMatterList()
@ -254,6 +250,7 @@ function onCreateDir(){
ElMessage.error(e.msg)
})
}
//------------------------------------------
// @cell-dblclick="handleDoubleClick"
//
@ -308,13 +305,11 @@ function handleDoubleClick(row:matterInfo,ind?:number){
onLoadMatterList()
}
*/
}else{
onPrivateView(row)
}
}
function checkMatterPermit(){
}
function handleMouseEnter(row:any){
currentHoverRow.value=row.name
}
@ -416,7 +411,6 @@ async function doCreateMultyDir(path:string,uuid:string){
puuid:uuid,
name:dirs[i],
space:props.spaceid,
roles:props.roles,
}).then((resp)=> {
uuid=resp.data.uuid //uuid, puuid
list.push(resp.data)
@ -549,12 +543,13 @@ function isOwner(){
<div>
<el-row :gutter="24" style="margin: 12px 0px;">
<span class="el-breadcrumb" style="font-weight: bold;">[ {{ props.spacename }} ] : </span>
<el-breadcrumb separator="/">
<!-- <el-breadcrumb separator="/">
<el-breadcrumb-item v-for="(item,index) in breadcrumbList"
:key="index" @click="handleDoubleClick(item,index)">
<span style="font-weight: bold;">{{ item.name }}</span>
<span style="font-weight: bold;cursor: pointer;">{{ item.name }}</span>
</el-breadcrumb-item>
</el-breadcrumb>
</el-breadcrumb> -->
<span style="font-weight: bold;margin:0 5px;align-content:center;">{{ currentNode.name }}</span>
</el-row>
<el-row :gutter="24">
@ -597,7 +592,7 @@ function isOwner(){
<el-table-column width="450" property="name" label="文件名">
<template #default="scope">
<input v-if="scope.row.name===''" v-model="newdirName" type="text" autofocus placeholder="文件夹名" style="border:groove;height:30px;" @change="onCreateDir" />
<div v-else style="display: flex; align-items: center;">
<div v-else style="display: flex; align-items: center;" @dblclick="handleDoubleClick(scope.row)" >
<svg-icon v-if="scope.row.dir" icon-class="folder-icon" :size="30"/>
<el-image v-else-if="getFileIcon(scope.row.name)==='img'" style="width: 30px;" :preview-src-list="[getSpaceImageDURL(scope.row.uuid,scope.row.name)]" :src="getSpaceImageViewURL(scope.row.uuid,scope.row.name)" />
<svg-icon v-else :icon-class="getFileIcon(scope.row.name)+'-icon'" :size="30" />
@ -636,7 +631,7 @@ function isOwner(){
<input v-model="newdirName" type="text" autofocus placeholder="文件夹名" style="border:groove;height:30px;" @change="onCreateDir" />
</div>
<div v-else class="grid-box" @mouseenter="handleMouseEnter(row)">
<div v-else class="grid-box" @dblclick="handleDoubleClick(row)" @contextmenu.prevent="handleMouseEnter(row)" >
<svg-icon v-if="row.dir" icon-class="folder-icon" size="80px"/>
<el-image v-else-if="getFileIcon(row.name)==='img'" style="width: 80px;" :preview-src-list="[getSpaceImageDURL(row.uuid,row.name)]" :src="getSpaceImageViewURL(row.uuid,row.name)" />
<svg-icon v-else :icon-class="getFileIcon(row.name)+'-icon'" size="80px"/>
@ -644,15 +639,15 @@ function isOwner(){
<el-tag v-if="row.agent" effect="dark" size="small" type="success" round >智能体</el-tag>
</div>
</div>
<div v-if="row.name!=''" class="grid-menus" v-show="currentHoverRow === row.name">
<el-button v-if="getFileIcon(row.name)!='img'" size="small" :icon="View" circle @click="onPrivateView(row)"></el-button>
<el-button v-if="row.permitVal! >= PERMITS.DOWNLOAD" size="small" :icon="Download" circle @click="onDownload(row)"></el-button>
<el-button v-if="row.permitVal! >= PERMITS.EDIT" size="small" :icon="Edit" circle @click="onlyOfficeEdit(row)"></el-button>
<ul v-if="row.name!=''" class="grid-menus" v-show="currentHoverRow === row.name" @mouseleave="currentHoverRow=''">
<li v-if="getFileIcon(row.name)!='img'" @click="onPrivateView(row)">预览</li>
<li v-if="row.permitVal! >= PERMITS.DOWNLOAD" @click="onDownload(row)">下载</li>
<li v-if="row.permitVal! >= PERMITS.EDIT" @click="onlyOfficeEdit(row)">编辑</li>
<span v-if="row.permitVal! >= PERMITS.MANAGER" >
<el-button size="small" :icon="Delete" circle @click="onDelMatter(row)"></el-button>
<el-button size="small" :icon="Setting" circle @click="onSpacePManage(row)"></el-button>
<li @click="onDelMatter(row)">删除</li>
<li @click="onSpacePManage(row)">权限</li>
</span>
</div>
</ul>
</div>
</div>
</el-row>
@ -684,10 +679,10 @@ function isOwner(){
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */
.grid-item{
position: relative;
height: 134px;
width: 134px;
margin: 5px;
.grid-box{
height: 150px;
display: flex;
flex-direction: column;
overflow: hidden;
@ -697,9 +692,17 @@ function isOwner(){
.grid-menus{
position: absolute;
top: 10px;
button{
color: black;
margin: 4px;
left: 72px;
background-color: #ffffff;
width: 60px;
line-height: 27px;
text-align: center;
color: #878989;
z-index: 999;
box-shadow:0px 0px 12px rgba(0,0,0,0.12);
li{
cursor: pointer;
border-bottom: 1px solid #ccc;
}
}
.grid{

Loading…
Cancel
Save