|
|
|
@ -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[]) => { |
|
|
|
<template #default="{ node, data }"> |
|
|
|
<div class="tree-item"> |
|
|
|
<span>{{ node.label }}</span> |
|
|
|
<el-button size="small" :icon="Delete" circle @click="(e)=>{ e.stopPropagation(); onDelMatter(data)}"></el-button> |
|
|
|
<el-dropdown> |
|
|
|
<el-button size="small" :icon="Setting" circle ></el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onDelNodeMatter(data)}">删除</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onMatterRename(data)}">重命名</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-tree> |
|
|
|
@ -851,9 +884,11 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
<el-button size="small" :icon="Setting" circle ></el-button> |
|
|
|
<template #dropdown> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onAccessManage(data)}">成员管理</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onSpacePManage(data)}">权限管理</el-dropdown-item> |
|
|
|
<el-dropdown-item v-if="!data.puuid" @click="(e)=>{ e.stopPropagation(); onAccessManage()}">成员管理</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onSpacePManage(data)}">权限管理</el-dropdown-item> |
|
|
|
<el-dropdown-item v-if="data.puuid" @click="(e)=>{ e.stopPropagation(); onAiAgent(data)}">创建智能体</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onDelSpaceMatter(data)}">删除</el-dropdown-item> |
|
|
|
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); spaceEleRef.onSpaceMatterRename(data)}">重命名</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</template> |
|
|
|
</el-dropdown> |
|
|
|
@ -936,7 +971,7 @@ const handleSelectionChange = (val:matterInfo[]) => { |
|
|
|
<template #default="scope"> |
|
|
|
<div v-show="currentHoverRow === scope.row.uuid"> |
|
|
|
<span v-if="scope.row.deleted"> |
|
|
|
<el-button size="small" :icon="View" circle @click="restoreMatter(scope.row)"></el-button> |
|
|
|
<el-button type="text" @click="restoreMatter(scope.row)">恢复</el-button> |
|
|
|
</span> |
|
|
|
<span v-else> |
|
|
|
<el-button size="small" :icon="View" circle @click="onPrivateView(scope.row)"></el-button> |
|
|
|
|