|
|
|
@ -17,7 +17,6 @@ import { |
|
|
|
Download, |
|
|
|
Plus, |
|
|
|
Edit, |
|
|
|
Folder, |
|
|
|
Setting, |
|
|
|
} from '@element-plus/icons-vue' |
|
|
|
import {ElMessage,UploadFile,UploadFiles,ElPagination} from "element-plus"; |
|
|
|
@ -52,8 +51,7 @@ enum PERMITS { |
|
|
|
} |
|
|
|
|
|
|
|
//-----------AI--------------------- |
|
|
|
//const agent=ref<{model:boolean,name:string}>({}) |
|
|
|
const currentAgent=ref<{model:boolean,name:string,uuid:string}>({}) |
|
|
|
const currentAgent=ref<{model:boolean,name:string,uuid:string,path:string}>({}) |
|
|
|
|
|
|
|
//--------------------------------- |
|
|
|
|
|
|
|
@ -78,6 +76,7 @@ const props = withDefaults(defineProps<{ |
|
|
|
watch(props,()=>{ |
|
|
|
currentNode.value.uuid="root" |
|
|
|
currentNode.value.name="根目录" |
|
|
|
currentAgent.value.path="root" |
|
|
|
onLoadMatterList() |
|
|
|
}) |
|
|
|
|
|
|
|
@ -275,7 +274,7 @@ function handleDoubleClick(row:matterInfo,ind?:number){ |
|
|
|
} |
|
|
|
|
|
|
|
if(row.agent){ |
|
|
|
currentAgent.value={name:row.name,model:false,uuid:row.uuid} |
|
|
|
currentAgent.value={name:row.name,model:false,uuid:row.uuid,path:row.path} |
|
|
|
} |
|
|
|
isNewNode=true |
|
|
|
//1:如果是当前目录的父组件没必要更新目录树 |
|
|
|
@ -296,10 +295,6 @@ function handleDoubleClick(row:matterInfo,ind?:number){ |
|
|
|
}else{ |
|
|
|
//进入下一级 |
|
|
|
//如果目录是一个智能体,把当前智能体设置为该目录 |
|
|
|
if(row.agent){ |
|
|
|
currentAgent.value={name:row.name,model:false,uuid:row.uuid} |
|
|
|
} |
|
|
|
|
|
|
|
currentNode.value=row |
|
|
|
breadcrumbList.value.push(row) |
|
|
|
onLoadMatterList() |
|
|
|
@ -447,7 +442,7 @@ function onAiAgent(){ |
|
|
|
} |
|
|
|
function handleAiUpload(info:matterInfo){ |
|
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
|
if (currentNode.value.agent){ |
|
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
|
doAiTraining(`/agents/${currentAgent.value.uuid}/updates`,{"matter":info.uuid}).then(resp=>{ |
|
|
|
console.log(resp) |
|
|
|
}) |
|
|
|
@ -508,7 +503,7 @@ function getSpaceImageDURL(_uuid:string,_name:string){ |
|
|
|
onMounted(() => { |
|
|
|
currentNode.value.uuid="root" |
|
|
|
//设置默认的AI智能体 |
|
|
|
currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent} |
|
|
|
currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent,path:"root"} |
|
|
|
|
|
|
|
if (props.ismanager) { |
|
|
|
CutLevelPermit.value=PERMITS.MANAGER |
|
|
|
@ -539,17 +534,16 @@ function isOwner(){ |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
|
|
|
|
<div> |
|
|
|
<el-row :gutter="24" style="margin: 12px 0px;"> |
|
|
|
<span class="el-breadcrumb" style="font-weight: bold;">[ {{ props.spacename }} ] : </span> |
|
|
|
<!-- <el-breadcrumb separator="/"> |
|
|
|
<span class="el-breadcrumb" style="font-weight: bold; align-content: center;">[ {{ props.spacename }} ] : </span> |
|
|
|
<el-breadcrumb separator="/" style="align-content: center;"> |
|
|
|
<el-breadcrumb-item v-for="(item,index) in breadcrumbList" |
|
|
|
:key="index" @click="handleDoubleClick(item,index)"> |
|
|
|
<span style="font-weight: bold;cursor: pointer;">{{ item.name }}</span> |
|
|
|
</el-breadcrumb-item> |
|
|
|
</el-breadcrumb> --> |
|
|
|
<span style="font-weight: bold;margin:0 5px;align-content:center;">{{ currentNode.name }}</span> |
|
|
|
</el-breadcrumb> |
|
|
|
<span v-if="currentNode.uuid!='root'" style="font-weight: bold;margin:0 5px;align-content:center;">/ {{ currentNode.name }}</span> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="24"> |
|
|
|
@ -630,7 +624,7 @@ function isOwner(){ |
|
|
|
<svg-icon icon-class="folder-icon" size="80px"/> |
|
|
|
<input v-model="newdirName" type="text" autofocus placeholder="文件夹名" style="border:groove;height:30px;" @change="onCreateDir" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<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)" /> |
|
|
|
|