fixing logo & banner recruiting
This commit is contained in:
parent
84ae839226
commit
8f3e1b0973
1 changed files with 26 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, nextTick } from "vue";
|
||||||
import type {
|
import type {
|
||||||
WebType,
|
WebType,
|
||||||
AddressWeb,
|
AddressWeb,
|
||||||
|
|
@ -398,9 +398,11 @@ const fetchData = async () => {
|
||||||
address.value.code = data.zipCode;
|
address.value.code = data.zipCode;
|
||||||
if (data.bannerImg) {
|
if (data.bannerImg) {
|
||||||
imageUrl.value = data.bannerImg.detail;
|
imageUrl.value = data.bannerImg.detail;
|
||||||
|
checkFileBanner();
|
||||||
}
|
}
|
||||||
if (data.logoImg) {
|
if (data.logoImg) {
|
||||||
imageUrlLogo.value = data.logoImg.detail;
|
imageUrlLogo.value = data.logoImg.detail;
|
||||||
|
checkFileLogo();
|
||||||
}
|
}
|
||||||
address.value.provinceId = data.provinceId;
|
address.value.provinceId = data.provinceId;
|
||||||
address.value.districtId = data.districtId;
|
address.value.districtId = data.districtId;
|
||||||
|
|
@ -634,6 +636,26 @@ const clickImage = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const checkLogoExits = ref<boolean>(false);
|
||||||
|
const checkFileLogo = async () => {
|
||||||
|
try {
|
||||||
|
const response = await fetch(imageUrlLogo.value, { method: "GET" });
|
||||||
|
checkLogoExits.value = response.ok;
|
||||||
|
} catch (error) {
|
||||||
|
checkLogoExits.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const checkBannerExits = ref<boolean>(false);
|
||||||
|
const checkFileBanner = async () => {
|
||||||
|
try {
|
||||||
|
const response = await fetch(imageUrl.value, { method: "GET" });
|
||||||
|
checkBannerExits.value = response.ok;
|
||||||
|
} catch (error) {
|
||||||
|
checkBannerExits.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const uploadImageLogo = (e: any) => {
|
const uploadImageLogo = (e: any) => {
|
||||||
let input = e.target.files;
|
let input = e.target.files;
|
||||||
if (input.length > 0) {
|
if (input.length > 0) {
|
||||||
|
|
@ -667,6 +689,7 @@ const getClass = (val: boolean) => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
ตั้งค่าเว็บไซต์ระบบสรรหา
|
ตั้งค่าเว็บไซต์ระบบสรรหา
|
||||||
|
|
@ -691,7 +714,7 @@ const getClass = (val: boolean) => {
|
||||||
<q-img
|
<q-img
|
||||||
class="rounded-borders"
|
class="rounded-borders"
|
||||||
:src="
|
:src="
|
||||||
imageUrlLogo !== null
|
imageUrlLogo !== null && checkLogoExits
|
||||||
? imageUrlLogo
|
? imageUrlLogo
|
||||||
: 'https://cdn.quasar.dev/img/image-src.png'
|
: 'https://cdn.quasar.dev/img/image-src.png'
|
||||||
"
|
"
|
||||||
|
|
@ -727,7 +750,7 @@ const getClass = (val: boolean) => {
|
||||||
<q-img
|
<q-img
|
||||||
class="rounded-borders full-width"
|
class="rounded-borders full-width"
|
||||||
:src="
|
:src="
|
||||||
imageUrl !== null
|
imageUrl !== null && checkBannerExits
|
||||||
? imageUrl
|
? imageUrl
|
||||||
: 'https://cdn.quasar.dev/img/image-src.png'
|
: 'https://cdn.quasar.dev/img/image-src.png'
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue