From 436fb3dd33f73a0b8b454123f336ccbc5ea54ecf Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2698393+2betop@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:12:08 +0800 Subject: [PATCH] =?UTF-8?q?doc:=20=E8=A1=A5=E5=85=85=20CRUD=20=E5=85=B1?= =?UTF-8?q?=E7=94=A8=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=96=87=E6=A1=A3?= =?UTF-8?q?=20(#11234)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/crud.md | 118 ++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/docs/zh-CN/components/crud.md b/docs/zh-CN/components/crud.md index 58f237891..48cac667b 100755 --- a/docs/zh-CN/components/crud.md +++ b/docs/zh-CN/components/crud.md @@ -881,6 +881,124 @@ Cards 模式支持 [Cards](./cards) 中的所有功能。 } ``` +## 多个列表共用一套查询条件 + +如果希望一个查询表单作用在多个列表中,可以直接 `form + n * crud` 的方式。将 form 的提交目标给到多个 crud。 + +> 注意:如果一个页面有多个 crud,请控制同步地址栏的 crud 数量不要超过一个。否则会相互干扰 + +```schema +{ + "type": "page", + "body": [ + { + "title": "条件搜索", + "type": "form", + "target": "crud1,crud2", + "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": "reset", + "label": "重置" + }, + { + "type": "submit", + "level": "primary", + "label": "查询" + } + ] + }, + + { + "type": "crud", + "name": "crud1", + "perPage": 5, + "syncLocation": false, + "title": "CRUD 1", + "api": "/api/mock2/sample", + "columns": [ + { + "name": "id", + "label": "ID" + }, + { + "name": "engine", + "label": "Rendering engine" + }, + { + "name": "browser", + "label": "Browser" + } + ] + }, + { + "type": "crud", + "name": "crud2", + "title": "CRUD 2", + "syncLocation": false, + "api": "/api/mock2/sample", + "columnsTogglable": false, + "perPage": 5, + "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" + } + ] + } + ] +} +``` + ## 配置默认请求参数 可以配置`defaultParams`,来指定拉取接口时的默认参数: