Commit 5e69bb3f by Natthaphat

เพิ่ม modal gridModal, pivotModal ## npm i --force เพิ่มด้วย

parent ce6154cd
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"@syncfusion/ej2-angular-grids": "^29.2.4", "@syncfusion/ej2-angular-grids": "^29.2.4",
"@syncfusion/ej2-angular-inputs": "^29.2.4", "@syncfusion/ej2-angular-inputs": "^29.2.4",
"@syncfusion/ej2-angular-pivotview": "^29.2.4", "@syncfusion/ej2-angular-pivotview": "^29.2.4",
"@syncfusion/ej2-grids": "^30.1.39", "@syncfusion/ej2-grids": "^29.2.11",
"@tailwindcss/forms": "^0.5.7", "@tailwindcss/forms": "^0.5.7",
"@types/google.maps": "^3.58.1", "@types/google.maps": "^3.58.1",
"@types/googlemaps": "^3.43.3", "@types/googlemaps": "^3.43.3",
......
...@@ -842,14 +842,12 @@ ...@@ -842,14 +842,12 @@
*ngIf="variableSheet.length&&(excelReport.isDataGrid=='1'||excelReport.isPivot=='1')"> *ngIf="variableSheet.length&&(excelReport.isDataGrid=='1'||excelReport.isPivot=='1')">
<div class="col-12 d-flex justify-content-center align-content-center"> <div class="col-12 d-flex justify-content-center align-content-center">
<button type="button" *ngIf="excelReport.isDataGrid=='1'" <button type="button" *ngIf="excelReport.isDataGrid=='1'"
class="ti-btn ti-btn-primary-full" class="ti-btn ti-btn-primary-full" (click)="getExcelData('grid')">Datagrid</button>
(click)="getExcelData(gridModal,'grid')">Datagrid</button>
<ng-container *ngIf="excelReport.isDataGrid=='1'&&excelReport.isPivot=='1'"> <ng-container *ngIf="excelReport.isDataGrid=='1'&&excelReport.isPivot=='1'">
&nbsp; &nbsp;
</ng-container> </ng-container>
<button type="button" *ngIf="excelReport.isPivot=='1'" <button type="button" *ngIf="excelReport.isPivot=='1'"
class="ti-btn ti-btn-primary-full" class="ti-btn ti-btn-primary-full" (click)="getExcelData('pivot')">Pivot</button>
(click)="getExcelData(pivotModal,'pivot')">Pivot</button>
</div> </div>
</div> </div>
</ng-container> </ng-container>
...@@ -998,6 +996,47 @@ ...@@ -998,6 +996,47 @@
</ng-template> </ng-template>
<ng-template #gridModal let-modal> <ng-template #gridModal let-modal>
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out">
<div class="ti-modal-content">
<div class="ti-modal-header flex justify-between items-center p-5">
<h6 class="ti-modal-title text-[1rem] font-semibold text-defaulttextcolor" id="mail-ComposeLabel">
GridData
</h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
(click)="closeModalgridModal()" #closeModal>
<span class="sr-only">{{'Close' | translate}}</span>
<i class="ri-close-line"></i>
</button>
</div>
<div class="ti-modal-body px-4 mt-3">
<app-datagrid-syncfution [searchSettings]="searchSettings" [dataSource]="dataList" [columns]="columns"
[gridLayout]="setPerspective" [sendLayout]="gridLayout.stimulate" (layout)="gridLayout.data=$event">
</app-datagrid-syncfution>
</div>
<div class="border-t">
<div class="ti-modal-footer flex justify-end gap-3 mb-3 mt-3 mr-3">
<button *ngIf="!loadingExcel" type="button" class="ti-btn ti-btn-info-full"
(click)="gridLayout.stimulate=!gridLayout.stimulate;savePerspective('grid')">
{{"Save Perspective"}}
</button>
<div *ngIf="loadingExcel" class="row" style="width: 120px;">
<div *ngFor="let item of [1,2,3]" class="spinner-grow text-info mx-1" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<button type="button" class="ti-btn ti-btn-danger-full text-white !font-medium"
(click)="closeModalgridModal()">
ปิด
</button>
</div>
</div>
</div>
</div>
</ng-template>
<!-- <ng-template #gridModals let-modal>
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="edittemplateLabel">GridData</h5> <h5 class="modal-title" id="edittemplateLabel">GridData</h5>
<button type="button" class="close" (click)="modal.dismiss()" aria-label="Close"> <button type="button" class="close" (click)="modal.dismiss()" aria-label="Close">
...@@ -1023,8 +1062,53 @@ ...@@ -1023,8 +1062,53 @@
{{"ปิด"}} {{"ปิด"}}
</button> </button>
</div> </div>
</ng-template> </ng-template> -->
<ng-template #pivotModal let-modal> <ng-template #pivotModal let-modal>
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out">
<div class="ti-modal-content">
<div class="ti-modal-header flex justify-between items-center p-5">
<h6 class="ti-modal-title text-[1rem] font-semibold text-defaulttextcolor" id="mail-ComposeLabel">
Pivot
</h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
(click)="closeModalpivotModal()" #closeModal>
<span class="sr-only">{{'Close' | translate}}</span>
<i class="ri-close-line"></i>
</button>
</div>
<div class="ti-modal-body px-4 mt-3">
<app-pivot-syncfution [dataSource]="dataList" [columns]="pivotColumns"
[templateId]="excelReport.templateId" [fileName]="excelReport.fileName"
[pivotLayout]="setPerspective" [sendLayout]="pivotLayout.stimulate"
(layout)="pivotLayout.data=$event">
</app-pivot-syncfution>
</div>
<div class="border-t">
<div class="ti-modal-footer flex justify-end gap-3 mb-3 mt-3 mr-3">
<button *ngIf="!loadingExcel" type="button" class="btn btn-info"
(click)="pivotLayout.stimulate=!pivotLayout.stimulate;savePerspective('pivot')">
{{"Save Perspective"}}
</button>
<div *ngIf="loadingExcel" class="row" style="width: 120px;">
<div *ngFor="let item of [1,2,3]" class="spinner-grow text-info mx-1" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<button type="button" class="ti-btn ti-btn-danger-full text-white !font-medium"
(click)="closeModalpivotModal()">
ปิด
</button>
</div>
</div>
</div>
</div>
</ng-template>
<!-- <ng-template #pivotModals let-modal>
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="edittemplateLabel">Pivot</h5> <h5 class="modal-title" id="edittemplateLabel">Pivot</h5>
<button type="button" class="close" (click)="modal.dismiss()" aria-label="Close"> <button type="button" class="close" (click)="modal.dismiss()" aria-label="Close">
...@@ -1051,4 +1135,4 @@ ...@@ -1051,4 +1135,4 @@
{{"ปิด"}} {{"ปิด"}}
</button> </button>
</div> </div>
</ng-template> </ng-template> -->
\ No newline at end of file \ No newline at end of file
...@@ -150,6 +150,8 @@ export class ExcelListComponent implements OnInit { ...@@ -150,6 +150,8 @@ export class ExcelListComponent implements OnInit {
modalRefvideoModal: any; modalRefvideoModal: any;
modalRefprintModal: any; modalRefprintModal: any;
modalRefmodalData: any; modalRefmodalData: any;
modalRefgridModal: any;
modalRefpivotModal: any;
searchText: string = ''; searchText: string = '';
@ViewChild('addGroupModal') addGroupModal!: TemplateRef<any>; @ViewChild('addGroupModal') addGroupModal!: TemplateRef<any>;
...@@ -158,6 +160,8 @@ export class ExcelListComponent implements OnInit { ...@@ -158,6 +160,8 @@ export class ExcelListComponent implements OnInit {
@ViewChild('videoModal') videoModal!: TemplateRef<any>; @ViewChild('videoModal') videoModal!: TemplateRef<any>;
@ViewChild('printModal') printModal!: TemplateRef<any>; @ViewChild('printModal') printModal!: TemplateRef<any>;
@ViewChild('modalData') modalData!: TemplateRef<any>; @ViewChild('modalData') modalData!: TemplateRef<any>;
@ViewChild('gridModal') gridModal!: TemplateRef<any>;
@ViewChild('pivotModal') pivotModal!: TemplateRef<any>;
constructor(private excelReportService: ExcelReportService, constructor(private excelReportService: ExcelReportService,
private modalService: NgbModal, private modalService: NgbModal,
private customCubeService: CustomCubeService, private customCubeService: CustomCubeService,
...@@ -774,7 +778,7 @@ export class ExcelListComponent implements OnInit { ...@@ -774,7 +778,7 @@ export class ExcelListComponent implements OnInit {
}) })
} }
getExcelData(targetModal: TemplateRef<any>, type: 'grid' | 'pivot') { getExcelData(type: 'grid' | 'pivot') {
this.loadingExcel = true this.loadingExcel = true
this.dataList = [] this.dataList = []
this.setPerspective = '' this.setPerspective = ''
...@@ -797,11 +801,30 @@ export class ExcelListComponent implements OnInit { ...@@ -797,11 +801,30 @@ export class ExcelListComponent implements OnInit {
}).subscribe(response => { }).subscribe(response => {
this.dataList = response.excelData as any this.dataList = response.excelData as any
this.loadingExcel = false this.loadingExcel = false
if (type == 'grid') { if (type === 'grid') {
this.openGridModal(targetModal, (response.excelPerspective as any).dataGridStr) this.modal.open(this.gridModal, {
} else if (type == 'pivot') { width: '1000px',
this.openPivotModal(targetModal, (response.excelPerspective as any).pivotStr) height: '700px',
data: {
gridData: (response.excelPerspective as any).dataGridStr,
dataList: this.dataList
},
disableClose: true,
autoFocus: false
});
} else if (type === 'pivot') {
this.modal.open(this.pivotModal, {
width: '800px',
height: '580px',
data: {
pivotData: (response.excelPerspective as any).pivotStr,
dataList: this.dataList
},
disableClose: true,
autoFocus: false
});
} }
this.cdr.detectChanges() this.cdr.detectChanges()
}, error => { }, error => {
this.loadingExcel = false this.loadingExcel = false
...@@ -890,7 +913,7 @@ export class ExcelListComponent implements OnInit { ...@@ -890,7 +913,7 @@ export class ExcelListComponent implements OnInit {
closeModalvideoModal() { closeModalvideoModal() {
this.modalRefvideoModal?.close() this.modalRefvideoModal?.close()
} }
openModalprintModal() { openModalprintModal() {
this.modalRefprintModal = this.modal.open(this.printModal, { this.modalRefprintModal = this.modal.open(this.printModal, {
width: '700px', width: '700px',
...@@ -913,4 +936,11 @@ export class ExcelListComponent implements OnInit { ...@@ -913,4 +936,11 @@ export class ExcelListComponent implements OnInit {
this.modalRefmodalData?.close() this.modalRefmodalData?.close()
} }
closeModalgridModal() {
this.modalRefgridModal?.close()
}
closeModalpivotModal() {
this.modalRefpivotModal?.close()
}
} }
\ No newline at end of file
...@@ -17,10 +17,10 @@ export class CustomCubeService { ...@@ -17,10 +17,10 @@ export class CustomCubeService {
templateId: string, templateId: string,
fileName: string, fileName: string,
}) { }) {
return this.http.post(environment.baseUrl + "customcube/get-excel-column?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body) return this.http.post(environment.url + "customcube/get-excel-column?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
} }
getExcelData(body: any) { getExcelData(body: any) {
return this.http.post(environment.baseUrl + "customcube/get-excel-data?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body) return this.http.post(environment.url + "customcube/get-excel-data?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
} }
saveExcelPerspective(body: { saveExcelPerspective(body: {
templateId: string, templateId: string,
...@@ -28,12 +28,12 @@ export class CustomCubeService { ...@@ -28,12 +28,12 @@ export class CustomCubeService {
dataGridStr: string, dataGridStr: string,
pivotStr: string, pivotStr: string,
}): Observable<AlertModel> { }): Observable<AlertModel> {
return this.http.post<AlertModel>(environment.baseUrl + "customcube/save-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body) return this.http.post<AlertModel>(environment.url + "customcube/save-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
} }
getExcelPerspective(body: { getExcelPerspective(body: {
templateId: string, templateId: string,
fileName: string, fileName: string,
}) { }) {
return this.http.post(environment.baseUrl + "customcube/get-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body) return this.http.post(environment.url + "customcube/get-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
} }
} }
\ No newline at end of file
...@@ -122,7 +122,7 @@ export class LoginComponent { ...@@ -122,7 +122,7 @@ export class LoginComponent {
console.log(result) console.log(result)
this.tokenService.saveToken(result.accessToken); this.tokenService.saveToken(result.accessToken);
this.tokenService.saveUser(result); this.tokenService.saveUser(result);
this.routes.navigate(['/admin/member-manage']) this.routes.navigate(['/admin/pdpa-manage'])
}, (error) => { }, (error) => {
this.showLoader = false; this.showLoader = false;
this.error = 'Username หรือ Password ไม่ถูกต้อง'; this.error = 'Username หรือ Password ไม่ถูกต้อง';
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
import { bootstrapApplication } from '@angular/platform-browser'; import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config'; import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component'; import { AppComponent } from './app/app.component';
import { registerLicense } from '@syncfusion/ej2-base';
registerLicense('ORg4AjUWIQA/Gnt2XFhhQlJHfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTH5WdUVjWXtXdHNdRWFbWkdx');
bootstrapApplication(AppComponent, appConfig) bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err)); .catch((err) => console.error(err));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment