Files
tp/main_dc/yalarba/easySite/app/pages/objects/create.vue
T
valitovgaziz 2941b14b38 flatten easySite directory: remove extra easySite/easySite nesting
- Moved contents of main_dc/yalarba/easySite/easySite/ up to easySite/
- Updated docker-compose.yml build context path
- Deleted empty nested easySite/ directory
2026-06-12 11:16:15 +05:00

95 lines
2.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="page-wrapper">
<main class="create-object-page">
<div class="container max-w-4xl">
<div class="page-header">
<div class="header-content">
<div class="header-text">
<h1 class="page-title">Добавить новый объект</h1>
<p class="page-subtitle">Заполните информацию о вашем объекте</p>
</div>
<NuxtLink to="/objects/my-objects" class="btn btn-outline btn-with-icon">
Мои объекты
</NuxtLink>
</div>
</div>
<ObjectForm :loading="loading" @submit="handleSubmit" @cancel="handleCancel" />
</div>
</main>
</div>
</template>
<script setup lang="ts">
const { create } = useObjects()
const loading = ref(false)
const handleSubmit = async (formData: Record<string, unknown>) => {
loading.value = true
try {
await create(formData as Parameters<typeof create>[0])
navigateTo('/objects/my-objects')
} catch (error) {
console.error('Error creating object:', error)
alert('Ошибка при создании объекта')
} finally {
loading.value = false
}
}
const handleCancel = () => {
navigateTo('/objects/my-objects')
}
</script>
<style scoped>
.create-object-page {
padding: var(--space-xl) 0;
min-height: calc(100vh - 160px);
background: var(--bg-secondary);
}
.page-header {
background: var(--bg-primary);
border-radius: var(--radius-lg);
padding: var(--space-xl);
margin-bottom: var(--space-lg);
box-shadow: var(--shadow-sm);
border: 1px solid var(--border-light);
}
.header-content {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: var(--space-xl);
}
.header-text {
display: flex;
flex-direction: column;
gap: var(--space-xs);
}
.page-title {
font-family: var(--font-heading);
font-size: var(--text-3xl);
font-weight: var(--font-bold);
color: var(--text-primary);
margin: 0;
}
.page-subtitle {
font-size: var(--text-lg);
color: var(--text-secondary);
margin: 0;
}
@media (max-width: 768px) {
.header-content {
flex-direction: column;
}
}
</style>