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

希望可以对友链”分组“进行排序 #1905

Closed
daifiyum opened this issue Apr 28, 2022 · 7 comments · Fixed by #2105
Closed

希望可以对友链”分组“进行排序 #1905

daifiyum opened this issue Apr 28, 2022 · 7 comments · Fixed by #2105
Assignees
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@daifiyum
Copy link

Your current Halo version

1.5.2

Describe this feature

目前,链接(友链)的分组还无法排序,有多个分组时,无法将重要分组放在满意的位置

Additional information

No response

@ruibaby
Copy link
Member

ruibaby commented Apr 28, 2022

感谢反馈,目前由于分组字段是存在友链的表当中的,所以要对分组排序也就意味着对分组下的所有友链进行排序。所以目前问题就变成了对所有友链的排序。

对此提供一种方案:

对于后端:

  1. 提供批量更新友链的接口。在 LinkController 当中提供类似 MenuController#updateBatchBy 的接口。
  2. 获取分组友链的接口可能需要改为同时根据 priority 和 team 字段进行排序。

对于前端:

  1. 重构整个管理友链的功能,目前表格的形式无法方便的完成排序。
  2. 需要改为以分组的形式展示。
  3. 可以参考菜单和文章分类的排序实现,但得支持整个分组的排序。
  4. 排序完成后使用批量更新接口进行所有友链的更新。

最终所呈现的效果可能是这样:

image

由于目前我们正在进行 2.0 版本的开发,所以可能并没有时间来增加 1.x 的功能,期待大家来实现这个特性。

/kind feature

@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 28, 2022
@Tainger
Copy link

Tainger commented May 2, 2022

ok

@ruibaby
Copy link
Member

ruibaby commented May 3, 2022

ok

如果有兴趣,可以评论 /assign 来指派。

@Camsyn
Copy link

Camsyn commented May 17, 2022

在不修改数据库表的前提下对分组进行排序,我认为分组排序和组内友链的排序可以共用一个priority字段(team字段不做排序)。即将分组内最大的友链priority作为该分组的priority。

  • 后端:List<LinkTeamVO> listTeamVos(Sort sort) api 可以先默认按分组的priority对分组进行排序,再对组内的友链进行排序。
  • 前端:修改 管理友链的页面,不再显式的提供修改友链priority的方法,而是采用可视化的拖拽来对分组或分组内的友链进行排序,并在前端按照最终的次序(从上到下,从左到右)对各个友链的priority进行递增/递减,配合后端提供的批量更新接口,完成对分组排序,组内友链排序的可视化调整。

@Camsyn
Copy link

Camsyn commented May 17, 2022

/assign

@JohnNiang
Copy link
Member

/milestone 1.6.x

@f2c-ci-robot f2c-ci-robot bot added this to the 1.6.x milestone May 17, 2022
@ruibaby
Copy link
Member

ruibaby commented May 17, 2022

/area core
/area admin

@f2c-ci-robot f2c-ci-robot bot added area/core Issues or PRs related to the Halo Core area/console Issues or PRs related to the Halo Console labels May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants