Merge branch 'oat_dev' into develop

This commit is contained in:
oat_dev 2024-03-20 15:50:14 +07:00
commit 170c2b323e

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, reactive } from "vue";
import axios from "axios"; import axios from "axios";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -55,7 +55,6 @@ const itemsMenu = ref<DataOption[]>([
]); ]);
const uploadUrl = ref<string>(""); const uploadUrl = ref<string>("");
// const testFile = ref<File | null>(null);
const fileName = ref<string>(""); const fileName = ref<string>("");
const profilePicture = ref<string>(""); const profilePicture = ref<string>("");
const profileFile = ref(); const profileFile = ref();
@ -72,11 +71,6 @@ function selectFile() {
input.click(); input.click();
} }
// watch(
// () => testFile.value,
// () => uploadProfile()
// );
async function uploadProfile() { async function uploadProfile() {
await http await http
.post(config.API.file("ทะเบียนประวัติ", "โปรไฟล์", profileId.value), { .post(config.API.file("ทะเบียนประวัติ", "โปรไฟล์", profileId.value), {
@ -124,31 +118,30 @@ async function fetchProfile(id: string) {
await http await http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
.then(async (res) => { .then(async (res) => {
console.log(res.data);
profilePicture.value = res.data.downloadUrl; profilePicture.value = res.data.downloadUrl;
}) })
.catch((err) => { .catch(() => {
profilePicture.value = avatar; profilePicture.value = avatar;
console.log(profilePicture.value);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
function fetchDataPersonal() { async function fetchDataPersonal() {
const data = { showLoader();
id: "1526d9d3-d8b1-43ab-81b5-a84dfbe99201", await http
prefix: "นาย", .get(config.API.registryNewByProfileId(profileId.value))
firstName: "ณัฐพงศ์", .then((res) => {
lastName: "ดิษยบุตร", formDetail.value = res.data.result;
citizenId: "0000000000001", console.log(formDetail.value);
position: "นักบริหาร", })
posLevelId: "1526d9d3-d8b1-43ab-81b5-a84dfbe09362", .catch((err) => {
posTypeId: "1526d9d3-d8b1-43ab-81b5-a84dfbe08091", messageError($q, err);
}; })
.finally(() => {
formDetail.value = data; hideLoader();
});
} }
function onClickDownloadKp7(type: string) { function onClickDownloadKp7(type: string) {
@ -268,7 +261,7 @@ onMounted(async () => {
</div> </div>
<div class="col-2"> <div class="col-2">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<div class="col text-grey-6">ระดบตำแหน</div> <div class="col text-grey-6">ระดบตำแหน</div>
<div class="col">ชำนาญการพเศษ</div> <div class="col">ชำนาญการพเศษ</div>
</div> </div>
</div> </div>