1.0.68 • Published 1 month ago

@winnerlc/model-generator v1.0.68

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

模型协议-页面元数据解析器

使用方式

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.0.68

1 month ago

1.0.67

1 month ago

1.0.66

2 months ago

1.0.65

4 months ago

1.0.64

4 months ago

1.0.63

4 months ago

1.0.62

4 months ago

1.0.61

4 months ago

1.0.60

4 months ago

1.0.59

4 months ago

1.0.55

5 months ago

1.0.58

5 months ago

1.0.57

5 months ago

1.0.56

5 months ago

1.0.54

5 months ago

1.0.51

5 months ago

1.0.53

5 months ago

1.0.52

5 months ago

1.0.50

5 months ago

1.0.48

5 months ago

1.0.49

5 months ago

1.0.47

5 months ago

1.0.46

5 months ago

1.0.45

5 months ago

1.0.44

5 months ago

1.0.43

5 months ago

1.0.42

5 months ago

1.0.41

5 months ago

1.0.40

5 months ago

1.0.39

5 months ago

1.0.38

5 months ago

1.0.37

6 months ago

1.0.36

6 months ago

1.0.35

6 months ago

1.0.34

6 months ago

1.0.33

6 months ago

1.0.32

6 months ago

1.0.31

6 months ago

1.0.30

6 months ago

1.0.29

6 months ago

1.0.28

6 months ago

1.0.27

6 months ago

1.0.26

6 months ago

1.0.25

6 months ago

1.0.24

6 months ago

1.0.23

7 months ago

1.0.22

7 months ago

1.0.21

8 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

9 months ago