| 12345678910111213141516171819202122232425262728293031 |
- <script setup lang="ts">
- // 工作组群聊:<TeamChat>(@ 机器人、任务进度、审批与提问、限额卡片、上传都由组件处理)
- import { computed, onBeforeUnmount } from 'vue'
- import { TeamChat, useTeamSession } from '@agent-server/chat-ui'
- import TopBar from '../components/TopBar.vue'
- import { botClient } from '../lib/config'
- import { openFile } from '../lib/files'
- import { TEAM_STATUS } from '../lib/sessions'
- const props = defineProps<{ id: string }>()
- const client = botClient.value!
- const team = useTeamSession(client, props.id)
- onBeforeUnmount(() => team.dispose())
- const info = computed(() => team.state.team)
- const subtitle = computed(() => {
- const t = info.value
- if (!t) return ''
- const busy = t.bots.filter(b => b.status !== 'idle').length
- return [t.status !== 'active' ? TEAM_STATUS[t.status] : '', `${t.bots.length} 个机器人`, busy ? `${busy} 个工作中` : ''].filter(Boolean).join(' · ')
- })
- </script>
- <template>
- <TopBar back :title="info?.title ?? '工作组'" :subtitle="subtitle">
- <RouterLink :to="`/teams/${id}/info`" class="m-icon no-underline" aria-label="工作组详情"><span class="codicon codicon-info text-[18px]" /></RouterLink>
- </TopBar>
- <div class="flex-1 min-h-0 pb-[var(--safe-bottom)] bg-[var(--app-primary-background)]">
- <TeamChat :client="client" :session="team" @open-file="f => openFile(client, f)" />
- </div>
- </template>
|