From c58bba2cd6344a0210e5cab667cc4cd937687245 Mon Sep 17 00:00:00 2001 From: JackySoft Date: Mon, 26 Aug 2024 22:52:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=87=E6=B3=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=95=B0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/docs/.vitepress/config.mts | 5 +++++ packages/docs/src/example/index.md | 16 +++++++++++++++ packages/docs/src/example/login.md | 12 +++++++++++ .../ApiConfig/components/BaseSetting.tsx | 20 ++++++++++++++----- .../ApiConfig/components/ReturnStructure.tsx | 6 +++--- .../ApiConfig/components/ReturnTips.tsx | 4 ++-- .../layout/components/Header/CreatePage.tsx | 4 ++-- .../Menu/Variable/VariableSetting.tsx | 4 ++-- .../editor/src/pages/admin/config/index.tsx | 2 +- .../src/pages/admin/menu/CreateMenu.tsx | 2 +- .../src/pages/admin/role/CreateRole.tsx | 2 +- 11 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 packages/docs/src/example/index.md create mode 100644 packages/docs/src/example/login.md diff --git a/packages/docs/.vitepress/config.mts b/packages/docs/.vitepress/config.mts index a3135c8..67e1c7d 100644 --- a/packages/docs/.vitepress/config.mts +++ b/packages/docs/.vitepress/config.mts @@ -17,6 +17,7 @@ export default defineConfig({ { text: '项目', link: '/project' }, { text: '页面', link: '/page' }, { text: '组件', link: '/lib' }, + { text: '综合案例', link: '/example' }, { text: '团队', link: '/team' }, ], @@ -55,6 +56,10 @@ export default defineConfig({ { text: '自定义组件案例', link: '/lib/LoginForm' }, ], }, + { + text: '综合案例', + items: [{ text: '登录事件流', link: '/example/login' }], + }, { text: '团队介绍', link: '/team', diff --git a/packages/docs/src/example/index.md b/packages/docs/src/example/index.md new file mode 100644 index 0000000..1fb01b7 --- /dev/null +++ b/packages/docs/src/example/index.md @@ -0,0 +1,16 @@ +# 综合案例 + +基于实际项目场景,围绕编辑器的使用,搭建一些综合案例,通过视频教学的方式教大家使用低代码平台。 + +## 功能介绍 + +- 编辑器使用 +- 组件使用 +- 属性配置使用 +- 样式配置使用 +- 事件配置使用 +- 接口配置使用 +- 页面权限使用 +- 页面变量使用 +- 页面大纲使用 +- 页面 json 源码使用 diff --git a/packages/docs/src/example/login.md b/packages/docs/src/example/login.md new file mode 100644 index 0000000..7def154 --- /dev/null +++ b/packages/docs/src/example/login.md @@ -0,0 +1,12 @@ +# 登录案例 + +- 画一个静态的登录页面 +- 配置事件流,实现表单重置 +- 配置事件流,实现接口调用 +- 配置事件流,实现变量填充,并且实现数据联动 + + diff --git a/packages/editor/src/components/ApiConfig/components/BaseSetting.tsx b/packages/editor/src/components/ApiConfig/components/BaseSetting.tsx index 4755526..d226890 100644 --- a/packages/editor/src/components/ApiConfig/components/BaseSetting.tsx +++ b/packages/editor/src/components/ApiConfig/components/BaseSetting.tsx @@ -1,6 +1,6 @@ import VariableBind from '@/components/VariableBind/VariableBind'; import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; -import { Form, Radio, Input, Switch, Space } from 'antd'; +import { Form, Radio, Input, Switch, Space, Popover } from 'antd'; const SettingForm = function () { return ( @@ -17,7 +17,7 @@ const SettingForm = function () { }, ]} > - + @@ -103,16 +103,26 @@ const SettingForm = function () { {/* */} - + +

1. 默认会把事件流参数和自定义参数合并;

+

2. 覆盖参数是事件流中上下文的参数覆盖自定义参数;

+

3. 保留参数为只取自定义参数,参数支持模板语法:{'${id}'}。

+ + } + > 合并参数 覆盖参数 保留参数
- + {/* - + */} ); }; diff --git a/packages/editor/src/components/ApiConfig/components/ReturnStructure.tsx b/packages/editor/src/components/ApiConfig/components/ReturnStructure.tsx index 7e61a2a..9ada36c 100644 --- a/packages/editor/src/components/ApiConfig/components/ReturnStructure.tsx +++ b/packages/editor/src/components/ApiConfig/components/ReturnStructure.tsx @@ -8,16 +8,16 @@ const ReturnStructure = function () { 用来定义接口返回结构,推荐结构:{`{ code: 0, data: {}, msg: '' }`}

- + - + - + ); diff --git a/packages/editor/src/components/ApiConfig/components/ReturnTips.tsx b/packages/editor/src/components/ApiConfig/components/ReturnTips.tsx index b87ab17..93aadc1 100644 --- a/packages/editor/src/components/ApiConfig/components/ReturnTips.tsx +++ b/packages/editor/src/components/ApiConfig/components/ReturnTips.tsx @@ -8,10 +8,10 @@ const ReturnTips = function () { 用来定义成功或者失败时,系统显示提示文案

- + - + diff --git a/packages/editor/src/layout/components/Header/CreatePage.tsx b/packages/editor/src/layout/components/Header/CreatePage.tsx index 1377836..29f0e00 100644 --- a/packages/editor/src/layout/components/Header/CreatePage.tsx +++ b/packages/editor/src/layout/components/Header/CreatePage.tsx @@ -78,10 +78,10 @@ const CreatePage = (props: IModalProp) => { >
- + - + diff --git a/packages/editor/src/layout/components/Menu/Variable/VariableSetting.tsx b/packages/editor/src/layout/components/Menu/Variable/VariableSetting.tsx index 107055d..4dba4d7 100644 --- a/packages/editor/src/layout/components/Menu/Variable/VariableSetting.tsx +++ b/packages/editor/src/layout/components/Menu/Variable/VariableSetting.tsx @@ -91,7 +91,7 @@ const VariableSetting = (_: any, ref: any) => { }, ]} > - + handleChange(e.target.value)}> @@ -121,7 +121,7 @@ const VariableSetting = (_: any, ref: any) => { )} - +
diff --git a/packages/editor/src/pages/admin/config/index.tsx b/packages/editor/src/pages/admin/config/index.tsx index 2f9c00a..71f5315 100644 --- a/packages/editor/src/pages/admin/config/index.tsx +++ b/packages/editor/src/pages/admin/config/index.tsx @@ -88,7 +88,7 @@ const Config: React.FC = memo(() => {

基础配置

- + diff --git a/packages/editor/src/pages/admin/menu/CreateMenu.tsx b/packages/editor/src/pages/admin/menu/CreateMenu.tsx index d3a7360..b369064 100644 --- a/packages/editor/src/pages/admin/menu/CreateMenu.tsx +++ b/packages/editor/src/pages/admin/menu/CreateMenu.tsx @@ -131,7 +131,7 @@ export default function CreateMenu(props: IModalProp) { const type = form.getFieldValue('type'); return type === 1 ? ( - + ) : type === 2 ? ( diff --git a/packages/editor/src/pages/admin/role/CreateRole.tsx b/packages/editor/src/pages/admin/role/CreateRole.tsx index f2bccce..4e75837 100644 --- a/packages/editor/src/pages/admin/role/CreateRole.tsx +++ b/packages/editor/src/pages/admin/role/CreateRole.tsx @@ -79,7 +79,7 @@ export default function CreateRole(props: IModalProp) { - +