Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/widgets/EquipList/components/ETag.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<script setup lang="ts">
import { NTooltip } from "naive-ui";

import { getLanguage } from "@/utils/i18n";

import { tagIconFavor, tagIconOther } from "../consts";
import { customLabel } from "../i18n";
import { customLabel, tagIconFavor, tagIconOther } from "../consts";

defineProps<{
type: "lv" | "favor" | "mission";
Expand Down Expand Up @@ -52,13 +49,13 @@ const getIconSrc = (type: string) => {
</div>
</template>
<div v-if="type === 'lv'">
{{ customLabel[getLanguage()].equipString.condLv }}
{{ customLabel.equipString.condLv }}
</div>
<div v-if="type === 'favor'">
{{ customLabel[getLanguage()].equipString.condTrust }}
{{ customLabel.equipString.condTrust }}
</div>
<div v-if="type === 'mission'">
{{ customLabel[getLanguage()].equipString.condMission }}
{{ customLabel.equipString.condMission }}
</div>
</NTooltip>
</template>
30 changes: 9 additions & 21 deletions src/widgets/EquipList/components/Equip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import {

import { NSpin } from "naive-ui";

import { getLanguage } from "@/utils/i18n";
import { useTheme } from "@/utils/theme";
import { getImagePath, isMobile } from "@/utils/utils";

import { colorMap, statsStyleMap } from "../consts";
import { colorMap, customLabel, statsStyleMap } from "../consts";
import { getEquipData } from "../equipData";
import { customLabel } from "../i18n";
import {
fixAtkRange,
processLink,
Expand Down Expand Up @@ -97,7 +95,6 @@ onBeforeUpdate(() => {
updateTippy();
handleDark();
});
const locale = getLanguage();
const isLatest = (e: string | undefined) => e && e === "yes";
const modeStats = () => props.simplemode === "stats";
const modeMission = () => props.simplemode === "mission";
Expand All @@ -116,7 +113,7 @@ const modeMission = () => props.simplemode === "mission";
:class="{ nosimple: !simple || !isLatest(e.latest) }"
>
<span class="w-full color-white font-bold">
{{ customLabel[locale].equipString.latest }}
{{ customLabel.equipString.latest }}
</span>
</div>
<div class="basicbox" :class="{ nosimple: simple }">
Expand Down Expand Up @@ -153,10 +150,7 @@ const modeMission = () => props.simplemode === "mission";
</div>
<div class="rankinfo">
<div class="ranktext">
<span
v-for="stats in customLabel[locale].statsMap"
:key="stats[0]"
>
<span v-for="stats in customLabel.statsMap" :key="stats[0]">
<span
v-if="e[stats[0]] !== '0'"
class="mx-[0.5em] whitespace-nowrap"
Expand Down Expand Up @@ -205,10 +199,7 @@ const modeMission = () => props.simplemode === "mission";
</div>
<div class="rankinfo">
<div class="ranktext">
<span
v-for="stats in customLabel[locale].statsMap"
:key="stats[0]"
>
<span v-for="stats in customLabel.statsMap" :key="stats[0]">
<span
v-if="e[`${stats[0]}2`] !== '0'"
class="mx-[0.5em] whitespace-nowrap"
Expand Down Expand Up @@ -249,10 +240,7 @@ const modeMission = () => props.simplemode === "mission";
</div>
<div class="rankinfo">
<div class="ranktext">
<span
v-for="stats in customLabel[locale].statsMap"
:key="stats[0]"
>
<span v-for="stats in customLabel.statsMap" :key="stats[0]">
<span
v-if="e[`${stats[0]}3`] !== '0'"
class="mx-[0.5em] whitespace-nowrap"
Expand Down Expand Up @@ -282,7 +270,7 @@ const modeMission = () => props.simplemode === "mission";
<div class="majorsep" :class="{ nosimple: simple }"></div>
<div class="linebox" :class="{ nosimple: simple && !modeMission() }">
<div class="descr font-bold" :class="{ nosimple: simple }">
{{ customLabel[locale].equipString.mission }}
{{ customLabel.equipString.mission }}
</div>
<div class="lineparta flex-col">
<span v-if="!!e.mission1">
Expand All @@ -297,14 +285,14 @@ const modeMission = () => props.simplemode === "mission";
</span>
<span v-if="!e.mission1 && !e.mission2">
<span class="mdi mdi-clipboard-off-outline"></span>
{{ customLabel[locale].equipString.nomission }}
{{ customLabel.equipString.nomission }}
</span>
</div>
</div>
<div class="majorsep" :class="{ nosimple: simple }"></div>
<div class="linebox" :class="{ nosimple: simple }">
<div class="descr font-bold" :class="{ nosimple: simple }">
{{ customLabel[locale].equipString.condition }}
{{ customLabel.equipString.condition }}
</div>
<div class="lineparta flex-wrap">
<div class="linebox flex-col">
Expand Down Expand Up @@ -382,7 +370,7 @@ const modeMission = () => props.simplemode === "mission";
</div>
</div>
</div>
<template #description> {{ customLabel[locale].loading }} </template>
<template #description> {{ customLabel.loading }} </template>
</NSpin>
</template>

Expand Down
8 changes: 2 additions & 6 deletions src/widgets/EquipList/components/EquipGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { computed } from "vue";

import { NEmpty } from "naive-ui";

import { getLanguage } from "@/utils/i18n";

import { customLabel } from "../i18n";
import { customLabel } from "../consts";

import SubContainer from "./SubContainer.vue";

Expand Down Expand Up @@ -86,8 +84,6 @@ const groupedEquipData = computed<Record<string, CharEquips[]>>(() => {
}
return result;
});

const locale = getLanguage();
</script>

<template>
Expand All @@ -102,7 +98,7 @@ const locale = getLanguage();
</div>
<NEmpty
v-if="Object.keys(groupedEquipData).length === 0"
:description="customLabel[locale].emptyDesc"
:description="customLabel.emptyDesc"
>
<template #icon>
<span class="mdi mdi-account-filter-outline text-5xl" />
Expand Down
6 changes: 2 additions & 4 deletions src/widgets/EquipList/components/EquipTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { h, inject, type Ref, ref, watch } from "vue";

import { type DataTableColumns, NDataTable } from "naive-ui";

import { getLanguage } from "@/utils/i18n";
import { getImagePath, isMobile } from "@/utils/utils";

import { customLabel } from "../i18n";
import { customLabel } from "../consts";

import Equip from "./Equip.vue";

Expand Down Expand Up @@ -95,14 +94,13 @@ const props = defineProps<{
data: EquipRow[];
}>();

const locale = getLanguage();
const pickSize = (): "small" | "medium" => {
return isMobile() ? "small" : "medium";
};
const pagination = ref({
page: 1,
pageSize: 10,
pageSizes: customLabel[locale].pagination,
pageSizes: customLabel.pagination,
pageSlot: isMobile() ? 5 : 9,
size: pickSize(),
showSizePicker: true,
Expand Down
8 changes: 3 additions & 5 deletions src/widgets/EquipList/components/SubContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { NCard } from "naive-ui";
import { getLanguage } from "@/utils/i18n";
import { getImagePath } from "@/utils/utils";

import { customLabel } from "../i18n";

import SubAvatar from "./SubAvatar.vue";

import type { CharEquips } from "../types";
Expand Down Expand Up @@ -65,9 +63,9 @@ const locale = getLanguage();
:src="getImagePath(`职业分支图标_${title}.png`)"
/>
</span>
<span class="inline-block text-center" style="width: 7em">{{
customLabel[locale].subtypeMap[title] ?? title
}}</span>
<span class="inline-block text-center" style="width: 7em">
{{ title }}
</span>
</div>
<div v-if="groupby === 'time'">
{{ new Date(Number(title) * 1000).toLocaleDateString(locale) }}
Expand Down
Loading
Loading