From f5130b5dc9c2fcd5ec6e67698e23456f1da82b22 Mon Sep 17 00:00:00 2001
From: han2015 <1019850453@qq.com>
Date: Wed, 17 Sep 2025 11:16:23 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E7=9B=98=EF=BC=9A=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/doc/space.ts | 16 ++++++++++
src/views/doc/agent.vue | 14 +++++++--
src/views/doc/manage.vue | 30 ++++++++++--------
src/views/doc/onlyoffice.vue | 28 ++++++++---------
src/views/doc/recentVisited.vue | 4 +--
src/views/doc/space.vue | 54 +++++++++++++++++++++++++++------
6 files changed, 105 insertions(+), 41 deletions(-)
diff --git a/src/api/doc/space.ts b/src/api/doc/space.ts
index fbc3ff2..219160e 100644
--- a/src/api/doc/space.ts
+++ b/src/api/doc/space.ts
@@ -74,6 +74,22 @@ export function doDelSpace(uid:string,data?: any){
});
}
+/**
+ * 重命名
+ */
+export function spaceMatterRename(uid:string,data?: any){
+ return request({
+ url: '/hxpan/api/space/rename',
+ method: 'post',
+ headers: {
+ 'Identifier':uid,
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ data: data
+ });
+}
+
+
/**
* 删除文件或目录
*/
diff --git a/src/views/doc/agent.vue b/src/views/doc/agent.vue
index ccc83aa..ad59e20 100644
--- a/src/views/doc/agent.vue
+++ b/src/views/doc/agent.vue
@@ -244,10 +244,12 @@ onMounted(() => {
-
+
引用
-
+
+
+
+
{{doc.document_name}}
@@ -389,6 +391,12 @@ onMounted(() => {
}
ol{
margin-left: 14px;
+ ul{
+ margin-left: 30px;
+ li{
+ list-style: disc;
+ }
+ }
}
ol>li{
list-style-type: decimal;
diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue
index 96b622e..8825cbc 100644
--- a/src/views/doc/manage.vue
+++ b/src/views/doc/manage.vue
@@ -254,10 +254,12 @@ function onMatterRename(row:matterInfo){
},
}),
}).then(() => {
- postMatterRename(uid,{
- uuid:row.uuid,
- name:newname.value,
- }).then(()=>onLoadMatterList())
+ if(newname.value&&newname.value!=""){
+ postMatterRename(uid,{
+ uuid:row.uuid,
+ name:newname.value,
+ }).then(()=>onLoadMatterList())
+ }
})
}
@@ -841,7 +843,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
-
+
{
-
+
@@ -874,6 +876,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
+ 改
@@ -902,10 +905,11 @@ const handleSelectionChange = (val:matterInfo[]) => {
@@ -1002,12 +1006,13 @@ const handleSelectionChange = (val:matterInfo[]) => {
.table-grid{
display: flex;
flex-wrap: wrap; /* 关键属性,允许子元素自动换行 */
+ align-content: flex-start;
.grid-item{
position: relative;
- width: 134px;
+ width: 134px;
+ height: 145px;
margin: 5px;
.grid-box{
- height: 150px;
display: flex;
flex-direction: column;
overflow: hidden;
@@ -1023,6 +1028,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
line-height: 27px;
text-align: center;
color: #878989;
+ z-index: 90;
box-shadow:0px 0px 12px rgba(0,0,0,0.12);
li{
cursor: pointer;
diff --git a/src/views/doc/onlyoffice.vue b/src/views/doc/onlyoffice.vue
index dce2bfe..64a2ebe 100644
--- a/src/views/doc/onlyoffice.vue
+++ b/src/views/doc/onlyoffice.vue
@@ -53,22 +53,22 @@ onMounted(()=>{
const _url=decodeURIComponent(window.atob(query.fileurl))
const name=query.name?.toString()??""
const dtype=query.dtype?.toString()??"word"
+
//验证一下文件名是否合规
- if (_info.includes(name)){
- config.value.document.url=_url
- config.value.document.title=name
- const _key=_url.match(/(\w+-\w+-\w+)/)![0]
- if(_key) config.value.document.key=_key+(new Date().getTime().toString()) //合作编辑必须要有一个unique key
- config.value.documentType=dtype
- config.value.editorConfig.callbackUrl+=`?info=${_info}`
- //设置编辑模式
- if(!query.verify) return;
- const _verify = atob(query.verify)
- //1:必须是验证通过,以true结尾 2:校验uuid是否匹配
- if(_verify.endsWith("true") && _key.includes(_verify.replace("true",""))){
- config.value.editorConfig.mode="edit"
- }
+ config.value.document.url=_url
+ config.value.document.title=name
+ const _key=_url.match(/(\w+-\w+-\w+)/)![0]
+ if(_key) config.value.document.key=_key+(new Date().getTime().toString()) //合作编辑必须要有一个unique key
+ config.value.documentType=dtype
+ config.value.editorConfig.callbackUrl+=`?info=${_info}`
+ //设置编辑模式
+ if(!query.verify) return;
+ const _verify = atob(query.verify)
+ //1:必须是验证通过,以true结尾 2:校验uuid是否匹配
+ if(_verify.endsWith("true") && _key.includes(_verify.replace("true",""))){
+ config.value.editorConfig.mode="edit"
}
+
}
})
diff --git a/src/views/doc/recentVisited.vue b/src/views/doc/recentVisited.vue
index 447f9e5..b700af9 100644
--- a/src/views/doc/recentVisited.vue
+++ b/src/views/doc/recentVisited.vue
@@ -24,9 +24,9 @@ const props = withDefaults(defineProps<{
function onlyOfficeView(row:shareItem){
const _type=fileType(row.name!)
if(_type!==""){ //office file
- const info =btoa(encodeURIComponent(`${row.userUuid}/root${row.matters[0].path}`))
+ const info =btoa(encodeURIComponent(`${row.name}`))
const _url=`${siteHost}${apiURL}/share/zip?shareUuid=${row.uuid}&code=${row.code}&uid=${props.uid}&dprt=${props.udprt}&puuid=root&rootUuid=root`
- window.open(`/#/onlyoffice?name=${row.name}&dtype=${_type}&info=${info}&fileurl=`+encodeURIComponent(_url),"_blank")
+ window.open(`/#/onlyoffice?name=${row.name}&dtype=${_type}&info=${info}&fileurl=`+window.btoa(encodeURIComponent(_url)),"_blank")
}else{
//by kkFilePreview
let a = row.name ?? '';
diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue
index 6b2d789..de14972 100644
--- a/src/views/doc/space.vue
+++ b/src/views/doc/space.vue
@@ -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(){
-
[ {{ props.spacename }} ] :
@@ -613,7 +641,7 @@ function isOwner(){
-
+
-
AI
+
+
+ 改
+
@@ -678,10 +709,13 @@ function isOwner(){
@@ -691,7 +725,6 @@ function isOwner(){
{paginInfo.page=value-1;onLoadMatterList();}" :page-count="paginInfo.total" class="mt-4"/>
-
@@ -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;