|
|
@ -9,16 +9,16 @@ import sharePermission from './sharePermission.vue'; |
|
|
import spacePermission from './spacePermission.vue'; |
|
|
import spacePermission from './spacePermission.vue'; |
|
|
import { matterPage,matterInfo,matterTree,doFileUpload,matterPermit} from "@/api/doc/type" |
|
|
import { matterPage,matterInfo,matterTree,doFileUpload,matterPermit} from "@/api/doc/type" |
|
|
import { doAccessManage,getSpaceMatterList,doCreateSpaceDir,doDelSpaceMatter, |
|
|
import { doAccessManage,getSpaceMatterList,doCreateSpaceDir,doDelSpaceMatter, |
|
|
doAiTraining ,doCreateAiagent} from "@/api/doc/space" |
|
|
doAiTraining ,doCreateAiagent,spaceMatterRename} from "@/api/doc/space" |
|
|
import { h } from 'vue' |
|
|
import { h } from 'vue' |
|
|
import { |
|
|
import { |
|
|
Delete, |
|
|
Delete, |
|
|
View, |
|
|
View, |
|
|
Download, |
|
|
Download, |
|
|
Plus, |
|
|
Plus,Search, |
|
|
Edit, |
|
|
Edit, |
|
|
Setting, |
|
|
Setting, |
|
|
Promotion, |
|
|
Grid,List, |
|
|
} from '@element-plus/icons-vue' |
|
|
} from '@element-plus/icons-vue' |
|
|
import {ElMessage,UploadFile,UploadFiles,ElPagination} from "element-plus"; |
|
|
import {ElMessage,UploadFile,UploadFiles,ElPagination} from "element-plus"; |
|
|
import aiagent from './agent.vue'; |
|
|
import aiagent from './agent.vue'; |
|
|
@ -29,6 +29,7 @@ const orgMembers = useOrgMemberStore() //为了初始化 |
|
|
|
|
|
|
|
|
const defaultAiAgent=import.meta.env.VITE_DEFAULT_AI_AGENT |
|
|
const defaultAiAgent=import.meta.env.VITE_DEFAULT_AI_AGENT |
|
|
const matterList = ref<matterInfo[]>([]) |
|
|
const matterList = ref<matterInfo[]>([]) |
|
|
|
|
|
const searchname=ref("") //按文件名查找文件 |
|
|
const newdirName=ref("") //创建新目录时的目录名 |
|
|
const newdirName=ref("") //创建新目录时的目录名 |
|
|
const currentHoverRow=ref("") //table 行的按钮控制 |
|
|
const currentHoverRow=ref("") //table 行的按钮控制 |
|
|
const breadcrumbList=ref<matterInfo[]>([{name:"根目录",uuid:"root", dir:true}]) //面包屑导航 |
|
|
const breadcrumbList=ref<matterInfo[]>([{name:"根目录",uuid:"root", dir:true}]) //面包屑导航 |
|
|
@ -41,6 +42,7 @@ const dynamicVNode = ref<VNode | null>(null) //permission 组件的父组件 |
|
|
const paginInfo = ref({ page: 0, total: 0 }) |
|
|
const paginInfo = ref({ page: 0, total: 0 }) |
|
|
|
|
|
|
|
|
const CutLevelPermit=ref(0) |
|
|
const CutLevelPermit=ref(0) |
|
|
|
|
|
const modListOrGrild=ref(true) //列表显示还是栅格显示 |
|
|
enum PERMITS { |
|
|
enum PERMITS { |
|
|
FORBID, //0 |
|
|
FORBID, //0 |
|
|
VIEW, //1 |
|
|
VIEW, //1 |
|
|
@ -88,8 +90,18 @@ const uploadFormData = computed(() => { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function updateListOrGrid(val:boolean){ |
|
|
|
|
|
modListOrGrild.value=val |
|
|
|
|
|
if(val){ |
|
|
|
|
|
localStorage.setItem("listOrGrid","true") |
|
|
|
|
|
}else{ |
|
|
|
|
|
localStorage.setItem("listOrGrid","false") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//--------------权限控制&添加空间成员------------- |
|
|
//--------------权限控制&添加空间成员------------- |
|
|
function onAccessManage(){ |
|
|
function onAccessManage(){ |
|
|
|
|
|
//迁移到了manage文件中,暂时不需要了 |
|
|
dynamicVNode.value = h(sharePermission, { |
|
|
dynamicVNode.value = h(sharePermission, { |
|
|
uid: props.uid, |
|
|
uid: props.uid, |
|
|
uuid: "", |
|
|
uuid: "", |
|
|
@ -159,10 +171,9 @@ function onDownload(row:matterInfo){ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//加载目录文件列表 |
|
|
//加载目录文件列表 |
|
|
function onLoadMatterList(){ |
|
|
function onLoadMatterList(name?:string){ |
|
|
let _page: matterPage = { |
|
|
let _page: matterPage= { |
|
|
page: paginInfo.value.page, |
|
|
page: paginInfo.value.page, |
|
|
pageSize: 50, |
|
|
pageSize: 50, |
|
|
orderCreateTime: "DESC", |
|
|
orderCreateTime: "DESC", |
|
|
@ -172,6 +183,18 @@ function onLoadMatterList(){ |
|
|
space:props.spaceid, |
|
|
space:props.spaceid, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if(name){ |
|
|
|
|
|
_page={ |
|
|
|
|
|
pageSize: 50, |
|
|
|
|
|
orderCreateTime: "DESC", |
|
|
|
|
|
orderDir: "DESC", |
|
|
|
|
|
deleted:false, |
|
|
|
|
|
name:name, |
|
|
|
|
|
space:props.spaceid, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getSpaceMatterList(props.uid,_page).then((resp)=>{ |
|
|
getSpaceMatterList(props.uid,_page).then((resp)=>{ |
|
|
//page+1 是由于分页的起始index是1,而后端api的分页index起始是0 |
|
|
//page+1 是由于分页的起始index是1,而后端api的分页index起始是0 |
|
|
paginInfo.value={total:resp.data.totalPages, page:resp.data.page} |
|
|
paginInfo.value={total:resp.data.totalPages, page:resp.data.page} |
|
|
@ -251,6 +274,31 @@ function onCreateDir(){ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//文件重命名 |
|
|
|
|
|
function onMatterRename(row:matterInfo){ |
|
|
|
|
|
const newname=ref(row.name) |
|
|
|
|
|
ElMessageBox({ |
|
|
|
|
|
title:"请输入新的文件名", |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
message: () => h(ElInput, { |
|
|
|
|
|
style: { width:'360px' }, |
|
|
|
|
|
modelValue: newname.value, |
|
|
|
|
|
'onUpdate:modelValue': (val) => { |
|
|
|
|
|
newname.value = val |
|
|
|
|
|
}, |
|
|
|
|
|
}), |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
if(newname.value&&newname.value!=""){ |
|
|
|
|
|
spaceMatterRename(props.uid,{ |
|
|
|
|
|
space:props.spaceid, |
|
|
|
|
|
uuid:row.uuid, |
|
|
|
|
|
name:newname.value, |
|
|
|
|
|
}).then(()=>onLoadMatterList()) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//------------------------------------------ |
|
|
//------------------------------------------ |
|
|
// @cell-dblclick="handleDoubleClick" 取消了目录双击打开功能 |
|
|
// @cell-dblclick="handleDoubleClick" 取消了目录双击打开功能 |
|
|
//打开一个目录 |
|
|
//打开一个目录 |
|
|
@ -445,7 +493,11 @@ function handleAiUpload(info:matterInfo){ |
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
doAiTraining(`/agents/${currentAgent.value.uuid}/updates`,{"matter":info.uuid}).then(resp=>{ |
|
|
doAiTraining(`/agents/${currentAgent.value.uuid}/updates`,{"matter":info.uuid}).then(resp=>{ |
|
|
console.log(resp) |
|
|
ElMessage({ |
|
|
|
|
|
message: '已成功安排训练', |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
plain: true, |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
}else{ |
|
|
alert("当前路径没有智能体") |
|
|
alert("当前路径没有智能体") |
|
|
@ -508,6 +560,13 @@ onMounted(() => { |
|
|
//设置默认的AI智能体 |
|
|
//设置默认的AI智能体 |
|
|
currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent,path:"root"} |
|
|
currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent,path:"root"} |
|
|
|
|
|
|
|
|
|
|
|
let val =localStorage.getItem("listOrGrid") |
|
|
|
|
|
if(val&&val=="false"){ |
|
|
|
|
|
modListOrGrild.value=false |
|
|
|
|
|
}else{ |
|
|
|
|
|
modListOrGrild.value=true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (props.ismanager) { |
|
|
if (props.ismanager) { |
|
|
CutLevelPermit.value=PERMITS.MANAGER |
|
|
CutLevelPermit.value=PERMITS.MANAGER |
|
|
}else{ |
|
|
}else{ |
|
|
@ -537,7 +596,6 @@ function isOwner(){ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
|
|
|
<el-row :gutter="24" style="margin: 12px 0px;"> |
|
|
<el-row :gutter="24" style="margin: 12px 0px;"> |
|
|
<span class="el-breadcrumb" style="font-weight: bold; align-content: center;">[ {{ props.spacename }} ] : </span> |
|
|
<span class="el-breadcrumb" style="font-weight: bold; align-content: center;">[ {{ props.spacename }} ] : </span> |
|
|
<el-breadcrumb separator="/" style="align-content: center;"> |
|
|
<el-breadcrumb separator="/" style="align-content: center;"> |
|
|
@ -547,6 +605,11 @@ function isOwner(){ |
|
|
</el-breadcrumb-item> |
|
|
</el-breadcrumb-item> |
|
|
</el-breadcrumb> |
|
|
</el-breadcrumb> |
|
|
<span v-if="currentNode.uuid!='root'" style="font-weight: bold;margin:0 5px;align-content:center;">/ {{ currentNode.name }}</span> |
|
|
<span v-if="currentNode.uuid!='root'" style="font-weight: bold;margin:0 5px;align-content:center;">/ {{ currentNode.name }}</span> |
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="6" class="search"> |
|
|
|
|
|
<el-input placeholder="搜索文件" v-model="searchname" @blur="searchname===''?onLoadMatterList():''"/> |
|
|
|
|
|
<el-button :icon="Search" @click="onLoadMatterList(searchname)"></el-button> |
|
|
|
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row :gutter="24"> |
|
|
<el-row :gutter="24"> |
|
|
@ -568,15 +631,18 @@ function isOwner(){ |
|
|
<el-button @click="createDir">新建目录</el-button> |
|
|
<el-button @click="createDir">新建目录</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-button style="margin-left: auto;" @click="()=>currentAgent.model=true">AI助手</el-button> |
|
|
<el-button style="margin-left: auto;" @click="()=>currentAgent.model=true">AI助手</el-button> |
|
|
|
|
|
|
|
|
<el-button-group v-if="isOwner()" class="control" style="margin: 0 10px;"> |
|
|
<el-button-group v-if="isOwner()" class="control" style="margin: 0 10px;"> |
|
|
<el-button :icon="Plus" @click="onAccessManage">成员</el-button> |
|
|
|
|
|
<el-button :icon="Plus" @click="onAiAgent">创建智能体</el-button> |
|
|
<el-button :icon="Plus" @click="onAiAgent">创建智能体</el-button> |
|
|
<!-- <el-button :icon="Delete" @click="onDeleteSpace">删除</el-button> --> |
|
|
</el-button-group> |
|
|
|
|
|
<el-button-group style="margin-right:20px;"> |
|
|
|
|
|
<el-button :icon="List" @click="updateListOrGrid(true)"></el-button> |
|
|
|
|
|
<el-button :icon="Grid" @click="updateListOrGrid(false)"></el-button> |
|
|
</el-button-group> |
|
|
</el-button-group> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row :gutter="24" style="height: 84%;overflow-y: auto;"> |
|
|
<el-row :gutter="24" style="overflow-y: auto;height: 90%;"> |
|
|
<el-table v-if="listOrGrid" |
|
|
<el-table v-if="modListOrGrild" |
|
|
stripe |
|
|
stripe |
|
|
:data="matterList" |
|
|
:data="matterList" |
|
|
:header-cell-style="{ background: '#f5f8fd' }" |
|
|
:header-cell-style="{ background: '#f5f8fd' }" |
|
|
@ -603,12 +669,15 @@ function isOwner(){ |
|
|
<div v-show="currentHoverRow === scope.row.name" style="display:inline; margin-left:15px"> |
|
|
<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 v-if="getFileIcon(scope.row.name)!='img'" size="small" :icon="View" circle @click="onPrivateView(scope.row)"></el-button> |
|
|
<el-button v-if="scope.row.permitVal>=PERMITS.DOWNLOAD" size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button> |
|
|
<el-button v-if="scope.row.permitVal>=PERMITS.DOWNLOAD" size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button> |
|
|
<el-button v-if="scope.row.permitVal>=PERMITS.EDIT" size="small" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></el-button> |
|
|
|
|
|
<span v-if="scope.row.permitVal>=PERMITS.MANAGER" class="manager_span" > |
|
|
<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> |
|
|
<el-button v-if="!scope.row.dir" size="small" circle @click="handleAiUpload(scope.row)">AI</el-button> |
|
|
<el-button size="small" :icon="Delete" circle @click="onDelMatter(scope.row)"></el-button> |
|
|
<el-button size="small" :icon="Delete" circle @click="onDelMatter(scope.row)"></el-button> |
|
|
<el-button size="small" :icon="Setting" circle @click="onSpacePManage(scope.row)"></el-button> |
|
|
<el-button size="small" :icon="Setting" circle @click="onSpacePManage(scope.row)"></el-button> |
|
|
</span> |
|
|
</span> |
|
|
|
|
|
<span v-if="scope.row.permitVal>=PERMITS.EDIT" class="manager_span"> |
|
|
|
|
|
<el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></el-button> |
|
|
|
|
|
<el-button size="small" circle @click="onMatterRename(scope.row)">改</el-button> |
|
|
|
|
|
</span> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
@ -640,10 +709,13 @@ function isOwner(){ |
|
|
<ul v-if="row.name!=''" class="grid-menus" v-show="currentHoverRow === row.name" @mouseleave="currentHoverRow=''"> |
|
|
<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="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.DOWNLOAD" @click="onDownload(row)">下载</li> |
|
|
<li v-if="row.permitVal! >= PERMITS.EDIT" @click="onlyOfficeEdit(row)">编辑</li> |
|
|
<span v-if="row.permitVal! >= PERMITS.EDIT" > |
|
|
|
|
|
<li @click="onlyOfficeEdit(row)">编辑</li> |
|
|
|
|
|
<li @click="onMatterRename(row)">重命名</li> |
|
|
|
|
|
</span> |
|
|
<span v-if="row.permitVal! >= PERMITS.MANAGER" > |
|
|
<span v-if="row.permitVal! >= PERMITS.MANAGER" > |
|
|
<li @click="onDelMatter(row)">删除</li> |
|
|
<li @click="onDelMatter(row)">删除</li> |
|
|
<li @click="onSpacePManage(row)">权限</li> |
|
|
<li @click="onSpacePManage(row)">权限</li> |
|
|
</span> |
|
|
</span> |
|
|
</ul> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
@ -653,7 +725,6 @@ function isOwner(){ |
|
|
<el-row v-if="paginInfo.total>1" style="justify-content: center;"> |
|
|
<el-row v-if="paginInfo.total>1" style="justify-content: center;"> |
|
|
<el-pagination size="small" background layout="prev, pager, next" :current-page="paginInfo.page+1" @current-change="(value:number)=>{paginInfo.page=value-1;onLoadMatterList();}" :page-count="paginInfo.total" class="mt-4"/> |
|
|
<el-pagination size="small" background layout="prev, pager, next" :current-page="paginInfo.page+1" @current-change="(value:number)=>{paginInfo.page=value-1;onLoadMatterList();}" :page-count="paginInfo.total" class="mt-4"/> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<aiagent :agent="currentAgent" :userid="uid" :uuid="currentAgent" :closefunc="()=>{currentAgent.model=false}"></aiagent> |
|
|
<aiagent :agent="currentAgent" :userid="uid" :uuid="currentAgent" :closefunc="()=>{currentAgent.model=false}"></aiagent> |
|
|
|
|
|
|
|
|
@ -671,16 +742,22 @@ function isOwner(){ |
|
|
align-self: flex-start; |
|
|
align-self: flex-start; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.search{ |
|
|
|
|
|
margin-left: auto; |
|
|
|
|
|
margin-right: 20px; |
|
|
|
|
|
display:inherit; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.table-grid{ |
|
|
.table-grid{ |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */ |
|
|
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */ |
|
|
|
|
|
align-content: flex-start; |
|
|
.grid-item{ |
|
|
.grid-item{ |
|
|
position: relative; |
|
|
position: relative; |
|
|
width: 134px; |
|
|
width: 134px; |
|
|
|
|
|
height: 135px; |
|
|
margin: 5px; |
|
|
margin: 5px; |
|
|
.grid-box{ |
|
|
.grid-box{ |
|
|
height: 150px; |
|
|
|
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
@ -696,7 +773,7 @@ function isOwner(){ |
|
|
line-height: 27px; |
|
|
line-height: 27px; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
color: #878989; |
|
|
color: #878989; |
|
|
z-index: 999; |
|
|
z-index: 90; |
|
|
box-shadow:0px 0px 12px rgba(0,0,0,0.12); |
|
|
box-shadow:0px 0px 12px rgba(0,0,0,0.12); |
|
|
li{ |
|
|
li{ |
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
|