From cede563628ae893614a10d52f398aef4756c372c Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Wed, 21 Apr 2021 00:08:16 +0800 Subject: [PATCH] =?UTF-8?q?Mapping=20=E4=BF=AE=E5=A4=8D=20boolean=20?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E6=98=A0=E5=B0=84=E9=97=AE=E9=A2=98=20(#1837?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 优化 pc 样式 * 样式微调 * Nav 支持 lazyreload * 修复 mapping boolean值映射问题 * 多提交了文件 * 还原 example --- docs/zh-CN/components/mapping.md | 44 +++ examples/components/App.tsx | 4 +- examples/components/CRUD/Aside.jsx | 7 +- examples/components/CRUD/Aside2.jsx | 306 +++++++++++++++ examples/components/Example.tsx | 8 +- examples/style.scss | 26 +- mock/options/nav.js | 63 ++++ scss/_properties.scss | 3 +- scss/components/_nav.scss | 68 +++- scss/components/form/_tree.scss | 29 -- scss/themes/_cxd-variables.scss | 2 +- scss/themes/_dark-variables.scss | 2 + src/components/Select.tsx | 2 +- src/components/WithRemoteConfig.tsx | 176 +++++++-- src/renderers/Form/ConditionBuilder.tsx | 2 +- src/renderers/Mapping.tsx | 27 +- src/renderers/Nav.tsx | 471 ++++++++++++------------ src/renderers/Steps.tsx | 2 +- 18 files changed, 906 insertions(+), 336 deletions(-) create mode 100644 examples/components/CRUD/Aside2.jsx create mode 100644 mock/options/nav.js diff --git a/docs/zh-CN/components/mapping.md b/docs/zh-CN/components/mapping.md index 27256bac1..a10611a31 100755 --- a/docs/zh-CN/components/mapping.md +++ b/docs/zh-CN/components/mapping.md @@ -119,6 +119,50 @@ List 的内容、Card 卡片的内容配置同上 } ``` +### 布尔值映射 + +```schema: scope="body" +{ + "type": "form", + "data": { + "type": true + }, + "controls": [ + { + "type": "static-mapping", + "name": "type", + "label": "映射", + "map": { + "1": "", + "0": "" + } + } + ] +} +``` + +或者 + +```schema: scope="body" +{ + "type": "form", + "data": { + "type": true + }, + "controls": [ + { + "type": "static-mapping", + "name": "type", + "label": "映射", + "map": { + "true": "", + "false": "" + } + } + ] +} +``` + ### 远程拉取字典 > since 1.1.6 diff --git a/examples/components/App.tsx b/examples/components/App.tsx index cb5868299..e3afc5af2 100644 --- a/examples/components/App.tsx +++ b/examples/components/App.tsx @@ -239,8 +239,8 @@ export class App extends React.PureComponent<{
{docPage ? null : (