From 7fcd8d4fce90652d42972b757afc322a80b9ec09 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:51:09 +0800 Subject: [PATCH] perf: Optimize front-end code --- .../component/chat-input-operate/index.vue | 4 +- .../ai-chat/component/control/index.vue | 2 +- .../ExecutionDetailContent.vue | 1232 +++++++++-------- .../ai-chat/component/user-form/index.vue | 10 +- ui/src/components/ai-chat/index.vue | 4 +- ui/src/components/back-button/index.vue | 6 +- ui/src/components/folder-tree/index.vue | 2 + ui/src/components/markdown/EchartsRander.vue | 3 +- ui/src/components/markdown/HtmlRander.vue | 2 +- .../components/markdown/MdEditorMagnify.vue | 2 +- .../select-knowledge-document/index.vue | 4 +- .../component/APIKeyDialog.vue | 3 +- .../component/DisplaySettingDialog.vue | 2 +- .../component/LimitDialog.vue | 2 +- .../component/SettingAPIKeyDialog.vue | 2 +- .../component/StatisticsCharts.vue | 1 - ui/src/views/application-overview/index.vue | 2 - .../XPackDisplaySettingDialog.vue | 2 - .../xpack-component/XPackLimitDrawer.vue | 1 - ui/src/views/application-workflow/index.vue | 10 +- .../views/application/ApplicationSetting.vue | 1 - .../component/CopyApplicationDialog.vue | 3 +- .../component/CreateApplicationDialog.vue | 1 - .../component/ParamSettingDialog.vue | 1 - ui/src/views/chat-log/index.vue | 1 - .../model/component/CreateModelDialog.vue | 2 +- ui/src/views/model/component/EditModel.vue | 2 +- .../paragraph/component/ParagraphDialog.vue | 2 +- .../paragraph/component/ProblemComponent.vue | 6 +- ui/src/views/paragraph/index.vue | 2 +- .../problem/component/RelateProblemDialog.vue | 9 +- .../ApplicationResourceIndex.vue | 1 - .../ModelResourceIndex.vue | 2 +- ui/src/views/system-setting/theme/index.vue | 1 - .../AuthorizedWorkspaceDialog.vue | 9 +- .../system-shared/KnowLedgeSharedIndex.vue | 4 +- .../views/system-shared/ModelSharedIndex.vue | 3 +- .../views/system-shared/ToolSharedIndex.vue | 3 +- ui/src/views/system/operate-log/index.vue | 5 +- .../views/tool/component/EditAvatarDialog.vue | 1 - 40 files changed, 751 insertions(+), 604 deletions(-) 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 dcdb8aa9f..f1c4dfaea 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 @@ -372,7 +372,7 @@ const imageExtensions = ['JPG', 'JPEG', 'PNG', 'GIF', 'BMP'] const documentExtensions = ['PDF', 'DOCX', 'TXT', 'XLS', 'XLSX', 'MD', 'HTML', 'CSV'] const videoExtensions: any = [] const audioExtensions = ['MP3', 'WAV', 'OGG', 'AAC', 'M4A'] -let otherExtensions = ref(['PPT', 'DOC']) +const otherExtensions = ref(['PPT', 'DOC']) const getAcceptList = () => { const { image, document, audio, video, other } = props.applicationDetails.file_upload_setting @@ -554,7 +554,7 @@ const switchMicrophone = (status: boolean) => { } } -const TouchEnd = (bool?: Boolean) => { +const TouchEnd = (bool?: boolean) => { if (bool) { stopRecording() recorderStatus.value = 'STOP' diff --git a/ui/src/components/ai-chat/component/control/index.vue b/ui/src/components/ai-chat/component/control/index.vue index 4b4645b16..bb9a3ce54 100644 --- a/ui/src/components/ai-chat/component/control/index.vue +++ b/ui/src/components/ai-chat/component/control/index.vue @@ -99,7 +99,7 @@ const menus = ref([ */ const clearSelectedText = () => { if (window.getSelection) { - var selection = window.getSelection() + const selection = window.getSelection() if (selection) { selection.removeAllRanges() } diff --git a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue index c777f25ac..26065a81c 100644 --- a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue +++ b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailContent.vue @@ -1,253 +1,106 @@