Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myjob-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myjob-manage
Commits
a9294f38
Commit
a9294f38
authored
Jul 03, 2025
by
DESKTOP-E3GSHH7\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เเก้ไขอัพโหลดรูป
parent
bedbea55
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
article-manage.component.html
...p/DPU/common/article-manage/article-manage.component.html
+0
-4
article-manage.component.ts
...app/DPU/common/article-manage/article-manage.component.ts
+4
-2
company-manage.component.html
...p/DPU/common/company-manage/company-manage.component.html
+1
-1
company-manage.component.ts
...app/DPU/common/company-manage/company-manage.component.ts
+8
-2
user.model.ts
src/app/DPU/models/user.model.ts
+6
-1
No files found.
src/app/DPU/common/article-manage/article-manage.component.html
View file @
a9294f38
...
@@ -103,10 +103,6 @@
...
@@ -103,10 +103,6 @@
</td>
</td>
<td>
<td>
<div
class=
"flex flex-row items-center !gap-2 "
>
<div
class=
"flex flex-row items-center !gap-2 "
>
<a
aria-label=
"anchor"
(
click
)="
viewArticleDetail
(
item
.
articleId
)"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
>
<i
class=
"ri-search-line"
></i>
</a>
<a
aria-label=
"anchor"
(
click
)="
view
(
item
)"
(
click
)="
openDialog
()"
<a
aria-label=
"anchor"
(
click
)="
view
(
item
)"
(
click
)="
openDialog
()"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
>
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
>
<i
class=
"ri-pencil-line"
></i>
<i
class=
"ri-pencil-line"
></i>
...
...
src/app/DPU/common/article-manage/article-manage.component.ts
View file @
a9294f38
...
@@ -105,7 +105,7 @@ export class ArticleManageComponent {
...
@@ -105,7 +105,7 @@ export class ArticleManageComponent {
uploadConfig
()
{
uploadConfig
()
{
this
.
uploaderProfile
=
new
FileUploader
({
this
.
uploaderProfile
=
new
FileUploader
({
url
:
environment
.
baseUrl
+
"/
api
/upload-image"
,
url
:
environment
.
baseUrl
+
"/
files
/upload-image"
,
isHTML5
:
true
,
isHTML5
:
true
,
authToken
:
this
.
tokenService
.
getToken
()
!
,
authToken
:
this
.
tokenService
.
getToken
()
!
,
});
});
...
@@ -144,8 +144,9 @@ export class ArticleManageComponent {
...
@@ -144,8 +144,9 @@ export class ArticleManageComponent {
if
(
item
.
isSuccess
)
{
if
(
item
.
isSuccess
)
{
const
res
=
JSON
.
parse
(
response
);
const
res
=
JSON
.
parse
(
response
);
console
.
log
(
"res"
,
res
);
console
.
log
(
"res"
,
res
);
this
.
selectModel
.
picture
=
res
.
filename
;
this
.
selectModel
.
picture
=
res
.
resultObject
;
swal
(
res
.
message
,
"บันทึกสำเร็จ"
,
"success"
);
swal
(
res
.
message
,
"บันทึกสำเร็จ"
,
"success"
);
console
.
log
(
'After Upload, selectModel is:'
,
this
.
selectModel
);
}
else
{
}
else
{
this
.
uploadErrorMsg
=
"cannot upload file."
;
this
.
uploadErrorMsg
=
"cannot upload file."
;
swal
(
"Opp!!"
,
"ไม่สามารถอัพโหลดได้"
,
"info"
);
swal
(
"Opp!!"
,
"ไม่สามารถอัพโหลดได้"
,
"info"
);
...
@@ -228,6 +229,7 @@ export class ArticleManageComponent {
...
@@ -228,6 +229,7 @@ export class ArticleManageComponent {
}
}
save
()
{
save
()
{
console
.
log
(
'Before Save, selectModel is:'
,
this
.
selectModel
);
swal
({
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
...
...
src/app/DPU/common/company-manage/company-manage.component.html
View file @
a9294f38
...
@@ -197,7 +197,7 @@
...
@@ -197,7 +197,7 @@
<span
class=
"avatar avatar-xxl avatar-rounded"
>
<span
class=
"avatar avatar-xxl avatar-rounded"
>
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<input
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
<input
(
click
)="
triggerFileInput
()"
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
</span>
</span>
...
...
src/app/DPU/common/company-manage/company-manage.component.ts
View file @
a9294f38
...
@@ -34,6 +34,7 @@ import { CompanyServiceS } from '../../services/companys.service';
...
@@ -34,6 +34,7 @@ import { CompanyServiceS } from '../../services/companys.service';
export
class
CompanyManageComponent
{
export
class
CompanyManageComponent
{
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
@
ViewChild
(
'profileChangeInput'
)
profileChangeInputRef
!
:
ElementRef
;
action
=
"new"
;
action
=
"new"
;
allSelected
=
false
;
allSelected
=
false
;
someSelected
=
false
;
someSelected
=
false
;
...
@@ -69,7 +70,7 @@ export class CompanyManageComponent {
...
@@ -69,7 +70,7 @@ export class CompanyManageComponent {
uploadConfig
()
{
uploadConfig
()
{
this
.
uploaderProfile
=
new
FileUploader
({
this
.
uploaderProfile
=
new
FileUploader
({
url
:
environment
.
baseUrl
+
"/
api
/upload-image"
,
url
:
environment
.
baseUrl
+
"/
files
/upload-image"
,
isHTML5
:
true
,
isHTML5
:
true
,
authToken
:
this
.
tokenService
.
getToken
()
!
,
authToken
:
this
.
tokenService
.
getToken
()
!
,
});
});
...
@@ -108,7 +109,7 @@ export class CompanyManageComponent {
...
@@ -108,7 +109,7 @@ export class CompanyManageComponent {
if
(
item
.
isSuccess
)
{
if
(
item
.
isSuccess
)
{
const
res
=
JSON
.
parse
(
response
);
const
res
=
JSON
.
parse
(
response
);
console
.
log
(
"res"
,
res
);
console
.
log
(
"res"
,
res
);
this
.
selectModel
.
photoGraph
=
res
.
filename
;
this
.
selectModel
.
photoGraph
=
res
.
resultObject
;
swal
(
res
.
message
,
"บันทึกสำเร็จ"
,
"success"
);
swal
(
res
.
message
,
"บันทึกสำเร็จ"
,
"success"
);
}
else
{
}
else
{
this
.
uploadErrorMsg
=
"cannot upload file."
;
this
.
uploadErrorMsg
=
"cannot upload file."
;
...
@@ -343,6 +344,11 @@ export class CompanyManageComponent {
...
@@ -343,6 +344,11 @@ export class CompanyManageComponent {
}
}
});
});
}
}
triggerFileInput
():
void
{
if
(
this
.
profileChangeInputRef
)
{
this
.
profileChangeInputRef
.
nativeElement
.
click
();
}
}
}
}
// import { Component, ElementRef, ViewChild } from '@angular/core';
// import { Component, ElementRef, ViewChild } from '@angular/core';
// import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
// import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
...
...
src/app/DPU/models/user.model.ts
View file @
a9294f38
...
@@ -96,7 +96,12 @@ export class UserProfileModel extends BaseModel {
...
@@ -96,7 +96,12 @@ export class UserProfileModel extends BaseModel {
}
}
getPicture
():
string
{
getPicture
():
string
{
return
this
.
picture
?
environment
.
baseUrl
+
'/images/'
+
this
.
picture
:
'./assets/images/faces/1.jpg'
;
if
(
this
.
picture
)
{
return
environment
.
baseUrl
+
"/files/image/"
+
this
.
picture
}
else
{
return
""
}
}
}
getFullname
():
string
{
getFullname
():
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment