minipower-frontend-crud-react-route-pages
Mẫu CRUD theo route của kit @platform/core — {Feature}ListPage · {Feature}FormPage (mode create/edit, tự nạp bản ghi khi sửa) · {Feature}DetailPage, điều hướng giữa màn bằng navigate{Feature}(get{Feature}*Path(id)), host bọc wrapper useParams. Dùng khi thực thể nhiều trường, cần URL riêng cho tạo/sửa/chi tiết.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 7
- Forks
- 0
01 前言 Front Matter
- name
- minipower-frontend-crud-react-route-pages
- description
- Mẫu CRUD theo route của kit @platform/core — {Feature}ListPage · {Feature}FormPage (mode create/edit, tự nạp bản ghi khi sửa) · {Feature}DetailPage, điều hướng giữa màn bằng navigate{Feature}(get{Feature}*Path(id)), host bọc wrapper useParams. Dùng khi thực thể nhiều trường, cần URL riêng cho tạo/sửa/chi tiết.
03 SKILL.md 正文
Mẫu theo route — List · Form · Detail
Copy
| Template | Đích |
|---|---|
| ../../templates/shared/components/ | src/features/{feature}/components/ |
| ../../templates/route-pages/pages/{Feature}List/ | pages/{Feature}List/ |
| ../../templates/route-pages/pages/{Feature}Form/ | pages/{Feature}Form/ |
| ../../templates/route-pages/pages/{Feature}Detail/ | pages/{Feature}Detail/ |
Barrel export cả ba page — architecture templates/index.ts đã kèm sẵn.
Ba page nối nhau thế nào
{Feature}ListPage ──Thêm mới──▶ navigate{Feature}(get{Feature}CreatePath()) ─▶ {Feature}FormPage mode="create"
│ ──Xem────────▶ navigate{Feature}(get{Feature}DetailPath(id)) ─▶ {Feature}DetailPage {feature}Id
│ ──Sửa────────▶ navigate{Feature}(get{Feature}EditPath(id)) ─▶ {Feature}FormPage mode="edit" {feature}Id
└── xoá / đổi trạng thái: tại chỗ (ConfirmDialog · handleAction) rồi reload
{Feature}FormPage ──lưu xong / Hủy──▶ navigate{Feature}(get{Feature}ListPath())
Mọi điều hướng mặc định tắt được bằng useRoutes={false} (host tự truyền onCreate / onView / onEdit / onCancel).
Host gắn route
id đọc ở host bằng wrapper useParams — page không import router:
function {Feature}EditRoute() {
const { id = '' } = useParams()
return <{Feature}FormPage mode="edit" {feature}Id={id} />
}
Mẫu đủ bốn route + wrapper: navigation templates/app/routes/{feature}.tsx. Route create tĩnh đứng cạnh :id vẫn khớp đúng — React Router xếp đoạn tĩnh trước đoạn động.
Chỉnh theo DOC-19
| Muốn | Sửa |
|---|---|
| Thêm cột | {Feature}Table: thêm THeadCell + Cell, tăng COLUMN_COUNT |
| Thêm bộ lọc (phòng ban, khoảng ngày) | {Feature}ListPage: state lọc → buildQuery → control trong toolbar → về trang 1 khi đổi |
| Form nhiều khối | {Feature}Form: chia Card / Tabs bên trong component, page giữ nguyên |
| Chi tiết có resource con | {Feature}DetailPage: thêm Card + nút sang route con (get{Feature}…Path(id)), resource con là page riêng |
Validate
Chạy npm run dev: /{features} tải danh sách → Thêm mới sang /{features}/create → lưu về danh sách có bản ghi mới → menu dòng Chỉnh sửa mở form có dữ liệu cũ → Xem chi tiết → Xoá qua hộp xác nhận.
04 同仓库更多 Skills
minipower-vcs-gitlab
Tra GitLab (search, issue, pipeline, MR), soạn MR/comment, tạo MR và commit/push sau L2. Dùng khi merge request, GitLab MCP, code_provider gitlab — không scaffold .NET, không force-push.
minipower-toolbox-skill-author
Viết và soát skill lá-rời Minipower (minipower-{module}-{capability}) — chọn module bằng 3 câu hỏi ADR-022, dựng cây SKILL.md/README.md/workflows/providers, đặt description kích hoạt được, cập nhật hub và test canh. Hỏi người xác nhận trước mọi quyết định, không tự chốt. Dùng khi tạo skill mới, thêm provider/pattern/workflow, mở module mới, hoặc soát skill có sẵn lệch chuẩn.
minipower-tasks-lark
Đọc, lọc, tìm, soạn nháp và ghi task Lark (tasklist / task) theo L1–L3. Dùng khi việc trên Lark, sprint, tasklist, "tìm task", "tạo task", tasks_provider lark — không dùng cho tin nhắn nhóm hay wiki.
minipower-support-registry
Rà registry DOC theo project_mode, nhắc owner thiếu ID hoặc chỗ lưu sai. Dùng khi doc-registry, thiếu DOC, rà soát tiêu chuẩn — không tự sửa FR, không init.
minipower-support-publish
暂无简介
minipower-router
Phân loại intent Minipower rồi gợi ý đúng một pack nghề hoặc kênh. Dùng khi làm gì tiếp, chọn skill, dispatcher, không biết mở pack nào — không tự gọi MCP L3, không spawn agent.