Commit e61731a0 by Nakarin Luankla

UPDATE เมนู excel

parent 74dcf9f1
<div class="row">
<div class="col-12">
<div class="card card-body">
<h4 class="card-title">รายการ Excel</h4>
<div class="d-flex mb-3 mt-3">
<input type="text" class="form-control w-25" placeholder="ค้นหา" [(ngModel)]='searchTerm'>
<!-- <button class="btn btn-primary ml-auto" (click)="openModal(editTemplateModal)">เพิ่มไฟล์ Excel</button> -->
</div>
<div class="table-responsive table-bordered">
<table class="table table-striped mb-0 no-wrap v-middle ">
<thead>
<tr>
<th class="text-center" scope="col">#</th>
<th scope="col">รูปภาพ</th>
<th scope="col">รหัสเอกสาร</th>
<th scope="col">ชื่อ</th>
<th scope="col">รายละเอียด</th>
<th scope="col">วันที่อัพโหลด</th>
<th scope="col">สถานะ</th>
<th scope="col">ลิงค์</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of testdata | slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index">
<td class="text-center">{{i+1}}</td>
<td><img width="100" class="border p-1" src="{{data.img}}"></td>
<td >{{data.id}}</td>
<td>{{ data.name }}</td>
<td>{{ data.detail }}</td>
<td>{{ data.dateupload }}</td>
<td>{{ data.status }}</td>
<td><a href="{{data.link}}" target="_blank">คลิก</a></td>
<td>
<button type="button" class="btn btn-circle btn-success rounded-circle btn-sm mr-2"><i class="fa fa-check"></i></button>
<button type="button" class="btn btn-circle btn-danger rounded-circle btn-sm mr-2"><i class="fas fa-times"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center mt-5">
<ngb-pagination [(page)]="page" [pageSize]="pageSize" [collectionSize]="testdata.length"></ngb-pagination>
</div>
</div>
</div>
</div>
<ng-template #editTemplateModal let-modal>
<div class="modal-header">
<h5 class="modal-title" id="edittemplateLabel">เพิ่มไฟล์ Excel</h5>
<button type="button" class="close" (click)="closeBtnClick()" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (ไทย)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameth">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (ไทย)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">รูปภาพตัวอย่างรายงาน</label>
<div class="col-sm-8">
<input type="file" class="form-control">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ลิงค์ตัวอย่าง</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">หมายเหตุ</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="modal-footer ">
<button type="submit" class="btn btn-info" [disabled]="edittemplate.invalid">บันทึก</button>
<button type="button" class="btn btn-danger" (click)="closeBtnClick()">ปิด</button>
</div>
</div>
</ng-template>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ApproveExcelComponent } from './approve-excel.component';
describe('ApproveExcelComponent', () => {
let component: ApproveExcelComponent;
let fixture: ComponentFixture<ApproveExcelComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ApproveExcelComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ApproveExcelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-approve-excel',
templateUrl: './approve-excel.component.html',
styleUrls: ['./approve-excel.component.scss']
})
export class ApproveExcelComponent implements OnInit {
get searchTerm(): string {
return this._searchTerm;
}
set searchTerm(val: string) {
this._searchTerm = val;
this.filterArray = this.filter(val);
}
page = 1;
pageSize = 7;
filterArray: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
}[] = [];
_searchTerm = '';
testdata: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
img:string
}[] = [];
constructor(private modalService: NgbModal) {
}
ngOnInit() {
this.testdata = [
{
id:'2024-1101',
name: "Template Excel ข้อมูลพนักงาน",
detail: "แสดงรายชื่อพนักงานทั้งหมด",
dateupload: "11/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/9a60ef19-7813-4094-bc45-17b7d9decc70.jpg'
},
{
id:'2024-1102',
name: "หนังสือรับรองเงินเดือน Word",
detail: "เอกสารใบรับรองเงินเดือน",
dateupload: "10/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/acb4b666-437e-47d1-94ca-4dbce9ce0761.png'
},
];
this.filterArray = this.testdata
}
filter(v: string) {
return this.testdata.filter(x => x.name.toLowerCase().indexOf(v.toLowerCase()) !== -1);
}
openModal(targetModal: NgbModal,) {
this.modalService.open(targetModal, {
centered: true,
backdrop: 'static',
size: 'lg'
});
}
closeBtnClick() {
this.modalService.dismissAll();
this.ngOnInit();
}
}
......@@ -82,6 +82,9 @@ import { PortalTemplateApproveComponent } from './portal-template-approve/portal
import { PortalCategoryListComponent } from './portal-category-list/portal-category-list.component';
import { PortalTemplateListComponent } from './portal-template-list/portal-template-list.component';
import { PortalCreateCategoryComponent } from './portal-create-category/portal-create-category.component';
import { ListDocComponent } from './list-doc/list-doc.component';
import { ApproveExcelComponent } from './approve-excel/approve-excel.component';
import { ListExcelComponent } from './list-excell/list-excell.component';
@NgModule({
......@@ -141,7 +144,10 @@ import { PortalCreateCategoryComponent } from './portal-create-category/portal-c
PortalTemplateApproveComponent,
PortalCategoryListComponent,
PortalTemplateListComponent,
PortalCreateCategoryComponent
PortalCreateCategoryComponent,
ListDocComponent,
ApproveExcelComponent,
ListExcelComponent
],
providers: [
ContactService,
......
......@@ -37,7 +37,9 @@ import { PortalTemplateApproveComponent } from "./portal-template-approve/portal
import { PortalCategoryListComponent } from "./portal-category-list/portal-category-list.component";
import { PortalTemplateListComponent } from "./portal-template-list/portal-template-list.component";
import { PortalCreateCategoryComponent } from "./portal-create-category/portal-create-category.component";
import { ListDocComponent } from "./list-doc/list-doc.component";
import { ApproveExcelComponent } from "./approve-excel/approve-excel.component";
import { ListExcelComponent } from "./list-excell/list-excell.component";
export const AppsRoutes: Routes = [
{
path: "",
......@@ -190,6 +192,17 @@ export const AppsRoutes: Routes = [
},
},
{
path: "approve-excel",
component: ApproveExcelComponent,
data: {
title: "Approve Excel",
urls: [
{ title: "Category List Approve" ,url: "apps/portal-category-list-approve"},
{ title: "Approve Excel" },
],
},
},
{
path: "portal-template-approve",
component: PortalTemplateApproveComponent,
data: {
......@@ -250,6 +263,28 @@ export const AppsRoutes: Routes = [
},
},
{
path: "list-doc",
component: ListDocComponent,
data: {
title: "List",
urls: [
{ title: "Create Category", url: "apps/portal-create-category" },
{ title: "List" },
],
},
},
{
path: "list-excel",
component: ListExcelComponent,
data: {
title: "List Excell",
urls: [
{ title: "Create Category", url: "apps/portal-create-category" },
{ title: "List" },
],
},
},
{
path: "usersrxjs",
component: UserRxjsComponent,
data: {
......
<div class="row">
<div class="col-12">
<div class="card card-body">
<h4 class="card-title">รายการ Excel</h4>
<div class="d-flex mb-3 mt-3">
<input type="text" class="form-control w-25" placeholder="ค้นหา" [(ngModel)]='searchTerm'>
<button class="btn btn-primary ml-auto" (click)="openModal(editTemplateModal, null)">เพิ่มไฟล์ Excel</button>
</div>
<div class="table-responsive table-bordered">
<table class="table table-striped mb-0 no-wrap v-middle ">
<thead>
<tr>
<th class="text-center" scope="col">#</th>
<th scope="col">รหัสเอกสาร</th>
<th scope="col">ชื่อ</th>
<th scope="col">รายละเอียด</th>
<th scope="col">วันที่อัพโหลด</th>
<th scope="col">สถานะ</th>
<th scope="col">ลิงค์</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of testdata | slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index">
<td class="text-center">{{i+1}}</td>
<td >{{data.id}}</td>
<td>{{ data.name }}</td>
<td>{{ data.detail }}</td>
<td>{{ data.dateupload }}</td>
<td>{{ data.status }}</td>
<td><a href="{{data.link}}" target="_blank">คลิก</a></td>
<td>
<a href="javascript: void(0);" (click)="openModal(editTemplateModal, template)" class="link mr-2"
placement="top" ngbTooltip="แก้ไข">
<i-feather name="edit-2" class="feather-sm text-primary"></i-feather>
</a>
<a href="javascript: void(0);" class="link" (click)="deletetemplate(template.id)" placement="top"
ngbTooltip="ลบ">
<i-feather name="trash-2" class="feather-sm text-danger"></i-feather>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center mt-5">
<ngb-pagination [(page)]="page" [pageSize]="pageSize" [collectionSize]="testdata.length"></ngb-pagination>
</div>
</div>
</div>
</div>
<ng-template #editTemplateModal let-modal>
<div class="modal-header">
<h5 class="modal-title" id="edittemplateLabel">เพิ่มไฟล์ Excel</h5>
<button type="button" class="close" (click)="closeBtnClick()" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (ไทย)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameth">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (ไทย)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">รูปภาพตัวอย่างรายงาน</label>
<div class="col-sm-8">
<input type="file" class="form-control">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ลิงค์ตัวอย่าง</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">หมายเหตุ</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="modal-footer ">
<button type="submit" class="btn btn-info" [disabled]="edittemplate.invalid">บันทึก</button>
<button type="button" class="btn btn-danger" (click)="closeBtnClick()">ปิด</button>
</div>
</div>
</ng-template>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { DatePipe } from '@angular/common';
import { UserService } from '../users/userService.service';
import { User } from '../users/user';
@Component({
selector: 'app-list-doc',
templateUrl: './list-doc.component.html',
styleUrls: ['./list-doc.component.scss']
})
export class ListDocComponent implements OnInit {
get searchTerm(): string {
return this._searchTerm;
}
set searchTerm(val: string) {
this._searchTerm = val;
this.filterArray = this.filter(val);
}
page = 1;
pageSize = 7;
filterArray: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
}[] = [];
_searchTerm = '';
testdata: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
}[] = [];
constructor(private modalService: NgbModal) {
}
ngOnInit() {
this.testdata = [
{
id:'2024-1101',
name: "Template Excel ข้อมูลพนักงาน",
detail: "แสดงรายชื่อพนักงานทั้งหมด",
dateupload: "11/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
},
{
id:'2024-1102',
name: "หนังสือรับรองเงินเดือน Word",
detail: "เอกสารใบรับรองเงินเดือน",
dateupload: "10/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
},
{
id:'2024-1103',
name: "Resume",
detail: "ตัวอย่าง Resume",
dateupload: "09/06/2024",
status: "เปิดใช้งาน",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
},
{
id:'2024-1104',
name: "Template Excel เวลาการทำงาน",
detail: "ข้อมูลเวลาการทำงาน ",
dateupload: "09/06/2024",
status: "ไม่อนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
},
];
this.filterArray = this.testdata
}
filter(v: string) {
return this.testdata.filter(x => x.name.toLowerCase().indexOf(v.toLowerCase()) !== -1);
}
openModal(targetModal: NgbModal, user: User | null) {
this.modalService.open(targetModal, {
centered: true,
backdrop: 'static',
size: 'lg'
});
}
closeBtnClick() {
this.modalService.dismissAll();
this.ngOnInit();
}
}
<div class="row">
<div class="col-12">
<div class="card card-body">
<h4 class="card-title">รายการ Excel</h4>
<div class="d-flex mb-3 mt-3">
<input type="text" class="form-control w-25" placeholder="ค้นหา" [(ngModel)]='searchTerm'>
<button class="btn btn-primary ml-auto" (click)="openModal(editTemplateModal)">เพิ่มไฟล์ Excel</button>
</div>
<div class="table-responsive table-bordered">
<table class="table table-striped mb-0 no-wrap v-middle ">
<thead>
<tr>
<th class="text-center" scope="col">#</th>
<th scope="col">รูปภาพ</th>
<th scope="col">รหัสเอกสาร</th>
<th scope="col">ชื่อ</th>
<th scope="col">รายละเอียด</th>
<th scope="col">วันที่อัพโหลด</th>
<th scope="col">สถานะ</th>
<th scope="col">ลิงค์</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of testdata | slice: (page-1) * pageSize : (page-1) * pageSize + pageSize ; let i = index">
<td class="text-center">{{i+1}}</td>
<td><img width="100" class="border p-1" src="{{data.img}}"></td>
<td >{{data.id}}</td>
<td>{{ data.name }}</td>
<td>{{ data.detail }}</td>
<td>{{ data.dateupload }}</td>
<td>{{ data.status }}</td>
<td><a href="{{data.link}}" target="_blank">คลิก</a></td>
<td>
<a href="javascript: void(0);" (click)="openModal(editTemplateModal, template)" class="link mr-2"
placement="top" ngbTooltip="แก้ไข">
<i-feather name="edit-2" class="feather-sm text-primary"></i-feather>
</a>
<a href="javascript: void(0);" class="link" (click)="deletetemplate(template.id)" placement="top"
ngbTooltip="ลบ">
<i-feather name="trash-2" class="feather-sm text-danger"></i-feather>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center mt-5">
<ngb-pagination [(page)]="page" [pageSize]="pageSize" [collectionSize]="testdata.length"></ngb-pagination>
</div>
</div>
</div>
</div>
<ng-template #editTemplateModal let-modal>
<div class="modal-header">
<h5 class="modal-title" id="edittemplateLabel">เพิ่มไฟล์ Excel</h5>
<button type="button" class="close" (click)="closeBtnClick()" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (ไทย)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameth">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ชื่อรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (ไทย)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">รายละเอียดรายงาน (อังกฤษ)</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">รูปภาพตัวอย่างรายงาน</label>
<div class="col-sm-8">
<input type="file" class="form-control">
</div>
</div>
<div class="form-group row">
<label for="name" class="col-sm-4 col-form-label">ลิงค์ตัวอย่าง</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="nameeng">
</div>
</div>
<div class="form-group row">
<label for="position" class="col-sm-4 col-form-label">หมายเหตุ</label>
<div class="col-sm-8">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="modal-footer ">
<button type="submit" class="btn btn-info" [disabled]="edittemplate.invalid">บันทึก</button>
<button type="button" class="btn btn-danger" (click)="closeBtnClick()">ปิด</button>
</div>
</div>
</ng-template>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ListExcelComponent } from './list-excell.component';
describe('ListExcelComponent', () => {
let component: ListExcelComponent;
let fixture: ComponentFixture<ListExcelComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ListExcelComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ListExcelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-list-excel',
templateUrl: './list-excell.component.html',
styleUrls: ['./list-excell.component.scss']
})
export class ListExcelComponent implements OnInit {
get searchTerm(): string {
return this._searchTerm;
}
set searchTerm(val: string) {
this._searchTerm = val;
this.filterArray = this.filter(val);
}
page = 1;
pageSize = 7;
filterArray: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
}[] = [];
_searchTerm = '';
testdata: {
id:string;
name: String;
detail: String;
dateupload: String;
status: String;
link: String;
img:string
}[] = [];
constructor(private modalService: NgbModal) {
}
ngOnInit() {
this.testdata = [
{
id:'2024-1101',
name: "Template Excel ข้อมูลพนักงาน",
detail: "แสดงรายชื่อพนักงานทั้งหมด",
dateupload: "11/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/9a60ef19-7813-4094-bc45-17b7d9decc70.jpg'
},
{
id:'2024-1102',
name: "หนังสือรับรองเงินเดือน Word",
detail: "เอกสารใบรับรองเงินเดือน",
dateupload: "10/06/2024",
status: "รออนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/acb4b666-437e-47d1-94ca-4dbce9ce0761.png'
},
{
id:'2024-1103',
name: "Resume",
detail: "ตัวอย่าง Resume",
dateupload: "09/06/2024",
status: "เปิดใช้งาน",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/3daddc9f-f69a-470b-8275-7db59db1a89b.jpg'
},
{
id:'2024-1104',
name: "Template Excel เวลาการทำงาน",
detail: "ข้อมูลเวลาการทำงาน ",
dateupload: "09/06/2024",
status: "ไม่อนุมัติ",
link: "https://www.youtube.com/watch?v=wOK9j3q20tw",
img:'http://elearning.bus.rmutt.ac.th/api/files/image/acb4b666-437e-47d1-94ca-4dbce9ce0761.png'
},
];
this.filterArray = this.testdata
}
filter(v: string) {
return this.testdata.filter(x => x.name.toLowerCase().indexOf(v.toLowerCase()) !== -1);
}
openModal(targetModal: NgbModal) {
this.modalService.open(targetModal, {
centered: true,
backdrop: 'static',
size: 'lg'
});
}
closeBtnClick() {
this.modalService.dismissAll();
this.ngOnInit();
}
}
......@@ -21,7 +21,7 @@
<br />
</div>
<div class="mt-3">
<a (click)="routerLink('/apps/portal-template-approve',c.type)">
<a (click)="openView(c.id)">
<button class="btn btn-info">View</button>
</a>
<!-- <button class="btn btn-warning">Edit</button>
......@@ -30,8 +30,7 @@
</div>
</div>
<div class="d-flex text-center justify-content-md-center bg-light border-top">
<div class="col-4 border-bottom py-3">
<i class="icon-social-instagram m-r-10"></i>
<div class="col-12 border-bottom py-3">
{{ c.document }}
</div>
</div>
......
......@@ -13,7 +13,7 @@ export class PortalCategoryListApproveComponent implements OnInit {
constructor(
private fb: FormBuilder,
private modalService: NgbModal,
private router:Router
private router:Router,
) {}
get searchTerm(): string {
return this._searchTerm;
......@@ -28,9 +28,9 @@ export class PortalCategoryListApproveComponent implements OnInit {
pageSize = 7;
testdata: {
id:string
img: String;
name: String;
type: String;
details: String;
document: String;
}[] = [];
......@@ -39,29 +39,33 @@ export class PortalCategoryListApproveComponent implements OnInit {
this.testdata = [
{
img: "assets/images/phototest/excel.jpg",
id:'1',
img: "assets/images/icon/excel.png",
name: "ประเภทไฟล์: Excel",
type: "Excel",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 8 ฉบับ"
},
{
img: "assets/images/phototest/mail.jpg",
name: "ประเภทไฟล์: Mail Merge",
type: "Mail Merge",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'2',
img: "assets/images/icon/document.png",
name: "ประเภทไฟล์: Document",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 3 ฉบับ"
},
{
img: "assets/images/phototest/resume.jpg",
name: "ประเภทไฟล์: Resume",
type: "Resume",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'3',
img: "assets/images/icon/course.png",
name: "ประเภทไฟล์: Course",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 5 ฉบับ"
},
];
}
openView(id:string){
if(id =='1'){
this.router.navigate(['apps/approve-excel']);
}
}
openModal(targetModal: NgbModal) {
this.modalService.open(targetModal, {
centered: true,
......
......@@ -30,8 +30,7 @@
</div>
</div>
<div class="d-flex text-center justify-content-md-center bg-light border-top">
<div class="col-4 border-bottom py-3">
<i class="icon-social-instagram m-r-10"></i>
<div class="col-12 border-bottom py-3">
{{ c.document }}
</div>
</div>
......
......@@ -28,9 +28,9 @@ export class PortalCategoryListComponent implements OnInit {
pageSize = 7;
testdata: {
id:string;
img: String;
name: String;
type: String;
details: String;
document: String;
}[] = [];
......@@ -39,24 +39,24 @@ export class PortalCategoryListComponent implements OnInit {
this.testdata = [
{
img: "assets/images/phototest/excel.jpg",
id:'1',
img: "assets/images/icon/excel.png",
name: "ประเภทไฟล์: Excel",
type: "Excel",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 8 ฉบับ"
},
{
img: "assets/images/phototest/mail.jpg",
name: "ประเภทไฟล์: Mail Merge",
type: "Mail Merge",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'2',
img: "assets/images/icon/document.png",
name: "ประเภทไฟล์: Document",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 3 ฉบับ"
},
{
img: "assets/images/phototest/resume.jpg",
name: "ประเภทไฟล์: Resume",
type: "Resume",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'3',
img: "assets/images/icon/course.png",
name: "ประเภทไฟล์: Course",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 5 ฉบับ"
},
];
......
......@@ -29,8 +29,7 @@
</div>
</div>
<div class="d-flex text-center justify-content-md-center bg-light border-top">
<div class="col-4 border-bottom py-3">
<i class="icon-social-instagram m-r-10"></i>
<div class="col-12 border-bottom py-3">
{{ c.document }}
</div>
</div>
......
......@@ -29,9 +29,9 @@ export class PortalCategoryManageComponent implements OnInit {
pageSize = 9;
testdata: {
id:string;
img: String;
name: String;
type: String;
details: String;
document: String;
}[] = [];
......@@ -84,24 +84,24 @@ export class PortalCategoryManageComponent implements OnInit {
this.testdata = [
{
img: "assets/images/phototest/excel.jpg",
id:'1',
img: "assets/images/icon/excel.png",
name: "ประเภทไฟล์: Excel",
type: "Excel",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 8 ฉบับ"
},
{
img: "assets/images/phototest/mail.jpg",
name: "ประเภทไฟล์: Mail Merge",
type: "Mail Merge",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'2',
img: "assets/images/icon/document.png",
name: "ประเภทไฟล์: Document",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 3 ฉบับ"
},
{
img: "assets/images/phototest/resume.jpg",
name: "ประเภทไฟล์: Resume",
type: "Resume",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'3',
img: "assets/images/icon/course.png",
name: "ประเภทไฟล์: Course",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 5 ฉบับ"
},
];
......
......@@ -4,7 +4,7 @@
<h4 class="card-title">Create Category</h4>
<div class="d-flex mb-3 mt-3">
<input type="text" class="form-control w-25" placeholder="Search" [(ngModel)]='searchTerm'>
<button class="btn btn-primary ml-auto" (click)="openModal(editTemplateModal)">Add File Type Category</button>
<!-- <button class="btn btn-primary ml-auto" (click)="openModal(editTemplateModal)">Add File Type Category</button> -->
</div>
</div>
</div>
......@@ -20,17 +20,11 @@
<br />
</div>
<div class="mt-3">
<!-- <a href="/portal-template-manage">
<button class="btn btn-info">View</button>
</a> -->
<button class="btn btn-warning mr-2">Edit</button>
<button class="btn btn-danger">Delete</button>
<!-- <button class="btn btn-light">Follow</button> -->
<button class="btn btn-info" (click)="openView(c.id)">View</button>
</div>
</div>
<div class="d-flex text-center justify-content-md-center bg-light border-top">
<div class="col-4 border-bottom py-3">
<i class="icon-social-instagram m-r-10"></i>
<div class="col-12 border-bottom py-3">
{{ c.document }}
</div>
</div>
......
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { PortalCreateCategoryComponent } from './portal-create-category.component';
describe('PortalCreateCategoryComponent', () => {
let component: PortalCreateCategoryComponent;
let fixture: ComponentFixture<PortalCreateCategoryComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PortalCreateCategoryComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PortalCreateCategoryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { DatePipe } from "@angular/common";
import { Router } from '@angular/router';
@Component({
selector: 'app-portal-create-category',
......@@ -10,7 +11,7 @@ import { DatePipe } from "@angular/common";
})
export class PortalCreateCategoryComponent implements OnInit {
constructor(private fb: FormBuilder, private modalService: NgbModal, private datePipe: DatePipe) {}
constructor(private fb: FormBuilder, private modalService: NgbModal, private datePipe: DatePipe,private routes: Router,) {}
get searchTerm(): string {
return this._searchTerm;
......@@ -22,43 +23,16 @@ export class PortalCreateCategoryComponent implements OnInit {
pageSize = 9;
testdata: {
id:string;
img: String;
name: String;
details: String;
document: String;
}[] = [];
// config: any;
// editUser: FormGroup | null = null;
// joiningDate: string | null = null;
_searchTerm = "";
// ValidationMessage = [
// {
// Name: { required: "Name is required." },
// },
// {
// Position: { required: "Position is required." },
// },
// {
// Email: { required: "Email is required." },
// },
// {
// Mobile: { required: "Mobile is required." },
// },
// {
// DateOfJoining: { required: "DOJ is required." },
// },
// {
// Salary: { required: "Salary is required." },
// },
// {
// Projects: { required: "Project is required." },
// },
// ];
formsErrors = [];
......@@ -76,44 +50,34 @@ export class PortalCreateCategoryComponent implements OnInit {
this.testdata = [
{
img: "assets/images/phototest/excel.jpg",
id:'1',
img: "assets/images/icon/excel.png",
name: "ประเภทไฟล์: Excel",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 8 ฉบับ"
},
{
img: "assets/images/phototest/mail.jpg",
name: "ประเภทไฟล์: Mail Merge",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'2',
img: "assets/images/icon/document.png",
name: "ประเภทไฟล์: Document",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 3 ฉบับ"
},
{
img: "assets/images/phototest/resume.jpg",
name: "ประเภทไฟล์: Resume",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
id:'3',
img: "assets/images/icon/course.png",
name: "ประเภทไฟล์: Course",
details: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
document: "จำนวนเอกสาร 5 ฉบับ"
},
];
}
logValidationErrors(group: FormGroup) {
// Object.keys(group.controls).forEach((key: string) => {
// const ac = group.get(key);
// this.formsErrors[key] = '';
// if (ac && !ac.valid && (ac.touched || ac.dirty)) {
// const message = this.ValidationMessage[key];
// for (const errorKey in ac.errors) {
// if (errorKey) {
// this.formsErrors[key] += message[errorKey] + ' ';
// }
// }
// }
// if (ac instanceof FormGroup) {
// this.logValidationErrors(ac)
// }
// })
openView(id:string){
if(id =='1'){
this.routes.navigate(['apps/list-excel/']);
}
}
openModal(targetModal: NgbModal) {
this.modalService.open(targetModal, {
centered: true,
......
......@@ -32,7 +32,7 @@
</div>
<div class="form-group text-center">
<div class="col-xs-12 p-b-20">
<a class="btn btn-block btn-lg btn-info" href="/apps/users">Log In</a>
<a class="btn btn-block btn-lg btn-info" href="/apps/portal-create-category">Log In</a>
</div>
</div>
<div class="row">
......
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