From 8abc3e188355a7df9406036aea78770622f86f16 Mon Sep 17 00:00:00 2001 From: WangJing Date: Mon, 28 Jul 2025 14:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=9C=BA=E7=99=BD?= =?UTF-8?q?=E5=92=8C=E6=8E=A8=E8=8D=90=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=B8=83=E5=B1=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat-client/.env.development | 8 +- chat-client/.env.production | 4 +- .../library/components/VabTabs/index.vue | 103 ++++++-------- chat-client/src/api/prologue.ts | 13 +- chat-client/src/locales/en.ts | 79 ++++++++--- chat-client/src/locales/zh-TW.ts | 93 +++++++++---- chat-client/src/locales/zh.ts | 83 ++++++++---- .../datasets/components/DocumentList.vue | 8 +- .../views/permission/prologueManage/index.vue | 128 +++++++++++++----- .../controller/PrologueController.java | 20 +++ .../mapper/opengauss/PrologueMapper.java | 4 + .../brichat/service/PrologueService.java | 5 + .../service/impl/PrologueServiceImpl.java | 20 +++ .../mapper/opengauss/PrologueMapper.xml | 10 ++ 14 files changed, 396 insertions(+), 182 deletions(-) diff --git a/chat-client/.env.development b/chat-client/.env.development index 659b179..9799822 100644 --- a/chat-client/.env.development +++ b/chat-client/.env.development @@ -2,14 +2,14 @@ # 此文件修改后需要重启项目 NODE_ENV=development #VUE_APP_BASE_URL='/vab-mock-server' -# VUE_APP_BASE_URL='http://localhost:10001' -# VUE_APP_API_BASE_URL='http://localhost:8080' +VUE_APP_BASE_URL='http://localhost:10001' +VUE_APP_API_BASE_URL='http://localhost:8080' #北京服务器配置 # VUE_APP_BASE_URL='http://192.168.1.211:80/brichat' # VUE_APP_API_BASE_URL='http://192.168.1.211:80/brichat' # #武汉公司服务器 -VUE_APP_BASE_URL='http://192.168.8.253:80/brichat' -VUE_APP_API_BASE_URL='http://192.168.8.253:80/brichat' +# VUE_APP_BASE_URL='http://192.168.8.253:80/brichat' +# VUE_APP_API_BASE_URL='http://192.168.8.253:80/brichat' #总部服务器配置 # VUE_APP_BASE_URL='http://192.168.0.33:80/brichat' # VUE_APP_API_BASE_URL='http://192.168.0.33:80/brichat' diff --git a/chat-client/.env.production b/chat-client/.env.production index a10fb89..d6534da 100644 --- a/chat-client/.env.production +++ b/chat-client/.env.production @@ -8,8 +8,8 @@ VUE_APP_API_BASE_URL='http://localhost:10001' # VUE_APP_BASE_URL='http://192.168.1.211:80/brichat' # VUE_APP_API_BASE_URL='http://192.168.1.211:80/brichat' #武汉公司服务器 -VUE_APP_BASE_URL='http://192.168.8.253:80/brichat' -VUE_APP_API_BASE_URL='http://192.168.8.253:80/brichat' +# VUE_APP_BASE_URL='http://192.168.8.253:80/brichat' +# VUE_APP_API_BASE_URL='http://192.168.8.253:80/brichat' # 总部服务器 # VUE_APP_BASE_URL='http://192.168.0.33:80/brichat' # VUE_APP_API_BASE_URL='http://192.168.0.33:80/brichat' diff --git a/chat-client/library/components/VabTabs/index.vue b/chat-client/library/components/VabTabs/index.vue index 9bca560..90f468d 100644 --- a/chat-client/library/components/VabTabs/index.vue +++ b/chat-client/library/components/VabTabs/index.vue @@ -5,7 +5,9 @@ import { handleActivePath, handleTabs } from '@/utils/routes' import { translate } from '@/i18n' import { VabRoute, VabRouteRecord } from '/#/router' + import { useI18n } from 'vue-i18n' + const { t, locale } = useI18n() defineProps({ layout: { type: String, @@ -24,14 +26,7 @@ const { getRoutes: routes } = storeToRefs(routesStore) const tabsStore = useTabsStore() const { getVisitedRoutes: visitedRoutes } = storeToRefs(tabsStore) - const { - addVisitedRoute, - delVisitedRoute, - delOthersVisitedRoutes, - delLeftVisitedRoutes, - delRightVisitedRoutes, - delAllVisitedRoutes, - } = tabsStore + const { addVisitedRoute, delVisitedRoute, delOthersVisitedRoutes, delLeftVisitedRoutes, delRightVisitedRoutes, delAllVisitedRoutes } = tabsStore const tabActive = ref('') const active = ref(false) @@ -148,9 +143,7 @@ * 跳转最后一个标签页 */ const toLastTab = async () => { - const latestView = visitedRoutes.value - .filter((_: any) => _.path !== handleActivePath(route, true)) - .slice(-1)[0] + const latestView = visitedRoutes.value.filter((_: any) => _.path !== handleActivePath(route, true)).slice(-1)[0] if (latestView) await router.push(latestView) else await router.push('/') } @@ -196,20 +189,11 @@ @tab-click="handleTabClick" @tab-remove="handleTabRemove" > - + -
    +
    • - {{ translate('刷新') }} + {{ t('vabI18n.vabtabs.refresh') }}
    • -
    • +
    • - {{ translate('关闭其他') }} + {{ t('vabI18n.vabtabs.closeOthers') }}
    • -
    • +
    • - {{ translate('关闭左侧') }} + {{ t('vabI18n.vabtabs.closeLeft') }}
    • - {{ translate('关闭右侧') }} + {{ t('vabI18n.vabtabs.closeRight') }}
    • - {{ translate('关闭全部') }} + {{ t('vabI18n.vabtabs.closeAll') }}
    @@ -337,9 +303,9 @@ margin-right: 3px; } - .vab-icon { - vertical-align: -3px; - } + // .vab-icon { + // vertical-align: -3px; + // } } &-content { @@ -466,10 +432,7 @@ .el-tabs__item { height: $base-tag-item-height + 4; padding: 0 30px 0 30px; - margin-top: #{math.div( - $base-tabs-height - $base-tag-item-height - 4.1, - 2 - )}; + margin-top: #{math.div($base-tabs-height - $base-tag-item-height - 4.1, 2)}; margin-right: -18px; line-height: $base-tag-item-height + 4; text-align: center; @@ -598,4 +561,20 @@ } } } + + :deep(.el-tabs__nav-wrap.is-top) { + padding-top: 0 !important; + margin-top: 0 !important; + display: flex; + align-items: center; + height: $base-tabs-height; + } + + :deep(.el-tabs__header.is-top) { + padding-top: 0 !important; + margin-top: 0 !important; + height: $base-tabs-height; + display: flex; + align-items: center; + } diff --git a/chat-client/src/api/prologue.ts b/chat-client/src/api/prologue.ts index 3d207d8..a377bc5 100644 --- a/chat-client/src/api/prologue.ts +++ b/chat-client/src/api/prologue.ts @@ -26,7 +26,7 @@ export function getRecommendations(chatType: string) { } // 编辑推荐问题 -export function eidtRecommendation(data: any) { +export function editRecommendation(data: any) { return request({ url: '/brichat-service/prologue/eidtRecommendation', method: 'post', @@ -41,4 +41,13 @@ export function deleteRecommendation(id: string) { method: 'delete', params: { id }, }) -} \ No newline at end of file +} + +// 新增推荐问题 +export function addRecommendation(data: any) { + return request({ + url: '/brichat-service/prologue/addRecommendation', + method: 'post', + data, + }) +} diff --git a/chat-client/src/locales/en.ts b/chat-client/src/locales/en.ts index bc9f906..f3967c2 100644 --- a/chat-client/src/locales/en.ts +++ b/chat-client/src/locales/en.ts @@ -515,35 +515,70 @@ export default { Tip: 'Tip', selectDeleteData: 'Please select the data to be deleted', confirmDeleteApiKeys: 'This operation will permanently delete selected ', - confirmDeleteApiKeysEnd:' API key, are you sure?', - confirmDeleteApiKeysEndPlural:' API keys, are you sure?', + confirmDeleteApiKeysEnd: ' API key, are you sure?', + confirmDeleteApiKeysEndPlural: ' API keys, are you sure?', confirmRefreshCache: 'This operation will refresh Redis cache, reloading all API keys, are you sure?', updateSuccess: 'Update Successfully', updateFail: 'Update Failed', addSuccess: 'Add Successfully', - addFail:'Add Failed' + addFail: 'Add Failed', }, - prologue:{ + prologue: { + title: 'Opening Statement Management', + query: 'Query', + save: 'Save', chatType: 'Chat Type', - selectChatType: 'Select Chat Type', - prologueContent: 'Prologue Content', - addRecommend: 'Add Recommendation', - recommendQuestion: 'Recommended Question', - actions: 'Actions', + chatTypes: { + '1': 'Fault Diagnosis', + '2': 'Intelligent Q&A', + '3': 'Chart Report', + '4': 'Emergency Assistant Q&A', + '5': 'Diagnostic Code Lookup', + }, + openingContent: 'Opening Statement Content', + addRecommend: 'Add Recommended Question', + recommendation: 'Recommended Question', + action: 'Action', edit: 'Edit', delete: 'Delete', - confirmDelete: 'Are you sure you want to delete this recommendation?', - confirmSave: 'Are you sure you want to save the changes?', - deleteSuccess: 'Deleted successfully', - deleteFailure: 'Failed to delete, please try again later', - saveSuccess: 'Saved successfully', - saveFailure: 'Failed to save, please try again later', - loadSuccess: 'Loaded successfully', - loadFailure: 'Failed to load, please try again later', - noContent: 'No content found', - loading: 'Loading...', - updateRecommendation: 'Update Recommendation', - addRecommendation: 'Add Recommendation', - } + dialog: { + addTitle: 'Add Recommended Question', + editTitle: 'Edit Recommended Question', + questionContent: 'Recommended Question', + cancel: 'Cancel', + confirm: 'Confirm', + save: 'Save', + }, + message: { + loadSuccess: 'Loaded successfully', + loadFailed: 'Load failed, please try again later', + loadFailedMess: 'Failed to load recommended questions', + notFound: 'Opening statement not found', + saveSuccess: 'Saved successfully', + saveFailed: 'Save failed, please try again later', + addSuccess: 'Recommended question added successfully', + addFailed: 'Failed to add recommended question', + editSuccess: 'Recommended question edited successfully', + editFailed: 'Failed to edit recommended question, please try again later', + deleteSuccess: 'Deleted successfully', + deleteFailed: 'Deletion failed', + }, + confirm: { + save: 'Are you sure you want to save the changes?', + tips: 'Tips', + delete: 'Are you sure you want to delete this recommended question?', + deleteConfirm: 'Delete Confirmation', + }, + placeholder: { + selectType: 'Select chat type', + }, + }, + vabtabs: { + refresh: 'Refresh', + closeOthers: 'Close Others', + closeLeft: 'Close Left', + closeRight: 'Close Right', + closeAll: 'Close All', + }, }, } diff --git a/chat-client/src/locales/zh-TW.ts b/chat-client/src/locales/zh-TW.ts index 7aa378f..563c203 100644 --- a/chat-client/src/locales/zh-TW.ts +++ b/chat-client/src/locales/zh-TW.ts @@ -472,14 +472,14 @@ export default { enterApiValue: '請輸入密鑰值', createBy: '創建人', placeCreateby: '請輸入創建人', - search:'查詢', + search: '查詢', index: '序號', createTime: '創建時間', updateBy: '更新人', updateTime: '更新時間', edit: '編輯', delete: '刪除', - + add: '新增', batchDelete: '批量刪除', refreshCache: '刷新快取', @@ -495,8 +495,8 @@ export default { batchDeleteFail: '批量刪除失敗', dictionaryKey: '密鑰名稱', dictionaryValue: '密鑰值', - show:'顯示', - hide:'隱藏', + show: '顯示', + hide: '隱藏', operation: '操作', remark: '備註', enterRemark: '請輸入備註信息', @@ -507,43 +507,78 @@ export default { refreshCacheFail: '快取刷新失敗', copySuccess: '複製成功', copyFail: '複製失敗', - copy:'複製', + copy: '複製', dictionaryKeyLength: '密鑰名稱長度在 1 到 255 個字符', dictionaryValueLength: '密鑰值長度在 1 到 255 個字符', getApiKeysFail: '获取API密鑰列表失败', - confirmDeleteApiKey: '此操作将永久删除该API密鑰,是否继续?', + confirmDeleteApiKey: '此操作将永久删除该API密鑰,是否继续?', Tip: '提示', selectDeleteData: '請選擇要刪除的數據', confirmDeleteApiKeys: '此操作將永久删除选中的 ', - confirmDeleteApiKeysEnd:' 條API密鑰,是否繼續?', - confirmDeleteApiKeysEndPlural:' 條API密鑰,是否繼續?', + confirmDeleteApiKeysEnd: ' 條API密鑰,是否繼續?', + confirmDeleteApiKeysEndPlural: ' 條API密鑰,是否繼續?', confirmRefreshCache: '此操作將刷新Redis缓存,重新加载所有API密鑰,是否繼續?', updateSuccess: '更新成功', - updateFail:'更新失敗', - addSuccess:'新增成功', - addFail:'新增失敗', + updateFail: '更新失敗', + addSuccess: '新增成功', + addFail: '新增失敗', }, - prologue:{ + prologue: { + title: '開場白管理', + query: '查詢', + save: '儲存', chatType: '聊天類型', - selectChatType: '選擇聊天類型', - prologueContent: '開場白內容', + chatTypes: { + '1': '故障診斷', + '2': '智慧問答', + '3': '圖表報告', + '4': '應急助手問答', + '5': '診斷代碼查詢', + }, + openingContent: '開場白內容', addRecommend: '新增推薦問題', - recommendQuestion: '推薦問題', - actions: '操作', + recommendation: '推薦問題', + action: '操作', edit: '編輯', delete: '刪除', - confirmDelete: '確定要刪除該推薦問題嗎?', - confirmSave: '是否確認保存修改?', - deleteSuccess: '刪除成功', - deleteFailure: '刪除失敗,請稍後重試', - saveSuccess: '保存成功', - saveFailure: '保存失敗,請稍後重試', - loadSuccess: '加載成功', - loadFailure: '加載失敗,請稍後重試', - noContent: '未找到內容', - loading: '加載中...', - updateRecommendation: '更新推薦問題', - addRecommendation: '新增推薦問題', - } + dialog: { + addTitle: '新增推薦問題', + editTitle: '編輯推薦問題', + questionContent: '推薦問題', + cancel: '取消', + confirm: '確認', + save: '儲存', + }, + message: { + loadSuccess: '加載成功', + loadFailed: '加載失敗,請稍後重試', + loadFailedMess: '加載推薦問題失敗', + notFound: '未找到開場白內容', + saveSuccess: '儲存成功', + saveFailed: '儲存失敗,請稍後重試', + addSuccess: '推薦問題新增成功', + addFailed: '新增推薦問題失敗', + editSuccess: '推薦問題編輯成功', + editFailed: '編輯推薦問題失敗,請稍後重試', + deleteSuccess: '刪除成功', + deleteFailed: '刪除失敗', + }, + confirm: { + save: '是否確認儲存修改?', + tips: '提示', + delete: '確定要刪除該推薦問題嗎?', + deleteConfirm: '刪除確認', + }, + placeholder: { + selectType: '選擇聊天類型', + }, + }, + vabtabs: { + refresh: '刷新', + closeOthers: '關閉其他', + closeLeft: '關閉左側', + closeRight: '關閉右側', + closeAll: '關閉全部', + }, }, } diff --git a/chat-client/src/locales/zh.ts b/chat-client/src/locales/zh.ts index 24ef299..a417884 100644 --- a/chat-client/src/locales/zh.ts +++ b/chat-client/src/locales/zh.ts @@ -481,7 +481,7 @@ export default { enterApiValue: '请输入密钥值', createBy: '创建人', placeCreateby: '请输入创建人', - search:'查询', + search: '查询', index: '序号', createTime: '创建时间', updateBy: '更新人', @@ -503,8 +503,8 @@ export default { batchDeleteFail: '批量删除失败', dictionaryKey: '密钥名称', dictionaryValue: '密钥值', - show:'显示', - hide:'隐藏', + show: '显示', + hide: '隐藏', operation: '操作', remark: '备注', enterRemark: '请输入备注信息', @@ -513,45 +513,80 @@ export default { cancel: '取消', refreshCacheSuccess: '缓存刷新成功', refreshCacheFail: '缓存刷新失败', - copy:'复制', + copy: '复制', copySuccess: '复制成功', copyFail: '复制失败', dictionaryKeyLength: '密钥名称长度在 1 到 255 个字符', dictionaryValueLength: '密钥值长度在 1 到 255 个字符', getApiKeysFail: '获取API密钥列表失败', - confirmDeleteApiKey: '此操作将永久删除该API密钥,是否继续?', + confirmDeleteApiKey: '此操作将永久删除该API密钥,是否继续?', Tip: '提示', selectDeleteData: '请选择要删除的数据', confirmDeleteApiKeys: '此操作将永久删除选中的 ', - confirmDeleteApiKeysEnd:' 条API密钥,是否继续?', - confirmDeleteApiKeysEndPlural:' 条API密钥,是否继续?', + confirmDeleteApiKeysEnd: ' 条API密钥,是否继续?', + confirmDeleteApiKeysEndPlural: ' 条API密钥,是否继续?', confirmRefreshCache: '此操作将刷新Redis缓存,重新加载所有API密钥,是否继续?', updateSuccess: '更新成功', updateFail: '更新失败', addSuccess: '新增成功', addFail: '新增失败', }, - prologue:{ + prologue: { + title: '开场白管理', + query: '查询', + save: '保存', chatType: '聊天类型', - selectChatType: '选择聊天类型', - prologueContent: '开场白内容', + chatTypes: { + '1': '故障诊断', + '2': '智能问答', + '3': '图表报告', + '4': '应急助手问答', + '5': '诊断代码查询', + }, + openingContent: '开场白内容', addRecommend: '新增推荐问题', - recommendQuestion: '推荐问题', - actions: '操作', + recommendation: '推荐问题', + action: '操作', edit: '编辑', delete: '删除', - confirmDelete: '确定要删除该推荐问题吗?', - confirmSave: '是否确认保存修改?', - deleteSuccess: '删除成功', - deleteFailure: '删除失败,请稍后重试', - saveSuccess: '保存成功', - saveFailure: '保存失败,请稍后重试', - loadSuccess: '加载成功', - loadFailure: '加载失败,请稍后重试', - noContent: '未找到内容', - loading: '加载中...', - updateRecommendation: '更新推荐问题', - addRecommendation: '新增推荐问题', + dialog: { + addTitle: '新增推荐问题', + editTitle: '编辑推荐问题', + questionContent: '推荐问题', + cancel: '取消', + confirm: '确认', + save: '保存', + }, + message: { + loadSuccess: '加载成功', + loadFailed: '加载失败,请稍后重试', + loadFailedMess: '加载推荐问题失败', + notFound: '未找到开场白内容', + saveSuccess: '保存成功', + saveFailed: '保存失败,请稍后重试', + addSuccess: '推荐问题新增成功', + addFailed: '新增推荐问题失败', + editSuccess: '推荐问题编辑成功', + editFailed: '编辑推荐问题失败,请稍后重试', + deleteSuccess: '删除成功', + deleteFailed: '删除失败', + }, + confirm: { + save: '是否确认保存修改?', + tips: '提示', + delete: '确定要删除该推荐问题吗?', + deleteConfirm:'删除确认' + }, + placeholder: { + selectType: '选择聊天类型', + }, + }, + vabtabs:{ + refresh:'刷新', + closeOthers:'关闭其他', + closeLeft:'关闭左侧', + closeRight:'关闭右侧', + closeAll:'关闭全部' } }, } diff --git a/chat-client/src/views/datasets/components/DocumentList.vue b/chat-client/src/views/datasets/components/DocumentList.vue index 12facab..a99d9e3 100644 --- a/chat-client/src/views/datasets/components/DocumentList.vue +++ b/chat-client/src/views/datasets/components/DocumentList.vue @@ -340,9 +340,13 @@ const renameForm = reactive({ const getFileTypeIcon = (fileType: string) => { // 使用动态导入获取图标路径 + // const getIconUrl = (iconName: string) => { + // return new URL(require(`@/assets/img/filetype-icon/${iconName}.png`), import.meta.url).href + // } const getIconUrl = (iconName: string) => { - return new URL(require(`@/assets/img/filetype-icon/${iconName}.png`), import.meta.url).href - } + return new URL(`/src/assets/img/filetype-icon/${iconName}.png`, import.meta.url).href +} + const iconMap: Record = { 'pdf': getIconUrl('pdf'), diff --git a/chat-client/src/views/permission/prologueManage/index.vue b/chat-client/src/views/permission/prologueManage/index.vue index 3e65e14..8f68b0e 100644 --- a/chat-client/src/views/permission/prologueManage/index.vue +++ b/chat-client/src/views/permission/prologueManage/index.vue @@ -2,46 +2,73 @@ - 查询 - 保存 + {{t('vabI18n.prologue.query')}} + {{t('vabI18n.prologue.save')}} - - - - - - - + + + + + + + - + - 新增推荐问题 + {{t('vabI18n.prologue.addRecommend')}} - - + + + + + + + + + + + + {{t('vabI18n.prologue.dialog.cancel')}} + {{t('vabI18n.prologue.dialog.save')}} + + + + + + + + + + + + {{t('vabI18n.prologue.dialog.cancel')}} + {{t('vabI18n.prologue.dialog.save')}} + + +