修正預覽2D圖片時的錯誤 | 登入UI修改

This commit is contained in:
koko 2025-08-21 14:07:36 +08:00
parent 5ba844e307
commit 8243900f96
4 changed files with 17 additions and 18 deletions

View File

@ -84,8 +84,8 @@ const useBuildingStore = defineStore("buildingInfo", () => {
// 獲取2D、3D顯示與否 // 獲取2D、3D顯示與否
const fetchDashboard2D3D = async (BuildingId) => { const fetchDashboard2D3D = async (BuildingId) => {
const res = await getDashboard2D3D(BuildingId); const res = await getDashboard2D3D(BuildingId);
showForgeArea.value = res.data.is3DEnabled || false; showForgeArea.value = res.data?.is3DEnabled || false;
previewImageExt.value = res.data.previewImageExt || ""; previewImageExt.value = res.data?.previewImageExt || "";
}; };
// 清除localStorage建築物 // 清除localStorage建築物

View File

@ -41,12 +41,12 @@ watch(
); );
watch( watch(
() => store.previewImageExt, [() => store.previewImageExt, () => formState.value.building_guid],
(newExt) => { ([newExt, buildingGuid]) => {
if (formState.value.building_guid) { if (newExt && buildingGuid) {
imgBaseUrl.value = newExt imgBaseUrl.value = `${FILE_BASEURL}/upload/setting/previewImage/${buildingGuid}${newExt}`;
? `${FILE_BASEURL}/upload/setting/previewImage/${formState.value.building_guid}${newExt}` } else {
: "/build_img.jpg"; imgBaseUrl.value = `${FILE_BASEURL}/upload/build_img.jpg`;
} }
}, },
{ immediate: true } { immediate: true }

View File

@ -54,7 +54,7 @@ const doLogin = async () => {
<template> <template>
<div <div
class="absolute top-10 left-1/2 -translate-x-1/2 z-20 border-4 rounded-3xl p-5 bg-white bg-opacity-60" class="absolute top-10 left-1/2 -translate-x-1/2 z-20 border-2 border-slate-200/40 shadow-lg shadow-slate-100/20 rounded-3xl p-5 bg-gradient-to-br from-slate-600 to-slate-800 bg-opacity-60"
> >
<div class="flex flex-col items-start w-96"> <div class="flex flex-col items-start w-96">
<div <div
@ -65,7 +65,7 @@ const doLogin = async () => {
</div> </div>
<div class="w-full flex flex-col items-end my-2"> <div class="w-full flex flex-col items-end my-2">
<div class="w-full flex justify-between"> <div class="w-full flex justify-between">
<label class="mr-2 text-2xl text-black" for="account">{{ <label class="mr-2 text-2xl text-slate-200" for="account">{{
$t("account") $t("account")
}}</label> }}</label>
<input <input
@ -81,7 +81,7 @@ const doLogin = async () => {
</div> </div>
<div class="w-full flex flex-col items-end my-2"> <div class="w-full flex flex-col items-end my-2">
<div class="w-full flex justify-between relative"> <div class="w-full flex justify-between relative">
<label class="mr-2 text-2xl text-black" for="password">{{ <label class="mr-2 text-2xl text-slate-200" for="password">{{
$t("password") $t("password")
}}</label> }}</label>
<input <input

View File

@ -138,14 +138,13 @@ watch(
} }
); );
watch( watch(
() => buildingStore.previewImageExt, [() => buildingStore.previewImageExt, () => buildingStore.selectedBuilding?.building_guid],
(newValue) => { ([newExt, buildingGuid]) => {
if (buildingStore.selectedBuilding && buildingStore.selectedBuilding.building_guid) { if (newExt && buildingGuid) {
imgBaseUrl.value = buildingStore.previewImageExt imgBaseUrl.value = `${FILE_BASEURL}/upload/setting/previewImage/${buildingGuid}${newExt}`;
? `${FILE_BASEURL}/upload/setting/previewImage/${buildingStore.selectedBuilding.building_guid}${newValue}` } else {
: "/build_img.jpg"; imgBaseUrl.value = `${FILE_BASEURL}/upload/build_img.jpg`;
} }
}, },
{ immediate: true } { immediate: true }