From 6a1fed85131ab7fe0060b24774d6a25fd50ddeb4 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Fri, 28 Mar 2025 03:17:09 +0800 Subject: [PATCH] =?UTF-8?q?message=20=E7=BB=84=E4=BB=B6=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/ChatComponent.vue | 155 +++--------- web/src/components/MessageInputComponent.vue | 247 +++++++++++++++++++ web/src/views/AgentView.vue | 127 ++-------- 3 files changed, 296 insertions(+), 233 deletions(-) create mode 100644 web/src/components/MessageInputComponent.vue diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index 94dd4224..39ef061a 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -104,18 +104,17 @@
-
-
- -
-
-
+
+ + -
-
- - - -
-
+ + +

请注意辨别内容的可靠性 By {{ configStore.config?.model_provider }}: {{ configStore.config?.model_name }}

-

请注意辨别内容的可靠性 By {{ configStore.config?.model_provider }}: {{ configStore.config?.model_name }}

@@ -197,6 +191,7 @@ import { message } from 'ant-design-vue' import RefsComponent from '@/components/RefsComponent.vue' import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; +import MessageInputComponent from '@/components/MessageInputComponent.vue' const props = defineProps({ conv: Object, @@ -618,7 +613,7 @@ watch( display: flex; flex-direction: column; overflow-x: hidden; - background: white; + background: var(--main-light-6); position: relative; box-sizing: border-box; flex: 5 5 200px; @@ -629,7 +624,8 @@ watch( position: sticky; top: 0; z-index: 10; - background-color: white; + background-color: rgba(255, 255, 255, 0.9); + backdrop-filter: blur(10px); height: var(--header-height); display: flex; justify-content: space-between; @@ -872,124 +868,29 @@ watch( width: 100%; margin: 0 auto; padding: 4px 2rem 0 2rem; - background: white; - .input-box { - display: flex; - flex-direction: column; + .message-input-wrapper { width: 100%; - height: auto; max-width: 800px; margin: 0 auto; - padding: 0.25rem 0.5rem; - border: 2px solid var(--gray-200); - border-radius: 1rem; - background: var(--gray-50); - transition: background, border 0.3s, box-shadow 0.3s, max-width 0.3s ease; + background-color: white; &.wide-screen { max-width: 1200px; } - &:focus-within { - border: 2px solid var(--main-500); - background: white; + .note { + width: 100%; + font-size: small; + text-align: center; + padding: 0; + color: #ccc; + margin: 4px 0; + user-select: none; } - - .input-options { - display: flex; - padding: 4px 8px; - - .options__left, - .options__right { - display: flex; - align-items: center; - gap: 8px; - } - - .options__left { - flex: 1; - - .opt-item { - border-radius: 12px; - border: 1px solid var(--gray-300); - padding: 4px 8px; - cursor: pointer; - font-size: 12px; - color: var(--gray-700); - - &.active { - color: var(--main-600); - border: 1px solid var(--main-500); - background-color: var(--main-10); - } - } - } - } - - .input-area { - display: flex; - align-items: flex-end; - gap: 8px; - } - - textarea.user-input { - flex: 1; - height: 40px; - padding: 0.5rem 0.5rem; - background-color: transparent; - border: none; - margin: 0 0; - color: #111111; - font-size: 16px; - font-variation-settings: 'wght' 400, 'opsz' 10.5; - outline: none; - resize: none; - &:focus { - outline: none; - box-shadow: none; - } - - &:active { - outline: none; - } - } - } - - button.ant-btn-icon-only { - height: 32px; - width: 32px; - cursor: pointer; - background-color: var(--main-color); - border-radius: 50%; - border: none; - transition: color 0.3s; - box-shadow: none; - color: white; - padding: 0; - - &:hover { - background-color: var(--main-800); - } - - &:disabled { - background-color: var(--gray-400); - cursor: not-allowed; - } - } - .note { - width: 100%; - font-size: small; - text-align: center; - padding: 0rem; - color: #ccc; - margin: 4px 0; - user-select: none; } } - - .ant-dropdown-link { color: var(--gray-900); cursor: pointer; diff --git a/web/src/components/MessageInputComponent.vue b/web/src/components/MessageInputComponent.vue new file mode 100644 index 00000000..30ef2411 --- /dev/null +++ b/web/src/components/MessageInputComponent.vue @@ -0,0 +1,247 @@ + + + + + \ No newline at end of file diff --git a/web/src/views/AgentView.vue b/web/src/views/AgentView.vue index 31fdaf41..8a436450 100644 --- a/web/src/views/AgentView.vue +++ b/web/src/views/AgentView.vue @@ -90,26 +90,18 @@
-
-
- -
-
-
- - - -
-
+
+ +

请注意辨别内容的可靠性

-

请注意辨别内容的可靠性

@@ -167,6 +159,7 @@ import { markedHighlight } from 'marked-highlight'; import { onClickOutside } from '@vueuse/core'; import 'highlight.js/styles/github.css'; import hljs from 'highlight.js'; +import MessageInputComponent from '@/components/MessageInputComponent.vue' // ==================== 初始化配置 ==================== @@ -1232,89 +1225,20 @@ const toggleToolCall = (toolCallId) => { padding: 4px 2rem 0 2rem; background: white; - .input-box { - display: flex; - flex-direction: column; + .message-input-wrapper { width: 100%; - height: auto; max-width: 800px; margin: 0 auto; - padding: 0.25rem 0.5rem; - border: 2px solid var(--gray-200); - border-radius: 1rem; - background: var(--gray-50); - transition: background, border 0.3s, box-shadow 0.3s; - &:focus-within { - border: 2px solid var(--main-500); - background: white; + .note { + width: 100%; + font-size: small; + text-align: center; + padding: 0; + color: #ccc; + margin: 4px 0; + user-select: none; } - - .input-options { - display: flex; - padding: 4px 8px; - justify-content: flex-end; - } - - .input-area { - display: flex; - align-items: flex-end; - gap: 8px; - } - - .user-input { - flex: 1; - height: 40px; - padding: 0.5rem 0.5rem; - background-color: transparent; - border: none; - margin: 0; - color: var(--gray-900); - font-size: 16px; - outline: none; - resize: none; - - &:focus { - outline: none; - box-shadow: none; - } - - &:active { - outline: none; - } - } - } - - button.ant-btn-icon-only { - height: 32px; - width: 32px; - cursor: pointer; - background-color: var(--main-color); - border-radius: 50%; - border: none; - transition: color 0.3s; - box-shadow: none; - color: white; - padding: 0; - - &:hover { - background-color: var(--main-800); - } - - &:disabled { - background-color: var(--gray-400); - cursor: not-allowed; - } - } - - .note { - width: 100%; - font-size: small; - text-align: center; - padding: 0rem; - color: #ccc; - margin: 4px 0; - user-select: none; } } @@ -1481,15 +1405,6 @@ const toggleToolCall = (toolCallId) => { .bottom { padding: 0.5rem 0.5rem; - - .input-box { - border-radius: 8px; - padding: 0.5rem; - } - - .note { - display: none; - } } }