0.0.21 • Published 7 months ago

umi-plugin-bs-code-gen v0.0.21

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

插件使用指南

umi3 系列 (umi4不支持) yarn add umi-plugin-bs-code-gen -D

在umirc 或者 config添加以下配置 并且注释代表详细说明

codeGenerate: {
 list: {
    // swaggerURL地址
    url:  'http://mep-api-dev.ur.com.cn/oms-ops/v2/api-docs',
    // locale 中英文菜单那个 后续再研究方案怎么进行增量生成 目前先补上
    locale:  'xxx列表',
    // page下的路径
    filePath:  '/aaa/bbb',
    // 详情路径 比如跳往详情
    routePath:  '/a/b/form',
    // 分页的接口路径
    path:  '/itemSkuRelation',
    // 新增的接口路径 默认是post
    addPath:  '/itemSkuRelation',
    // 编辑的接口路径 默认请求方法是patch 列表页一般不走全量更新的put
    editPath:  '/itemSkuRelation/{id}',
    // 'patch'|'put'
    editMethodName:  'patch',
    // 删除的接口路径 默认请求方法是delete
    deletePath:  '/itemSkuRelation/{ids}',
 },
  // 用来做新增 编辑 提交
  form: {
    // 虽然有些是公共的可以提取 但是为了保持独立性
    url:  'http://mep-api-dev.ur.com.cn/oms-ops/v2/api-docs',
    // 跳回列表后刷新的地址
    routePath:  '/a/b/list',
    //获取单据详情的接口 一般通过主键id获取
    detailPath:  '/itemSkuRelation/{id}',
    // 提交地址 根据restful 规范 一般认为 新增 编辑 就是差个id的区别 与detail做区分
    postPath:  '/itemSkuRelation',
    //生成文件地址
    filePath:  '/a/b',
    locale:'xxx表单'
 },
  table:{
    url:'http://mep-api-dev.ur.com.cn/items/v2/api-docs',
    voName:'DictItemResVo',
    filePath:'/aaa/bbb',
    componentName:'table-info',
  }
},

接下来使用命令 umi g listTpl , umi g formTpl 或umi g tableTpl 即可生成列表和表单页面 以及table组件

0.0.21

7 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago