Skip to content

Conversation

@zeje
Copy link
Contributor

@zeje zeje commented Oct 31, 2025

优化菜单排序

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


caizz seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhou-hao
Copy link
Member

  1. 什么场景下需要这样排序
  2. 封装一个支持分组排序的工具应该更合适? SortUtils.groupingSort( list, MenuEntity::getOwner ) 这样?

@zeje
Copy link
Contributor Author

zeje commented Nov 1, 2025

角色分配权限界面,菜单数据有多个owner时(如 iot,jetlinks),自定义的owner的菜单,跟系统原有iot的菜单,交错在了一起。
通用查询,使用owner排序,再按照sortIndex。这样的话,iot 在前面,jetlinks在后面。
假如说我想jetlinks在前面,按照我push的代码,可以做到这个效果。只要把jetlinks的最小的sortIndex设置得比iot得最小的sortIndex小便可。

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

Successfully merging this pull request may close these issues.

3 participants