diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/server/query-parser/query-parser.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/server/query-parser/query-parser.ts index 82144c16f4970..00f576ccfcd90 100644 --- a/packages/plugins/@nocobase/plugin-data-visualization/src/server/query-parser/query-parser.ts +++ b/packages/plugins/@nocobase/plugin-data-visualization/src/server/query-parser/query-parser.ts @@ -100,18 +100,21 @@ export class QueryParser { } = this.parseDimensions(ctx, dimensions, hasAgg, ctx.get?.('x-timezone')); const order = this.parseOrders(ctx, orders, hasAgg); + const queryParams = { + where, + attributes: [...measureAttributes, ...dimensionAttributes], + include, + group, + order, + subQuery: false, + raw: true, + }; + if (!hasAgg || dimensions.length) { + queryParams['limit'] = limit || 2000; + } ctx.action.params.values = { ...ctx.action.params.values, - queryParams: { - where, - attributes: [...measureAttributes, ...dimensionAttributes], - include, - group, - order, - limit: limit || 2000, - subQuery: false, - raw: true, - }, + queryParams, fieldMap: { ...measureFieldMap, ...dimensionFieldMap }, }; await next();