Write a JSON page description and place it in `tables` In the directory, a set of interfaces for data list, data display and data editing can be realized.
In a similar way, it is also possible to describe the analytical chart interface (charts directory), the dashboard interface (
kanban directory) and data screen interface (screens directory).
For special pages, you can write HTML
The page, placed in the ui directory, can be displayed as a stand-alone interface or embedded in the management system through an iframe.
The data table provides a set of RESTFul APIs, and the data management interface calls these APIs to realize functional interaction such as adding, deleting, modifying, and querying data forms.
API
Request Method
Routing
Description
search
GET
/api/xiang/table/<table name>/search
Query by criteria, pagination.
select
GET
/api/xiang/table/<table name>/select
List query, return the data format agreed by the select component.
find
GET
/api/xiang/table/<table name>/find/:id
Query a single record by primary key.
save
POST
/api/xiang/table/<table name>/save
Save a single record, there is a primary key update, there is no primary key creation.
delete
POST
/api/xiang/table/<table name>/delete/:id
Delete a single record by primary key.
insert
POST
/api/xiang/table/<table name>/insert
Batch add records.
delete-where
POST
/api/xiang/table/<table name>/delete/where
Batch delete eligible records.
delete-in
POST
/api/xiang/table/<table name>/delete/in
Batch delete data records with a specified set of primary keys.
update-where
POST
/api/xiang/table/<table name>/update/where
Batch update eligible records.
update-in
POST
/api/xiang/table/<table name>/update/in
Batch update data records with a specified set of primary keys.
quicksave
POST
/api/xiang/table/<table name>/quicksave
Save multiple records, there is a primary key update, there is no primary key creation.
setting
GET
/api/xiang/table/<table name>/setting
Read data table configuration information for front-end interface rendering
The data table document consists of basic table information, data model binding, business structure mapping table, field mapping table, filter mapping table, list page, edit page, batch insert page and detail page.
{
"name":"Cloud Service Library",
"version":"1.0.0",
"bind":{},
"apis":{},
"columns":{},
"filters":{},
"list":{},
"edit":{},
"view":{},
"insert":{}
}
Fields
Type
Description
Required Fields
name
String
data table name
yes
version
String
Version number, used for dependency check and development platform rendering
yes
bind
Object Bind
Bind the data model.
No
hooks
[key:String]:String
Data table Hook
No
apis
[key:String]:Object API
Data management API settings. For example, if the binding data model is set, the data management API will be automatically generated according to the model information, and the automatically generated API can be overwritten by setting the configuration information of the same key.
No
columns
[key:String]:Object Column
Field rendering settings. If the binding data model is set, the associated components are automatically set according to the field type information, and the automatically generated associated component information can be overwritten by setting the configuration information of the same key.
No
filters
[key:String]:Object Filter
Query filter settings. For example, if the binding data model is set, the associated components are automatically set according to the index and field information, and the automatically generated associated component information can be overwritten by setting the configuration information of the same key.
You can bind the data table to the data model by setting model and withs. After binding, the application engine will generate apis, columns and fliters configurations according to the data model definition. If you need special declarations, you can add special configuration information with the same key. You can also add fields in columns, fliters for rendering on each page.
The data table will provide interfaces such as adding, deleting, modifying and checking, and completing data management operations through these interfaces. For example, if the binding data model is set, the data management API will be automatically generated according to the model information. By setting the configuration information of the same key, the automatically generated API can be overwritten. The API input and output data structure must be consistent with the original interface.
Binding process (process) input and output data structures must be consistent with the original interface
yes
guard
String
Interface authentication middleware, multiple are separated by ,, set to -, no authentication middleware is set, and no default authentication mode is set.
No
default
Array<Any>
The default value of the parameter table, if there is no default value, it can be set to null, such as [null, null, 15]
It is possible to set the presentation method of fields in list rendering (view), list editing (edit) and edit form (form). Fields can be added freely and can be used in the rendering settings of each page. For example, if the binding data model is set, the corresponding presentation is automatically generated according to the field name and field type of the data model, and the automatically generated presentation information can be overwritten by setting the configuration information of the same key. Field rendering mapping table, which can be read from the setting interface.
You can add data query conditions to display by setting query filters. Query filters are freely added and can be used in listing page rendering settings. For example, if the binding data model is set, the corresponding configuration is automatically generated according to the data model index name and field information, and the automatically generated configuration information can be overwritten by setting the configuration information of the same key. Query filter mapping table, which can be read from the setting interface.
Component properties, see the corresponding component documentation for details. String, Number and Variable can be used in property parameters.
No
components
Array<Any>
Composite component, referencing an atomic component name or description. ["Billing method", "Industry coverage", {"name":"Name", "props":{}}]
No
Using variables in properties (props)
CanIn properties (props), you can use {{field name}} or :field name to refer to the current record data, support using . to access Object or Array type data, such as {{ field name.foo.bar}}, {{fieldname.0.foo}}, :fieldname.foo.bar, :fieldname.0.foo
Table API input and output data can be processed using Hooks. Hooks are divided into two categories: before and after. Before hook, which runs before the API call, can be used to process incoming parameters, and after hook, which runs after the API call and can be used to process query results.
When describing the data table, in the hooks field, declare the handler associated with the Hook, for example:
Write a JSON page description and place it in `tables` In the directory, a set of interfaces for data list, data display and data editing can be realized.
In a similar way, it is also possible to describe the analytical chart interface (charts directory), the dashboard interface (
kanban directory) and data screen interface (screens directory).
For special pages, you can write HTML
The page, placed in the ui directory, can be displayed as a stand-alone interface or embedded in the management system through an iframe.
The data table provides a set of RESTFul APIs, and the data management interface calls these APIs to realize functional interaction such as adding, deleting, modifying, and querying data forms.
API
Request Method
Routing
Description
search
GET
/api/xiang/table/<table name>/search
Query by criteria, pagination.
select
GET
/api/xiang/table/<table name>/select
List query, return the data format agreed by the select component.
find
GET
/api/xiang/table/<table name>/find/:id
Query a single record by primary key.
save
POST
/api/xiang/table/<table name>/save
Save a single record, there is a primary key update, there is no primary key creation.
delete
POST
/api/xiang/table/<table name>/delete/:id
Delete a single record by primary key.
insert
POST
/api/xiang/table/<table name>/insert
Batch add records.
delete-where
POST
/api/xiang/table/<table name>/delete/where
Batch delete eligible records.
delete-in
POST
/api/xiang/table/<table name>/delete/in
Batch delete data records with a specified set of primary keys.
update-where
POST
/api/xiang/table/<table name>/update/where
Batch update eligible records.
update-in
POST
/api/xiang/table/<table name>/update/in
Batch update data records with a specified set of primary keys.
quicksave
POST
/api/xiang/table/<table name>/quicksave
Save multiple records, there is a primary key update, there is no primary key creation.
setting
GET
/api/xiang/table/<table name>/setting
Read data table configuration information for front-end interface rendering
The data table document consists of basic table information, data model binding, business structure mapping table, field mapping table, filter mapping table, list page, edit page, batch insert page and detail page.
{
"name":"Cloud Service Library",
"version":"1.0.0",
"bind":{},
"apis":{},
"columns":{},
"filters":{},
"list":{},
"edit":{},
"view":{},
"insert":{}
}
Fields
Type
Description
Required Fields
name
String
data table name
yes
version
String
Version number, used for dependency check and development platform rendering
yes
bind
Object Bind
Bind the data model.
No
hooks
[key:String]:String
Data table Hook
No
apis
[key:String]:Object API
Data management API settings. For example, if the binding data model is set, the data management API will be automatically generated according to the model information, and the automatically generated API can be overwritten by setting the configuration information of the same key.
No
columns
[key:String]:Object Column
Field rendering settings. If the binding data model is set, the associated components are automatically set according to the field type information, and the automatically generated associated component information can be overwritten by setting the configuration information of the same key.
No
filters
[key:String]:Object Filter
Query filter settings. For example, if the binding data model is set, the associated components are automatically set according to the index and field information, and the automatically generated associated component information can be overwritten by setting the configuration information of the same key.
You can bind the data table to the data model by setting model and withs. After binding, the application engine will generate apis, columns and fliters configurations according to the data model definition. If you need special declarations, you can add special configuration information with the same key. You can also add fields in columns, fliters for rendering on each page.
The data table will provide interfaces such as adding, deleting, modifying and checking, and completing data management operations through these interfaces. For example, if the binding data model is set, the data management API will be automatically generated according to the model information. By setting the configuration information of the same key, the automatically generated API can be overwritten. The API input and output data structure must be consistent with the original interface.
Binding process (process) input and output data structures must be consistent with the original interface
yes
guard
String
Interface authentication middleware, multiple are separated by ,, set to -, no authentication middleware is set, and no default authentication mode is set.
No
default
Array<Any>
The default value of the parameter table, if there is no default value, it can be set to null, such as [null, null, 15]
It is possible to set the presentation method of fields in list rendering (view), list editing (edit) and edit form (form). Fields can be added freely and can be used in the rendering settings of each page. For example, if the binding data model is set, the corresponding presentation is automatically generated according to the field name and field type of the data model, and the automatically generated presentation information can be overwritten by setting the configuration information of the same key. Field rendering mapping table, which can be read from the setting interface.
You can add data query conditions to display by setting query filters. Query filters are freely added and can be used in listing page rendering settings. For example, if the binding data model is set, the corresponding configuration is automatically generated according to the data model index name and field information, and the automatically generated configuration information can be overwritten by setting the configuration information of the same key. Query filter mapping table, which can be read from the setting interface.
Component properties, see the corresponding component documentation for details. String, Number and Variable can be used in property parameters.
No
components
Array<Any>
Composite component, referencing an atomic component name or description. ["Billing method", "Industry coverage", {"name":"Name", "props":{}}]
No
Using variables in properties (props)
CanIn properties (props), you can use {{field name}} or :field name to refer to the current record data, support using . to access Object or Array type data, such as {{ field name.foo.bar}}, {{fieldname.0.foo}}, :fieldname.foo.bar, :fieldname.0.foo
Table API input and output data can be processed using Hooks. Hooks are divided into two categories: before and after. Before hook, which runs before the API call, can be used to process incoming parameters, and after hook, which runs after the API call and can be used to process query results.
When describing the data table, in the hooks field, declare the handler associated with the Hook, for example: