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

chore: table2性能优化close#8594 #8679

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

wanglinfang2014
Copy link
Collaborator

@wanglinfang2014 wanglinfang2014 commented Nov 9, 2023

What

🤖 Generated by Copilot at d7d0f61

This pull request adds and improves the components and logic for rendering a table with various features, such as sorting, filtering, selecting, dragging, expanding, and nesting. It also simplifies and optimizes some existing code in table2.ts and Cell.tsx. The main files affected are packages/amis-ui/src/components/table/* and packages/amis/src/renderers/Table2/HeadCellSearchDropdown.tsx.

🤖 Generated by Copilot at d7d0f61

We're building a table with React and MobX
We're making it sortable and filterable and more
We're using PureComponent to boost performance
And we're refactoring code to make it elegant

Why

How

🤖 Generated by Copilot at d7d0f61

  • Add the Head component to render the table header with sortable, filterable, and selectable features (link)
  • Add the BodyRow component to render the table body row with draggable, selectable, expandable, and nested features (link)
  • Add the SummaryRow and SummaryRows components to render the table summary rows with fixed and colspan features (link)
  • Add the util module with helper functions for the table rendering logic (link)
  • Change the ColGroup component to render the col elements for the draggable, selectable, and expandable features (link, link, link, link, link)
  • Change the Cell component to remove unused props and wrappers, and extend React.PureComponent (link, link, link, link, link, link, link)
  • Change the HeadCellDropDown component to check the filterDropdown prop and extend React.PureComponent (link, link)
  • Change the HeadCellFilter, HeadCellSelect, HeadCellSort, and ItemActionsWrapper components to extend React.PureComponent (link, link, link, link)
  • Change the HeadCellSearchDropDown component to use the observer wrapper, the order prop, and the async onSearch function (link, link, link, link, link, link, link, link, link, link, link)
  • Remove the code that adjusts the toIndex and fromIndex based on the parent children index in the table store (link)
  • Remove some empty lines for code style consistency (link, link)

Copy link

github-actions bot commented Nov 9, 2023

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@lurunze1226 lurunze1226 merged commit b58bd57 into baidu:master Nov 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants