regestery tk023

master
Boris Voropaev 2024-02-08 16:49:36 +03:00
parent bf561161da
commit 0f00949df7
7 changed files with 41 additions and 29 deletions

View File

@ -6,7 +6,7 @@ export const environment = {
production: false,
apiUrl: 'http://api.neftegaz.lc',
clientId: 2,
clientSecret: 'B7alelPwCZJfVG8AjM21ByNAekSDv8wUqooiXnH1',
clientSecret: 'RmvjxrgGIQQ3JXZ4gvCSRLMuXPopPDsiYua6Xvlc',
project: null,
licence: 'POUFLO4YW7SU',
defaultLocale: 'ru'

View File

@ -19,8 +19,7 @@
</a>
<div class="slider-menu-locale">
<locale></locale>
{{rootPage.name}}
{{rootPage.name}}
</div>
</div>
</div>

View File

@ -1,14 +1,17 @@
<table class="default">
<tr *ngFor="let field of fields" [ngSwitch]="field.type">
<td class="caption">{{field.title}}</td>
<td *ngSwitchCase="'document'">
<div class="documents list default">
<div class="items">
<div class="item"><a [href]="field.value?.links?.open" target="_blank">{{field.value?.name}}</a></div>
<div class="entry-prop">
<table class="default">
<tr *ngFor="let field of fields" [ngSwitch]="field.type">
<td class="caption">{{field.title}}</td>
<td *ngSwitchCase="'document'">
<div class="documents list default">
<div class="items">
<div class="item"><a [href]="field.value?.links?.open" target="_blank">{{field.value?.name}}</a></div>
</div>
</div>
</div>
</td>
<td *ngSwitchDefault class="value">{{getValue(field)}}</td>
</tr>
</table>
</td>
<td *ngSwitchDefault class="value">{{getValue(field)}}</td>
</tr>
</table>
<drop-down *ngIf="expandeble" (click)="toggle()"></drop-down>
</div>

View File

@ -11,7 +11,9 @@ import {DatePipe} from "@angular/common";
export class EntryPropertiesComponent {
@Input() entry: any;
@Input() bar: number;
@Input() expande: boolean;
expande = false;
private fieldsLength:number;
constructor(private entriesService: RegistryEntriesService, private objectsService: ObjectsService, private datePipe: DatePipe) {
}
@ -19,8 +21,13 @@ export class EntryPropertiesComponent {
get fields() {
let fields = this.objectsService.parsedFields(this.entry.properties?.data)
.filter(field => {return field.value?.length || field.value?.id});
if (!this.expande) fields = fields.slice(0,this.bar)
return fields
this.fieldsLength = fields.length
if (this.expande) return fields
return fields.slice(0,this.bar)
}
get expandeble(){
return this.bar < this.fieldsLength
}
ngOnInit() {
@ -43,4 +50,9 @@ export class EntryPropertiesComponent {
}).join('; ');
}
toggle() {
this.expande = !this.expande;
}
}

View File

@ -9,7 +9,7 @@
</div>
<span *ngIf="!link">{{title}}</span>
</div>
<drop-down *ngIf="isExpandable && withToggle" (click)="toggle()" [visible]="isExpanded"></drop-down>
</div>
<div class="block" *ngIf="registryOptions?.states && activeSince">
<div class="state {{entry.state?.name}}">{{entry.state?.title}}</div>
@ -31,7 +31,7 @@
</div>
<div class="details" >
<div class="block" *ngIf="registryOptions?.properties">
<entry-properties [entry]="entry" [bar]="bar" [expande]="isExpanded && withToggle"></entry-properties>
<entry-properties [entry]="entry" [bar]="bar"></entry-properties>
</div>
<div class="block" *ngIf="registryOptions?.operations">
<entry-operations [entry]="entry" [editMode]="editMode"></entry-operations>

View File

@ -14,8 +14,6 @@ export class RegistryEntryComponent {
@Input() entry: any;
@Input() editMode: boolean;
public isExpanded = false;
constructor(private entriesService: RegistryEntriesService, private formsService: FormsService, private listsService: ListsService, private datePipe: DatePipe) {
}
@ -53,6 +51,7 @@ export class RegistryEntryComponent {
get bar(){
switch(this.registry.type.name){
case 'notice': return 2;
case 'standards': return 4;
}
return 2
}
@ -65,7 +64,6 @@ export class RegistryEntryComponent {
add() {
if (this.isExpandable) this.isExpanded = true;
this.formsService.createModel('entryOperation', {extraProps: {entry: this.entry.id}}, this.operationsListId);
}
@ -81,11 +79,6 @@ export class RegistryEntryComponent {
}
}
toggle() {
this.isExpanded = !this.isExpanded;
}
get withToggle(){
return this.registry.type.name !== 'workshops'
}

View File

@ -214,6 +214,11 @@ registry-entry {
}
.entry-prop{
display: flex;
align-items: center;
}
pagination{
display: block;
&:first-child {