diff --git a/src/components/userGacha/gro-data-view.vue b/src/components/userGacha/gro-data-view.vue index b605753b..a046d6f8 100644 --- a/src/components/userGacha/gro-data-view.vue +++ b/src/components/userGacha/gro-data-view.vue @@ -13,7 +13,7 @@
★★★★
-
+
{{ reset4count - 1 }}
@@ -33,7 +33,7 @@
★★★★★
-
+
{{ reset5count - 1 }}
@@ -66,7 +66,7 @@ (""); // 最早的时间 const endDate = ref(""); // 最晚的时间 const star5List = shallowRef>([]); // 5星物品数据 const star4List = shallowRef>([]); // 4星物品数据 +const showReset = ref(true); const reset5count = ref(1); // 5星垫抽数量 const reset4count = ref(1); // 4星垫抽数量 const star3count = ref(0); // 3星物品数量 @@ -190,7 +191,27 @@ onUnmounted(() => { resizeListener = null; } }); - +// 监听数据变化 +watch( + () => props.dataVal, + async () => { + star5List.value = []; + star4List.value = []; + reset5count.value = 1; + reset4count.value = 1; + star3count.value = 1; + startDate.value = ""; + endDate.value = ""; + star5avg.value = ""; + star5UpAvg.value = ""; + star4avg.value = ""; + star4UpAvg.value = ""; + tab.value = "5"; + loadData(); + await nextTick(); + calculateHeights(); + }, +); watch( () => [props.dataVal, props.dataType], async () => { @@ -199,6 +220,11 @@ watch( }, ); +// 切换垫数显示 +function switchShowReset(): void { + showReset.value = !showReset.value; +} + function loadData(): void { title.value = getTitle(); const tempData = props.dataVal; @@ -330,28 +356,6 @@ function getPg(star: "5" | "4" | "3"): string { if (progress === 0) return "0"; return `${progress.toFixed(2)}%`; } - -// 监听数据变化 -watch( - () => props.dataVal, - async () => { - star5List.value = []; - star4List.value = []; - reset5count.value = 1; - reset4count.value = 1; - star3count.value = 1; - startDate.value = ""; - endDate.value = ""; - star5avg.value = ""; - star5UpAvg.value = ""; - star4avg.value = ""; - star4UpAvg.value = ""; - tab.value = "5"; - loadData(); - await nextTick(); - calculateHeights(); - }, -);