fix(chat): 修改智能体列表
This commit is contained in:
1 parent
cafce5cfa9
commit
7e4a2037d8
8 files changed
+71
-17
No files matched your search
@@ -16,10 +16,12 @@ import {
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
agents: AgentWithCategory[];
|
||||
activeAgentId?: number | null;
|
||||
compact?: boolean;
|
||||
showSearch?: boolean;
|
||||
defaultExpanded?: boolean;
|
||||
}>(), {
|
||||
activeAgentId: null,
|
||||
compact: false,
|
||||
showSearch: true,
|
||||
defaultExpanded: true,
|
||||
@@ -72,7 +74,10 @@ const toggleCategory = (category: string) => {
|
||||
|
||||
const isCategoryCollapsed = (category: string) => collapsedCategories.value.has(category);
|
||||
|
||||
const isActiveAgent = (agent: AgentWithCategory) => agent.id === props.activeAgentId;
|
||||
|
||||
const onSelect = (agent: AgentWithCategory) => {
|
||||
if (isActiveAgent(agent)) return;
|
||||
emit('select', agent);
|
||||
};
|
||||
</script>
|
||||
@@ -119,7 +124,11 @@ const onSelect = (agent: AgentWithCategory) => {
|
||||
v-for="agent in subGroup.agents"
|
||||
:key="agent.id"
|
||||
type="button"
|
||||
class="grid w-full min-w-0 grid-cols-[1rem_1fr] items-center gap-1.5 rounded-xl px-2 py-2 text-left text-xs font-medium text-secondary transition-colors hover-surface-soft hover:shadow-sm"
|
||||
class="grid w-full min-w-0 grid-cols-[1rem_1fr] items-center gap-1.5 rounded-xl px-2 py-2 text-left text-xs font-medium transition-colors"
|
||||
:class="isActiveAgent(agent)
|
||||
? 'cursor-default bg-brand-50 text-brand-700 shadow-sm ring-1 ring-brand-100 dark:bg-brand-900/20 dark:text-brand-300 dark:ring-brand-800/50'
|
||||
: 'text-secondary hover-surface-soft hover:shadow-sm'"
|
||||
:aria-current="isActiveAgent(agent) ? 'page' : undefined"
|
||||
@click="onSelect(agent)"
|
||||
>
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user