Skip to content

Commit 69ff7f9

Browse files
fix: Embedding mode issue fix
1 parent 2fbeb43 commit 69ff7f9

File tree

14 files changed

+166
-77
lines changed

14 files changed

+166
-77
lines changed

ui/src/api/shared-workspace.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const getUserGroupUserList: (
119119
}
120120

121121
/**
122-
* 获取工作空间下共享知识库的用户组
122+
* 获取工作空间下共享知识库的用户组
123123
*/
124124
const getUserGroupList: (resource: any, loading?: Ref<boolean>) => Promise<Result<ChatUserGroupItem[]>> = (resource, loading) => {
125125
return get (`${prefix}/${prefix_workspace.value}/KNOWLEDGE/${resource.resource_id}/user_group`, undefined, loading)
@@ -170,6 +170,16 @@ const getToolListPage: (
170170
)
171171
}
172172

173+
/**
174+
* 获取全部用户
175+
*/
176+
const getAllMemberList: (arg: string, loading?: Ref<boolean>) => Promise<Result<Record<string, any>[]>> = (
177+
arg,
178+
loading,
179+
) => {
180+
return get('/user/list', undefined, loading)
181+
}
182+
173183
export default {
174184
getKnowledgeList,
175185
getKnowledgeListPage,
@@ -182,5 +192,6 @@ export default {
182192
getToolList,
183193
getToolListPage,
184194
getUserGroupList,
185-
getUserGroupUserList
195+
getUserGroupUserList,
196+
getAllMemberList
186197
}

ui/src/components/app-icon/icons/application.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,4 +688,29 @@ export default {
688688
])
689689
},
690690
},
691+
'app-pdf-export': {
692+
iconReader: () => {
693+
return h('i', [
694+
h(
695+
'svg',
696+
{
697+
style: { height: '100%', width: '100%' },
698+
viewBox: '0 0 20 20',
699+
version: '1.1',
700+
xmlns: 'http://www.w3.org/2000/svg',
701+
},
702+
[
703+
h('path', {
704+
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',
705+
fill: 'currentColor',
706+
}),
707+
h('path', {
708+
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',
709+
fill: 'currentColor',
710+
}),
711+
],
712+
),
713+
])
714+
},
715+
},
691716
}

ui/src/components/layout-container/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const showBack = computed(() => {
5555
.collapse {
5656
position: absolute;
5757
top: 36px;
58-
right: -15px;
58+
right: -12px;
5959
box-shadow: 0px 5px 10px 0px rgba(31, 35, 41, 0.1);
6060
z-index: 1;
6161
}

ui/src/layout/layout-header/avatar/index.vue

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,83 @@
2121
<div style="width: 90%">
2222
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
2323
<template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0">
24-
<TagGroup size="small" :tags="user.userInfo?.role_name"
25-
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE],'OR')"
24+
<TagGroup
25+
size="small"
26+
:tags="user.userInfo?.role_name"
27+
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
2628
/>
2729
</template>
2830
</div>
2931
</div>
30-
<el-dropdown-item class="border-t p-8" @click="openResetPassword"
31-
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
32+
<el-dropdown-item class="border-t"
33+
@click="router.push({ path: `/system/user` })"
34+
v-if="
35+
hasPermission(
36+
[
37+
RoleConst.EXTENDS_ADMIN,
38+
RoleConst.EXTENDS_WORKSPACE_MANAGE,
39+
RoleConst.ADMIN,
40+
RoleConst.WORKSPACE_MANAGE,
41+
],
42+
'OR',
43+
)
44+
"
45+
>
46+
<div class="flex-between w-full">
47+
{{ $t('views.system.title') }}
48+
<AppIcon iconName="app-go"></AppIcon>
49+
</div>
50+
</el-dropdown-item>
51+
<el-dropdown-item
52+
53+
@click="openResetPassword"
54+
v-if="
55+
hasPermission(
56+
new ComplexPermission(
57+
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
3258
[PermissionConst.CHANGE_PASSWORD],
33-
[],'OR'),'OR')"
59+
[],
60+
'OR',
61+
),
62+
'OR',
63+
)
64+
"
3465
>
3566
{{ $t('views.login.resetPassword') }}
3667
</el-dropdown-item>
3768
<div>
38-
<el-dropdown-item class="p-8" @click="openAPIKeyDialog"
39-
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN],[PermissionConst.SYSTEM_API_KEY_EDIT],
40-
[EditionConst.IS_EE,EditionConst.IS_PE],'OR'),'OR')"
69+
<el-dropdown-item
70+
class="p-8"
71+
@click="openAPIKeyDialog"
72+
v-if="
73+
hasPermission(
74+
new ComplexPermission(
75+
[RoleConst.ADMIN],
76+
[PermissionConst.SYSTEM_API_KEY_EDIT],
77+
[EditionConst.IS_EE, EditionConst.IS_PE],
78+
'OR',
79+
),
80+
'OR',
81+
)
82+
"
4183
>
4284
{{ $t('layout.apiKey') }}
4385
</el-dropdown-item>
4486
</div>
45-
<el-dropdown-item style="padding: 0" @click.stop
46-
v-if="hasPermission(new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
47-
[PermissionConst.SWITCH_LANGUAGE],[],'OR'),'OR')"
87+
<el-dropdown-item
88+
style="padding: 0"
89+
@click.stop
90+
v-if="
91+
hasPermission(
92+
new ComplexPermission(
93+
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
94+
[PermissionConst.SWITCH_LANGUAGE],
95+
[],
96+
'OR',
97+
),
98+
'OR',
99+
)
100+
"
48101
>
49102
<el-dropdown class="w-full" trigger="hover" placement="left-start">
50103
<div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px">
@@ -78,22 +131,13 @@
78131
</template>
79132
</el-dropdown>
80133
</el-dropdown-item>
81-
<el-dropdown-item @click="openAbout"
82-
v-if="hasPermission([RoleConst.ADMIN,PermissionConst.ABOUT_READ],'OR')"
134+
<el-dropdown-item
135+
@click="openAbout"
136+
v-if="hasPermission([RoleConst.ADMIN, PermissionConst.ABOUT_READ], 'OR')"
83137
>
84138
{{ $t('layout.about.title') }}
85139
</el-dropdown-item>
86140

87-
<el-dropdown-item @click="router.push({ path: `/system/user` })"
88-
v-if="hasPermission([RoleConst.EXTENDS_ADMIN, RoleConst.EXTENDS_WORKSPACE_MANAGE,
89-
RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],'OR')"
90-
>
91-
<div class="flex-between w-full">
92-
{{ $t('views.system.title') }}
93-
<AppIcon iconName="app-go"></AppIcon>
94-
</div>
95-
</el-dropdown-item>
96-
97141
<el-dropdown-item class="border-t" @click="logout">
98142
{{ $t('layout.logout') }}
99143
</el-dropdown-item>
@@ -114,10 +158,10 @@ import ResetPassword from './ResetPassword.vue'
114158
import AboutDialog from './AboutDialog.vue'
115159
// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
116160
import APIKeyDialog from './APIKeyDialog.vue'
117-
import {ComplexPermission} from '@/utils/permission/type'
118-
import {langList} from '@/locales/index'
161+
import { ComplexPermission } from '@/utils/permission/type'
162+
import { langList } from '@/locales/index'
119163
import { hasPermission } from '@/utils/permission'
120-
import { PermissionConst, RoleConst,EditionConst } from '@/utils/permission/data'
164+
import { PermissionConst, RoleConst, EditionConst } from '@/utils/permission/data'
121165
122166
const { user, login } = useStore()
123167
const router = useRouter()

ui/src/layout/login-layout/LoginContainer.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="login-form-container">
2+
<div class="login-form-container p-24">
33
<div class="login-title">
44
<div class="logo text-center">
55
<slot name="logo">
@@ -25,6 +25,7 @@ defineProps({
2525
.login-form-container {
2626
width: 480px;
2727
28+
2829
.login-title {
2930
margin-bottom: 32px;
3031
.sub-title {

ui/src/views/application/component/AddKnowledgeDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
:canOperation="false"
3737
showShared
3838
:shareTitle="$t('views.shared.shared_knowledge')"
39-
:treeStyle="{ height: 'calc(100vh - 320px)' }"
39+
:treeStyle="{ height: 'calc(100vh - 240px)' }"
4040
/>
4141
</div>
4242
</template>
@@ -250,7 +250,7 @@ defineExpose({ open })
250250
}
251251
252252
.el-dialog__headerbtn {
253-
top: 3px;
253+
top: 2px;
254254
right: 6px;
255255
}
256256
}

ui/src/views/chat/auth/component/password.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ const FormRef = ref()
1818
const { chatUser } = useStore()
1919
const loading = ref<boolean>(false)
2020
const router = useRouter()
21+
const route = useRoute()
2122
2223
const auth = () => {
2324
return chatUser.passwordAuthentication(form.value.password).then((ok) => {
24-
router.push({ name: 'chat', params: { accessToken: chatUser.accessToken } })
25+
router.push({ name: 'chat', params: { accessToken: chatUser.accessToken }, query: route.query })
2526
})
2627
}
2728
const validator_auth = (rule: any, value: string, callback: any) => {

ui/src/views/chat/auth/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</template>
88
<script setup lang="ts">
99
import { computed } from 'vue'
10-
import { isAppIcon } from '@/utils/common'
1110
1211
const auth_components: any = import.meta.glob('@/views/chat/auth/component/*.vue', {
1312
eager: true,

ui/src/views/chat/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const {
2323
query: { mode },
2424
} = route as any
2525
26+
27+
console.log(mode)
2628
const currentTemplate = computed(() => {
2729
let modeName = ''
2830
if (chatUser.application) {

ui/src/views/chat/pc/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
:title="rightPanelDetail?.document_name?.trim()"
184184
>
185185
<el-button text>
186-
<el-icon> <Download /> </el-icon>
186+
<AppIcon iconName="app-pdf-export" class="cursor"></AppIcon>
187187
</el-button>
188188
</a>
189189
</span>

0 commit comments

Comments
 (0)