fix(chat): 智能体支持配置分级显示
This commit is contained in:
1 parent
a451951e7a
commit
70d7435b5f
27 files changed
+645
-76
No files matched your search
@@ -5,11 +5,10 @@
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { BookOpen, History, LayoutGrid } from 'lucide-vue-next';
|
||||
import AgentCategoryList from '@/shared/components/AgentCategoryList.vue';
|
||||
import type { AgentWithCategory } from '@/shared/utils/agent-category.utils';
|
||||
|
||||
export interface ChatMobileHeaderAgent {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
export interface ChatMobileHeaderAgent extends AgentWithCategory {}
|
||||
|
||||
defineProps<{
|
||||
agentName: string;
|
||||
@@ -99,21 +98,12 @@ onBeforeUnmount(() => {
|
||||
class="absolute right-4 top-12 z-50 w-72 rounded-2xl border border-default bg-surface p-3 shadow-xl"
|
||||
>
|
||||
<div class="mb-2 text-xs font-medium text-muted">{{ $t('chat.agents') }}</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<button
|
||||
v-for="agent in userAgents"
|
||||
:key="agent.id"
|
||||
type="button"
|
||||
class="flex flex-col items-center gap-1.5 rounded-xl px-2 py-3 text-center transition-colors hover-surface-soft"
|
||||
@click="onSwitchAgent(agent)"
|
||||
>
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg bg-brand-50 text-sm font-bold text-brand-600">
|
||||
{{ agent.name.charAt(0) }}
|
||||
</div>
|
||||
<span class="w-full truncate text-xs font-medium text-secondary">{{ agent.name }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="userAgents.length === 0" class="py-3 text-center text-xs text-muted">{{ $t('chat.noOtherAgents') }}</div>
|
||||
<AgentCategoryList
|
||||
v-if="userAgents.length > 0"
|
||||
:agents="userAgents"
|
||||
@select="onSwitchAgent"
|
||||
/>
|
||||
<div v-else class="py-3 text-center text-xs text-muted">{{ $t('chat.noOtherAgents') }}</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
Reference in new issue
Block a user