优化移动端UI交互

This commit is contained in:
runny committed 2026-05-20 20:32:11 +08:00
1 parent 83f958f272
commit 73c93a497b
3 files changed
+196 -57

No files matched your search

+2 -2
View File
@@ -10,8 +10,8 @@
<meta name="apple-mobile-web-app-title" content="AI工作台" />
<link rel="manifest" href="/manifest.webmanifest" />
<title>AI工作台</title>
<script type="module" crossorigin src="/assets/index-C27ubssp.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Cf26xMBx.css">
<script type="module" crossorigin src="/assets/index-CsdgB1Ej.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Attkfi5T.css">
</head>
<body>
<div id="app"></div>␍
+43 -4
View File
@@ -13,7 +13,7 @@
import { ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import { useChat } from '../composables/useChat';
import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, Heart, Bell, Mail, Settings, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, UserCircle } from 'lucide-vue-next';
import { Send, Loader2, Plus, Copy, Edit2, RotateCw, Check, X, PanelLeftClose, PanelLeftOpen, Heart, Bell, Mail, Settings, ChevronDown, Sparkles, Database, Mic, LogOut, MessageSquareText, Globe, ExternalLink, Search, LayoutGrid, History, MoreVertical } from 'lucide-vue-next';
import { marked } from 'marked';
import { useRoute, useRouter } from 'vue-router';
import { config } from '../config';
@@ -26,6 +26,21 @@ import { getAuthHeaders, getStoredAuthUser, clearAuthUser } from '../utils/auth'
const { t } = useI18n();
const { showMessageDialog } = useGlobalMessageDialog();
const { isMobile } = useIsMobile();
const showMobileAgentPopover = ref(false);
const mobileAgentPopoverRef = ref<HTMLElement | null>(null);
const handleMobileAgentPopoverClickOutside = (e: MouseEvent | TouchEvent) => {
if (mobileAgentPopoverRef.value && !mobileAgentPopoverRef.value.contains(e.target as Node)) {
showMobileAgentPopover.value = false;
}
};
const toggleMobileAgentPopover = () => {
showMobileAgentPopover.value = !showMobileAgentPopover.value;
if (showMobileAgentPopover.value) {
loadUserAgents();
}
};
const currentUser = ref(getStoredAuthUser());
const showUserDropdown = ref(false);
const userMenuRef = ref<HTMLElement | null>(null);
@@ -1662,6 +1677,8 @@ const switchToAgent = (agent: { id: number; name: string }) => {
onMounted(async () => {
document.addEventListener('mousedown', handleDocumentPointerDown);
document.addEventListener('touchstart', handleDocumentPointerDown, { passive: true });
document.addEventListener('mousedown', handleMobileAgentPopoverClickOutside);
document.addEventListener('touchstart', handleMobileAgentPopoverClickOutside, { passive: true });
window.addEventListener('resize', syncViewportWidth);
await syncCurrentUserProfile();
await loadAgent();
@@ -1681,6 +1698,8 @@ onMounted(async () => {
onBeforeUnmount(() => {
document.removeEventListener('mousedown', handleDocumentPointerDown);
document.removeEventListener('touchstart', handleDocumentPointerDown);
document.removeEventListener('mousedown', handleMobileAgentPopoverClickOutside);
document.removeEventListener('touchstart', handleMobileAgentPopoverClickOutside);
window.removeEventListener('resize', syncViewportWidth);
stopBrowserResize();
if (scrollToBottomFrame !== null) {
@@ -1873,9 +1892,29 @@ const showChatRating = ref(false);
<div class="flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-xs font-bold text-white shadow-sm shadow-brand-500/20">AI</div>
<span class="text-sm font-semibold text-slate-800 dark:text-slate-100">{{ currentAgent?.name || 'AI' }}</span>
</div>
<button @click="router.push('/workspace?view=profile')" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" title="个人设置">
<UserCircle class="h-6 w-6" />
</button>
<div class="flex items-center gap-1">
<button @click="toggleMobileAgentPopover" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" title="更多">
<MoreVertical class="h-5 w-5" />
</button>
<button @click="router.push('/workspace?view=history')" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" title="历史记录">
<History class="h-5 w-5" />
</button>
</div>
<div v-if="showMobileAgentPopover" ref="mobileAgentPopoverRef" class="absolute right-4 top-12 z-50 w-56 rounded-2xl border border-slate-200 bg-white p-2 shadow-xl dark:border-slate-700 dark:bg-slate-800">
<div class="mb-1 px-3 py-1.5 text-xs font-medium text-slate-400">智能体</div>
<button
v-for="agent in userAgents"
:key="agent.id"
@click="switchToAgent(agent); showMobileAgentPopover = false"
class="flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors hover:bg-slate-100 dark:hover:bg-slate-700"
>
<div class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-brand-50 text-xs font-bold text-brand-600 dark:bg-brand-900/30">
{{ agent.name.charAt(0) }}
</div>
<span class="truncate font-medium text-slate-700 dark:text-slate-200">{{ agent.name }}</span>
</button>
<div v-if="userAgents.length === 0" class="px-3 py-2 text-xs text-slate-400">暂无其他智能体</div>
</div>
</header>
<div v-if="!currentAgent" class="flex flex-1 flex-col items-center justify-center space-y-4">
+151 -51
View File
@@ -48,8 +48,7 @@ import {
Megaphone,
X,
ChevronDown,
ChevronUp,
MessageCircle
ChevronUp
} from 'lucide-vue-next';
import KbWorkspaceView from './KbWorkspaceView.vue';
@@ -320,7 +319,7 @@ const fetchHome = async () => {
defaultSections.forEach(d => {
if (!backendIds.has(d.id)) {
if (config.workspace.modules[mapKey(d.id) as keyof typeof config.workspace.modules] === false) {
return;
return;
}
merged.push(d);
}
@@ -771,7 +770,7 @@ const handleRegister = async () => {
}
};
const activeSidebarItem = ref<'profile' | 'applications' | 'feedback' | 'updates' | 'knowledge_base' | 'schedule_runs'>('applications');
const activeSidebarItem = ref<'profile' | 'applications' | 'feedback' | 'updates' | 'knowledge_base' | 'schedule_runs' | 'history'>('applications');
const isProfileLoading = ref(false);
const isProfileSaving = ref(false);
const isProfileEditing = ref(false);
@@ -817,15 +816,16 @@ const hasProfileUnsavedChanges = computed(() => {
const mobileTabActive = computed({
get: () => {
if (activeSidebarItem.value === 'profile') return 'profile';
if (activeSidebarItem.value === 'feedback') return 'feedback';
if (activeSidebarItem.value === 'history') return 'history';
return 'applications';
},
set: (tab: 'applications' | 'feedback' | 'profile') => {
set: (tab: 'applications' | 'profile' | 'history') => {
if (tab === 'profile') {
activeSidebarItem.value = 'profile';
if (!profileUser.value.id) fetchProfile();
} else if (tab === 'feedback') {
activeSidebarItem.value = 'feedback';
} else if (tab === 'history') {
activeSidebarItem.value = 'history';
if (chatHistories.value.length === 0) loadChatHistories();
} else {
activeSidebarItem.value = 'applications';
}
@@ -834,7 +834,7 @@ const mobileTabActive = computed({
const mobileTabTitle = computed(() => {
if (mobileTabActive.value === 'profile') return '我的';
if (mobileTabActive.value === 'feedback') return '意见反馈';
if (mobileTabActive.value === 'history') return '历史会话';
return '应用管理';
});
@@ -1117,6 +1117,43 @@ const downloadWsScheduleExcel = async (runId: number) => {
URL.revokeObjectURL(url);
};
interface ChatHistoryItem {
id: number;
conversation_id: string;
title: string;
agent_id?: number;
agent_name?: string;
created_at: string;
}
const chatHistories = ref<ChatHistoryItem[]>([]);
const isLoadingHistories = ref(false);
const loadChatHistories = async () => {
isLoadingHistories.value = true;
try {
const res = await fetch('/api/agents', { headers: getAuthHeaders() });
if (!res.ok) { isLoadingHistories.value = false; return; }
const agentList = await res.json();
const allHistories: ChatHistoryItem[] = [];
await Promise.all(
(Array.isArray(agentList) ? agentList : []).map(async (agent: any) => {
try {
const hRes = await fetch(`/api/chat/sessions?agent_id=${agent.id}`, { headers: getAuthHeaders() });
if (hRes.ok) {
const sessions = await hRes.json();
for (const s of sessions) {
allHistories.push({ ...s, agent_id: agent.id, agent_name: agent.name });
}
}
} catch {}
})
);
allHistories.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
chatHistories.value = allHistories;
} catch {}
isLoadingHistories.value = false;
};
const navigateToGeneralChat = () => {
router.push(`/chat/${DEFAULT_POST_LOGIN_AGENT_ID}`);
};
@@ -1331,12 +1368,15 @@ onMounted(async () => {
await fetchHome();
await handleWecomDeeplinkContext();
const viewParam = route.query.view as string;
const validViews: string[] = ['profile', 'applications', 'feedback', 'updates', 'knowledge_base', 'schedule_runs'];
const validViews: string[] = ['profile', 'applications', 'feedback', 'updates', 'knowledge_base', 'schedule_runs', 'history'];
if (viewParam && validViews.includes(viewParam)) {
activeSidebarItem.value = viewParam as typeof activeSidebarItem.value;
if (viewParam === 'profile' && !profileUser.value.id) {
await fetchProfile();
}
if (viewParam === 'history') {
await loadChatHistories();
}
}
} else {
await fetchPublicAgents();
@@ -1384,7 +1424,7 @@ onMounted(async () => {
<!--
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-brand-50 text-brand-600 text-sm font-medium border border-brand-100">
<span class="relative flex h-2 w-2">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-400 opacity-75"></span>
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-2 w-2 bg-brand-500"></span>
</span>
{{ $t('title') }}
@@ -1588,6 +1628,14 @@ onMounted(async () => {
<Bot class="h-4 w-4" />
<span>返回聊天</span>
</button>
<button
@click="activeSidebarItem = 'history'; if (chatHistories.length === 0) loadChatHistories()"
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
:class="activeSidebarItem === 'history' ? 'bg-brand-50 text-brand-700 shadow-sm' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'"
>
<Bot class="h-4 w-4" />
<span>历史会话</span>
</button>
<button
v-if="currentUser?.role === 'admin'"
@click="openAdminPanel"
@@ -1609,6 +1657,42 @@ onMounted(async () => {
</aside>
<section class="min-w-0 space-y-6 bg-gray-50 px-4 py-6 md:px-6 md:py-8 lg:px-8" :class="isMobile ? 'pb-20' : ''">
<template v-if="activeSidebarItem === 'history'">
<div class="space-y-3">
<div v-if="isLoadingHistories" class="flex justify-center py-20">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-brand-600"></div>
</div>
<div v-else-if="chatHistories.length === 0" class="flex flex-col items-center justify-center py-20 text-slate-400">
<Bot class="h-10 w-10 mb-2" />
<p class="text-sm">暂无历史会话</p>
</div>
<div v-else>
<button
v-for="item in chatHistories"
:key="item.id"
@click="router.push(`/chat/${item.agent_id || 16}`)"
class="w-full rounded-2xl border border-slate-200 bg-white p-3 text-left transition-colors hover:border-brand-300 hover:bg-brand-50/50 dark:border-slate-700 dark:bg-slate-800 dark:hover:border-brand-600 mb-2"
:class="isMobile ? 'p-2.5 rounded-xl' : ''"
>
<div class="flex items-start gap-3">
<div class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-brand-50 text-xs font-bold text-brand-600 dark:bg-brand-900/30" :class="isMobile ? 'h-7 w-7 text-[10px]' : ''">
{{ (item.agent_name || 'AI').charAt(0) }}
</div>
<div class="min-w-0 flex-1">
<div class="flex items-center gap-2">
<span class="truncate text-sm font-medium text-slate-800 dark:text-slate-100">{{ item.title || '未命名对话' }}</span>
</div>
<div class="mt-0.5 flex items-center gap-2 text-xs text-slate-400">
<span>{{ item.agent_name || '' }}</span>
<span>{{ new Date(item.created_at).toLocaleDateString() }}</span>
</div>
</div>
</div>
</button>
</div>
</div>
</template>
<template v-if="activeSidebarItem === 'profile'">
<div v-if="isProfileLoading" class="flex justify-center py-20">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-brand-600"></div>
@@ -1618,48 +1702,64 @@ onMounted(async () => {
<div class="rounded-3xl border border-slate-200 bg-white px-6 py-6 shadow-sm md:px-8">
<div class="flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between">
<div class="flex flex-1 flex-col gap-6 sm:flex-row sm:items-center sm:justify-start">
<div class="flex h-24 w-24 shrink-0 items-center justify-center rounded-full bg-brand-100 text-4xl font-bold text-brand-600">
<div class="flex h-24 w-24 shrink-0 items-center justify-center rounded-full bg-brand-100 text-4xl font-bold text-brand-600" :class="isMobile ? 'h-14 w-14 text-2xl' : ''">
{{ (profileUser.real_name || profileUser.username || 'U').charAt(0).toUpperCase() }}
</div>
<div class="grid flex-1 grid-cols-1 gap-x-12 gap-y-3 text-left sm:grid-cols-2">
<div>
<div class="text-lg font-semibold text-slate-900">{{ profileUser.username || '-' }}</div>
<div class="grid flex-1 text-left" :class="isMobile ? 'grid-cols-2 gap-x-4 gap-y-1' : 'grid-cols-1 gap-x-12 gap-y-3 sm:grid-cols-2'">
<div :class="isMobile ? '' : ''">
<div :class="isMobile ? 'text-xs text-slate-400' : 'text-lg font-semibold text-slate-900'">{{ isMobile ? '姓名' : (profileUser.username || '-') }}</div>
<div v-if="isMobile" class="text-sm font-medium text-slate-900 truncate">{{ profileUser.real_name || profileUser.username || '-' }}</div>
</div>
<div>
<div class="text-lg font-semibold text-slate-900">{{ profileUser.employee_id || '-' }}</div>
<div :class="isMobile ? 'text-xs text-slate-400' : 'text-lg font-semibold text-slate-900'">{{ isMobile ? '工号' : (profileUser.employee_id || '-') }}</div>
<div v-if="isMobile" class="text-sm font-medium text-slate-900 truncate">{{ profileUser.employee_id || '-' }}</div>
</div>
<div>
<div class="text-lg font-semibold text-slate-900">{{ profileUser.department || '-' }}</div>
<div :class="isMobile ? 'text-xs text-slate-400' : 'text-lg font-semibold text-slate-900'">{{ isMobile ? '部门' : (profileUser.department || '-') }}</div>
<div v-if="isMobile" class="text-sm font-medium text-slate-900 truncate">{{ profileUser.department || '-' }}</div>
</div>
<div>
<div class="text-lg font-semibold text-slate-900">
{{ profileUser.role === 'admin' ? ($t('profile.roleAdmin') || 'Administrator') : ($t('profile.roleUser') || 'User') }}
</div>
<div :class="isMobile ? 'text-xs text-slate-400' : 'text-lg font-semibold text-slate-900'">{{ isMobile ? '角色' : (profileUser.role === 'admin' ? ($t('profile.roleAdmin') || 'Administrator') : ($t('profile.roleUser') || 'User')) }}</div>
<div v-if="isMobile" class="text-sm font-medium text-slate-900 truncate">{{ profileUser.role === 'admin' ? ($t('profile.roleAdmin') || '管理员') : ($t('profile.roleUser') || '用户') }}</div>
</div>
<div class="sm:col-span-2">
<div class="break-all text-lg font-semibold text-slate-900">{{ profileUser.email || '-' }}</div>
<div :class="isMobile ? 'col-span-2' : 'sm:col-span-2'">
<div :class="isMobile ? 'text-xs text-slate-400' : 'break-all text-lg font-semibold text-slate-900'">{{ isMobile ? '邮箱' : (profileUser.email || '-') }}</div>
<div v-if="isMobile" class="text-sm font-medium text-slate-900 truncate">{{ profileUser.email || '-' }}</div>
</div>
</div>
</div>
<button @click="showPasswordModal = true" class="btn-primary shrink-0 self-start px-6 py-3 text-base lg:ml-6">
<div v-if="!isMobile" class="flex shrink-0 items-center gap-2 self-start lg:ml-6">
<button @click="showPasswordModal = true" class="btn-primary px-6 py-3 text-base">
修改密码
</button>
</div>
</div>
<div v-if="isMobile" class="mt-4 flex items-center justify-center gap-4">
<button @click="showPasswordModal = true" class="btn-primary flex-1 py-2.5 text-sm text-center">
修改密码
</button>
<button @click="handleLogout" class="btn-secondary flex-1 py-2.5 text-sm text-center text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950">
退出登录
</button>
</div>
</div>
<div class="space-y-6">
<div class="rounded-3xl border border-slate-200 bg-white p-8 shadow-sm">
<div class="mb-8 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<h3 class="flex items-center gap-3 text-3xl font-bold text-slate-900">
<User class="h-6 w-6 text-brand-500" />
<div class="rounded-3xl border border-slate-200 bg-white p-8 shadow-sm" :class="isMobile ? 'p-4' : ''">
<div class="mb-8 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" :class="isMobile ? 'mb-4 gap-2' : ''">
<div class="flex items-center" :class="isMobile ? 'w-full justify-center gap-2' : ''">
<h3 class="flex items-center gap-3 text-3xl font-bold text-slate-900" :class="isMobile ? 'text-lg gap-2' : ''">
<User class="h-6 w-6 text-brand-500" :class="isMobile ? 'h-4 w-4' : ''" />
基本信息
</h3>
<p class="mt-2 text-sm text-slate-500">
{{ isProfileEditing ? '可直接修改并保存个人资料' : '切换到编辑模式以更新个人资料' }}
</p>
<button v-if="isMobile && !isProfileEditing" @click="startProfileEditing" class="btn-secondary px-3 py-1 text-xs">
编辑
</button>
</div>
<div class="flex items-center gap-2">
<p v-if="!isMobile" class="mt-2 text-sm text-slate-500">
{{ isProfileEditing ? '可直接修改并保存个人资料' : '切换到编辑模式以更新个人资料' }}
</p>
<div v-if="!isMobile" class="flex items-center gap-2">
<button v-if="!isProfileEditing" @click="startProfileEditing" class="btn-secondary px-5 py-2.5 text-sm">
编辑
</button>
@@ -1678,57 +1778,57 @@ onMounted(async () => {
</template>
</div>
</div>
<div class="grid grid-cols-1 gap-5 md:grid-cols-2">
<div class="grid grid-cols-1 gap-5 md:grid-cols-2" :class="isMobile ? 'gap-3' : ''">
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<User class="h-4 w-4" /> 用户名
</label>
<div class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<div class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.username || '-' }}
</div>
</div>
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<CreditCard class="h-4 w-4" /> 工号
</label>
<input v-if="isProfileEditing" v-model="profileUser.employee_id" type="text" class="input-field h-[58px]" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<input v-if="isProfileEditing" v-model="profileUser.employee_id" type="text" class="input-field" :class="isMobile ? 'h-10 text-sm' : 'h-[58px]'" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.employee_id || '-' }}
</div>
</div>
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<User class="h-4 w-4" /> 真实姓名
</label>
<input v-if="isProfileEditing" v-model="profileUser.real_name" type="text" class="input-field h-[58px]" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<input v-if="isProfileEditing" v-model="profileUser.real_name" type="text" class="input-field" :class="isMobile ? 'h-10 text-sm' : 'h-[58px]'" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.real_name || '-' }}
</div>
</div>
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<Building class="h-4 w-4" /> 部门
</label>
<input v-if="isProfileEditing" v-model="profileUser.department" type="text" class="input-field h-[58px]" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<input v-if="isProfileEditing" v-model="profileUser.department" type="text" class="input-field" :class="isMobile ? 'h-10 text-sm' : 'h-[58px]'" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.department || '-' }}
</div>
</div>
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<Mail class="h-4 w-4" /> 邮箱
</label>
<input v-if="isProfileEditing" v-model="profileUser.email" type="email" class="input-field h-[58px]" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<input v-if="isProfileEditing" v-model="profileUser.email" type="email" class="input-field" :class="isMobile ? 'h-10 text-sm' : 'h-[58px]'" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.email || '-' }}
</div>
</div>
<div>
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500">
<label class="mb-2 flex items-center gap-2 text-sm font-medium text-slate-500" :class="isMobile ? 'text-xs mb-1' : ''">
<Globe class="h-4 w-4" /> 手机号
</label>
<input v-if="isProfileEditing" v-model="profileUser.phone_number" type="text" class="input-field h-[58px]" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700">
<input v-if="isProfileEditing" v-model="profileUser.phone_number" type="text" class="input-field" :class="isMobile ? 'h-10 text-sm' : 'h-[58px]'" />
<div v-else class="rounded-2xl border border-slate-200 bg-slate-50 px-4 py-4 text-lg font-medium text-slate-700" :class="isMobile ? 'px-3 py-2 text-sm rounded-xl' : ''">
{{ profileUser.phone_number || '-' }}
</div>
</div>
@@ -2069,7 +2169,7 @@ onMounted(async () => {
<button
v-for="tab in ([
{ key: 'applications', icon: LayoutGrid, label: '应用管理' },
{ key: 'feedback', icon: MessageCircle, label: '意见反馈' },
{ key: 'history', icon: Bot, label: '历史会话' },
{ key: 'profile', icon: User, label: '我的' },
] as const)"
:key="tab.key"