From e715e244afbbc78dffa86bb145e62dae30105025 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed, 20 Aug 2025 19:02:29 +0800 Subject: [PATCH] perf: Optimize * fix: New conversation user, user group should be a mandatory field(#3833) * fix: Filter empty files uploaded during application dialogue(#3836) * fix: License not uploaded, knowledge base hits test interface style issue(#3852) * perf: Optimize packaging --------- Co-authored-by: wangdan-fit2cloud --- ui/package.json | 1 + .../component/chat-input-operate/index.vue | 15 ++++++++++++++- ui/src/locales/lang/en-US/ai-chat.ts | 1 + ui/src/locales/lang/en-US/views/chat-user.ts | 12 ++++++++---- ui/src/locales/lang/zh-CN/ai-chat.ts | 1 + ui/src/locales/lang/zh-CN/views/chat-user.ts | 3 ++- ui/src/locales/lang/zh-Hant/ai-chat.ts | 1 + ui/src/locales/lang/zh-Hant/views/chat-user.ts | 3 ++- ui/src/styles/element-plus.scss | 10 ++++++++++ ui/src/views/hit-test/index.vue | 8 +++----- ui/src/views/paragraph/index.vue | 4 ++-- .../chat-user/component/UserDrawer.vue | 9 ++++++++- ui/vite.config.ts | 9 +++++++++ 13 files changed, 62 insertions(+), 15 deletions(-) diff --git a/ui/package.json b/ui/package.json index 78d5ed2ab..47514fa3c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -44,6 +44,7 @@ "screenfull": "^6.0.2", "sortablejs": "^1.15.6", "use-element-plus-theme": "^0.0.5", + "vite-plugin-compression": "^0.5.1", "vite-plugin-html": "^3.2.2", "vue": "^3.5.13", "vue-clipboard3": "^2.0.0", diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index f1c4dfaea..db994c96f 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -421,16 +421,29 @@ const uploadFile = async (file: any, fileList: any) => { uploadAudioList.value.length + uploadVideoList.value.length + uploadOtherList.value.length + if (file_limit_once >= maxFiles) { MsgWarning(t('chat.uploadFile.limitMessage1') + maxFiles + t('chat.uploadFile.limitMessage2')) fileList.splice(0, fileList.length, ...fileList.slice(0, maxFiles)) return } + console.log(fileList) + if (fileList.filter((f: any) => f.size == 0).length > 0) { + // MB + MsgWarning(t('chat.uploadFile.sizeLimit2') + fileLimit + 'MB') + // 只保留未超出大小限制的文件 + fileList.splice(0, fileList.length, ...fileList.filter((f: any) => f.size > 0)) + return + } if (fileList.filter((f: any) => f.size > fileLimit * 1024 * 1024).length > 0) { // MB MsgWarning(t('chat.uploadFile.sizeLimit') + fileLimit + 'MB') // 只保留未超出大小限制的文件 - fileList.splice(0, fileList.length, ...fileList.filter((f: any) => f.size <= fileLimit * 1024 * 1024)) + fileList.splice( + 0, + fileList.length, + ...fileList.filter((f: any) => f.size <= fileLimit * 1024 * 1024), + ) return } const inner = reactive(file) diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index 3299c500b..729089898 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -66,6 +66,7 @@ export default { limitMessage1: 'You can upload up to', limitMessage2: 'files', sizeLimit: 'Each file must not exceed', + sizeLimit2: 'Empty files are not supported for upload', imageMessage: 'Please process the image content', fileMessage: 'Please process the file content', errorMessage: 'Upload Failed', diff --git a/ui/src/locales/lang/en-US/views/chat-user.ts b/ui/src/locales/lang/en-US/views/chat-user.ts index 1ce532fe6..6d9a557d9 100644 --- a/ui/src/locales/lang/en-US/views/chat-user.ts +++ b/ui/src/locales/lang/en-US/views/chat-user.ts @@ -3,8 +3,10 @@ export default { syncUsers: 'Sync Users', syncUsersTip: 'Only sync newly added users', setUserGroups: 'Configure User Groups', - knowledgeTitleTip: 'This configuration will only take effect after enabling chat user login authentication in the associated application', - applicationTitleTip: 'This configuration requires login authentication to be enabled in the application', + knowledgeTitleTip: + 'This configuration will only take effect after enabling chat user login authentication in the associated application', + applicationTitleTip: + 'This configuration requires login authentication to be enabled in the application', autoAuthorization: 'Auto Authorization', authorization: 'Authorization', batchDeleteUser: 'Delete selected {count} users?', @@ -14,10 +16,12 @@ export default { group: { title: 'User Groups', name: 'User Group Name', + requiredMessage: 'Please select user group', usernameOrName: 'Username/Name', delete: { confirmTitle: 'Confirm to delete user group:', - confirmMessage: 'All members in this group will be removed after deletion. Proceed with caution!', + confirmMessage: + 'All members in this group will be removed after deletion. Proceed with caution!', }, batchDeleteMember: 'Remove selected {count} members?', }, @@ -25,5 +29,5 @@ export default { title: 'Successfully synced {count} users', usernameExist: 'The following usernames already exist:', nicknameExist: 'The following nicknames already exist:', - } + }, } diff --git a/ui/src/locales/lang/zh-CN/ai-chat.ts b/ui/src/locales/lang/zh-CN/ai-chat.ts index 72524044d..4a024954a 100644 --- a/ui/src/locales/lang/zh-CN/ai-chat.ts +++ b/ui/src/locales/lang/zh-CN/ai-chat.ts @@ -68,6 +68,7 @@ export default { limitMessage1: '最多上传', limitMessage2: '个文件', sizeLimit: '单个文件大小不能超过', + sizeLimit2: '空文件不支持上传', imageMessage: '请解析图片内容', fileMessage: '请解析文件内容', errorMessage: '上传失败', diff --git a/ui/src/locales/lang/zh-CN/views/chat-user.ts b/ui/src/locales/lang/zh-CN/views/chat-user.ts index ec9f7527f..d7f8e11c9 100644 --- a/ui/src/locales/lang/zh-CN/views/chat-user.ts +++ b/ui/src/locales/lang/zh-CN/views/chat-user.ts @@ -13,6 +13,7 @@ export default { replace: '替换', group: { title: '用户组', + requiredMessage: '请选择用户组', name: '用户组名称', usernameOrName: '用户名/姓名', delete: { @@ -25,5 +26,5 @@ export default { title: '成功同步 {count} 个用户', usernameExist: '以下用户名已存在:', nicknameExist: '以下姓名已存在:', - } + }, } diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index bc0a3551f..432050783 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -64,6 +64,7 @@ export default { limitMessage1: '最多上傳', limitMessage2: '個文件', sizeLimit: '單個文件大小不能超過', + sizeLimit2: '空文件不支持上傳', imageMessage: '請解析圖片內容', fileMessage: '請解析文件內容', errorMessage: '上傳失敗', diff --git a/ui/src/locales/lang/zh-Hant/views/chat-user.ts b/ui/src/locales/lang/zh-Hant/views/chat-user.ts index dd72254ed..e928586dd 100644 --- a/ui/src/locales/lang/zh-Hant/views/chat-user.ts +++ b/ui/src/locales/lang/zh-Hant/views/chat-user.ts @@ -13,6 +13,7 @@ export default { replace: '替換', group: { title: '用戶組', + requiredMessage: '請選擇用戶組', name: '用戶組名稱', usernameOrName: '用戶名/姓名', delete: { @@ -25,5 +26,5 @@ export default { title: '成功同步 {count} 個用戶', usernameExist: '以下用戶名已存在:', nicknameExist: '以下姓名已存在:', - } + }, } diff --git a/ui/src/styles/element-plus.scss b/ui/src/styles/element-plus.scss index 0e2cf9af3..a65d10bec 100644 --- a/ui/src/styles/element-plus.scss +++ b/ui/src/styles/element-plus.scss @@ -287,3 +287,13 @@ .el-input { --el-input-text-color: var(--el-text-color-primary); } + +.el-input-group__prepend div.el-select .el-select__wrapper { + background: #ffffff; + &:hover { + background: #ffffff; + } + .el-select__placeholder { + color: var(--el-text-color-regular); + } +} diff --git a/ui/src/views/hit-test/index.vue b/ui/src/views/hit-test/index.vue index 76aad8b8f..a4111be74 100644 --- a/ui/src/views/hit-test/index.vue +++ b/ui/src/views/hit-test/index.vue @@ -22,7 +22,7 @@ -
+
import { nextTick, ref, onMounted, computed } from 'vue' import { useRoute } from 'vue-router' +import useStore from '@/stores' import { cloneDeep } from 'lodash' import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue' import { arraySort } from '@/utils/array' @@ -241,6 +242,7 @@ const route = useRoute() const { params: { id }, } = route as any +const { user } = useStore() const apiType = computed(() => { if (route.path.includes('shared')) { return 'systemShare' @@ -408,10 +410,6 @@ onMounted(() => {}) position: absolute; right: calc(var(--app-base-px) * 3); } - - .hit-test-height { - height: calc(100vh - 300px); - } .document-card { height: 210px; border: 1px solid var(--app-layout-bg-color); diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index cfb1d1623..3bf0182a4 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -160,7 +160,7 @@
-
+
{{ $t('views.document.generateQuestion.title') }} @@ -171,7 +171,7 @@ {{ $t('common.delete') }} - + {{ $t('common.selected') }} {{ multipleSelection.length }} {{ $t('views.document.items') }} diff --git a/ui/src/views/system-chat-user/chat-user/component/UserDrawer.vue b/ui/src/views/system-chat-user/chat-user/component/UserDrawer.vue index 4e174e3dc..19d8966ea 100644 --- a/ui/src/views/system-chat-user/chat-user/component/UserDrawer.vue +++ b/ui/src/views/system-chat-user/chat-user/component/UserDrawer.vue @@ -51,7 +51,6 @@