♻️ 剔除日历JSON冗余数据

This commit is contained in:
目棃
2024-12-31 11:09:22 +08:00
parent a98cb5dbd1
commit 4cfb19dc21
5 changed files with 1777 additions and 11353 deletions

View File

@@ -1,10 +1,10 @@
<template> <template>
<div class="tcm-box"> <div class="tcm-box">
<div class="tcm-left"> <div class="tcm-left">
<div class="tcm-bg"><img :src="item.bg" alt="bg" /></div> <div class="tcm-bg"><img :src="`/icon/bg/${item.star}-Star.webp`" alt="bg" /></div>
<div class="tcm-icon"><img :src="item.icon" alt="icon" /></div> <div class="tcm-icon"><img :src="`/icon/material/${item.id}.webp`" alt="icon" /></div>
<div class="tcm-star" v-if="item.star !== 0"> <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> </div>
<div class="tcm-right">{{ item.name }}</div> <div class="tcm-right">{{ item.name }}</div>

View File

@@ -51,16 +51,18 @@ const visible = computed<boolean>({
set: (v) => emits("update:modelValue", v), set: (v) => emits("update:modelValue", v),
}); });
const boxData = computed<TItemBoxData>(() => ({ const boxData = computed<TItemBoxData>(() => ({
bg: props.dataVal.bg, bg: `/icon/bg/${props.dataVal.star}-Star.webp`,
icon: props.dataVal.icon, icon: `/WIKI/${props.dataType}/${props.dataVal.id}.webp`,
size: "100px", size: "100px",
height: "100px", height: "100px",
display: "inner", display: "inner",
clickable: false, 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", ltSize: "20px",
innerHeight: 25, 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, innerText: props.dataVal.name,
})); }));

View File

@@ -99,16 +99,18 @@ function selectItem(item: TGApp.App.Calendar.Item): void {
function getBoxData(item: TGApp.App.Calendar.Item): TItemBoxData { function getBoxData(item: TGApp.App.Calendar.Item): TItemBoxData {
return { return {
bg: item.bg, bg: `/icon/bg/${item.star}-Star.webp`,
icon: item.icon, icon: `/WIKI/${item.itemType}/${item.id}.webp`,
size: "100px", size: "100px",
height: "100px", height: "100px",
display: "inner", display: "inner",
clickable: true, 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", ltSize: "20px",
innerHeight: 25, innerHeight: 25,
innerIcon: selectedType.value === "character" ? item.weaponIcon : undefined, innerIcon: item.element ? `/icon/weapon/${item.weapon}.webp` : undefined,
innerText: item.name, innerText: item.name,
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
/** /**
* @file types/App/Calendar.d.ts * @file types/App/Calendar.d.ts
* @description 应用素材日历相关类型定义文件 * @description 应用素材日历相关类型定义文件
* @since Beta v0.3.8 * @since Beta v0.6.7
*/ */
declare namespace TGApp.App.Calendar { declare namespace TGApp.App.Calendar {
/** /**
* @description 素材日历类型 * @description 素材日历类型
* @since Beta v0.3.8 * @since Beta v0.6.7
* @interface Item * @interface Item
* @property {number} id - 角色ID/武器ID * @property {number} id - 角色ID/武器ID
* @property {number} contentId - 观测枢的 content_id * @property {number} contentId - 观测枢的 content_id
@@ -15,62 +15,44 @@ declare namespace TGApp.App.Calendar {
* @property {string} name - 角色/武器名称 * @property {string} name - 角色/武器名称
* @property {string} itemType - 角色|武器 * @property {string} itemType - 角色|武器
* @property {number} star - 角色/武器星级 * @property {number} star - 角色/武器星级
* @property {string} bg - 日历项背景 * @property {string} weapon - 武器类型图标
* @property {string} icon - 日历项图标 * @property {string} element - 角色元素类型图标
* @property {string} weaponIcon - 武器类型图标
* @property {string} elementIcon - 角色元素类型图标
* @property {Material[]} materials - 日历项需要的素材 * @property {Material[]} materials - 日历项需要的素材
* @property {Source} source - 日历项来源 * @property {Source} source - 日历项来源
* @return Item * @return Item
*/ */
interface Item { type Item = {
id: number; id: number;
contentId: number; contentId: number;
dropDays: number[]; dropDays: number[];
itemType: string;
name: string; name: string;
itemType: string; // character | weapon
star: number; star: number;
bg: string; weapon: string;
icon: string; element?: string;
weaponIcon: string;
elementIcon?: string;
materials: Material[]; materials: Material[];
source: Source; source: Source;
} };
/** /**
* @description 素材日历材料类型 * @description 素材日历材料类型
* @since Alpha v0.1.5 * @since Beta v0.6.7
* @interface Material * @interface Material
* @property {number} id - 素材 ID * @property {number} id - 素材 ID
* @property {string} name - 素材名称 * @property {string} name - 素材名称
* @property {number} star - 素材星级 * @property {number} star - 素材星级
* @property {string} starIcon - 素材星级图标
* @property {string} bg - 素材背景
* @property {string} icon - 素材图标
* @return Material * @return Material
*/ */
interface Material { type Material = { id: number; name: string; star: number };
id: number;
name: string;
star: number;
starIcon: string;
bg: string;
icon: string;
}
/** /**
* @description 素材日历来源类型 * @description 素材日历来源类型
* @since Alpha v0.1.5 * @since Beta v0.6.7
* @interface Source * @interface Source
* @property {number} index - 来源索引
* @property {string} area - 来源区域 * @property {string} area - 来源区域
* @property {string} icon - 来源图标
* @property {string} name - 来源名称 * @property {string} name - 来源名称
* @return Source * @return Source
*/ */
interface Source { type Source = { index: number; area: string; name: string };
area: string;
icon: string;
name: string;
}
} }