mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-05 07:15:06 +08:00
@@ -79,7 +79,7 @@ const chartHeight = computed<string>(() => {
|
||||
* @returns {EChartsOption}
|
||||
*/
|
||||
async function getCalendarOptions(): Promise<EChartsOption> {
|
||||
const records = await TSUserGacha.getGachaRecordsGroupByDate(props.uid, props.gachaType);
|
||||
const records = await TSUserGacha.record.time(props.uid, props.gachaType);
|
||||
// 获取最大长度
|
||||
const maxLen = Math.max(...Object.values(records).map((v) => v.length));
|
||||
// 获取年份
|
||||
|
||||
@@ -72,7 +72,7 @@ const chartEl = useTemplateRef<InstanceType<typeof VChart>>("chartRef");
|
||||
* @returns {EChartsOption}
|
||||
*/
|
||||
async function getOverviewOptions(): Promise<EChartsOption> {
|
||||
const records = await TSUserGacha.getGachaRecords(props.uid);
|
||||
const records = await TSUserGacha.record.all(props.uid);
|
||||
const data: EChartsOption = {
|
||||
title: [
|
||||
{ text: ">> 祈愿系统大数据分析 <<", left: "center", top: "5%" },
|
||||
|
||||
@@ -72,7 +72,7 @@ const chartEl = useTemplateRef<InstanceType<typeof VChart>>("chartRef");
|
||||
* @returns {EChartsOption}
|
||||
*/
|
||||
async function getStackBarOptions(): Promise<EChartsOption> {
|
||||
const records = await TSUserGacha.getGachaRecordsGroupByDate(props.uid, props.gachaType);
|
||||
const records = await TSUserGacha.record.time(props.uid, props.gachaType);
|
||||
const dataCount = Object.keys(records).length;
|
||||
const xAxis = {
|
||||
type: <const>"category",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!-- 抽卡历史 -->
|
||||
<template>
|
||||
<div class="gro-container">
|
||||
<v-tabs class="gro-tabs" v-model="historyTab" align-tabs="start" direction="vertical">
|
||||
<v-tabs v-model="historyTab" align-tabs="start" class="gro-tabs" direction="vertical">
|
||||
<v-tab v-for="(item, index) in tabList" :key="index" :value="item.tab">
|
||||
{{ item.tab }}
|
||||
</v-tab>
|
||||
@@ -12,7 +13,7 @@
|
||||
:value="item.tab"
|
||||
class="gro-pools"
|
||||
>
|
||||
<UgHisCard v-for="pool in item.value" :key="pool.order" :pool="pool" />
|
||||
<UgHisCard v-for="pool in item.value" :key="pool.order" :pool="pool" :uid="props.uid" />
|
||||
</v-window-item>
|
||||
</v-window>
|
||||
</div>
|
||||
@@ -25,6 +26,9 @@ import UgHisCard from "./ug-his-card.vue";
|
||||
import { AppGachaData } from "@/data/index.js";
|
||||
|
||||
type GroHistoryMap = { tab: string; value: Array<TGApp.App.Gacha.PoolItem> };
|
||||
type GroHistoryProps = { uid?: string };
|
||||
|
||||
const props = defineProps<GroHistoryProps>();
|
||||
|
||||
const historyTab = ref<string>("");
|
||||
const tabList = shallowRef<Array<GroHistoryMap>>([]);
|
||||
@@ -62,6 +66,7 @@ onMounted(() => {
|
||||
.gro-container :deep(.v-tabs.v-slide-group--vertical) {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
/* stylelint-enable selector-class-pattern */
|
||||
|
||||
.gro-window {
|
||||
@@ -81,6 +86,7 @@ onMounted(() => {
|
||||
.gro-window :deep(.v-window__container) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* stylelint-enable selector-class-pattern */
|
||||
|
||||
.gro-pools {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- 单个卡池抽卡记录 -->
|
||||
<template>
|
||||
<div class="user-gacha-history-card-comp">
|
||||
<img
|
||||
@@ -38,21 +39,40 @@
|
||||
import TItemBox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
|
||||
import showSnackbar from "@comp/func/snackbar.js";
|
||||
import gameEnum from "@enum/game.js";
|
||||
import TSUserGacha from "@Sqlm/userGacha.js";
|
||||
import { createPost } from "@utils/TGWindow.js";
|
||||
import { getWikiBrief, timestampToDate } from "@utils/toolFunc.js";
|
||||
import { shallowRef, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
type UgHisCardProps = { pool: TGApp.App.Gacha.PoolItem };
|
||||
type UgHisCardProps = {
|
||||
/** 卡池信息 */
|
||||
pool: TGApp.App.Gacha.PoolItem;
|
||||
/** UID */
|
||||
uid?: string;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const props = defineProps<UgHisCardProps>();
|
||||
|
||||
const gachaTypeList: ReadonlyArray<TGApp.App.Gacha.PoolGachaType> = [
|
||||
TGApp.Game.Gacha.GachaType.AvatarUp,
|
||||
TGApp.Game.Gacha.GachaType.AvatarUp2,
|
||||
TGApp.Game.Gacha.GachaType.WeaponUp,
|
||||
TGApp.Game.Gacha.GachaType.MixUp,
|
||||
gameEnum.gachaType.AvatarUp,
|
||||
gameEnum.gachaType.AvatarUp2,
|
||||
gameEnum.gachaType.WeaponUp,
|
||||
gameEnum.gachaType.MixUp,
|
||||
];
|
||||
const gachaRecords = shallowRef<Array<TGApp.Sqlite.Gacha.Gacha>>([]);
|
||||
|
||||
watch(
|
||||
() => props.uid,
|
||||
async () => loadRecords(),
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
async function loadRecords(): Promise<void> {
|
||||
if (!props.uid) gachaRecords.value = [];
|
||||
else gachaRecords.value = await TSUserGacha.record.pool(props.pool, props.uid);
|
||||
}
|
||||
|
||||
function isPoolGachaType(x: string): x is TGApp.App.Gacha.PoolGachaType {
|
||||
return (<ReadonlyArray<string>>gachaTypeList).includes(x);
|
||||
|
||||
@@ -156,7 +156,7 @@ async function handleExportData(): Promise<void> {
|
||||
const uidList = await TSUserGacha.getUidList();
|
||||
const tmpData: Array<UgoUidItem> = [];
|
||||
for (const uid of uidList) {
|
||||
const dataRaw = await TSUserGacha.getGachaRecords(uid);
|
||||
const dataRaw = await TSUserGacha.record.all(uid);
|
||||
tmpData.push(parseDataRaw(dataRaw));
|
||||
}
|
||||
data.value = tmpData;
|
||||
|
||||
Reference in New Issue
Block a user