【解决todo】AI 对话显示隐藏效果

This commit is contained in:
cherishsince 2024-05-21 21:50:28 +08:00
parent a8cf6b6f29
commit 2d7bf84593

View File

@ -37,6 +37,8 @@
v-for="conversation in conversationMap[conversationKey]" v-for="conversation in conversationMap[conversationKey]"
:key="conversation.id" :key="conversation.id"
@click="handleConversationClick(conversation.id)" @click="handleConversationClick(conversation.id)"
@mouseover="hoverConversationId = conversation.id"
@mouseout="hoverConversationId = ''"
> >
<div <div
:class="conversation.id === activeConversationId ? 'conversation active' : 'conversation'" :class="conversation.id === activeConversationId ? 'conversation active' : 'conversation'"
@ -46,7 +48,7 @@
<span class="title">{{ conversation.title }}</span> <span class="title">{{ conversation.title }}</span>
</div> </div>
<!-- TODO done @fan缺一个置顶按钮效果改成 hover 上去展示 --> <!-- TODO done @fan缺一个置顶按钮效果改成 hover 上去展示 -->
<div class="button-wrapper"> <div class="button-wrapper" v-show="hoverConversationId === conversation.id">
<el-button class="btn" link @click.stop="handlerTop(conversation)" > <el-button class="btn" link @click.stop="handlerTop(conversation)" >
<el-icon title="置顶" v-if="!conversation.pinned"><Top /></el-icon> <el-icon title="置顶" v-if="!conversation.pinned"><Top /></el-icon>
<el-icon title="置顶" v-if="conversation.pinned"><Bottom /></el-icon> <el-icon title="置顶" v-if="conversation.pinned"><Bottom /></el-icon>
@ -104,6 +106,7 @@ const message = useMessage() // 消息弹窗
// //
const searchName = ref<string>('') // const searchName = ref<string>('') //
const activeConversationId = ref<string | null>(null) // null const activeConversationId = ref<string | null>(null) // null
const hoverConversationId = ref<string | null>(null) //
const conversationList = ref([] as ChatConversationVO[]) // const conversationList = ref([] as ChatConversationVO[]) //
const conversationMap = ref<any>({}) // () const conversationMap = ref<any>({}) // ()
const drawer = ref<boolean>(false) // const drawer = ref<boolean>(false) //
@ -456,7 +459,6 @@ onMounted(async () => {
.btn { .btn {
margin: 0; margin: 0;
} }
} }
} }
} }