fix:bug showload profile
This commit is contained in:
parent
91c870955b
commit
b0b16131ab
4 changed files with 51 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ import type {
|
|||
DataOptionSys,
|
||||
} from "@/modules/04_registryPerson/interface/index/Main";
|
||||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
||||
import { s } from "@fullcalendar/core/internal-common";
|
||||
|
||||
/** importComponents*/
|
||||
const CardNotPermission = defineAsyncComponent(
|
||||
|
|
@ -178,6 +179,9 @@ function imageActive(n: any) {
|
|||
* @param file ไฟล์รูป
|
||||
*/
|
||||
function resizeImage(file: File): Promise<File> {
|
||||
if (!file) {
|
||||
return Promise.reject("No file provided");
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
const reader = new FileReader();
|
||||
|
|
@ -240,9 +244,9 @@ const newProfileFile = ref<any>(null);
|
|||
|
||||
/** ฟังก์ชันอัปโหลด*/
|
||||
async function uploadImg() {
|
||||
showLoader();
|
||||
newProfileFile.value = await resizeImage(profileFile.value);
|
||||
closeImage();
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgProfileAvatarbyType(empType.value), {
|
||||
profileId: empType.value == "" ? profileId.value : undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue