diff --git a/package.json b/package.json index 5e6b4e2d16a4991e14ea72228790feae03dd18b6..55a4918177c28bb2738548dd449d096c94cfd39d 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "element-plus": "2.8.0", "highlight.js": "11.10.0", "js-yaml": "^4.1.0", + "lodash": "^4.17.21", "marked": "^15.0.8", "marked-highlight": "^2.2.1", "monaco-editor": "^0.52.2", diff --git a/patches/monaco-editor.patch b/patches/monaco-editor.patch new file mode 100644 index 0000000000000000000000000000000000000000..a05281b8637a7b27638d5f851a0eb76d32b11908 --- /dev/null +++ b/patches/monaco-editor.patch @@ -0,0 +1,13 @@ +diff --git a/esm/vs/editor/contrib/clipboard/browser/clipboard.js b/esm/vs/editor/contrib/clipboard/browser/clipboard.js +index a1deb14b9174989775f3bbe2c7d2370644633237..89691c6b59dc198891dd2afe88e9a156da41c99c 100644 +--- a/esm/vs/editor/contrib/clipboard/browser/clipboard.js ++++ b/esm/vs/editor/contrib/clipboard/browser/clipboard.js +@@ -201,7 +201,7 @@ if (PasteAction) { + if (result) { + return CopyPasteController.get(focusedEditor)?.finishedPaste() ?? Promise.resolve(); + } +- else if (platform.isWeb) { ++ else { + // Use the clipboard service if document.execCommand('paste') was not successful + return (async () => { + const clipboardText = await clipboardService.readText(); diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8861e28c9963848a555b21700e8903c3a948880b..439f72af487d71f0b9879ad2166daec7d379ca76 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,3 +3,5 @@ onlyBuiltDependencies: - electron - esbuild - vue-demi +patchedDependencies: + monaco-editor: patches/monaco-editor.patch diff --git a/src/assets/styles/main.scss b/src/assets/styles/main.scss index dde14f5b6cfff0e6c9595438dcdc62cc65c18ba0..6239175e2de85274a6df5c2f0ebe50c943f60c52 100644 --- a/src/assets/styles/main.scss +++ b/src/assets/styles/main.scss @@ -66,3 +66,28 @@ html.platform-linux { } } } +/* 滚动条轨道样式 */ +::-webkit-scrollbar-track { + background-image: linear-gradient(180deg, #e7f0fd 1%, #daeafc 40%) !important; + display: none !important; +} + +::-webkit-scrollbar { + width: 4px !important; + height: 4px !important; + color:var(--o-scrollbar-thumb) !important; +} + +/* 滚动条的滑块 */ +::-webkit-scrollbar-thumb { + background-color: var(--o-scrollbar-thumb) !important; + border-radius: 3px !important; +} +::-webkit-scrollbar-corner { + background: transparent !important; +} + +::-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 60a147f6eacc3916eb37adb3b1cdedf6833079b6..f12679944196586fdb522d2adab6b5751ea11174 100644 --- a/src/assets/styles/theme.scss +++ b/src/assets/styles/theme.scss @@ -1,4 +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-main-bg-color: #131415; --o-bg-image: url('../../assets/svgs/dark_background.svg'); --no-work-flow: url('../../assets/images/dark_no_flow.png'); @@ -83,11 +88,16 @@ body[theme='dark'] { --expand-fold-default: url('../../assets/svgs/dark_expand_fold.svg'); --expand-fold-hover: url('../../assets/svgs/dark_expand_fold_hover.svg'); --expand-fold-active: url('../../assets/svgs/dark_expand_fold_active.svg'); - --o-scrollbar-thumb: #d3dce9; + --o-scrollbar-thumb: #576372; --o-apiBox-bg: rgb(253, 254, 255); } body[theme='light'] { + --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/components/commonFooter/CommonFooter.vue b/src/components/commonFooter/CommonFooter.vue index a02803d46760a9573594a2377db3aa29998b95ca..b077064c58431156780f9631a629bc76c224b41f 100644 --- a/src/components/commonFooter/CommonFooter.vue +++ b/src/components/commonFooter/CommonFooter.vue @@ -120,30 +120,6 @@ const readPolicy = async () => { color: var(--o-text-color-primary); font-weight: 700 !important; } - - ::-webkit-scrollbar-track { - background-image: linear-gradient( - 180deg, - #e7f0fd 1%, - #daeafc 40% - ) !important; - display: none; - } - - ::-webkit-scrollbar { - width: 3px; - height: 3px; - display: none; - } - - ::-webkit-scrollbar-thumb { - background-color: #d3dce9 !important; - border-radius: 3px; - } - - .el-scrollbar__thumb { - width: 1px; - } } :deep(.dialog .el-dialog__header) { margin-right: 0px; diff --git a/src/components/dialoguePanel/DialoguePanel.scss b/src/components/dialoguePanel/DialoguePanel.scss index deec3a7f7303d489b7f714352e6bd27b6df3d3f2..fbe8fdbce4d0423f6ac6fd0b4e2db67e6cd5e5d8 100644 --- a/src/components/dialoguePanel/DialoguePanel.scss +++ b/src/components/dialoguePanel/DialoguePanel.scss @@ -257,11 +257,7 @@ // align-items: center; color: var(--o-text-color-primary); margin-left: 45px; - background-image: linear-gradient( - to right, - rgba(109, 117, 250, 0.2), - rgba(90, 179, 255, 0.2) - ); + background-image: var(--o-content-bg); .messaege { top: 10px; margin-top: 24px; diff --git a/src/components/sessionCard/SessionDropDown.vue b/src/components/sessionCard/SessionDropDown.vue index 2cdfe448c04ef3a9a7196b77460f89edc70f90e4..1f56b7175f3c670b09d0dd442e2aefc8554f9f64 100644 --- a/src/components/sessionCard/SessionDropDown.vue +++ b/src/components/sessionCard/SessionDropDown.vue @@ -118,26 +118,6 @@ const handleLeave = () => { } } -/* 滚动条轨道样式 */ -::-webkit-scrollbar-track { - background-image: linear-gradient(180deg, #e7f0fd 1%, #daeafc 40%) !important; - display: none; -} - -::-webkit-scrollbar { - width: 3px; - height: 3px; -} - -/* 滚动条的滑块 */ -::-webkit-scrollbar-thumb { - background-color: #c3cedf; - border-radius: 3px; -} -::-webkit-scrollbar-corner { - background: transparent; -} - /* transition 动画 */ .drop-enter-from { max-height: 0px; diff --git a/src/store/historySession.ts b/src/store/historySession.ts index 7db254a01362965d3deb6219eeb72620c98ff548..9b702d5e0527149a8893773ea7da63ef157b9d70 100644 --- a/src/store/historySession.ts +++ b/src/store/historySession.ts @@ -156,7 +156,6 @@ export const useHistorySessionStore = defineStore( if (!currentSelectedSession.value) { currentSelectedSession.value = res.result.conversations[0]?.conversationId; - //----- } if (currentSelectedSession.value) { const { getConversation, isAnswerGenerating } = useSessionStore(); diff --git a/src/views/api/style.scss b/src/views/api/style.scss index 6717f7242191349ef5aa749fcc847a7edaa46028..403e381a8e2d746c3bada28f49aef72844b305ad 100644 --- a/src/views/api/style.scss +++ b/src/views/api/style.scss @@ -171,11 +171,6 @@ } } } - ::-webkit-scrollbar { - width: 4px; - height: 8px; - background: transparent; - } @media screen and (width <= 1400px) { .apiCenterCardContainer { width: 1000px; diff --git a/src/views/app/index.vue b/src/views/app/index.vue index fc09cd07ab6365288f209a80b0872776958900a4..a9003b1ab5ec1d6a32c2e34d7dafa2d568323776 100644 --- a/src/views/app/index.vue +++ b/src/views/app/index.vue @@ -192,6 +192,7 @@ const router = useRouter(); const { t } = useI18n(); const { currentSelectedSession } = storeToRefs(useHistorySessionStore()); +const { createNewSession } = useHistorySessionStore(); const appType = ref('my'); const appSearchValue = ref(); const appList = ref([]); @@ -237,14 +238,15 @@ const handleCreateApp = async (appType: 'flow' | 'agent') => { } }; -const routerToDetail = (appItem) => { +const routerToDetail = async(appItem) => { if (!appItem.published) { //未发布应用不允许跳转 return; } - //获取appItem.id & appItem.name - router.push(`/?appId=${appItem.appId}&name=${appItem.name}`); - //保证跳转后一定是一条选中的新会话 + await createNewSession().finally(() => { + //保证跳转后一定是一条选中的新会话 + router.push(`/?appId=${appItem.appId}&name=${appItem.name}`); + }) currentSelectedSession.value = ''; }; diff --git a/src/views/app/style.scss b/src/views/app/style.scss index ef7ef5dc3a4999a330d12d72be2d652cb2758670..2e26280cdec845183e8fe8f4af38ae358354551c 100644 --- a/src/views/app/style.scss +++ b/src/views/app/style.scss @@ -216,11 +216,6 @@ } } } - ::-webkit-scrollbar { - width: 4px; - height: 8px; - background: transparent; - } @media screen and (width <= 1400px) { .appCenterCardContainer { width: 1004px; diff --git a/src/views/createapp/components/appConfig.vue b/src/views/createapp/components/appConfig.vue index ab0e84e000d09bc4c603730b77997a356d608aa1..42472b8d4b9d69c671adb768ffbef972ae224f53 100644 --- a/src/views/createapp/components/appConfig.vue +++ b/src/views/createapp/components/appConfig.vue @@ -579,22 +579,4 @@ defineExpose({ diff --git a/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue b/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue index 1a22dba1178a19780c90a7ae5801ed1d6ea31b3f..7d5fe3f03495cd9f1b151cf1fdf78ee556db4dfd 100644 --- a/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue +++ b/src/views/createapp/components/workFlowConfig/yamlEditDrawer.vue @@ -218,52 +218,18 @@ const updateNodeYaml = () => { :deep(.el-collapse-item__arrow .is-active) { top: 0px !important; } +:deep(.el-collapse-item){ + margin-top: 0px; +} +:deep(.el-drawer__header){ + padding:24px 24px 16px !important; + margin-bottom: 0px; +} .yamlMonacoEditor { height: 400px; } - -.monacoEditorMask { - .view-lines { - position: relative; - } - .view-lines { - pointer-events: none; - } - .view-lines::after { - content: ''; - display: block; - position: absolute; - width: 100%; - height: 100%; - background: #c3cedf; - opacity: 0.3; - pointer-events: none; - } -} -.flowDrawer.el-drawer { - padding: 0px; - background-color: var(--o-bg-color-base); - top: 48px; - width: 700px !important; - height: calc(100% - 48px); - .el-drawer__header { - font-weight: 700; - padding: 24px 24px 16px; - margin-bottom: 0px; - .drawerHeader { - width: 100%; - height: 24px; - line-height: 24px; - font-weight: 700; - font-size: 16px; - color: var(--o-text-color-primary); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - .el-drawer__body { - padding: 0px 24px 16px; + :deep(.el-drawer__body) { + padding: 0px 24px 16px !important; .drawerBody { height: 100%; .yamlContent { @@ -275,6 +241,9 @@ const updateNodeYaml = () => { font-size: 14px; display: flex; gap: 4px; + span { + color: var(--o-text-color-primary); + } } .el-collapse-item__content { margin-left: 20px; @@ -291,6 +260,9 @@ const updateNodeYaml = () => { } } .baseInfo { + .el-form{ + margin-top:0px + } .el-form-item { display: flex; gap: 24px; @@ -314,6 +286,46 @@ const updateNodeYaml = () => { } } } +.monacoEditorMask { + .view-lines { + position: relative; + } + .view-lines { + pointer-events: none; + } + .view-lines::after { + content: ''; + display: block; + position: absolute; + width: 100%; + height: 100%; + background: #c3cedf; + opacity: 0.3; + pointer-events: none; + } +} +.flowDrawer.el-drawer { + padding: 0px; + background-color: var(--o-bg-color-base); + top: 48px; + width: 700px !important; + height: calc(100% - 48px); + .el-drawer__header { + font-weight: 700; + padding: 24px 24px 8px !important; + margin-bottom: 0px; + .drawerHeader { + width: 100%; + height: 24px; + line-height: 24px; + font-weight: 700; + font-size: 16px; + color: var(--o-text-color-primary); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } .el-drawer__footer { box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.1); padding: 0px 24px; diff --git a/src/views/createapp/index.vue b/src/views/createapp/index.vue index deea456d70af67076991ab2edc5133d91f94a20a..b1199aff1b08eb11e5cf888b8200a498903bb63e 100644 --- a/src/views/createapp/index.vue +++ b/src/views/createapp/index.vue @@ -303,19 +303,4 @@ function onDebugSuccess(status: boolean) { diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index 3d73b0c5efe4e5f00b1ee5c9478a35b94f760700..0ff258fe31ea2209639c08f57a1a2965c34dd609 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -13,6 +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 { useAccountStore, useHistorySessionStore, @@ -256,13 +257,14 @@ const toggleCollapse = () => { isCollapsed.value = !isCollapsed.value; }; -const handleNewChat = () => { +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) { @@ -772,24 +774,6 @@ watch( flex-direction: column; position: relative; overflow: auto; - /* 滚动条轨道样式 */ - ::-webkit-scrollbar-track { - background-color: transparent !important; - } - - ::-webkit-scrollbar { - background-color: transparent !important; - left: 12px; - width: 3px; - height: 3px; - } - - /* 滚动条的滑块 */ - ::-webkit-scrollbar-thumb { - background-color: #d3dce9 !important; - border-radius: 3px; - } - &-blogroll { display: block; padding-right: 24px; @@ -822,12 +806,6 @@ watch( } } - /* 滚动条滑块hover样式 */ - ::-webkit-scrollbar-thumb:hover { - background-color: #d3dce9 !important; - /* 鼠标悬停时的滚动条按钮颜色 */ - } - &-tips { font-size: 12px; color: #8d98aa; diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 184e8c8c5f66549e7f1dc54f37a13daf046dc54e..7c944f5ed1d8d4ab0076585d8d6c1ebeeba48bbe 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -926,28 +926,6 @@ button[disabled]:hover { justify-content: space-between; min-width: 500px; - /* 滚动条轨道样式 */ - ::-webkit-scrollbar-track { - background-image: linear-gradient( - 180deg, - #e7f0fd 1%, - #daeafc 40% - ) !important; - display: none; - } - - ::-webkit-scrollbar { - width: 3px; - height: 3px; - // display: none; - } - - /* 滚动条的滑块 */ - ::-webkit-scrollbar-thumb { - background-color: #c3cedf; - border-radius: 3px; - // display: none; - } &::before { content: '';