baidu / baidu/amis

inputTable中嵌套多个inputTable,其中嵌套的子inputTable保存一行数据时,其他子inputTable也会保存一行数据。

Open
#9,983 1 comment 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

inputTable中嵌套多个inputTable,其中嵌套的子inputTable保存一行数据时,其他子inputTable也会保存一行数据。

#### 截图或视频:

https://github.com/baidu/amis/assets/44042778/6cd76471-6a27-41e6-b5a5-2bc85a619601

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

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

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
6.3.0
3. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "page",
"id": "u:57a2b54449b8",
"toolbar": [
{
"type": "button",
"label": "+新增一行",
"id": "u:2c5b928cee97",
"onEvent": {
"click": {
"weight": 0,
"actions": [
{
"componentId": "u:ac1a5a42ed72",
"groupType": "component",
"actionType": "addItem",
"args": {
"item": [
{}
]
}
}
]
}
},
"level": "link"
}
],
"body": [
{
"type": "input-table",
"name": "table",
"label": "",
"columns": [
{
"label": "接口状态",
"name": "apiStatus",
"id": "u:292220c17939",
"quickEdit": {
"type": "select",
"options": [
"启用",
"停用"
],
"id": "u:9a9b65e1d33f"
}
},
{
"label": "接口方式",
"name": "apiMethod",
"quickEdit": {
"type": "select",
"options": [
"POST",
"GET"
],
"id": "u:9a9b65c1d33f"
},
"id": "u:841be0cec255"
},
{
"label": "请求参数",
"name": "requestParameters",
"quickEdit": {
"type": "flex",
"direction": "column",
"id": "u:8ee6dff1ff6a",
"items": [
{
"type": "input-table",
"columns": [
{
"label": "字段",
"name": "requestField",
"id": "u:292220c179bb"
},
{
"label": "字段类型",
"name": "requestFieldType",
"id": "u:292220c179cc",
"quickEdit": {
"type": "select",
"options": [
"Integer",
"String"
],
"id": "u:9a9b65f4d3dd"
}
},
{
"label": "是否必填",
"name": "requestIsRequired",
"id": "u:292220c179ee",
"quickEdit": {
"type": "select",
"options": [
"是",
"否"
],
"id": "u:9a9b65f1d4ff"
}
},
{
"label": "备注",
"name": "requestRemark",
"id": "u:292220c179gg"
}
],
"id": "u:aa9b65f1d3hh",
"minLength": 0,
"name": "新增",
"addable": true,
"showIndex": true,
"removable": true,
"copyable": true
}
]
},
"id": "u:8x1be0cec2jj",
"width": 800
},
{
"label": "返回参数",
"name": "responseParameters",
"quickEdit": {
"type": "flex",
"id": "u:8ee6dff1ff69",
"direction": "column",
"items": [
{
"type": "input-table",
"columns": [
{
"label": "字段",
"name": "responseField",
"id": "u:292220c17939"
},
{
"label": "字段类型",
"name": "responseFieldType",
"id": "u:292220c17939",
"quickEdit": {
"type": "select",
"options": [
"Integer",
"String"
],
"id": "u:9a9b65f4d33f"
}
},
{
"label": "是否必填",
"name": "responseIsRequired",
"id": "u:292220c17939",
"quickEdit": {
"type": "select",
"options": [
"是",
"否"
],
"id": "u:9a9b65f1d43f"
}
},
{
"label": "备注",
"name": "responseRemark",
"id": "u:292220c17939"
}
],
"id": "u:9a9b65f1d33f",
"minLength": 0,
"name": "新增",
"addable": true,
"showIndex": true,
"removable": true,
"copyable": true
}
]
},
"id": "u:841be0cec255",
"width": 800
},
{
"label": "代码类型",
"name": "glueType",
"quickEdit": {
"type": "select",
"id": "u:9a9ba5f1d33f",
"options": [
"JAVA",
"PYTHON"
]
},
"id": "u:841be0cec255"
},
{
"label": "接口创建时间",
"name": "createDateTime",
"id": "u:841be0cec255",
"quickEdit": {
"type": "input-datetime",
"id": "u:9a9b6zf1d33f"
}
},
{
"label": "创建人",
"name": "creator",
"id": "u:841be0cec255"
},
{
"label": "备注",
"id": "u:841be0cec255",
"name": "remark"
},
{
"label": "操作",
"id": "u:8ee1b9a16a43",
"type": "operation",
"buttons": [
{
"label": "删除",
"type": "button",
"level": "link",
"id": "u:3bfadce79870"
}
]
}
],
"needConfirm": false,
"id": "u:ac1a5a42ed72",
"showIndex": true,
"draggable": true,
"perPage": 10,
"columnsTogglable": "auto"
}
],
"data": {
"table": [
{
"a": "a1",
"b": "b1"
},
{
"a": "a2",
"b": "b2"
},
{
"a": "a3",
"b": "b3"
}
],
"inputTableStatic": false
},
"asideResizor": false,
"pullRefresh": {
"disabled": true
}
}
```

4. 操作步骤
直接复制到amis-editor中即可

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested input-table schema from the issue directly in amis-editor, focusing on saving one row in one child table. Done means saving a row in one nested child input-table does not add or save a row in the other child input-table.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.