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

@ -119,7 +119,7 @@ const getUserGroupUserList: (
}
/**
*
*
*/
const getUserGroupList: (resource: any, loading?: Ref<boolean>) => Promise<Result<ChatUserGroupItem[]>> = (resource, loading) => {
return get (`${prefix}/${prefix_workspace.value}/KNOWLEDGE/${resource.resource_id}/user_group`, undefined, loading)
@ -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 {
getKnowledgeList,
getKnowledgeListPage,
@ -182,5 +192,6 @@ export default {
getToolList,
getToolListPage,
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 {
position: absolute;
top: 36px;
right: -15px;
right: -12px;
box-shadow: 0px 5px 10px 0px rgba(31, 35, 41, 0.1);
z-index: 1;
}

View File

@ -21,30 +21,83 @@
<div style="width: 90%">
<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">
<TagGroup size="small" :tags="user.userInfo?.role_name"
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE],'OR')"
<TagGroup
size="small"
:tags="user.userInfo?.role_name"
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
/>
</template>
</div>
</div>
<el-dropdown-item class="border-t p-8" @click="openResetPassword"
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
<el-dropdown-item class="border-t"
@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],
[],'OR'),'OR')"
[],
'OR',
),
'OR',
)
"
>
{{ $t('views.login.resetPassword') }}
</el-dropdown-item>
<div>
<el-dropdown-item class="p-8" @click="openAPIKeyDialog"
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN],[PermissionConst.SYSTEM_API_KEY_EDIT],
[EditionConst.IS_EE,EditionConst.IS_PE],'OR'),'OR')"
<el-dropdown-item
class="p-8"
@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') }}
</el-dropdown-item>
</div>
<el-dropdown-item style="padding: 0" @click.stop
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
[PermissionConst.SWITCH_LANGUAGE],[],'OR'),'OR')"
<el-dropdown-item
style="padding: 0"
@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">
<div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px">
@ -78,22 +131,13 @@
</template>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item @click="openAbout"
v-if="hasPermission([RoleConst.ADMIN,PermissionConst.ABOUT_READ],'OR')"
<el-dropdown-item
@click="openAbout"
v-if="hasPermission([RoleConst.ADMIN, PermissionConst.ABOUT_READ], 'OR')"
>
{{ $t('layout.about.title') }}
</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">
{{ $t('layout.logout') }}
</el-dropdown-item>
@ -114,10 +158,10 @@ import ResetPassword from './ResetPassword.vue'
import AboutDialog from './AboutDialog.vue'
// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
import APIKeyDialog from './APIKeyDialog.vue'
import {ComplexPermission} from '@/utils/permission/type'
import {langList} from '@/locales/index'
import { ComplexPermission } from '@/utils/permission/type'
import { langList } from '@/locales/index'
import { hasPermission } from '@/utils/permission'
import { PermissionConst, RoleConst,EditionConst } from '@/utils/permission/data'
import { PermissionConst, RoleConst, EditionConst } from '@/utils/permission/data'
const { user, login } = useStore()
const router = useRouter()

View File

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

View File

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

View File

@ -18,10 +18,11 @@ const FormRef = ref()
const { chatUser } = useStore()
const loading = ref<boolean>(false)
const router = useRouter()
const route = useRoute()
const auth = () => {
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) => {

View File

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

View File

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

View File

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

View File

@ -16,7 +16,10 @@
</template>
<KnowledgeListContainer @refreshFolder="refreshFolder">
<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>
</KnowledgeListContainer>
</LayoutContainer>

View File

@ -17,7 +17,7 @@
v-model="search"
:validate-event="false"
:placeholder="$t('common.search')"
style="width: 364px; padding: 16px 16px 0 16px;"
style="width: 364px; padding: 16px 16px 0 16px"
clearable
>
<template #prefix>
@ -29,7 +29,7 @@
<div class="mt-8">
<el-checkbox
class="mb-8"
style="margin-left: 16px;"
style="margin-left: 16px"
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
@ -38,23 +38,23 @@
{{ $t('views.shared.allCheck') }}
</el-checkbox>
<el-scrollbar max-height="205" wrap-class="p-16 pt-0">
<el-checkbox-group
class="checkbox-group-block"
v-model="checkedWorkspace"
@change="handleCheckedWorkspaceChange"
>
<el-checkbox
v-for="space in workspaceWithKeywords"
:key="space.id"
:label="space.name"
:value="space"
<el-checkbox-group
class="checkbox-group-block"
v-model="checkedWorkspace"
@change="handleCheckedWorkspaceChange"
>
<div class="flex">
<AppIcon iconName="app-workspace"></AppIcon>
<span class="ml-4 ellipsis" :title="space.name"> {{ space.name }}</span>
</div>
</el-checkbox>
</el-checkbox-group>
<el-checkbox
v-for="space in workspaceWithKeywords"
:key="space.id"
:label="space.name"
:value="space"
>
<div class="flex">
<AppIcon iconName="app-workspace"></AppIcon>
<span class="ml-4 ellipsis" :title="space.name"> {{ space.name }}</span>
</div>
</el-checkbox>
</el-checkbox-group>
</el-scrollbar>
</div>
</div>
@ -69,19 +69,19 @@
</el-button>
</div>
<el-scrollbar max-height="250" wrap-class="p-16 pt-0">
<template v-for="ele in checkedWorkspace">
<div class="flex-between">
<div class="flex align-center">
<AppIcon iconName="app-workspace"></AppIcon>
<span class="ml-4 lighter ellipsis" :title="ele.name">{{ ele.name }}</span>
<template v-for="ele in checkedWorkspace">
<div class="flex-between">
<div class="flex align-center">
<AppIcon iconName="app-workspace"></AppIcon>
<span class="ml-4 lighter ellipsis" :title="ele.name">{{ ele.name }}</span>
</div>
<el-button link>
<el-icon @click="clearWorkspace(ele)" :size="18">
<Close />
</el-icon>
</el-button>
</div>
<el-button link>
<el-icon @click="clearWorkspace(ele)" :size="18">
<Close />
</el-icon>
</el-button>
</div>
</template>
</template>
</el-scrollbar>
</div>
</div>

View File

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

View File

@ -16,7 +16,10 @@
</template>
<ToolListContainer @refreshFolder="refreshFolder">
<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>
</ToolListContainer>
</LayoutContainer>