From 32dd4b41b6a28583fdc98baac6f09946975c2db1 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 2 Jul 2025 17:46:39 +0800 Subject: [PATCH] feat: user input --- ui/package.json | 4 +- .../component/chat-input-operate/index.vue | 62 ++++++-- .../ai-chat/component/user-form/index.vue | 105 ++++++------- ui/src/components/ai-chat/index.vue | 18 ++- .../components/app-icon/icons/application.ts | 21 +++ ui/src/stores/modules/chat-user.ts | 8 +- ui/src/stores/modules/theme.ts | 3 +- ui/src/stores/modules/user.ts | 2 +- ui/src/views/404/index.vue | 4 +- ui/src/views/chat/auth/index.vue | 9 -- ui/src/views/chat/pc/index.vue | 146 ++++++++++++------ ui/vite.config.ts | 5 +- 12 files changed, 241 insertions(+), 146 deletions(-) diff --git a/ui/package.json b/ui/package.json index e921cb1a6..d1690294a 100644 --- a/ui/package.json +++ b/ui/package.json @@ -29,10 +29,10 @@ "cropperjs": "^2.0.0-rc.2", "dingtalk-jsapi": "^3.1.0", "echarts": "^5.6.0", - "element-plus": "^2.9.10", + "element-plus": "^2.10.2", "file-saver": "^2.0.5", - "katex": "^0.16.10", "highlight.js": "^11.11.1", + "katex": "^0.16.10", "md-editor-v3": "^5.6.1", "mermaid": "^11.6.0", "moment": "^2.30.1", 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 b88162060..adc4c0160 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 @@ -169,6 +169,8 @@ v-else ref="quickInputRef" v-model="inputValue" + :autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }" + type="textarea" :placeholder=" recorderStatus === 'START' ? `${$t('chat.inputPlaceholder.speaking')}...` @@ -176,27 +178,17 @@ ? `${$t('chat.inputPlaceholder.recorderLoading')}...` : $t('chat.inputPlaceholder.default') " - :autosize="{ minRows: 1, maxRows: isMobile ? 4 : 10 }" - type="textarea" :maxlength="100000" @keydown.enter="sendChatHandle($event)" @paste="handlePaste" @drop="handleDrop" + class="chat-operate-textarea" />
- +
-
- - + +
{{ row.abstract }} @@ -146,12 +165,14 @@ - {{ chatUser.chatUserProfile?.nick_name }} + {{ + chatUser.chatUserProfile?.nick_name + }}
- - + - +
@@ -237,14 +273,25 @@
- +

{{ rightPanelTitle }}

- - + +
@@ -257,7 +304,11 @@ - + @@ -288,11 +339,14 @@ const EditTitleDialogRef = ref() const isCollapse = ref(false) const isPcCollapse = ref(false) -watch(() => common.device, () => { - if (common.isMobile()) { - isPcCollapse.value = false - } -}) +watch( + () => common.device, + () => { + if (common.isMobile()) { + isPcCollapse.value = false + } + }, +) const logout = () => { chatUser.logout().then(() => { @@ -550,7 +604,7 @@ async function openExecutionDetail(row: any) { } } -async function openKnowledgeSource (row: any) { +async function openKnowledgeSource(row: any) { rightPanelTitle.value = t('chat.KnowledgeSource.title') rightPanelType.value = 'knowledgeSource' // TODO 数据 @@ -617,13 +671,12 @@ function closeExecutionDetail() { margin: 16px; box-sizing: border-box; &:hover { - background-color: #1F23291A; + background-color: #1f23291a; } } } &.el-menu--collapse { - .el-menu-item, .el-menu-tooltip__trigger, .el-sub-menu__title { @@ -643,7 +696,7 @@ function closeExecutionDetail() { .el-menu-item:hover .el-menu-tooltip__trigger, .el-sub-menu__title:hover { - background-color: #1F23291A; + background-color: #1f23291a; } .user-info { @@ -663,8 +716,8 @@ function closeExecutionDetail() { .pc-collapse { position: absolute; top: 20px; - right: -12px; - box-shadow: 0px 5px 10px 0px #1F23291A; + right: -15px; + box-shadow: 0px 5px 10px 0px #1f23291a; } } @@ -678,7 +731,8 @@ function closeExecutionDetail() { height: calc(100vh - 85px); } - .el-splitter-bar__collapse-icon, .el-splitter-bar__dragger { + .el-splitter-bar__collapse-icon, + .el-splitter-bar__dragger { display: none; } .execution-detail-panel { @@ -741,10 +795,10 @@ function closeExecutionDetail() { padding-left: 8px; padding-right: 8px; &:hover { - background-color: #1F23291A; + background-color: #1f23291a; } &.is-active { - background-color: #3370FF1A; + background-color: #3370ff1a; } } } diff --git a/ui/vite.config.ts b/ui/vite.config.ts index cc75c9ef7..bd20e1cb6 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -36,8 +36,8 @@ export default defineConfig((conf: any) => { const ENV = loadEnv(mode, envDir) const proxyConf: Record = {} proxyConf['/admin/api'] = { - //target: 'http://47.92.195.88:8080/', - target: 'http://127.0.0.1:8080', + target: 'http://47.92.195.88:8080/', + // target: 'http://127.0.0.1:8080', changeOrigin: true, } proxyConf['/oss'] = { @@ -46,6 +46,7 @@ export default defineConfig((conf: any) => { rewrite: (path: string) => path.replace(ENV.VITE_BASE_PATH, '/'), } proxyConf['/chat/api'] = { + // target: 'http://47.92.195.88:8080/', target: 'http://127.0.0.1:8080', changeOrigin: true, }