Skip to content

Commit 9d1149b

Browse files
committed
feat: add isShared parameter to loadSharedApi calls in ParagraphCard, SelectDocumentDialog, and index components
1 parent e458236 commit 9d1149b

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

ui/src/views/paragraph/component/ParagraphCard.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,13 @@ const props = defineProps<{
169169
const route = useRoute()
170170
const {
171171
params: { id, documentId },
172-
query: { from },
172+
query: { from, isShared },
173173
} = route as any
174174
175+
const shareDisabled = computed(() => {
176+
return isShared === 'true'
177+
})
178+
175179
const apiType = computed(() => {
176180
return from as 'systemShare' | 'workspace' | 'systemManage'
177181
})
@@ -223,7 +227,7 @@ async function changeState(row: any) {
223227
})
224228
}
225229
function getDetail() {
226-
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
230+
loadSharedApi({ type: 'knowledge', systemType: apiType.value, isShared: shareDisabled.value})
227231
.getKnowledgeDetail(id, loading)
228232
.then((res: any) => {
229233
knowledgeDetail.value = res.data

ui/src/views/paragraph/component/SelectDocumentDialog.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ const props = defineProps<{
3737
const route = useRoute()
3838
const {
3939
params: { id, documentId }, // id为knowledgeID
40+
query: { from, isShared },
4041
} = route as any
4142
43+
const shareDisabled = computed(() => {
44+
return isShared === 'true'
45+
})
46+
4247
const emit = defineEmits(['refresh'])
4348
const SelectKnowledgeDocumentRef = ref()
4449
const knowledgeDetail = ref<any>({})
@@ -80,7 +85,7 @@ const submitForm = async () => {
8085
}
8186
8287
function getDetail() {
83-
loadSharedApi({ type: 'knowledge', systemType: props.apiType })
88+
loadSharedApi({ type: 'knowledge', systemType: props.apiType, isShared: shareDisabled.value })
8489
.getKnowledgeDetail(id, loading)
8590
.then((res: any) => {
8691
knowledgeDetail.value = res.data

ui/src/views/paragraph/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function getDetail() {
352352
documentDetail.value = res.data
353353
})
354354
355-
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
355+
loadSharedApi({ type: 'knowledge', isShared: shareDisabled.value, systemType: apiType.value })
356356
.getKnowledgeDetail(id, loading)
357357
.then((res: any) => {
358358
knowledgeDetail.value = res.data

0 commit comments

Comments
 (0)