|
|
|
@ -9,7 +9,7 @@ import sharePermission from './sharePermission.vue'; |
|
|
|
import spacePermission from './spacePermission.vue'; |
|
|
|
import { matterPage,matterInfo,matterTree,doFileUpload,matterPermit} from "@/api/doc/type" |
|
|
|
import { doAccessManage,getSpaceMatterList,doCreateSpaceDir,doDelSpaceMatter, |
|
|
|
doAiTraining ,doCreateAiagent} from "@/api/doc/space" |
|
|
|
doAiTraining ,doCreateAiagent,spaceMatterRename} from "@/api/doc/space" |
|
|
|
import { h } from 'vue' |
|
|
|
import { |
|
|
|
Delete, |
|
|
|
@ -274,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" 取消了目录双击打开功能 |
|
|
|
//打开一个目录 |
|
|
|
@ -468,7 +493,11 @@ function handleAiUpload(info:matterInfo){ |
|
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
|
doAiTraining(`/agents/${currentAgent.value.uuid}/updates`,{"matter":info.uuid}).then(resp=>{ |
|
|
|
console.log(resp) |
|
|
|
ElMessage({ |
|
|
|
message: '已成功安排训练', |
|
|
|
type: 'success', |
|
|
|
plain: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
alert("当前路径没有智能体") |
|
|
|
@ -567,7 +596,6 @@ function isOwner(){ |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-row :gutter="24" style="margin: 12px 0px;"> |
|
|
|
<span class="el-breadcrumb" style="font-weight: bold; align-content: center;">[ {{ props.spacename }} ] : </span> |
|
|
|
<el-breadcrumb separator="/" style="align-content: center;"> |
|
|
|
@ -613,7 +641,7 @@ function isOwner(){ |
|
|
|
</el-button-group> |
|
|
|
</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="modListOrGrild" |
|
|
|
stripe |
|
|
|
:data="matterList" |
|
|
|
@ -641,12 +669,15 @@ function isOwner(){ |
|
|
|
<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="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" > |
|
|
|
<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="Setting" circle @click="onSpacePManage(scope.row)"></el-button> |
|
|
|
</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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -678,10 +709,13 @@ function isOwner(){ |
|
|
|
<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.EDIT" > |
|
|
|
<li @click="onlyOfficeEdit(row)">编辑</li> |
|
|
|
<li @click="onMatterRename(row)">重命名</li> |
|
|
|
</span> |
|
|
|
<span v-if="row.permitVal! >= PERMITS.MANAGER" > |
|
|
|
<li @click="onDelMatter(row)">删除</li> |
|
|
|
<li @click="onSpacePManage(row)">权限</li> |
|
|
|
<li @click="onSpacePManage(row)">权限</li> |
|
|
|
</span> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
@ -691,7 +725,6 @@ function isOwner(){ |
|
|
|
<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-row> |
|
|
|
</div> |
|
|
|
|
|
|
|
<aiagent :agent="currentAgent" :userid="uid" :uuid="currentAgent" :closefunc="()=>{currentAgent.model=false}"></aiagent> |
|
|
|
|
|
|
|
@ -718,12 +751,13 @@ function isOwner(){ |
|
|
|
.table-grid{ |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */ |
|
|
|
align-content: flex-start; |
|
|
|
.grid-item{ |
|
|
|
position: relative; |
|
|
|
width: 134px; |
|
|
|
height: 135px; |
|
|
|
margin: 5px; |
|
|
|
.grid-box{ |
|
|
|
height: 150px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
overflow: hidden; |
|
|
|
@ -739,7 +773,7 @@ function isOwner(){ |
|
|
|
line-height: 27px; |
|
|
|
text-align: center; |
|
|
|
color: #878989; |
|
|
|
z-index: 999; |
|
|
|
z-index: 90; |
|
|
|
box-shadow:0px 0px 12px rgba(0,0,0,0.12); |
|
|
|
li{ |
|
|
|
cursor: pointer; |
|
|
|
|