Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<ion-header [translucent]="true">
<ion-toolbar color="primary">
<ion-title>Gérer les positions de signatures</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div style="display: flex;height: 100%;">
<div style="flex: 1;">
<ion-list>
<ion-item>
<ion-label>Page</ion-label>
<ion-select interface="popover" [(ngModel)]="currentPage"
(ionChange)="changePage($event.detail.value)">
<ion-select-option *ngFor="let page of pages" [value]="page">{{page}}</ion-select-option>
</ion-select>
</ion-item>
</ion-list>
<ion-list>
<ion-radio-group [(ngModel)]="currentUser" (ionChange)="selectUser($event.detail.value)">
<ion-item *ngFor="let user of workflow;let i=index">
<ion-radio slot="start" [value]="i"></ion-radio>
<ion-label>
<h2>{{user.userDisplay}} <sup class="primary"
color="primary">({{user.mode === 'sign' ? ('lang.signUser' | translate): ('lang.visaUser' | translate)}})</sup>
</h2>
<p>
<ng-container *ngFor="let sign of signList">
<ion-chip style="z-index: 9999;" *ngIf="sign.sequence === i" outline
[color]="(i=== currentUser && sign.page === currentPage) ? 'primary' : 'medium'"
(click)="goToSignUserPage(i,sign.page)">
<ion-label>{{sign.page}}</ion-label>
</ion-chip>
</ng-container>
</p>
</ion-label>
</ion-item>
</ion-radio-group>
</ion-list>
<div style="text-align: center;">
<ion-button color="primary" *ngIf="emptySign()" (click)="initSign()">Positionner la signature</ion-button>
</div>
</div>
<div class="signatureContainer">
<div id="myBounds" #myBounds
style="position: absolute;position: absolute;box-shadow: 0px 0px 5px 0px #656565;"
[style.width.px]="workingAreaWidth" [style.height.px]="workingAreaHeight">
<ng-container *ngFor="let sign of signList;let indexSign=index;">
<div *ngIf="sign.page === currentPage" [class.signDisabled]="currentUser!==sign.sequence"
[position]="{x: (sign.position.positionX*workingAreaWidth)/100, y:(sign.position.positionY*workingAreaHeight)/100}"
[style.width.%]="25" [ngDraggable]="currentUser===sign.sequence"
(endOffset)="moveSign($event, i);" [preventDefaultEvent]="false" [bounds]="myBounds"
[inBounds]="true" class="signature"
(click)="currentUser!=sign.sequence ? goToSignUserPage(sign.sequence, currentPage) : false">
<ion-buttons style="position: absolute;top: -50px;right: 0px;">
<ion-button fill="clear" slot="icon-only" shape="round" size="small" color="danger"
[title]="'lang.delete' | translate" (click)="deleteSign(indexSign)">
<ion-icon slot="icon-only" name="trash-outline"></ion-icon>
</ion-button>
</ion-buttons>
<span class="signUserName">{{getUserName(sign.sequence)}}</span>
SIGNATURE
</div>
</ng-container>
<img class="img-content" [src]="imgContent" />
</div>
</div>
</div>
<ngx-extended-pdf-viewer style="display: none;" [src]="pdfContent" [useBrowserLocale]="true" [textLayer]="false"
(pdfLoaded)="onPagesLoaded($event)">
</ngx-extended-pdf-viewer>
</ion-content>
<ion-footer class="ion-no-border">
<ion-toolbar>
<ion-buttons class="ion-justify-content-center">
<ion-button type="button" color="primary" fill="outline" shape="round" (click)="onSubmit()">
<ion-label>{{'lang.save' | translate}}</ion-label>
</ion-button>
<ion-button type="button" color="medium" fill="outline" shape="round" (click)="modalController.dismiss()">
<ion-label>{{'lang.cancel' | translate}}</ion-label>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-footer>
<!--<div class="mat-dialog-content-container">
<h1 mat-dialog-title>Gérer les positions de signatures</h1>
<div mat-dialog-content>
<div *ngIf="loading" class="loading" style="display:flex;height:100%;">
<mat-spinner style="margin:auto;"></mat-spinner>
</div>
<div style="display: flex;height: 100%;">
<div style="padding-right: 10px;">
<mat-radio-group aria-labelledby="example-radio-group-label" class="example-radio-group"
[(ngModel)]="currentUser" class="example-radio-group">
<mat-radio-button *ngFor="let user of data.workflow;let i=index" [value]="i"
class="example-radio-button" (change)="selectUser(i)">
<div>{{user.labelToDisplay}} <sup
color="primary">({{user.requested_signature ? ('lang.signUser' | translate): ('lang.visaUser' | translate)}})</sup>
</div>
<div>
<mat-chip-list aria-label="Fish selection">
<ng-container *ngFor="let sign of signList">
<mat-chip *ngIf="sign.sequence === i" color="accent" style="font-size: 10px;
padding-top: 0px;
padding-bottom: 0px;
min-height: 20px;cursor: pointer;" (click)="goToSignUserPage(i,sign.page)">Page
{{sign.page}}</mat-chip>
</ng-container>
</mat-chip-list>
</div>
</mat-radio-button>
</mat-radio-group>
<mat-form-field>
<mat-label>Page :</mat-label>
<mat-select [(ngModel)]="currentPage" (selectionChange)="changePage($event.value)">
<mat-option *ngFor="let page of pages" [value]="page">{{page}}</mat-option>
</mat-select>
</mat-form-field>
<button *ngIf="emptySign()" mat-raised-button color="primary" type="button"
(click)="initSign()">Positionner la
signature</button>
</div>
<div class="signatureContainer">
<div id="myBounds" #myBounds style="position: absolute;position: absolute;"
[style.width.px]="workingAreaWidth" [style.height.px]="workingAreaHeight">
<ng-container *ngFor="let sign of signList">
<div *ngIf="sign.page === currentPage" [class.signDisabled]="currentUser!==sign.sequence"
[position]="{x: (sign.position.positionX*workingAreaWidth)/100, y:(sign.position.positionY*workingAreaHeight)/100}"
[style.width.%]="25" [ngDraggable]="currentUser===sign.sequence"
(endOffset)="moveSign($event, i);" [preventDefaultEvent]="false" [bounds]="myBounds"
[inBounds]="true" class="signature">
<span>{{getUserName(sign.sequence)}}</span>
SIGNATURE
</div>
</ng-container>
</div>
<img class="img-content" [src]="imgContent" />
</div>
</div>
<ngx-extended-pdf-viewer style="display: none;" [src]="pdfContent" [useBrowserLocale]="true" [textLayer]="false"
(pdfLoaded)="onPagesLoaded($event)">
</ngx-extended-pdf-viewer>
</div>
<span class="divider-modal"></span>
<div mat-dialog-actions class="actions">
<button mat-raised-button mat-button color="primary"
(click)="onSubmit()">{{'lang.validate' | translate}}</button>
<button mat-raised-button mat-button [disabled]="loading"
[mat-dialog-close]="">{{'lang.cancel' | translate}}</button>
</div>
</div>-->