feat: system
This commit is contained in:
parent
66606bcaec
commit
7f1f9ccd3b
@ -77,6 +77,7 @@ defineExpose({
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
&.active {
|
&.active {
|
||||||
|
background: var(--el-color-primary-light-9);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|||||||
@ -23,6 +23,8 @@ import TagEllipsis from './tag-ellipsis/index.vue'
|
|||||||
import CardCheckbox from './card-checkbox/index.vue'
|
import CardCheckbox from './card-checkbox/index.vue'
|
||||||
import AiChat from './ai-chat/index.vue'
|
import AiChat from './ai-chat/index.vue'
|
||||||
import KnowledgeIcon from './app-icon/KnowledgeIcon.vue'
|
import KnowledgeIcon from './app-icon/KnowledgeIcon.vue'
|
||||||
|
import TagGroup from './tag-group/index.vue'
|
||||||
|
import WorkspaceDropdown from './workspace-dropdown/index.vue'
|
||||||
export default {
|
export default {
|
||||||
install(app: App) {
|
install(app: App) {
|
||||||
app.component('LogoFull', LogoFull)
|
app.component('LogoFull', LogoFull)
|
||||||
@ -49,5 +51,7 @@ export default {
|
|||||||
app.component('CardCheckbox', CardCheckbox)
|
app.component('CardCheckbox', CardCheckbox)
|
||||||
app.component('AiChat', AiChat)
|
app.component('AiChat', AiChat)
|
||||||
app.component('KnowledgeIcon', KnowledgeIcon)
|
app.component('KnowledgeIcon', KnowledgeIcon)
|
||||||
|
app.component('TagGroup', TagGroup)
|
||||||
|
app.component('WorkspaceDropdown', WorkspaceDropdown)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tag-group" v-if="props.tags.length">
|
<div class="tag-group" v-if="props.tags.length">
|
||||||
<el-tag class="default-tag" style="max-width: 100%;">
|
<el-tag class="default-tag" style="max-width: 100%">
|
||||||
<span class="ellipsis" style="max-width: 100%;">{{ props.tags[0] }}</span>
|
<span class="ellipsis" style="max-width: 100%">{{ props.tags[0] }}</span>
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tooltip effect="light">
|
<el-tooltip effect="light">
|
||||||
<el-tag class="info-tag ml-4" v-if="props.tags?.length > 1">
|
<el-tag class="info-tag ml-4 cursor" v-if="props.tags?.length > 1">
|
||||||
+{{ props.tags?.length - 1 }}
|
+{{ props.tags?.length - 1 }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<template #content>
|
<template #content>
|
||||||
@ -17,9 +17,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
tags: string[],
|
tags: string[]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -28,4 +27,4 @@ const props = defineProps<{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dropdown placement="bottom-start">
|
<el-dropdown placement="bottom-start" class="workspace-dropdown">
|
||||||
<el-button text>
|
<el-button text style="font-size: 14px" class="workspace-dropdown__button">
|
||||||
<AppIcon iconName="app-wordspace" style="font-size: 18px"></AppIcon>
|
<AppIcon iconName="app-wordspace" style="font-size: 18px"></AppIcon>
|
||||||
<span class="dropdown-title ellipsis">
|
<span class="ellipsis" style="max-width: 155px">
|
||||||
{{ currentWorkspace?.name }}
|
{{ currentWorkspace?.name }}
|
||||||
</span>
|
</span>
|
||||||
<el-icon class="el-icon--right">
|
<el-icon class="el-icon--right">
|
||||||
@ -18,7 +18,7 @@
|
|||||||
@click="changeWorkspace(item)"
|
@click="changeWorkspace(item)"
|
||||||
>
|
>
|
||||||
<AppIcon class="mr-8" iconName="app-wordspace" style="font-size: 16px"></AppIcon>
|
<AppIcon class="mr-8" iconName="app-wordspace" style="font-size: 16px"></AppIcon>
|
||||||
<span class="dropdown-item ellipsis">
|
<span class="ellipsis" style="max-width: 230px">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</span>
|
</span>
|
||||||
<el-icon
|
<el-icon
|
||||||
@ -48,27 +48,16 @@ const currentWorkspace = computed(() => {
|
|||||||
|
|
||||||
function changeWorkspace(item: WorkspaceItem) {
|
function changeWorkspace(item: WorkspaceItem) {
|
||||||
if (item.id === user.workspace_id) return
|
if (item.id === user.workspace_id) return
|
||||||
|
|
||||||
user.setWorkspaceId(item.id || 'default')
|
user.setWorkspaceId(item.id || 'default')
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.el-button.is-text) {
|
.workspace-dropdown {
|
||||||
color: var(--el-text-color-primary);
|
&__button {
|
||||||
max-height: 32px;
|
font-size: 14px;
|
||||||
}
|
padding: 0 12px !important;
|
||||||
|
max-height: 32px;
|
||||||
.dropdown-title {
|
}
|
||||||
max-width: 155px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item {
|
|
||||||
max-width: 230px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-dropdown-menu__item.active) {
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -8,7 +8,11 @@
|
|||||||
<div class="flex-between w-full">
|
<div class="flex-between w-full">
|
||||||
<div class="ml-24 flex align-center">
|
<div class="ml-24 flex align-center">
|
||||||
<!-- 企业版: 工作空间下拉框-->
|
<!-- 企业版: 工作空间下拉框-->
|
||||||
<el-divider class="mr-16" direction="vertical" v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
|
<el-divider
|
||||||
|
class="mr-8"
|
||||||
|
direction="vertical"
|
||||||
|
v-if="hasPermission(EditionConst.IS_EE, 'OR')"
|
||||||
|
/>
|
||||||
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
|
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
|
||||||
</div>
|
</div>
|
||||||
<TopMenu></TopMenu>
|
<TopMenu></TopMenu>
|
||||||
@ -23,12 +27,6 @@ import Avatar from './avatar/index.vue'
|
|||||||
import TopAbout from './top-about/index.vue'
|
import TopAbout from './top-about/index.vue'
|
||||||
import { EditionConst } from '@/utils/permission/data'
|
import { EditionConst } from '@/utils/permission/data'
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
import WorkspaceDropdown from './workspace-dropdown/index.vue'
|
|
||||||
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import useStore from '@/stores'
|
|
||||||
const router = useRouter()
|
|
||||||
const { user } = useStore()
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-top-bar-container {
|
.app-top-bar-container {
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import system from './system'
|
|||||||
import tool from './tool'
|
import tool from './tool'
|
||||||
import userManage from './user-manage'
|
import userManage from './user-manage'
|
||||||
import resourceAuthorization from './resource-authorization'
|
import resourceAuthorization from './resource-authorization'
|
||||||
import team from './team'
|
|
||||||
import model from './model'
|
import model from './model'
|
||||||
import document from './document'
|
import document from './document'
|
||||||
import paragraph from './paragraph'
|
import paragraph from './paragraph'
|
||||||
@ -26,7 +25,6 @@ export default {
|
|||||||
tool,
|
tool,
|
||||||
userManage,
|
userManage,
|
||||||
resourceAuthorization,
|
resourceAuthorization,
|
||||||
team,
|
|
||||||
model,
|
model,
|
||||||
knowledge,
|
knowledge,
|
||||||
applicationWorkflow,
|
applicationWorkflow,
|
||||||
|
|||||||
@ -1,32 +1,27 @@
|
|||||||
export default {
|
export default {
|
||||||
title: 'Resource Authorization',
|
title: 'Resource Authorization',
|
||||||
member:'Member',
|
member: 'Member',
|
||||||
manage: 'Owner',
|
manage: 'Owner',
|
||||||
permissionSetting: 'Permission Setting',
|
permissionSetting: 'Permission Setting',
|
||||||
addMember: 'Add Member',
|
addMember: 'Add Member',
|
||||||
addSubTitle: 'After members log in,they can access the data you have authorized.',
|
addSubTitle: 'After members log in,they can access the data you have authorized.',
|
||||||
searchBar: {
|
searchBar: {
|
||||||
placeholder: 'Please enter the username to search'
|
placeholder: 'Please enter the username to search',
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
button: 'Remove',
|
button: 'Remove',
|
||||||
confirmTitle: 'Wheather to remove the member:',
|
confirmTitle: 'Wheather to remove the member:',
|
||||||
confirmMessage: "After removal, the member's knowledge base and application permissions will be revoked. "
|
confirmMessage:
|
||||||
|
"After removal, the member's knowledge base and application permissions will be revoked. ",
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
management: ' management',
|
management: ' management',
|
||||||
check: 'check'
|
check: 'check',
|
||||||
|
authorization: 'authorization',
|
||||||
|
},
|
||||||
|
priority: {
|
||||||
|
label: 'Resource permission priority',
|
||||||
|
role: 'Role',
|
||||||
|
customize: 'Customize',
|
||||||
},
|
},
|
||||||
teamForm: {
|
|
||||||
form: {
|
|
||||||
userName: {
|
|
||||||
label: 'Username/Email',
|
|
||||||
placeholder: "Please enter the member's username or email",
|
|
||||||
requiredMessage: 'Please enter Username/Email',
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
export default {
|
|
||||||
title: 'Team Members',
|
|
||||||
member: 'Member',
|
|
||||||
manage: 'Owner',
|
|
||||||
permissionSetting: 'Permission Settings',
|
|
||||||
addMember: 'Add Member',
|
|
||||||
addSubTitle: 'Members can access the data you authorize after logging in.',
|
|
||||||
searchBar: {
|
|
||||||
placeholder: 'Enter username to search'
|
|
||||||
},
|
|
||||||
delete: {
|
|
||||||
button: 'Remove',
|
|
||||||
confirmTitle: 'Confirm removal of member:',
|
|
||||||
confirmMessage:
|
|
||||||
'Removing the member will revoke their access to knowledge and APP.'
|
|
||||||
},
|
|
||||||
setting: {
|
|
||||||
management: 'Manage',
|
|
||||||
check: 'View'
|
|
||||||
},
|
|
||||||
teamForm: {
|
|
||||||
form: {
|
|
||||||
userName: {
|
|
||||||
label: 'Username/Email',
|
|
||||||
placeholder: "Enter the member's username or email",
|
|
||||||
requiredMessage: 'Enter the username/email'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
import role from './role'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: '资源授权',
|
title: '资源授权',
|
||||||
member: '成员',
|
member: '成员',
|
||||||
@ -6,26 +8,21 @@ export default {
|
|||||||
addMember: '添加成员',
|
addMember: '添加成员',
|
||||||
addSubTitle: '成员登录后可以访问到您授权的数据。',
|
addSubTitle: '成员登录后可以访问到您授权的数据。',
|
||||||
searchBar: {
|
searchBar: {
|
||||||
placeholder: '请输入用户名搜索'
|
placeholder: '请输入用户名搜索',
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
button: '移除',
|
button: '移除',
|
||||||
confirmTitle: '是否移除成员:',
|
confirmTitle: '是否移除成员:',
|
||||||
confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。'
|
confirmMessage: '移除后将会取消成员拥有的知识库和应用权限。',
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
management: '管理',
|
management: '管理',
|
||||||
check: '查看'
|
check: '查看',
|
||||||
|
authorization: '授权',
|
||||||
|
},
|
||||||
|
priority: {
|
||||||
|
label: '资源权限优先级',
|
||||||
|
role: '按角色',
|
||||||
|
customize: '自定义',
|
||||||
},
|
},
|
||||||
teamForm: {
|
|
||||||
form: {
|
|
||||||
userName: {
|
|
||||||
label: '用户名/邮箱',
|
|
||||||
placeholder: '请输入成员的用户名或邮箱',
|
|
||||||
requiredMessage: '请输入用户名/邮箱'
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import system from './system'
|
|||||||
import tool from './tool'
|
import tool from './tool'
|
||||||
import userManage from './user-manage'
|
import userManage from './user-manage'
|
||||||
import resourceAuthorization from './resource-authorization'
|
import resourceAuthorization from './resource-authorization'
|
||||||
import team from './team'
|
|
||||||
import model from './model'
|
import model from './model'
|
||||||
import document from './document'
|
import document from './document'
|
||||||
import paragraph from './paragraph'
|
import paragraph from './paragraph'
|
||||||
@ -26,7 +25,6 @@ export default {
|
|||||||
tool,
|
tool,
|
||||||
userManage,
|
userManage,
|
||||||
resourceAuthorization,
|
resourceAuthorization,
|
||||||
team,
|
|
||||||
model,
|
model,
|
||||||
knowledge,
|
knowledge,
|
||||||
applicationWorkflow,
|
applicationWorkflow,
|
||||||
|
|||||||
@ -1,3 +1,21 @@
|
|||||||
export default {
|
export default {
|
||||||
title: '资源授权',
|
title: '资源授权',
|
||||||
|
member: '成员',
|
||||||
|
manage: '所有者',
|
||||||
|
permissionSetting: '资源权限配置',
|
||||||
|
addMember: '添加成员',
|
||||||
|
addSubTitle: '成员登录后可以访问到您授权的数据。',
|
||||||
|
searchBar: {
|
||||||
|
placeholder: '请输入用户名搜索',
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
button: '移除',
|
||||||
|
confirmTitle: '是否移除成员:',
|
||||||
|
confirmMessage: '移除后将会取消成员拥有知识库和应用权限。',
|
||||||
|
},
|
||||||
|
setting: {
|
||||||
|
management: '管理',
|
||||||
|
check: '查看',
|
||||||
|
authorization: '授权',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
export default {
|
|
||||||
title: '團隊成員',
|
|
||||||
member: '成員',
|
|
||||||
manage: '所有者',
|
|
||||||
permissionSetting: '權限設定',
|
|
||||||
addMember: '新增成員',
|
|
||||||
addSubTitle: '成員登入後可以存取您授權的資料。',
|
|
||||||
searchBar: {
|
|
||||||
placeholder: '請輸入使用者名稱搜尋'
|
|
||||||
},
|
|
||||||
delete: {
|
|
||||||
button: '移除',
|
|
||||||
confirmTitle: '是否移除成員:',
|
|
||||||
confirmMessage: '移除後將會取消成員擁有之知識庫和應用程式權限。'
|
|
||||||
},
|
|
||||||
setting: {
|
|
||||||
management: '管理',
|
|
||||||
check: '查看'
|
|
||||||
},
|
|
||||||
teamForm: {
|
|
||||||
form: {
|
|
||||||
userName: {
|
|
||||||
label: '使用者名稱/電子郵件',
|
|
||||||
placeholder: '請輸入成員的使用者名稱或電子郵件',
|
|
||||||
requiredMessage: '請輸入使用者名稱/電子郵件'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -81,7 +81,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole], [PermissionConst.ROLE_READ], [EditionConst.IS_EE], 'OR'),],
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
||||||
|
[PermissionConst.ROLE_READ],
|
||||||
|
[EditionConst.IS_EE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/role/index.vue'),
|
component: () => import('@/views/role/index.vue'),
|
||||||
},
|
},
|
||||||
@ -95,7 +102,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_WORKSPACE_READ], [EditionConst.IS_EE], 'OR'),],
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.WORKSPACE_WORKSPACE_READ],
|
||||||
|
[EditionConst.IS_EE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/workspace/index.vue'),
|
component: () => import('@/views/workspace/index.vue'),
|
||||||
},
|
},
|
||||||
@ -157,7 +171,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_USER_GROUP_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR'),],
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.WORKSPACE_USER_GROUP_READ],
|
||||||
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@ -168,7 +189,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_CHAT_USER_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR'),],
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.WORKSPACE_CHAT_USER_READ],
|
||||||
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system-chat-user/user-manage/index.vue'),
|
component: () => import('@/views/system-chat-user/user-manage/index.vue'),
|
||||||
},
|
},
|
||||||
@ -180,7 +208,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_USER_GROUP_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR'),],
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.WORKSPACE_USER_GROUP_READ],
|
||||||
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system-chat-user/group/index.vue'),
|
component: () => import('@/views/system-chat-user/group/index.vue'),
|
||||||
},
|
},
|
||||||
@ -192,8 +227,14 @@ const systemRouter = {
|
|||||||
activeMenu: '/system',
|
activeMenu: '/system',
|
||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [new ComplexPermission([RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
permission: [
|
||||||
[PermissionConst.CHAT_USER_AUTH_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR'),],
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.CHAT_USER_AUTH_READ],
|
||||||
|
[EditionConst.IS_EE, EditionConst.IS_PE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system-chat-user/authentication/index.vue'),
|
component: () => import('@/views/system-chat-user/authentication/index.vue'),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -65,8 +65,11 @@
|
|||||||
}
|
}
|
||||||
&:focus {
|
&:focus {
|
||||||
color: var(--el-button-text-color);
|
color: var(--el-button-text-color);
|
||||||
background-color: var(--el-button-bg-color);
|
background-color: none;
|
||||||
border-color: var(--el-button-border-color);
|
border-color: none;
|
||||||
|
}
|
||||||
|
&:focus-visible {
|
||||||
|
outline: none !important;
|
||||||
}
|
}
|
||||||
&.is-link:focus {
|
&.is-link:focus {
|
||||||
background: none;
|
background: none;
|
||||||
@ -105,6 +108,9 @@
|
|||||||
color: var(--el-menu-active-color);
|
color: var(--el-menu-active-color);
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
}
|
}
|
||||||
|
&.active {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// message
|
// message
|
||||||
|
|||||||
@ -1,13 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-input
|
<div class="w-full">
|
||||||
v-model="filterText"
|
<div class="flex-between mb-16">
|
||||||
:placeholder="$t('common.search')"
|
<div class="flex align-center" v-if="hasPermission(EditionConst.IS_EE, 'OR')">
|
||||||
prefix-icon="Search"
|
<!-- 企业版: 选优先级-->
|
||||||
class="mb-16 mt-4 1"
|
<span class="lighter mr-16">{{ $t('views.resourceAuthorization.priority.label') }}</span>
|
||||||
clearable
|
<el-radio-group v-model="isRole">
|
||||||
/>
|
<el-radio :value="true" size="large">{{
|
||||||
<div class="pt-0">
|
$t('views.resourceAuthorization.priority.role')
|
||||||
<el-table default-expand-all row-key="id" :data="filterData" :max-height="tableHeight">
|
}}</el-radio>
|
||||||
|
<el-radio :value="false" size="large">{{
|
||||||
|
$t('views.resourceAuthorization.priority.customize')
|
||||||
|
}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<el-input
|
||||||
|
v-model="filterText"
|
||||||
|
:placeholder="$t('common.search')"
|
||||||
|
prefix-icon="Search"
|
||||||
|
class="mt-4"
|
||||||
|
:class="hasPermission(EditionConst.IS_EE, 'OR') ? 'w-240' : ''"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
row-key="id"
|
||||||
|
:data="filterData"
|
||||||
|
:max-height="tableHeight"
|
||||||
|
:expand-row-keys="['default']"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<el-table-column class-name="folder-flex" prop="name" :label="$t('common.name')">
|
<el-table-column class-name="folder-flex" prop="name" :label="$t('common.name')">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
@ -49,10 +71,40 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
v-if="isRole"
|
||||||
|
:label="$t('views.resourceAuthorization.setting.authorization')"
|
||||||
|
align="center"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<!-- <template #header>
|
||||||
|
<el-checkbox
|
||||||
|
:disabled="props.manage"
|
||||||
|
v-model="allChecked[AuthorizationEnum.MANAGE]"
|
||||||
|
:indeterminate="allIndeterminate[AuthorizationEnum.MANAGE]"
|
||||||
|
:label="$t('views.resourceAuthorization.setting.management')"
|
||||||
|
/>
|
||||||
|
</template> -->
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-checkbox
|
||||||
|
v-if="row.isFolder"
|
||||||
|
:disabled="props.manage"
|
||||||
|
v-model="row.permission[AuthorizationEnum.ROLE]"
|
||||||
|
:indeterminate="row.permissionHalf[AuthorizationEnum.ROLE]"
|
||||||
|
@change="(e: boolean) => checkedOperateChange(AuthorizationEnum.ROLE, row, e)"
|
||||||
|
/>
|
||||||
|
<el-checkbox
|
||||||
|
v-else
|
||||||
|
:disabled="props.manage"
|
||||||
|
v-model="row.permission[AuthorizationEnum.ROLE]"
|
||||||
|
@change="(e: boolean) => checkedOperateChange(AuthorizationEnum.ROLE, row, e)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
v-if="!isRole"
|
||||||
:label="$t('views.resourceAuthorization.setting.management')"
|
:label="$t('views.resourceAuthorization.setting.management')"
|
||||||
align="center"
|
align="center"
|
||||||
width="100"
|
width="100"
|
||||||
fixed="right"
|
|
||||||
>
|
>
|
||||||
<!-- <template #header>
|
<!-- <template #header>
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@ -79,10 +131,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
v-if="!isRole"
|
||||||
:label="$t('views.resourceAuthorization.setting.check')"
|
:label="$t('views.resourceAuthorization.setting.check')"
|
||||||
align="center"
|
align="center"
|
||||||
width="100"
|
width="100"
|
||||||
fixed="right"
|
|
||||||
>
|
>
|
||||||
<!-- <template #header>
|
<!-- <template #header>
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@ -115,6 +167,8 @@
|
|||||||
import { ref, onMounted, watch, computed } from 'vue'
|
import { ref, onMounted, watch, computed } from 'vue'
|
||||||
import { AuthorizationEnum } from '@/enums/system'
|
import { AuthorizationEnum } from '@/enums/system'
|
||||||
import { isAppIcon } from '@/utils/common'
|
import { isAppIcon } from '@/utils/common'
|
||||||
|
import { EditionConst } from '@/utils/permission/data'
|
||||||
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
@ -127,6 +181,8 @@ const props = defineProps({
|
|||||||
manage: Boolean,
|
manage: Boolean,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isRole = ref(false)
|
||||||
|
|
||||||
const isKnowledge = computed(() => props.type === AuthorizationEnum.KNOWLEDGE)
|
const isKnowledge = computed(() => props.type === AuthorizationEnum.KNOWLEDGE)
|
||||||
const isApplication = computed(() => props.type === AuthorizationEnum.APPLICATION)
|
const isApplication = computed(() => props.type === AuthorizationEnum.APPLICATION)
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="resource-authorization p-16-24">
|
<div class="resource-authorization p-16-24">
|
||||||
<h2 class="mb-16">{{ $t('views.userManage.title') }}</h2>
|
<div class="flex align-center mb-16">
|
||||||
|
<h2>{{ $t('views.resourceAuthorization.title') }}</h2>
|
||||||
|
<!-- 企业版: 工作空间下拉框-->
|
||||||
|
<el-divider
|
||||||
|
class="mr-16"
|
||||||
|
direction="vertical"
|
||||||
|
v-if="hasPermission(EditionConst.IS_EE, 'OR')"
|
||||||
|
/>
|
||||||
|
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-card style="--el-card-padding: 0">
|
<el-card style="--el-card-padding: 0">
|
||||||
<div class="flex main-calc-height">
|
<div class="flex main-calc-height">
|
||||||
<div class="resource-authorization__left border-r p-8">
|
<div class="resource-authorization__left border-r p-8">
|
||||||
<div class="p-8">
|
<div class="p-8">
|
||||||
<h4 class="mb-12">{{ $t('views.resourceAuthorization.member') }}</h4>
|
<h4 class="mb-12">{{ $t('views.resourceAuthorization.member') }}</h4>
|
||||||
<el-input v-model="filterText" :placeholder="$t('common.search')" prefix-icon="Search" clearable />
|
<el-input
|
||||||
|
v-model="filterText"
|
||||||
|
:placeholder="$t('common.search')"
|
||||||
|
prefix-icon="Search"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-height-left">
|
<div class="list-height-left">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<common-list :data="filterMember" class="mt-8" v-loading="loading" @click="clickMemberHandle"
|
<common-list
|
||||||
:default-active="currentUser">
|
:data="filterMember"
|
||||||
|
class="mt-8"
|
||||||
|
v-loading="loading"
|
||||||
|
@click="clickMemberHandle"
|
||||||
|
:default-active="currentUser"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div>
|
<div class="flex">
|
||||||
<span class="mr-8">{{ row.nick_name }}</span>
|
<span class="mr-8">{{ row.nick_name }}</span>
|
||||||
<el-tag v-if="isManage(row.type)" class="default-tag">{{
|
<TagGroup :tags="row.roles" />
|
||||||
$t('views.resourceAuthorization.manage')
|
|
||||||
}}</el-tag>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -30,10 +48,20 @@
|
|||||||
<div class="resource-authorization__table">
|
<div class="resource-authorization__table">
|
||||||
<h4 class="mb-4">{{ $t('views.resourceAuthorization.permissionSetting') }}</h4>
|
<h4 class="mb-4">{{ $t('views.resourceAuthorization.permissionSetting') }}</h4>
|
||||||
<el-tabs v-model="activeName" class="resource-authorization__tabs">
|
<el-tabs v-model="activeName" class="resource-authorization__tabs">
|
||||||
<el-tab-pane v-for="(item, index) in settingTags" :key="item.value" :label="item.label"
|
<el-tab-pane
|
||||||
:name="item.value">
|
v-for="(item, index) in settingTags"
|
||||||
<PermissionSetting :key="index" :data="item.data" :type="item.value" :tableHeight="tableHeight"
|
:key="item.value"
|
||||||
:manage="isManage(currentType)" @refreshData="refreshData"></PermissionSetting>
|
:label="item.label"
|
||||||
|
:name="item.value"
|
||||||
|
>
|
||||||
|
<PermissionSetting
|
||||||
|
:key="index"
|
||||||
|
:data="item.data"
|
||||||
|
:type="item.value"
|
||||||
|
:tableHeight="tableHeight"
|
||||||
|
:manage="isManage(currentType)"
|
||||||
|
@refreshData="refreshData"
|
||||||
|
></PermissionSetting>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
@ -56,6 +84,8 @@ import { AuthorizationEnum } from '@/enums/system'
|
|||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
import { EditionConst } from '@/utils/permission/data'
|
||||||
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const rLoading = ref(false)
|
const rLoading = ref(false)
|
||||||
@ -97,7 +127,7 @@ function isManage(type: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const flotTree = (tree: Array<any>, result: Array<any>) => {
|
const flotTree = (tree: Array<any>, result: Array<any>) => {
|
||||||
tree.forEach(tItem => {
|
tree.forEach((tItem) => {
|
||||||
result.push(tItem)
|
result.push(tItem)
|
||||||
if (tItem.children) {
|
if (tItem.children) {
|
||||||
flotTree(tItem.children, result)
|
flotTree(tItem.children, result)
|
||||||
@ -106,19 +136,27 @@ const flotTree = (tree: Array<any>, result: Array<any>) => {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
function submitPermissions() {
|
function submitPermissions() {
|
||||||
const user_resource_permission_list = settingTags.map((item: any) => {
|
const user_resource_permission_list = settingTags
|
||||||
return flotTree(item.data, []).filter((v: any) => !v.isFolder).map((v: any) => {
|
.map((item: any) => {
|
||||||
return {
|
return flotTree(item.data, [])
|
||||||
target_id: v.id,
|
.filter((v: any) => !v.isFolder)
|
||||||
auth_target_type: item.value,
|
.map((v: any) => {
|
||||||
permission: v.permission,
|
return {
|
||||||
auth_type: 'RESOURCE_PERMISSION_GROUP',
|
target_id: v.id,
|
||||||
}
|
auth_target_type: item.value,
|
||||||
|
permission: v.permission,
|
||||||
|
auth_type: 'RESOURCE_PERMISSION_GROUP',
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}).reduce((pre, next) => {
|
.reduce((pre, next) => {
|
||||||
return [...pre, ...next]
|
return [...pre, ...next]
|
||||||
}, [])
|
}, [])
|
||||||
AuthorizationApi.putResourceAuthorization(currentUser.value, { user_resource_permission_list: user_resource_permission_list }, rLoading).then(() => {
|
AuthorizationApi.putResourceAuthorization(
|
||||||
|
currentUser.value,
|
||||||
|
{ user_resource_permission_list: user_resource_permission_list },
|
||||||
|
rLoading,
|
||||||
|
).then(() => {
|
||||||
MsgSuccess(t('common.submitSuccess'))
|
MsgSuccess(t('common.submitSuccess'))
|
||||||
getWholeTree(currentUser.value)
|
getWholeTree(currentUser.value)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
{{ row.phone || '-' }}
|
{{ row.phone || '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="user_group_names" :label="$t('views.chatUser.group.title')">
|
<el-table-column prop="user_group_names" :label="$t('views.chatUser.group.title')" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<TagGroup :tags="row.user_group_names" />
|
<TagGroup :tags="row.user_group_names" />
|
||||||
</template>
|
</template>
|
||||||
@ -172,7 +172,6 @@ import userManageApi from '@/api/system/chat-user'
|
|||||||
import { datetimeFormat } from '@/utils/time'
|
import { datetimeFormat } from '@/utils/time'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import TagGroup from '@/components/tag-group/index.vue'
|
|
||||||
import iconMap from '@/components/app-icon/icons/common'
|
import iconMap from '@/components/app-icon/icons/common'
|
||||||
import type { ChatUserItem } from '@/api/type/systemChatUser'
|
import type { ChatUserItem } from '@/api/type/systemChatUser'
|
||||||
import SystemGroupApi from '@/api/system/user-group'
|
import SystemGroupApi from '@/api/system/user-group'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user