Volcore Documentation
website·Indexed 31 days ago
http://doc.volcore.xyzDeveloper documentation for the Volcore framework, covering frontend components like vol-table and volform, and backend C# development. Includes guides on EF Core transactions, Dapper integration, service layer extensions for CRUD operations, audit workflows, and API configuration using JsonNormal.
What's inside Volcore
- The VolPro framework relies on a code generator to automate the implementation of basic CRUD and business functions. It supports the automatic generation of frontend and backend code for single tables, master-detail tables, one-to-many relationships, and three-level nested detail tables (Master -> Detail -> Sub-Detail). Generated features include querying, deleting, adding, modifying, importing, exporting, approval workflows, forms, tables, and print data source binding.
vol-table Feature Overview
The
vol-tablecomponent supports the following advanced features:- Data Binding: Supports both
url(API) andtableData(manual) modes. - Inline Editing: Supports various input types (text, dropdown, date picker, file upload).
- Pagination: Built-in pagination with customizable size and info.
- Sorting & Filtering: Column-level sorting and header-based filtering.
- Aggregation: Column totals with customizable formats.
- Tree Structure: Supports tree tables with lazy loading and expansion control.
- Drag & Drop: Supports row reordering via dragging.
- Multi-level Headers: Supports complex header configurations.
- Cross-page Selection: Maintains selection state across different pagination pages.
- High Performance:
tableV2mode for handling large datasets. - Custom Rendering: Use the
renderfunction to customize cell content. - Fixed Columns: Support for left or right fixed columns.
- Cell Merging: Custom rules for merging cells.
- Data Binding: Supports both
vol.pro Web Platform Technology Stack
vol.pro is a cross-platform development framework for Web and Mobile applications. The core technology stack consists of:
- Frontend: Vue3, Vite, and TypeScript
- Backend: .NET 8, EFCore 8, and SqlSugar
- Mobile: Uni-app (supports automatic code generation)
Configure independent databases for different business types
The system supports 'Business Database Sharding' (业务分库), enabling developers to configure independent databases for different types of business logic. It allows the simultaneous use of multiple database types within a single project—including MySQL, SQL Server, Oracle, and PostgreSQL—and supports automatic code generation for these configurations.Vol Framework AI Skill Execution Contract
The AI Skill follows a strict execution contract to ensure business logic is implemented without overwriting generated files or breaking the architecture. The workflow is:
- Keyword search for requirements.
- Determine target: Backend only, Frontend only, or Full-stack.
- Determine UI pattern: If
Edit.vueexists, use 'New Page Edit' mode; otherwise, use 'Standard view-grid' ({Table}.vue). - Write to specific files:
Partial/{Table}Service.cs,{Table}.vue,Edit.vue, or newSelectXxx.vuecomponents.
Strict Prohibitions:
- Do NOT write business logic in
.jsxfiles. - Do NOT manually modify
options.js. - Do NOT modify non-Partial Services or Controllers.
- Do NOT modify ViewGrid source code.
Configure No-Code Development Mode
The platform supports a comprehensive No-Code development mode. Key capabilities include:
- Custom selection sorting.
- Document coding functions.
- Data permission management.
- Custom SQL validation for legality.
- Initialization parameters consistent with coded development.
Retrieve the previous approval node
Use theGetTablePreFlowStep()method on a table entity (with a valid primary key) to retrieve information about the previous approval node in the workflow.Order order = new Order(); order.Id = value; // Get the previous approval node information List<Sys_WorkFlowTableStep> steps2 = order.GetTablePreFlowStep();Understand the view-grid component architecture
view-gridacts as the master controller for generated pages, managing lifecycle hooks (e.g.,onInit,searchBefore,addBefore), page properties, and public methods. It internally rendersvol-formandvol-tablecomponents to handle the search area, edit forms, main tables, and detail tables. Configuration for these internal components is passed via theoptionsobject in the page's.vuefile.view-grid ├── vol-form ref="searchForm" ← searchFormFields / searchFormOptions(查询区) ├── vol-table ref="table" ← columns(主表列表) └── 编辑弹框 (vol-box) ├── vol-form ref="form" ← editFormFields / editFormOptions(主表编辑) └── vol-table ref="detail" ← detail.columns / detailOptions(明细,一对多另有 details[])Deploy the project frontend
- Configure the backend API base URL by modifying
src\api\http.js. Setaxios.defaults.baseURLto the deployed backend address. - Run the
build.batfile located in the../VolPro.vue/directory. The production-ready files will be generated in thedistfolder.
// In src\api\http.js axios.defaults.baseURL = 'http://your-deployed-backend-address';- Configure the backend API base URL by modifying
Database access rules and repository patterns in Vol framework
Business logic must be implemented inPartial/{Table}Service.cs. Use EF LINQ via the injected repository for database operations. Avoid writing complex LINQ in Controllers. For cross-table operations, inject the required repository into the Service constructor using[ActivatorUtilitiesConstructor].public partial class Sys_WorkFlowTableService { private readonly ISys_WorkFlowTableRepository _repository; private readonly ISys_WorkFlowTableStepRepository _stepRepository; [ActivatorUtilitiesConstructor] public Sys_WorkFlowTableService( ISys_WorkFlowTableRepository dbRepository, IHttpContextAccessor httpContextAccessor, ISys_WorkFlowTableStepRepository stepRepository) : base(dbRepository) { _repository = dbRepository; _stepRepository = stepRepository; // Access to other tables } }Implement custom main table queries in Service layer
To customize the data retrieval for a main table, override theGetPageDatamethod in thePartial/{TableName}Service.csfile. You can assign values to variousFunc/Actionproperties (defined inApplicationServiceBase.cs) to control filtering, sorting, and post-processing before callingbase.GetPageData(options).public override PageGridData<YourEntity> GetPageData(PageDataOptions options) { // 1. Handle extra parameters passed from the frontend (searchBefore method) object extraValue = options.Value; // 2. Filter or extract specific search parameters from the relative list QueryRelativeList = (List<SearchParameters> parameters) => { foreach (var item in parameters) { if (item.Name == "TargetField") { string value = item.Value; item.Value = null; // Clearing the value prevents the framework from using it automatically } } }; // 3. Define custom query expressions (IQueryable for EF, ISugarQueryable for SqlSugar) QueryRelativeExpression = (IQueryable<YourEntity> queryable) => { // Example: Filter by current user queryable = queryable.Where(x => x.CreateID == UserContext.Current.UserId); // Example: Include related detail tables queryable = queryable.Include(x => x.DetailTable); return queryable; }; // 4. Specify multiple fields for sorting OrderByExpression = x => new Dictionary<object, QueryOrderBy>() { { x.CreateDate, QueryOrderBy.Desc }, { x.PhoneNo, QueryOrderBy.Asc } }; // 5. Perform operations on the result set before returning to the page GetPageDataOnExecuted = (PageGridData<YourEntity> grid) => { List<YourEntity> rows = grid.rows; }; var res = base.GetPageData(options); // Optional: Add extra data to be received by frontend searchAfter(rows, res) res.extra = new { CustomValue = 123 }; return res; }Customize content in detail tables
To customize the content of a detail table, you can implement logic in either Vue 3 or Vue 2 depending on your project setup. For Vue 3, use data slotting directly within the generated.vuefile. For Vue 2, implement the logic within themethodssection of the generated.jsxfile.