Commit 36fa5d75 by DESKTOP-E3GSHH7\myhr

เเก้ไขหน้าตาการเพิ่มรูป

parent a2ae82b1
...@@ -24,4 +24,21 @@ ...@@ -24,4 +24,21 @@
} }
.font-36{ .font-36{
font-size: 36px; font-size: 36px;
}
.page {
display: flex;
height: auto;
flex-direction: column;
}
.hs-tab-active {
background-color: rgb(21, 76, 156) !important;
border-color: rgb(21, 76, 156) !important;
color: #FFFFFF !important;
}
.active {
background-color: rgb(21, 76, 156) !important;
border-color: rgb(21, 76, 156) !important;
color: #FFFFFF !important;
} }
\ No newline at end of file
...@@ -62,7 +62,10 @@ export class ArticleManageComponent { ...@@ -62,7 +62,10 @@ export class ArticleManageComponent {
@ViewChild('closeModal') public childModal?: ElementRef; @ViewChild('closeModal') public childModal?: ElementRef;
@ViewChild('modalDetail') public modalDetail?: ElementRef; @ViewChild('modalDetail') public modalDetail?: ElementRef;
@ViewChild("articleModel") articleModel: any; @ViewChild("articleModel") articleModel: any;
@ViewChild('profileChangeInput') profileChangeInputRef!: ElementRef;
dialogRef: any dialogRef: any
currentContentTab: number = 1;
currentExcerptTab: number = 1;
action = "new"; action = "new";
allSelected = false; allSelected = false;
...@@ -71,7 +74,6 @@ export class ArticleManageComponent { ...@@ -71,7 +74,6 @@ export class ArticleManageComponent {
filterList: ArticleModel[] = []; filterList: ArticleModel[] = [];
selectModel: ArticleModel = new ArticleModel(); selectModel: ArticleModel = new ArticleModel();
selectedItems = new Map<string, boolean>(); selectedItems = new Map<string, boolean>();
editorInstance: any;
// empList: ArticleModel[] = []; // empList: ArticleModel[] = [];
// descName = 'engName'; // descName = 'engName';
pageIndex = 0; pageIndex = 0;
...@@ -98,24 +100,6 @@ export class ArticleManageComponent { ...@@ -98,24 +100,6 @@ export class ArticleManageComponent {
this.uploadConfig(); this.uploadConfig();
} }
isDescriptionValid(): boolean {
const plainText = this.editorInstance?.getText()?.trim() || '';
return plainText.length > 0;
}
onEditorCreated(quill: any) {
this.editorInstance = quill;
}
onContentChanged(event: any) {
const text = event.editor.getText().trim();
if (text.length === 0 && this.editorInstance) {
this.editorInstance.formatLine(0, 1, 'header', false);
}
this.selectModel.content = event.html;
}
...@@ -210,7 +194,7 @@ export class ArticleManageComponent { ...@@ -210,7 +194,7 @@ export class ArticleManageComponent {
}) })
.then((willDelete: any) => { .then((willDelete: any) => {
if (willDelete) { if (willDelete) {
this.articleService.deletearticle(item).subscribe(result => { this.articleService.deletearticleById(item.articleId).subscribe(result => {
swal("ลบสำเร็จ!!", "ลบข้อมูลสำเร็จ", "success"); swal("ลบสำเร็จ!!", "ลบข้อมูลสำเร็จ", "success");
this.ngOnInit(); this.ngOnInit();
}, error => { }, error => {
...@@ -258,6 +242,7 @@ export class ArticleManageComponent { ...@@ -258,6 +242,7 @@ export class ArticleManageComponent {
swal("บันทึกสำเร็จ!!", "บันทึกข้อมูลสมาชิก", "success"); swal("บันทึกสำเร็จ!!", "บันทึกข้อมูลสมาชิก", "success");
this.ngOnInit(); this.ngOnInit();
this.childModal?.nativeElement.click(); this.childModal?.nativeElement.click();
this.closeDialog();
}, error => { }, error => {
console.error("เกิดข้อผิดพลาดในการบันทึก/อัปเดต:", error); console.error("เกิดข้อผิดพลาดในการบันทึก/อัปเดต:", error);
swal("ข้อผิดพลาด!!", "ไม่สามารถบันทึก/อัปเดตข้อมูลได้", "error"); swal("ข้อผิดพลาด!!", "ไม่สามารถบันทึก/อัปเดตข้อมูลได้", "error");
...@@ -406,4 +391,9 @@ export class ArticleManageComponent { ...@@ -406,4 +391,9 @@ export class ArticleManageComponent {
closeDialog() { closeDialog() {
this.dialogRef.close() this.dialogRef.close()
} }
triggerFileInput(): void {
if (this.profileChangeInputRef) {
this.profileChangeInputRef.nativeElement.click();
}
}
} }
\ No newline at end of file
...@@ -8,7 +8,11 @@ export interface ArticleModel { ...@@ -8,7 +8,11 @@ export interface ArticleModel {
companyId: CompanyModel[] companyId: CompanyModel[]
title: string title: string
content: string content: string
engcontent: string
zhcontent: string
excerpt: string excerpt: string
engexcerpt: string
zhexcerpt: string
category: string category: string
author: string author: string
picture: string picture: string
...@@ -23,7 +27,11 @@ export class ArticleModel extends BaseModel implements ArticleModel { ...@@ -23,7 +27,11 @@ export class ArticleModel extends BaseModel implements ArticleModel {
companyId: CompanyModel[] companyId: CompanyModel[]
title: string title: string
content: string content: string
engcontent: string
zhcontent: string
excerpt: string excerpt: string
engexcerpt: string
zhexcerpt: string
category: string category: string
author: string author: string
picture: string picture: string
...@@ -38,7 +46,11 @@ export class ArticleModel extends BaseModel implements ArticleModel { ...@@ -38,7 +46,11 @@ export class ArticleModel extends BaseModel implements ArticleModel {
this.companyId = dataToArray(data?.companyId).map((x:CompanyModel) => new CompanyModel(x,translateService)) this.companyId = dataToArray(data?.companyId).map((x:CompanyModel) => new CompanyModel(x,translateService))
this.title = data?.title! this.title = data?.title!
this.content = data?.content! this.content = data?.content!
this.engcontent = data?.engcontent!
this.zhcontent = data?.zhcontent!
this.excerpt = data?.excerpt! this.excerpt = data?.excerpt!
this.engexcerpt = data?.engexcerpt!
this.zhexcerpt = data?.zhexcerpt!
this.category = data?.category! this.category = data?.category!
this.author = data?.author! this.author = data?.author!
this.picture = data?.picture! this.picture = data?.picture!
......
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