优化前端

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: '/',
},
],
},
@@ -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')
@@ -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') }}