feat: update folder_id retrieval to use workspace ID in knowledge list loading

--bug=1057585 --user=刘瑞斌 【知识库】文档 、文档分段 迁移报错,知识库下拉框无数据 https://www.tapd.cn/62980211/s/1719493
This commit is contained in:
CaptainB 2025-06-27 11:12:54 +08:00
parent 86ee4598ee
commit 8bc776af2b

View File

@ -81,12 +81,15 @@ import { useRoute } from 'vue-router'
import type { FormInstance, FormRules } from 'element-plus'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
import { t } from '@/locales'
import useStore from "@/stores";
const route = useRoute()
const {
params: { id, documentId }, // idknowledgeID
} = route as any
const { user } = useStore()
const apiType = computed(() => {
if (route.path.includes('shared')) {
return 'systemShare'
@ -143,9 +146,9 @@ const defaultProps = {
const loadTree = (node: any, resolve: any) => {
if (node.isLeaf) return resolve([])
const folder_id = node.level === 0 ? '' : node.data.id
const folder_id = node.level === 0 ? user.getWorkspaceId() : node.data.id
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
.getKnowledgeList(folder_id, optionLoading)
.getKnowledgeList({folder_id: folder_id}, optionLoading)
.then((res: any) => {
resolve(res.data)
})