Commit 84c08d57 by Nattana Chaiyamat

ตั้งค่าผู้ใช้งาน

parent 8cbf148f
......@@ -10,27 +10,30 @@
<nav class="-mb-0.5 flex space-x-6 rtl:space-x-reverse">
<a class="text-base font-medium hs-tab-active:text-lg hs-tab-active:font-bold hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1" (click)="pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','สร้างชื่อผู้ใช้งาน']">
aria-controls="underline-1"
(click)="currentPage =1 ;pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','สร้างชื่อผู้ใช้งาน']">
สร้างชื่อผู้ใช้งาน
</a>
<a class="text-base font-medium hs-tab-active:text-lg hs-tab-active:font-bold hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 px-1 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary"
href="javascript:void(0);" id="underline-item-2" data-hs-tab="#underline-2"
aria-controls="underline-2" (click)="pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','กำหนดรหัสผ่าน']">
aria-controls="underline-2"
(click)="currentPage =2 ;pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','กำหนดรหัสผ่าน']">
กำหนดรหัสผ่าน
</a>
<a class="text-base font-medium hs-tab-active:text-lg hs-tab-active:font-bold hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 px-1 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary"
href="javascript:void(0);" id="underline-item-3" data-hs-tab="#underline-3"
aria-controls="underline-3" (click)="pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','จัดการผู้ใช้งาน']">
aria-controls="underline-3"
(click)="currentPage =3 ;pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน','จัดการผู้ใช้งาน']">
จัดการผู้ใช้งาน
</a>
</nav>
</div>
<div class="mt-3 px-3rem !-mt-3 pt-50px">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-user-settings [pathTitle]="pathTitle"
(sendPathTitle)="pathTitle=$event"></app-user-settings>
<div *ngIf="currentPage==1" id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-user-settings></app-user-settings>
</div>
<div id="underline-2" class="hidden" role="tabpanel" aria-labelledby="underline-item-2">
<div *ngIf="currentPage==2" id="underline-2" class="hidden" role="tabpanel"
aria-labelledby="underline-item-2">
<app-set-a-password [pathTitle]="pathTitle" (sendPathTitle)="pathTitle=$event"></app-set-a-password>
</div>
</div>
......
......@@ -6,5 +6,6 @@ import { Component } from '@angular/core';
styleUrls: ['./account-settings.component.scss']
})
export class AccountSettingsComponent {
pathTitle = ['การจัดการข้อมูลองค์กร','ตั้งค่าผู้ใช้งาน', 'สร้างชื่อผู้ใช้งาน']
pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน', 'สร้างชื่อผู้ใช้งาน']
currentPage = 1
}
......@@ -3,7 +3,8 @@
<div class="flex pr-2">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#company-registration-page-upload-modal">
data-hs-overlay="#user-setting-upload-modal"
(click)="fileInput.value = '';selectedFile=null;selectedFileName = 'กรุณาเลือกไฟล์'">
<i class="ri-add-line"></i>
นำเข้าข้อมูล
</button>
......@@ -13,59 +14,60 @@
</a>
</div>
</div>
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" style="height: 40px;">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#user-settings-component-modal-add">
<i class="ri-add-line"></i>
Add
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
data-hs-overlay="#user-settings-component-alert-delete-modal">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
</div>
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
style="height: 40px;">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#user-setting-modal" (click)="currentModal=='add';selectUser()">
<i class="ri-add-line"></i>
Add
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
data-hs-overlay="#user-settings-component-alert-delete-modal">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
</div>
<div class="page px-rem">
<div class="page px-rem">
<div class="overflow-auto shadow-md rounded-t-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered">
<thead>
<tr>
<ng-container
*ngFor="let item of ['ชื่อล็อคอิน','รหัสพนักงาน','ชื่อ','นามสกุล','สถานะ','การจัดการ']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of[
<thead>
<tr>
<ng-container
*ngFor="let item of ['ชื่อล็อคอิน','รหัสพนักงาน','ชื่อ','นามสกุล','สถานะ','การจัดการ']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of[
['CC001', '620010','จรุณ','เทพมาศ','ใช้งาน'],
['CC002', '592530','มานะ','มิณนา','ใช้งาน'],
['CC003', '5812142','ชาญชัย','โพธิ์สุข','ใช้งาน'],
......@@ -73,29 +75,31 @@
['FC002', '5211475','ธนศักดิ์','ตาศรี','ใช้งาน'],
['KC001', '525258','สุทธิดา','สินประเสริฐ','ใช้งาน'],
['KC002', '647589','ศรสุข','ยอดสิงฆ์','ใช้งาน']];let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item[0]}}">
<label for="checkbox-{{item[0]}}">&nbsp;{{item[0]}}</label>
</td>
<td class="text-center">{{item[1]}}</td>
<td>{{item[2]}}</td>
<td>{{item[3]}}</td>
<td class="text-center">{{item[4]}}</td>
<td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" data-hs-overlay="#user-settings-component-modal-edit"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" data-hs-overlay="#user-settings-component-alert-delete-modal"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 py-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item[0]}}">
<label for="checkbox-{{item[0]}}">&nbsp;{{item[0]}}</label>
</td>
<td class="text-center">{{item[1]}}</td>
<td>{{item[2]}}</td>
<td>{{item[3]}}</td>
<td class="text-center">{{item[4]}}</td>
<td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#user-settings-component-modal-edit"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#user-settings-component-alert-delete-modal"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 py-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
......@@ -113,19 +117,94 @@
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
</ul>
</nav>
</div>
</ul>
<ul class="nav-tabs">
<p>Show 1 to 10 of 50 items</p>
</ul>
</div>
</div>
</ul>
<ul class="nav-tabs">
<p>Show 1 to 10 of 50 items</p>
</ul>
</div>
<div id="user-settings-component-modal-add" class="hs-overlay hidden ti-modal">
<div id="user-setting-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
{{currentModal=='add'?'กำหนดค่าผู้ใช้งานระบบ':'แก้ไขข้อมูลผู้ใช้งานระบบ'}}
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#company-registration-page-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="w-full flex justify-end">
<div class="absolute flex">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path d="M15 49A24 24 0 0 1 32 8"></path>
<path d="M49 15a24 24 0 0 1-17 41"></path>
<polyline points="15.03 40 15.03 48.97 8 48.97"></polyline>
<polyline points="48.97 24 48.97 15.03 56 15.03"></polyline>
</g>
</svg>
Clear
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label class="ti-form-label mt-2rem">ชื่อล็อคอิน</label>
<input type="text" class="ti-form-input" [ngClass]="{'bg-input-readonly':currentModal=='edit'}"
[readonly]="currentModal=='edit'" [(ngModel)]="data.select.usernameId" [maxLength]="20">
<label class="ti-form-label mt-2rem">รหัสพนักงาน</label>
<div class="grid grid-cols-2 gap-2">
<input type="text" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="data.select.empId">
<input type="text" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="data.select.employee.thFullName">
</div>
<!-- <label class="ti-form-label mt-2rem">รายละเอียด (อังกฤษ)</label>
<input type="text" class="ti-form-input h-16" [(ngModel)]="data.select.edesc">
<label class="ti-form-label mt-2rem">ที่อยู่ บริษัท</label>
<textarea type="text" rows="2" class="ti-form-input" [(ngModel)]="data.select.address"></textarea>
<label class="ti-form-label mt-2rem">ข้อมูล ติดต่อ</label>
<textarea type="text" rows="2" class="ti-form-input" [(ngModel)]="data.select.contact"></textarea> -->
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#company-registration-page-modal">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#company-registration-page-alert-modal">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="user-settings-component-modal-add" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
......@@ -133,7 +212,7 @@
กำหนดค่าผู้ใช้งานระบบ
</h3>
<div class="flex justify-end">
<div class="button-help" >
<div class="button-help">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
......@@ -147,7 +226,8 @@
</div>
</div>
<div class="ti-modal-body-content " style="margin-top: 60px;">
<div class="checkbox-container text-primary" style="display: flex; justify-content: flex-end; gap: 3px; margin-bottom: 10px;">
<div class="checkbox-container text-primary"
style="display: flex; justify-content: flex-end; gap: 3px; margin-bottom: 10px;">
<label style="display: flex; align-items: center; margin-right: 20px;">
<input type="checkbox" style="transform: scale(0.6); margin-right: 2px;">ใช้งาน
</label>
......@@ -165,12 +245,18 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
......@@ -183,14 +269,20 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
</div>
<div class="flex col-span-4 relative mt-2">
<input type="password" class="ti-form-input bg-input-readonly" disabled placeholder="">
......@@ -201,14 +293,20 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
</div>
<div class="flex col-span-4 relative mt-2">
<input type="password" class="ti-form-input bg-input-readonly" disabled placeholder="">
......@@ -217,7 +315,7 @@
<div class="sm:grid grid-cols-12 gap-x-6 mt-4">
<label class="col-span-3 ti-form-label text-primary mt-2">สถานะรหัสผ่าน</label>
<div class="col-span-6 mt-2 flex">
<select class="ti-form-input flex" >
<select class="ti-form-input flex">
<option value="1">รหัสผ่านถูกตั้งใหม่เเล้ว</option>
</select>
</div>
......@@ -230,7 +328,7 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#user-settings-component-alert-modal">
data-hs-overlay="#user-settings-component-alert-modal">
บันทึกข้อมูล
</a>
</div>
......@@ -261,7 +359,8 @@
</div>
</div>
<div class="ti-modal-body-content " style="margin-top: 60px;">
<div class="checkbox-container text-primary" style="display: flex; justify-content: flex-end; gap: 3px; margin-bottom: 10px;">
<div class="checkbox-container text-primary"
style="display: flex; justify-content: flex-end; gap: 3px; margin-bottom: 10px;">
<label style="display: flex; align-items: center; margin-right: 20px;">
<input type="checkbox" style="transform: scale(0.6); margin-right: 2px;">ใช้งาน
</label>
......@@ -279,12 +378,18 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
......@@ -297,14 +402,20 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
</div>
<div class="flex col-span-4 relative mt-2">
<input type="password" class="ti-form-input bg-input-readonly" disabled placeholder="">
......@@ -315,14 +426,20 @@
<div class="col-span-3 relative mt-2">
<div>
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</div>
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input ltr:pr-11 rtl:pl-11 rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4">
<svg class="h-4 w-4 text-gray-500 dark:text-white/70"
xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" viewBox="0 0 16 16">
<path
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</div>
</div>
</div>
</div>
</div>
<div class="flex col-span-4 relative mt-2">
<input type="password" class="ti-form-input bg-input-readonly" disabled placeholder="">
......@@ -331,7 +448,7 @@
<div class="sm:grid grid-cols-12 gap-x-6 mt-4">
<label class="col-span-3 ti-form-label text-primary mt-2">สถานะรหัสผ่าน</label>
<div class="col-span-6 mt-2 flex">
<select class="ti-form-input flex" >
<select class="ti-form-input flex">
<option value="1">รหัสผ่านถูกตั้งใหม่เเล้ว</option>
</select>
</div>
......@@ -344,13 +461,13 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#user-settings-component-alert-edit-modal">
data-hs-overlay="#user-settings-component-alert-edit-modal">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
......@@ -381,7 +498,7 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#user-settings-component-alert-modal" (click)="addUser();showSuccess()">
data-hs-overlay="#user-settings-component-alert-modal">
บันทึกข้อมูล
</a>
</div>
......@@ -417,7 +534,7 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#user-settings-component-alert-edit-modal" (click)="addUser();showSuccessEdit()">
data-hs-overlay="#user-settings-component-alert-edit-modal">
บันทึกข้อมูล
</a>
</div>
......@@ -452,11 +569,43 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#user-settings-component-alert-delete-modal" (click)="addUser();showSuccessDelete()">
data-hs-overlay="#user-settings-component-alert-delete-modal">
ลบข้อมูล
</a>
</div>
</div>
</div>
</div>
</div> -->
<div id="user-setting-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าผู้ใช้งาน
</h5>
</div>
<div class="ti-modal-body max-h-full overflow-hidden ti-modal-content !rounded-t-none !rounded-b-sm">
<h1 class="mt-2" style="text-align: center;">ไฟล์</h1>
<div class="mt-2 p-2">
<div class="flex rounded-md">
<input #fileInput id="fileInput" type="file" (change)="onFileSelected($event)" hidden>
<input type="text" [value]="selectedFileName" readonly (click)="fileInput.click()"
class="ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10 cursor-pointer">
<button type="button" (click)="fileInput.click()"
class="inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-secondary text-white hover:bg-secondary focus:z-10 focus:outline-none focus:ring-0 focus:ring-secondary transition-all text-sm">
<i class="ti ti-upload"></i>
</button>
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" data-hs-overlay="#user-setting-upload-modal" class="ti-btn ti-btn-secondary"
[class.ti-btn-disabled]="!selectedFile" (click)="uploadFile()" [disabled]="!selectedFile">
อัปโหลด
</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { MyUserModel, UserModel } from 'src/app/shared/model/user.model';
import { FileService } from 'src/app/shared/services/file.service';
import { UserService } from 'src/app/shared/services/user.service';
@Component({
selector: 'app-user-settings',
......@@ -7,88 +10,82 @@ import { ToastrService } from 'ngx-toastr';
styleUrls: ['./user-settings.component.scss']
})
export class UserSettingsComponent {
@Input() pathTitle = ['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน', 'สร้างรหัสผู้ใช้งาน'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น
selectedFile: File | null = null;
selectedFileName: string = 'กรุณาเลือกไฟล์';
currentModal: 'add' | 'edit' = "add"
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab(tab: { id: string, text: string }) {
this.sendPathTitle.emit(['การจัดการข้อมูลองค์กร', 'ตั้งค่าผู้ใช้งาน', tab.text]);
this.activeTab = tab.id;
data: { loading: boolean, select: UserModel, dataList: { check: boolean, data: UserModel }[] } = { loading: false, select: new MyUserModel(), dataList: [] }
constructor(private toastr: ToastrService,
private cdr: ChangeDetectorRef,
private userService: UserService,
private fileService: FileService) { }
ngOnInit(): void {
this.getUserList()
}
// การจัดการการเปิดปิด modal
modalOptions: {
[nameModal: string]: {
isModalOpen: boolean;
modalSize: string;
backdropClose: boolean;
};
} = {
"add": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
},
"edit": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
}
};
openModal(name: string, size: string, closeOnBackdrop?: boolean) {
this.modalOptions[name].modalSize = size;
this.modalOptions[name].backdropClose = closeOnBackdrop || false;
this.modalOptions[name].isModalOpen = true;
this.currentModal = name; // ตั้งค่าค่าของ currentModal เป็น 'add' หรือ 'edit'
document.body.style.overflow = 'hidden';
getUserList() {
this.data.loading = true
this.userService.getList().subscribe(response => {
this.data.dataList = response.map(x => ({ check: false, data: new MyUserModel(x) }))
this.data.loading = false
this.cdr.detectChanges()
}, error => {
this.data.loading = false
this.cdr.detectChanges()
})
}
closeModal(name: string) {
this.modalOptions[name].isModalOpen = false;
if (!this.isAnyModalOpen()) {
document.body.style.overflow = ''; // คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
selectUser(data?: UserModel) {
this.data.select = new MyUserModel(data)
}
isAnyModalOpen(): boolean {
return Object.values(this.modalOptions).some(modal => modal.isModalOpen); // ตรวจสอบว่า modal อื่นยังเปิดอยู่หรือไม่
onFileSelected(event: any) {
this.selectedFile = event.target.files.length > 0 ? event.target.files[0] : null;
this.selectedFileName = this.selectedFile?.name || "กรุณาเลือกไฟล์"
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addUser() {
// ฟังก์ชันสำหรับการเพิ่มผู้ใช้งาน
console.log('เพิ่มผู้ใช้งาน');
uploadFile() {
if (!this.selectedFile) {
alert('กรุณาเลือกไฟล์ก่อนอัปโหลด')
return
}
const formData = new FormData();
formData.append('file', this.selectedFile);
this.data.loading = true
this.fileService.upload(formData, 'mbu1').subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
} else {
this.showAlert(response.message, 'error')
this.data.loading = false
}
}, error: error => {
this.showAlert(error.message, 'error')
this.data.loading = false
}
})
}
downloadFile() {
const fileName = 'IMPORT_USER.xlsx'
this.fileService.download(fileName).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}, error: error => {
this.showAlert(error.message, 'error')
}
})
deleteUser() {
// ฟังก์ชันสำหรับการลบผู้ใช้งาน
console.log('ลบผู้ใช้งาน');
}
editUser() {
// ฟังก์ชันสำหรับการแก้ไขผู้ใช้งาน
console.log('แก้ไขผู้ใช้งาน');
}
currentModal = ""
constructor(private toastr: ToastrService) { }
showSuccess() {
this.toastr.success('บันทึกข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessEdit() {
this.toastr.success('เเก้ไขข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessDelete() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', {
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
})
}
}
......@@ -191,8 +191,9 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style="padding-right: 3.5rem;" [(ngModel)]="bu1.bu1id" (ngModelChange)="bu1idChange()">
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu1.bu1id"
(ngModelChange)="bu1idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
<button type="button" class="flex items-center text-red-500" (click)="selectBu1()">
......@@ -293,7 +294,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu1.bu1id" (ngModelChange)="bu1idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -678,7 +679,7 @@
</div>
<div id="department-list-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนแผนก
......
......@@ -344,7 +344,7 @@
</div>
<div id="department-register-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนฝ่าย
......
......@@ -190,7 +190,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu2.bu2id" (ngModelChange)="bu2idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -297,7 +297,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu2.bu2id" (ngModelChange)="bu2idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -683,7 +683,7 @@
</div>
<div id="section-registration-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนส่วน
......
......@@ -190,7 +190,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu6.bu6id" (ngModelChange)="bu6idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -297,7 +297,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu6.bu6id" (ngModelChange)="bu6idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -683,7 +683,7 @@
</div>
<div id="sub-department-four-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนส่วนย่อย4
......
......@@ -192,7 +192,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu3.bu3id" (ngModelChange)="bu3idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -299,7 +299,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu3.bu3id" (ngModelChange)="bu3idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -690,7 +690,7 @@
</div>
<div id="sub-department-one-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนส่วนย่อย1
......
......@@ -190,7 +190,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu5.bu5id" (ngModelChange)="bu5idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -297,7 +297,7 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly" readonly
style="padding-right: 3.5rem;" [(ngModel)]="bu5.bu5id" (ngModelChange)="bu5idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
......@@ -685,7 +685,7 @@
</div>
<div id="sub-department-three-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนส่วนย่อย3
......
......@@ -190,8 +190,9 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style="padding-right: 3.5rem;" [(ngModel)]="bu4.bu4id" (ngModelChange)="bu4idChange()">
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly"
readonly style="padding-right: 3.5rem;" [(ngModel)]="bu4.bu4id"
(ngModelChange)="bu4idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
<button type="button" class="flex items-center text-red-500" (click)="selectBu4()">
......@@ -297,8 +298,9 @@
<div class="relative flex rounded-md">
<input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style="padding-right: 3.5rem;" [(ngModel)]="bu4.bu4id" (ngModelChange)="bu4idChange()">
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10 bg-input-readonly"
readonly style="padding-right: 3.5rem;" [(ngModel)]="bu4.bu4id"
(ngModelChange)="bu4idChange()">
<div
class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
<button type="button" class="flex items-center text-red-500" (click)="selectBu4()">
......@@ -680,7 +682,7 @@
</div>
<div id="sub-department-two-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าทะเบียนส่วนย่อย2
......
......@@ -281,7 +281,7 @@
</div>
<div id="company-registration-page-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าข้อมูลบริษัท
......
......@@ -347,7 +347,7 @@
</div>
<div id="sub-employee-registration-modal-upload" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าข้อมูลพนักงาน
......
......@@ -275,7 +275,7 @@
</div>
<div id="employee-categories-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าประเภทพนักงาน
......
......@@ -276,7 +276,7 @@
</div>
<div id="employee-group-unit-component-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้ากลุ่มพนักงาน
......
......@@ -211,7 +211,7 @@
</div>
<div id="employee-level-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าระดับพนักงาน (PL)
......
......@@ -272,7 +272,7 @@
</div>
<div id="position-unit-component-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าตำแหน่ง
......
......@@ -608,7 +608,7 @@
</div>
<div id="competency-topic-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าหัวข้อสมรรถนะ
......
......@@ -293,7 +293,7 @@
</div>
<div id="type-registration-component-upload-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] rounded-md">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary !rounded-none !rounded-t-sm">
<h5 class="text-xxl font-bold text-white">
นำเข้าประเภทสมรรถนะ
......
......@@ -134,6 +134,7 @@ import { FileService } from 'src/app/shared/services/file.service';
import { CompetencyGroupGradeService } from 'src/app/shared/services/competency-group-grade.service';
import { IndicatorsCoursesService } from 'src/app/shared/services/indicators-courses.service';
import { IdpDevelopmentService } from 'src/app/shared/services/idp-development.service';
import { UserService } from 'src/app/shared/services/user.service';
export const MY_DATE_FORMATS = {
parse: {
......@@ -298,6 +299,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
CompetencyGroupGradeService,
IndicatorsCoursesService,
IdpDevelopmentService,
UserService,
{
provide: HTTP_INTERCEPTORS,
useClass: HttpRequestInterceptor,
......
......@@ -198,92 +198,92 @@ export class MyEmployeeModel implements EmployeeModel {
ssoFlag: string
thFullName: string
engFullName: string
constructor(data: Partial<EmployeeModel>) {
this.employeeId = data.employeeId || ""
this.prefix = new MyPrefixModel(data.prefix || {})
this.fname = data.fname || ""
this.lname = data.lname || ""
this.efname = data.efname || ""
this.elname = data.elname || ""
this.nickname = data.nickname || ""
this.enickname = data.enickname || ""
this.birthDate = data.birthDate || ""
this.status = new MyStatusModel(data.status || {})
this.age = new MyAgeModel(data.age || {})
this.swipeCardId = data.swipeCardId || ""
this.idPeople = data.idPeople || ""
this.idexpdate = data.idexpdate || ""
this.passport_no = data.passport_no || ""
this.passport_expire_date = data.passport_expire_date || ""
this.height = data.height || ""
this.weight = data.weight || ""
this.blood = data.blood || ""
this.rh = data.rh || ""
this.eyeColor = data.eyeColor || ""
this.hairColor = data.hairColor || ""
this.shirtSize = data.shirtSize || ""
this.waistSize = data.waistSize || ""
this.national = new MyNationalModel(data.national || {})
this.nationality = new MyNationalityModel(data.nationality || {})
this.religion = new MyReligionModel(data.religion || {})
this.sex = data.sex || ""
this.email = data.email || ""
this.emailMicrosoft365 = data.emailMicrosoft365 || ""
this.emailPersonal = data.emailPersonal || ""
this.picture = data.picture || ""
this.telNo = data.telNo || ""
this.mobile = data.mobile || ""
this.position = new MyPositionModel(data.position || {})
this.jobCode = new MyJobCodeModel(data.jobCode || {})
this.personalLevel = new MyPLModel(data.personalLevel || {})
this.companyId = data.companyId || ""
this.idExpireDate = data.idExpireDate || ""
this.passportNo = data.passportNo || ""
this.passportExpireDate = data.passportExpireDate || ""
this.bossId = data.bossId || ""
this.boss = new MyBossModel(data.boss || {})
this.bu1 = new MyBu1Model(data.bu1 || {})
this.bu2 = new MyBu2Model(data.bu2 || {})
this.bu3 = new MyBu3Model(data.bu3 || {})
this.bu4 = new MyBu4Model(data.bu4 || {})
this.bu5 = new MyBu5Model(data.bu5 || {})
this.bu6 = new MyBu6Model(data.bu6 || {})
this.bu7 = new MyBu7Model(data.bu7 || {})
this.empGroup = new MyEmpGroupModel(data.empGroup || {})
this.firstHireDate = data.firstHireDate || ""
this.startDate = data.startDate || ""
this.ageWork = new MyAgeModel(data.ageWork || {})
this.empType = new MyEmpTypeModel(data.empType || {})
this.time0 = new MyTime0Model(data.time0 || {})
this.publicHoliday = data.publicHoliday || ""
this.proDate = data.proDate || ""
this.proEvery = data.proEvery || ""
this.approveDate = data.approveDate || ""
this.workarea = new MyWorkareaModel(data.workarea || {})
this.telExt = data.telExt || ""
this.costcenter = new MyCostcenterModel(data.costcenter || {})
this.branch = new MyBranchModel(data.branch || {})
this.zeemeLogOnName = data.zeemeLogOnName || ""
this.salatype = new MySalatypeModel(data.salatype || {})
this.effSalatype = data.effSalatype || ""
this.salary = data.salary || ""
this.empEvery = data.empEvery || ""
this.curchgincDate = data.curchgincDate || ""
this.receiverBankNo = data.receiverBankNo || ""
this.receiverBank = data.receiverBank || ""
this.receiverBankBranch = data.receiverBankBranch || ""
this.banks = data.banks?.map(x => new MyBanksModel(x)) || []
this.taxTable = data.taxTable || ""
this.compenTaxTable = data.compenTaxTable || ""
this.idTax = data.idTax || ""
this.calTax = data.calTax || ""
this.fixTax = data.fixTax || ""
this.calSoc = data.calSoc || ""
this.calPvf = data.calPvf || ""
this.taxMethodAct = data.taxMethodAct || ""
this.ssoFlag = data.ssoFlag || ""
this.thFullName = data.thFullName || ""
this.engFullName = data.engFullName || ""
constructor(data?: Partial<EmployeeModel>) {
this.employeeId = data?.employeeId || ""
this.prefix = new MyPrefixModel(data?.prefix || {})
this.fname = data?.fname || ""
this.lname = data?.lname || ""
this.efname = data?.efname || ""
this.elname = data?.elname || ""
this.nickname = data?.nickname || ""
this.enickname = data?.enickname || ""
this.birthDate = data?.birthDate || ""
this.status = new MyStatusModel(data?.status || {})
this.age = new MyAgeModel(data?.age || {})
this.swipeCardId = data?.swipeCardId || ""
this.idPeople = data?.idPeople || ""
this.idexpdate = data?.idexpdate || ""
this.passport_no = data?.passport_no || ""
this.passport_expire_date = data?.passport_expire_date || ""
this.height = data?.height || ""
this.weight = data?.weight || ""
this.blood = data?.blood || ""
this.rh = data?.rh || ""
this.eyeColor = data?.eyeColor || ""
this.hairColor = data?.hairColor || ""
this.shirtSize = data?.shirtSize || ""
this.waistSize = data?.waistSize || ""
this.national = new MyNationalModel(data?.national || {})
this.nationality = new MyNationalityModel(data?.nationality || {})
this.religion = new MyReligionModel(data?.religion || {})
this.sex = data?.sex || ""
this.email = data?.email || ""
this.emailMicrosoft365 = data?.emailMicrosoft365 || ""
this.emailPersonal = data?.emailPersonal || ""
this.picture = data?.picture || ""
this.telNo = data?.telNo || ""
this.mobile = data?.mobile || ""
this.position = new MyPositionModel(data?.position || {})
this.jobCode = new MyJobCodeModel(data?.jobCode || {})
this.personalLevel = new MyPLModel(data?.personalLevel || {})
this.companyId = data?.companyId || ""
this.idExpireDate = data?.idExpireDate || ""
this.passportNo = data?.passportNo || ""
this.passportExpireDate = data?.passportExpireDate || ""
this.bossId = data?.bossId || ""
this.boss = new MyBossModel(data?.boss || {})
this.bu1 = new MyBu1Model(data?.bu1 || {})
this.bu2 = new MyBu2Model(data?.bu2 || {})
this.bu3 = new MyBu3Model(data?.bu3 || {})
this.bu4 = new MyBu4Model(data?.bu4 || {})
this.bu5 = new MyBu5Model(data?.bu5 || {})
this.bu6 = new MyBu6Model(data?.bu6 || {})
this.bu7 = new MyBu7Model(data?.bu7 || {})
this.empGroup = new MyEmpGroupModel(data?.empGroup || {})
this.firstHireDate = data?.firstHireDate || ""
this.startDate = data?.startDate || ""
this.ageWork = new MyAgeModel(data?.ageWork || {})
this.empType = new MyEmpTypeModel(data?.empType || {})
this.time0 = new MyTime0Model(data?.time0 || {})
this.publicHoliday = data?.publicHoliday || ""
this.proDate = data?.proDate || ""
this.proEvery = data?.proEvery || ""
this.approveDate = data?.approveDate || ""
this.workarea = new MyWorkareaModel(data?.workarea || {})
this.telExt = data?.telExt || ""
this.costcenter = new MyCostcenterModel(data?.costcenter || {})
this.branch = new MyBranchModel(data?.branch || {})
this.zeemeLogOnName = data?.zeemeLogOnName || ""
this.salatype = new MySalatypeModel(data?.salatype || {})
this.effSalatype = data?.effSalatype || ""
this.salary = data?.salary || ""
this.empEvery = data?.empEvery || ""
this.curchgincDate = data?.curchgincDate || ""
this.receiverBankNo = data?.receiverBankNo || ""
this.receiverBank = data?.receiverBank || ""
this.receiverBankBranch = data?.receiverBankBranch || ""
this.banks = data?.banks?.map(x => new MyBanksModel(x)) || []
this.taxTable = data?.taxTable || ""
this.compenTaxTable = data?.compenTaxTable || ""
this.idTax = data?.idTax || ""
this.calTax = data?.calTax || ""
this.fixTax = data?.fixTax || ""
this.calSoc = data?.calSoc || ""
this.calPvf = data?.calPvf || ""
this.taxMethodAct = data?.taxMethodAct || ""
this.ssoFlag = data?.ssoFlag || ""
this.thFullName = data?.thFullName || ""
this.engFullName = data?.engFullName || ""
}
}
export interface LevelModel {
userLevel: string
tdesc: string
edesc: string
}
export class MyLevelModel implements LevelModel {
userLevel: string
tdesc: string
edesc: string
constructor(data?: Partial<LevelModel>) {
this.userLevel = data?.userLevel || ""
this.tdesc = data?.tdesc || ""
this.edesc = data?.edesc || ""
}
}
export interface RoleModel {
roleId: string
tdesc: string
edesc: string
}
export class MyRoleModel implements RoleModel {
roleId: string
tdesc: string
edesc: string
constructor(data?: Partial<RoleModel>) {
this.roleId = data?.roleId || ""
this.tdesc = data?.tdesc || ""
this.edesc = data?.edesc || ""
}
}
import { LevelModel, MyLevelModel } from "./level.model";
import { EmployeeModel, MyEmployeeModel } from "./employee.model";
import { MyRoleModel, RoleModel } from "./role.model";
export interface UserModel {
usernameId: string
empId: string
companyId: string
userRole: string
userLevel: string
lang: string
passwordStatus: string
expireDate: string
adAccount: string
status: string
role: RoleModel
level: LevelModel
employee: EmployeeModel
}
export class MyUserModel implements UserModel {
usernameId: string
empId: string
companyId: string
userRole: string
userLevel: string
lang: string
passwordStatus: string
expireDate: string
adAccount: string
status: string
role: RoleModel
level: LevelModel
employee: EmployeeModel
constructor(data?: Partial<UserModel>) {
this.usernameId = data?.usernameId || ""
this.empId = data?.empId || ""
this.companyId = data?.companyId || ""
this.userRole = data?.userRole || ""
this.userLevel = data?.userLevel || ""
this.lang = data?.lang || ""
this.passwordStatus = data?.passwordStatus || ""
this.expireDate = data?.expireDate || ""
this.adAccount = data?.adAccount || ""
this.status = data?.status || ""
this.role = new MyRoleModel(data?.role)
this.level = new MyLevelModel(data?.level)
this.employee = new MyEmployeeModel(data?.employee)
}
}
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model';
import { UserModel } from '../model/user.model';
@Injectable({
providedIn: 'root'
})
export class UserService {
api = "/user"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getList(): Observable<UserModel[]> {
return this.http.get<UserModel[]>(this.urlApi + "/lists")
}
checkUser(username: string): Observable<AlertModel> {
return this.http.get<AlertModel>(this.urlApi + "/validate-username/" + username)
}
post(body: UserModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/create", body)
}
delete(body: UserModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi+'/delete', options)
}
}
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