diff --git a/app/Filament/Components/Forms/ItemForm/Pages/ContentBuilderItem.php b/app/Filament/Components/Forms/ItemForm/Pages/ContentBuilderItem.php index 370e8c7..bb1a658 100644 --- a/app/Filament/Components/Forms/ItemForm/Pages/ContentBuilderItem.php +++ b/app/Filament/Components/Forms/ItemForm/Pages/ContentBuilderItem.php @@ -27,10 +27,10 @@ use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor; class ContentBuilderItem { - public static function getItem() + public static function getItem(string $name) { return - Builder::make('content')->label('')->blocks([ + Builder::make($name)->label('')->blocks([ Builder\Block::make('heading')->label('Заголовок') ->schema([ TextInput::make('id')->hidden()->integer()->default(rand(2335235,324634264263426)), diff --git a/app/Filament/Components/Forms/PageForm.php b/app/Filament/Components/Forms/PageForm.php index a721729..9532caa 100644 --- a/app/Filament/Components/Forms/PageForm.php +++ b/app/Filament/Components/Forms/PageForm.php @@ -95,7 +95,7 @@ class PageForm TextInput::make('search_data')->hidden(), ]), Forms\Components\Tabs\Tab::make('Контент')->schema([ - ContentBuilderItem::getItem() + ContentBuilderItem::getItem('content') ]), Forms\Components\Tabs\Tab::make('Настройки')->schema([ Select::make('template')->options(self::getPageTemplates())->required(), diff --git a/app/Filament/Components/Forms/UserDetailForm.php b/app/Filament/Components/Forms/UserDetailForm.php new file mode 100644 index 0000000..afe11ea --- /dev/null +++ b/app/Filament/Components/Forms/UserDetailForm.php @@ -0,0 +1,130 @@ +schema([ + Forms\Components\Card::make()->schema([ + Forms\Components\Grid::make(2)->schema([ + Forms\Components\Toggle::make('is_only_worker') + ->inline(false) + ->label('Только сотрудник') + ]), + ]), + Tabs::make('Tabs') + ->tabs([ + Tabs\Tab::make('Основная информация') + ->schema([ + Forms\Components\FileUpload::make('photo') + ->label('Фотография') + ->image() + ->optimize('jpg') + ->resize(30) + ->disk('public') + ->imageEditor() + ->directory('images') + ->imageEditor(), + Forms\Components\Grid::make()->schema([ + Forms\Components\TextInput::make('contactEmail') + ->label('Контактный Email') + ->maxLength(255), + Forms\Components\TextInput::make('contactPhone') + ->label('Контактный телефон') + ->maxLength(255), + ]), + ]), + Tabs\Tab::make('Образование') + ->schema([ + Forms\Components\Grid::make()->schema([ + Forms\Components\TextInput::make('academicTitle') + ->label('Ученая степень') + ->maxLength(255), + Forms\Components\TextInput::make('AcademicDegree') + ->label('Ученое звание') + ->maxLength(255), + ]), + Forms\Components\Repeater::make('education')->schema([ + Forms\Components\TextInput::make('year')->label('Года обучения')->string()->required(), + Forms\Components\TextInput::make('content')->label('Общая информация')->string()->required(), + Forms\Components\TextInput::make('institution')->label('Учебное заведение')->string()->required() + ])->label('Образование'), + Forms\Components\Repeater::make('professionalRetraining')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Профессиональная переподготовка'), + Forms\Components\Repeater::make('professionalDevelopment') + ->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Повышение квалификации'), + Forms\Components\Repeater::make('awards')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Награды'), + ]), + Tabs\Tab::make('Преподавание') + ->schema([ + Forms\Components\Grid::make(2)->schema([ + Forms\Components\TextInput::make('workExperience.total') + ->label('Стаж работы в общем') + ->numeric(), + Forms\Components\TextInput::make('workExperience.byProf') + ->label('Стаж работы по специальности') + ->numeric(), + ]), + Forms\Components\Repeater::make('professDisciplines')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Преподаваемые дисциплины'), + ]), + Tabs\Tab::make('Научная деятельность') + ->schema([ + Forms\Components\Repeater::make('attendedConferences')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Преподаваемые дисциплины'), + Forms\Components\Repeater::make('participationScienceProjects')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Преподаваемые дисциплины'), + Forms\Components\Repeater::make('publications')->schema([ + Forms\Components\TextInput::make('item')->label('')->string()->required() + ])->label('Преподаваемые дисциплины'), + ]), + Tabs\Tab::make('Другое') + ->schema([ + ContentBuilderItem::getItem('other') + ]), + + + ])->columnSpanFull(), + ]); + + } +} \ No newline at end of file diff --git a/app/Filament/Resources/PostResource/Pages/CreatePost.php b/app/Filament/Resources/PostResource/Pages/CreatePost.php index 3c22f16..c325718 100644 --- a/app/Filament/Resources/PostResource/Pages/CreatePost.php +++ b/app/Filament/Resources/PostResource/Pages/CreatePost.php @@ -51,7 +51,8 @@ class CreatePost extends CreateRecord { $this->record->seo()->create($this->seoData); $this->sendNotify($this->record, auth()->user()); - $this->postToSocialMedia($this->publicationAgreements, $this->record->content, $this->record->title, Carbon::parse($this->record->publish_at)->timestamp); + $publish_date = ($this->record->publish_at > now()) ? Carbon::parse($this->record->publish_at)->timestamp : null; + $this->postToSocialMedia($this->publicationAgreements, $this->record->content, $this->record->title, $publish_date); } private function generateSeo(array $data) : array @@ -268,6 +269,7 @@ class CreatePost extends CreateRecord $post_id = $this->record->id; + dispatch(new CreateVkPost($title, $text, $images, $post_id, $publish_date)); } } diff --git a/app/Filament/Resources/PostResource/Pages/EditPost.php b/app/Filament/Resources/PostResource/Pages/EditPost.php index a454cd4..b027fb4 100644 --- a/app/Filament/Resources/PostResource/Pages/EditPost.php +++ b/app/Filament/Resources/PostResource/Pages/EditPost.php @@ -36,7 +36,8 @@ class EditPost extends EditRecord protected function afterSave(): void { $this->record->seo()->update($this->seoData); - $this->postToSocialMedia($this->publicationAgreements, $this->record->content, $this->record->title, Carbon::parse($this->record->publish_at)->timestamp); + $publish_date = ($this->record->publish_at > now()) ? Carbon::parse($this->record->publish_at)->timestamp : null; + $this->postToSocialMedia($this->publicationAgreements, $this->record->content, $this->record->title, $publish_date); } private function setPreviewText(array $data) : string|null diff --git a/app/Filament/Resources/UserDetailResource.php b/app/Filament/Resources/UserDetailResource.php index eab9b1c..63d3a44 100644 --- a/app/Filament/Resources/UserDetailResource.php +++ b/app/Filament/Resources/UserDetailResource.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources; +use App\Filament\Components\Forms\UserDetailForm; use App\Filament\Resources\UserDetailResource\Pages; use App\Filament\Resources\UserDetailResource\RelationManagers; use App\Models\UserDetail; @@ -30,97 +31,7 @@ class UserDetailResource extends Resource public static function form(Form $form): Form { - return $form - ->schema([ - Forms\Components\Card::make()->schema([ - Forms\Components\Grid::make(2)->schema([ - Forms\Components\Select::make('user_id') - ->relationship('user', 'email') - ->searchable() - ->required() - ->preload() - ->label('Пользователь'), - Forms\Components\Toggle::make('is_only_worker') - ->inline(false) - ->label('Только сотрудник') - ]), - ]), - Tabs::make('Tabs') - ->tabs([ - Tabs\Tab::make('Основная информация') - ->schema([ - Forms\Components\FileUpload::make('photo') - ->label('Фотография') - ->image() - ->optimize('jpg') - ->resize(30) - ->disk('public') - ->imageEditor() - ->directory('images') - ->imageEditor(), - Forms\Components\Grid::make()->schema([ - Forms\Components\TextInput::make('contactEmail') - ->label('Контактный Email') - ->maxLength(255), - Forms\Components\TextInput::make('contactPhone') - ->label('Контактный телефон') - ->maxLength(255), - ]), - ]), - Tabs\Tab::make('Образование') - ->schema([ - Forms\Components\Grid::make()->schema([ - Forms\Components\TextInput::make('academicTitle') - ->label('Ученая степень') - ->maxLength(255), - Forms\Components\TextInput::make('AcademicDegree') - ->label('Ученое звание') - ->maxLength(255), - ]), - Forms\Components\TextInput::make('education') - ->label('Образование') - ->maxLength(255), - Forms\Components\Repeater::make('professionalRetraining')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Профессиональная переподготовка'), - Forms\Components\Repeater::make('professionalDevelopment') - ->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Повышение квалификации'), - Forms\Components\Repeater::make('awards')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Награды'), - ]), - Tabs\Tab::make('Преподавание') - ->schema([ - Forms\Components\TextInput::make('workExperience') - ->label('Стаж работы') - ->numeric(), - Forms\Components\Repeater::make('professDisciplines')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Преподаваемые дисциплины'), - ]), - Tabs\Tab::make('Научная деятельность') - ->schema([ - Forms\Components\Repeater::make('attendedConferences')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Преподаваемые дисциплины'), - Forms\Components\Repeater::make('participationScienceProjects')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Преподаваемые дисциплины'), - Forms\Components\Repeater::make('publications')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Преподаваемые дисциплины'), - ]), - Tabs\Tab::make('Другое') - ->schema([ - Forms\Components\Textarea::make('other') - ->columnSpanFull(), - ]), - - - ])->columnSpanFull(), - ]); + return UserDetailForm::getForm($form); } public static function table(Table $table): Table diff --git a/app/Filament/Resources/UserResource/RelationManagers/UserDetailRelationManager.php b/app/Filament/Resources/UserResource/RelationManagers/UserDetailRelationManager.php index 75c4e25..f17baad 100644 --- a/app/Filament/Resources/UserResource/RelationManagers/UserDetailRelationManager.php +++ b/app/Filament/Resources/UserResource/RelationManagers/UserDetailRelationManager.php @@ -2,6 +2,7 @@ namespace App\Filament\Resources\UserResource\RelationManagers; +use App\Filament\Components\Forms\UserDetailForm; use App\Models\User; use Filament\Forms; use Filament\Forms\Components\Tabs; @@ -20,87 +21,7 @@ class UserDetailRelationManager extends RelationManager public function form(Form $form): Form { - return $form - ->schema([ - Forms\Components\Card::make()->schema([ - Forms\Components\Toggle::make('is_only_worker') - ->inline(false) - ->label('Только сотрудник') - ]), - Tabs::make('Tabs') - ->tabs([ - Tabs\Tab::make('Основная информация') - ->schema([ - Forms\Components\FileUpload::make('photo') - ->label('Фото') - ->image() - ->disk('public') - ->directory('images') - ->imageEditor() - ->required(), - Forms\Components\Grid::make()->schema([ - Forms\Components\TextInput::make('contactEmail') - ->label('Контактный Email') - ->maxLength(255), - Forms\Components\TextInput::make('contactPhone') - ->label('Контактный телефон') - ->maxLength(255), - ]), - ]), - Tabs\Tab::make('Образование') - ->schema([ - Forms\Components\Grid::make()->schema([ - Forms\Components\TextInput::make('academicTitle') - ->label('Ученая степень') - ->maxLength(255), - Forms\Components\TextInput::make('AcademicDegree') - ->label('Ученое звание') - ->maxLength(255), - ]), - Forms\Components\TextInput::make('education') - ->label('Образование') - ->maxLength(255), - Forms\Components\Repeater::make('professionalRetraining')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Профессиональная переподготовка'), - Forms\Components\Repeater::make('professionalDevelopment') - ->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Повышение квалификации'), - Forms\Components\Repeater::make('awards')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Награды'), - ]), - Tabs\Tab::make('Преподавание') - ->schema([ - Forms\Components\TextInput::make('workExperience') - ->label('Стаж работы') - ->numeric(), - Forms\Components\Repeater::make('professDisciplines')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Преподаваемые дисциплины'), - ]), - Tabs\Tab::make('Научная деятельность') - ->schema([ - Forms\Components\Repeater::make('attendedConferences')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Участие в конференциях'), - Forms\Components\Repeater::make('participationScienceProjects')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Участие в научных проектах'), - Forms\Components\Repeater::make('publications')->schema([ - Forms\Components\TextInput::make('item')->label('')->string()->required() - ])->label('Публикации'), - ]), - Tabs\Tab::make('Другое') - ->schema([ - Forms\Components\Textarea::make('other') - ->columnSpanFull(), - ]), - - - ])->columnSpanFull(), - ]); + return UserDetailForm::getForm($form); } diff --git a/app/Jobs/CreateVkPost.php b/app/Jobs/CreateVkPost.php index 7f8fff3..2a9e81b 100644 --- a/app/Jobs/CreateVkPost.php +++ b/app/Jobs/CreateVkPost.php @@ -32,7 +32,7 @@ class CreateVkPost implements ShouldQueue readonly private string $text, readonly private array $images = [], readonly private int $post_id, - readonly private int $publish_date, + readonly private int|null $publish_date = null, ) {} diff --git a/app/Jobs/UpdateVkPost.php b/app/Jobs/UpdateVkPost.php index add30cc..9454aad 100644 --- a/app/Jobs/UpdateVkPost.php +++ b/app/Jobs/UpdateVkPost.php @@ -32,7 +32,7 @@ class UpdateVkPost implements ShouldQueue readonly private string $text, readonly private array $images = [], readonly private int $post_id, - readonly private int $publish_date, + readonly private int|null $publish_date = null, ) {} diff --git a/app/Models/UserDetail.php b/app/Models/UserDetail.php index 5cb4b71..2419516 100644 --- a/app/Models/UserDetail.php +++ b/app/Models/UserDetail.php @@ -14,6 +14,8 @@ class UserDetail extends Model protected $casts = [ 'is_only_worker' => 'boolean', 'awards' => 'array', + 'education' => 'array', + 'workExperience' => 'array', 'professDisciplines' => 'array', 'professionalRetraining' => 'array', 'professionalDevelopment' => 'array', diff --git a/app/Services/VK/VkService.php b/app/Services/VK/VkService.php index 41ec46f..457b93c 100644 --- a/app/Services/VK/VkService.php +++ b/app/Services/VK/VkService.php @@ -28,7 +28,7 @@ class VkService return $this->wallService->getPostById($id); } - public function createPost(string $title, string $message, array $images = [], int $publish_date = null) + public function createPost(string $title, string $message, array $images = [], int|null $publish_date = null) { $from_group = 1; $album_attachment = ''; @@ -40,7 +40,7 @@ class VkService return $this->wallService->createPost($message, $from_group, $album_attachment, $publish_date); } - public function updatePost(int $id, string $title, string $message, array $images = [], int $publish_date = null) + public function updatePost(int $id, string $title, string $message, array $images = [], int|null $publish_date = null) { $from_group = 1; $vk_post = $this->wallService->getPostById($id); diff --git a/app/Services/VK/Wall/VkWallService.php b/app/Services/VK/Wall/VkWallService.php index b123c89..ad8f021 100644 --- a/app/Services/VK/Wall/VkWallService.php +++ b/app/Services/VK/Wall/VkWallService.php @@ -46,7 +46,7 @@ class VkWallService - public function createPost(string $message, int $from_group, string $attachments = '', int $publish_date) + public function createPost(string $message, int $from_group, string $attachments = '', int|null $publish_date = null) { $params = [ 'owner_id' => '-' . $this->publicId, @@ -79,7 +79,7 @@ class VkWallService } } - public function updatePost(int $post_id, string $message = '', int $from_group = 1, string $attachments = '', int $publish_date) + public function updatePost(int $post_id, string $message = '', int $from_group = 1, string $attachments = '', int|null $publish_date = null) { if (empty($message) && empty($attachments)) { return [ @@ -89,18 +89,6 @@ class VkWallService } - $params = [ - 'owner_id' => '-' . $this->publicId, - 'post_id' => $post_id, - 'message' => $message, - 'attachments' => $attachments, - 'access_token' => $this->wallToken, - 'v' => '5.131', - ]; - - - - try { return $this->vk->wall()->edit( $this->vkAuthService->getToken()->access_token, diff --git a/database/migrations/2023_12_07_165728_create_user_details_table.php b/database/migrations/2023_12_07_165728_create_user_details_table.php index 42f52f5..9ff7bba 100644 --- a/database/migrations/2023_12_07_165728_create_user_details_table.php +++ b/database/migrations/2023_12_07_165728_create_user_details_table.php @@ -19,12 +19,12 @@ return new class extends Migration $table->string('photo')->nullable(); // Фото $table->string('academicTitle')->nullable(); // Ученая степень $table->string('AcademicDegree')->nullable(); // Ученое звание - $table->string('education')->nullable(); // Образование + $table->text('education')->nullable(); // Образование $table->text('awards')->nullable(); // Награды $table->text('professDisciplines')->nullable(); // Преподаваемые программы $table->text('professionalRetraining')->nullable(); // Профессиональная переподготовка $table->text('professionalDevelopment')->nullable(); // Повышение квалификации - $table->integer('workExperience')->nullable(); // Стаж работы + $table->text('workExperience')->nullable(); // Стаж работы $table->text('attendedConferences')->nullable(); // Участие в конференциях $table->text('participationScienceProjects')->nullable(); // Участие в научных проектах $table->text('publications')->nullable(); // Публикации diff --git a/database/migrations/2024_11_11_232229_change_education_column_type_in_user_details.php b/database/migrations/2024_11_11_232229_change_education_column_type_in_user_details.php new file mode 100644 index 0000000..ac8036f --- /dev/null +++ b/database/migrations/2024_11_11_232229_change_education_column_type_in_user_details.php @@ -0,0 +1,25 @@ +text('education')->change(); // Изменяем тип на text + }); + } + + public function down() : void + { + Schema::table('user_details', function (Blueprint $table) { + $table->string('education')->change(); // Возвращаем тип обратно на string + }); + } +}; diff --git a/database/migrations/2024_11_11_232323_change_work_exp_column_type_in_user_details.php b/database/migrations/2024_11_11_232323_change_work_exp_column_type_in_user_details.php new file mode 100644 index 0000000..ebc8e74 --- /dev/null +++ b/database/migrations/2024_11_11_232323_change_work_exp_column_type_in_user_details.php @@ -0,0 +1,28 @@ +text('workExperience')->change(); // Изменяем тип на text + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('user_details', function (Blueprint $table) { + $table->integer('workExperience')->change(); + }); + } +}; diff --git a/docker-compose.yml b/docker-compose.yml index 818dcae..8544a05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,15 +23,15 @@ services: command: > sh -c "php artisan inertia:start-ssr & php-fpm" - php-queue: - restart: always - build: - context: . - dockerfile: _docker/app/Dockerfile - volumes: - - ./:/var/www - container_name: ntspi-php-queue - command: php artisan queue:work --tries=3 --timeout=90 # Настройте параметры по необходимости +# php-queue: +# restart: always +# build: +# context: . +# dockerfile: _docker/app/Dockerfile +# volumes: +# - ./:/var/www +# container_name: ntspi-php-queue +# command: php artisan queue:work --tries=3 --timeout=90 # Настройте параметры по необходимости db: image: mysql:8.0 diff --git a/resources/js/Components/BuilderUi/Persons/Blocks/EducationBlock.vue b/resources/js/Components/BuilderUi/Persons/Blocks/EducationBlock.vue new file mode 100644 index 0000000..1343f2c --- /dev/null +++ b/resources/js/Components/BuilderUi/Persons/Blocks/EducationBlock.vue @@ -0,0 +1,60 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/Components/BuilderUi/Persons/Blocks/ListBlock.vue b/resources/js/Components/BuilderUi/Persons/Blocks/ListBlock.vue new file mode 100644 index 0000000..ec75911 --- /dev/null +++ b/resources/js/Components/BuilderUi/Persons/Blocks/ListBlock.vue @@ -0,0 +1,46 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/Components/BuilderUi/Persons/Blocks/OtherBlock.vue b/resources/js/Components/BuilderUi/Persons/Blocks/OtherBlock.vue new file mode 100644 index 0000000..857250f --- /dev/null +++ b/resources/js/Components/BuilderUi/Persons/Blocks/OtherBlock.vue @@ -0,0 +1,42 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue b/resources/js/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue new file mode 100644 index 0000000..64eb78b --- /dev/null +++ b/resources/js/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue @@ -0,0 +1,49 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/Components/BuilderUi/Persons/PersonNavLink.vue b/resources/js/Components/BuilderUi/Persons/PersonNavLink.vue new file mode 100644 index 0000000..922f59a --- /dev/null +++ b/resources/js/Components/BuilderUi/Persons/PersonNavLink.vue @@ -0,0 +1,40 @@ + + + + + + \ No newline at end of file diff --git a/resources/js/Pages/Client/Persons/Show.vue b/resources/js/Pages/Client/Persons/Show.vue index f005e5a..ad50797 100644 --- a/resources/js/Pages/Client/Persons/Show.vue +++ b/resources/js/Pages/Client/Persons/Show.vue @@ -8,90 +8,13 @@
-
- - - +
- +
@@ -146,167 +69,46 @@
-
-

- Направление подготовки -

- -
-
-

- 2012 - 2013 -

- -

- {{ person.data.details.education }} -

- -

- The University of Manchester -

-
- -
- +
-

- Награды -

-
    - -
+
-

- Профессиональная переподготовка -

-
    - -
+
-

- Повышение квалификации -

-
    - -
+
-

- Преподаваемые дисциплины -

-
    - -
+
-

- Стаж -

- -
-

- Стаж работы: {{ person.data.details.workExperience }} -

-

- Стаж по специальности: {{ person.data.details.workExperience }} -

-
- +
-

- Участие в конференциях -

-
    - -
+
-

- Участие в научных проектах -

-
    - -
+
-

- Публикации -

-
    - -
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ +
@@ -332,6 +134,12 @@ import MainPageNavBar from "@/Navbars/MainPageNavbar.vue"; import AppHead from "@/Components/AppHead.vue"; import PersonBreadcrumbs from "@/Components/BuilderUi/Persons/PersonBreadcrumbs.vue"; import PersonAvatarBlock from "@/Components/BuilderUi/Persons/PersonAvatarBlock.vue"; +import PersonNavLink from "@/Components/BuilderUi/Persons/PersonNavLink.vue"; +import PageNavigateLinks from "@/Components/BuilderUi/Pages/PageNavigateLinks.vue"; +import EducationBlock from "@/Components/BuilderUi/Persons/Blocks/EducationBlock.vue"; +import ListBlock from "@/Components/BuilderUi/Persons/Blocks/ListBlock.vue"; +import WorkExperienceBlock from "@/Components/BuilderUi/Persons/Blocks/WorkExperienceBlock.vue"; +import OtherBlock from "@/Components/BuilderUi/Persons/Blocks/OtherBlock.vue"; export default { @@ -340,6 +148,7 @@ export default { return { scrollTop: false, currentNavSection: null, + headerNavs: [] } }, @@ -353,6 +162,12 @@ export default { }, components: { + OtherBlock, + WorkExperienceBlock, + ListBlock, + EducationBlock, + PageNavigateLinks, + PersonNavLink, PersonAvatarBlock, PersonBreadcrumbs, AppHead, @@ -427,10 +242,20 @@ export default { scrollToTop() { window.scrollTo(0, 0) }, + extractH2Headers() { + const h2Elements = document.querySelectorAll('h2'); // выбираем все h2 на странице + this.headerNavs = Array.from(h2Elements).map(h2 => ({ + id: h2.id, // id заголовка + text: h2.textContent // содержимое заголовка + })); + } + }, mounted() { + this.extractH2Headers(); + window.addEventListener("scroll", this.onScroll)