Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛版本1.55.7,明细表设置表头分组后,第一个分组的边框显示有问题 #2821

Closed
1 of 4 tasks
liruidong1 opened this issue Jul 18, 2024 · 3 comments
Closed
1 of 4 tasks
Assignees
Labels
next 2.0-next 版本的问题 ✨ supported or fixed in 2.x 在 2.x 版本中,已支持该需求,或 bug 已修复

Comments

@liruidong1
Copy link

🏷 1.55.7

Package Version
@antv/s2 1.55.7
@antv/s2-react
@antv/s2-vue

Sheet Type

  • PivotSheet
  • TableSheet
  • [] GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

明细表设置表头分组后,第一个分组的左侧的边框不显示

⌨️ Code Snapshots

import { TableSheet } from "@antv/s2";

fetch("https://assets.antv.antgroup.com/s2/basic-table-mode.json")
  .then((res) => res.json())
  .then((data) => {
    const container = document.getElementById("container");
    const s2DataConfig = {
      fields: {
        columns: [
          {
            key: "area",
            children: ["province", "city"]
          },
          "type",
          {
            key: "money",
            children: [{ key: "price" }]
          }
        ]
      },
      meta: [
        {
          field: "province",
          name: "省份"
        },
        {
          field: "city",
          name: "城市"
        },
        {
          field: "type",
          name: "商品类别"
        },
        {
          field: "price",
          name: "价格"
        },
        {
          field: "cost",
          name: "成本"
        },
        {
          field: "area",
          name: "位置"
        },
        {
          field: "money",
          name: "金额"
        }
      ],
      data
    };

    const s2Options = {
      width: 600,
      height: 480,
      showSeriesNumber: false // 关闭序号列
    };
    const s2 = new TableSheet(container, s2DataConfig, s2Options);

    s2.setTheme({
      colCell: {
        cell: {
          backgroundColor: "white"
        }
      }
    });

    s2.render();
  });

🔗 Reproduce Link

https://s2-v1.antv.antgroup.com/examples/basic/table/#table-column-group

🤔 Steps to Reproduce

将代码复制进官网的例子里就可以看到效果了

😊 Expected Behavior

希望第一个分组左侧的边框正常显示

😅 Current Behavior

image
第一个分组左侧的边框不显示

💻 System information

Environment Info
System macos sonoma 14.5
Browser chrome 126.0.6478.127
@lijinke666 lijinke666 added the ✨ supported or fixed in 2.x 在 2.x 版本中,已支持该需求,或 bug 已修复 label Jul 18, 2024
@antvis antvis deleted a comment from github-actions bot Jul 18, 2024
@lijinke666 lijinke666 removed the ✨ supported or fixed in 2.x 在 2.x 版本中,已支持该需求,或 bug 已修复 label Jul 18, 2024
@liruidong1
Copy link
Author

我们目前业务是基于其他开源产品做的,升级到2.0的话后续可能不好合并,想知道在1.0的版本上有没有什么写法可以修复这个问题

@lijinke666
Copy link
Member

lijinke666 commented Jul 22, 2024

这个是 bug, 不过由于边框相关的问题较多所以我们放在 2.0 统一重构修复了, 你这里遇到的场景是多列头没有绘制左边框

在 1.x 中, 临时方案可以这样手动补齐一下:

import { TableColCell, CellBorderPosition } from '@antv/s2';

class CustomColCell extends TableColCell {
  drawBorders() {
    const { options } = this.spreadsheet;

    this.drawHorizontalBorder();
    this.drawVerticalBorder(CellBorderPosition.RIGHT);

    if (
      !options.showSeriesNumber &&
      (this.meta.colIndex === 0 || this.meta.children[0]?.colIndex === 0)
    ) {
      this.drawVerticalBorder(CellBorderPosition.LEFT);
    }
  }
}

const s2Options = {
  colCell: (...args) => new CustomColCell(...args)
}

image

@lijinke666 lijinke666 self-assigned this Jul 22, 2024
@lijinke666 lijinke666 added next 2.0-next 版本的问题 ✨ supported or fixed in 2.x 在 2.x 版本中,已支持该需求,或 bug 已修复 labels Jul 22, 2024
Copy link
Contributor

你好 @liruidong1,该功能或缺陷已经在 2.0 next 版本 中支持或修复,next 版本目前处于内测中, 感谢你的支持与理解。

如有任何 2.0 版本 问题,请前往讨论区查看文档, 抢先试用:

yarn add @antv/s2@next  # pnpm add @antv/s2@next
yarn add @antv/s2-react@next  # pnpm add @antv/s2-react@next
yarn add @antv/s2-vue@next  # pnpm add @antv/s2-vue@next

Hello, @liruidong1, This feature or flaw has been supported or fixed in 2.0 next version, next version is currently in private beta, thank you for your support and understanding.

Any 2.0 version issues, please go to discussion, or view docs, the first trial:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 ✨ supported or fixed in 2.x 在 2.x 版本中,已支持该需求,或 bug 已修复
Projects
None yet
Development

No branches or pull requests

2 participants