Cấu trúc dự án
Bạn chỉ cần làm việc trong TMS.UI. Đây là bản đồ những file/thư mục bạn sẽ đụng đến.
Bạn làm việc ở đâu?
99% thời gian bạn chỉ chạm vào TMS.UI/Business/. Phần còn lại của repo là framework — đừng sửa trừ khi thật sự cần.
E:\softek\coreui\
├── TMS.UI\ ← BẠN VIẾT CODE Ở ĐÂY
│ └── Business\ ← các màn hình của app
│
├── TMS.API\ ← backend của TMS app (DTO, controller)
│
├── Core\ ← framework FE (đừng đụng)
└── Core.API\ ← framework BE (đừng đụng)
TMS.UI/Business/ — quy ước thư mục
Mỗi domain = 1 thư mục. Bên trong đặt class *BL.cs cho mỗi màn hình:
TMS.UI/Business/
├── Authentication/
│ ├── LoginBL.cs
│ └── PolicyEditorBL.cs
│
├── Freight/ ← domain "Vận chuyển"
│ ├── CoordinationContainerBL.cs ← màn hình list điều phối container
│ ├── CoordinationTruckBL.cs ← màn hình list điều phối xe
│ ├── DriverContainerDetailBL.cs ← popup chi tiết tài xế-container
│ └── DriverTruckDetailBL.cs ← popup chi tiết tài xế-xe
│
└── Menu/
└── MenuBL.cs
Quy ước đặt tên:
<Entity>BL.cscho màn hình list (kế thừaTabEditor);<Entity>DetailBL.cscho editor (kế thừaPopupEditor).
File 1 màn hình điển hình
using Core.Components.Forms;
using Core.Components.Extensions;
using Core.Components;
using TMS.API.Models;
namespace TMS.UI.Business.Freight
{
public class CustomerListBL : TabEditor
{
public CustomerListBL() : base(nameof(Customer))
{
Title = "Khách hàng";
Icon = "icons/customers.png";
DOMContentLoaded += AfterRendered;
}
private void AfterRendered()
{
// truy cập widget sau khi DOM sẵn sàng
var grid = this.FindComponentByName<GridView>("Grid");
if (grid != null) grid.DblClick = OnRowDblClick;
}
private void OnRowDblClick(object row)
{
var customer = (Customer)row;
this.OpenTab("Customer_" + customer.Id, "CustomerEditor",
() => new CustomerDetailBL { Entity = customer }, popup: true);
}
// Method được wire vào button có Events="ExportExcel" (config DB)
public void ExportExcel(object arg)
{
// ...
}
}
}
Cấu hình DB — quản lý ở đâu?
Không phải ở source code. Truy cập trong app đang chạy:
| Màn hình quản lý | Mục đích |
|---|---|
| Quản lý Feature | Tạo/sửa row Feature (tên màn hình, icon, entity). |
| Detail Feature | Trong 1 feature: thêm/sửa ComponentGroup (section) + Component (field). |
| Quản lý Menu | Thêm menu trỏ vào class C# bạn viết. |
| Quản lý quyền | Phân quyền đọc/ghi cho mỗi row Feature/Component. |
→ Cấu hình UI từ DB cho chi tiết các field.
Build & chạy
cd E:\softek\coreui\TMS.UI
dotnet build
dotnet build Bridge.NET compile C# ra JavaScript. File JS xuất ra static folder của TMS.API. Sau đó chạy backend TMS.API rồi mở browser → app.
→ Chạy dev / build chi tiết.
Bạn KHÔNG cần biết
Dưới đây là internals của framework — không nằm trong tài liệu này, không cần đọc để làm việc:
Core/Components/EditableComponent.cs— class cha của mọi widget.Core/MVVM/—Observable<T>,Htmlbuilder.Core/Components/Forms/EditForm.cs— base củaTabEditor/PopupEditor.- Bridge.NET runtime, vòng đời render, scoped CSS injection…
Khi cần feature mới mà framework chưa hỗ trợ → báo team Core, không tự sửa source Core/.