From 14f5d45c0a2bedca5e1e7267f833e0f2ce10428f Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Thu, 23 Oct 2025 14:26:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BA=91=E7=9B=98=EF=BC=9A=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/doc/type.ts | 14 +++++++ src/views/doc/logpanel.vue | 14 +++++++ src/views/doc/manage.vue | 62 +++++++++++++++++++++++++---- src/views/doc/space.vue | 21 +++++++--- src/views/doc/uploadlog.vue | 78 +++++++++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+), 14 deletions(-) create mode 100644 src/views/doc/logpanel.vue create mode 100644 src/views/doc/uploadlog.vue diff --git a/src/api/doc/type.ts b/src/api/doc/type.ts index b7ae54c..fe4c785 100644 --- a/src/api/doc/type.ts +++ b/src/api/doc/type.ts @@ -98,4 +98,18 @@ export function doFileUpload(params:FormData,_url:string): AxiosPromise { + return request({ + url: _url, + method: 'post', + data: params, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); } \ No newline at end of file diff --git a/src/views/doc/logpanel.vue b/src/views/doc/logpanel.vue new file mode 100644 index 0000000..31a5445 --- /dev/null +++ b/src/views/doc/logpanel.vue @@ -0,0 +1,14 @@ + + + + diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue index 13590d3..5dfe21c 100644 --- a/src/views/doc/manage.vue +++ b/src/views/doc/manage.vue @@ -16,10 +16,12 @@ import { Delete,View,Download,Share,Search,Edit, Avatar,Plus,Grid,List, Setting, + Bell, } from '@element-plus/icons-vue' import {ElSelect,ElOption, ElText,ElInput,TableInstance,ElMessage,UploadFile, UploadFiles,ElPagination,ElTree,TreeNode,ElDropdown,ElDropdownItem} from "element-plus"; import preview from './preview.vue'; +import uploadlog from './uploadlog.vue'; import space from './space.vue'; import spacePermission from './spacePermission.vue'; import SvgIcon from "@/components/SvgIcon/index.vue"; @@ -74,6 +76,7 @@ const modRecycling=ref(false) //进度条 const percentage=ref(0) const onprogress=ref(false) +const tabName = ref('logs') const Departs = computed(() => { return `${'p0'+userStore.userInfoCont.userId},${userStore.userInfoCont.company},${userStore.userInfoCont.department},${userStore.userInfoCont.organization}` @@ -294,10 +297,25 @@ function onSearchFile(name?:string){ //获取回收站文件 function showRecycling(){ + tabName.value="main" modRecycling.value=true currentNode.value={} //清空当前节点 if(!PRIVATESPACE.value) { //共享空间模式要切换到个人空间 - PRIVATESPACE.value=true + PRIVATESPACE.value=true + } + + getRecyclingList(uid,{}).then((resp)=>{ + paginInfo.value={total:1,page:0} + matterList.value=resp.data + }) +} + +//获取上传日志 +function showlogs(){ + modRecycling.value=true + currentNode.value={} //清空当前节点 + if(!PRIVATESPACE.value) { //共享空间模式要切换到个人空间 + PRIVATESPACE.value=true } getRecyclingList(uid,{}).then((resp)=>{ @@ -305,6 +323,7 @@ function showRecycling(){ matterList.value=resp.data }) } + //恢复删除文件 function restoreMatter(row:matterInfo){ if (row.uuid){ @@ -435,6 +454,7 @@ function onNodeExpand(node: TreeNode, resolve: (data: matterTree[]) => void, rej } //树节点单击 function onNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ + tabName.value="main" modRecycling.value=false if(!PRIVATESPACE.value) { PRIVATESPACE.value=true @@ -565,11 +585,16 @@ async function onCustomUpload(e:Event){ }) percentage.value = Number(((index + 1) / count).toPrecision(2)) * 100 } - if(result!="") alert(result) + if(result!=""){ + dynamicVNode.value=h(uploadlog,{ + content:result + }) + } onLoadMatterList() //刷新 } + async function handleSingleFile(ff:File){ const fields=new FormData() fields.append("userUuid",uploadFormData.value.userUuid) @@ -579,7 +604,7 @@ async function handleSingleFile(ff:File){ const res = await doFileUpload(fields,'/hxpan/api/matter/upload') if(res.code!=200){ console.log(ff.name+"上传失败! ") - throw new Error(ff.name+"上传失败!\n ") + throw new Error(ff.name+"上传失败!
") } } @@ -595,11 +620,15 @@ async function uploadFolder(e:Event){ const f = files[index] await handleFolderFile(f).catch((err)=>{ console.log(err) - result+= (f as File).name+"上传失败\n" + result+= (f as File).name+"上传失败
" }) percentage.value = Number(((index + 1) / count).toPrecision(2)) * 100 } - if(result!="") alert(result) + if(result!=""){ + dynamicVNode.value=h(uploadlog,{ + content:result + }) + } onLoadMatterList() //刷新 } @@ -626,7 +655,7 @@ async function handleFolderFile(option:File){ puuid=newnodes[0].uuid }else{ console.log(_path+"上传失败! ") - throw new Error(_path +" 上传失败!\n ") + throw new Error(_path +" 上传失败!
") return } }else{ @@ -640,7 +669,7 @@ async function handleFolderFile(option:File){ const res = await doFileUpload(fields,'/hxpan/api/matter/upload') if(res.code!=200){ console.log(_path+"上传失败! ") - throw new Error(_path +" 上传失败!\n ") + throw new Error(_path +" 上传失败!
") } } @@ -689,6 +718,7 @@ function handleSigLoadErr(error: Error, uploadFile: UploadFile, uploadFiles:Uplo //-------------------space feature--------------------- function onNewSpace(){ + tabName.value="main" const newname=ref("") ElMessageBox({ title:"请输入空间名称", @@ -713,6 +743,7 @@ function onNewSpace(){ } function onSpaceNodeClick(data:matterTree,node:TreeNode,self:any,env:any){ + tabName.value="main" if(PRIVATESPACE.value) { //如果打开了个人空间,突然点击共享空间,要及时切换状态 PRIVATESPACE.value=false modRecycling.value=false @@ -839,6 +870,7 @@ onMounted(() => { // {name:'个人空间',uuid:'root',dir:false}, // currentNode.value.uuid // ) + currentNode.value={uuid:"root"} //加载我的空间列表 getMySpaces(uid,{roles:Departs.value}).then((resp)=>{ @@ -931,11 +963,16 @@ const handleSelectionChange = (val:matterInfo[]) => { +
+ 上传日志 +
回收站
+ +
回收站 @@ -1070,10 +1107,16 @@ const handleSelectionChange = (val:matterInfo[]) => { :officeHost="officeHost" :site-host="siteHost" :api-u-r-l="apiURL" :flushSpaceTree="flushSpaceTree">
+
+ + Comming soon.... + +
+ @@ -1121,7 +1164,6 @@ const handleSelectionChange = (val:matterInfo[]) => { margin: 0 5px 0 auto; } - .app_container { padding: 10px 30px 0px 30px; height: calc(100% - 10px); @@ -1206,4 +1248,8 @@ const handleSelectionChange = (val:matterInfo[]) => { :root{ --el-index-normal:auto; } + +.el-tabs__header{ + display: none; +} \ No newline at end of file diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue index 5e0e4ed..0551413 100644 --- a/src/views/doc/space.vue +++ b/src/views/doc/space.vue @@ -22,6 +22,7 @@ import { } from '@element-plus/icons-vue' import {ElMessage,UploadFile,UploadFiles,ElPagination, ElProgress} 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"; @@ -391,7 +392,11 @@ async function onCustomUpload(e:Event){ }) percentage.value = Number(((index + 1) / count).toPrecision(2)) * 100 } - if(result!="") alert(result) + if(result!=""){ + dynamicVNode.value=h(uploadlog,{ + content:result + }) + } onLoadMatterList() //刷新 } @@ -405,7 +410,7 @@ async function handleSingleFile(ff:File){ const res = await doFileUpload(fields,'/hxpan/api/space/upload') if(res.code!=200){ console.log(ff.name+"上传失败! ") - throw new Error(ff.name+"上传失败!\n ") + throw new Error(ff.name+"上传失败!
") } //上传后继续AI服务训练 @@ -424,11 +429,15 @@ async function uploadFolder(e:Event){ const f = files[index] await handleFolderFile(f).catch((err)=>{ console.log(err) - result+= (f as File).name+"上传失败\n" + result+= (f as File).name+"上传失败
" }) percentage.value = Number(((index + 1) / count).toPrecision(2)) * 100 } - if(result!="") alert(result) + if(result!=""){ + dynamicVNode.value=h(uploadlog,{ + content:result + }) + } onLoadMatterList() //刷新 } @@ -454,7 +463,7 @@ async function handleFolderFile(option:File){ puuid=newnodes[0].uuid }else{ console.log(_path+"上传失败! ") - throw new Error(_path +" 上传失败!\n ") + throw new Error(_path +" 上传失败!
") } }else{ puuid=node[0].uuid @@ -467,7 +476,7 @@ async function handleFolderFile(option:File){ const res = await doFileUpload(fields,'/hxpan/api/space/upload') if(res.code!=200){ console.log(_path+"上传失败! ") - throw new Error(_path+"上传失败!\n ") + throw new Error(_path+"上传失败!
") } //上传后继续AI服务训练,是不是需要上传,在handleAiUpload里面有检测 diff --git a/src/views/doc/uploadlog.vue b/src/views/doc/uploadlog.vue new file mode 100644 index 0000000..3d6c089 --- /dev/null +++ b/src/views/doc/uploadlog.vue @@ -0,0 +1,78 @@ + + + + + + From 4cd90bd992844fe2bc553d82aeb2913aebe3a0ce Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Thu, 23 Oct 2025 15:22:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=EF=BC=9A?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=95=E5=BE=8B=E6=B3=95=E8=A7=84API?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/doc/agent.vue | 16 ++++++++++++++-- src/views/doc/space.vue | 4 +++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/views/doc/agent.vue b/src/views/doc/agent.vue index 1942a07..0a206fe 100644 --- a/src/views/doc/agent.vue +++ b/src/views/doc/agent.vue @@ -27,6 +27,7 @@ const inputState=ref(true) const conversations=ref([]) const centHoverItem=ref("") const currentAgent=ref<{name:string,uuid:string}>({}) +const queryUrl=ref("") const interact_msg=ref<{ask:boolean,think:string,content:string,docinfo?:any[]}[]>([]) const props = withDefaults(defineProps<{ @@ -69,12 +70,20 @@ async function onSendTextToAI(){ const params={ "onlineSearch":"否", - "useDataset":"否" + "useDataset":"否", + "queryUrl":"" } for (let item of checkedModel.value){ - if(item==="onlineSearch") params.onlineSearch="是" + if(item==="onlineSearch"){ + params.onlineSearch="是" + if(queryUrl.value!="") { + params.queryUrl=queryUrl.value + //queryUrl.value="" //立即清理 + } + } if(item==="useDataset") params.useDataset="是" } + if (conversation.value==""){ //开启新对话 interact_msg.value=[{ask:true,think:"", content:myquestion.value}] @@ -325,6 +334,9 @@ onMounted(() => { {{ mod.name }} +
+ +
diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue index 0551413..3893341 100644 --- a/src/views/doc/space.vue +++ b/src/views/doc/space.vue @@ -332,6 +332,8 @@ function handleDoubleClick(row:matterInfo,ind?:number){ if(row.agent){ currentAgent.value={name:row.name,model:false,uuid:row.uuid,path:row.path} + }else if(row.uuid=="root"){ + currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent,path:"root"} } isNewNode=true //1:如果是当前目录的父组件没必要更新目录树 @@ -752,7 +754,7 @@ function isOwner(){ - +