|
|
@ -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,spaceMatterRename} from "@/api/doc/space" |
|
|
doAiTraining ,spaceMatterRename} from "@/api/doc/space" |
|
|
import { h } from 'vue' |
|
|
import { h } from 'vue' |
|
|
import { |
|
|
import { |
|
|
Delete, |
|
|
Delete, |
|
|
@ -151,7 +151,6 @@ function onDelMatter(row:matterInfo){ |
|
|
"space":props.spaceid, |
|
|
"space":props.spaceid, |
|
|
}).then(()=>{ |
|
|
}).then(()=>{ |
|
|
currentNode.value.uuid = row.puuid ?? "" |
|
|
currentNode.value.uuid = row.puuid ?? "" |
|
|
currentNode.value.name = row.path ? row.path.replace(`/${row.name}`,'').match(/[^/]+$/g)?.pop() :"上级目录" |
|
|
|
|
|
onLoadMatterList() |
|
|
onLoadMatterList() |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
@ -275,7 +274,7 @@ function onCreateDir(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//文件重命名 |
|
|
//文件重命名 |
|
|
function onMatterRename(row:matterInfo){ |
|
|
function onSpaceMatterRename(row:matterInfo){ |
|
|
const newname=ref(row.name) |
|
|
const newname=ref(row.name) |
|
|
ElMessageBox({ |
|
|
ElMessageBox({ |
|
|
title:"请输入新的文件名", |
|
|
title:"请输入新的文件名", |
|
|
@ -471,31 +470,7 @@ async function doCreateMultyDir(path:string,uuid:string){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//-------------------------AI section-------------- |
|
|
//-------------------------AI section-------------- |
|
|
//处理智能体创建 |
|
|
|
|
|
function onAiAgent(){ |
|
|
|
|
|
if(currentNode.value.uuid=="root"){ |
|
|
|
|
|
alert("根目录不支持创建智能体") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(currentNode.value.agent){ |
|
|
|
|
|
alert("当前目录已经是智能体目录") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm(`确认创建智能体( ${currentNode.value.name}) ?`, "警告", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}).then(()=>{ |
|
|
|
|
|
doCreateAiagent(props.uid,{ |
|
|
|
|
|
space:props.spaceid, |
|
|
|
|
|
matter:currentNode.value.uuid |
|
|
|
|
|
}).then(()=>{ |
|
|
|
|
|
router.replace({ query: { t: Date.now() } }) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
function handleAiUpload(info:matterInfo){ |
|
|
function handleAiUpload(info:matterInfo){ |
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
//只有当前路径是智能体,上传文件才会进行训练 |
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
if (info.path?.startsWith(currentAgent.value.path)){ |
|
|
@ -594,7 +569,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
tabSelected.value = val |
|
|
tabSelected.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
defineExpose({handleDoubleClick,onDelMatter}) |
|
|
defineExpose({handleDoubleClick,onDelMatter,onSpaceMatterRename}) |
|
|
|
|
|
|
|
|
//判断是不是空间的所有者 |
|
|
//判断是不是空间的所有者 |
|
|
function isOwner(){ |
|
|
function isOwner(){ |
|
|
@ -639,9 +614,9 @@ function isOwner(){ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-button style="margin-left: auto;" @click="()=>currentAgent.model=true">AI助手</el-button> |
|
|
<el-button style="margin-left: auto;" @click="()=>currentAgent.model=true">AI助手</el-button> |
|
|
|
|
|
|
|
|
<el-button-group v-if="isOwner()" class="control" style="margin: 0 10px;"> |
|
|
<!-- <el-button-group v-if="isOwner()" class="control" style="margin: 0 10px;"> |
|
|
<el-button :icon="Plus" @click="onAiAgent">创建智能体</el-button> |
|
|
<el-button :icon="Plus" @click="onAiAgent">创建智能体</el-button> |
|
|
</el-button-group> |
|
|
</el-button-group> --> |
|
|
<el-button-group style="margin-right:20px;"> |
|
|
<el-button-group style="margin-right:20px;"> |
|
|
<el-button :icon="List" @click="updateListOrGrid(true)"></el-button> |
|
|
<el-button :icon="List" @click="updateListOrGrid(true)"></el-button> |
|
|
<el-button :icon="Grid" @click="updateListOrGrid(false)"></el-button> |
|
|
<el-button :icon="Grid" @click="updateListOrGrid(false)"></el-button> |
|
|
@ -683,7 +658,7 @@ function isOwner(){ |
|
|
</span> |
|
|
</span> |
|
|
<span v-if="scope.row.permitVal>=PERMITS.EDIT" class="manager_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" :icon="Edit" circle @click="onlyOfficeEdit(scope.row)"></el-button> |
|
|
<el-button size="small" circle @click="onMatterRename(scope.row)">改</el-button> |
|
|
<el-button size="small" circle @click="onSpaceMatterRename(scope.row)">改</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
@ -718,7 +693,7 @@ function isOwner(){ |
|
|
<li v-if="row.permitVal! >= PERMITS.DOWNLOAD" @click="onDownload(row)">下载</li> |
|
|
<li v-if="row.permitVal! >= PERMITS.DOWNLOAD" @click="onDownload(row)">下载</li> |
|
|
<span v-if="row.permitVal! >= PERMITS.EDIT" > |
|
|
<span v-if="row.permitVal! >= PERMITS.EDIT" > |
|
|
<li @click="onlyOfficeEdit(row)">编辑</li> |
|
|
<li @click="onlyOfficeEdit(row)">编辑</li> |
|
|
<li @click="onMatterRename(row)">重命名</li> |
|
|
<li @click="onSpaceMatterRename(row)">重命名</li> |
|
|
</span> |
|
|
</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> |
|
|
|