diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue index 142923c..f489804 100644 --- a/src/views/doc/manage.vue +++ b/src/views/doc/manage.vue @@ -23,7 +23,7 @@ import preview from './preview.vue'; import space from './space.vue'; import spacePermission from './spacePermission.vue'; import SvgIcon from "@/components/SvgIcon/index.vue"; -import {doDelSpace,doAccessManage} from "@/api/doc/space" +import {doDelSpace,doAccessManage,doCreateAiagent} from "@/api/doc/space" import Space from "./space.vue"; //TODO: add file icons done! @@ -184,8 +184,12 @@ function showShareMessage(row:respCreateShare){ } //---------------------------------------- + +function onDelNodeMatter(row:matterInfo){ + onDelMatter(row,true) +} //删除 -function onDelMatter(row:matterInfo){ +function onDelMatter(row:matterInfo,dir?:boolean){ if (row.uuid){ ElMessageBox.confirm(`确认删除( ${row.name}) ?删除后不可恢复!取消则放弃删除操作。`, "警告", { confirmButtonText: "确定", @@ -195,11 +199,12 @@ function onDelMatter(row:matterInfo){ postDelMatter(uid,{ "uuid":row.uuid }).then(()=>{ - if (row.dir) { - currentNode.value.uuid = row.puuid ?? "" - currentNode.value.name = row.path ? row.path.replace(`/${row.name}`,'').match(/[^/]+$/g)?.pop() :"上级目录" - - treeRef.value.remove(row.uuid) + if (row.dir || dir) { + const node = treeRef.value.getNode(row.uuid) + if (node) { + treeRef.value.remove(node) + } + currentNode.value.uuid = row.puuid ?? "root" } onLoadMatterList() }) @@ -298,7 +303,7 @@ function showRecycling(){ }) } //恢复删除文件 -function restoreMatter (row:matterInfo){ +function restoreMatter(row:matterInfo){ if (row.uuid){ ElMessageBox.confirm(`确认要恢复( ${row.name}) ?`, "警告", { confirmButtonText: "确定", @@ -774,6 +779,26 @@ function onSpacePManage(row:matterInfo){ }) } +//处理空间智能体创建 +function onAiAgent(row:matterInfo){ + if(row.agent){ + alert("当前目录已经是智能体目录") + return + } + + ElMessageBox.confirm(`确认创建智能体( ${row.name}) ?`, "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }).then(()=>{ + doCreateAiagent(uid,{ + space:SpaceID.value.uuid, + matter:row.uuid + }).then(()=>{ + router.replace({ query: { t: Date.now() } }) + }) + }) +} //------------------------------------------------------ //http://172.20.2.87:6010/api/alien/preview/5a10aaf6-396e-4d9a-7e87-3c5c8029d4db/123.png?ir=fill_100_100 @@ -826,7 +851,15 @@ const handleSelectionChange = (val:matterInfo[]) => { @@ -851,9 +884,11 @@ const handleSelectionChange = (val:matterInfo[]) => { @@ -936,7 +971,7 @@ const handleSelectionChange = (val:matterInfo[]) => { @@ -718,7 +693,7 @@ function isOwner(){
  • 下载
  • 编辑
  • -
  • 重命名
  • +
  • 重命名
  • 删除