drag n drop documents

master
Boris Voropaev 2023-12-18 15:54:28 +03:00
parent 1344166fa4
commit bb0f3a09c8
6 changed files with 15 additions and 3 deletions

View File

@ -31,7 +31,7 @@ export class AuthFormPasswordForgetComponent implements OnInit {
return this.f?.email?.value;
}
onSubmit() {console.log(111)
onSubmit() {
if (this.form.invalid) return;
this.loading = true;
this.authenticationService.forget(this.email).subscribe(res => {

View File

@ -7,12 +7,14 @@ import {FieldDocumentSingleComponent} from "@app/_modules/form-fields/types/docu
import {FieldDocumentMultipleComponent} from "@app/_modules/form-fields/types/document/multiple/field-document-multiple.component";
import { WidjetModule } from '@app/_modules/widjet/widjet.module';
import {FieldDocumentValueComponent} from "@app/_modules/form-fields/types/document/value/field-document-value.component";
import {SortablejsModule} from "@dustfoundation/ngx-sortablejs";
@NgModule({
imports: [
CommonModule,
ReactiveFormsModule,
WidjetModule,
SortablejsModule
],
declarations: [
FormFieldDocumentComponent,

View File

@ -9,6 +9,6 @@
<div class="progress"><div class="fill" [style.width]="upload.progress + '%'"></div></div>
</div>
</div>
<div class="values">
<div class="values" [sortablejs]="assets" [sortablejsOptions]="documentsValues">
<field-document-value *ngFor="let asset of assets" [asset]="asset" (delete)="removeValue(asset)"></field-document-value>
</div>

View File

@ -2,6 +2,7 @@ import {Component, HostListener, Input} from '@angular/core';
import {FormGroup} from "@angular/forms";
import {AssetsService} from "@app/_services/assets.service";
import {HttpEventType, HttpResponse} from "@angular/common/http";
import {SortableOptions} from "sortablejs";
@Component({
selector: 'field-document-multiple',
@ -16,6 +17,13 @@ export class FieldDocumentMultipleComponent {
public upload: any = {file: null, progress: 0};
public dragOver = false;
public documentsValues: SortableOptions = {
group: 'doc-values',
handle: 'file-ico',
// onUpdate: (event: any) => {this.move(event)},
// onAdd: (event: any) => {this.move(event)}
};
@HostListener("dragover", ["$event"])
@HostListener("dragenter", ["$event"])
@HostListener("dragend", ["$event"])

View File

@ -89,7 +89,6 @@ export class JumbotronComponent {
}
get editable(){
console.log(this.currentPage)
return this.currentPage&&(this.authService.privileges?.admin|| this.authService.privileges?.editor);
}

View File

@ -216,6 +216,9 @@ form-field-document{
line-height: 24px;
color: var(--second);
}
file-ico{
cursor: move;
}
}
.doc-item-form{
input{