|
|
|
@ -5,6 +5,7 @@ |
|
|
|
--> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { getFileIcon, readableSize,fileType} from "./tools" |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import sharePermission from './sharePermission.vue'; |
|
|
|
import spacePermission from './spacePermission.vue'; |
|
|
|
import { matterPage,matterInfo,matterTree,doFileUpload,matterPermit} from "@/api/doc/type" |
|
|
|
@ -16,18 +17,18 @@ import { |
|
|
|
View, |
|
|
|
Download, |
|
|
|
Plus,Search, |
|
|
|
Share, |
|
|
|
Edit, |
|
|
|
Setting, |
|
|
|
Grid,List, |
|
|
|
} from '@element-plus/icons-vue' |
|
|
|
import {ElMessage,UploadFile,UploadFiles,ElPagination, ElProgress} from "element-plus"; |
|
|
|
import {ElMessage,UploadFile,UploadFiles,ElPagination, ElProgress,ElText} from "element-plus"; |
|
|
|
import aiagent from './agent.vue'; |
|
|
|
import uploadlog from './uploadlog.vue'; |
|
|
|
import router from "@/router"; |
|
|
|
import SvgIcon from "@/components/SvgIcon/index.vue"; |
|
|
|
import { useOrgMemberStore } from "@/store/modules/orgMember"; |
|
|
|
const orgMembers = useOrgMemberStore() //为了初始化 |
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
const siteHost=document.location.origin; |
|
|
|
const defaultAiAgent=import.meta.env.VITE_DEFAULT_AI_AGENT |
|
|
|
const matterList = ref<matterInfo[]>([]) |
|
|
|
const searchname=ref("") //按文件名查找文件 |
|
|
|
@ -176,7 +177,7 @@ function onDownload(row:matterInfo){ |
|
|
|
} |
|
|
|
|
|
|
|
//加载目录文件列表 |
|
|
|
function onLoadMatterList(name?:string){ |
|
|
|
function onLoadMatterList(name?:string,_puuid?:string){ |
|
|
|
percentage.value=0 |
|
|
|
onprogress.value=false |
|
|
|
|
|
|
|
@ -195,6 +196,7 @@ function onLoadMatterList(name?:string){ |
|
|
|
pageSize: 50, |
|
|
|
orderCreateTime: "DESC", |
|
|
|
orderDir: "DESC", |
|
|
|
puuid:_puuid, |
|
|
|
deleted:false, |
|
|
|
name:name, |
|
|
|
space:props.spaceid, |
|
|
|
@ -531,6 +533,25 @@ function handleAiUpload(info:matterInfo){ |
|
|
|
//------------------------------------------------- |
|
|
|
|
|
|
|
//-------------------edit & preive file for space--------------------- |
|
|
|
//空间文件分享链接 |
|
|
|
const onShareSpaceFile=(row:matterInfo)=>{ |
|
|
|
const str=btoa(encodeURIComponent(`${props.spaceid}|${row.puuid}|${row.name}`)) |
|
|
|
let _shareURL=`${siteHost}/#/doc/manage?s_token=${str}` |
|
|
|
ElMessageBox({ |
|
|
|
title: '文件分享:', |
|
|
|
customStyle: { '--el-messagebox-width':'800px',padding:'40px'}, |
|
|
|
message: () => h('div',{style:{display:'flex','flex-direction':'column','line-height':'34px', width:'600px'}},[ |
|
|
|
h(ElText,{style:{'align-self':'flex-start','font-weight':'bold'}},()=>row.name), |
|
|
|
h(ElText,{style:{'align-self':'flex-start','overflow-wrap': 'anywhere'}},()=>_shareURL), |
|
|
|
]), |
|
|
|
confirmButtonText: '复制分享链接', |
|
|
|
showCancelButton: true |
|
|
|
}).then(()=>{ |
|
|
|
if(!navigator.clipboard) alert("clipboard 不可用") |
|
|
|
navigator.clipboard.writeText(_shareURL) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//文件预览 |
|
|
|
function onPrivateView(row:matterInfo){ |
|
|
|
const _type=fileType(row.name!) |
|
|
|
@ -603,7 +624,14 @@ onMounted(() => { |
|
|
|
CutLevelPermit.value = PERMITS.FORBID //没有权限!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const query = route.query |
|
|
|
if(query.s_token){ |
|
|
|
const s_token=decodeURIComponent(atob(query.s_token as string)).split("|") |
|
|
|
if(s_token.length==3){ |
|
|
|
onLoadMatterList(s_token[2],s_token[1]) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
onLoadMatterList() |
|
|
|
}); |
|
|
|
|
|
|
|
@ -611,7 +639,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
tabSelected.value = val |
|
|
|
} |
|
|
|
|
|
|
|
defineExpose({handleDoubleClick,onDelMatter,onSpaceMatterRename}) |
|
|
|
defineExpose({handleDoubleClick,onDelMatter,onSpaceMatterRename,onLoadMatterList}) |
|
|
|
|
|
|
|
//判断是不是空间的所有者 |
|
|
|
function isOwner(){ |
|
|
|
@ -697,6 +725,7 @@ function isOwner(){ |
|
|
|
<el-tag v-if="scope.row.agent" effect="dark" size="small" type="success" round >智能体</el-tag> |
|
|
|
<div v-show="currentHoverRow === scope.row.name" style="display:inline; margin-left:15px"> |
|
|
|
<el-button v-if="getFileIcon(scope.row.name)!='img'" size="small" :icon="View" circle @click="onPrivateView(scope.row)"></el-button> |
|
|
|
<el-button size="small" :icon="Share" circle @click="onShareSpaceFile(scope.row)"></el-button> |
|
|
|
<el-button v-if="scope.row.permitVal>=PERMITS.DOWNLOAD" size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button> |
|
|
|
<span v-if="scope.row.permitVal>=PERMITS.MANAGER" class="manager_span" > |
|
|
|
<el-button v-if="!scope.row.dir" size="small" circle @click="handleAiUpload(scope.row)">AI</el-button> |
|
|
|
@ -737,6 +766,7 @@ function isOwner(){ |
|
|
|
</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 @click="onShareSpaceFile(row)">分享</li> |
|
|
|
<li v-if="row.permitVal! >= PERMITS.DOWNLOAD" @click="onDownload(row)">下载</li> |
|
|
|
<span v-if="row.permitVal! >= PERMITS.EDIT" > |
|
|
|
<li @click="onlyOfficeEdit(row)">编辑</li> |
|
|
|
|