This commit is contained in:
f4ilji
2024-11-21 06:08:22 +05:00
parent 1efd49607f
commit f144b0a300
4 changed files with 59 additions and 2 deletions
@@ -114,7 +114,10 @@ class UserDetailForm
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Участие в научных проектах')->defaultItems(0), ])->label('Участие в научных проектах')->defaultItems(0),
Forms\Components\Repeater::make('publications')->schema([ Forms\Components\Repeater::make('publications')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('category_publication')->label('Категория публикаций')->string()->required(),
Forms\Components\Repeater::make('publication')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Публикации')->collapsed(),
])->label('Публикации')->defaultItems(0), ])->label('Публикации')->defaultItems(0),
]), ]),
Tabs\Tab::make('Другое') Tabs\Tab::make('Другое')
@@ -17,6 +17,9 @@ class UserDetailRelationManager extends RelationManager
{ {
protected static string $relationship = 'userDetail'; protected static string $relationship = 'userDetail';
protected static ?string $title = 'Детальная информация';
protected static ?string $inverseRelationship = 'user'; protected static ?string $inverseRelationship = 'user';
public function form(Form $form): Form public function form(Form $form): Form
@@ -0,0 +1,49 @@
<!-- NavLink.vue -->
<template>
<div :id="generateSlug(nameList)">
<template v-for="el in list">
<h3 class="my-4 font-medium text-gray-800">{{ el.category_publication }}</h3>
<ul class="list-disc ms-6 mt-3 space-y-1.5">
<template v-for="el in el.publication">
<li class="ps-1 text-sm text-gray-600 dark:text-neutral-400">
{{ el.item }}
</li>
</template>
</ul>
</template>
</div>
</template>
<script>
import slugify from "slugify";
export default {
name: 'PublicationBlock',
props: {
list: {
type: String,
required: true
},
nameList: {
type: String,
required: true,
},
},
methods: {
generateSlug(text) {
return slugify(text, {
lower: true,
strict: true,
locale: "ru",
});
},
}
}
</script>
<style scoped>
/* Добавьте стили, если это необходимо */
</style>
+3 -1
View File
@@ -103,7 +103,7 @@
</div> </div>
<div class="mt-8"> <div class="mt-8">
<ListBlock v-if="person.data.details.publications.length > 0" name-list="Публикации" :list="person.data.details.publications" /> <PublicationBlock v-if="person.data.details.publications.length > 0" name-list="Публикации" :list="person.data.details.publications" />
</div> </div>
<div class="mt-8"> <div class="mt-8">
@@ -140,6 +140,7 @@ import EducationBlock from "@/Components/BuilderUi/Persons/Blocks/EducationBlock
import ListBlock from "@/Components/BuilderUi/Persons/Blocks/ListBlock.vue"; import ListBlock from "@/Components/BuilderUi/Persons/Blocks/ListBlock.vue";
import WorkExperienceBlock from "@/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue"; import WorkExperienceBlock from "@/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue";
import OtherBlock from "@/Components/BuilderUi/Persons/Blocks/OtherBlock.vue"; import OtherBlock from "@/Components/BuilderUi/Persons/Blocks/OtherBlock.vue";
import PublicationBlock from "@/Components/BuilderUi/Persons/Blocks/PublicationBlock.vue";
export default { export default {
@@ -162,6 +163,7 @@ export default {
}, },
components: { components: {
PublicationBlock,
OtherBlock, OtherBlock,
WorkExperienceBlock, WorkExperienceBlock,
ListBlock, ListBlock,