baidu / baidu/amis

1.10.0+版本crud点击联动功能异常

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

Description

#### 描述问题:

1.10.0+版本crud点击联动功能异常,初始联动加载地址正常,点击item后联动错误地址,目标联动对象未刷新。
(type=crud 中 的 itemAction 联动功能)
#### 截图或视频:
1.10.0 版本异常如下图所示:
![bug01](https://user-images.githubusercontent.com/54793128/172827253-4c1fbf54-269e-4d42-b985-eb8a238997b7.png)
1.9.1-beta.11 版本正常
![normal01](https://user-images.githubusercontent.com/54793128/172830363-606934b8-0720-475d-af23-a33d78348706.png)
#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
`sdk`、`npm` 或`其他`...
npm 安装,script标签引入sdk.js
2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
已验证 1.10.0 / 1.10.1 / v2.0.0-rc.10 联动功能异常
3. 粘贴有问题的完整 `amis schema` 代码:
```

(function () {
let amis = amisRequire('amis/embed');
let amisJSON =
{
"type": "page",
"body": {
"type": "tabs",
"direction": "horizontal",
"tabs": [
{
"title": "DOCLEVER-检索",
"body": {
"type": "grid",
"columns": [
{
"title": "接口检索",
"body": {
"type": "crud",
"draggable": true,
"api": "http://192.168.60.156:8085/",
"perPage": 10,
"syncLocation": false,
"itemAction": {
"actionType": "reload",
"target": "detailCRUD?projectId=${id}"
},
"filter": {
"title": "条件搜索",
"submitText": "",
"body": [
{
"type": "select",
"placeholder": "检索类型",
"name": "action",
"selectFirst": true,
"options": [
"projects",
"interfaces"
]
},
{
"type": "select",
"placeholder": "检索范围",
"name": "type",
"selectFirst": true,
"options": [
"url",
"desc"
]
},
{
"type": "input-text",
"placeholder": "检索内容",
"name": "search"
},
{
"type": "submit",
"label": "搜索"
},
{
"type": "reset",
"label": "重置"
}
]
},
"columns": [
{
"name": "id",
"label": "ID"
},
{
"name": "projectName",
"label": "项目名称"
},
{
"name": "name",
"label": "接口名称"
},
{
"name": "url",
"label": "api url"
},
{
"name": "remark",
"label": "备注"
},
{
"name": "ownerName",
"label": "所有者"
}
]
}
},
{
"body": [
{
"filter": {
"title": "条件搜索",
"submitText": "",
"body": [
{
"type": "select",
"placeholder": "检索范围",
"name": "type2",
"selectFirst": true,
"options": [
"url",
"desc"
]
},
{
"type": "input-text",
"placeholder": "检索内容",
"name": "search2"
},
{
"type": "submit",
"label": "搜索"
},
{
"type": "reset",
"label": "重置"
}
]
},
"type": "crud",
"name": "detailCRUD",
"perPage": 20,
"headerToolbar": [],
"syncLocation": false,
"api": "http://192.168.60.156:8085/?action=interfaces",
"itemAction": {
"type": "button",
"actionType": "dialog",
"dialog": {
"title": "参数",
"body": {
"levelExpand": 2,
"jsonTheme": "eighties",
"type": "json",
"source": "${param}"
}
}
},
"columns": [
{
"name": "id",
"label": "ID"
},
{
"name": "projectName",
"label": "项目名称"
},
{
"name": "groupName",
"label": "分组名称"
},
{
"name": "name",
"label": "接口名称"
},
{
"name": "url",
"label": "api url"
},
{
"name": "remark",
"label": "备注"
},
{
"name": "ownerName",
"label": "所有者"
}
]
}
]
}
]
}
},
{
"title": "PHP接口-检索",
"body": {
"filter": {
"title": "条件搜索",
"submitText": "",
"body": [
{
"type": "input-text",
"placeholder": "类名",
"name": "op"
},
{
"type": "input-text",
"placeholder": "方法名",
"name": "func"
},
{
"type": "input-text",
"placeholder": "接口名称/描述",
"name": "desc"
},
{
"type": "submit",
"label": "搜索"
},
{
"type": "reset",
"label": "重置"
}
]
},
"type": "crud",
"api": "http://192.168.60.156:8080/wwwroot/gitweb/job/inc/autoRun/local/searchInterfaces.php",
"syncLocation": false,
"footable": true,
"perPage": 10,
}
}
]
}
}

let amisScoped = amis.embed('#root', amisJSON);
})();

```

4. 操作步骤
使用(type=crud 中 的 itemAction 联动功能)联动两个CRUD,点击第一个CRUD的item,无法联动第二个CRUD

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the provided embedded AMIS schema, focusing on the first CRUD's itemAction reload targeting detailCRUD?projectId=${id}. Compare behavior across 1.9.1-beta.11 and the reported newer versions, then trace the CRUD itemAction linkage and reload path. Done means clicking an item requests the intended target URL and refreshes the second CRUD.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.