Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

za-dplatform-adaptor

wsq19921281.0.75TypeScript support: included

使用改工具包的项目 1、商品中心 预览和创建投保流程配置的时候 2、模版工具 创建 3、投保流程配置 一键重置

readme

umi project

使用改工具包的项目

1、商品中心 预览和创建投保流程配置的时候 2、模版工具 创建 3、投保流程配置 一键重置

Getting Started

模板工具

http://27842-zat-caerus-template-biz.test.za-tech.net/swagger-ui.html#/template45controller

商品

http://zat-caerus-bops.test.za-tech.net/swagger-ui.html#!/218302169730456208512638121153/queryGoodsStructureUsingPOST

优化点

  • 适配可以直接接受模板str和商品data进行适配
  • 支持模块级别适配
  • 支持单页面适配
  • 查询商品信息接口缓存,避免多次适配时会重复调取接口
  1. 仓库信息 https://git.zhonganinfo.com/zainfo/za-platform-adapter

开发分支:dev

  1. 项目框架 React + umi + antd

语言: Typescript(也可用js)

  1. 项目架构 此项目主要核心部分是数据的处理,在设计上每个组件都是一个对应的继承自 Adapter 的派生类

如果你的组件属性完全可以通过组件管理中的 attribute 决定,那就不需要做什么,否则请在 src/components 目录中建同名文件并默认导出

运行 npm run start 后会打开一个开发调试页面,输入对应的模块 code 和商品 id 可以用对应的数据进行开发测试

3.1 Adapter 类成员

async init(): thisType // 适配实例化后会立即执行的一段初始化方法
get attrs(): {} // attrs 属性
getConfigAttrs(): {} // 返回组件的完整属性
getParentNode() // 返回父节点信息
getChildren(Node) // 查找子节点
loadChild(Component: Adapter, template: {}, params: any[]) // 实例化一个节点对象 params会传递到 Adapter 中的 init 方法里解构成入参

public plan: Goods.PlanList // 如果模块勾选了计划层级,可以通过这个属性获取到商品的当前计划信息
public goods: Goods // 去商品详情
public template // 当前组件的模板信息
public module: Module // 获取当前模块的节点
  1. 项目发布 1、npm run build 发包的方式发布,不走 ship 2、npm publish
  1. 分支管理

保险基线 dev 分支 鲸小宝 jxb 分支 华润项目使用分支 dev_hr 分支

模版工具配置模块数据

{
    "id": 1955,
    "code": "LAY_001955",
    "type": "1-1",
    "component": "paymentPlanModule",
    "name": "通用试算信息收集",
    "style": null,
    "css": null,
    "relationKey": null,
    "attribute": {
        "showTitle": true,
        "showPlan": true,
        "relationKey": "", // 可以指定关联的 投保人、被保人、受益人、代理人模块要素  
    },
    "relations": [ // 模块包含的子组件
        {
            "id": 3292,
            "componentModuleCode": "COM_002161",
            "componentModuleName": "通用投保要素",
            "relationKey": "common.insuranceStartDate",
            "componentOrder": "0",
            "attribute": {
                "label": "起保日期"
            }
        },
    ],
    "gmtCreated": "2020-08-07T16:21:17.000+0800",
    "gmtModified": "2020-11-26T13:43:46.000+0800",
    "isDeleted": "N"
}