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

grid 开启合计和扩展行后,动态添加字段后,合计和固定列错位 #540

Closed
hyzhen1231 opened this issue Mar 3, 2020 · 1 comment

Comments

@hyzhen1231
Copy link

环境及版本信息

  • tinper-bee 版本号:
    "bee-complex-grid": "2.1.2",
    "bee-input-group": "2.0.2",
    "bee-input-number": "2.2.11",
    "bee-table": "2.2.33"

  • 当前项目中react的版本号:
    "react": "16.8.6",

  • 所使用的操作系统:
    Mac

  • 所使用的浏览器:
    Google Chrome

描述这个问题:

grid 开启合计和扩展行后,合计和固定列错位

1、组件相关代码

代码粘贴区域:


import * as React from 'react';
import Grid from 'bee-complex-grid';
import 'bee-complex-grid/build/Grid.css';
import TIcon from 'tinper-bee/lib/Icon';
export default class Tab extends React.PureComponent<{}> {
  state = {
    selecteds: [],
    data: [
      { key: '1', orderCode: 1 },
      { key: '2', orderCode: 2 }
    ],
    columns:  [
      {
        title: '订单编号',
        dataIndex: 'orderCode',
        key: 'orderCode',
        width: 150,
        sumCol: true
      },
      {
        title: '金额',
        dataIndex: 'money',
        key: 'money',
        width: 160
      }
    ]
  };
  componentDidMount() {
    setTimeout(() => {
      this.setState({
        columns: [
          {
            title: '关闭状态',
            dataIndex: '1closeState_name',
            key: '1closeState_name',
            width: 150,
            sumCol: true
          },
          {
            title: '关闭状态',
            dataIndex: '2closeState_name',
            key: '2closeState_name',
            width: 150
          },
          {
            title: '关闭状态',
            dataIndex: '3closeState_name',
            key: '3closeState_name',
            width: 150
          },
          {
            title: '订单编号',
            dataIndex: 'orderCode',
            key: 'orderCode',
            width: 150,
            sumCol: true
          },
          {
            title: '金额',
            dataIndex: 'money',
            key: 'money',
            width: 160
          }
        ]
      });
    }, 3000);
  }
  render() {
    return (
      <div>
        <Grid
          columns={this.state.columns}
          data={this.state.data}
          rowKey={item => item['key']}
          columnFilterAble={false}
          showHeaderMenu={false}
          multiSelect={{type: ''}}
          noReplaceColumns={true}
          canSum={true}
          showRowNum={true}
          collapsedIcon={<TIcon type='uf-anglearrowpointingtoright' />}
          expandedIcon={<TIcon type='uf-treearrow-down' />}
          expandIconAsCell={true}
          expandedRowRender={(record, index, indent) => index}
          // loadLazy={true}
        />
      </div>
    );
  }
}

2、报错信息

当前的行为:效果(可截图说明)及动作描述

image

期望的行为:

扩展行正常,合计字显示,合计列不会错位

@hyzhen1231 hyzhen1231 changed the title grid 开启合计和扩展行后,合计和固定列错位 grid 开启合计和扩展行后,动态添加字段后,合计和固定列错位 Mar 3, 2020
@yangchch6
Copy link
Contributor

问题已修复,重新装包即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants