Commit 36fa5d75 by DESKTOP-E3GSHH7\myhr

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

parent a2ae82b1
......@@ -25,3 +25,20 @@
.font-36{
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 {
@ViewChild('closeModal') public childModal?: ElementRef;
@ViewChild('modalDetail') public modalDetail?: ElementRef;
@ViewChild("articleModel") articleModel: any;
@ViewChild('profileChangeInput') profileChangeInputRef!: ElementRef;
dialogRef: any
currentContentTab: number = 1;
currentExcerptTab: number = 1;
action = "new";
allSelected = false;
......@@ -71,7 +74,6 @@ export class ArticleManageComponent {
filterList: ArticleModel[] = [];
selectModel: ArticleModel = new ArticleModel();
selectedItems = new Map<string, boolean>();
editorInstance: any;
// empList: ArticleModel[] = [];
// descName = 'engName';
pageIndex = 0;
......@@ -98,24 +100,6 @@ export class ArticleManageComponent {
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 {
})
.then((willDelete: any) => {
if (willDelete) {
this.articleService.deletearticle(item).subscribe(result => {
this.articleService.deletearticleById(item.articleId).subscribe(result => {
swal("ลบสำเร็จ!!", "ลบข้อมูลสำเร็จ", "success");
this.ngOnInit();
}, error => {
......@@ -258,6 +242,7 @@ export class ArticleManageComponent {
swal("บันทึกสำเร็จ!!", "บันทึกข้อมูลสมาชิก", "success");
this.ngOnInit();
this.childModal?.nativeElement.click();
this.closeDialog();
}, error => {
console.error("เกิดข้อผิดพลาดในการบันทึก/อัปเดต:", error);
swal("ข้อผิดพลาด!!", "ไม่สามารถบันทึก/อัปเดตข้อมูลได้", "error");
......@@ -406,4 +391,9 @@ export class ArticleManageComponent {
closeDialog() {
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 {
companyId: CompanyModel[]
title: string
content: string
engcontent: string
zhcontent: string
excerpt: string
engexcerpt: string
zhexcerpt: string
category: string
author: string
picture: string
......@@ -23,7 +27,11 @@ export class ArticleModel extends BaseModel implements ArticleModel {
companyId: CompanyModel[]
title: string
content: string
engcontent: string
zhcontent: string
excerpt: string
engexcerpt: string
zhexcerpt: string
category: string
author: string
picture: string
......@@ -38,7 +46,11 @@ export class ArticleModel extends BaseModel implements ArticleModel {
this.companyId = dataToArray(data?.companyId).map((x:CompanyModel) => new CompanyModel(x,translateService))
this.title = data?.title!
this.content = data?.content!
this.engcontent = data?.engcontent!
this.zhcontent = data?.zhcontent!
this.excerpt = data?.excerpt!
this.engexcerpt = data?.engexcerpt!
this.zhexcerpt = data?.zhexcerpt!
this.category = data?.category!
this.author = data?.author!
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