From 5e687d9314044c7e682ca5d41ca6be06a48d1328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E9=B8=BF=E5=AE=87?= Date: Wed, 11 Jun 2025 17:09:35 +0800 Subject: [PATCH] chore: clean code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史鸿宇 --- src/assets/styles/main.scss | 4 +- src/assets/styles/theme.scss | 20 ++-- src/views/app/index.vue | 4 +- .../workFlowConfig/yamlEditDrawer.vue | 100 +++++++++--------- .../dialogue/components/DialogueAside.vue | 21 ++-- .../dialogue/components/DialogueSession.vue | 1 - 6 files changed, 76 insertions(+), 74 deletions(-) diff --git a/src/assets/styles/main.scss b/src/assets/styles/main.scss index 6239175..ac1620b 100644 --- a/src/assets/styles/main.scss +++ b/src/assets/styles/main.scss @@ -75,7 +75,7 @@ html.platform-linux { ::-webkit-scrollbar { width: 4px !important; height: 4px !important; - color:var(--o-scrollbar-thumb) !important; + color: var(--o-scrollbar-thumb) !important; } /* 滚动条的滑块 */ @@ -90,4 +90,4 @@ html.platform-linux { ::-webkit-scrollbar-thumb:hover { background-color: var(--o-scrollbar-thumb) !important; /* 鼠标悬停时的滚动条按钮颜色 */ -} \ No newline at end of file +} diff --git a/src/assets/styles/theme.scss b/src/assets/styles/theme.scss index f126799..24823ca 100644 --- a/src/assets/styles/theme.scss +++ b/src/assets/styles/theme.scss @@ -1,9 +1,9 @@ body[theme='dark'] { - --o-content-bg:linear-gradient( - to right, - rgba(109, 117, 250, 0.5), - rgba(90, 179, 255, 0.5) - ); + --o-content-bg: linear-gradient( + to right, + rgba(109, 117, 250, 0.5), + rgba(90, 179, 255, 0.5) + ); --o-main-bg-color: #131415; --o-bg-image: url('../../assets/svgs/dark_background.svg'); --no-work-flow: url('../../assets/images/dark_no_flow.png'); @@ -93,11 +93,11 @@ body[theme='dark'] { } body[theme='light'] { - --o-content-bg:linear-gradient( - to right, - rgba(109, 117, 250, 0.2), - rgba(90, 179, 255, 0.2) - ); + --o-content-bg: linear-gradient( + to right, + rgba(109, 117, 250, 0.2), + rgba(90, 179, 255, 0.2) + ); --o-main-bg-color: #f1f8ff; --o-bg-image: url('../../assets/svgs/light_background.webp'); --no-work-flow: url('../../assets/images/light_no_flow.png'); diff --git a/src/views/app/index.vue b/src/views/app/index.vue index a9003b1..eb9647c 100644 --- a/src/views/app/index.vue +++ b/src/views/app/index.vue @@ -238,7 +238,7 @@ const handleCreateApp = async (appType: 'flow' | 'agent') => { } }; -const routerToDetail = async(appItem) => { +const routerToDetail = async (appItem) => { if (!appItem.published) { //未发布应用不允许跳转 return; @@ -246,7 +246,7 @@ const routerToDetail = async(appItem) => { await createNewSession().finally(() => { //保证跳转后一定是一条选中的新会话 router.push(`/?appId=${appItem.appId}&name=${appItem.name}`); - }) + }); currentSelectedSession.value = ''; }; diff --git a/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue b/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue index 7d5fe3f..a84090a 100644 --- a/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue +++ b/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue @@ -218,74 +218,74 @@ const updateNodeYaml = () => { :deep(.el-collapse-item__arrow .is-active) { top: 0px !important; } -:deep(.el-collapse-item){ +:deep(.el-collapse-item) { margin-top: 0px; } -:deep(.el-drawer__header){ - padding:24px 24px 16px !important; +:deep(.el-drawer__header) { + padding: 24px 24px 16px !important; margin-bottom: 0px; } .yamlMonacoEditor { height: 400px; } - :deep(.el-drawer__body) { - padding: 0px 24px 16px !important; - .drawerBody { - height: 100%; - .yamlContent { - .el-collapse-item__header { - padding: 0; - height: 22px; - line-height: 22px; - margin-bottom: 8px; - font-size: 14px; - display: flex; - gap: 4px; - span { - color: var(--o-text-color-primary); - } +:deep(.el-drawer__body) { + padding: 0px 24px 16px !important; + .drawerBody { + height: 100%; + .yamlContent { + .el-collapse-item__header { + padding: 0; + height: 22px; + line-height: 22px; + margin-bottom: 8px; + font-size: 14px; + display: flex; + gap: 4px; + span { + color: var(--o-text-color-primary); } - .el-collapse-item__content { - margin-left: 20px; - .cm-editor { - .cm-lineNumbers { - .cm-gutterElement { - min-width: 31px; - padding-left: 0 0 0 9px; - text-align: center; - } - } - .cm-foldGutter { - padding-left: 0; + } + .el-collapse-item__content { + margin-left: 20px; + .cm-editor { + .cm-lineNumbers { + .cm-gutterElement { + min-width: 31px; + padding-left: 0 0 0 9px; + text-align: center; } } - .baseInfo { - .el-form{ - margin-top:0px + .cm-foldGutter { + padding-left: 0; + } + } + .baseInfo { + .el-form { + margin-top: 0px; + } + .el-form-item { + display: flex; + gap: 24px; + .el-form-item__label { + margin-left: -8px; + padding-right: 0px; } - .el-form-item { - display: flex; - gap: 24px; - .el-form-item__label { - margin-left: -8px; - padding-right: 0px; - } - .el-form-item__content { - flex: 1; - .el-textarea__inner { - height: 56px; - } + .el-form-item__content { + flex: 1; + .el-textarea__inner { + height: 56px; } } } } } - textarea { - width: 100%; - height: 100%; - } + } + textarea { + width: 100%; + height: 100%; } } +} .monacoEditorMask { .view-lines { position: relative; diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index 0ff258f..4585f3f 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -13,7 +13,7 @@ import { } from 'element-plus'; import { computed, onMounted, ref, watch } from 'vue'; import SessionCard from '@/components/sessionCard/SessionCard.vue'; -import * as _ from 'lodash' +import * as _ from 'lodash'; import { useAccountStore, useHistorySessionStore, @@ -257,14 +257,17 @@ const toggleCollapse = () => { isCollapsed.value = !isCollapsed.value; }; -const handleNewChat = _.debounce(() => { - selectedAppId.value = ''; - user_selected_app.value = ''; - app.value.selectedAppId = ''; - app.value.appId = ''; - createNewSession(); -},500, { leading: true, trailing: false }) - +const handleNewChat = _.debounce( + () => { + selectedAppId.value = ''; + user_selected_app.value = ''; + app.value.selectedAppId = ''; + app.value.appId = ''; + createNewSession(); + }, + 500, + { leading: true, trailing: false }, +); const selectApp = (id) => { if (selectedAppId.value === id) { diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 7c944f5..63f836a 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -926,7 +926,6 @@ button[disabled]:hover { justify-content: space-between; min-width: 500px; - &::before { content: ''; width: 100%; -- Gitee