🏷️ 采用枚举类

This commit is contained in:
BTMuli
2026-03-25 18:31:51 +08:00
parent 47029ce802
commit 789b388a6f
4 changed files with 59 additions and 14 deletions

View File

@@ -30,6 +30,7 @@
<script lang="ts" setup>
import TItembox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
import TMiImg from "@comp/app/t-mi-img.vue";
import gameEnum from "@enum/game.js";
import { getRcStar, getWikiBrief, getZhElement } from "@utils/toolFunc.js";
type TucAeBoxProps = {
@@ -43,7 +44,7 @@ const props = defineProps<TucAeBoxProps>();
function getAvatarBox(item: TGApp.Game.Combat.Avatar): TItemBoxData {
const findAvatar = getWikiBrief(item.avatar_id);
let innerText = item.avatar_type === 2 ? "试用角色" : item.avatar_type === 3 ? "助演角色" : "";
let innerText = gameEnum.combat.avatarTypeDesc(item.avatar_type);
let findWeapon;
if (findAvatar) {
findWeapon = findAvatar.weapon;

View File

@@ -6,6 +6,7 @@
</template>
<script lang="ts" setup>
import TItemBox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
import gameEnum from "@enum/game.js";
import { getRcStar, getWikiBrief, getZhElement } from "@utils/toolFunc.js";
type TucAvatarsProps = { modelValue: Array<TGApp.Game.Combat.Avatar>; detail: boolean };
@@ -14,7 +15,7 @@ const props = defineProps<TucAvatarsProps>();
function getItemBox(item: TGApp.Game.Combat.Avatar): TItemBoxData {
const findAvatar = getWikiBrief(item.avatar_id);
let innerText = item.avatar_type === 2 ? "试用角色" : item.avatar_type === 3 ? "助演角色" : "";
let innerText = gameEnum.combat.avatarTypeDesc(item.avatar_type);
let findWeapon;
if (findAvatar) {
findWeapon = findAvatar.weapon;