Bỏ qua, đến nội dung

@digiforce-nc/plugin-ui-templates

Plugin UI Widget Templates — cho phép lưu và tái sử dụng các block/widget UI dưới dạng template, hỗ trợ chế độ reference (liên kết) và copy (sao chép độc lập).

Plugin này làm gì?

Khi xây dựng giao diện, nhiều trang sử dụng cùng một block layout (ví dụ: bảng danh sách khách hàng, form nhập liệu đơn hàng). Thay vì tạo lại từ đầu, plugin cho phép lưu block thành templatetái sử dụng ở nhiều nơi. Template có thể dùng theo chế độ reference (thay đổi template tự động cập nhật mọi nơi sử dụng) hoặc copy (tạo bản sao độc lập).

Tính năng chính

#Tính năngMô tả
1Lưu templateLưu bất kỳ block/widget nào thành template có tên và mô tả
2Reference modeSử dụng template theo kiểu liên kết — sửa 1 nơi, cập nhật tất cả
3Copy modeTạo bản sao độc lập từ template — chỉnh sửa không ảnh hưởng template gốc
4Usage trackingTự động theo dõi nơi nào đang sử dụng template (qua uiWidgetTemplateUsages)
5Audit trailGhi nhận hành động create/update/destroy template

Database

Collection uiWidgetTemplates

FieldKiểuMô tả
uiduid (PK)ID duy nhất của template
namestringTên hiển thị
descriptiontextMô tả template
targetUidstringUID của widget gốc
useWidgetstringLoại widget
typestringPhân loại template
collectionNamestringCollection liên kết
dataSourceKeystringData source liên kết

Collection uiWidgetTemplateUsages

Bảng theo dõi nơi nào đang dùng template nào:

FieldKiểuMô tả
uiduid (PK)ID duy nhất
templateUidstringUID của template
uiWidgetUidstringUID của widget đang dùng template

ACL — Phân quyền

ResourceQuyềnMô tả
uiWidgetTemplatesloggedInUser đã đăng nhập truy cập được
uiWidgetTemplateUsagesloggedInUser đã đăng nhập truy cập được
uiWidgetTemplates:*Admin (snippet)Quản lý đầy đủ template

Dependencies

PackageVai trò
@digiforce-nc/serverServer framework
@digiforce-nc/plugin-ui-coreUiWidgetRepository — quản lý widget tree
@digiforce-nc/utilsuid() — tạo unique ID
lodashUtility functions

Mục lục chi tiết