mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-29 03:32:44 +01:00
Adjust function return data
This commit is contained in:
parent
f4675d1bb9
commit
18a75dfca7
2 changed files with 9 additions and 12 deletions
|
@ -1,7 +1,6 @@
|
||||||
import { Workbook } from 'exceljs';
|
import { Workbook } from 'exceljs';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { bannerTypes } from '../data/bannerTypes';
|
|
||||||
import { banners } from '../data/banners';
|
import { banners } from '../data/banners';
|
||||||
|
|
||||||
import { getTimeOffset } from '../stores/server';
|
import { getTimeOffset } from '../stores/server';
|
||||||
|
@ -129,7 +128,6 @@ async function addInformation(workbook) {
|
||||||
*/
|
*/
|
||||||
async function addWishHistory(workbook, icons) {
|
async function addWishHistory(workbook, icons) {
|
||||||
for (const [id, category] of Object.entries(bannerCategories)) {
|
for (const [id, category] of Object.entries(bannerCategories)) {
|
||||||
const data = process(id);
|
|
||||||
|
|
||||||
const sheet = workbook.getWorksheet(category);
|
const sheet = workbook.getWorksheet(category);
|
||||||
sheet.columns = [
|
sheet.columns = [
|
||||||
|
@ -148,12 +146,13 @@ async function addWishHistory(workbook, icons) {
|
||||||
bold: true,
|
bold: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const data = process(id);
|
||||||
if (data === null) continue;
|
if (data === null) continue;
|
||||||
|
|
||||||
let groupCount = 0;
|
let groupCount = 0;
|
||||||
let lastTime = 0;
|
let lastTime = 0;
|
||||||
let lastBanner = '';
|
let lastBanner = '';
|
||||||
for (const pull of data) {
|
for (const pull of data.pulls) {
|
||||||
if (lastBanner !== pull.banner.image) {
|
if (lastBanner !== pull.banner.image) {
|
||||||
groupCount = 0;
|
groupCount = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,10 +160,8 @@ export function process(id) {
|
||||||
currentPulls.push(newPull);
|
currentPulls.push(newPull);
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentPulls;
|
return {
|
||||||
|
pulls: currentPulls,
|
||||||
// console.log(JSON.stringify(pulls.slice(0, 5).map(e => [e.time.toString(), e.id, e.type, e.pity, e.group === 'group'])));
|
banner: selectedBanners,
|
||||||
// console.log(JSON.stringify(selectedBanners[8].legendary.map(e => [e.time.toString(), e.id, e.type, e.pity, e.group === 'group'])));
|
}
|
||||||
// console.log(JSON.stringify(selectedBanners[8].rarePity));
|
|
||||||
// console.log(selectedBanners[8].legendary.length, selectedBanners[8].rare.character.length + selectedBanners[8].rare.weapon.length, selectedBanners[8].total);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue