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