Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LeoQuote opened this issue Jul 27, 2020 · 0 comments
Labels
enhancement New feature or request ideas

Comments

@LeoQuote
Copy link
Contributor

场景

用户需要批量申请很多个资源, 比如需要创建很多个用户, 每个用户都有 姓名, 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 本身比较灵活, 支持应该问题不大, 其他的就不太清楚.

@LeoQuote LeoQuote added enhancement New feature or request ideas labels Jul 27, 2020
@LeoQuote LeoQuote changed the title 表单新字段类型 [ dict ] 列表内的字典, 用户可以点击增加子项 表单新字段类型 array 列表内的字典, 用户可以点击增加子项 Jul 27, 2020
@LeoQuote LeoQuote changed the title 表单新字段类型 array 列表内的字典, 用户可以点击增加子项 表单新字段类型 array (列表内的字典), 用户可以点击增加子项 Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ideas
Projects
None yet
Development

No branches or pull requests

1 participant