feat: bugs
This commit is contained in:
parent
0eeb79a977
commit
cc20e20f61
@ -59,7 +59,7 @@
|
|||||||
import { ref, watch, computed } from 'vue'
|
import { ref, watch, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import useStore from "@/stores";
|
import useStore from '@/stores'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id }, // id为knowledgeID
|
params: { id }, // id为knowledgeID
|
||||||
@ -90,18 +90,18 @@ const form = ref<any>({
|
|||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
isLeaf: (data: any) => data.resource_type && data.resource_type !== 'folder',
|
isLeaf: (data: any) =>
|
||||||
|
data.resource_type ? data.resource_type !== 'folder' : data.workspace_id === 'None',
|
||||||
disabled: (data: any, node: any) => {
|
disabled: (data: any, node: any) => {
|
||||||
return data.id === id
|
return data.id === id
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadTree = (node: any, resolve: any) => {
|
const loadTree = (node: any, resolve: any) => {
|
||||||
console.log(node)
|
|
||||||
if (node.isLeaf) return resolve([])
|
if (node.isLeaf) return resolve([])
|
||||||
const folder_id = node.level === 0 ? user.getWorkspaceId() : node.data.id
|
const folder_id = node.level === 0 ? user.getWorkspaceId() : node.data.id
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||||
.getKnowledgeList({folder_id: folder_id}, loading)
|
.getKnowledgeList({ folder_id: folder_id }, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -72,7 +72,11 @@
|
|||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
:apiType="apiType"
|
:apiType="apiType"
|
||||||
/>
|
/>
|
||||||
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
<SelectDocumentDialog
|
||||||
|
ref="SelectDocumentDialogRef"
|
||||||
|
@refresh="refreshMigrateParagraph"
|
||||||
|
:apiType="apiType"
|
||||||
|
/>
|
||||||
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -80,9 +80,12 @@ import { ref, watch, reactive, computed } from 'vue'
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
import useStore from '@/stores'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import useStore from "@/stores";
|
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
||||||
|
}>()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id, documentId }, // id为knowledgeID
|
params: { id, documentId }, // id为knowledgeID
|
||||||
@ -90,15 +93,6 @@ const {
|
|||||||
|
|
||||||
const { user } = useStore()
|
const { user } = useStore()
|
||||||
|
|
||||||
const apiType = computed(() => {
|
|
||||||
if (route.path.includes('shared')) {
|
|
||||||
return 'systemShare'
|
|
||||||
} else if (route.path.includes('resource-management')) {
|
|
||||||
return 'systemManage'
|
|
||||||
} else {
|
|
||||||
return 'workspace'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
|
||||||
@ -138,7 +132,8 @@ watch(dialogVisible, (bool) => {
|
|||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
isLeaf: (data: any) => data.resource_type && data.resource_type !== 'folder',
|
isLeaf: (data: any) =>
|
||||||
|
data.resource_type ? data.resource_type !== 'folder' : data.workspace_id === 'None',
|
||||||
disabled: (data: any, node: any) => {
|
disabled: (data: any, node: any) => {
|
||||||
return data.id === id
|
return data.id === id
|
||||||
},
|
},
|
||||||
@ -147,8 +142,8 @@ const defaultProps = {
|
|||||||
const loadTree = (node: any, resolve: any) => {
|
const loadTree = (node: any, resolve: any) => {
|
||||||
if (node.isLeaf) return resolve([])
|
if (node.isLeaf) return resolve([])
|
||||||
const folder_id = node.level === 0 ? user.getWorkspaceId() : node.data.id
|
const folder_id = node.level === 0 ? user.getWorkspaceId() : node.data.id
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
loadSharedApi({ type: 'knowledge', systemType: props.apiType })
|
||||||
.getKnowledgeList({folder_id: folder_id}, optionLoading)
|
.getKnowledgeList({ folder_id: folder_id }, optionLoading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
})
|
})
|
||||||
@ -160,7 +155,7 @@ function changeKnowledge(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDocument(id: string) {
|
function getDocument(id: string) {
|
||||||
loadSharedApi({ type: 'document', systemType: apiType.value })
|
loadSharedApi({ type: 'document', systemType: props.apiType })
|
||||||
.getDocumentList(id, optionLoading)
|
.getDocumentList(id, optionLoading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
documentList.value = res.data?.filter((v: any) => v.id !== documentId)
|
documentList.value = res.data?.filter((v: any) => v.id !== documentId)
|
||||||
@ -179,7 +174,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
const obj = {
|
const obj = {
|
||||||
id_list: paragraphList.value,
|
id_list: paragraphList.value,
|
||||||
}
|
}
|
||||||
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
loadSharedApi({ type: 'paragraph', systemType: props.apiType })
|
||||||
.putMigrateMulParagraph(
|
.putMigrateMulParagraph(
|
||||||
id,
|
id,
|
||||||
documentId,
|
documentId,
|
||||||
|
|||||||
@ -142,7 +142,11 @@
|
|||||||
:apiType="apiType"
|
:apiType="apiType"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
/>
|
/>
|
||||||
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
<SelectDocumentDialog
|
||||||
|
ref="SelectDocumentDialogRef"
|
||||||
|
@refresh="refreshMigrateParagraph"
|
||||||
|
:apiType="apiType"
|
||||||
|
/>
|
||||||
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user