master
sergeybodin 2023-09-21 12:27:21 +03:00
parent 16360f44a2
commit fe85ef3cb9
14 changed files with 75 additions and 62 deletions

View File

@ -12,12 +12,6 @@ export class CompanyComponent {
constructor(private formsService: FormsService) {
}
ngOnInit() {
}
ngOnDestroy() {
}
get logo() {
return this.company?.logo?.data.links?.full;

View File

@ -1,6 +1,5 @@
<div class="header" >
<div class="header">
<div class="bottom">
<!-- -->
<div class="main-menu-btn" (click)="showBottom=true">
<button class=" clear"></button>
</div>
@ -8,7 +7,7 @@
<div class="logo">
<header-user-bar *ngIf="user" [user]="user"></header-user-bar>
</div>
</a>
</a>
<div class="grid-menu" >
<button class="close" (click)="showBottom=false"></button>
<pages-menu [items]="menuItems" (onSelected)="itemSelect($event)"></pages-menu>
@ -20,7 +19,6 @@
</div>
</div>
</div>
<div class="header showmobile" *ngIf="showBottom">
<div class="bottom">
<div class="grid-menu">
@ -28,9 +26,9 @@
<button class="close" (click)="showBottom=false"></button>
<pages-menu [items]="menuItems" (onSelected)="itemSelect($event)"></pages-menu>
<a class="ais" href="https://ais.vniigaz-cert.ru/" target="_blank">АИС СЦ ВНИИГАЗ</a>
</div>
</div>
</div>
<div class="fog" (click)="showBottom=false" [ngClass]="{hidemobile:!showBottom,showmobile:showBottom}"></div>
<div class="fog" (click)="showBottom=false" [ngClass]="{hidemobile:!showBottom,showmobile:showBottom}"></div>
</div>
</div>

View File

@ -14,26 +14,41 @@ export class HeaderComponent {
public user: any;
public loading: boolean = false;
public error: string = '';
subscription: Subscription;
subscriptionUser: Subscription;
showBottom = false;
constructor(private router: Router, private pagesService: PagesService, public authenticationService: AuthenticationService, private listsService: ListsService) {
this.subscription = this.authenticationService.user.subscribe(user => {
controlsSubscriptionMenu: Subscription;
resultSubscriptionMenu: Subscription;
constructor(
private router: Router,
private pagesService: PagesService,
public authenticationService: AuthenticationService,
private listsService: ListsService
) {
this.subscriptionUser = this.authenticationService.user.subscribe(user => {
this.user = user;
});
}
ngOnInit() {
this.fetchMenu();
let showSettingSite = localStorage.getItem('showSettingSite');
if (showSettingSite === null || showSettingSite === 'no') {
localStorage.setItem('showSettingSite', 'no');
this.listsService.result('showSettingSite').next(false);
}
this.controlsSubscriptionMenu = this.listsService.controls('headerMenu').subscribe(controls => {
this.fetchMenu();
});
this.resultSubscriptionMenu = this.listsService.result('headerMenu').subscribe(res => {
this.menuItems = res?.data || [];
});
}
ngOnDestroy() {
this.subscription?.unsubscribe();
this.subscriptionUser?.unsubscribe();
this.controlsSubscriptionMenu?.unsubscribe();
this.resultSubscriptionMenu?.unsubscribe();
}

View File

@ -3,7 +3,7 @@
<div class="row">
<div class="left">
<h2>Портфолио</h2>
<button type="button" class="btn default" routerLink="/uslugi/portfolio-proektov">Подробнее вап вапв</button>
<button type="button" class="btn default" routerLink="/uslugi/portfolio-proektov">Подробнее</button>
</div>
<div class="right">
<div class="holder">

View File

@ -1,2 +1,8 @@
<pages-menu-item (click)="close()" (onSelected)="itemSelect($event)" (mouseleave)="leave()"
[class.hidden]="hidden" [item]="item" *ngFor="let item of visibleItems"></pages-menu-item>
<pages-menu-item
(click)="close()"
(onSelected)="itemSelect($event)"
(mouseleave)="leave()"
[class.hidden]="hidden"
[item]="item"
*ngFor="let item of visibleItems"
></pages-menu-item>

View File

@ -1,4 +1,7 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {AdvisoryMembersService} from "@app/_services/advisory-members.service";
import {ListsService} from "@app/_services";
import {Subscription} from "rxjs";
@Component({
selector: 'pages-menu',
@ -9,10 +12,15 @@ export class PagesMenuComponent {
@Input() items = <any>[];
@Output() onSelected = new EventEmitter();
public hidden = false;
private hiddenPages = ['/o-tsentre/protivodeistvie-korruptsii', '/o-tsentre/zashchita-personalnykh-dannykh', '/o-tsentre/okhrana-truda'];
constructor() {
}
ngOnInit() {
}
get visibleItems() {
return this.items.filter(item => {
@ -23,8 +31,8 @@ export class PagesMenuComponent {
close() {
this.hidden = !this.hidden;
// setTimeout(() => {this.hidden = false;}, 100);
}
leave(){
this.hidden = false;
}
@ -32,5 +40,4 @@ export class PagesMenuComponent {
itemSelect(event:any){
this.onSelected.emit(event);
}
}

View File

@ -5,7 +5,7 @@
</div>
<div *ngIf="editMode" class="toggle" (click)="add()"></div>
</div>
<div class="list">
<div class="item" *ngFor="let member of members">
@ -19,8 +19,8 @@
<!-- <div class="doc-icon" [style.backgroundImage]="iconUrl(field?.value?.data[0]?.extension)">
</div> -->
<div class="doc-link">
<a [textContent]="getFields(member)['member-doc'].name+'shd;oughfiogsofehg;o;fdh;oigs;hdofghifdh'" class="title" [href]="getFields(member)['member-doc'].links.download"></a>
</div>
<a [textContent]="getFields(member)['member-doc-name']" class="title" [href]="getFields(member)['member-doc'].links.download"></a>
</div>
</div>
<div class="more"><a [href]="getLink(member.id)">
Подробнее <img src="/assets/images/icons/chevron_right_24dp.svg" alt="">

View File

@ -21,21 +21,17 @@ export class MemberSectionListComponent {
ngOnInit() {
}
// <ng-template ngFor let-group [ngForOf]="member.groups.data">
// <ng-template ngFor let-field [ngForOf]="group.fields.data">
getFields(member){
let fields:any = {};
member.groups.data.forEach(group =>{
group.fields.data.forEach(field =>{
if(field.name&&field?.value?.data[0]){
fields[field.name] = field?.value?.data[0]
}
})
getFields(member) {
let fields: any = {};
member.groups.data.forEach(group => {
group.fields.data.forEach(field => {
if (field.name && field?.value?.data[0]) {
fields[field.name] = field?.value?.data[0]
}
})
return fields
})
console.log(fields['member-doc'].links.download);
return fields
}
@ -55,7 +51,7 @@ export class MemberSectionListComponent {
return this.section.id;
}
iconUrl(name:string){
iconUrl(name: string) {
return `url(/assets/images/icons/document/${name.toUpperCase()}.svg)`
}
@ -67,7 +63,7 @@ export class MemberSectionListComponent {
add() {
let attach = {modelType: 'object', group: 'sections', modelId: this.section.id, ord: this.ord};
let attach = {modelType: 'object', group: 'sections', modelId: this.section.id, ord: this.ord};
this.formsService.createObject('page-section-list-member', {extraProps: {attach: attach}});
}

View File

@ -7,10 +7,7 @@
<img *ngIf="logo" src="{{logo}}" alt="" />
<span *ngIf="!logo">{{noLogoLetters}}</span>
</div>
<div class="name">
<p><a [routerLink]="page.link" target="_blank">{{page.name}}</a></p>
<!-- <p class="sub">{{page.type?.title}}</p> -->
</div>
<div class="name"><p><a [routerLink]="page.link" target="_blank" [innerHTML]="page.name"></a></p></div>
</div>
</div>
<div class="right">

View File

@ -19,9 +19,17 @@ export class PagesTreeItemComponent {
constructor(private router: Router, private pagesService: PagesService, private formsService: FormsService, private listsService: ListsService) {
}
ngOnInit() {
this.subscription = this.listsService.controls(this.listId).subscribe(res => {
if (this.touched) this.fetch();
});
}
get listId() {
return this.page.id;
}
get parentListId() {
return this.parent?.id || 'pages-tree-root';
}
@ -29,21 +37,16 @@ export class PagesTreeItemComponent {
get logo() {
return this.page?.logo?.data.links?.full;
}
get noLogoLetters() {
return this.page.name.replace(' ', '').slice(0, 2);
}
get children() {
return this.page.children?.data;
}
ngOnInit() {
this.subscription = this.listsService.controls(this.listId).subscribe(res => {
if (this.touched) this.fetch();
});
}
fetch() {
let include = ['children.children'];
this.pagesService.show(this.page.id, {include: include.join(',')}).subscribe(res => {
@ -66,11 +69,8 @@ export class PagesTreeItemComponent {
});
}
toggle() {
this.active = !this.active;
if (this.active) this.fetch();
}
}

View File

@ -3,10 +3,10 @@
background-image: url('~src/assets/images/icons/home_page_24dp.svg');
}
.item:not(.home){
.item:not(.home){
.bar{
padding-left: 50px;
}
.item .bar{
padding-left: 100px;
@ -19,8 +19,6 @@
.item {
.bar {
display: flex;
flex-direction: row;
@ -62,7 +60,7 @@
color: #ffffff;
span{
display: none;
}
&::before {
content: "";

View File

@ -68,6 +68,7 @@ export class PagesTreeComponent {
add() {
//this.listsService.result('headerMenu').next(result);
this.formsService.createModel('page', null, this.listId);
}

View File

@ -14,6 +14,7 @@
padding-left: 8px;
&:hover{
color: var(--blue-2);
cursor: pointer;
}
};
&::before{

View File

@ -6,7 +6,7 @@ export const environment = {
production: false,
apiUrl: 'http://api.vniigazv2.lc',
clientId: 2,
clientSecret: 'XVBDBzHcJu52dGI5qctg8l6aT7Q8Ms9PKiAUHOVp',
clientSecret: 'Z4AOjzV1N676Yvudrm5SfpeFLxh00RigroxaBYCw',
};
/*