antvis / antvis/S2

🐛透视表自定义列头后,行维度的外侧排序失效

Open
#3,204 5 comments 0 reactions 0 assignees View on GitHub
💤 inactive
Dominant language
TypeScript
Stars
1.7k
Forks
220
PR merge metrics
No merged PRs in 30d

Description

### 🏷 S2 Version / S2 版本

| Package | Version |
| -------------- | ------- |
| @antv/s2 | * |
| @antv/s2-react | |
| @antv/s2-react-components | |

### 💻 Sheet Type / 表格类型

- [x] PivotSheet
- [ ] TableSheet
- [ ] PivotChartSheet
- [ ] GridAnalysisSheet
- [ ] StrategySheet
- [ ] EditableSheet

### 🖋 Describe the bug / 问题描述

当使用透视表的自定义列头的时候,行维度根据TOTAL_VALUE的排序失效

### ⌨️ Code Snapshots / 代码片段
```js
{
fields: {
"columns": [
{
"field": "所有量值[实际销售数量]",
"title": "实际销售数量",
"description": "实际销售数量",
"express": {
"measure": {
"property": "实际销售数量",
"expression": {
"string": {
"value": "所有量值"
}
}
}
}
}
],
"rows": [
"商品大类",
"品牌",
"商品年份"
],
"values": [
"所有量值[实际销售数量]"
],
"valueInCols": true
},
[
{
"sortFieldId": "商品大类",
"sortByMeasure": "$$total$$",
"sortMethod": "desc",
"query": {
"$$extra$$": "所有量值[实际销售数量]"
}
},
{
"sortFieldId": "品牌",
"sortByMeasure": "$$total$$",
"sortMethod": "desc",
"query": {
"$$extra$$": "所有量值[实际销售数量]"
}
},
{
"sortFieldId": "商品年份",
"sortByMeasure": "$$total$$",
"sortMethod": "desc",
"query": {
"$$extra$$": "所有量值[实际销售数量]"
}
}
]
}
```
这是字段配置和相关的排序设置

### 🔗 Reproduction link / 复现链接

_No response_

### 📋 Steps to Reproduce the Bug or Issue / 重现步骤

Image
只要是透视表自定义列头,外加行维度超过一个就能复现

### 😊 Expected Behavior / 期望行为

Image
预期是像图片所示,当行有多个维度时,外侧维度根据设置按汇总数据排序

### 😅 Current Behavior / 当前行为

_No response_

### 💻 OS / 操作系统

- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] Others / 其他

### 🌏 Browser / 浏览器

- [x] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

Open the contributing guide

Research direction

Start from the PivotSheet configuration and sorting settings shown in the issue, using custom column headers and more than one row dimension to reproduce the failure. Verify that the outer row dimensions are ordered by the configured total measure, matching the expected behavior shown in the issue images.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.