refactor: chat user
This commit is contained in:
parent
d0ba49456f
commit
f1d9bfa648
@ -23,7 +23,7 @@ const getUserGroupList: (resource: ChatUserResourceParams, loading?: Ref<boolean
|
|||||||
* 修改用户组列表授权
|
* 修改用户组列表授权
|
||||||
*/
|
*/
|
||||||
const editUserGroupList: (resource: ChatUserResourceParams, data: { user_group_id: string, is_auth: boolean }[], loading?: Ref<boolean>) => Promise<Result<any>> = (resource, data, loading) => {
|
const editUserGroupList: (resource: ChatUserResourceParams, data: { user_group_id: string, is_auth: boolean }[], loading?: Ref<boolean>) => Promise<Result<any>> = (resource, data, loading) => {
|
||||||
return put(`${prefix}/${resource.resource_type}/${resource.resource_id}/user_group`, data, undefined, loading)
|
return put(`${prefix.value}/${resource.resource_type}/${resource.resource_id}/user_group`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,10 +1,19 @@
|
|||||||
export default {
|
export default {
|
||||||
title: 'Chat users',
|
title: 'Chat users',
|
||||||
syncUsers: 'Sync users',
|
syncUsers: 'Synchronize users',
|
||||||
setUserGroups: 'Set user groups',
|
setUserGroups: 'Configure user groups',
|
||||||
|
knowledgeTitleTip: 'This configuration will only take effect when the associated application enables chat user login authentication',
|
||||||
|
applicationTitleTip: 'This configuration requires login authentication to be enabled in the application',
|
||||||
autoAuthorization: 'Auto authorization',
|
autoAuthorization: 'Auto authorization',
|
||||||
authorization: 'Authorization',
|
authorization: 'Authorization',
|
||||||
group: {
|
group: {
|
||||||
title: 'User groups',
|
title: 'User groups',
|
||||||
|
name: 'User group name',
|
||||||
|
usernameOrName: 'Username/Name',
|
||||||
|
delete: {
|
||||||
|
confirmTitle: 'Confirm to delete user group:',
|
||||||
|
confirmMessage: 'After deletion, all members in this user group will be removed. Please proceed with caution!',
|
||||||
|
},
|
||||||
|
batchDeleteMember: 'Remove selected {count} members?',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2,6 +2,8 @@ export default {
|
|||||||
title: '对话用户',
|
title: '对话用户',
|
||||||
syncUsers: '同步用户',
|
syncUsers: '同步用户',
|
||||||
setUserGroups: '设置用户组',
|
setUserGroups: '设置用户组',
|
||||||
|
knowledgeTitleTip: '该配置需要关联的应用开启对话用户登录认证后才会生效',
|
||||||
|
applicationTitleTip: '该配置需要应用开启登录认证后生效',
|
||||||
autoAuthorization: '自动授权',
|
autoAuthorization: '自动授权',
|
||||||
authorization: '授权',
|
authorization: '授权',
|
||||||
group: {
|
group: {
|
||||||
|
|||||||
@ -2,9 +2,18 @@ export default {
|
|||||||
title: '對話用戶',
|
title: '對話用戶',
|
||||||
syncUsers: '同步用戶',
|
syncUsers: '同步用戶',
|
||||||
setUserGroups: '設定用戶組',
|
setUserGroups: '設定用戶組',
|
||||||
|
knowledgeTitleTip: '該配置需要關聯的應用開啟對話用戶登入認證後才會生效',
|
||||||
|
applicationTitleTip: '該配置需要應用開啟登入認證後生效',
|
||||||
autoAuthorization: '自動授權',
|
autoAuthorization: '自動授權',
|
||||||
authorization: '授權',
|
authorization: '授權',
|
||||||
group: {
|
group: {
|
||||||
title: '用戶組',
|
title: '用戶組',
|
||||||
|
name: '用戶組名稱',
|
||||||
|
usernameOrName: '用戶名/姓名',
|
||||||
|
delete: {
|
||||||
|
confirmTitle: '是否刪除用戶組:',
|
||||||
|
confirmMessage: '刪除後,該用戶組下的成員將全部移除,請謹慎操作!',
|
||||||
|
},
|
||||||
|
batchDeleteMember: '是否移除選中的 {count} 個成員?',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -55,7 +55,7 @@ const DocumentRouter = {
|
|||||||
active: 'chat-log',
|
active: 'chat-log',
|
||||||
parentPath: '/knowledge/:id/:folderId',
|
parentPath: '/knowledge/:id/:folderId',
|
||||||
parentName: 'KnowledgeDetail',
|
parentName: 'KnowledgeDetail',
|
||||||
resourceType: ChatUserResourceEnum.APPLICATION
|
resourceType: ChatUserResourceEnum.KNOWLEDGE
|
||||||
},
|
},
|
||||||
component: () => import('@/views/chat-user/index.vue')
|
component: () => import('@/views/chat-user/index.vue')
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div>
|
<div>
|
||||||
<h2>{{ $t('views.chatUser.title') }}</h2>
|
<h2>{{ $t('views.chatUser.title') }}</h2>
|
||||||
<div class="color-secondary">{{ $t('views.user.title') }}</div>
|
<div class="color-secondary">{{ resource.resource_type === ChatUserResourceEnum.APPLICATION ?
|
||||||
|
$t('views.chatUser.applicationTitleTip') : $t('views.chatUser.knowledgeTitleTip') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-card style="--el-card-padding: 0" class="user-card">
|
<el-card style="--el-card-padding: 0" class="user-card">
|
||||||
@ -109,7 +110,7 @@ import { ChatUserResourceEnum } from '@/enums/workspaceChatUser'
|
|||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const resource: ChatUserResourceParams = { resource_id: route.params.id as string, resource_type: route.meta.resourceType as ChatUserResourceEnum }
|
const resource: ChatUserResourceParams = reactive({ resource_id: route.params.id as string, resource_type: route.meta.resourceType as ChatUserResourceEnum })
|
||||||
|
|
||||||
const filterText = ref('')
|
const filterText = ref('')
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
<ContentContainer>
|
<ContentContainer>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="shared-header">
|
<div class="shared-header">
|
||||||
<span class="title">{{ t('views.system.shared_resources') }}</span>
|
<span class="title">{{ t('views.chatUser.title') }}</span>
|
||||||
<el-icon size="12">
|
<el-icon size="12">
|
||||||
<rightOutlined></rightOutlined>
|
<rightOutlined></rightOutlined>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="sub-title">{{ t('views.knowledge.title') }}</span>
|
<span class="sub-title">{{ t('views.chatUser.group.title') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-card style="--el-card-padding: 0" class="user-card">
|
<el-card style="--el-card-padding: 0" class="user-card">
|
||||||
@ -293,6 +293,23 @@ function handleDeleteUser(item?: ChatUserGroupUserItem) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.shared-header {
|
||||||
|
color: #646a73;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 22px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
:deep(.el-icon i) {
|
||||||
|
height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-title {
|
||||||
|
color: #1f2329;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.content-container {
|
.content-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
<ContentContainer>
|
<ContentContainer>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="shared-header">
|
<div class="shared-header">
|
||||||
<span class="title">{{ t('views.system.shared_resources') }}</span>
|
<span class="title">{{ t('views.chatUser.title') }}</span>
|
||||||
<el-icon size="12">
|
<el-icon size="12">
|
||||||
<rightOutlined></rightOutlined>
|
<rightOutlined></rightOutlined>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="sub-title">{{ t('views.knowledge.title') }}</span>
|
<span class="sub-title">{{ t('views.chatUser.title') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-card class="h-full">
|
<el-card class="h-full">
|
||||||
@ -59,11 +59,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column prop="email" :label="$t('views.login.loginForm.email.label')" show-overflow-tooltip>
|
||||||
prop="email"
|
|
||||||
:label="$t('views.login.loginForm.email.label')"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.email || '-' }}
|
{{ row.email || '-' }}
|
||||||
</template>
|
</template>
|
||||||
@ -264,6 +260,23 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.shared-header {
|
||||||
|
color: #646a73;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 22px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
:deep(.el-icon i) {
|
||||||
|
height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-title {
|
||||||
|
color: #1f2329;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.content-container {
|
.content-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user