mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
only show chart data type of categorical analysis in statistics setting page
This commit is contained in:
+7
-2
@@ -13,6 +13,7 @@ import statisticsConstants from '@/consts/statistics.js';
|
||||
import apiConstants from '@/consts/api.js';
|
||||
|
||||
import {
|
||||
isDefined,
|
||||
isString,
|
||||
isNumber,
|
||||
isBoolean,
|
||||
@@ -995,7 +996,7 @@ function getAllTrendChartTypes(translateFn) {
|
||||
return allChartTypes;
|
||||
}
|
||||
|
||||
function getAllStatisticsChartDataTypes(translateFn) {
|
||||
function getAllStatisticsChartDataTypes(translateFn, analysisType) {
|
||||
const allChartDataTypes = [];
|
||||
|
||||
for (const dataTypeField in statisticsConstants.allChartDataTypes) {
|
||||
@@ -1005,6 +1006,10 @@ function getAllStatisticsChartDataTypes(translateFn) {
|
||||
|
||||
const chartDataType = statisticsConstants.allChartDataTypes[dataTypeField];
|
||||
|
||||
if (isDefined(analysisType) && !chartDataType.availableAnalysisTypes[analysisType]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
allChartDataTypes.push({
|
||||
type: chartDataType.type,
|
||||
displayName: translateFn(chartDataType.name),
|
||||
@@ -1468,7 +1473,7 @@ export function i18nFunctions(i18nGlobal) {
|
||||
getAllAccountTypes: () => getAllAccountTypes(i18nGlobal.t),
|
||||
getAllCategoricalChartTypes: () => getAllCategoricalChartTypes(i18nGlobal.t),
|
||||
getAllTrendChartTypes: () => getAllTrendChartTypes(i18nGlobal.t),
|
||||
getAllStatisticsChartDataTypes: () => getAllStatisticsChartDataTypes(i18nGlobal.t),
|
||||
getAllStatisticsChartDataTypes: (analysisType) => getAllStatisticsChartDataTypes(i18nGlobal.t, analysisType),
|
||||
getAllStatisticsSortingTypes: () => getAllStatisticsSortingTypes(i18nGlobal.t),
|
||||
getAllTransactionEditScopeTypes: () => getAllTransactionEditScopeTypes(i18nGlobal.t),
|
||||
getAllTransactionDefaultCategories: (categoryType, locale) => getAllTransactionDefaultCategories(categoryType, locale, i18nGlobal.t),
|
||||
|
||||
Reference in New Issue
Block a user