feat: add isShared parameter to loadSharedApi calls in ParagraphCard, SelectDocumentDialog, and index components
parent
e458236455
commit
9d1149b5ca
|
|
@ -169,9 +169,13 @@ const props = defineProps<{
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id, documentId },
|
params: { id, documentId },
|
||||||
query: { from },
|
query: { from, isShared },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
|
const shareDisabled = computed(() => {
|
||||||
|
return isShared === 'true'
|
||||||
|
})
|
||||||
|
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
return from as 'systemShare' | 'workspace' | 'systemManage'
|
return from as 'systemShare' | 'workspace' | 'systemManage'
|
||||||
})
|
})
|
||||||
|
|
@ -223,7 +227,7 @@ async function changeState(row: any) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function getDetail() {
|
function getDetail() {
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value, isShared: shareDisabled.value})
|
||||||
.getKnowledgeDetail(id, loading)
|
.getKnowledgeDetail(id, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
knowledgeDetail.value = res.data
|
knowledgeDetail.value = res.data
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,13 @@ const props = defineProps<{
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id, documentId }, // id为knowledgeID
|
params: { id, documentId }, // id为knowledgeID
|
||||||
|
query: { from, isShared },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
|
const shareDisabled = computed(() => {
|
||||||
|
return isShared === 'true'
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
const SelectKnowledgeDocumentRef = ref()
|
const SelectKnowledgeDocumentRef = ref()
|
||||||
const knowledgeDetail = ref<any>({})
|
const knowledgeDetail = ref<any>({})
|
||||||
|
|
@ -80,7 +85,7 @@ const submitForm = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDetail() {
|
function getDetail() {
|
||||||
loadSharedApi({ type: 'knowledge', systemType: props.apiType })
|
loadSharedApi({ type: 'knowledge', systemType: props.apiType, isShared: shareDisabled.value })
|
||||||
.getKnowledgeDetail(id, loading)
|
.getKnowledgeDetail(id, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
knowledgeDetail.value = res.data
|
knowledgeDetail.value = res.data
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ function getDetail() {
|
||||||
documentDetail.value = res.data
|
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)
|
.getKnowledgeDetail(id, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
knowledgeDetail.value = res.data
|
knowledgeDetail.value = res.data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue