style(web): 优化部分细节
This commit is contained in:
parent
80f97cc2d9
commit
5fa89ddc85
@ -1349,7 +1349,7 @@ watch(
|
||||
background: var(--gray-0);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px var(--shadow-1);
|
||||
border: 1px solid var(--gray-200);
|
||||
border: 1px solid var(--gray-150);
|
||||
min-width: 0;
|
||||
will-change: flex-basis;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<MessageInputComponent
|
||||
ref="inputRef"
|
||||
:key="inputKey"
|
||||
:model-value="modelValue"
|
||||
@update:modelValue="updateValue"
|
||||
:is-loading="isLoading"
|
||||
@ -48,7 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import MessageInputComponent from '@/components/MessageInputComponent.vue'
|
||||
import ImagePreviewComponent from '@/components/ImagePreviewComponent.vue'
|
||||
@ -84,6 +85,20 @@ const emit = defineEmits([
|
||||
const inputRef = ref(null)
|
||||
const currentImage = ref(null)
|
||||
|
||||
// 用于强制重建输入组件的 key
|
||||
const inputKey = ref(0)
|
||||
|
||||
// 监听 hasStateContent 变化,当从有 state 切换到无 state 时重建组件
|
||||
watch(
|
||||
() => props.hasStateContent,
|
||||
(newVal, oldVal) => {
|
||||
// 当 hasStateContent 从 true 变为 false 时,重建输入组件
|
||||
if (oldVal === true && newVal === false) {
|
||||
inputKey.value++
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const updateValue = (val) => {
|
||||
emit('update:modelValue', val)
|
||||
}
|
||||
@ -110,12 +125,14 @@ const handleAttachmentUpload = async (files) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const hide = message.loading({ content: '正在上传附件...', key: 'upload-attachment', duration: 0 })
|
||||
for (const file of files) {
|
||||
await threadApi.uploadThreadAttachment(threadId, file)
|
||||
message.success(`${file.name} 上传成功`)
|
||||
}
|
||||
message.success({ content: '附件上传成功', key: 'upload-attachment', duration: 2 })
|
||||
emit('attachment-changed', threadId)
|
||||
} catch (error) {
|
||||
message.destroy('upload-attachment')
|
||||
handleChatError(error, 'upload')
|
||||
}
|
||||
}
|
||||
|
||||
@ -565,7 +565,7 @@ const stopResize = () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 12px;
|
||||
padding: 4px 16px;
|
||||
height: 40px;
|
||||
background: var(--gray-25);
|
||||
flex-shrink: 0;
|
||||
@ -623,7 +623,7 @@ const stopResize = () => {
|
||||
background: var(--gray-25);
|
||||
position: relative;
|
||||
align-items: center;
|
||||
padding: 8px 6px;
|
||||
padding: 8px 10px;
|
||||
padding-top: 0px;
|
||||
gap: 4px;
|
||||
flex-shrink: 0;
|
||||
@ -655,7 +655,7 @@ const stopResize = () => {
|
||||
.tab-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 16px;
|
||||
padding: 8px;
|
||||
min-height: 0; /* Important for flex child scroll */
|
||||
|
||||
/* 自定义滚动条 */
|
||||
@ -1020,7 +1020,6 @@ const stopResize = () => {
|
||||
|
||||
/* Specific Ant Design Tree Overrides */
|
||||
.file-tree-container :deep(.ant-tree) {
|
||||
background: var(--gray-25);
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user