优化前端
This commit is contained in:
@@ -159,7 +159,7 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: 'aichat',
|
path: 'aichat',
|
||||||
name: '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 { usePageTitle } from '@/composables/usePageTitle'
|
||||||
import { scheduleApi } from '@/api/schedule'
|
import { scheduleApi } from '@/api/schedule'
|
||||||
import { purchaseApi } from '@/api/purchase'
|
import { purchaseApi } from '@/api/purchase'
|
||||||
|
import AiChatView from '@/views/aichat/AiChatView.vue'
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
|
|
||||||
usePageTitle('appname.home')
|
usePageTitle('appname.home')
|
||||||
@@ -198,5 +199,9 @@ onMounted(() => {
|
|||||||
<p class="text-xs text-gray-400">{{ t('home.pending_orders') }}</p>
|
<p class="text-xs text-gray-400">{{ t('home.pending_orders') }}</p>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<section class="mt-6">
|
||||||
|
<AiChatView embedded />
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,11 +13,20 @@ import { usePageTitle } from '@/composables/usePageTitle'
|
|||||||
import { useToastStore } from '@/stores/toast'
|
import { useToastStore } from '@/stores/toast'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
embedded: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const toast = useToastStore()
|
const toast = useToastStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
usePageTitle('appname.aichat')
|
if (!props.embedded) {
|
||||||
|
usePageTitle('appname.aichat')
|
||||||
|
}
|
||||||
|
|
||||||
const messages = ref([])
|
const messages = ref([])
|
||||||
const inputText = ref('')
|
const inputText = ref('')
|
||||||
@@ -699,8 +708,8 @@ async function sendMessage() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mx-auto flex h-[calc(100vh-7rem)] max-w-7xl flex-col px-4 py-6">
|
<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">
|
<div :class="['mb-4 flex flex-wrap items-center justify-between gap-3', { 'px-1': embedded }]">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-2xl font-bold text-gray-900 dark:text-dk-text">
|
<h1 class="text-2xl font-bold text-gray-900 dark:text-dk-text">
|
||||||
{{ t('aichat.title') }}
|
{{ t('aichat.title') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user