fix: Embedding mode issue fix

This commit is contained in:
wangdan-fit2cloud 2025-07-16 13:49:46 +08:00
parent 2fbeb4300f
commit 69ff7f9af4
14 changed files with 166 additions and 77 deletions

View File

@ -170,6 +170,16 @@ const getToolListPage: (
) )
} }
/**
*
*/
const getAllMemberList: (arg: string, loading?: Ref<boolean>) => Promise<Result<Record<string, any>[]>> = (
arg,
loading,
) => {
return get('/user/list', undefined, loading)
}
export default { export default {
getKnowledgeList, getKnowledgeList,
getKnowledgeListPage, getKnowledgeListPage,
@ -182,5 +192,6 @@ export default {
getToolList, getToolList,
getToolListPage, getToolListPage,
getUserGroupList, getUserGroupList,
getUserGroupUserList getUserGroupUserList,
getAllMemberList
} }

View File

@ -688,4 +688,29 @@ export default {
]) ])
}, },
}, },
'app-pdf-export': {
iconReader: () => {
return h('i', [
h(
'svg',
{
style: { height: '100%', width: '100%' },
viewBox: '0 0 20 20',
version: '1.1',
xmlns: 'http://www.w3.org/2000/svg',
},
[
h('path', {
d: 'M3.33366 5.83342V16.6667H16.667V10.8334H18.3337V17.5001C18.3337 17.9603 17.9606 18.3334 17.5003 18.3334H2.50033C2.04009 18.3334 1.66699 17.9603 1.66699 17.5001V5.00008C1.66699 4.53984 2.04009 4.16675 2.50033 4.16675H9.16699V5.83342H3.33366Z',
fill: 'currentColor',
}),
h('path', {
d: 'M18.3335 2.50008V8.33342H16.6668V4.51175L11.6876 9.49091C11.6095 9.56903 11.5035 9.61291 11.393 9.61291C11.2825 9.61291 11.1766 9.56903 11.0984 9.49091L10.5093 8.90175C10.4312 8.82361 10.3873 8.71765 10.3873 8.60716C10.3873 8.49668 10.4312 8.39072 10.5093 8.31258L15.4884 3.33341H11.6668V1.66675H17.5001C17.7211 1.66675 17.9331 1.75455 18.0894 1.91083C18.2457 2.06711 18.3335 2.27907 18.3335 2.50008Z',
fill: 'currentColor',
}),
],
),
])
},
},
} }

View File

@ -55,7 +55,7 @@ const showBack = computed(() => {
.collapse { .collapse {
position: absolute; position: absolute;
top: 36px; top: 36px;
right: -15px; right: -12px;
box-shadow: 0px 5px 10px 0px rgba(31, 35, 41, 0.1); box-shadow: 0px 5px 10px 0px rgba(31, 35, 41, 0.1);
z-index: 1; z-index: 1;
} }

View File

@ -21,30 +21,83 @@
<div style="width: 90%"> <div style="width: 90%">
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p> <p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
<template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0"> <template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0">
<TagGroup size="small" :tags="user.userInfo?.role_name" <TagGroup
size="small"
:tags="user.userInfo?.role_name"
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')" v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
/> />
</template> </template>
</div> </div>
</div> </div>
<el-dropdown-item class="border-t p-8" @click="openResetPassword" <el-dropdown-item class="border-t"
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER], @click="router.push({ path: `/system/user` })"
v-if="
hasPermission(
[
RoleConst.EXTENDS_ADMIN,
RoleConst.EXTENDS_WORKSPACE_MANAGE,
RoleConst.ADMIN,
RoleConst.WORKSPACE_MANAGE,
],
'OR',
)
"
>
<div class="flex-between w-full">
{{ $t('views.system.title') }}
<AppIcon iconName="app-go"></AppIcon>
</div>
</el-dropdown-item>
<el-dropdown-item
@click="openResetPassword"
v-if="
hasPermission(
new ComplexPermission(
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
[PermissionConst.CHANGE_PASSWORD], [PermissionConst.CHANGE_PASSWORD],
[],'OR'),'OR')" [],
'OR',
),
'OR',
)
"
> >
{{ $t('views.login.resetPassword') }} {{ $t('views.login.resetPassword') }}
</el-dropdown-item> </el-dropdown-item>
<div> <div>
<el-dropdown-item class="p-8" @click="openAPIKeyDialog" <el-dropdown-item
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN],[PermissionConst.SYSTEM_API_KEY_EDIT], class="p-8"
[EditionConst.IS_EE,EditionConst.IS_PE],'OR'),'OR')" @click="openAPIKeyDialog"
v-if="
hasPermission(
new ComplexPermission(
[RoleConst.ADMIN],
[PermissionConst.SYSTEM_API_KEY_EDIT],
[EditionConst.IS_EE, EditionConst.IS_PE],
'OR',
),
'OR',
)
"
> >
{{ $t('layout.apiKey') }} {{ $t('layout.apiKey') }}
</el-dropdown-item> </el-dropdown-item>
</div> </div>
<el-dropdown-item style="padding: 0" @click.stop <el-dropdown-item
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER], style="padding: 0"
[PermissionConst.SWITCH_LANGUAGE],[],'OR'),'OR')" @click.stop
v-if="
hasPermission(
new ComplexPermission(
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
[PermissionConst.SWITCH_LANGUAGE],
[],
'OR',
),
'OR',
)
"
> >
<el-dropdown class="w-full" trigger="hover" placement="left-start"> <el-dropdown class="w-full" trigger="hover" placement="left-start">
<div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px"> <div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px">
@ -78,22 +131,13 @@
</template> </template>
</el-dropdown> </el-dropdown>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="openAbout" <el-dropdown-item
@click="openAbout"
v-if="hasPermission([RoleConst.ADMIN, PermissionConst.ABOUT_READ], 'OR')" v-if="hasPermission([RoleConst.ADMIN, PermissionConst.ABOUT_READ], 'OR')"
> >
{{ $t('layout.about.title') }} {{ $t('layout.about.title') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="router.push({ path: `/system/user` })"
v-if="hasPermission([RoleConst.EXTENDS_ADMIN, RoleConst.EXTENDS_WORKSPACE_MANAGE,
RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],'OR')"
>
<div class="flex-between w-full">
{{ $t('views.system.title') }}
<AppIcon iconName="app-go"></AppIcon>
</div>
</el-dropdown-item>
<el-dropdown-item class="border-t" @click="logout"> <el-dropdown-item class="border-t" @click="logout">
{{ $t('layout.logout') }} {{ $t('layout.logout') }}
</el-dropdown-item> </el-dropdown-item>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="login-form-container"> <div class="login-form-container p-24">
<div class="login-title"> <div class="login-title">
<div class="logo text-center"> <div class="logo text-center">
<slot name="logo"> <slot name="logo">
@ -25,6 +25,7 @@ defineProps({
.login-form-container { .login-form-container {
width: 480px; width: 480px;
.login-title { .login-title {
margin-bottom: 32px; margin-bottom: 32px;
.sub-title { .sub-title {

View File

@ -36,7 +36,7 @@
:canOperation="false" :canOperation="false"
showShared showShared
:shareTitle="$t('views.shared.shared_knowledge')" :shareTitle="$t('views.shared.shared_knowledge')"
:treeStyle="{ height: 'calc(100vh - 320px)' }" :treeStyle="{ height: 'calc(100vh - 240px)' }"
/> />
</div> </div>
</template> </template>
@ -250,7 +250,7 @@ defineExpose({ open })
} }
.el-dialog__headerbtn { .el-dialog__headerbtn {
top: 3px; top: 2px;
right: 6px; right: 6px;
} }
} }

View File

@ -18,10 +18,11 @@ const FormRef = ref()
const { chatUser } = useStore() const { chatUser } = useStore()
const loading = ref<boolean>(false) const loading = ref<boolean>(false)
const router = useRouter() const router = useRouter()
const route = useRoute()
const auth = () => { const auth = () => {
return chatUser.passwordAuthentication(form.value.password).then((ok) => { return chatUser.passwordAuthentication(form.value.password).then((ok) => {
router.push({ name: 'chat', params: { accessToken: chatUser.accessToken } }) router.push({ name: 'chat', params: { accessToken: chatUser.accessToken }, query: route.query })
}) })
} }
const validator_auth = (rule: any, value: string, callback: any) => { const validator_auth = (rule: any, value: string, callback: any) => {

View File

@ -7,7 +7,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue' import { computed } from 'vue'
import { isAppIcon } from '@/utils/common'
const auth_components: any = import.meta.glob('@/views/chat/auth/component/*.vue', { const auth_components: any = import.meta.glob('@/views/chat/auth/component/*.vue', {
eager: true, eager: true,

View File

@ -23,6 +23,8 @@ const {
query: { mode }, query: { mode },
} = route as any } = route as any
console.log(mode)
const currentTemplate = computed(() => { const currentTemplate = computed(() => {
let modeName = '' let modeName = ''
if (chatUser.application) { if (chatUser.application) {

View File

@ -183,7 +183,7 @@
:title="rightPanelDetail?.document_name?.trim()" :title="rightPanelDetail?.document_name?.trim()"
> >
<el-button text> <el-button text>
<el-icon> <Download /> </el-icon> <AppIcon iconName="app-pdf-export" class="cursor"></AppIcon>
</el-button> </el-button>
</a> </a>
</span> </span>

View File

@ -16,7 +16,10 @@
</template> </template>
<KnowledgeListContainer @refreshFolder="refreshFolder"> <KnowledgeListContainer @refreshFolder="refreshFolder">
<template #header> <template #header>
<FolderBreadcrumb :folderList="folderList" @click="folderClickHandle" /> <h2 v-if="folder.currentFolder?.id === 'share'">
{{ $t('views.shared.shared_knowledge') }}
</h2>
<FolderBreadcrumb :folderList="folderList" @click="folderClickHandle" v-else />
</template> </template>
</KnowledgeListContainer> </KnowledgeListContainer>
</LayoutContainer> </LayoutContainer>

View File

@ -17,7 +17,7 @@
v-model="search" v-model="search"
:validate-event="false" :validate-event="false"
:placeholder="$t('common.search')" :placeholder="$t('common.search')"
style="width: 364px; padding: 16px 16px 0 16px;" style="width: 364px; padding: 16px 16px 0 16px"
clearable clearable
> >
<template #prefix> <template #prefix>
@ -29,7 +29,7 @@
<div class="mt-8"> <div class="mt-8">
<el-checkbox <el-checkbox
class="mb-8" class="mb-8"
style="margin-left: 16px;" style="margin-left: 16px"
v-model="checkAll" v-model="checkAll"
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
@change="handleCheckAllChange" @change="handleCheckAllChange"

View File

@ -46,7 +46,8 @@
<div class="flex-between"> <div class="flex-between">
<div class="flex"> <div class="flex">
<span class="mr-8">{{ row.nick_name }}</span> <span class="mr-8">{{ row.nick_name }}</span>
<TagGroup :tags="row.roles" <TagGroup
:tags="row.roles"
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')" v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
/> />
</div> </div>
@ -315,21 +316,21 @@ const dfsPermissionIndeterminate = (
if (item.isFolder) { if (item.isFolder) {
// //
const hasPermissions = permissionHalfMap[item.id][type]; const hasPermissions = permissionHalfMap[item.id][type]
const allTrue = hasPermissions.length && hasPermissions.every((p: boolean) => p); const allTrue = hasPermissions.length && hasPermissions.every((p: boolean) => p)
const allFalse = hasPermissions.length && hasPermissions.every((p: boolean) => !p); const allFalse = hasPermissions.length && hasPermissions.every((p: boolean) => !p)
// //
item.permissionHalf[type] = hasPermissions.length && !allTrue && !allFalse; item.permissionHalf[type] = hasPermissions.length && !allTrue && !allFalse
// //
if (item.children.some((ele: any) => ele.isFolder && ele.permissionHalf[type])) { if (item.children.some((ele: any) => ele.isFolder && ele.permissionHalf[type])) {
item.permissionHalf[type] = true; item.permissionHalf[type] = true
} }
// //
if (allTrue) { if (allTrue) {
item.permission[type] = true; item.permission[type] = true
item.permissionHalf[type] = false item.permissionHalf[type] = false
} }
@ -406,7 +407,6 @@ const getWholeTree = async (user_id: string) => {
dfsPermissionIndeterminateTrue(folderTree, ele) dfsPermissionIndeterminateTrue(folderTree, ele)
dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default') dfsPermissionIndeterminate(folderTree, ele, cloneDeep(permissionHalf), {}, 'default')
}) })
if (activeData.value.type === AuthorizationEnum.MODEL) { if (activeData.value.type === AuthorizationEnum.MODEL) {
activeData.value.data = folderTree[0].children activeData.value.data = folderTree[0].children
} else { } else {

View File

@ -16,7 +16,10 @@
</template> </template>
<ToolListContainer @refreshFolder="refreshFolder"> <ToolListContainer @refreshFolder="refreshFolder">
<template #header> <template #header>
<FolderBreadcrumb :folderList="folderList" @click="folderClickHandle" /> <h2 v-if="folder.currentFolder?.id === 'share'">
{{ $t('views.shared.shared_tool') }}
</h2>
<FolderBreadcrumb :folderList="folderList" @click="folderClickHandle" v-else />
</template> </template>
</ToolListContainer> </ToolListContainer>
</LayoutContainer> </LayoutContainer>