@luck-design-biz/luckda 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +40 -49
- package/es/components/Builder/index.js +4 -4
- package/es/components/LdAutoForm/index.js +7 -9
- package/es/components/LdCard/index.js +5 -6
- package/es/components/LdCard/model.js +1 -1
- package/es/components/LdCom/index.js +2 -2
- package/es/components/LdFormList/index.js +19 -17
- package/es/components/LdGrid/index.js +11 -12
- package/es/components/LdGrid/model.js +1 -1
- package/es/components/LdGridForm/index.js +10 -10
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdInfoPanel/index.js +2 -2
- package/es/components/LdRuntimeCom/index.js +42 -0
- package/es/components/LdTree/index.js +3 -4
- package/es/components/LdTree/index.less +36 -36
- package/es/helper/FromItems.js +1 -1
- package/es/helper/action.js +8 -8
- package/es/helper/form.js +16 -16
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +1 -1
- package/es/helper/ldComBuild.js +4 -4
- package/es/index.js +10 -9
- package/es/lowcode/constants/api-url.js +2 -0
- package/es/lowcode/constants/event-topics.js +23 -0
- package/es/lowcode/constants/index.js +12 -0
- package/es/lowcode/engine/factory/DataFactory.js +1 -0
- package/es/lowcode/engine/meta/button.props.default.json +8 -0
- package/es/lowcode/engine/meta/cardlist.props.default.json +10 -0
- package/es/lowcode/engine/meta/components/button.json +104 -0
- package/es/lowcode/engine/meta/components/card-list.json +143 -0
- package/es/lowcode/engine/meta/components/drawer.json +143 -0
- package/es/lowcode/engine/meta/components/form.json +116 -0
- package/es/lowcode/engine/meta/components/iframe.json +31 -0
- package/es/lowcode/engine/meta/components/image.json +113 -0
- package/es/lowcode/engine/meta/components/imex.json +81 -0
- package/es/lowcode/engine/meta/components/jsx.json +24 -0
- package/es/lowcode/engine/meta/components/layout.json +107 -0
- package/es/lowcode/engine/meta/components/link.json +111 -0
- package/es/lowcode/engine/meta/components/modal.json +120 -0
- package/es/lowcode/engine/meta/components/section.json +107 -0
- package/es/lowcode/engine/meta/components/split.json +71 -0
- package/es/lowcode/engine/meta/components/table.json +161 -0
- package/es/lowcode/engine/meta/components/tabs.json +140 -0
- package/es/lowcode/engine/meta/components/text.json +65 -0
- package/es/lowcode/engine/meta/components/tree.json +156 -0
- package/es/lowcode/engine/meta/components-list.json +122 -0
- package/es/lowcode/engine/meta/drawer.props.default.json +10 -0
- package/es/lowcode/engine/meta/form.props.default.json +5 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +3 -0
- package/es/lowcode/engine/meta/image.props.default.json +8 -0
- package/es/lowcode/engine/meta/imex.props.default.json +4 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -0
- package/es/lowcode/engine/meta/layout.props.default.json +5 -0
- package/es/lowcode/engine/meta/link.props.default.json +6 -0
- package/es/lowcode/engine/meta/modal.props.default.json +11 -0
- package/es/lowcode/engine/meta/section.props.default.json +9 -0
- package/es/lowcode/engine/meta/split.props.default.json +5 -0
- package/es/lowcode/engine/meta/table.props.default.json +10 -0
- package/es/lowcode/engine/meta/tabs.props.default.json +10 -0
- package/es/lowcode/engine/meta/text.props.default.json +4 -0
- package/es/lowcode/engine/meta/tree.props.default.json +9 -0
- package/es/lowcode/engine/provider/ContextProvider.js +164 -0
- package/es/lowcode/engine/provider/EventBusProvider.js +120 -0
- package/es/lowcode/engine/tools/dataProcess.js +188 -0
- package/es/lowcode/engine/tools/helper.js +4 -0
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +3 -0
- package/es/lowcode/painter/Components.js +104 -0
- package/es/lowcode/painter/Design.js +97 -0
- package/es/lowcode/painter/I18n.js +5 -0
- package/es/lowcode/painter/Outline.js +202 -0
- package/es/lowcode/painter/Panel.js +8 -0
- package/es/lowcode/painter/Ribbon.js +136 -0
- package/es/lowcode/painter/components/PanelItem.js +20 -0
- package/es/lowcode/painter/components/RuleInput.js +105 -0
- package/es/lowcode/painter/index.js +19 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +123 -0
- package/es/lowcode/painter/panel-section/Radio.js +58 -0
- package/es/lowcode/painter/style/components.less +90 -0
- package/es/lowcode/painter/style/design.less +38 -0
- package/es/lowcode/painter/style/index.less +7 -0
- package/es/lowcode/painter/style/layout-ratio.less +51 -0
- package/es/lowcode/painter/style/outline.less +26 -0
- package/es/lowcode/painter/style/panel-item.less +21 -0
- package/es/lowcode/painter/style/panel.less +5 -0
- package/es/lowcode/painter/style/radio.less +24 -0
- package/es/lowcode/painter/style/ribbon.less +4 -0
- package/es/lowcode/painter/style/rule-input.less +13 -0
- package/es/lowcode/view/Canvas.js +135 -0
- package/es/lowcode/view/Loading.js +23 -0
- package/es/lowcode/view/Page.js +55 -0
- package/es/lowcode/view/index.js +18 -0
- package/es/lowcode/view/lc-components/Box/index.js +21 -0
- package/es/lowcode/view/lc-components/Button/index.js +37 -0
- package/es/lowcode/view/lc-components/CardList/index.js +20 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +50 -0
- package/es/lowcode/view/lc-components/Dialog/index.less +3 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +46 -0
- package/es/lowcode/view/lc-components/Form/index.js +20 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +20 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +20 -0
- package/es/lowcode/view/lc-components/Image/index.js +20 -0
- package/es/lowcode/view/lc-components/JSX/index.js +20 -0
- package/es/lowcode/view/lc-components/Layout/index.js +24 -0
- package/es/lowcode/view/lc-components/Link/index.js +20 -0
- package/es/lowcode/view/lc-components/Section/index.js +34 -0
- package/es/lowcode/view/lc-components/Split/index.js +21 -0
- package/es/lowcode/view/lc-components/Table/index.js +23 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +21 -0
- package/es/lowcode/view/lc-components/Text/index.js +23 -0
- package/es/lowcode/view/lc-components/Tree/index.js +20 -0
- package/es/lowcode/view/lc-components/Wrapper.js +45 -0
- package/es/lowcode/view/style/canvas.less +5 -0
- package/es/lowcode/view/style/loading.less +84 -0
- package/es/lowcode/view/style/page.less +6 -0
- package/es/services.js +1 -1
- package/es/upload/Form/gridForm.js +29 -7
- package/es/upload/Form/index.js +1 -1
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +30 -18
- package/es/upload/index.js +3 -3
- package/es/utils/action.js +1 -1
- package/es/utils/form.js +26 -26
- package/es/utils/grid.js +22 -26
- package/es/utils/index.js +3 -3
- package/lib/components/Builder/index.js +3 -5
- package/lib/components/LdAutoForm/index.js +5 -8
- package/lib/components/LdCard/index.js +5 -7
- package/lib/components/LdCom/index.js +6 -11
- package/lib/components/LdFormList/index.js +15 -13
- package/lib/components/LdGrid/index.js +10 -12
- package/lib/components/LdGridForm/index.js +6 -7
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdInfoPanel/index.js +2 -3
- package/lib/components/LdPop/index.js +2 -4
- package/lib/components/LdRuntimeCom/index.js +49 -0
- package/lib/components/LdTree/index.js +2 -4
- package/lib/components/LdTree/index.less +36 -36
- package/lib/helper/FromItems.js +15 -29
- package/lib/helper/action.js +9 -11
- package/lib/helper/form.js +18 -20
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +1 -2
- package/lib/helper/ldComBuild.js +7 -11
- package/lib/index.js +9 -1
- package/lib/lowcode/constants/api-url.js +8 -0
- package/lib/lowcode/constants/event-topics.js +29 -0
- package/lib/lowcode/constants/index.js +18 -0
- package/lib/lowcode/engine/factory/DataFactory.js +3 -0
- package/lib/lowcode/engine/meta/button.props.default.json +8 -0
- package/lib/lowcode/engine/meta/cardlist.props.default.json +10 -0
- package/lib/lowcode/engine/meta/components/button.json +104 -0
- package/lib/lowcode/engine/meta/components/card-list.json +143 -0
- package/lib/lowcode/engine/meta/components/drawer.json +143 -0
- package/lib/lowcode/engine/meta/components/form.json +116 -0
- package/lib/lowcode/engine/meta/components/iframe.json +31 -0
- package/lib/lowcode/engine/meta/components/image.json +113 -0
- package/lib/lowcode/engine/meta/components/imex.json +81 -0
- package/lib/lowcode/engine/meta/components/jsx.json +24 -0
- package/lib/lowcode/engine/meta/components/layout.json +107 -0
- package/lib/lowcode/engine/meta/components/link.json +111 -0
- package/lib/lowcode/engine/meta/components/modal.json +120 -0
- package/lib/lowcode/engine/meta/components/section.json +107 -0
- package/lib/lowcode/engine/meta/components/split.json +71 -0
- package/lib/lowcode/engine/meta/components/table.json +161 -0
- package/lib/lowcode/engine/meta/components/tabs.json +140 -0
- package/lib/lowcode/engine/meta/components/text.json +65 -0
- package/lib/lowcode/engine/meta/components/tree.json +156 -0
- package/lib/lowcode/engine/meta/components-list.json +122 -0
- package/lib/lowcode/engine/meta/drawer.props.default.json +10 -0
- package/lib/lowcode/engine/meta/form.props.default.json +5 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +3 -0
- package/lib/lowcode/engine/meta/image.props.default.json +8 -0
- package/lib/lowcode/engine/meta/imex.props.default.json +4 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -0
- package/lib/lowcode/engine/meta/layout.props.default.json +5 -0
- package/lib/lowcode/engine/meta/link.props.default.json +6 -0
- package/lib/lowcode/engine/meta/modal.props.default.json +11 -0
- package/lib/lowcode/engine/meta/section.props.default.json +9 -0
- package/lib/lowcode/engine/meta/split.props.default.json +5 -0
- package/lib/lowcode/engine/meta/table.props.default.json +10 -0
- package/lib/lowcode/engine/meta/tabs.props.default.json +10 -0
- package/lib/lowcode/engine/meta/text.props.default.json +4 -0
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -0
- package/lib/lowcode/engine/provider/ContextProvider.js +172 -0
- package/lib/lowcode/engine/provider/EventBusProvider.js +128 -0
- package/lib/lowcode/engine/tools/dataProcess.js +201 -0
- package/lib/lowcode/engine/tools/helper.js +11 -0
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +20 -0
- package/lib/lowcode/painter/Components.js +112 -0
- package/lib/lowcode/painter/Design.js +105 -0
- package/lib/lowcode/painter/I18n.js +12 -0
- package/lib/lowcode/painter/Outline.js +210 -0
- package/lib/lowcode/painter/Panel.js +16 -0
- package/lib/lowcode/painter/Ribbon.js +151 -0
- package/lib/lowcode/painter/components/PanelItem.js +26 -0
- package/lib/lowcode/painter/components/RuleInput.js +112 -0
- package/lib/lowcode/painter/index.js +26 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +131 -0
- package/lib/lowcode/painter/panel-section/Radio.js +65 -0
- package/lib/lowcode/painter/style/components.less +90 -0
- package/lib/lowcode/painter/style/design.less +38 -0
- package/lib/lowcode/painter/style/index.less +7 -0
- package/lib/lowcode/painter/style/layout-ratio.less +51 -0
- package/lib/lowcode/painter/style/outline.less +26 -0
- package/lib/lowcode/painter/style/panel-item.less +21 -0
- package/lib/lowcode/painter/style/panel.less +5 -0
- package/lib/lowcode/painter/style/radio.less +24 -0
- package/lib/lowcode/painter/style/ribbon.less +4 -0
- package/lib/lowcode/painter/style/rule-input.less +13 -0
- package/lib/lowcode/view/Canvas.js +150 -0
- package/lib/lowcode/view/Loading.js +30 -0
- package/lib/lowcode/view/Page.js +63 -0
- package/lib/lowcode/view/index.js +25 -0
- package/lib/lowcode/view/lc-components/Box/index.js +29 -0
- package/lib/lowcode/view/lc-components/Button/index.js +45 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +28 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +58 -0
- package/lib/lowcode/view/lc-components/Dialog/index.less +3 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +54 -0
- package/lib/lowcode/view/lc-components/Form/index.js +28 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +28 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +28 -0
- package/lib/lowcode/view/lc-components/Image/index.js +28 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +28 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +32 -0
- package/lib/lowcode/view/lc-components/Link/index.js +28 -0
- package/lib/lowcode/view/lc-components/Section/index.js +42 -0
- package/lib/lowcode/view/lc-components/Split/index.js +29 -0
- package/lib/lowcode/view/lc-components/Table/index.js +31 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +29 -0
- package/lib/lowcode/view/lc-components/Text/index.js +31 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +28 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +52 -0
- package/lib/lowcode/view/style/canvas.less +5 -0
- package/lib/lowcode/view/style/loading.less +84 -0
- package/lib/lowcode/view/style/page.less +6 -0
- package/lib/upload/Form/gridForm.js +27 -6
- package/lib/upload/Form/index.js +1 -2
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +30 -19
- package/lib/upload/GridCell/index.js +1 -2
- package/lib/utils/form.js +26 -29
- package/lib/utils/grid.js +23 -28
- package/lowcode.js +1 -0
- package/package.json +157 -78
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/README.zh-CN.md +0 -51
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 UmiJS
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 UmiJS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,49 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npm login
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
最后执行发布命令
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm publish
|
|
49
|
-
```
|
|
1
|
+
# 微服务 3.0 纯净版
|
|
2
|
+
|
|
3
|
+
luck-react-pure 是一个基于 qiankun 框架搭建的极简微服务框架,作为微服务业务子系统的开发基座。旨在为业务子系统提供简单、轻量的解决方案。该框架去除了冗余的功能,专注于提供基本的功能支持,使开发者能够更快速地搭建和开发业务子系统。
|
|
4
|
+
|
|
5
|
+
## 启动
|
|
6
|
+
|
|
7
|
+
安装 `node_modules`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 开始项目
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 代码校验
|
|
20
|
+
|
|
21
|
+
本框架提供了代码校验方案,校验不通过禁止提交代码,当提交代码时将会校验以下内容:
|
|
22
|
+
|
|
23
|
+
### 代码规范
|
|
24
|
+
|
|
25
|
+
根据 eslint 校验规范。
|
|
26
|
+
|
|
27
|
+
### commit message 校验
|
|
28
|
+
|
|
29
|
+
commit message 格式:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
💥 feat(模块): 添加了个很棒的功能
|
|
33
|
+
🐛 fix(模块): 修复了一些 bug
|
|
34
|
+
📝 docs(模块): 更新了一下文档
|
|
35
|
+
💄 UI(模块): 修改了一下样式
|
|
36
|
+
🎨 chore(模块): 对脚手架做了些更改
|
|
37
|
+
🚨 refactor(模块): 重构(即不是新增功能,也不是修改bug的代码变动)
|
|
38
|
+
🐞 test(模块): 增加、修改测试用例
|
|
39
|
+
🌟 release(3.0.1):url
|
|
40
|
+
```
|
|
@@ -5,9 +5,9 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import React, { createContext, useState, useRef } from 'react';
|
|
6
6
|
import { useRequest, useSetState, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { BasicForm, BasicFormItem } from 'luck-design';
|
|
8
|
-
import LdPop from
|
|
9
|
-
import { readModlue } from
|
|
10
|
-
import { doAction as doActionUtils } from
|
|
8
|
+
import LdPop from "../LdPop";
|
|
9
|
+
import { readModlue } from "../../services";
|
|
10
|
+
import { doAction as doActionUtils } from "../../helper/action";
|
|
11
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
12
|
var LuckDaContext = /*#__PURE__*/createContext();
|
|
13
13
|
var builder = function builder(WrappedComponent, moduleCode) {
|
|
@@ -92,7 +92,7 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
92
92
|
var _props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
93
93
|
fieldProps.current = _objectSpread(_objectSpread({}, fieldProps.current), _props);
|
|
94
94
|
};
|
|
95
|
-
if (loading) return
|
|
95
|
+
if (loading) return null;
|
|
96
96
|
if (!moduleData) return formatMessage({
|
|
97
97
|
id: 'luckda.module.loadFailed',
|
|
98
98
|
label: '模块信息加载失败'
|
|
@@ -6,9 +6,9 @@ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSet
|
|
|
6
6
|
import React, { createRef, useContext } from 'react';
|
|
7
7
|
import { transform } from 'lodash';
|
|
8
8
|
import { AutoForm } from '@luck-design-biz/base/FormList';
|
|
9
|
-
import ldBuilder from
|
|
10
|
-
import { getFormItem, formItemDataFormat, dataFormat, behaviorCall } from
|
|
11
|
-
import { LuckDaContext } from
|
|
9
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
10
|
+
import { getFormItem, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
11
|
+
import { LuckDaContext } from "../Builder";
|
|
12
12
|
var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
13
13
|
var _ref$columns = _ref.columns,
|
|
14
14
|
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
@@ -50,11 +50,10 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
50
50
|
var _defaultValues = {};
|
|
51
51
|
var _nodes = transform(columns, function (result, col) {
|
|
52
52
|
if (col.isShowInForm) {
|
|
53
|
-
var _objectSpread2;
|
|
54
53
|
var customFiled = filedsRewrite.find(function (field) {
|
|
55
54
|
return field.name === col.aliaName;
|
|
56
55
|
}) || {};
|
|
57
|
-
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, (
|
|
56
|
+
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
|
|
58
57
|
result.push(getFormItem(col, _objectSpread(_objectSpread({
|
|
59
58
|
formId: ldId,
|
|
60
59
|
moduleCode: moduleCode
|
|
@@ -101,7 +100,7 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
101
100
|
var values = _ref3.values,
|
|
102
101
|
submitData = _ref3.submitData;
|
|
103
102
|
var _submitData = dataFormat(columns, submitData);
|
|
104
|
-
if (_onOperate
|
|
103
|
+
if (_onOperate !== null && _onOperate !== void 0 && _onOperate.post) return _onOperate.post({
|
|
105
104
|
values: values,
|
|
106
105
|
submitData: _submitData
|
|
107
106
|
}); // 以预设为主
|
|
@@ -113,16 +112,15 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
113
112
|
onQuery: _objectSpread(_objectSpread({
|
|
114
113
|
api: behaviorCall,
|
|
115
114
|
get: function get(formData) {
|
|
116
|
-
var _params2;
|
|
117
115
|
var _relationKey = isMain ? window.appConfig.constraintKeys.PRIMARY : relationKey;
|
|
118
|
-
var _params = (
|
|
116
|
+
var _params = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, isMain ? 'indocno' : 'relationId', formData[mainFormLdId] && formData[mainFormLdId][_relationKey] || ticketData[_relationKey]), "moduleCode", moduleCode), "datasetCode", dataSetKey), "behaviorKey", isMain ? 'readForm' : 'readUniqueForm');
|
|
119
117
|
if (!isMain) _params.relationDs = mainDataSetKey;
|
|
120
118
|
return _params;
|
|
121
119
|
}
|
|
122
120
|
}, onQuery), {}, {
|
|
123
121
|
format: function format(data, res) {
|
|
124
122
|
var formItemData = _objectSpread({}, formItemDataFormat(columns, data));
|
|
125
|
-
if (onQuery
|
|
123
|
+
if (onQuery !== null && onQuery !== void 0 && onQuery.format) return onQuery.format(data, formItemData, res); // 以预设为主
|
|
126
124
|
return formItemData;
|
|
127
125
|
}
|
|
128
126
|
})
|
|
@@ -11,8 +11,8 @@ import { Icon, Tooltip } from 'luck-design/antd';
|
|
|
11
11
|
import { ResultSet, PermissionUtil } from 'luck-design';
|
|
12
12
|
import { includes, difference } from 'lodash';
|
|
13
13
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
14
|
-
import createModel from
|
|
15
|
-
import ldBuilder from
|
|
14
|
+
import createModel from "./model";
|
|
15
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
16
16
|
import { CardList, Card } from '@luck-design-biz/base/List';
|
|
17
17
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
18
18
|
import { build } from '@luck-design-biz/base/Component';
|
|
@@ -135,10 +135,10 @@ var LdIndex = function LdIndex(_ref2) {
|
|
|
135
135
|
});
|
|
136
136
|
var Component = useCreation(function () {
|
|
137
137
|
var _getDvaApp, _getDvaApp2;
|
|
138
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
139
|
-
if (!((_getDvaApp2 = getDvaApp())
|
|
138
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp.unmodel(namespace);
|
|
139
|
+
if (!((_getDvaApp2 = getDvaApp()) !== null && _getDvaApp2 !== void 0 && _getDvaApp2._store.getState()[namespace])) {
|
|
140
140
|
var _getDvaApp3;
|
|
141
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
141
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
142
142
|
isFlow: !!props.isFlow
|
|
143
143
|
}, overModel), {}, {
|
|
144
144
|
dataSetKey: props.dataSetKey,
|
|
@@ -178,7 +178,6 @@ Index.propTypes = {
|
|
|
178
178
|
// 卡片行为
|
|
179
179
|
cardKey: PropTypes.string // 卡片主键
|
|
180
180
|
};
|
|
181
|
-
|
|
182
181
|
Index.defaultProps = {
|
|
183
182
|
resultSet: {},
|
|
184
183
|
suppressInit: false,
|
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["readAll", "moduleCode", "dataSetKey", "afterQuery"];
|
|
4
4
|
import { createListModel } from '@luck-design-biz/base/utils/modelHelper';
|
|
5
|
-
import { behaviorCall } from
|
|
5
|
+
import { behaviorCall } from "../../utils";
|
|
6
6
|
export default function (namespace) {
|
|
7
7
|
var modelProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8
8
|
var _readAll = modelProps.readAll,
|
|
@@ -4,7 +4,7 @@ var _excluded = ["options"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Button, Tabs } from 'luck-design/antd';
|
|
6
6
|
import { Collapse, ButtonRadio, IconFont } from '@luck-design-biz/base';
|
|
7
|
-
import { ldComBuilder, filterOptions, deepFilterCom } from
|
|
7
|
+
import { ldComBuilder, filterOptions, deepFilterCom } from "../../helper/ldComBuild";
|
|
8
8
|
export var LdButton = ldComBuilder(Button);
|
|
9
9
|
export var LdCollapse = ldComBuilder(Collapse);
|
|
10
10
|
export var LdButtonRadio = function LdButtonRadio(_ref) {
|
|
@@ -18,7 +18,7 @@ export var LdButtonRadio = function LdButtonRadio(_ref) {
|
|
|
18
18
|
export var LdIconFont = ldComBuilder(IconFont);
|
|
19
19
|
var LdTabs = deepFilterCom(Tabs, function (child) {
|
|
20
20
|
var _child$type;
|
|
21
|
-
return (child === null || child === void 0
|
|
21
|
+
return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'TabPane';
|
|
22
22
|
});
|
|
23
23
|
LdTabs.TabPane = Tabs.TabPane;
|
|
24
24
|
export { LdTabs };
|
|
@@ -14,20 +14,22 @@ import React, { useContext, useRef, forwardRef, Fragment, useImperativeHandle, u
|
|
|
14
14
|
import { connect, getDvaApp, useRouteMatch, useModel } from 'umi';
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
16
16
|
import { useCreation, useMemoizedFn, useAsyncEffect } from 'ahooks';
|
|
17
|
+
import { createDeepCompareEffect } from 'ahooks/es/createDeepCompareEffect';
|
|
17
18
|
import { BasicDivider } from 'luck-design';
|
|
18
19
|
import { ChildrenUtil } from '@luck-design-biz/base/utils';
|
|
19
20
|
import { FormList, FormListAffix, FormBtn } from '@luck-design-biz/base/FormList';
|
|
20
|
-
import buildLdAutoForm from
|
|
21
|
-
import buildLdGridForm from
|
|
21
|
+
import buildLdAutoForm from "../LdAutoForm";
|
|
22
|
+
import buildLdGridForm from "../LdGridForm";
|
|
22
23
|
import { Collapse } from '@luck-design-biz/base';
|
|
23
|
-
import { LuckDaContext } from
|
|
24
|
-
import { LuckDaPopContext } from
|
|
25
|
-
import createModel from
|
|
26
|
-
import { onBatchSubmitAction } from
|
|
24
|
+
import { LuckDaContext } from "../Builder";
|
|
25
|
+
import { LuckDaPopContext } from "../LdPop";
|
|
26
|
+
import createModel from "./model";
|
|
27
|
+
import { onBatchSubmitAction } from "../../helper/action";
|
|
27
28
|
import { isArray, sortBy, mapValues } from 'lodash';
|
|
28
29
|
import { BpmButton } from '@luck-design-biz/bpm';
|
|
29
|
-
import { readBehaviorCall } from
|
|
30
|
+
import { readBehaviorCall } from "../../services";
|
|
30
31
|
import { parse, stringify } from 'querystring';
|
|
32
|
+
var useDeepCompareAsyncEffect = createDeepCompareEffect(useAsyncEffect);
|
|
31
33
|
|
|
32
34
|
// 组件
|
|
33
35
|
var LdFormList = function LdFormList(_ref) {
|
|
@@ -87,7 +89,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
87
89
|
var _params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88
90
|
if (props.formMode !== 'add') {
|
|
89
91
|
var _getDvaApp;
|
|
90
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
92
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp._store.dispatch({
|
|
91
93
|
type: "".concat(namespace, "/setTicketData"),
|
|
92
94
|
payload: {
|
|
93
95
|
ticketData: _objectSpread(_objectSpread({}, props.ticketData), _params)
|
|
@@ -102,8 +104,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
102
104
|
var _ref4 = formListRef.current || {},
|
|
103
105
|
formRefs = _ref4.formRefs;
|
|
104
106
|
var data = formRefs && Object.keys(formRefs).map(function (key) {
|
|
105
|
-
var _formRefs$key, _formRefs$key$
|
|
106
|
-
var getValue = ((
|
|
107
|
+
var _formRefs$key, _formRefs$key$current;
|
|
108
|
+
var getValue = ((_formRefs$key = formRefs[key]) !== null && _formRefs$key !== void 0 && (_formRefs$key = _formRefs$key.formRef) !== null && _formRefs$key !== void 0 && _formRefs$key.current ? formRefs[key].getData : null) || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
107
109
|
return _defineProperty({}, key, getValue && getValue());
|
|
108
110
|
});
|
|
109
111
|
onValueChange(change, data);
|
|
@@ -124,7 +126,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
124
126
|
placement: luckTheme === 'base' && (affixLayout || defaultLayout) !== 'top' ? 'topRight' : 'bottomRight'
|
|
125
127
|
}, bpmButtonProps)));
|
|
126
128
|
};
|
|
127
|
-
|
|
129
|
+
useDeepCompareAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
128
130
|
var _props$formData$mainF, _params, response, _yield$readBehaviorCa, code, data, _props$formData$mainF2, _props$formData$mainF3, bpmInfoObj, tempObj;
|
|
129
131
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
130
132
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -150,6 +152,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
150
152
|
}
|
|
151
153
|
_context.next = 8;
|
|
152
154
|
return readBehaviorCall(_objectSpread(_objectSpread({}, _params), {}, {
|
|
155
|
+
// bizKey: bizData.bizKey,
|
|
153
156
|
behaviorKey: 'readBpm'
|
|
154
157
|
}));
|
|
155
158
|
case 8:
|
|
@@ -325,7 +328,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
325
328
|
// 构建带有model的组件
|
|
326
329
|
var builder = function builder(WrappedComponent, namespace, initData) {
|
|
327
330
|
var _getDvaApp2;
|
|
328
|
-
(_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0
|
|
331
|
+
(_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2._store.dispatch({
|
|
329
332
|
type: "".concat(namespace, "/setFormInit"),
|
|
330
333
|
payload: _objectSpread({
|
|
331
334
|
formMode: 'add'
|
|
@@ -352,12 +355,12 @@ var Index = function Index(_ref10) {
|
|
|
352
355
|
var match = useRouteMatch();
|
|
353
356
|
var Component = useCreation(function () {
|
|
354
357
|
var _getDvaApp3, _getDvaApp4, _match$params;
|
|
355
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
356
|
-
if (!((_getDvaApp4 = getDvaApp())
|
|
358
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.unmodel(namespace);
|
|
359
|
+
if (!((_getDvaApp4 = getDvaApp()) !== null && _getDvaApp4 !== void 0 && _getDvaApp4._store.getState()[namespace])) {
|
|
357
360
|
var _getDvaApp5;
|
|
358
|
-
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0
|
|
361
|
+
(_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0 || _getDvaApp5.model(createModel(namespace, overModel));
|
|
359
362
|
}
|
|
360
|
-
return builder(LdFormList, namespace,
|
|
363
|
+
return builder(LdFormList, namespace, match !== null && match !== void 0 && (_match$params = match.params) !== null && _match$params !== void 0 && _match$params.isEdit ? _objectSpread(_objectSpread({}, initData), {}, {
|
|
361
364
|
formMode: 'edit'
|
|
362
365
|
}) : initData);
|
|
363
366
|
}, [namespace]);
|
|
@@ -388,7 +391,6 @@ Index.propTypes = {
|
|
|
388
391
|
affixLayout: PropTypes.oneOf(['top', 'bottom']),
|
|
389
392
|
onValueChange: PropTypes.func // 参数变化的事件
|
|
390
393
|
};
|
|
391
|
-
|
|
392
394
|
Index.defaultProps = {
|
|
393
395
|
initData: {},
|
|
394
396
|
readOnly: false,
|
|
@@ -11,9 +11,9 @@ import { useCreation } from 'ahooks';
|
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { build } from '@luck-design-biz/base/Component';
|
|
13
13
|
import { GridList } from '@luck-design-biz/base/List';
|
|
14
|
-
import ldBuilder from
|
|
15
|
-
import { getGridColumn } from
|
|
16
|
-
import createModel from
|
|
14
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
15
|
+
import { getGridColumn } from "../../utils";
|
|
16
|
+
import createModel from "./model";
|
|
17
17
|
var LdGrid = function LdGrid(_ref) {
|
|
18
18
|
var columns = _ref.columns,
|
|
19
19
|
resources = _ref.resources,
|
|
@@ -81,10 +81,10 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
81
81
|
});
|
|
82
82
|
}, [batchOperations]);
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* 优先级
|
|
86
|
-
* columnsReset 重置columns,不受模块管理限制,写什么展示什么
|
|
87
|
-
* columnsRewrite 覆盖模块管理配置,是否展示以模块管理配置为主,自己可以用hide来隐藏某字段
|
|
84
|
+
/**
|
|
85
|
+
* 优先级
|
|
86
|
+
* columnsReset 重置columns,不受模块管理限制,写什么展示什么
|
|
87
|
+
* columnsRewrite 覆盖模块管理配置,是否展示以模块管理配置为主,自己可以用hide来隐藏某字段
|
|
88
88
|
*/
|
|
89
89
|
var _columns = useCreation(function () {
|
|
90
90
|
if (columnsReset) return columnsReset;
|
|
@@ -93,7 +93,7 @@ var LdGrid = function LdGrid(_ref) {
|
|
|
93
93
|
var mergeFields = union(keys(defaultColumns), keys(customColumns));
|
|
94
94
|
return transform(mergeFields, function (result, field) {
|
|
95
95
|
var _customColumns$field;
|
|
96
|
-
if ((_customColumns$field = customColumns[field])
|
|
96
|
+
if ((_customColumns$field = customColumns[field]) !== null && _customColumns$field !== void 0 && _customColumns$field.hide) {
|
|
97
97
|
// 任何情况都不显示
|
|
98
98
|
} else if (!defaultColumns[field]) {
|
|
99
99
|
// 数据集中不存在的字段以自定义的形式展示
|
|
@@ -167,10 +167,10 @@ var LdIndex = function LdIndex(_ref2) {
|
|
|
167
167
|
var isTreeGrid = isNil(_isTreeGrid) ? includes(props.isTree, props.dataSetKey) : _isTreeGrid;
|
|
168
168
|
var Component = useCreation(function () {
|
|
169
169
|
var _getDvaApp, _getDvaApp2;
|
|
170
|
-
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0
|
|
171
|
-
if (!((_getDvaApp2 = getDvaApp())
|
|
170
|
+
(_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp.unmodel(namespace);
|
|
171
|
+
if (!((_getDvaApp2 = getDvaApp()) !== null && _getDvaApp2 !== void 0 && _getDvaApp2._store.getState()[namespace])) {
|
|
172
172
|
var _getDvaApp3;
|
|
173
|
-
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0
|
|
173
|
+
(_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
174
174
|
isFlow: isTreeGrid || !!props.isFlow
|
|
175
175
|
}, overModel), {}, {
|
|
176
176
|
dataSetKey: props.dataSetKey,
|
|
@@ -215,7 +215,6 @@ Index.propTypes = {
|
|
|
215
215
|
// 初始化后
|
|
216
216
|
rowKey: PropTypes.string // 初始化后
|
|
217
217
|
};
|
|
218
|
-
|
|
219
218
|
Index.defaultProps = {
|
|
220
219
|
columnsRewrite: [],
|
|
221
220
|
columnsReset: null,
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
var _excluded = ["readAll", "moduleCode", "dataSetKey", "behaviorKey", "afterQuery"],
|
|
4
4
|
_excluded2 = ["_MultiFieldFilter"];
|
|
5
5
|
import { createMainModel } from '@luck-design-biz/base/utils/modelHelper';
|
|
6
|
-
import { behaviorCall } from
|
|
6
|
+
import { behaviorCall } from "../../utils";
|
|
7
7
|
export default function (namespace) {
|
|
8
8
|
var modelProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9
9
|
var _readAll = modelProps.readAll,
|
|
@@ -6,12 +6,12 @@ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSet
|
|
|
6
6
|
import React, { createRef, useContext } from 'react';
|
|
7
7
|
import { transform } from 'lodash';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import ldBuilder from
|
|
9
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
10
10
|
import { GridForm } from '@luck-design-biz/base/FormList';
|
|
11
|
-
import { getFormColumn, formItemDataFormat, dataFormat, behaviorCall } from
|
|
12
|
-
import { defaultComName } from
|
|
13
|
-
import { LuckDaContext } from
|
|
14
|
-
import styles from
|
|
11
|
+
import { getFormColumn, formItemDataFormat, dataFormat, behaviorCall } from "../../utils";
|
|
12
|
+
import { defaultComName } from "../../helper/form";
|
|
13
|
+
import { LuckDaContext } from "../Builder";
|
|
14
|
+
import styles from "./index.less";
|
|
15
15
|
var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
16
16
|
var _ref$columns = _ref.columns,
|
|
17
17
|
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
@@ -65,7 +65,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
65
65
|
var _defaultValues = {};
|
|
66
66
|
var _nodes = transform(gridColumns, function (result, col) {
|
|
67
67
|
if (col.isShowInForm) {
|
|
68
|
-
var
|
|
68
|
+
var _customColumn;
|
|
69
69
|
var customColumn = columnsRewrite.find(function (column) {
|
|
70
70
|
return column.field === col.aliaName;
|
|
71
71
|
}) || {};
|
|
@@ -73,7 +73,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
73
73
|
editable: false,
|
|
74
74
|
mode: 'grid'
|
|
75
75
|
});
|
|
76
|
-
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, (
|
|
76
|
+
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
|
|
77
77
|
result.push(getFormColumn(type, col, _objectSpread(_objectSpread({}, customColumn), {}, {
|
|
78
78
|
formItemRewrite: _objectSpread(_objectSpread({}, (_customColumn = customColumn) === null || _customColumn === void 0 ? void 0 : _customColumn.formItemRewrite), {}, {
|
|
79
79
|
moduleCode: moduleCode,
|
|
@@ -125,7 +125,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
125
125
|
var _submitData = data.map(function (item) {
|
|
126
126
|
return behaviorKey === 'add' ? _objectSpread(_objectSpread({}, dataFormat(gridColumns, item)), {}, _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, null)) : dataFormat(gridColumns, item);
|
|
127
127
|
});
|
|
128
|
-
if (_onOperate
|
|
128
|
+
if (_onOperate !== null && _onOperate !== void 0 && _onOperate.post) return _onOperate.post(_submitData); // 以预设为主
|
|
129
129
|
return _defineProperty({}, dataSetKey, _defineProperty({}, "".concat(behaviorKey, "List"), _submitData));
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -154,7 +154,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
154
154
|
var formItemData = data.map(function (item) {
|
|
155
155
|
return formItemDataFormat(gridColumns, item);
|
|
156
156
|
});
|
|
157
|
-
if (onQuery
|
|
157
|
+
if (onQuery !== null && onQuery !== void 0 && onQuery.format) return onQuery.format(data, formItemData); // 以预设为主
|
|
158
158
|
return formItemData;
|
|
159
159
|
}
|
|
160
160
|
}),
|
|
@@ -167,7 +167,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
167
167
|
indocno: item[window.appConfig.constraintKeys.PRIMARY]
|
|
168
168
|
};
|
|
169
169
|
});
|
|
170
|
-
if (onDelete
|
|
170
|
+
if (onDelete !== null && onDelete !== void 0 && onDelete.post) return onDelete.post(_submitData); // 以预设为主
|
|
171
171
|
return _defineProperty({}, dataSetKey, {
|
|
172
172
|
deleteList: _submitData
|
|
173
173
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.ldGridForm {
|
|
2
|
-
:global {
|
|
3
|
-
.ag-layout-auto-height {
|
|
4
|
-
height: 100% !important;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.ldGridForm {
|
|
2
|
+
:global {
|
|
3
|
+
.ag-layout-auto-height {
|
|
4
|
+
height: 100% !important;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -7,9 +7,9 @@ import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useCreation, useRequest } from 'ahooks';
|
|
9
9
|
import { InfoPanel } from 'luck-design';
|
|
10
|
-
import { behaviorCall } from
|
|
10
|
+
import { behaviorCall } from "../../utils";
|
|
11
11
|
import { transform } from 'lodash';
|
|
12
|
-
import ldBuilder from
|
|
12
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
13
13
|
var formatInfoPanelData = function formatInfoPanelData(columns, data) {
|
|
14
14
|
return transform(columns, function (result, col) {
|
|
15
15
|
result[col.dataIndex] = col.render && col.render(data[col.dataIndex], data) || data["".concat(col.dataIndex, "_virtual")] || data[col.dataIndex];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import * as Babel from '@babel/standalone';
|
|
4
|
+
import * as LuckAntd from 'luck-design/antd';
|
|
5
|
+
import * as LuckDesign from 'luck-design';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 实时代码渲染组件
|
|
9
|
+
* todo:沙箱上下文的集成
|
|
10
|
+
* todo:Loading效果的优化
|
|
11
|
+
*/
|
|
12
|
+
var LdRuntimeCom = function LdRuntimeCom(_ref) {
|
|
13
|
+
var children = _ref.children;
|
|
14
|
+
var _useState = useState(null),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
Component = _useState2[0],
|
|
17
|
+
setComponent = _useState2[1];
|
|
18
|
+
var code = React.Children.toArray(children).join('').trim();
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
if (code) {
|
|
21
|
+
// 使用Babel转换代码
|
|
22
|
+
var transformedCode = Babel.transform(code, {
|
|
23
|
+
presets: ['react']
|
|
24
|
+
}).code;
|
|
25
|
+
|
|
26
|
+
// 输出编译后的代码用于排错
|
|
27
|
+
console.log('transformedCode', transformedCode);
|
|
28
|
+
|
|
29
|
+
// 自动
|
|
30
|
+
var functionNameMatch = transformedCode.match(/function\s+([^\s(]+)/);
|
|
31
|
+
if (functionNameMatch && functionNameMatch.length > 1) {
|
|
32
|
+
var functionName = functionNameMatch[1];
|
|
33
|
+
var execute = new Function('React', 'LuckAntd', 'LuckDesign', "".concat(transformedCode, "; return ").concat(functionName, ";"));
|
|
34
|
+
// 设置组件状态
|
|
35
|
+
var ReactComponent = execute(React, LuckAntd, LuckDesign);
|
|
36
|
+
setComponent( /*#__PURE__*/React.createElement(ReactComponent, null));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, [code]);
|
|
40
|
+
return Component ? Component : /*#__PURE__*/React.createElement("div", null, "Loading...");
|
|
41
|
+
};
|
|
42
|
+
export default LdRuntimeCom;
|
|
@@ -14,9 +14,9 @@ import { Icon, Popover } from 'luck-design/antd';
|
|
|
14
14
|
import { LuckTree } from 'luck-design';
|
|
15
15
|
import { formatMessage, dataToTree, dragTreeData } from '@luck-design-biz/base/utils';
|
|
16
16
|
import { TreeBox } from '@luck-design-biz/base';
|
|
17
|
-
import ldBuilder from
|
|
18
|
-
import { behaviorCall } from
|
|
19
|
-
import styles from
|
|
17
|
+
import ldBuilder from "../../helper/ldBuilder";
|
|
18
|
+
import { behaviorCall } from "../../utils";
|
|
19
|
+
import styles from "./index.less";
|
|
20
20
|
var LdTree = function LdTree(_ref) {
|
|
21
21
|
var columns = _ref.columns,
|
|
22
22
|
resources = _ref.resources,
|
|
@@ -225,7 +225,6 @@ Index.propTypes = {
|
|
|
225
225
|
// 抑制初始化
|
|
226
226
|
afterInit: PropTypes.func // 初始化后
|
|
227
227
|
};
|
|
228
|
-
|
|
229
228
|
Index.defaultProps = {
|
|
230
229
|
readOnly: false,
|
|
231
230
|
title: false,
|