Browse Source

云盘:修改文件名

space2
han2015 2 months ago
parent
commit
f5130b5dc9
  1. 16
      src/api/doc/space.ts
  2. 14
      src/views/doc/agent.vue
  3. 20
      src/views/doc/manage.vue
  4. 4
      src/views/doc/onlyoffice.vue
  5. 4
      src/views/doc/recentVisited.vue
  6. 52
      src/views/doc/space.vue

16
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
});
}
/** /**
* *
*/ */

14
src/views/doc/agent.vue

@ -244,10 +244,12 @@ onMounted(() => {
<div v-else class="t_resp"> <div v-else class="t_resp">
<el-text style="white-space: pre-line" v-html="msg.think"></el-text> <el-text style="white-space: pre-line" v-html="msg.think"></el-text>
<VueMarkdown :markdown="msg.content" :rehype-plugins="[rehypeRaw]" :remark-plugins="[remarkGfm]" ></VueMarkdown> <VueMarkdown :markdown="msg.content" :rehype-plugins="[rehypeRaw]" :remark-plugins="[remarkGfm]" ></VueMarkdown>
<div v-if="msg.docinfo" class="doc_ref"> <div v-if="msg.docinfo?.length>0" class="doc_ref">
引用<hr> 引用<hr>
<el-tooltip v-for="doc in msg.docinfo" placement="top" effect="dark" <el-tooltip v-for="doc in msg.docinfo" placement="top" effect="dark">
:content="formatRefContent(doc.content)"> <template #content>
<div v-html="formatRefContent(doc.content)" />
</template>
<span>{{doc.document_name}}</span> <span>{{doc.document_name}}</span>
</el-tooltip> </el-tooltip>
</div> </div>
@ -389,6 +391,12 @@ onMounted(() => {
} }
ol{ ol{
margin-left: 14px; margin-left: 14px;
ul{
margin-left: 30px;
li{
list-style: disc;
}
}
} }
ol>li{ ol>li{
list-style-type: decimal; list-style-type: decimal;

20
src/views/doc/manage.vue

@ -254,10 +254,12 @@ function onMatterRename(row:matterInfo){
}, },
}), }),
}).then(() => { }).then(() => {
if(newname.value&&newname.value!=""){
postMatterRename(uid,{ postMatterRename(uid,{
uuid:row.uuid, uuid:row.uuid,
name:newname.value, name:newname.value,
}).then(()=>onLoadMatterList()) }).then(()=>onLoadMatterList())
}
}) })
} }
@ -841,7 +843,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
</el-button-group> </el-button-group>
</el-row> </el-row>
<el-row :gutter="24" style="overflow-y: auto;"> <el-row :gutter="24" style="overflow-y: auto; height: 90%;">
<el-table v-if="modListOrGrild" <el-table v-if="modListOrGrild"
stripe stripe
:data="matterList" :data="matterList"
@ -865,7 +867,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="250" align="center"> <el-table-column width="360" align="center">
<template #default="scope"> <template #default="scope">
<div v-show="currentHoverRow === scope.row.name"> <div v-show="currentHoverRow === scope.row.name">
<!-- <el-button size="small" :icon="Promotion" circle ></el-button> --> <!-- <el-button size="small" :icon="Promotion" circle ></el-button> -->
@ -874,6 +876,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
<el-button size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button> <el-button size="small" :icon="Download" circle @click="onDownload(scope.row)"></el-button>
<el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></el-button> <el-button size="small" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></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" circle @click="onMatterRename(scope.row)"></el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -902,10 +905,11 @@ const handleSelectionChange = (val:matterInfo[]) => {
</div> </div>
<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 size="small" :icon="Share" @click="onShareMatter(row)">分享</li> <li @click="onShareMatter(row)">分享</li>
<li size="small" :icon="Download" @click="onDownload(row)">下载</li> <li @click="onDownload(row)">下载</li>
<li size="small" :icon="Edit" @click="onlyOfficeEdit(row)">编辑</li> <li @click="onlyOfficeEdit(row)">编辑</li>
<li size="small" :icon="Delete" @click="onDelMatter(row)">删除</li> <li @click="onDelMatter(row)">删除</li>
<li @click="onMatterRename(row)">重命名</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -1002,12 +1006,13 @@ const handleSelectionChange = (val:matterInfo[]) => {
.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: 145px;
margin: 5px; margin: 5px;
.grid-box{ .grid-box{
height: 150px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
@ -1023,6 +1028,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
line-height: 27px; line-height: 27px;
text-align: center; text-align: center;
color: #878989; color: #878989;
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;

4
src/views/doc/onlyoffice.vue

@ -53,8 +53,8 @@ onMounted(()=>{
const _url=decodeURIComponent(window.atob(query.fileurl)) const _url=decodeURIComponent(window.atob(query.fileurl))
const name=query.name?.toString()??"" const name=query.name?.toString()??""
const dtype=query.dtype?.toString()??"word" const dtype=query.dtype?.toString()??"word"
// //
if (_info.includes(name)){
config.value.document.url=_url config.value.document.url=_url
config.value.document.title=name config.value.document.title=name
const _key=_url.match(/(\w+-\w+-\w+)/)![0] const _key=_url.match(/(\w+-\w+-\w+)/)![0]
@ -68,7 +68,7 @@ onMounted(()=>{
if(_verify.endsWith("true") && _key.includes(_verify.replace("true",""))){ if(_verify.endsWith("true") && _key.includes(_verify.replace("true",""))){
config.value.editorConfig.mode="edit" config.value.editorConfig.mode="edit"
} }
}
} }
}) })

4
src/views/doc/recentVisited.vue

@ -24,9 +24,9 @@ const props = withDefaults(defineProps<{
function onlyOfficeView(row:shareItem){ function onlyOfficeView(row:shareItem){
const _type=fileType(row.name!) const _type=fileType(row.name!)
if(_type!==""){ //office file 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` 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{ }else{
//by kkFilePreview //by kkFilePreview
let a = row.name ?? ''; let a = row.name ?? '';

52
src/views/doc/space.vue

@ -9,7 +9,7 @@ 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,
@ -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" // @cell-dblclick="handleDoubleClick"
// //
@ -468,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("当前路径没有智能体")
@ -567,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;">
@ -613,7 +641,7 @@ function isOwner(){
</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="modListOrGrild" <el-table v-if="modListOrGrild"
stripe stripe
:data="matterList" :data="matterList"
@ -641,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>
@ -678,7 +709,10 @@ 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>
@ -691,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>
@ -718,12 +751,13 @@ function isOwner(){
.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;
@ -739,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;

Loading…
Cancel
Save