# dplatform-adaptor

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

Latest version **1.0.3** (published 2021-07-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install dplatform-adaptor
pnpm add dplatform-adaptor
yarn add dplatform-adaptor
bun add dplatform-adaptor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-07-20 |
| First published | 2021-06-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.5 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | ecnatsiDehTog |
| Maintainers | shenhui19920926 |

## Links

- npm: https://www.npmjs.com/package/dplatform-adaptor
- npm.io page: https://npm.io/package/dplatform-adaptor

## Dependencies (3)

- [dva](https://npm.io/package/dva.md) ^2.6.0-beta.20
- [swr](https://npm.io/package/swr.md) ^0.3.2
- [uuid](https://npm.io/package/uuid.md) ^8.3.1

## Recent versions

- 1.0.3 (latest) — 2021-07-20
- 1.0.2 — 2021-06-21
- 1.0.1 — 2021-06-01
- 1.0.0 — 2021-06-01

## 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

2. 项目框架
React + umi + antd 

语言： Typescript（也可用js）

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

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

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

3.1 Adapter 类成员

```.ts
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 // 获取当前模块的节点
```

4. 项目发布
1、npm run build 发包的方式发布，不走 ship
2、npm publish

---
_Source: https://npm.io/package/dplatform-adaptor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
