diff --git a/ui/src/api/shared-workspace.ts b/ui/src/api/shared-workspace.ts index ced713de3..1aa81bf83 100644 --- a/ui/src/api/shared-workspace.ts +++ b/ui/src/api/shared-workspace.ts @@ -33,6 +33,76 @@ const getKnowledgeListPage: ( ) } +/** + * 知识库详情 + * @param 参数 knowledge_id + */ +const getKnowledgeDetail: (knowledge_id: string, loading?: Ref) => Promise> = ( + knowledge_id, + loading, +) => { + return get(`${prefix}/${prefix_workspace.value}/knowledge/${knowledge_id}`, undefined, loading) +} + +/** + * 文档分页列表 + * @param 参数 knowledge_id, + * param { + "name": "string", + folder_id: "string", + } + */ + +const getDocumentPage: ( + knowledge_id: string, + page: pageRequest, + param: any, + loading?: Ref, +) => Promise> = (knowledge_id, page, param, loading) => { + return get( + `${prefix}/${prefix_workspace.value}/knowledge/${knowledge_id}/document/${page.current_page}/${page.page_size}`, + param, + loading, + ) +} + +/** + * 文档详情 + * @param 参数 knowledge_id + */ +const getDocumentDetail: ( + knowledge_id: string, + document_id: string, + loading?: Ref, +) => Promise> = (knowledge_id, document_id, loading) => { + return get(`${prefix}/${prefix_workspace.value}/knowledge/${knowledge_id}/document/${document_id}`, + {}, + loading,) +} + +/** + * 段落分页列表 + * @param 参数 knowledge_id document_id + * param { + "title": "string", + "content": "string", + } + */ +const getParagraphPage: ( + knowledge_id: string, + document_id: string, + page: pageRequest, + param: any, + loading?: Ref, +) => Promise> = (knowledge_id, document_id, page, param, loading) => { + return get( + `${prefix}/${prefix_workspace.value}/knowledge/${knowledge_id}/document/${document_id}/paragraph/${page.current_page}/${page.page_size}`, + param, + loading, + ) +} + + const getModelList: ( param: any, loading?: Ref, @@ -57,6 +127,10 @@ const getToolListPage: ( export default { getKnowledgeList, getKnowledgeListPage, + getKnowledgeDetail, + getDocumentPage, + getDocumentDetail, + getParagraphPage, getModelList, getToolList, getToolListPage diff --git a/ui/src/api/shared-workspace/knowledge.ts b/ui/src/api/shared-workspace/knowledge.ts deleted file mode 100644 index 8c75092ea..000000000 --- a/ui/src/api/shared-workspace/knowledge.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Result } from '@/request/Result' -import { get, post, del, put, exportFile, exportExcel } from '@/request/index' -import { type Ref } from 'vue' -import type { pageRequest } from '@/api/type/common' -import type { knowledgeData } from '@/api/type/knowledge' - -import useStore from '@/stores' -const prefix: any = { _value: '/system/shared/knowledge/' } -Object.defineProperty(prefix, 'value', { - get: function () { - const { user } = useStore() - return this._value + user.getWorkspaceId() - }, -}) - -/** - * 知识库列表(无分页) - * @param 参数 - * param { - folder_id: "string", - name: "string", - tool_type: "string", - desc: string, - } - */ -const getKnowledgeList: (param?: any, loading?: Ref) => Promise> = ( - param, - loading, -) => { - return get(`${prefix.value}`, param, loading) -} - -/** - * 知识库分页列表 - * @param 参数 - * param { - "folder_id": "string", - "name": "string", - "tool_type": "string", - desc: string, - } - */ -const getKnowledgeListPage: ( - page: pageRequest, - param?: any, - loading?: Ref, -) => Promise> = (page, param, loading) => { - return get(`${prefix.value}/${page.current_page}/${page.page_size}`, param, loading) -} - -/** - * 知识库详情 - * @param 参数 knowledge_id - */ -const getKnowledgeDetail: (knowledge_id: string, loading?: Ref) => Promise> = ( - knowledge_id, - loading, -) => { - return get(`${prefix.value}/${knowledge_id}`, undefined, loading) -} - -export default { - getKnowledgeList, - getKnowledgeListPage, - getKnowledgeDetail, -} diff --git a/ui/src/layout/components/breadcrumb/index.vue b/ui/src/layout/components/breadcrumb/index.vue index ef2c80fe8..db438a064 100644 --- a/ui/src/layout/components/breadcrumb/index.vue +++ b/ui/src/layout/components/breadcrumb/index.vue @@ -35,7 +35,8 @@ const route = useRoute() const { meta: { activeMenu }, - params: { id }, + params: { id, folderId }, + query: { isShared }, } = route as any const apiType = computed(() => { @@ -48,6 +49,10 @@ const apiType = computed(() => { } }) +const shareDisabled = computed(() => { + return folderId === 'share' || isShared === 'true' +}) + onBeforeRouteLeave((to, from) => { common.saveBreadcrumb(null) }) @@ -75,7 +80,7 @@ const toBackPath = computed(() => { function getKnowledgeDetail() { loading.value = true - loadSharedApi({ type: 'knowledge', systemType: apiType.value }) + loadSharedApi({ type: 'knowledge', isShared: shareDisabled.value, systemType: apiType.value }) .getKnowledgeDetail(id) .then((res: any) => { current.value = res.data diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss index 7b77ff934..848bd0886 100644 --- a/ui/src/styles/app.scss +++ b/ui/src/styles/app.scss @@ -218,6 +218,9 @@ h5 { .p-8-12 { padding: calc(var(--app-base-px)) calc(var(--app-base-px) + 4px); } +.p-8-16 { + padding: calc(var(--app-base-px)) calc(var(--app-base-px) * 2); +} .p-12-16 { padding: calc(var(--app-base-px) + 4px) calc(var(--app-base-px) * 2); } diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index 989147eb4..431ec5b51 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -1066,7 +1066,7 @@ function getList(bool?: boolean) { } function getDetail() { - loadSharedApi({ type: 'knowledge', systemType: apiType.value }) + loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value }) .getKnowledgeDetail(id, loading) .then((res: any) => { knowledgeDetail.value = res.data diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index aadeb4d16..138b291d0 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -275,7 +275,7 @@ function addParagraph() { } function getDetail() { - loadSharedApi({ type: 'document', systemType: apiType.value }) + loadSharedApi({ type: 'document', isShared: shareDisabled.value, systemType: apiType.value }) .getDocumentDetail(id, documentId, loading) .then((res: any) => { documentDetail.value = res.data @@ -283,7 +283,7 @@ function getDetail() { } function getParagraphList() { - loadSharedApi({ type: 'paragraph', systemType: apiType.value }) + loadSharedApi({ type: 'paragraph', isShared: shareDisabled.value, systemType: apiType.value }) .getParagraphPage( id, documentId, diff --git a/ui/src/views/system-chat-user/group/index.vue b/ui/src/views/system-chat-user/group/index.vue index 627de2239..ca45b7f78 100644 --- a/ui/src/views/system-chat-user/group/index.vue +++ b/ui/src/views/system-chat-user/group/index.vue @@ -8,9 +8,9 @@
-
-
-
+
+
+

{{ $t('views.chatUser.group.title') }}

- - + + +
diff --git a/ui/src/views/system/resource-authorization/index.vue b/ui/src/views/system/resource-authorization/index.vue index 10b758132..8a21f0f2f 100644 --- a/ui/src/views/system/resource-authorization/index.vue +++ b/ui/src/views/system/resource-authorization/index.vue @@ -23,8 +23,8 @@
-
-
+
+

{{ $t('views.resourceAuthorization.member') }}

- - + +
diff --git a/ui/src/views/system/role/index.vue b/ui/src/views/system/role/index.vue index 30e22ffdb..ab4bbf26f 100644 --- a/ui/src/views/system/role/index.vue +++ b/ui/src/views/system/role/index.vue @@ -26,7 +26,7 @@ @mouseleave="mouseId = ''" >