Skip to content

表单新字段类型 array (列表内的字典), 用户可以点击增加子项 #31

@LeoQuote

Description

@LeoQuote

场景

用户需要批量申请很多个资源, 比如需要创建很多个用户, 每个用户都有 姓名, id, 邮箱这些选项

- name: xxx
  id: 1
  email: [email protected]
- name: yyy
  id: 2
  email: [email protected]

当然这些表单也可以转成单个表单, 由用户填很多个单独的表单, 但是审核和申请起来都比较麻烦.

如何实现

前端

做一个新的 widget ,渲染出来是由单行的表单组成, 大概这样

企业微信截图_15958384618109

schema 描述应该是:

"user":{
  "description":"用户",
  "required":true,
  "type":"array",
  "fields": {
    "name": {"description": "用户名", "required":true, "type": "string"},
    "email": {"description": "email", "required":true, "type": "string"},
  }
}

传数据到后端的时候, 目前用的form 表单, 应该是类似 user[0].name = 'xxx' 这样的数据, 这样的数据给到 widge 的时候, 应该是个list , widget 根据 list 内容渲染.

后端

后端看各个provider 的支持情况, airflow 本身比较灵活, 支持应该问题不大, 其他的就不太清楚.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions