Commit 797a5951 authored by tyyin lan's avatar tyyin lan

fix(首页): 模型菜单选择失效

parent 86dc1589
<script setup lang="ts">
import { computed, nextTick, ref } from 'vue'
import { computed, nextTick, ref, toValue } from 'vue'
import type { AgentApplicationRecordItem, MessageItemInterface } from '../types'
import { fetchAgentApplicationSelectList } from '@/apis/home-agent'
import { nanoid } from 'nanoid'
......@@ -58,8 +58,18 @@ function handleApplicationSelectMenuSwitchShow() {
isShowApplicationSelectMenu.value = !isShowApplicationSelectMenu.value
}
function handleApplicationSelectBtnBlur() {
setTimeout(() => {
isShowApplicationSelectMenu.value = false
}, 100)
}
function handleApplicationChange(agentApplicationItem: AgentApplicationRecordItem) {
currentAgentApplication.value = agentApplicationItem
if (currentAgentApplication.value.agentId === agentApplicationItem.agentId) {
return
}
currentAgentApplication.value = toValue(agentApplicationItem)
}
function handleCreateNewSession() {
......@@ -189,7 +199,7 @@ function handleQuestionSubmitEnter(event: KeyboardEvent) {
<n-button
class="application-select-btn !h-[34px] !rounded-[10px] !p-0"
@click="handleApplicationSelectMenuSwitchShow"
@blur="() => (isShowApplicationSelectMenu = false)"
@blur="handleApplicationSelectBtnBlur"
>
<div class="box-border flex !w-[160px] w-full items-center justify-between px-[12px]">
<div class="mr-[5px] flex flex-1 items-center overflow-hidden">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment