Commit 5411f194 by sawit

model meetingroom

parent 0e4b2288
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="form-label">รายละเอียด</label> <label class="form-label">รายละเอียด</label>
<input type="text" class="form-control" formControlName="amenitiesText"> <input type="text" class="form-control" formControlName="descriptionText">
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="form-label">หมายเหตุ</label> <label class="form-label">หมายเหตุ</label>
......
...@@ -46,6 +46,8 @@ export class MeetingRoomComponent implements OnInit { ...@@ -46,6 +46,8 @@ export class MeetingRoomComponent implements OnInit {
building: [''], building: [''],
floor: [''], floor: [''],
amenitiesText: [''], amenitiesText: [''],
descriptionText: [''],
remarksText: [''],
imageUrl: [''], imageUrl: [''],
isActive: [true] isActive: [true]
}); });
...@@ -57,9 +59,7 @@ export class MeetingRoomComponent implements OnInit { ...@@ -57,9 +59,7 @@ export class MeetingRoomComponent implements OnInit {
{ id:'B201', name:'ห้องประชุม B201', capacity:8, location:'โซนเหนือ', floor:'2', building:'อาคาร B', amenities:['TV','Whiteboard'], isActive:true, imageUrl:'' } { id:'B201', name:'ห้องประชุม B201', capacity:8, location:'โซนเหนือ', floor:'2', building:'อาคาร B', amenities:['TV','Whiteboard'], isActive:true, imageUrl:'' }
]; ];
} }
ngOnInit(): void { ngOnInit(): void {}
throw new Error('Method not implemented.');
}
get filteredRooms(): MeetingRoom[] { get filteredRooms(): MeetingRoom[] {
const q = (this.searchTerm || '').toLowerCase(); const q = (this.searchTerm || '').toLowerCase();
...@@ -74,7 +74,7 @@ export class MeetingRoomComponent implements OnInit { ...@@ -74,7 +74,7 @@ export class MeetingRoomComponent implements OnInit {
// overlay handled by HS overlay via data-hs-overlay attributes // overlay handled by HS overlay via data-hs-overlay attributes
startCreate(){ startCreate(){
this.form.reset({ id: '', name:'', capacity:0, building:'', floor:'', amenitiesText:'', imageUrl:'', isActive:true }); this.form.reset({ id: '', name:'', capacity:0, building:'', floor:'', amenitiesText:'', descriptionText:'', remarksText:'', imageUrl:'', isActive:true });
} }
edit(r: MeetingRoom){ edit(r: MeetingRoom){
...@@ -84,7 +84,9 @@ export class MeetingRoomComponent implements OnInit { ...@@ -84,7 +84,9 @@ export class MeetingRoomComponent implements OnInit {
capacity: r.capacity, capacity: r.capacity,
building: r.building, building: r.building,
floor: r.floor, floor: r.floor,
amenitiesText: r.amenities?.join(', ') || '', amenitiesText: (r.amenities || []).join(', '),
descriptionText: r.description || '',
remarksText: r.remarks || '',
imageUrl: r.imageUrl || '', imageUrl: r.imageUrl || '',
isActive: r.isActive isActive: r.isActive
}); });
...@@ -107,8 +109,10 @@ export class MeetingRoomComponent implements OnInit { ...@@ -107,8 +109,10 @@ export class MeetingRoomComponent implements OnInit {
floor: v.floor || '', floor: v.floor || '',
location: '', location: '',
amenities: (v.amenitiesText || '').split(',').map(s => s.trim()).filter(Boolean), amenities: (v.amenitiesText || '').split(',').map(s => s.trim()).filter(Boolean),
description: v.descriptionText || '',
isActive: !!v.isActive, isActive: !!v.isActive,
imageUrl: this.imagePreview || v.imageUrl || '' imageUrl: this.imagePreview || v.imageUrl || '',
remarks: v.remarksText || ''
}; };
if(idx >= 0){ this.rooms[idx] = data; } else { this.rooms = [...this.rooms, data]; } if(idx >= 0){ this.rooms[idx] = data; } else { this.rooms = [...this.rooms, data]; }
this.snack.open('บันทึกห้องประชุมแล้ว', 'ปิด', { duration: 2000 }); this.snack.open('บันทึกห้องประชุมแล้ว', 'ปิด', { duration: 2000 });
......
...@@ -9,6 +9,7 @@ export interface MeetingRoom { ...@@ -9,6 +9,7 @@ export interface MeetingRoom {
isActive: boolean; isActive: boolean;
imageUrl?: string; imageUrl?: string;
description?: string; description?: string;
remarks?: string;
} }
export interface MeetingBooking { export interface MeetingBooking {
......
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