Change export column order to match history page

pull/1/head
Made Baruna 2021-03-27 19:26:53 +08:00
parent 8217a2bf14
commit f4675d1bb9
1 changed files with 10 additions and 9 deletions

View File

@ -1,8 +1,9 @@
import { Workbook } from 'exceljs'; import { Workbook } from 'exceljs';
import dayjs from 'dayjs';
import { bannerTypes } from '../data/bannerTypes'; import { bannerTypes } from '../data/bannerTypes';
import { banners } from '../data/banners'; import { banners } from '../data/banners';
import dayjs from 'dayjs';
import { getTimeOffset } from '../stores/server'; import { getTimeOffset } from '../stores/server';
import { process } from './wish'; import { process } from './wish';
@ -132,11 +133,11 @@ async function addWishHistory(workbook, icons) {
const sheet = workbook.getWorksheet(category); const sheet = workbook.getWorksheet(category);
sheet.columns = [ sheet.columns = [
{ header: 'Time', width: 22, style: { alignment: { horizontal: 'left' } } },
{ header: 'Pity', width: 4, style: { alignment: { horizontal: 'center' } } },
{ header: 'Name', width: 32 },
{ header: '⭐', width: 2.5, style: { alignment: { horizontal: 'center' } } },
{ header: 'Type', width: 9 }, { header: 'Type', width: 9 },
{ header: 'Name', width: 32 },
{ header: 'Time', width: 22, style: { alignment: { horizontal: 'left' } } },
{ header: '⭐', width: 2.5, style: { alignment: { horizontal: 'center' } } },
{ header: 'Pity', width: 4, style: { alignment: { horizontal: 'center' } } },
{ header: '#Roll', width: 7, style: { alignment: { horizontal: 'center' } } }, { header: '#Roll', width: 7, style: { alignment: { horizontal: 'center' } } },
{ header: 'Group', width: 7, style: { alignment: { horizontal: 'center' } } }, { header: 'Group', width: 7, style: { alignment: { horizontal: 'center' } } },
{ header: 'Banner', width: 24 }, { header: 'Banner', width: 24 },
@ -164,11 +165,11 @@ async function addWishHistory(workbook, icons) {
lastTime = pull.time; lastTime = pull.time;
const row = sheet.addRow([ const row = sheet.addRow([
dayjs.unix(pull.time).toDate(), pull.type[0].toUpperCase() + pull.type.slice(1),
pull.pity,
pull.name, pull.name,
dayjs.unix(pull.time).toDate(),
pull.rarity, pull.rarity,
pull.type, pull.pity,
pull.at, pull.at,
groupCount, groupCount,
pull.banner.name, pull.banner.name,
@ -183,7 +184,7 @@ async function addWishHistory(workbook, icons) {
}; };
} }
row.getCell(1).numFmt = 'yyyy-mm-dd hh:mm:ss'; row.getCell(3).numFmt = 'yyyy-mm-dd hh:mm:ss';
row.font = { row.font = {
color: { argb: pull.rarity === 5 ? 'FFCC9832' : pull.rarity === 4 ? 'FF8A6995' : 'FF000000' }, color: { argb: pull.rarity === 5 ? 'FFCC9832' : pull.rarity === 4 ? 'FF8A6995' : 'FF000000' },