baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.22k stars 2.5k forks source link

input-table 在编辑时的几个问题 #8241

Closed songyinhai2006 closed 5 months ago

songyinhai2006 commented 1 year ago

描述问题:

1、将字段设置数字类型,一个设置默认1,一个设置默认0,新增的时候都没有默认。 2、将数字设置必填校验,没有完全校验到,只校验了部分; 3、如果关闭确认模式,那么在加载数据的时候有很多请求,如截图2。启用确认模式不会有那么多请求。是否可以考虑在相关事件的时候触发,要不太多请求了。

截图或视频:

image

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? sdk

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在 3.4.2

  3. 粘贴有问题的完整 amis schema 代码: { "type": "page", "id": "u:ce3e5dc31fa0", "asideResizor": false, "regions": [ "body" ], "body": [ { "type": "form", "title": "表单", "body": [ { "label": "文本框", "type": "input-text", "name": "text", "id": "u:6d4d6d1de8f0" }, { "type": "input-table", "name": "table", "label": "表格表单", "columns": [ { "label": "名称", "name": "name", "quickEdit": { "type": "input-text", "name": "name", "id": "u:212368682b63" }, "id": "u:750accc30b1c" }, { "label": "分数", "name": "score", "quickEdit": { "type": "input-number", "name": "score", "id": "u:cd8af6688958", "keyboard": true, "step": 1, "precision": 2, "value": 1, "mode": "popOver", "required": true }, "id": "u:1aeaedb66477", "placeholder": "-" }, { "label": "等级", "name": "level", "quickEdit": { "type": "input-number", "name": "level", "id": "u:875bdcbae84f", "keyboard": true, "step": 1, "value": 0, "precision": 2, "mode": "popOver", "required": true }, "id": "u:465f8c2ee576", "placeholder": "-" } ], "addable": true, "footerAddBtn": { "label": "新增", "icon": "fa fa-plus", "id": "u:0310dd6e6eaa" }, "strictMode": true, "id": "u:d3138d95c23b", "minLength": 0, "needConfirm": false } ], "id": "u:57b6d748d5bc" } ], "style": { "boxShadow": " 0px 0px 0px 0px transparent" } }

github-actions[bot] commented 1 year ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

lhtuling commented 1 year ago

默认数据问题 应该是默认添加时候直接给数组push了个 {} 空对象 这个问题可以靠不用组件内的新增 自己搞个按钮用add事件完成 https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-table#add

Amis低代码前端框架交流群【QQ1群】:717791727 Amis低代码前端框架交流群【QQ2群】:721182449