mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: add isShared parameter to loadSharedApi calls in ParagraphCard, SelectDocumentDialog, and index components
This commit is contained in:
parent
e458236455
commit
9d1149b5ca
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -37,8 +37,13 @@ const props = defineProps<{
|
|||
const route = useRoute()
|
||||
const {
|
||||
params: { id, documentId }, // id为knowledgeID
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue