mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
migrate statistics store to composition API and typescript
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { YearMonth, YearUnixTime, YearQuarterUnixTime, YearMonthUnixTime } from '@/core/datetime.ts';
|
||||
import { ChartSortingType, ChartDateAggregationType } from '@/core/statistics.ts';
|
||||
import type { TransactionStatisticDataItemBase } from '@/models/transaction.ts';
|
||||
|
||||
import {
|
||||
getAllMonthsStartAndEndUnixTimes,
|
||||
@@ -7,7 +8,7 @@ import {
|
||||
getAllYearsStartAndEndUnixTimes
|
||||
} from '@/lib/datetime.ts';
|
||||
|
||||
export function sortStatisticsItems(items: { name: string, totalAmount: number, displayOrders: number[] }[], sortingType: number): void {
|
||||
export function sortStatisticsItems(items: TransactionStatisticDataItemBase[], sortingType: number): void {
|
||||
if (sortingType === ChartSortingType.DisplayOrder.type) {
|
||||
items.sort(function (data1, data2) {
|
||||
for (let i = 0; i < Math.min(data1.displayOrders.length, data2.displayOrders.length); i++) {
|
||||
|
||||
Reference in New Issue
Block a user