mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
♻️ 剔除日历JSON冗余数据
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="tcm-box">
|
||||
<div class="tcm-left">
|
||||
<div class="tcm-bg"><img :src="item.bg" alt="bg" /></div>
|
||||
<div class="tcm-icon"><img :src="item.icon" alt="icon" /></div>
|
||||
<div class="tcm-bg"><img :src="`/icon/bg/${item.star}-Star.webp`" alt="bg" /></div>
|
||||
<div class="tcm-icon"><img :src="`/icon/material/${item.id}.webp`" alt="icon" /></div>
|
||||
<div class="tcm-star" v-if="item.star !== 0">
|
||||
<img :src="item.starIcon" alt="element" />
|
||||
<img :src="`/icon/star/${item.star}.webp`" alt="element" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tcm-right">{{ item.name }}</div>
|
||||
|
||||
@@ -51,16 +51,18 @@ const visible = computed<boolean>({
|
||||
set: (v) => emits("update:modelValue", v),
|
||||
});
|
||||
const boxData = computed<TItemBoxData>(() => ({
|
||||
bg: props.dataVal.bg,
|
||||
icon: props.dataVal.icon,
|
||||
bg: `/icon/bg/${props.dataVal.star}-Star.webp`,
|
||||
icon: `/WIKI/${props.dataType}/${props.dataVal.id}.webp`,
|
||||
size: "100px",
|
||||
height: "100px",
|
||||
display: "inner",
|
||||
clickable: false,
|
||||
lt: props.dataType === "character" ? (props.dataVal.elementIcon ?? "") : props.dataVal.weaponIcon,
|
||||
lt: props.dataVal.element
|
||||
? `/icon/element/${props.dataVal.element}元素.webp`
|
||||
: `/icon/weapon/${props.dataVal.weapon}.webp`,
|
||||
ltSize: "20px",
|
||||
innerHeight: 25,
|
||||
innerIcon: props.dataType === "character" ? props.dataVal.weaponIcon : undefined,
|
||||
innerIcon: props.dataVal.element ? `/icon/weapon/${props.dataVal.weapon}.webp` : undefined,
|
||||
innerText: props.dataVal.name,
|
||||
}));
|
||||
|
||||
|
||||
@@ -99,16 +99,18 @@ function selectItem(item: TGApp.App.Calendar.Item): void {
|
||||
|
||||
function getBoxData(item: TGApp.App.Calendar.Item): TItemBoxData {
|
||||
return {
|
||||
bg: item.bg,
|
||||
icon: item.icon,
|
||||
bg: `/icon/bg/${item.star}-Star.webp`,
|
||||
icon: `/WIKI/${item.itemType}/${item.id}.webp`,
|
||||
size: "100px",
|
||||
height: "100px",
|
||||
display: "inner",
|
||||
clickable: true,
|
||||
lt: selectedType.value === "weapon" ? item.weaponIcon : (item.elementIcon ?? ""),
|
||||
lt: item.element
|
||||
? `/icon/element/${item.element}元素.webp`
|
||||
: `/icon/weapon/${item.weapon}.webp`,
|
||||
ltSize: "20px",
|
||||
innerHeight: 25,
|
||||
innerIcon: selectedType.value === "character" ? item.weaponIcon : undefined,
|
||||
innerIcon: item.element ? `/icon/weapon/${item.weapon}.webp` : undefined,
|
||||
innerText: item.name,
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
46
src/types/App/Calendar.d.ts
vendored
46
src/types/App/Calendar.d.ts
vendored
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* @file types/App/Calendar.d.ts
|
||||
* @description 应用素材日历相关类型定义文件
|
||||
* @since Beta v0.3.8
|
||||
* @since Beta v0.6.7
|
||||
*/
|
||||
|
||||
declare namespace TGApp.App.Calendar {
|
||||
/**
|
||||
* @description 素材日历类型
|
||||
* @since Beta v0.3.8
|
||||
* @since Beta v0.6.7
|
||||
* @interface Item
|
||||
* @property {number} id - 角色ID/武器ID
|
||||
* @property {number} contentId - 观测枢的 content_id
|
||||
@@ -15,62 +15,44 @@ declare namespace TGApp.App.Calendar {
|
||||
* @property {string} name - 角色/武器名称
|
||||
* @property {string} itemType - 角色|武器
|
||||
* @property {number} star - 角色/武器星级
|
||||
* @property {string} bg - 日历项背景
|
||||
* @property {string} icon - 日历项图标
|
||||
* @property {string} weaponIcon - 武器类型图标
|
||||
* @property {string} elementIcon - 角色元素类型图标
|
||||
* @property {string} weapon - 武器类型图标
|
||||
* @property {string} element - 角色元素类型图标
|
||||
* @property {Material[]} materials - 日历项需要的素材
|
||||
* @property {Source} source - 日历项来源
|
||||
* @return Item
|
||||
*/
|
||||
interface Item {
|
||||
type Item = {
|
||||
id: number;
|
||||
contentId: number;
|
||||
dropDays: number[];
|
||||
itemType: string;
|
||||
name: string;
|
||||
itemType: string; // character | weapon
|
||||
star: number;
|
||||
bg: string;
|
||||
icon: string;
|
||||
weaponIcon: string;
|
||||
elementIcon?: string;
|
||||
weapon: string;
|
||||
element?: string;
|
||||
materials: Material[];
|
||||
source: Source;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 素材日历材料类型
|
||||
* @since Alpha v0.1.5
|
||||
* @since Beta v0.6.7
|
||||
* @interface Material
|
||||
* @property {number} id - 素材 ID
|
||||
* @property {string} name - 素材名称
|
||||
* @property {number} star - 素材星级
|
||||
* @property {string} starIcon - 素材星级图标
|
||||
* @property {string} bg - 素材背景
|
||||
* @property {string} icon - 素材图标
|
||||
* @return Material
|
||||
*/
|
||||
interface Material {
|
||||
id: number;
|
||||
name: string;
|
||||
star: number;
|
||||
starIcon: string;
|
||||
bg: string;
|
||||
icon: string;
|
||||
}
|
||||
type Material = { id: number; name: string; star: number };
|
||||
|
||||
/**
|
||||
* @description 素材日历来源类型
|
||||
* @since Alpha v0.1.5
|
||||
* @since Beta v0.6.7
|
||||
* @interface Source
|
||||
* @property {number} index - 来源索引
|
||||
* @property {string} area - 来源区域
|
||||
* @property {string} icon - 来源图标
|
||||
* @property {string} name - 来源名称
|
||||
* @return Source
|
||||
*/
|
||||
interface Source {
|
||||
area: string;
|
||||
icon: string;
|
||||
name: string;
|
||||
}
|
||||
type Source = { index: number; area: string; name: string };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user