@luck-design-biz/luckda 0.0.24-2 → 0.0.25
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/es/components/LDActions/index.js +130 -0
- package/es/components/LDActions/index.less +48 -0
- package/es/components/LdFormList/index.js +1 -1
- package/es/components/LdGrid/index.js +9 -3
- package/es/components/LdTree/index.js +32 -5
- package/es/components/LdTree/index.less +6 -1
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +151 -0
- package/es/lowcode/constants/api-url.js +71 -12
- package/es/lowcode/constants/index.js +3 -1
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -3
- package/es/lowcode/engine/meta/box.props.json +1 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/es/lowcode/engine/meta/cardlist.props.json +1 -2
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/es/lowcode/engine/meta/dialog.props.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.default.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +1 -1
- package/es/lowcode/engine/meta/image.props.json +1 -1
- package/es/lowcode/engine/meta/imex.props.default.json +1 -1
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +132 -26
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/section.props.default.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +1 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.default.json +18 -2
- package/es/lowcode/engine/meta/table.props.json +207 -32
- package/es/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/es/lowcode/engine/meta/tabs.props.json +0 -1
- package/es/lowcode/engine/meta/text.props.default.json +1 -1
- package/es/lowcode/engine/meta/text.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.default.json +9 -4
- package/es/lowcode/engine/meta/tree.props.json +101 -55
- package/es/lowcode/engine/provider/{ContextProvider.js → ContextProvider/index.js} +71 -41
- package/es/lowcode/engine/tools/helper.js +29 -1
- package/es/lowcode/engine/tools/usePromiseState.js +7 -6
- package/es/lowcode/painter/Panel.js +50 -133
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +180 -0
- package/es/lowcode/painter/components/AdvancePanel.js +68 -0
- package/es/lowcode/painter/components/AttrsPanel.js +134 -0
- package/es/lowcode/painter/components/Collapse.js +12 -7
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/ListEditor.js +4 -2
- package/es/lowcode/painter/components/PopConfirm.js +10 -3
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +10 -3
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +36 -8
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +48 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/style/action-bind-modal.less +99 -0
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel.less +6 -37
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/view/lc-components/Box/index.js +20 -4
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -3
- package/es/lowcode/view/lc-components/Button/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/es/lowcode/view/lc-components/Drawer/index.js +16 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/meta.json +1 -2
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/meta.json +1 -1
- package/es/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/meta.json +1 -1
- package/es/lowcode/view/lc-components/Split/meta.json +1 -1
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +35 -2
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +255 -35
- package/es/lowcode/view/lc-components/Table/meta.json +179 -32
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/es/lowcode/view/lc-components/Text/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Tree/index.js +77 -6
- package/es/lowcode/view/lc-components/Tree/index.less +2 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/es/lowcode/view/lc-components/Wrapper.js +2 -2
- package/lib/components/LDActions/index.js +138 -0
- package/lib/components/LDActions/index.less +48 -0
- package/lib/components/LdFormList/index.js +1 -1
- package/lib/components/LdGrid/index.js +8 -2
- package/lib/components/LdTree/index.js +31 -4
- package/lib/components/LdTree/index.less +6 -1
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +157 -0
- package/lib/lowcode/constants/api-url.js +71 -12
- package/lib/lowcode/constants/index.js +4 -2
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -3
- package/lib/lowcode/engine/meta/box.props.json +1 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -2
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/lib/lowcode/engine/meta/dialog.props.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.default.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +1 -1
- package/lib/lowcode/engine/meta/image.props.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.default.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +132 -26
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/section.props.default.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +1 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.default.json +18 -2
- package/lib/lowcode/engine/meta/table.props.json +207 -32
- package/lib/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/lib/lowcode/engine/meta/tabs.props.json +0 -1
- package/lib/lowcode/engine/meta/text.props.default.json +1 -1
- package/lib/lowcode/engine/meta/text.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -4
- package/lib/lowcode/engine/meta/tree.props.json +101 -55
- package/lib/lowcode/engine/provider/{ContextProvider.js → ContextProvider/index.js} +70 -40
- package/lib/lowcode/engine/tools/helper.js +31 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -5
- package/lib/lowcode/painter/Panel.js +48 -131
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +188 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +76 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +142 -0
- package/lib/lowcode/painter/components/Collapse.js +12 -7
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/ListEditor.js +4 -2
- package/lib/lowcode/painter/components/PopConfirm.js +10 -3
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +10 -3
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +35 -7
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +56 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +99 -0
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel.less +6 -37
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/view/lc-components/Box/index.js +17 -2
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -3
- package/lib/lowcode/view/lc-components/Button/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +1 -1
- package/lib/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Split/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +37 -3
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +255 -35
- package/lib/lowcode/view/lc-components/Table/meta.json +179 -32
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Tree/index.js +77 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +2 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/lib/lowcode/view/lc-components/Wrapper.js +2 -2
- package/package.json +10 -5
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.lc-painter-panel-attrs {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
flex: 1;
|
|
5
|
+
overflow-x: hidden;
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
padding: 8px 0;
|
|
8
|
+
|
|
9
|
+
&-next {
|
|
10
|
+
height: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
|
|
14
|
+
&-header {
|
|
15
|
+
height: 28px;
|
|
16
|
+
background-color: #e8e8e8;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
padding: 0 4px;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
}
|
|
23
|
+
&-header:hover {
|
|
24
|
+
background-color: #e3e3e3;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-body {
|
|
29
|
+
flex: 1;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
background-color: white;
|
|
32
|
+
padding: 16px 0 8px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.lc-painter-panel-attrs.hidden {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.lc-painter-panel-attrs.showNext {
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
}
|
|
@@ -82,48 +82,17 @@
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
&-content {
|
|
86
|
-
position: relative;
|
|
87
|
-
width: 100%;
|
|
88
|
-
flex: 1;
|
|
89
|
-
overflow-x: hidden;
|
|
90
|
-
overflow-y: auto;
|
|
91
|
-
padding: 8px 0;
|
|
92
|
-
|
|
93
|
-
.next-content {
|
|
94
|
-
height: 100%;
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-direction: column;
|
|
97
|
-
|
|
98
|
-
&-header {
|
|
99
|
-
height: 28px;
|
|
100
|
-
background-color: #e8e8e8;
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
justify-content: space-between;
|
|
104
|
-
padding: 0 4px;
|
|
105
|
-
}
|
|
106
|
-
&-header:hover {
|
|
107
|
-
background-color: #e3e3e3;
|
|
108
|
-
cursor: pointer;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&-body {
|
|
112
|
-
flex: 1;
|
|
113
|
-
overflow-y: auto;
|
|
114
|
-
background-color: white;
|
|
115
|
-
padding: 16px 0 8px;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
&-content.showNext {
|
|
120
|
-
overflow: hidden;
|
|
121
|
-
}
|
|
122
85
|
:global {
|
|
123
86
|
.ant-select .ant-btn {
|
|
124
87
|
width: 170px !important;
|
|
125
88
|
height: 20px;
|
|
126
89
|
line-height: 16px;
|
|
127
90
|
}
|
|
91
|
+
input,
|
|
92
|
+
button,
|
|
93
|
+
.ant-radio-wrapper,
|
|
94
|
+
.ant-select-sm {
|
|
95
|
+
font-size: 12px;
|
|
96
|
+
}
|
|
128
97
|
}
|
|
129
98
|
}
|
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
.ant-popover-message-title {
|
|
4
4
|
padding: 0;
|
|
5
5
|
}
|
|
6
|
-
.ant-popover-buttons{
|
|
6
|
+
.ant-popover-buttons {
|
|
7
7
|
display: none;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
.lc-painter-panel-section-components-popconfirm.show-btn {
|
|
12
|
+
:global {
|
|
13
|
+
.ant-popover-buttons {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import
|
|
2
|
+
import _styled from "styled-components";
|
|
3
|
+
import React, { useRef, useMemo } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
5
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
5
6
|
import classNames from 'classnames';
|
|
7
|
+
import styled from 'styled-components';
|
|
6
8
|
import Wrapper from "../Wrapper";
|
|
7
9
|
import styles from "./index.less";
|
|
8
10
|
import { omitBadProps } from "../../../engine/tools/helper";
|
|
9
11
|
import defaultMeta from "../../../engine/meta/box.props.default.json";
|
|
12
|
+
var Box = styled.div.withConfig({
|
|
13
|
+
displayName: "Box",
|
|
14
|
+
componentId: "luckda-6530__sc-19se5zf-0"
|
|
15
|
+
})(["", ""], function (props) {
|
|
16
|
+
return props.css;
|
|
17
|
+
});
|
|
18
|
+
var _StyledBox = styled(Box).withConfig({
|
|
19
|
+
displayName: "_StyledBox",
|
|
20
|
+
componentId: "luckda-6530__sc-19se5zf-1"
|
|
21
|
+
})(["", ""], function (p) {
|
|
22
|
+
return p.$_css;
|
|
23
|
+
});
|
|
10
24
|
var LCBox = function LCBox(_ref) {
|
|
11
25
|
var id = _ref.id,
|
|
12
26
|
children = _ref.children,
|
|
13
27
|
className = _ref.className,
|
|
28
|
+
css = _ref.css,
|
|
14
29
|
style = _ref.style;
|
|
15
30
|
var ref = useRef();
|
|
16
31
|
var getTargetDom = useMemoizedFn(function () {
|
|
@@ -19,11 +34,12 @@ var LCBox = function LCBox(_ref) {
|
|
|
19
34
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
20
35
|
id: id,
|
|
21
36
|
getTargetDom: getTargetDom
|
|
22
|
-
}, /*#__PURE__*/React.createElement(
|
|
37
|
+
}, /*#__PURE__*/React.createElement(_StyledBox, {
|
|
23
38
|
ref: ref,
|
|
24
39
|
className: classNames(styles['lc-component-box'], _defineProperty({}, className, !!className)),
|
|
25
40
|
style: style,
|
|
26
|
-
name: "box"
|
|
41
|
+
name: "box",
|
|
42
|
+
$_css: css
|
|
27
43
|
}, children));
|
|
28
44
|
};
|
|
29
45
|
LCBox.propTypes = {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"key": "
|
|
17
|
+
"key": "dataset",
|
|
18
18
|
"name": "首次数据自动加载",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
20
|
"type": "_DataSetSelector"
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"type": "_ActionSelector"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
|
-
"style": {},
|
|
98
97
|
"advance": {
|
|
99
98
|
"events": [
|
|
100
99
|
{
|
|
@@ -30,9 +30,25 @@ var LCDrawer = function LCDrawer(_ref) {
|
|
|
30
30
|
});
|
|
31
31
|
useImperativeHandle(apiRef, function () {
|
|
32
32
|
return {
|
|
33
|
+
/**
|
|
34
|
+
* 是否打开
|
|
35
|
+
* @property
|
|
36
|
+
*/
|
|
33
37
|
open: open,
|
|
38
|
+
/**
|
|
39
|
+
* 打开弹窗
|
|
40
|
+
* @method
|
|
41
|
+
*/
|
|
34
42
|
doOpen: setTrue,
|
|
43
|
+
/**
|
|
44
|
+
* 关闭弹窗
|
|
45
|
+
* @method
|
|
46
|
+
*/
|
|
35
47
|
doClose: setFalse,
|
|
48
|
+
/**
|
|
49
|
+
* @method
|
|
50
|
+
* 切换弹窗
|
|
51
|
+
*/
|
|
36
52
|
toggle: toggle
|
|
37
53
|
};
|
|
38
54
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"key": "
|
|
17
|
+
"key": "dataset",
|
|
18
18
|
"name": "首次数据自动加载",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
20
|
"type": "_DataSetSelector"
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"type": "number"
|
|
86
86
|
}
|
|
87
87
|
],
|
|
88
|
-
"style": {},
|
|
89
88
|
"advance": {
|
|
90
89
|
"events": [
|
|
91
90
|
{
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "context", "id", "columnRatio"]
|
|
5
|
-
_excluded2 = ["style"];
|
|
4
|
+
var _excluded = ["children", "context", "id", "columnRatio"];
|
|
6
5
|
import { useEffect } from 'react';
|
|
7
6
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
8
7
|
import { drop, cloneDeep } from 'lodash';
|
|
@@ -30,18 +29,16 @@ var LayoutFunctionDesign = function LayoutFunctionDesign(_ref) {
|
|
|
30
29
|
var boxId = (_current$children = current.children) === null || _current$children === void 0 ? void 0 : _current$children[index];
|
|
31
30
|
if (boxId) {
|
|
32
31
|
modifyById(cloneData, current.children[index], _objectSpread(_objectSpread({}, current[boxId].props), {}, {
|
|
33
|
-
style:
|
|
32
|
+
style: {
|
|
34
33
|
gridColumn: 'span ' + ratio
|
|
35
|
-
}
|
|
34
|
+
}
|
|
36
35
|
}));
|
|
37
36
|
} else {
|
|
38
37
|
boxId = "box_".concat(suid());
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
add(cloneData, id, boxId, _objectSpread(_objectSpread({}, json), {}, {
|
|
42
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
38
|
+
add(cloneData, id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
39
|
+
style: {
|
|
43
40
|
gridColumn: 'span ' + ratio
|
|
44
|
-
}
|
|
41
|
+
}
|
|
45
42
|
}));
|
|
46
43
|
}
|
|
47
44
|
});
|
|
@@ -1,18 +1,51 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className", "suppressPreset"];
|
|
4
|
+
var _excluded = ["children", "className", "suppressPreset", "renderIndex", "zebra", "actions"];
|
|
5
|
+
import React, { useRef } from 'react';
|
|
5
6
|
import Index from "./index";
|
|
7
|
+
import { useLatest, useUpdateEffect, useMemoizedFn } from 'ahooks';
|
|
6
8
|
import classNames from 'classnames';
|
|
7
9
|
import { CELL_CLASS_NAME } from "../../../constants/index";
|
|
8
10
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
9
11
|
var children = _ref.children,
|
|
10
12
|
className = _ref.className,
|
|
11
13
|
suppressPreset = _ref.suppressPreset,
|
|
14
|
+
renderIndex = _ref.renderIndex,
|
|
15
|
+
zebra = _ref.zebra,
|
|
16
|
+
actions = _ref.actions,
|
|
12
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
var gridRef = useRef(null);
|
|
19
|
+
var latestZebra = useLatest(zebra);
|
|
20
|
+
var latestActions = useLatest(actions);
|
|
21
|
+
var handleGridReady = useMemoizedFn(function (grid) {
|
|
22
|
+
gridRef.current = grid;
|
|
23
|
+
});
|
|
24
|
+
useUpdateEffect(function () {
|
|
25
|
+
var itemsToUpdate = [];
|
|
26
|
+
gridRef.current.api.forEachNode(function (rowNode) {
|
|
27
|
+
if (rowNode.rowIndex % 2 === 0) itemsToUpdate.push(rowNode.data);
|
|
28
|
+
});
|
|
29
|
+
gridRef.current.api.updateRowData({
|
|
30
|
+
update: itemsToUpdate
|
|
31
|
+
});
|
|
32
|
+
}, [zebra]);
|
|
33
|
+
useUpdateEffect(function () {
|
|
34
|
+
gridRef.current.api.refreshCells({
|
|
35
|
+
columns: ['luck-actions'],
|
|
36
|
+
force: true
|
|
37
|
+
});
|
|
38
|
+
}, [actions]);
|
|
39
|
+
useUpdateEffect(function () {
|
|
40
|
+
gridRef.current.columnApi.setColumnVisible('luck-index', renderIndex);
|
|
41
|
+
}, [renderIndex]);
|
|
13
42
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
14
43
|
className: classNames(CELL_CLASS_NAME, _defineProperty({}, className, !!className)),
|
|
15
|
-
suppressPreset: true
|
|
44
|
+
suppressPreset: true,
|
|
45
|
+
renderIndex: renderIndex,
|
|
46
|
+
zebra: latestZebra,
|
|
47
|
+
actions: latestActions,
|
|
48
|
+
onGridReady: handleGridReady
|
|
16
49
|
}, props), children);
|
|
17
50
|
};
|
|
18
51
|
export default FunctionDesign;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { useAsyncEffect } from 'ahooks';
|
|
6
|
+
import { Segmented } from 'luck-design/antd';
|
|
7
|
+
import { isArray, isString } from 'lodash';
|
|
8
|
+
function mockDict() {
|
|
9
|
+
return new Promise(function (resolve) {
|
|
10
|
+
setTimeout(function () {
|
|
11
|
+
resolve([{
|
|
12
|
+
value: '1',
|
|
13
|
+
label: '启用'
|
|
14
|
+
}, {
|
|
15
|
+
value: '2',
|
|
16
|
+
label: '未启用'
|
|
17
|
+
}, {
|
|
18
|
+
value: '0',
|
|
19
|
+
label: '未知'
|
|
20
|
+
}]);
|
|
21
|
+
}, 600);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function mockDApi() {
|
|
25
|
+
return new Promise(function (resolve) {
|
|
26
|
+
setTimeout(function () {
|
|
27
|
+
resolve({
|
|
28
|
+
options: [{
|
|
29
|
+
value: '2023',
|
|
30
|
+
label: '2023年'
|
|
31
|
+
}, {
|
|
32
|
+
value: '2024',
|
|
33
|
+
label: '2024年'
|
|
34
|
+
}, {
|
|
35
|
+
value: '2024',
|
|
36
|
+
label: '2025年'
|
|
37
|
+
}],
|
|
38
|
+
field: 'planYear'
|
|
39
|
+
});
|
|
40
|
+
}, 600);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
var TopFilter = function TopFilter(_ref) {
|
|
44
|
+
var filter = _ref.filter;
|
|
45
|
+
var _useState = useState(isArray(filter) ? filter : []),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
optons = _useState2[0],
|
|
48
|
+
setOptions = _useState2[1];
|
|
49
|
+
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
50
|
+
var _yield$mockDApi, options, field;
|
|
51
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
52
|
+
while (1) switch (_context.prev = _context.next) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (!isString(filter)) {
|
|
55
|
+
_context.next = 9;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
_context.next = 3;
|
|
59
|
+
return mockDApi();
|
|
60
|
+
case 3:
|
|
61
|
+
_yield$mockDApi = _context.sent;
|
|
62
|
+
options = _yield$mockDApi.options;
|
|
63
|
+
field = _yield$mockDApi.field;
|
|
64
|
+
setOptions(options);
|
|
65
|
+
_context.next = 19;
|
|
66
|
+
break;
|
|
67
|
+
case 9:
|
|
68
|
+
if (!isArray(filter)) {
|
|
69
|
+
_context.next = 13;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
setOptions(filter);
|
|
73
|
+
_context.next = 19;
|
|
74
|
+
break;
|
|
75
|
+
case 13:
|
|
76
|
+
if (!(filter.key && filter.field)) {
|
|
77
|
+
_context.next = 19;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
_context.t0 = setOptions;
|
|
81
|
+
_context.next = 17;
|
|
82
|
+
return mockDict();
|
|
83
|
+
case 17:
|
|
84
|
+
_context.t1 = _context.sent;
|
|
85
|
+
(0, _context.t0)(_context.t1);
|
|
86
|
+
case 19:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context.stop();
|
|
89
|
+
}
|
|
90
|
+
}, _callee);
|
|
91
|
+
})), [filter]);
|
|
92
|
+
return /*#__PURE__*/React.createElement(Segmented, {
|
|
93
|
+
options: optons
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
export default TopFilter;
|