fix tk023

master
Boris Voropaev 2024-02-20 16:24:48 +03:00
parent 9ed2610996
commit 48ff919640
9 changed files with 107 additions and 130 deletions

View File

@ -1,4 +1,4 @@
<ul class="breadcrumbs" *ngIf="parents.length>1">
<ul class="breadcrumbs" [ngClass]="depthClass">
<li *ngFor="let parent of parents"><a [routerLink]="parent.link">{{parent.name}}</a></li>
<li>{{page.name}}</li>
</ul>

View File

@ -15,6 +15,13 @@ export class pageBreadcrumbsComponent {
return this.page?.parents?.data;
}
get depthClass(){
let depthClass:any = {};
let name = 'bc-depth-' + this.parents.length;
depthClass[name] = true;
return depthClass
}
ngOnInit() {
}

View File

@ -1,5 +1,5 @@
<div class="footer layout-corral">
<a>
<a href="https://vniigaz-cert.ru/" target="_blank">
© 2023, Газпром ВНИИГАЗ
</a>
<div>

View File

@ -1,49 +1,44 @@
<div class="layout-corral " *ngIf="pictURL">
<div class="jumbotron-img">
<div class="layout-corral">
<div class="jumbotron-img" *ngIf="pictURL">
<img [src]="pictURL" alt="">
</div>
<div class="jumbotron-board">
<div class=" jumbotron-registeries">
<a href="uvedomlenie-o-razrabotke"><h2>Разработка стандартов</h2></a>
<div *ngFor="let reg of regestries; index as i;">
<div *ngIf="i<3">
<div *ngFor="let entry of entries">
<div class="">
<span *ngIf="reg.notificationDate" class="notification-date">{{reg.notificationDate | date : 'dd.MM.yyyy'}}&emsp;</span>
<span *ngIf="reg.yearInclusion" class="year-inclusion">{{reg.yearInclusion}}&emsp;</span>
<span>{{reg.type}}&emsp;</span>
<span class="subcommittee">{{reg.subcommittee}}</span>
<span *ngIf="entry.notificationDate" class="notification-date">{{entry.notificationDate | date : 'dd.MM.yyyy'}}&emsp;</span>
<span *ngIf="entry.yearInclusion" class="year-inclusion">{{entry.yearInclusion}}&emsp;</span>
<span>{{entry.type}}&emsp;</span>
<span class="subcommittee">{{entry.subcommittee}}</span>
</div>
<div class="name">
<a [routerLink]="reg.page">{{reg.name}}</a>
<a [routerLink]="entry.page">{{entry.name}}</a>
</div>
<div *ngIf="reg.startDiscussion" class="discussion">
<span class="start-discussion">{{reg.startDiscussion | date : 'dd.MM.yyyy'}}</span> -
<span class="end-discussion">{{reg.endDiscussion | date : 'dd.MM.yyyy'}}</span>
<div *ngIf="entry.startDiscussion" class="discussion">
<span class="start-discussion">{{entry.startDiscussion | date : 'dd.MM.yyyy'}}</span> -
<span class="end-discussion">{{entry.endDiscussion | date : 'dd.MM.yyyy'}}</span>
</div>
<div *ngIf="reg.documentType">
<span class="document-type">{{reg.documentType}}&emsp;</span>
<span class="designation">{{reg.designation}}&emsp;</span>
<span class="order">{{reg.order}}</span>
<div *ngIf="entry.documentType">
<span class="document-type">{{entry.documentType}}&emsp;</span>
<span class="designation">{{entry.designation}}&emsp;</span>
<span class="order">{{entry.order}}</span>
</div>
<br>
</div>
</div>
</div>
<div class=" jumbotron-news">
<a href="novosti"><h2>Новости</h2></a>
<div *ngFor="let pub of news; index as i;">
<div *ngIf="i<3">
<span>{{pub.date}}&emsp;</span>
<a [routerLink]="pub.link ">{{pub.name}}&emsp;</a>
</div> <br>
<div *ngFor="let pub of news">
<span class="pub-date">{{pub.date}}&emsp;</span>
<a [routerLink]="pub.link ">{{pub.name}}&emsp;</a><br>
</div>
</div>

View File

@ -1,8 +1,10 @@
import { Component } from '@angular/core';
import { PagesService } from '@app/_services/pages.service';
import { RegistryEntriesService } from '@app/_services/registry-entries.service';
import {PublicationsService} from "@app/_services/publications.service";
import { RegistriesService } from '@app/_services/registries.service';
import { HttpClient } from '@angular/common/http';
import { environment } from '@environments/environment';
@Component({
selector: 'jumbotron',
@ -11,14 +13,14 @@ import { RegistriesService } from '@app/_services/registries.service';
})
export class JumbotronComponent {
regestries: any[] =[]
entries: any[]
rootEntries: any
news: any[] =[]
constructor(
private pagesService: PagesService,
private entriesService: RegistryEntriesService,
private publicationsService: PublicationsService,
private registriesService: RegistriesService
private http: HttpClient,
){}
get currentPage(){
@ -33,93 +35,55 @@ export class JumbotronComponent {
return !this.pagesService.currentPage?.parents.data.length && this.pagesService.currentPage
}
newlist(type: string, params?: {}) {
return this.http.get(`${environment.apiUrl}/api/registries/list/${type}`, {params: params});
}
ngOnInit(){
let include = ['page'];
this.registriesService.list({
// filters:JSON.stringify({"id": "602770ef-7f5b-421e-a4f4-14e16ca1ee90"}),
include: include.join(',')
}).subscribe(
resp => {
console.log('DATA',resp.data)
let regID:any = [];
regID = regID.concat(
resp.data.filter( reg=> reg.type.name == "notice")
.map(reg=>({id: reg.id, type:reg.type.title, page:reg.page.data.link}))
)
regID = regID.concat(
resp.data.filter( reg=> reg.type.name == "approval")
.map(reg=>({id: reg.id, type:reg.type.title, page:reg.page.data.link}))
)
console.log(regID)
regID.forEach(reg=>{
this.entriesService.list({
page:1,
filters:JSON.stringify({
"registry": reg.id
})
}).subscribe(resp=>{
let include = ['properties.groups.fields.value'];
resp.data.forEach(entry => {
this.entriesService.show(entry.id,{include: include.join(',')}).subscribe(resp=>{
console.log('ENYTY',resp.data)
console.log('REG',reg)
let properties = resp.data.properties.data.groups.data[0].fields.data;
this.regestries.push({
type:reg.type,
page: reg.page,
createdAt:resp.data.createdAt,
notificationDate: properties.find(prop=>prop.name=='notification-date')?.value.data[0],
subcommittee: properties.find(prop=>prop.name=='subcommittee')?.value.data[0],
name: resp.data.name,
link: resp.data.link,
startDiscussion: properties.find(prop=>prop.name=='start-discussion')?.value.data[0],
endDiscussion: properties.find(prop=>prop.name=='end-discussion')?.value.data[0],
yearInclusion: properties.find(prop=>prop.name=='year-inclusion')?.value.data[0],
documentType: properties.find(prop=>prop.name=='document-type')?.value.data[0],
designation: properties.find(prop=>prop.name=='designation')?.value.data[0],
order: properties.find(prop=>prop.name=='order')?.value.data[0],
})
this.regestries.sort((a,b)=> a.createdAt<b.createdAt?1:-1)
})
});
})
})
// this.entriesService.list({
// page:1,
// filters:JSON.stringify({
// "registry": regID[0]
// })
// }).subscribe(resp=>{
// let include = ['properties.groups.fields.value'];
// resp.data.slice(0,3).forEach(entry => {
// this.entriesService.show(entry.id,{include: include.join(',')}).subscribe(resp=>{
// let properties = resp.data.properties.data.groups.data[0].fields.data;
// this.regestries.push({
// notificationDate: properties.find(prop=>prop.name=='notification-date').value.data[0],
// subcommittee: properties.find(prop=>prop.name=='subcommittee').value.data[0],
// name: resp.data.name,
// link: resp.data.link,
// startDiscussion: properties.find(prop=>prop.name=='subcommittee').value.data[0],
// endDiscussion: properties.find(prop=>prop.name=='subcommittee').value.data[0],
// })
// })
// });
// })
let include = ['registry.page', 'properties.groups.fields.value'];
this.newlist('notice',{include: include.join(',')}).subscribe(
(resp:any)=>{
this.rootEntries = resp.data;
this.newlist('approval',{include: include.join(',')}).subscribe(
(resp:any)=>{
this.rootEntries = this.rootEntries
.concat(resp.data)
.sort((a,b)=> a.createdAt<b.createdAt?1:-1)
.slice(0,5)
this.entries = this.rootEntries.map(entry=>{
let properties = entry.properties.data.groups.data[0].fields.data;
let findProp = (propName)=>properties.find(prop=>prop.name==propName)?.value.data[0]
return{
type: entry.registry.data.type.title,
page: entry.registry.data.page.data.link,
name: entry.name,
notificationDate: findProp('notification-date'),
subcommittee: findProp('subcommittee'),
startDiscussion: findProp('start-discussion'),
endDiscussion: findProp('end-discussion'),
yearInclusion: findProp('year-inclusion'),
documentType: findProp('document-type'),
designation: findProp('designation'),
order: findProp('order'),
}
})
}
)
}
);
// this.registriesService.list().subscribe(resp=>{
// console.log('EEEEntry', resp.data)
// let regID = resp.data.find( reg=> reg.type.name == "notice").id
// console.log('EEEEntry', regID)
// })
this.publicationsService.list({subType: 'publication-news'}).subscribe(resp=>{
// console.log('novosti', resp)
this.news = resp.data.slice(0,3).map( pub =>
this.news = resp.data.slice(0,5).map( pub =>
({
name: pub.name,
date: pub.publishDateRus,

View File

@ -149,20 +149,22 @@ button.mat-calendar-body-cell{
}
.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover > .mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){
background-color: rgba(0, 162, 255,0.3);
background-color: rgba(0, 162, 255,0.3) ;
font-weight: 400;
}
.mat-calendar-body-cell-content{
font-family: PT Sans;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 24px;
width: 32px !important;
height: 32px !important;
button.mat-mdc-button:hover, button.mat-mdc-icon-button:hover{
background-color: rgba(0, 162, 255,0.3) ;
border: none;
}
.mat-calendar-body-cell-content{
font-weight: 500;
line-height: 24px;
}
.tox-promotion, .tox-statusbar__branding {
display: none!important;
}
@ -446,11 +448,6 @@ modal{
}
.toggle {
font-family: PT Sans;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 24px;
display: flex;
flex-direction: row;
align-items: center;

View File

@ -375,11 +375,6 @@ form-field-image{
.caption {
color: var(--second);
font-family: PT Sans;
font-size: 20px;
font-style: normal;
font-weight: 400;
line-height: 32px;
}
.value {
.error {

View File

@ -74,6 +74,9 @@ jumbotron{
>div{
flex-grow: 1;
flex-basis: 50%;
.notification-date, .year-inclusion, .pub-date{
color: var(--second);
}
}
}
}

View File

@ -9,6 +9,14 @@ page-breadcrumbs{
gap:2px;
padding: 0;
list-style-type: none;
&.bc-depth-0{
display: none;
}
&.bc-depth-1{
li:first-child{
display: none;
}
}
li{
&:first-child{
display: inline-flex;
@ -174,6 +182,14 @@ cards-section{
border-top: 1px solid var(--second-dis);
border-bottom: 1px solid var(--second-dis);
margin-bottom: 40px;
&::before{
content: "Группа карточек";
margin-right: auto;
}
>span{
display: none;
}
ico{
cursor: pointer;
svg{