fix: 감찰부 장수 변경시 tooltip 빈칸 버그
This commit is contained in:
@@ -14,10 +14,11 @@
|
|||||||
backgroundColor: nation.color,
|
backgroundColor: nation.color,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ general.name }} 【 <template v-if="2 <= general.officerLevel && general.officerLevel <= 4 && general.officer_city">
|
{{ general.name }} 【
|
||||||
|
<template v-if="2 <= general.officerLevel && general.officerLevel <= 4 && general.officer_city">
|
||||||
{{ formatCityName(general.officer_city, gameConstStore) }}
|
{{ formatCityName(general.officer_city, gameConstStore) }}
|
||||||
</template>
|
</template>
|
||||||
{{ general.officerLevelText }} | {{ generalTypeCall }} |
|
{{ general.officerLevelText }} | {{ generalTypeCall }} |
|
||||||
<span :style="{ color: injuryInfo.color }">{{ injuryInfo.text }}</span>
|
<span :style="{ color: injuryInfo.color }">{{ injuryInfo.text }}</span>
|
||||||
】 {{ general.turntime.substring(11, 19) }}
|
】 {{ general.turntime.substring(11, 19) }}
|
||||||
</div>
|
</div>
|
||||||
@@ -59,18 +60,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg1">명마</div>
|
<div class="bg1">명마</div>
|
||||||
<div v-b-tooltip.hover :title="horse.info ?? undefined">{{ horse.name }}</div>
|
<div v-b-tooltip.hover :title="horse.info ?? '-'">{{ horse.name }}</div>
|
||||||
<div class="bg1">무기</div>
|
<div class="bg1">무기</div>
|
||||||
<div v-b-tooltip.hover :title="weapon.info ?? undefined">{{ weapon.name }}</div>
|
<div v-b-tooltip.hover :title="weapon.info ?? '-'">{{ weapon.name }}</div>
|
||||||
<div class="bg1">서적</div>
|
<div class="bg1">서적</div>
|
||||||
<div v-b-tooltip.hover :title="book.info ?? undefined">{{ book.name }}</div>
|
<div v-b-tooltip.hover :title="book.info ?? '-'">{{ book.name }}</div>
|
||||||
|
|
||||||
<div class="bg1">자금</div>
|
<div class="bg1">자금</div>
|
||||||
<div>{{ general.gold.toLocaleString() }}</div>
|
<div>{{ general.gold.toLocaleString() }}</div>
|
||||||
<div class="bg1">군량</div>
|
<div class="bg1">군량</div>
|
||||||
<div>{{ general.rice.toLocaleString() }}</div>
|
<div>{{ general.rice.toLocaleString() }}</div>
|
||||||
<div class="bg1">도구</div>
|
<div class="bg1">도구</div>
|
||||||
<div v-b-tooltip.hover :title="item.info ?? undefined">{{ item.name }}</div>
|
<div v-b-tooltip.hover :title="item.info ?? '-'">{{ item.name }}</div>
|
||||||
|
|
||||||
<!-- TODO: show_img_level을 고려 -->
|
<!-- TODO: show_img_level을 고려 -->
|
||||||
<div
|
<div
|
||||||
@@ -81,11 +82,11 @@
|
|||||||
></div>
|
></div>
|
||||||
|
|
||||||
<div class="bg1">병종</div>
|
<div class="bg1">병종</div>
|
||||||
<div v-b-tooltip.hover :title="crewtype.info ?? undefined">{{ crewtype.name }}</div>
|
<div v-b-tooltip.hover :title="crewtype.info ?? '-'">{{ crewtype.name }}</div>
|
||||||
<div class="bg1">병사</div>
|
<div class="bg1">병사</div>
|
||||||
<div>{{ general.crew.toLocaleString() }}</div>
|
<div>{{ general.crew.toLocaleString() }}</div>
|
||||||
<div class="bg1">성격</div>
|
<div class="bg1">성격</div>
|
||||||
<div v-b-tooltip.hover :title="personal.info ?? undefined">{{ personal.name }}</div>
|
<div v-b-tooltip.hover :title="personal.info ?? '-'">{{ personal.name }}</div>
|
||||||
|
|
||||||
<!-- TODO: bonusTrain 같은 개념이 필요 -->
|
<!-- TODO: bonusTrain 같은 개념이 필요 -->
|
||||||
<div class="bg1">훈련</div>
|
<div class="bg1">훈련</div>
|
||||||
@@ -94,8 +95,8 @@
|
|||||||
<div>{{ general.atmos }}</div>
|
<div>{{ general.atmos }}</div>
|
||||||
<div class="bg1">특기</div>
|
<div class="bg1">특기</div>
|
||||||
<div>
|
<div>
|
||||||
<span v-b-tooltip.hover :title="specialDomestic.info ?? undefined"> {{ specialDomestic.name }}</span> /
|
<span v-b-tooltip.hover :title="specialDomestic.info ?? '-'"> {{ specialDomestic.name }}</span> /
|
||||||
<span v-b-tooltip.hover :title="specialWar.info ?? undefined"> {{ specialWar.name }}</span>
|
<span v-b-tooltip.hover :title="specialWar.info ?? '-'"> {{ specialWar.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg1">Lv</div>
|
<div class="bg1">Lv</div>
|
||||||
@@ -161,6 +162,7 @@ import SammoBar from "@/components/SammoBar.vue";
|
|||||||
import { parseTime } from "@/util/parseTime";
|
import { parseTime } from "@/util/parseTime";
|
||||||
import { clamp } from "lodash";
|
import { clamp } from "lodash";
|
||||||
import { formatCityName } from "@/utilGame/formatCityName";
|
import { formatCityName } from "@/utilGame/formatCityName";
|
||||||
|
import { isValidObjKey } from "@/utilGame/isValidObjKey";
|
||||||
const imagePath = window.pathConfig.gameImage;
|
const imagePath = window.pathConfig.gameImage;
|
||||||
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
|
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -190,35 +192,55 @@ const generalTypeCall = computed(() =>
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const horse = computed(
|
const horse = computed(() =>
|
||||||
() => gameConstStore.value.iActionInfo.item[general.value.horse] ?? { value: "None", name: "-" }
|
isValidObjKey(general.value.horse)
|
||||||
|
? gameConstStore.value.iActionInfo.item[general.value.horse]
|
||||||
|
: { value: "None", name: "-", info: "" }
|
||||||
);
|
);
|
||||||
const weapon = computed(
|
const weapon = computed(() =>
|
||||||
() => gameConstStore.value.iActionInfo.item[general.value.weapon] ?? { value: "None", name: "-" }
|
isValidObjKey(general.value.weapon)
|
||||||
|
? gameConstStore.value.iActionInfo.item[general.value.weapon]
|
||||||
|
: { value: "None", name: "-", info: "" }
|
||||||
);
|
);
|
||||||
const book = computed(() => gameConstStore.value.iActionInfo.item[general.value.book] ?? { value: "None", name: "-" });
|
const book = computed(() =>
|
||||||
const item = computed(() => gameConstStore.value.iActionInfo.item[general.value.item] ?? { value: "None", name: "-" });
|
isValidObjKey(general.value.book)
|
||||||
|
? gameConstStore.value.iActionInfo.item[general.value.book]
|
||||||
const crewtype = computed(
|
: { value: "None", name: "-", info: "" }
|
||||||
() => gameConstStore.value.iActionInfo.crewtype[general.value.crewtype] ?? { value: "None", name: "-" }
|
);
|
||||||
|
const item = computed(() =>
|
||||||
|
isValidObjKey(general.value.item)
|
||||||
|
? gameConstStore.value.iActionInfo.item[general.value.item]
|
||||||
|
: { value: "None", name: "-", info: "" }
|
||||||
);
|
);
|
||||||
|
|
||||||
const personal = computed(
|
const crewtype = computed(() =>
|
||||||
() => gameConstStore.value.iActionInfo.personality[general.value.personal] ?? { value: "None", name: "-" }
|
isValidObjKey(general.value.crewtype)
|
||||||
|
? gameConstStore.value.iActionInfo.crewtype[general.value.crewtype]
|
||||||
|
: { value: "None", name: "-", info: "-" }
|
||||||
);
|
);
|
||||||
const specialDomestic = computed(
|
|
||||||
() =>
|
const personal = computed(() =>
|
||||||
gameConstStore.value.iActionInfo.specialDomestic[general.value.specialDomestic] ?? {
|
isValidObjKey(general.value.personal)
|
||||||
value: "None",
|
? gameConstStore.value.iActionInfo.personality[general.value.personal]
|
||||||
name: `${general.value.specage}세`,
|
: { value: "None", name: "-", info: "-" }
|
||||||
}
|
|
||||||
);
|
);
|
||||||
const specialWar = computed(
|
const specialDomestic = computed(() =>
|
||||||
() =>
|
isValidObjKey(general.value.specialDomestic)
|
||||||
gameConstStore.value.iActionInfo.specialWar[general.value.specialWar] ?? {
|
? gameConstStore.value.iActionInfo.specialDomestic[general.value.specialDomestic]
|
||||||
value: "None",
|
: {
|
||||||
name: `${general.value.specage2}세`,
|
value: "None",
|
||||||
}
|
name: `${Math.max(general.value.age + 1, general.value.specage)}세`,
|
||||||
|
info: '-',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const specialWar = computed(() =>
|
||||||
|
isValidObjKey(general.value.specialWar)
|
||||||
|
? gameConstStore.value.iActionInfo.specialWar[general.value.specialWar]
|
||||||
|
: {
|
||||||
|
value: "None",
|
||||||
|
name: `${Math.max(general.value.age + 1, general.value.specage2)}세`,
|
||||||
|
info: '-',
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const ageColor = computed(() => {
|
const ageColor = computed(() => {
|
||||||
@@ -252,7 +274,9 @@ onMounted(() => {
|
|||||||
border-bottom: 1px solid gray;
|
border-bottom: 1px solid gray;
|
||||||
border-right: 1px solid gray;
|
border-right: 1px solid gray;
|
||||||
|
|
||||||
> div.bg1, > .general-crew-type-icon, > .general-icon {
|
> div.bg1,
|
||||||
|
> .general-crew-type-icon,
|
||||||
|
> .general-icon {
|
||||||
border-left: 1px solid gray;
|
border-left: 1px solid gray;
|
||||||
}
|
}
|
||||||
> div {
|
> div {
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export function isValidObjKey<T>(key: T|'None'|undefined|null): boolean{
|
||||||
|
if(key === 'None' || key === undefined || key === null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user