feat: add isShared parameter to loadSharedApi calls in ParagraphCard, SelectDocumentDialog, and index components

This commit is contained in:
CaptainB 2025-10-20 11:06:21 +08:00
parent e458236455
commit 9d1149b5ca
3 changed files with 13 additions and 4 deletions

View File

@ -169,9 +169,13 @@ const props = defineProps<{
const route = useRoute()
const {
params: { id, documentId },
query: { from },
query: { from, isShared },
} = route as any
const shareDisabled = computed(() => {
return isShared === 'true'
})
const apiType = computed(() => {
return from as 'systemShare' | 'workspace' | 'systemManage'
})
@ -223,7 +227,7 @@ async function changeState(row: any) {
})
}
function getDetail() {
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
loadSharedApi({ type: 'knowledge', systemType: apiType.value, isShared: shareDisabled.value})
.getKnowledgeDetail(id, loading)
.then((res: any) => {
knowledgeDetail.value = res.data

View File

@ -37,8 +37,13 @@ const props = defineProps<{
const route = useRoute()
const {
params: { id, documentId }, // idknowledgeID
query: { from, isShared },
} = route as any
const shareDisabled = computed(() => {
return isShared === 'true'
})
const emit = defineEmits(['refresh'])
const SelectKnowledgeDocumentRef = ref()
const knowledgeDetail = ref<any>({})
@ -80,7 +85,7 @@ const submitForm = async () => {
}
function getDetail() {
loadSharedApi({ type: 'knowledge', systemType: props.apiType })
loadSharedApi({ type: 'knowledge', systemType: props.apiType, isShared: shareDisabled.value })
.getKnowledgeDetail(id, loading)
.then((res: any) => {
knowledgeDetail.value = res.data

View File

@ -352,7 +352,7 @@ function getDetail() {
documentDetail.value = res.data
})
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
loadSharedApi({ type: 'knowledge', isShared: shareDisabled.value, systemType: apiType.value })
.getKnowledgeDetail(id, loading)
.then((res: any) => {
knowledgeDetail.value = res.data