Commit 4f0b56ab by Nattana Chaiyamat

backupโค้ดเปลี่ยนเครื่อง

parent fddf6930
......@@ -29,6 +29,17 @@
"@ngx-translate/http-loader": "^6.0.0",
"@swimlane/ngx-charts": "^16.0.0",
"@swimlane/ngx-datatable": "^17.0.0",
"@syncfusion/ej2-angular-base": "^29.2.4",
"@syncfusion/ej2-angular-dropdowns": "^29.2.4",
"@syncfusion/ej2-angular-grids": "^29.2.4",
"@syncfusion/ej2-angular-inputs": "^29.2.4",
"@syncfusion/ej2-angular-pivotview": "^29.2.4",
"@syncfusion/ej2-base": "^29.2.4",
"@syncfusion/ej2-buttons": "^29.2.4",
"@syncfusion/ej2-data": "^29.2.4",
"@syncfusion/ej2-dropdowns": "^29.2.4",
"@syncfusion/ej2-grids": "^29.2.4",
"@syncfusion/ej2-inputs": "^29.2.4",
"@types/quill": "1.3.6",
"angular-calendar": "^0.28.16",
"angular-datatables": "^11.1.1",
......@@ -82,6 +93,7 @@
"@types/c3": "^0.6.4",
"@types/chartist": "^0.9.47",
"@types/datatables.net": "^1.10.18",
"@types/file-saver": "^2.0.7",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.8",
"@types/node": "^14.0.13",
......
......@@ -98,7 +98,12 @@ import { ApprovedListComponent } from './approved-list/approved-list.component';
import { OpenImageComponent } from './open-image/open-image.component';
import { ListWidgetsComponent } from './list-widgets/list-widgets.component';
import { ViewListWidgetsComponent } from './view-list-widgets/view-list-widgets.component';
import { GridModule } from '@syncfusion/ej2-angular-grids';
import { PivotViewModule } from '@syncfusion/ej2-angular-pivotview';
import { ExcelReportComponent } from './excel-report/excel-report.component';
import { ExcelListComponent } from './excel-list/excel-list.component';
import { ExcelReportToggleComponent } from './excel-report-toggle/excel-report-toggle.component';
import { ExcelReportEmpviewComponent } from './excel-report-empview/excel-report-empview.component';
@NgModule({
imports: [
......@@ -119,7 +124,9 @@ import { ViewListWidgetsComponent } from './view-list-widgets/view-list-widgets.
DragDropModule,
FlatpickrModule.forRoot(),
HttpClientModule,
FeatherModule
FeatherModule,
GridModule,
PivotViewModule
],
declarations: [
ChatComponent,
......@@ -173,7 +180,11 @@ import { ViewListWidgetsComponent } from './view-list-widgets/view-list-widgets.
ApprovedListComponent,
OpenImageComponent,
ListWidgetsComponent,
ViewListWidgetsComponent
ViewListWidgetsComponent,
ExcelReportComponent,
ExcelListComponent,
ExcelReportToggleComponent,
ExcelReportEmpviewComponent
],
providers: [
ContactService,
......
......@@ -49,6 +49,10 @@ import { ViewListDocComponent } from "./view-list-doc/view-list-doc.component";
import { ApprovedListComponent } from "./approved-list/approved-list.component";
import { ListWidgetsComponent } from "./list-widgets/list-widgets.component";
import { ViewListWidgetsComponent } from "./view-list-widgets/view-list-widgets.component";
import { ExcelReportComponent } from "./excel-report/excel-report.component";
import { ExcelListComponent } from "./excel-list/excel-list.component";
import { ExcelReportEmpviewComponent } from "./excel-report-empview/excel-report-empview.component";
import { ExcelReportToggleComponent } from "./excel-report-toggle/excel-report-toggle.component";
export const AppsRoutes: Routes = [
{
path: "",
......@@ -206,7 +210,7 @@ export const AppsRoutes: Routes = [
data: {
title: "อนุมัติ Excel",
urls: [
{ title: "รายการเอกสารรอการอนุมัติ" ,url: "apps/portal-category-list-approve"},
{ title: "รายการเอกสารรอการอนุมัติ", url: "apps/portal-category-list-approve" },
{ title: "อนุมัติ Excel" },
],
},
......@@ -217,7 +221,7 @@ export const AppsRoutes: Routes = [
data: {
title: "อนุมัติเอกสาร",
urls: [
{ title: "รายการเอกสารรอการอนุมัติ" ,url: "apps/portal-category-list-approve"},
{ title: "รายการเอกสารรอการอนุมัติ", url: "apps/portal-category-list-approve" },
{ title: "อนุมัติเอกสาร" },
],
},
......@@ -228,7 +232,7 @@ export const AppsRoutes: Routes = [
data: {
title: "อนุมัติหลักสูตร",
urls: [
{ title: "รายการเอกสารรอการอนุมัติ" ,url: "apps/portal-category-list-approve"},
{ title: "รายการเอกสารรอการอนุมัติ", url: "apps/portal-category-list-approve" },
{ title: "อนุมัติหลักสูตร" },
],
},
......@@ -239,7 +243,7 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการเอกสารผ่านการอนุมัติ",
urls: [
{ title: "รายการเอกสารผ่านการอนุมัติ" ,url: "apps/portal-category-list-approve"},
{ title: "รายการเอกสารผ่านการอนุมัติ", url: "apps/portal-category-list-approve" },
{ title: "อนุมัติหลักสูตร" },
],
},
......@@ -270,8 +274,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการ Excel",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการ Excel"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการ Excel" }
],
},
},
......@@ -281,8 +285,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการ Excel",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการ Excel"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการ Excel" }
],
},
},
......@@ -292,8 +296,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการเอกสาร",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการเอกสาร"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการเอกสาร" }
],
},
},
......@@ -303,8 +307,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการเอกสาร",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการเอกสาร"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการเอกสาร" }
],
},
},
......@@ -314,8 +318,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการหลักสูตร",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการหลักสูตร"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการหลักสูตร" }
],
},
},
......@@ -325,8 +329,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการหลักสูตร",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการหลักสูตร"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการหลักสูตร" }
],
},
},
......@@ -336,8 +340,8 @@ export const AppsRoutes: Routes = [
data: {
title: "รายการวิทเจ็ท",
urls: [
{ title: "รายการเอกสาร" ,url: "apps/portal-category-list"},
{title:"รายการวิทเจ็ท"}
{ title: "รายการเอกสาร", url: "apps/portal-category-list" },
{ title: "รายการวิทเจ็ท" }
],
},
},
......@@ -519,6 +523,38 @@ export const AppsRoutes: Routes = [
urls: [],
},
},
{
path: "excel-export/:id",
component: ExcelReportComponent,
data: {
title: "รายงาน Excel",
urls: [],
},
},
{
path: "excel-list",
component: ExcelListComponent,
data: {
title: "เพิ่มรายงาน Excel",
urls: [],
},
},
{
path: "excel-report-toggle",
component: ExcelReportToggleComponent,
data: {
title: "เปิด-ปิด การใช้งานรายงาน Excel",
urls: [],
},
},
{
path: "excel-report-empview",
component: ExcelReportEmpviewComponent,
data: {
title: "รายงาน Excel สำหรับ Empview",
urls: [],
},
},
],
},
];
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbDate, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import * as FileSaver from 'file-saver';
import { IDataOptions } from '@syncfusion/ej2-angular-pivotview';
import { ExcelReportService } from 'src/app/service/excel-report.service';
import { MyTemplateModel, TemplateModel } from 'src/app/model/template.model';
import { AlertModalComponent } from '../alert-modal/alert-modal.component';
import { MyModuleModel, ModuleModel } from 'src/app/model/module.model';
import { ConfirmModalComponent } from '../confirm-modal/confirm-modal.component';
export interface ModalDetail {
text: { cardHead: string, search: string[], tableHead: string[] }
}
@Component({
selector: 'app-excel-list',
templateUrl: './excel-list.component.html',
styleUrls: ['./excel-list.component.scss']
})
export class ExcelListComponent implements OnInit {
template: { data: TemplateModel[], filter: TemplateModel[], loading: boolean } = { data: [], filter: [], loading: false }
module: { data: ModuleModel[], loading: boolean } = { data: [], loading: false }
page = 1
pageSize = 10
searchBy = ''
condition = ''
searchValue = ''
openTemplate: Map<string, boolean> = new Map<string, boolean>()
bodyTemplate: {
status: 'add' | 'edit',
data: {
templateId: string,
tname: string,
ename: string,
tdesc: string,
edesc: string,
module: string
}
} = {
status: 'add',
data: {
templateId: '',
tname: '',
ename: '',
tdesc: '',
edesc: '',
module: ''
}
}
constructor(private excelReportService: ExcelReportService,
private modalService: NgbModal,
private cdr: ChangeDetectorRef) {
}
ngOnInit(): void {
this.getExcelList()
this.getModuleList()
}
getExcelList() {
this.template.loading = true
this.excelReportService.getExcelList().subscribe(response => {
this.template.data = response.map(e => new MyTemplateModel(e))
this.template.filter = response.map(e => new MyTemplateModel(e))
this.template.loading = false
}, error => {
this.template.loading = false
})
}
getModuleList() {
this.module.loading = true
this.excelReportService.getModuleList().subscribe(response => {
this.module.data = response.map(e => new MyModuleModel(e))
this.module.loading = false
}, error => {
this.module.loading = false
})
}
postTemplate() {
}
openAlertModal(message?: string) {
const modalRef = this.modalService.open(AlertModalComponent, {
centered: true,
backdrop: 'static'
})
modalRef.componentInstance.message = message ? message : ""
modalRef.result.then(result => {
}, reason => {
})
}
openAddGroupModal(targetModal: NgbModal, data?: TemplateModel) {
if (data) {
this.bodyTemplate.status = 'edit'
this.bodyTemplate.data = {
templateId: data.templateId,
tname: data.tname,
ename: data.ename,
tdesc: data.tdesc,
edesc: data.edesc,
module: data.module
}
} else {
this.bodyTemplate.status = 'add'
this.bodyTemplate.data = {
templateId: '',
tname: '',
ename: '',
tdesc: '',
edesc: '',
module: ''
}
}
const modalRef = this.modalService.open(targetModal, {
centered: true,
backdrop: 'static',
size: 'lg'
})
modalRef.result.then(result => {
const modalConfirmRef = this.modalService.open(ConfirmModalComponent, {
centered: true,
backdrop: 'static',
})
modalConfirmRef.componentInstance.message = 'คุณต้องการบันทึกข้อมูลหรือไม่'
modalConfirmRef.result.then(result => {
console.log(" 🐒 this.bodyTemplate:", this.bodyTemplate)
this.excelReportService.postTemplate(this.bodyTemplate.data).subscribe((response: any) => {
this.openAlertModal(response.message)
if (response.success) {
this.getExcelList()
this.getModuleList()
}
}, error => { this.openAlertModal(error.message) })
}, reject => { })
}, reject => { })
}
openAddChildModal(targetModal: NgbModal) {
const modalRef = this.modalService.open(targetModal, {
centered: true,
backdrop: 'static',
size: 'lg'
})
modalRef.result.then(result => {
const modalConfirmRef = this.modalService.open(ConfirmModalComponent, {
centered: true,
backdrop: 'static',
})
modalConfirmRef.componentInstance.message = 'คุณต้องการบันทึกข้อมูลหรือไม่'
modalConfirmRef.result.then(result => {
console.log(" 🐒 this.bodyTemplate:", this.bodyTemplate)
}, reject => { })
}, reject => { })
}
templateListSearch() {
if (!this.searchBy || !this.condition || !this.searchValue) {
this.template.filter = this.template.data.map(e => new MyTemplateModel(e))
}
const conditionMap: { [key: string]: (a: any, b: any) => boolean } = {
includes: (a, b) => (a || '').toString().toLowerCase().includes((b || '').toString().toLowerCase()),
lt: (a, b) => parseFloat(a) < parseFloat(b),
gt: (a, b) => parseFloat(a) > parseFloat(b),
eq: (a, b) => a == b,
lte: (a, b) => parseFloat(a) <= parseFloat(b),
gte: (a, b) => parseFloat(a) >= parseFloat(b),
neq: (a, b) => a != b,
};
const compareFn = conditionMap[this.condition];
if (!compareFn) {
this.template.filter = this.template.data.map(e => new MyTemplateModel(e))
}
this.template.filter = this.template.data.filter(item => {
const value = (item as any)[this.searchBy];
return compareFn(value, this.searchValue);
}).map(e => new MyTemplateModel(e));
}
}
\ No newline at end of file
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbDate, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ExcelReportService } from 'src/app/service/excel-report.service';
import * as FileSaver from 'file-saver';
import { IDataOptions } from '@syncfusion/ej2-angular-pivotview';
export interface ModalDetail {
text: { cardHead: string, search: string[], tableHead: string[] }
}
@Component({
selector: 'app-excel-report-empview',
templateUrl: './excel-report-empview.component.html',
styleUrls: ['./excel-report-empview.component.scss']
})
export class ExcelReportEmpviewComponent implements OnInit {
ngOnInit(): void {
}
}
\ No newline at end of file
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbDate, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ExcelReportService } from 'src/app/service/excel-report.service';
import * as FileSaver from 'file-saver';
import { IDataOptions } from '@syncfusion/ej2-angular-pivotview';
export interface ModalDetail {
text: { cardHead: string, search: string[], tableHead: string[] }
}
@Component({
selector: 'app-excel-report-toggle',
templateUrl: './excel-report-toggle.component.html',
styleUrls: ['./excel-report-toggle.component.scss']
})
export class ExcelReportToggleComponent implements OnInit {
ngOnInit(): void {
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
export interface ModuleModel {
code: string
tdesc: string
edesc: string
}
export class MyModuleModel implements ModuleModel {
code: string
tdesc: string
edesc: string
constructor(data: Partial<any>) {
this.code = data?.code || ''
this.tdesc = data?.tdesc || ''
this.edesc = data?.edesc || ''
}
}
\ No newline at end of file
export interface PrefixModel {
edesc: string
prefixId: string
tdesc: string
}
export class MyPrefixModel implements PrefixModel {
edesc: string
prefixId: string
tdesc: string
constructor(data?: Partial<PrefixModel>) {
this.edesc = data?.edesc || ''
this.prefixId = data?.prefixId || ''
this.tdesc = data?.tdesc || ''
}
}
export interface CreateByModel {
efname: string
elname: string
email: string
employeeId: string
engFullName: string
fname: string
lname: string
picture: string
prefix: PrefixModel
sex: string
thFullName: string
}
export class MyCreateByModel implements CreateByModel {
efname: string
elname: string
email: string
employeeId: string
engFullName: string
fname: string
lname: string
picture: string
prefix: PrefixModel
sex: string
thFullName: string
constructor(data?: Partial<CreateByModel>) {
this.efname = data?.efname || ''
this.elname = data?.elname || ''
this.email = data?.email || ''
this.employeeId = data?.employeeId || ''
this.engFullName = data?.engFullName || ''
this.fname = data?.fname || ''
this.lname = data?.lname || ''
this.picture = data?.picture || ''
this.prefix = new MyPrefixModel(data?.prefix)
this.sex = data?.sex || ''
this.thFullName = data?.thFullName || ''
}
}
export interface TemplateFileModel {
templateId: string
portalId: string
itemId: string
fileName: string
realFileName: string
realFileNameOld: string
tdesc: string
edesc: string
menuActive: string
uponMenu: string
module: string
page: string
isShare: string
isPivot: string
createDate: string
createTime: string
param: any | null
createBy: CreateByModel
}
export class MyTemplateFileModel implements TemplateFileModel {
templateId: string
portalId: string
itemId: string
fileName: string
realFileName: string
realFileNameOld: string
tdesc: string
edesc: string
menuActive: string
uponMenu: string
module: string
page: string
isShare: string
isPivot: string
createDate: string
createTime: string
param: any | null
createBy: CreateByModel
constructor(data?: Partial<TemplateFileModel>) {
this.templateId = data?.templateId || ''
this.portalId = data?.portalId || ''
this.itemId = data?.itemId || ''
this.fileName = data?.fileName || ''
this.realFileName = data?.realFileName || ''
this.realFileNameOld = data?.realFileNameOld || ''
this.tdesc = data?.tdesc || ''
this.edesc = data?.edesc || ''
this.menuActive = data?.menuActive || ''
this.uponMenu = data?.uponMenu || ''
this.module = data?.module || ''
this.page = data?.page || ''
this.isShare = data?.isShare || ''
this.isPivot = data?.isPivot || ''
this.createDate = data?.createDate || ''
this.createTime = data?.createTime || ''
this.param = data?.param || null
this.createBy = new MyCreateByModel(data?.createBy)
}
}
export interface TemplateModel {
templateId: string
tname: string
ename: string
tdesc: string
edesc: string
module: string
templateFile: TemplateFileModel[]
}
export class MyTemplateModel implements TemplateModel {
templateId: string
tname: string
ename: string
tdesc: string
edesc: string
module: string
templateFile: TemplateFileModel[]
constructor(data?: Partial<TemplateModel>) {
this.templateId = data?.templateId || ''
this.tname = data?.tname || ''
this.ename = data?.ename || ''
this.tdesc = data?.tdesc || ''
this.edesc = data?.edesc || ''
this.module = data?.module || ''
this.templateFile = data?.templateFile?.map(x => new MyTemplateFileModel(x)) || []
}
}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { TemplateModel } from '../model/template.model';
import { ModuleModel } from '../model/module.model';
@Injectable({
providedIn: 'root'
})
export class ExcelReportService {
constructor(private http: HttpClient,
private translateService: TranslateService
) { }
getExcelReport(itemId: string): Observable<any> {
return this.http.get(environment.url + "/irapi/menuitem/" + itemId + '?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47')
}
dowloadExcelReport(fileName: string, varname: string, data: string): Observable<any> {
return this.http.get(environment.url + "/irapi/excel/export-to-excel?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47&fileName=" + fileName + "&param=__varname=" + varname + "|__screen=XLSOPTION|" + data, { responseType: 'blob' })
}
getExcelList(): Observable<TemplateModel[]> {
return this.http.get<TemplateModel[]>("https://hrplus-std.myhr.co.th/plus/template/lists?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47")
}
getModuleList(): Observable<ModuleModel[]> {
return this.http.get<ModuleModel[]>("https://hrplus-std.myhr.co.th/plus/template/lists/module?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47")
}
postTemplate(body: {
templateId: string,
tname: string,
ename: string,
tdesc: string,
edesc: string,
module: string
}) {
return this.http.post("https://hrplus-std.myhr.co.th/plus/template?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
}
}
......@@ -6,7 +6,8 @@ import { environment } from 'src/environments/environment';
@Injectable()
export class HttpRequestInterceptor {
token= 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBdXRoIiwidWlkIjoiOGFhNDUzMzAtMzE0Yy0xMWU3LWJhZjMtMmQ3ZDA5ODc3NzQ0Iiwicm9sZSI6InVzZXIiLCJpc3MiOiJDb21wdXRlciBTY2llbmNlIENvcnBvcmF0aW9uIExpbWl0ZWQiLCJmdWxsTmFtZSI6InRlZXJhZGFjaCBrdWhhdGFuYXNhdGllbiIsIm1lbWJlcklkIjoiOGFhNDUzMzAtMzE0Yy0xMWU3LWJhZjMtMmQ3ZDA5ODc3NzQ0In0.FO7u8g7KfzkmZFTuuniBCEQxduPjcvzMbH7iug3DT90'
// token= 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBdXRoIiwidWlkIjoiOGFhNDUzMzAtMzE0Yy0xMWU3LWJhZjMtMmQ3ZDA5ODc3NzQ0Iiwicm9sZSI6InVzZXIiLCJpc3MiOiJDb21wdXRlciBTY2llbmNlIENvcnBvcmF0aW9uIExpbWl0ZWQiLCJmdWxsTmFtZSI6InRlZXJhZGFjaCBrdWhhdGFuYXNhdGllbiIsIm1lbWJlcklkIjoiOGFhNDUzMzAtMzE0Yy0xMWU3LWJhZjMtMmQ3ZDA5ODc3NzQ0In0.FO7u8g7KfzkmZFTuuniBCEQxduPjcvzMbH7iug3DT90'
token= 'eyJhbGciOiJIUzI1NiJ9.eyJzY2hlbWEiOiJkYm8iLCJlbmNvZGUiOiIyIiwic3ViIjoiQXV0aCIsImNvbXBhbnlOYW1lIjoi4Lia4Lij4Li04Lip4Lix4LiXIOC4oeC4suC4ouC5gOC4reC4iuC4reC4suC4o-C5jCDguIjguLPguIHguLHguJQiLCJkYk5hbWUiOiJNWUhSUExVUyIsInJvbGVzIjpbIlVTRVIiXSwid29ya2FyZWEiOiJUS1ciLCJpc3MiOiJDb21wdXRlciBTY2llbmNlIENvcnBvcmF0aW9uIExpbWl0ZWQiLCJ6bWxvZ2luIjoiZmFsc2UiLCJyb2xlX2xldmVsIjoiNiIsImVtcGxveWVlaWQiOiIxMDAwMDA4MiIsImJyYW5jaCI6Im15aHIiLCJlbXBfcG9zaXRpb24iOiIwOTciLCJ1c2VyX3JvbGUiOiJBbGwiLCJ1aWQiOiIxMDAwMDA4MiIsImNvbXBhbnlpZCI6IjEwMCIsImFjdG9yaWQiOiIxMDAwMDA4MiIsImFjY291bnRhY3RpdmUiOiJ0cnVlIiwibGFuZyI6InRoIiwiYWQiOiJmYWxzZSIsImZpcnN0bG9naW4iOiJmYWxzZSIsInVybF9teWhyIjoiaHR0cDovL2hycGx1cy1zdGQubXloci5jby50aC9ociIsImFwcF9uYW1lIjoibXlociIsInJlZ2lvbmFsbHR5IjoiRU5HIiwidG9rZW5femVlbWUiOiIiLCJ1c2VyX2xldmVsIjoiTVlIUiIsImZ1bGxuYW1lIjoi4LiZ4Liy4Lii4Lit4Lie4Li04Lij4Lix4LiV4LiZ4LmMICDguJfguJTguKrguK3guJoiLCJjb21pZCI6IiIsImpvYiI6IjA5Ny0yNDY5IiwidXNlciI6Im15aHIiLCJ6bV91c2VyIjoiIiwidXNlcm5hbWUiOiJteWhyIiwibWVtYmVyaWQiOiIifQ.z106M3tnpWYWmD7tzAf7hPv2CDSyw50FoUrfDqqHFjw'
constructor() { }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
......
import { RouteInfo } from "./vertical-sidebar.metadata";
export const ROUTES: RouteInfo[] = [
{
path: '/apps/portal-category-list',
title: 'รายการเอกสาร',
......@@ -51,39 +50,79 @@ export const ROUTES: RouteInfo[] = [
label: "",
labelClass: "badge badge-info sidebar-badge",
submenu: [
{
path: '/apps/portal-category-list-approve',
title: 'รายการรอการอนุมัติ',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
{
path: '/apps/portal-category-list-approve',
title: 'รายการรอการอนุมัติ',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
},
{
path: '/apps/approved-list',
title: 'รายการผ่านการอนุมัติ',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
},
// {
// path: '/apps/portal-category-list',
// title: 'รายการเอกสาร',
// icon: '',
// class: '',
// label: "",
// labelClass: "",
// extralink: false,
// submenu: []
// },
]
},
{
path: '/apps/approved-list',
title: 'รายการผ่านการอนุมัติ',
icon: '',
class: '',
label: "",
labelClass: "",
path: "",
title: "ตั้งค่ารายงานเอ็กเซล",
icon: "mdi mdi-adjust",
class: "has-arrow",
extralink: false,
submenu: []
},
// {
// path: '/apps/portal-category-list',
// title: 'รายการเอกสาร',
// icon: '',
// class: '',
// label: "",
// labelClass: "",
// extralink: false,
// submenu: []
// },
label: "",
labelClass: "badge badge-info sidebar-badge",
submenu: [
{
path: '/apps/excel-list',
title: 'เพิ่มรายงาน Excel',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
},
{
path: '/apps/excel-report-toggle',
title: 'เปิด-ปิด การใช้งานรายงาน Excel',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
},
{
path: '/apps/excel-report-empview',
title: 'รายงาน Excel สำหรับ Empview',
icon: '',
class: '',
label: "",
labelClass: "",
extralink: false,
submenu: []
},
]
},
//
// {
......
......@@ -17,17 +17,46 @@ export class VerticalSidebarComponent {
path = '';
constructor(private menuServise: VerticalSidebarService, private router: Router) {
if (this.menuServise.submenu.length > 0) {
const currentValue = this.menuServise.items.value;
const updated = [...currentValue, {
path: '',
title: 'รายงาน Excel',
icon: 'mdi mdi-adjust',
class: 'has-arrow',
label: "",
labelClass: "",
extralink: false,
submenu: []
}];
this.menuServise.items.next(updated);
}
this.menuServise.items.subscribe(menuItems => {
this.sidebarnavItems = menuItems;
// Active menu
this.sidebarnavItems.filter(m => m.submenu.filter(
(s) => {
if (s.path === this.router.url) {
this.path = m.title;
}
this.sidebarnavItems = menuItems.map(e => {
if (e.title == 'รายงาน Excel') {
this.menuServise.submenu.map(e2 => {
e.submenu.push({
path: '/apps/excel-export/' + e2.itemId,
title: e2.tdesc,
icon: "",
class: "",
label: "",
labelClass: "",
extralink: false,
submenu: []
})
})
}
));
return e
})
this.sidebarnavItems.filter(m =>
m.submenu.filter(
(s) => {
if (s.path === this.router.url) {
this.path = m.title;
}
}
));
this.addExpandClass(this.path);
});
}
......
......@@ -17,6 +17,24 @@ export class VerticalSidebarService {
items = new BehaviorSubject<RouteInfo[]>(this.MENUITEMS);
submenu = [
{
"itemId": "3459",
"templateId": "3011",
"fileName": "BFET6T4QJ.xlsx",
"tdesc": "FOR TEST OPTION ESS",
"edesc": "FOR TEST OPTION ESS",
"module": "EMPVIEW"
},
{
"itemId": "3462",
"templateId": "3011",
"fileName": "F5QTI20MBJ.xls",
"tdesc": "REPORT WORKING HOURS_BU3",
"edesc": "REPORT WORKING HOURS_BU3",
"module": "EMPVIEW"
}
]
constructor() {
}
}
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { registerLicense } from '@syncfusion/ej2-base';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
registerLicense('ORg4AjUWIQA/Gnt2XFhhQlJHfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTH5WdUVjWXtXdHNdRWFbWkdx');
if (environment.production) {
enableProdMode();
}
......
......@@ -3,6 +3,17 @@
@import url('https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800');
@import url("https://fonts.googleapis.com/css?family=Kanit:300,400,600,700,800");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css");
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-calendars/styles/material.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-angular-grids/styles/material.css';
body {
font-family: "Kanit", sans-serif !important;
}
......
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