baidu / baidu/amis

CRUD 重置表单自动触发查询

Open
#7,786 4 comments 0 reactions 1 assignee Claimed by @hsm-lv View on GitHub
confirmed
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

我在CRUD,filter表单的actions中,增加了 重置按钮(type:reset),期望实现重置功能,但不期望重置之后自动触发表格查询;
即便CRUD initFetch=false,甚至表单中存在必填项是空的,均会触发查询,这应该是个bug

#### 截图或视频:

![20230811175030_rec_](https://github.com/baidu/amis/assets/19227210/5b31363a-3069-4598-b823-a69d6ded4078)

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

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

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

3. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "page",
"body": {
"type": "crud",
"name": "crud",
"syncLocation": false,
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/crud/table4",
"filter": {
"debug": true,
"title": "条件搜索",
"body": [
{
"type": "group",
"body": [
{
"type": "input-text",
"name": "keywords",
"label": "关键字",
"clearable": true,
"placeholder": "通过关键字搜索",
"size": "sm"
},
{
"type": "input-text",
"name": "engine",
"label": "Engine",
"clearable": true,
"size": "sm"
},
{
"type": "input-text",
"name": "platform",
"label": "Platform",
"clearable": true,
"size": "sm"
}
]
}
],
"actions": [
{
"type": "button",
"actionType": "drawer",
"icon": "fa fa-plus",
"label": "创建记录",
"target": "crud",
"closeOnOutside": true,
"drawer": {
"title": "创建记录",
"body": {
"type": "form",
"api": "post:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample",
"body": [
{
"type": "input-text",
"name": "engine",
"label": "Engine"
},
{
"type": "input-text",
"name": "browser",
"label": "Browser"
}
]
}
}
},
{
"type": "reset",
"label": "重置"
},
{
"type": "submit",
"level": "primary",
"label": "查询"
}
]
},
"columns": [
{
"name": "id",
"label": "ID"
},
{
"name": "engine",
"label": "Rendering engine"
},
{
"name": "browser",
"label": "Browser"
},
{
"name": "platform",
"label": "Platform(s)",
"canAccessSuperData": false
},
{
"name": "version",
"label": "Engine version"
},
{
"name": "grade",
"label": "CSS grade"
}
]
}
}
```

4. 操作步骤
参考 [CRUD 查询条件表单](https://baidu.github.io/amis/zh-CN/components/crud?page=1#%E6%9F%A5%E8%AF%A2%E6%9D%A1%E4%BB%B6%E8%A1%A8%E5%8D%95)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.