优化前端

This commit is contained in:
2026-06-10 20:17:36 +08:00
parent 3437e46290
commit 446659a396
3 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -159,7 +159,7 @@ const router = createRouter({
{
path: 'aichat',
name: 'aichat',
component: () => import('@/views/aichat/AiChatView.vue'),
redirect: '/',
},
],
},
+6 -1
View File
@@ -5,6 +5,7 @@ import { useUsersStore } from '@/stores/users'
import { usePageTitle } from '@/composables/usePageTitle'
import { scheduleApi } from '@/api/schedule'
import { purchaseApi } from '@/api/purchase'
import AiChatView from '@/views/aichat/AiChatView.vue'
import { ref, computed, onMounted } from 'vue'
usePageTitle('appname.home')
@@ -183,7 +184,7 @@ onMounted(() => {
<!-- 功能入口卡片 -->
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
<RouterLink
to="/purchase"
class="rounded-xl border border-gray-200 bg-white px-5 py-4 transition-shadow hover:shadow-md dark:border-dk-muted dark:bg-dk-card"
@@ -198,5 +199,9 @@ onMounted(() => {
<p class="text-xs text-gray-400">{{ t('home.pending_orders') }}</p>
</RouterLink>
</div>
<section class="mt-6">
<AiChatView embedded />
</section>
</div>
</template>
@@ -13,11 +13,20 @@ import { usePageTitle } from '@/composables/usePageTitle'
import { useToastStore } from '@/stores/toast'
import { useUserStore } from '@/stores/user'
const props = defineProps({
embedded: {
type: Boolean,
default: false,
},
})
const { t } = useI18n()
const toast = useToastStore()
const userStore = useUserStore()
usePageTitle('appname.aichat')
if (!props.embedded) {
usePageTitle('appname.aichat')
}
const messages = ref([])
const inputText = ref('')
@@ -699,8 +708,8 @@ async function sendMessage() {
</script>
<template>
<div class="mx-auto flex h-[calc(100vh-7rem)] max-w-7xl flex-col px-4 py-6">
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
<div :class="embedded ? 'flex h-[70vh] min-h-[38rem] flex-col' : 'mx-auto flex h-[calc(100vh-7rem)] max-w-7xl flex-col px-4 py-6'">
<div :class="['mb-4 flex flex-wrap items-center justify-between gap-3', { 'px-1': embedded }]">
<div>
<h1 class="text-2xl font-bold text-gray-900 dark:text-dk-text">
{{ t('aichat.title') }}