baidu / baidu/amis

input-table内选择框不能使用componentName 刷新数据

Open
#7,149 0 comments 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

#### 描述问题:

input-table内选择框不能使用componentName 刷新数据, 使用componentId刷新选择框数据只能刷新第一行的,如果有多条数据就会出现只刷第一行选择框数据

#### 截图或视频:

![1686574045344](https://github.com/baidu/amis/assets/48676074/8925c7fb-3259-4be3-baac-2f7497fbdad8)

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

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

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
3.1.1
3. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "page",
"body": [
{
"type": "page",
"body": [
{
"type": "form",
"debug": "true",
"data": {
},
"api": "/amis/api/mock2/form/saveForm",
"body": [
{
"type": "input-table",
"name": "facProjectSectionList2",
"label": "",
"columns": [
{
"label": "险类",
"name": "sectionId",
"quickEdit": {
"type": "select",
"name": "sectionId",
"id": "u:7ef399998e52",
"mode": "inline",
"options": [
{
"label": "a",
"value": "a",
"pid": "a"
},
{
"label": "b",
"value": "b",
"pid": "b"
},
{
"label": "c",
"value": "c",
"pid": "c"
}
],
"editorPath": "input.base.default",
"onEvent": {
"change": {
"weight": 0,
"actions": [
{
"args": {
"index": "${index}",
"value": {
"facShare": "$facShare",
"riskLevel": "$riskLevel",
"sumInsured": "$sumInsured",
"sectionId": "$sectionId",
"pid": "${event.data.selectedItems.pid}",
"subSection": "",
"sectionNo": "$sectionNo"
}
},
"actionType": "setValue",
"componentId": "u:c586b33fdd20"
},
{
"actionType": "reload",
// "componentId": "u:6c39c4da78d1"
"componentName": "subSection",
"groupType": "component"
}
]
}
},
"multiple": false
},
"id": "u:1fd61a18b158",
"placeholder": "-"
},
{
"label": "二级险类",
"name": "subSection",
"quickEdit": {
"type": "select",
"name": "subSection",
"id": "u:6c39c4da78d1",
"source": {
"data": {
"pid": "$pid"
},
"method": "get",
"adaptor": "",
"messages": {
},
"requestAdaptor": "",
"url": "/co/dict/getCategoryList"
},
"editorPath": "input.base.default",
"multiple": false
},
"id": "u:3aee0a357db5"
}
],
"addable": true,
"footerAddBtn": {
"label": "新增",
"icon": "fa fa-plus",
"id": "u:51aaecc8b715"
},
"strictMode": true,
"id": "u:c586b33fdd20",
"minLength": 0,
"needConfirm": false,
"editable": false,
"removable": true
},
{
"type": "select",
"label": "选项",
"name": "select",
"id": "u:a7c3ba5fa679",
"source": {
"data": {
"pid": "$pid"
},
"method": "get",
"adaptor": "",
"messages": {
},
"requestAdaptor": "",
"url": "/co/dict/getCategoryList"
},
"multiple": false
},
{
"type": "button",
"label": "下拉框刷新接口",
"onEvent": {
"click": {
"actions": [
{
"groupType": "component",
"actionType": "reload",
// "componentId": "u:a7c3ba5fa679",
"componentName": "select"
}
]
}
},
"id": "u:10cf5505f1b7"
}
],
"id": "u:681522b22909"
}
],
"id": "u:5f4fd1351615"
}
],
"id": "u:f81147ceccd4",
"pullRefresh": {
"disabled": true
}
}
```

4. 操作步骤
新增一条数据 选择险类, 看二级险类的接口是否调用

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the provided AMIS schema with multiple input-table rows, focusing on the quick-edit select fields and their reload actions. Compare componentName and componentId behavior after selecting an item, and consider the issue resolved when the dependent subSection request refreshes for every row rather than only the first.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.