flop_phoenix
512
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Elixir
语言
—
创建时间
最近更新
项目能做什么
基于 Phoenix、Ecto 和 Flop 的分页、可排序表格及筛选表单组件。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Flop Phoenix
 [](https://hex.pm/packages/flop_phoenix) [](https://coveralls.io/github/woylie/flop_phoenix)
Flop Phoenix provides Phoenix components for pagination, sortable tables, and
filter forms with [Flop](https://hex.pm/packages/flop) and
[Ecto](https://hex.pm/packages/ecto).
## Installation
Add `flop_phoenix` to your list of dependencies in the `mix.exs` of your Phoenix
application.
```elixir
def deps do
[
{:flop_phoenix, "~> 0.27.0"}
]
end
```
Next, set up your business logic following the
[Flop documentation](https://hex.pm/packages/flop).
### Supported versions
Flop Phoenix is tested against the Elixir and OTP versions that are still
maintained. `mix.exs` allows older Elixir versions, but they are untested.
## Context
Define a context function that performs a list query using Flop.
```elixir
defmodule MyApp.Pets do
alias MyApp.Pet
def list_pets(params) do
Flop.validate_and_run!(Pet, params, for: Pet, replace_invalid_params: true)
end
end
```
Note the usage of the `replace_invalid_params` option, which lets Flop ignore
invalid parameters instead of producing an error.
## LiveView
In the `handle_params` function of your LiveView module, pass the parameters
to the list function to fetch the data and assign both the data and the meta
struct to the socket.
```elixir
defmodule MyAppWeb.PetLive.Index do
use MyAppWeb, :live_view
alias MyApp.Pets
@impl Phoenix.LiveView
def handle_params(params, _, socket) do
{pets, meta} = Pets.list_pets(params)
{:noreply, assign(socket, pets: pets, meta: meta)}
end
end
```
## Sortable table and pagination
Add a sortable table and pagination to your HEEx template:
```heex
<Flop.Phoenix.table items={@pets} meta={@meta} path={~p"/pets"}>
<:col :let={pet} label="Name" field={:name}>{pet.name}</:col>
<:col :let={pet} label="Age" field={:age}>{pet.age}</:col>
</Flop.Phoenix.table>
<Flop.Phoenix.pagination meta={@meta} path={~p"/pets"} />
```
The `path` attribute points to the current route, and Flop Phoenix appends
pagination, filtering, and sorting parameters to it. You can use verified
routes, route helpers, or custom path builder functions. For a
description of the different formats, refer to the documentation of
`Flop.Phoenix.build_path/3`.
The `field` attribute in the `:col` slot is optional. If set and the field
is defined as sortable in the Ecto schema, the table header for
that column will be interactive, allowing users to sort by that column. However,
if the field isn't defined as sortable, or if the field attribute is omitted, or
set to `nil` or `false`, the table header will not be clickable.
By using the `for` option in your Flop query, Flop Phoenix can identify which
table columns are sortable. Additionally, it omits the `order` and `page_si
阅读完整原文
项目深度分析 AI 生成
Phoenix LiveView 高级商业 UI 组件库 (Flop Pro Components)
| 产品构想 | 基于 flop_phoenix 打造商用扩展组件包,提供拖拽排序列、行级内联编辑、复杂树状条件筛选器、虚拟滚动长列表及预设 Tailwind/DaisyUI 精美主题。 |
| 核心功能 | 复杂嵌套过滤器 UI 组件、列宽自适应与拖拽排序、批量行操作支持、预设多款现代 Tailwind 设计样式、一键复制到工程的源码级分发模式。 |
| 目标用户 | 需要快速交付高质量 B 端企业管理系统的 Phoenix/LiveView 开发者与商业团队。 |
| 难度/周期 | 中等 · 1 - 2 个月 · 成本:极低(主要为前端交互与 LiveView Hook 开发时间、展示站点部署费用) |
| 收费模式 | 类似 Tailwind UI / Catalyst 的单次买断制商业授权或年付更新订阅。 |
| 竞争风险 | Elixir 开发者基数较小,市场总体容量有限;开源社区可能逐步跟进类似基础功能。 |
| 依据 | 已验证事实 |
面向 Phoenix 体系的开箱即用 Admin 后台框架 (Flop Admin / Kit)
| 产品构想 | 利用 Flop + Ecto + LiveView 构建类似 ActiveAdmin / Filament 的无代码/低代码 Phoenix 后台生成器,一键生成带 Flop 强大过滤与分页的管理面板。 |
| 核心功能 | Ecto Schema 自动反射生成完整 CRUD 界面、权限控制集成、基于 Flop 的动态数据导出 (CSV/Excel)、审计日志与仪表盘卡片系统。 |
| 目标用户 | 开发内部运营系统、SaaS 早期后台的 Elixir 独立开发者和中小企业。 |
| 难度/周期 | 较高 · 2 - 4 个月 · 成本:低(基础服务器、文档托管) |
| 收费模式 | 双重许可 (AGPL + 商业付费 License) 或 Pro 模板一次性代码销售。 |
| 竞争风险 | 已有 Kaffy、Torch 等 Elixir 后台项目存在竞争;需要长期维护对 Phoenix/Ecto 大版本的兼容。 |
| 依据 | AI推测 |
Flop 增强型商业扩展包 (Flop Enterprise Add-ons)
| 产品构想 | 提供面向生产环境的高级数据处理插件包,聚焦于大规模数据导出、审计留痕与复杂报表查询优化。 |
| 核心功能 | 基于 Oban 的异步百万级数据导出生成器 (CSV/XLSX)、过滤配置持久化与视图分享 (Saved Filters/Views)、实时列统计与汇总行计算插件。 |
| 目标用户 | 承载中大型业务、面临大数据量表格导出性能瓶颈的企业级 Elixir 团队。 |
| 难度/周期 | 中等 · 1 - 2 个月 · 成本:极低 |
| 收费模式 | 私有 Hex 仓库授权分发或年费支持订阅 (B2B License)。 |
| 竞争风险 | B端企业客户采购决策周期长,单纯工具包客单价难以拉高。 |
| 依据 | 尚需验证的假设 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建时间待补全,最近推送 ,发布过 60 个 Release |
| 社区活跃 | Star 512 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。