Skip to content

Commit 7f1f9cc

Browse files
feat: system
1 parent 66606bc commit 7f1f9cc

File tree

17 files changed

+252
-174
lines changed

17 files changed

+252
-174
lines changed

ui/src/components/common-list/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ defineExpose({
7777
font-size: 14px;
7878
margin-bottom: 4px;
7979
&.active {
80+
background: var(--el-color-primary-light-9);
8081
border-radius: 4px;
8182
color: var(--el-color-primary);
8283
font-weight: 500;

ui/src/components/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import TagEllipsis from './tag-ellipsis/index.vue'
2323
import CardCheckbox from './card-checkbox/index.vue'
2424
import AiChat from './ai-chat/index.vue'
2525
import KnowledgeIcon from './app-icon/KnowledgeIcon.vue'
26+
import TagGroup from './tag-group/index.vue'
27+
import WorkspaceDropdown from './workspace-dropdown/index.vue'
2628
export default {
2729
install(app: App) {
2830
app.component('LogoFull', LogoFull)
@@ -49,5 +51,7 @@ export default {
4951
app.component('CardCheckbox', CardCheckbox)
5052
app.component('AiChat', AiChat)
5153
app.component('KnowledgeIcon', KnowledgeIcon)
54+
app.component('TagGroup', TagGroup)
55+
app.component('WorkspaceDropdown', WorkspaceDropdown)
5256
},
5357
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="tag-group" v-if="props.tags.length">
3-
<el-tag class="default-tag" style="max-width: 100%;">
4-
<span class="ellipsis" style="max-width: 100%;">{{ props.tags[0] }}</span>
3+
<el-tag class="default-tag" style="max-width: 100%">
4+
<span class="ellipsis" style="max-width: 100%">{{ props.tags[0] }}</span>
55
</el-tag>
66
<el-tooltip effect="light">
7-
<el-tag class="info-tag ml-4" v-if="props.tags?.length > 1">
7+
<el-tag class="info-tag ml-4 cursor" v-if="props.tags?.length > 1">
88
+{{ props.tags?.length - 1 }}
99
</el-tag>
1010
<template #content>
@@ -17,9 +17,8 @@
1717
</template>
1818
<script setup lang="ts">
1919
const props = defineProps<{
20-
tags: string[],
20+
tags: string[]
2121
}>()
22-
2322
</script>
2423

2524
<style lang="scss" scoped>
@@ -28,4 +27,4 @@ const props = defineProps<{
2827
width: 100%;
2928
}
3029
}
31-
</style>
30+
</style>

ui/src/layout/layout-header/workspace-dropdown/index.vue renamed to ui/src/components/workspace-dropdown/index.vue

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<el-dropdown placement="bottom-start">
3-
<el-button text>
2+
<el-dropdown placement="bottom-start" class="workspace-dropdown">
3+
<el-button text style="font-size: 14px" class="workspace-dropdown__button">
44
<AppIcon iconName="app-wordspace" style="font-size: 18px"></AppIcon>
5-
<span class="dropdown-title ellipsis">
5+
<span class="ellipsis" style="max-width: 155px">
66
{{ currentWorkspace?.name }}
77
</span>
88
<el-icon class="el-icon--right">
@@ -18,7 +18,7 @@
1818
@click="changeWorkspace(item)"
1919
>
2020
<AppIcon class="mr-8" iconName="app-wordspace" style="font-size: 16px"></AppIcon>
21-
<span class="dropdown-item ellipsis">
21+
<span class="ellipsis" style="max-width: 230px">
2222
{{ item.name }}
2323
</span>
2424
<el-icon
@@ -48,27 +48,16 @@ const currentWorkspace = computed(() => {
4848
4949
function changeWorkspace(item: WorkspaceItem) {
5050
if (item.id === user.workspace_id) return
51-
5251
user.setWorkspaceId(item.id || 'default')
5352
window.location.reload()
5453
}
5554
</script>
5655
<style lang="scss" scoped>
57-
:deep(.el-button.is-text) {
58-
color: var(--el-text-color-primary);
59-
max-height: 32px;
60-
}
61-
62-
.dropdown-title {
63-
max-width: 155px;
64-
font-size: 14px;
65-
}
66-
67-
.dropdown-item {
68-
max-width: 230px;
69-
}
70-
71-
:deep(.el-dropdown-menu__item.active) {
72-
color: var(--el-color-primary);
56+
.workspace-dropdown {
57+
&__button {
58+
font-size: 14px;
59+
padding: 0 12px !important;
60+
max-height: 32px;
61+
}
7362
}
7463
</style>

ui/src/layout/layout-header/UserHeader.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<div class="flex-between w-full">
99
<div class="ml-24 flex align-center">
1010
<!-- 企业版: 工作空间下拉框-->
11-
<el-divider class="mr-16" direction="vertical" v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
11+
<el-divider
12+
class="mr-8"
13+
direction="vertical"
14+
v-if="hasPermission(EditionConst.IS_EE, 'OR')"
15+
/>
1216
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
1317
</div>
1418
<TopMenu></TopMenu>
@@ -23,12 +27,6 @@ import Avatar from './avatar/index.vue'
2327
import TopAbout from './top-about/index.vue'
2428
import { EditionConst } from '@/utils/permission/data'
2529
import { hasPermission } from '@/utils/permission/index'
26-
import WorkspaceDropdown from './workspace-dropdown/index.vue'
27-
28-
import { useRouter } from 'vue-router'
29-
import useStore from '@/stores'
30-
const router = useRouter()
31-
const { user } = useStore()
3230
</script>
3331
<style lang="scss" scoped>
3432
.app-top-bar-container {

ui/src/locales/lang/en-US/views/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import system from './system'
88
import tool from './tool'
99
import userManage from './user-manage'
1010
import resourceAuthorization from './resource-authorization'
11-
import team from './team'
1211
import model from './model'
1312
import document from './document'
1413
import paragraph from './paragraph'
@@ -26,7 +25,6 @@ export default {
2625
tool,
2726
userManage,
2827
resourceAuthorization,
29-
team,
3028
model,
3129
knowledge,
3230
applicationWorkflow,
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
export default {
22
title: 'Resource Authorization',
3-
member:'Member',
3+
member: 'Member',
44
manage: 'Owner',
55
permissionSetting: 'Permission Setting',
66
addMember: 'Add Member',
77
addSubTitle: 'After members log in,they can access the data you have authorized.',
88
searchBar: {
9-
placeholder: 'Please enter the username to search'
9+
placeholder: 'Please enter the username to search',
1010
},
1111
delete: {
1212
button: 'Remove',
1313
confirmTitle: 'Wheather to remove the member:',
14-
confirmMessage: "After removal, the member's knowledge base and application permissions will be revoked. "
14+
confirmMessage:
15+
"After removal, the member's knowledge base and application permissions will be revoked. ",
1516
},
1617
setting: {
1718
management: ' management',
18-
check: 'check'
19+
check: 'check',
20+
authorization: 'authorization',
21+
},
22+
priority: {
23+
label: 'Resource permission priority',
24+
role: 'Role',
25+
customize: 'Customize',
1926
},
20-
teamForm: {
21-
form: {
22-
userName: {
23-
label: 'Username/Email',
24-
placeholder: "Please enter the member's username or email",
25-
requiredMessage: 'Please enter Username/Email',
26-
},
27-
28-
},
29-
30-
}
3127
}
32-

ui/src/locales/lang/en-US/views/team.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import role from './role'
2+
13
export default {
24
title: '资源授权',
35
member: '成员',
@@ -6,26 +8,21 @@ export default {
68
addMember: '添加成员',
79
addSubTitle: '成员登录后可以访问到您授权的数据。',
810
searchBar: {
9-
placeholder: '请输入用户名搜索'
11+
placeholder: '请输入用户名搜索',
1012
},
1113
delete: {
1214
button: '移除',
1315
confirmTitle: '是否移除成员:',
14-
confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。'
16+
confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。',
1517
},
1618
setting: {
1719
management: '管理',
18-
check: '查看'
20+
check: '查看',
21+
authorization: '授权',
22+
},
23+
priority: {
24+
label: '资源权限优先级',
25+
role: '按角色',
26+
customize: '自定义',
1927
},
20-
teamForm: {
21-
form: {
22-
userName: {
23-
label: '用户名/邮箱',
24-
placeholder: '请输入成员的用户名或邮箱',
25-
requiredMessage: '请输入用户名/邮箱'
26-
},
27-
28-
},
29-
30-
}
3128
}

ui/src/locales/lang/zh-Hant/views/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import system from './system'
88
import tool from './tool'
99
import userManage from './user-manage'
1010
import resourceAuthorization from './resource-authorization'
11-
import team from './team'
1211
import model from './model'
1312
import document from './document'
1413
import paragraph from './paragraph'
@@ -26,7 +25,6 @@ export default {
2625
tool,
2726
userManage,
2827
resourceAuthorization,
29-
team,
3028
model,
3129
knowledge,
3230
applicationWorkflow,

0 commit comments

Comments
 (0)