Closed chen610620 closed 2 months ago
请 @wjgogogo 看一下
calcFunc 无汇总数据是有意为之, 自定义汇总本质上是对明细数据进行汇总, 如果汇总数据混入其中的话会导致数据二次累加, 会导致 BUG, 如果你希望获取全部的数据, 可以根据 query
主动查询一次, 代替第二个参数 (ps: 什么情况需要获取汇总数据, 理论上不需要才对吧).
import { QueryDataType } from '@antv/s2';
calcFunc(query) {
+ const allData = s2.dataSet.getMultiData(query, {
+ queryType: QueryDataType.All,
+ });
console.log(allData);
return 15;
},
这里可能无法拿到 s2 实例, 近期我们增加第三个参数好了, 更灵活一点
ok, 好的。那我就主动查询一次解决问题。
ok, 好的。那我就主动查询一次解决问题。
:tada: This issue has been resolved in version @antv/s2-v1.55.7 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
🏷 Version
Sheet Type
🖋 Description
小计总计功能 自定义总计函数(calcFunc)中无小计汇总信息。 仅有最小单元数据。 原有使用 s2:
1.47.1
, s2-react:1.40.0
中, 自定义汇总函数的第二个入参 包含单元格数据+小计汇总数据。 升级到最新版本(1.55.0)后,自定义汇总函数的第二个入参, 仅包含单元格数据。存在差异情况
⌨️ Code Snapshots
bug重现可使用官网demo修改配置进行复现:
官网示例 js配置修改如下
🤔 Steps to Reproduce
无操作步骤, 仅打开调试控制台即可
😊 Expected Behavior
预期行为:控制台输出应包含小计数据, eg:
😅 Current Behavior
当前仅包含单元格数据
💻 System information