@winnerlc/model-generator v1.0.68
模型协议-页面元数据解析器
使用方式
import modelGenerator from "@winnerlc/model-generator";
let pageSchema = null // 页面协议
pageSchema = modelGenerator.modelGenerator('模型类型', '模型协议')
模板类型
[
{
label: '列表',
value: 'VoucherList'
} ,
{
label: '单卡',
value: 'Voucher'
}
]
模型协议
{
"pageName": "单据类型",
"modelType": "单据类型",
"entity":
{
"objectEntityResponse": {
"entityId": "79",
"entityCode": "A",
"businessObjectUcode": "64dad631e4b090717871da58",
"entityUcode": "64e6c285e4b0576b9f7fb933",
"entityName": "A1",
"tenantCode": "purcotton",
"moduleId": "1428",
"businessObjectId": "7",
"entityDescribe": null,
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12",
"parentEntityName": null,
"parentEntityCode": null,
"parentEntityUcode": null
},
"entityServiceFields": [
{
"entityServiceAttributeId": "120",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"serviceFieldCode": "custCode",
"serviceFieldUcode": "64f6f830e4b003b6774b6a40",
"serviceFieldName": "客户编码",
"dataTypeConfigurationCode": "bigText",
"referenceType": null,
"isRequired": 1,
"delFlag": false,
"version": "V1.0.0",
"fieldDesc": "这个是客户编码",
"defaultValue": "2",
"maxValue": null,
"minValue": null,
"createBy": "1946",
"createTime": "2023-09-05 17:43:12",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"entityServiceAttributeId": "121",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"serviceFieldCode": "custName",
"serviceFieldUcode": "64f6f830e4b003b6774b6a41",
"serviceFieldName": "客户名称",
"dataTypeConfigurationCode": "dateTime",
"referenceType": null,
"isRequired": 1,
"delFlag": false,
"version": "V1.0.0",
"fieldDesc": "这个是客户名称",
"defaultValue": null,
"maxValue": null,
"minValue": null,
"createBy": "1946",
"createTime": "2023-09-05 17:43:12",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"entityServiceAttributeId": "122",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"serviceFieldCode": "custDesc",
"serviceFieldUcode": "64f6f830e4b003b6774b6a42",
"serviceFieldName": "客户描述",
"dataTypeConfigurationCode": "bigText",
"referenceType": null,
"isRequired": 0,
"delFlag": false,
"version": "V1.0.0",
"fieldDesc": "这个是客户描述",
"defaultValue": null,
"maxValue": null,
"minValue": null,
"createBy": "1946",
"createTime": "2023-09-05 17:43:12",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
}
],
"entityRelationship": null,
"entitySystemProperties": [
{
"systemPropertyId": "26",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"systemPropertyType": 1,
"serviceFieldCode": "create_by",
"serviceFieldName": "创建人",
"referenceType": null,
"tenantCode": "purcotton",
"dataTypeConfigurationCode": "text",
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"systemPropertyId": "27",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"systemPropertyType": 1,
"serviceFieldCode": "create_time",
"serviceFieldName": "创建时间",
"referenceType": null,
"tenantCode": "purcotton",
"dataTypeConfigurationCode": "datetime",
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"systemPropertyId": "28",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"systemPropertyType": 1,
"serviceFieldCode": "update_by",
"serviceFieldName": "修改人",
"referenceType": null,
"tenantCode": "purcotton",
"dataTypeConfigurationCode": "text",
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"systemPropertyId": "29",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"systemPropertyType": 1,
"serviceFieldCode": "update_time",
"serviceFieldName": "修改时间",
"referenceType": null,
"tenantCode": "purcotton",
"dataTypeConfigurationCode": "datetime",
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
},
{
"systemPropertyId": "30",
"objectEntityUcode": "64e6c285e4b0576b9f7fb933",
"systemPropertyType": 1,
"serviceFieldCode": "A_id",
"serviceFieldName": "关联实体ID",
"referenceType": null,
"tenantCode": "purcotton",
"dataTypeConfigurationCode": "text",
"version": "V1.0.0",
"delFlag": false,
"createBy": "3277",
"createTime": "2023-08-24 10:37:57",
"updateBy": "1946",
"updateTime": "2023-09-05 17:43:12"
}
],
"searchHelpBinds": [],
"businessScenarios": []
},
"actions":["upload","download"],
"links":{
"add":{
"path":"页面编码",
"title":"xxx-新增",
"query":{"pageId": "xxxx", "uiType":"addModel"}
},
"edit":{
"path":"页面编码",
"title":"xxx-编辑",
"query":{"pageId": "xxxx", "uiType":"editModel"}
},
"info":{
"path":"页面编码",
"title":"xxx-详情",
"query":{"pageId": "xxxx", "uiType":"infoModel"}
}
}
}
最终解析出来的页面协议:
{
"version": "1.0.0",
"componentsTree": [{
"componentName": "Page",
"id": "Page-5x19gz38",
"fileName": "",
"title": "",
"props": {
"class": {
"layout": true,
"span-24": true
},
"winid": "Page-zupdkje4",
"uuid": "Page"
},
"css": {
"scoped": true,
"lang": "scss",
"value": ""
},
"scripts": {
"setup": true,
"lang": "tsx",
"value": ""
},
"dataSource": [],
"objectModels": [],
"state": [{
"id": "params",
"name": "params",
"label": "页面参数模型",
"type": "system",
"dataType": "object",
"fields": []
}, {
"id": "pageData",
"name": "pageData",
"type": "system",
"label": "自定义数据模型",
"dataType": "object",
"fields": []
}],
"children": [{
"componentName": "layout",
"props": {
"class": {
"layout": true,
"span-24": true
},
"winid": "root-uamn2us0",
"uuid": "root"
},
"others": {
"span": "24",
"isPageRoot": true
},
"children": []
}]
}]
}
目录结构
- model:存放模板解析的具体逻辑代码,文件名对应模板名称
- pageSchema:存放对应模板的低代码元数据协议
- demo:存放模板的后端协议
- index.ts文件中modelType变量注册模板信息
文件依赖
"@winnerlc/designer" 依赖当前工程中designer项目的designerProps目录
1 month ago
1 month ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago