Skip to content

[Bug] 同时开启树形结构、自动行高和自动换行后,折叠/展开行会导致行的位置错乱 #3468

@YiiGuxing

Description

@YiiGuxing

Version

1.16.2

Link to Minimal Reproduction

https://visactor.com/vtable/guide/table_type/List_table/tree_list?version=1.16.2

Steps to Reproduce

  1. 代码
const records = [
  {
    group: "Human Resources Department",
    total_children: 30,
    monthly_expense: "$45000",
    new_hires_this_month: 6,
    resignations_this_month: 3,
    complaints_and_suggestions: 2,
    g_test: "G1",
    children: [
      {
        group: "Recruiting Group",
        children: [
          {
            group: "John Smith",
            position: "Recruiting Manager",
            salary: "$8000"
          },
          {
            group: "Emily Johnson",
            position: "Recruiting Supervisor",
            salary: "$6000"
          },
          {
            group: "Michael Davis",
            position: "Recruiting Specialist",
            salary: "$4000"
          }
        ],
        total_children: 15,
        monthly_expense: "$25000",
        new_hires_this_month: 4,
        resignations_this_month: 2,
        complaints_and_suggestions: 1
      },
      {
        group: "Training Group",
        children: [
          {
            group: "Jessica Brown",
            position: "Training Manager",
            salary: "$8000"
          },
          {
            group: "Andrew Wilson",
            position: "Training Supervisor",
            salary: "$6000"
          }
        ],
        total_children: 15,
        monthly_expense: "$20000",
        new_hires_this_month: 2,
        resignations_this_month: 1,
        complaints_and_suggestions: 1
      }
    ]
  },
  {
    group: "Human Resources Department",
    total_children: 30,
    monthly_expense: "$45000",
    new_hires_this_month: 6,
    resignations_this_month: 3,
    complaints_and_suggestions: 2,
    g_test: "G2",
    children: [
      {
        group: "Recruiting Group",
        children: [
          {
            group: "John Smith",
            position: "Recruiting Manager",
            salary: "$8000"
          },
          {
            group: "Emily Johnson",
            position: "Recruiting Supervisor",
            salary: "$6000"
          },
          {
            group: "Michael Davis",
            position: "Recruiting Specialist",
            salary: "$4000"
          }
        ],
        total_children: 15,
        monthly_expense: "$25000",
        new_hires_this_month: 4,
        resignations_this_month: 2,
        complaints_and_suggestions: 1
      },
      {
        group: "Training Group",
        children: [
          {
            group: "Jessica Brown",
            position: "Training Manager",
            salary: "$8000"
          },
          {
            group: "Andrew Wilson",
            position: "Training Supervisor",
            salary: "$6000"
          }
        ],
        total_children: 15,
        monthly_expense: "$20000",
        new_hires_this_month: 2,
        resignations_this_month: 1,
        complaints_and_suggestions: 1
      }
    ]
  }
];
const columns = [
  {
    field: "group",
    title: "department",
    width: "auto",
    tree: true
  },
  {
    field: "total_children",
    title: "memebers count",
    width: 150,
    fieldFormat(rec) {
      if (rec?.["position"]) {
        return `position:  ${rec["position"]}`;
      } else return rec?.["total_children"];
    }
  },
  {
    field: "monthly_expense",
    title: "monthly expense",
    width: "auto",
    fieldFormat(rec) {
      if (rec?.["salary"]) {
        return `salary:  ${rec["salary"]}`;
      } else return rec?.["monthly_expense"];
    }
  },
  {
    field: "new_hires_this_month",
    title: "new hires this month",
    width: "auto"
  },
  {
    field: "resignations_this_month",
    title: "resignations this month",
    width: "auto"
  },
  {
    field: "complaints_and_suggestions",
    title: "recived complaints counts",
    width: "auto"
  }
];

const option = {
  records,
  columns,
  hierarchyExpandLevel:100,
  widthMode: "standard",
  heightMode: "autoHeight",
  autoWrapText: true,
  canvasWidth: 500,
  canvasHeight: 200,
  theme: { bodyStyle: { bgColor: "transparent" } }
};
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window["tableInstance"] = tableInstance;
  1. 切换行的展开/折叠状态
  2. 可见问题

Current Behavior

行的位置错乱重叠:
Image

Expected Behavior

正常渲染

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions