@luck-design-biz/luckda 1.0.0-alpha → 1.0.1
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/Builder/index.js +15 -3
- package/es/components/ComplexItem/index.js +65 -49
- package/es/components/LdAutoForm/index.js +4 -3
- package/es/components/LdFormList/index.js +3 -6
- package/es/components/LdGridForm/index.js +2 -1
- package/es/helper/form.js +1 -0
- package/es/helper/ldBuilder.js +8 -3
- package/es/locales/zh-CN.js +38 -4
- package/es/lowcode/constants/event-topics.js +0 -2
- package/es/lowcode/engine/launcher.js +3 -1
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +2 -2
- package/es/lowcode/engine/meta/dialog.props.json +2 -2
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/es/lowcode/engine/meta/fielddate.props.json +4 -2
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/es/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/es/lowcode/engine/meta/fielduser.props.json +1 -1
- package/es/lowcode/engine/meta/form.props.default.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +4 -5
- 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 +2 -1
- package/es/lowcode/engine/meta/imex.props.json +26 -5
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +38 -20
- 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 +5 -5
- 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/page.props.json +6 -0
- package/es/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/es/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +2 -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.json +2 -2
- package/es/lowcode/engine/meta/text.props.default.json +4 -2
- package/es/lowcode/engine/meta/text.props.json +8 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +63 -46
- package/es/lowcode/engine/provider/ContextProvider/router.js +43 -0
- package/es/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -15
- package/es/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/es/lowcode/engine/provider/ContextProvider/utils.js +157 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +1 -2
- package/es/lowcode/engine/tools/helper.js +7 -2
- package/es/lowcode/engine/tools/initDS.js +263 -0
- package/es/lowcode/engine/tools/useCombinedRefs.js +3 -2
- package/es/lowcode/painter/DesignOperator.js +10 -1
- package/es/lowcode/painter/Panel.js +2 -2
- package/es/lowcode/painter/components/AdvancePanel.js +3 -3
- package/es/lowcode/painter/components/Collapse.js +5 -2
- package/es/lowcode/painter/components/TipIcon.js +16 -0
- package/es/lowcode/painter/components/VarEditor.js +456 -0
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +2 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +3 -1
- package/es/lowcode/painter/components/code-editor/VisionEditor.js +81 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +17 -3
- package/es/lowcode/painter/components/field-setting/index.js +1 -1
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/es/lowcode/painter/index.js +1 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +20 -6
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/es/lowcode/painter/panel-section/ComplexPop.js +242 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +29 -3
- package/es/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/es/lowcode/painter/panel-section/Icon.js +9 -4
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +7 -7
- package/es/lowcode/painter/panel-section/IconSelector.js +1 -1
- package/es/lowcode/painter/panel-section/ImpExp.js +1 -27
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +1 -2
- package/es/lowcode/painter/panel-section/LayoutRatio.js +1 -0
- package/es/lowcode/painter/panel-section/PageVars.js +300 -0
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +4 -3
- package/es/lowcode/painter/panel-section/TabItems.js +6 -42
- package/es/lowcode/painter/panel-section/TextContent.js +79 -0
- package/es/lowcode/painter/services/complexPop.js +21 -0
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/page-vars.less +25 -0
- package/es/lowcode/preview/index.js +1 -0
- package/es/lowcode/view/Canvas.js +24 -22
- package/es/lowcode/view/Loading.js +5 -7
- package/es/lowcode/view/Page.js +37 -15
- package/es/lowcode/view/index.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +18 -3
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +7 -7
- package/es/lowcode/view/lc-components/Button/meta.json +2 -2
- package/es/lowcode/view/lc-components/Dialog/index.js +6 -7
- package/es/lowcode/view/lc-components/Dialog/meta.json +2 -2
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +7 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +4 -2
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +3 -2
- package/es/lowcode/view/lc-components/FieldUser/meta.json +1 -1
- package/es/lowcode/view/lc-components/Form/index.js +14 -6
- package/es/lowcode/view/lc-components/Form/meta.json +4 -5
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/index.js +174 -103
- package/es/lowcode/view/lc-components/ImEx/meta.json +26 -5
- 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/index.js +22 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +5 -5
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Page/meta.json +6 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/es/lowcode/view/lc-components/PageLayout/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/index.js +2 -6
- package/es/lowcode/view/lc-components/Section/meta.json +2 -1
- package/es/lowcode/view/lc-components/Split/index.js +19 -4
- package/es/lowcode/view/lc-components/Split/meta.json +1 -1
- package/es/lowcode/view/lc-components/Table/index.js +29 -3
- package/es/lowcode/view/lc-components/Table/meta.json +2 -2
- package/es/lowcode/view/lc-components/Tabs/index.js +19 -16
- package/es/lowcode/view/lc-components/Text/index.js +9 -2
- package/es/lowcode/view/lc-components/Text/meta.json +6 -6
- package/es/lowcode/view/lc-components/Wrapper.js +17 -2
- package/es/lowcode/view/style/loading.less +14 -0
- package/es/services.js +19 -0
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/FormItem/index.js +6 -6
- package/es/utils/form.js +4 -4
- package/es/utils/grid.js +2 -1
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/ComplexItem/index.js +62 -47
- package/lib/components/LdAutoForm/index.js +3 -2
- package/lib/components/LdFormList/index.js +5 -8
- package/lib/components/LdGridForm/index.js +2 -1
- package/lib/helper/form.js +1 -0
- package/lib/helper/ldBuilder.js +8 -3
- package/lib/locales/zh-CN.js +38 -4
- package/lib/lowcode/constants/event-topics.js +1 -3
- package/lib/lowcode/engine/launcher.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +2 -2
- package/lib/lowcode/engine/meta/dialog.props.json +2 -2
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +4 -2
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/lib/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/lib/lowcode/engine/meta/fielduser.props.json +1 -1
- package/lib/lowcode/engine/meta/form.props.default.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +4 -5
- 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 +2 -1
- package/lib/lowcode/engine/meta/imex.props.json +26 -5
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +38 -20
- 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 +5 -5
- 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/page.props.json +6 -0
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +2 -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.json +2 -2
- package/lib/lowcode/engine/meta/text.props.default.json +4 -2
- package/lib/lowcode/engine/meta/text.props.json +8 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +61 -44
- package/lib/lowcode/engine/provider/ContextProvider/router.js +57 -0
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -16
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/lib/lowcode/engine/provider/ContextProvider/utils.js +170 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +2 -3
- package/lib/lowcode/engine/tools/helper.js +7 -2
- package/lib/lowcode/engine/tools/initDS.js +270 -0
- package/lib/lowcode/engine/tools/useCombinedRefs.js +2 -1
- package/lib/lowcode/painter/DesignOperator.js +9 -0
- package/lib/lowcode/painter/Panel.js +2 -2
- package/lib/lowcode/painter/components/AdvancePanel.js +3 -3
- package/lib/lowcode/painter/components/Collapse.js +5 -2
- package/lib/lowcode/painter/components/TipIcon.js +23 -0
- package/lib/lowcode/painter/components/VarEditor.js +463 -0
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +2 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +3 -1
- package/lib/lowcode/painter/components/code-editor/VisionEditor.js +88 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +17 -3
- package/lib/lowcode/painter/components/field-setting/index.js +1 -1
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/lib/lowcode/painter/index.js +1 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +19 -5
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/lib/lowcode/painter/panel-section/ComplexPop.js +250 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +29 -3
- package/lib/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/lib/lowcode/painter/panel-section/Icon.js +8 -3
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +6 -6
- package/lib/lowcode/painter/panel-section/IconSelector.js +1 -1
- package/lib/lowcode/painter/panel-section/ImpExp.js +0 -26
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +0 -1
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +1 -0
- package/lib/lowcode/painter/panel-section/PageVars.js +308 -0
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +4 -3
- package/lib/lowcode/painter/panel-section/TabItems.js +6 -42
- package/lib/lowcode/painter/panel-section/TextContent.js +87 -0
- package/lib/lowcode/painter/services/complexPop.js +28 -0
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/page-vars.less +25 -0
- package/lib/lowcode/preview/index.js +1 -0
- package/lib/lowcode/view/Canvas.js +24 -22
- package/lib/lowcode/view/Loading.js +5 -7
- package/lib/lowcode/view/Page.js +35 -13
- package/lib/lowcode/view/index.js +1 -0
- package/lib/lowcode/view/lc-components/Box/index.js +17 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +5 -5
- package/lib/lowcode/view/lc-components/Button/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Dialog/index.js +6 -7
- package/lib/lowcode/view/lc-components/Dialog/meta.json +2 -2
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +7 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +4 -2
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +3 -2
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Form/index.js +14 -6
- package/lib/lowcode/view/lc-components/Form/meta.json +4 -5
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/index.js +172 -101
- package/lib/lowcode/view/lc-components/ImEx/meta.json +26 -5
- 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/index.js +21 -4
- package/lib/lowcode/view/lc-components/Layout/meta.json +5 -5
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Page/meta.json +6 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/index.js +2 -6
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -1
- package/lib/lowcode/view/lc-components/Split/index.js +18 -3
- package/lib/lowcode/view/lc-components/Split/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Table/index.js +30 -4
- package/lib/lowcode/view/lc-components/Table/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Tabs/index.js +17 -14
- package/lib/lowcode/view/lc-components/Text/index.js +8 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +6 -6
- package/lib/lowcode/view/lc-components/Wrapper.js +16 -1
- package/lib/lowcode/view/style/loading.less +14 -0
- package/lib/services.js +20 -0
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/FormItem/index.js +6 -6
- package/lib/utils/form.js +3 -3
- package/lib/utils/grid.js +2 -1
- package/package.json +3 -3
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useReducer, useState } from 'react';
|
|
4
|
+
import { useMemoizedFn, useUpdateEffect, useCreation, useDebounceFn, useSetState } from 'ahooks';
|
|
5
|
+
import { Select, Input, Button, Menu, Dropdown, Drawer, Modal } from 'luck-design/antd';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { reduce, isNil } from 'lodash';
|
|
8
|
+
import { suid, formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import { SortBox, SortItem } from "../components/SortBox";
|
|
10
|
+
import { ListEditor, ListEditorItem } from "../components/ListEditor";
|
|
11
|
+
import { listReducer } from "../../engine/tools/helper";
|
|
12
|
+
import VarEditor from "../components/VarEditor";
|
|
13
|
+
import TipIcon from "../components/TipIcon";
|
|
14
|
+
import styles from "../style/page-vars.less";
|
|
15
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.pageVars';
|
|
16
|
+
var Wrapper = styled.div.withConfig({
|
|
17
|
+
displayName: "Wrapper",
|
|
18
|
+
componentId: "luckda-6530__sc-1qdz6c5-0"
|
|
19
|
+
})(["padding:0 12px;"]);
|
|
20
|
+
var SearchBar = styled.div.withConfig({
|
|
21
|
+
displayName: "SearchBar",
|
|
22
|
+
componentId: "luckda-6530__sc-1qdz6c5-1"
|
|
23
|
+
})(["display:flex;margin-bottom:8px;"]);
|
|
24
|
+
var ItemWrapper = styled.div.withConfig({
|
|
25
|
+
displayName: "ItemWrapper",
|
|
26
|
+
componentId: "luckda-6530__sc-1qdz6c5-2"
|
|
27
|
+
})(["display:flex;align-items:center;"]);
|
|
28
|
+
var _TYPES_ = {
|
|
29
|
+
var: {
|
|
30
|
+
name: formatMessage({
|
|
31
|
+
id: "".concat(_I18N_PREFIX_, ".var"),
|
|
32
|
+
label: '变量'
|
|
33
|
+
}),
|
|
34
|
+
color: '#87d068'
|
|
35
|
+
},
|
|
36
|
+
api: {
|
|
37
|
+
name: formatMessage({
|
|
38
|
+
id: "".concat(_I18N_PREFIX_, ".api"),
|
|
39
|
+
label: '远程 API'
|
|
40
|
+
}),
|
|
41
|
+
color: '#108ee9'
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var _TYPE_KEYS_ = Object.keys(_TYPES_);
|
|
45
|
+
var PageVars = function PageVars(_ref) {
|
|
46
|
+
var _ref$defaultValue = _ref.defaultValue,
|
|
47
|
+
defaultValue = _ref$defaultValue === void 0 ? [] : _ref$defaultValue,
|
|
48
|
+
onChange = _ref.onChange;
|
|
49
|
+
var _useReducer = useReducer(listReducer, defaultValue),
|
|
50
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
51
|
+
vars = _useReducer2[0],
|
|
52
|
+
dispatch = _useReducer2[1];
|
|
53
|
+
var _useSetState = useSetState({}),
|
|
54
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
55
|
+
filter = _useSetState2[0],
|
|
56
|
+
setFilter = _useSetState2[1];
|
|
57
|
+
useUpdateEffect(function () {
|
|
58
|
+
onChange(vars);
|
|
59
|
+
}, [vars]);
|
|
60
|
+
var _useState = useState(null),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
currentItem = _useState2[0],
|
|
63
|
+
setCurrentItem = _useState2[1];
|
|
64
|
+
var handleSortChange = useMemoizedFn(function (sortItems) {
|
|
65
|
+
dispatch({
|
|
66
|
+
type: 'sort',
|
|
67
|
+
payload: sortItems
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
var handleAdd = useMemoizedFn(function (_item) {
|
|
71
|
+
dispatch({
|
|
72
|
+
type: 'add',
|
|
73
|
+
payload: _item
|
|
74
|
+
});
|
|
75
|
+
setCurrentItem(_item);
|
|
76
|
+
});
|
|
77
|
+
var _useDebounceFn = useDebounceFn(function (keyword) {
|
|
78
|
+
return setFilter({
|
|
79
|
+
keyword: isNil(keyword) || keyword === '' ? void 0 : keyword
|
|
80
|
+
});
|
|
81
|
+
}, {
|
|
82
|
+
wait: 400
|
|
83
|
+
}),
|
|
84
|
+
handleSearch = _useDebounceFn.run;
|
|
85
|
+
var renderItemLeft = useMemoizedFn(function (item) {
|
|
86
|
+
var _TYPES_$item$type = _TYPES_[item.type],
|
|
87
|
+
name = _TYPES_$item$type.name,
|
|
88
|
+
color = _TYPES_$item$type.color;
|
|
89
|
+
return /*#__PURE__*/React.createElement(ItemWrapper, null, /*#__PURE__*/React.createElement("span", {
|
|
90
|
+
style: {
|
|
91
|
+
color: color
|
|
92
|
+
}
|
|
93
|
+
}, name.substring(0, 2)), /*#__PURE__*/React.createElement("span", {
|
|
94
|
+
style: {
|
|
95
|
+
marginLeft: 4,
|
|
96
|
+
fontWeight: 'bold'
|
|
97
|
+
}
|
|
98
|
+
}, item.name));
|
|
99
|
+
});
|
|
100
|
+
var renderItemRight = useMemoizedFn(function (item) {
|
|
101
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TipIcon, {
|
|
102
|
+
type: "edit",
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return setCurrentItem(item);
|
|
105
|
+
},
|
|
106
|
+
style: {
|
|
107
|
+
marginRight: 4,
|
|
108
|
+
cursor: 'pointer'
|
|
109
|
+
},
|
|
110
|
+
title: formatMessage({
|
|
111
|
+
id: "".concat(_I18N_PREFIX_, ".edit"),
|
|
112
|
+
label: '编辑'
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
115
|
+
type: "copy",
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
return handleAdd(_objectSpread(_objectSpread({}, item), {}, {
|
|
118
|
+
id: suid(),
|
|
119
|
+
name: "".concat(item.name, "_copy")
|
|
120
|
+
}));
|
|
121
|
+
},
|
|
122
|
+
style: {
|
|
123
|
+
marginRight: 4,
|
|
124
|
+
cursor: 'pointer'
|
|
125
|
+
},
|
|
126
|
+
title: formatMessage({
|
|
127
|
+
id: "".concat(_I18N_PREFIX_, ".copy"),
|
|
128
|
+
label: '拷贝'
|
|
129
|
+
})
|
|
130
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
131
|
+
type: "delete",
|
|
132
|
+
onClick: function onClick() {
|
|
133
|
+
return Modal.confirm({
|
|
134
|
+
title: formatMessage({
|
|
135
|
+
id: "".concat(_I18N_PREFIX_, ".confirm.delete"),
|
|
136
|
+
label: "\u786E\u8BA4\u5220\u9664\u5417\uFF1F"
|
|
137
|
+
}),
|
|
138
|
+
onOk: function onOk() {
|
|
139
|
+
if (currentItem.id === item.id) {
|
|
140
|
+
setCurrentItem(null);
|
|
141
|
+
}
|
|
142
|
+
dispatch({
|
|
143
|
+
type: 'delete',
|
|
144
|
+
payload: item.id
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
style: {
|
|
150
|
+
marginRight: 4,
|
|
151
|
+
cursor: 'pointer'
|
|
152
|
+
},
|
|
153
|
+
title: formatMessage({
|
|
154
|
+
id: "".concat(_I18N_PREFIX_, ".delete"),
|
|
155
|
+
label: '删除'
|
|
156
|
+
})
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
var menu = useCreation(function () {
|
|
160
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
161
|
+
onClick: function onClick(_ref2) {
|
|
162
|
+
var key = _ref2.key;
|
|
163
|
+
var id = suid();
|
|
164
|
+
handleAdd(_objectSpread({
|
|
165
|
+
id: id,
|
|
166
|
+
type: key,
|
|
167
|
+
name: id
|
|
168
|
+
}, {
|
|
169
|
+
var: {
|
|
170
|
+
data: ''
|
|
171
|
+
},
|
|
172
|
+
api: {
|
|
173
|
+
data: {
|
|
174
|
+
auto: true,
|
|
175
|
+
taskType: 'parallel',
|
|
176
|
+
method: 'get'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}[key]));
|
|
180
|
+
}
|
|
181
|
+
}, _TYPE_KEYS_.map(function (key) {
|
|
182
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
183
|
+
key: key
|
|
184
|
+
}, _TYPES_[key].name);
|
|
185
|
+
}));
|
|
186
|
+
}, []);
|
|
187
|
+
var _vars = useCreation(function () {
|
|
188
|
+
var keyword = filter.keyword,
|
|
189
|
+
type = filter.type;
|
|
190
|
+
var _vars = isNil(type) ? vars : vars.filter(function (_item) {
|
|
191
|
+
return _item.type === type;
|
|
192
|
+
});
|
|
193
|
+
if (isNil(keyword) || keyword === '') {
|
|
194
|
+
return _vars;
|
|
195
|
+
}
|
|
196
|
+
return reduce(_vars, function (ret, _item) {
|
|
197
|
+
if (JSON.stringify(_item).includes(keyword)) {
|
|
198
|
+
ret.push(_item);
|
|
199
|
+
}
|
|
200
|
+
return ret;
|
|
201
|
+
}, []);
|
|
202
|
+
}, [filter, vars]);
|
|
203
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(SearchBar, null, /*#__PURE__*/React.createElement(Select, {
|
|
204
|
+
size: "small",
|
|
205
|
+
defaultValue: "all",
|
|
206
|
+
style: {
|
|
207
|
+
width: 100,
|
|
208
|
+
marginRight: 8
|
|
209
|
+
},
|
|
210
|
+
onSelect: function onSelect(key) {
|
|
211
|
+
return setFilter({
|
|
212
|
+
type: key === 'all' ? void 0 : key
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
216
|
+
value: "all"
|
|
217
|
+
}, formatMessage({
|
|
218
|
+
id: "".concat(_I18N_PREFIX_, ".all"),
|
|
219
|
+
label: '全部'
|
|
220
|
+
})), _TYPE_KEYS_.map(function (key) {
|
|
221
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
222
|
+
key: key,
|
|
223
|
+
value: key
|
|
224
|
+
}, _TYPES_[key].name);
|
|
225
|
+
})), /*#__PURE__*/React.createElement(Input.Search, {
|
|
226
|
+
size: "small",
|
|
227
|
+
allowClear: true,
|
|
228
|
+
style: {
|
|
229
|
+
flex: 1
|
|
230
|
+
},
|
|
231
|
+
placeholder: formatMessage({
|
|
232
|
+
id: "".concat(_I18N_PREFIX_, ".placeholder.search"),
|
|
233
|
+
label: '请输入'
|
|
234
|
+
}),
|
|
235
|
+
onChange: function onChange(e) {
|
|
236
|
+
return handleSearch(e.target.value);
|
|
237
|
+
},
|
|
238
|
+
onSearch: handleSearch
|
|
239
|
+
})), /*#__PURE__*/React.createElement(Dropdown, {
|
|
240
|
+
overlay: menu,
|
|
241
|
+
trigger: ['click'],
|
|
242
|
+
getPopupContainer: function getPopupContainer() {
|
|
243
|
+
return document.getElementById('lc-design-workspace');
|
|
244
|
+
}
|
|
245
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
246
|
+
size: "small",
|
|
247
|
+
type: "primary"
|
|
248
|
+
}, formatMessage({
|
|
249
|
+
id: "".concat(_I18N_PREFIX_, ".add"),
|
|
250
|
+
label: '添加'
|
|
251
|
+
}))), /*#__PURE__*/React.createElement(SortBox, {
|
|
252
|
+
datas: vars.map(function (_ref3) {
|
|
253
|
+
var id = _ref3.id;
|
|
254
|
+
return id;
|
|
255
|
+
}),
|
|
256
|
+
onChange: handleSortChange
|
|
257
|
+
}, /*#__PURE__*/React.createElement(ListEditor, {
|
|
258
|
+
style: {
|
|
259
|
+
marginTop: 8
|
|
260
|
+
},
|
|
261
|
+
suppressAdd: true
|
|
262
|
+
}, _vars.map(function (item) {
|
|
263
|
+
return /*#__PURE__*/React.createElement(SortItem, {
|
|
264
|
+
key: item.id,
|
|
265
|
+
id: item.id
|
|
266
|
+
}, /*#__PURE__*/React.createElement(ListEditorItem, {
|
|
267
|
+
sortable: isNil(filter.keyword) && isNil(filter.type),
|
|
268
|
+
left: renderItemLeft(item),
|
|
269
|
+
right: renderItemRight(item),
|
|
270
|
+
item: item,
|
|
271
|
+
dispatch: dispatch
|
|
272
|
+
}));
|
|
273
|
+
})))), currentItem ? /*#__PURE__*/React.createElement(Drawer, {
|
|
274
|
+
visible: true,
|
|
275
|
+
width: 420,
|
|
276
|
+
mask: false,
|
|
277
|
+
onClose: function onClose() {
|
|
278
|
+
return setCurrentItem(null);
|
|
279
|
+
},
|
|
280
|
+
title: formatMessage({
|
|
281
|
+
id: "".concat(_I18N_PREFIX_, ".edit"),
|
|
282
|
+
label: '编辑数据源'
|
|
283
|
+
}),
|
|
284
|
+
getContainer: function getContainer() {
|
|
285
|
+
return document.getElementById('lc-design-workspace');
|
|
286
|
+
},
|
|
287
|
+
destroyOnClose: true,
|
|
288
|
+
className: styles['lc-painter-panel-page-vars-drawer'],
|
|
289
|
+
style: {
|
|
290
|
+
position: 'absolute',
|
|
291
|
+
transform: 'none',
|
|
292
|
+
right: 320
|
|
293
|
+
}
|
|
294
|
+
}, /*#__PURE__*/React.createElement(VarEditor, {
|
|
295
|
+
key: currentItem.id,
|
|
296
|
+
item: currentItem,
|
|
297
|
+
dispatch: dispatch
|
|
298
|
+
})) : null);
|
|
299
|
+
};
|
|
300
|
+
export default PageVars;
|
|
@@ -2,6 +2,7 @@ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIt
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
7
|
import React, { createContext, useContext, useReducer, useRef } from 'react';
|
|
7
8
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -44,7 +45,7 @@ export function StyleProvider(_ref) {
|
|
|
44
45
|
}
|
|
45
46
|
case 'new':
|
|
46
47
|
{
|
|
47
|
-
var _newState =
|
|
48
|
+
var _newState = _defineProperty({}, _ROOT_KEY_, action.payload);
|
|
48
49
|
if (editorRef.current) {
|
|
49
50
|
styleToEditor(_newState).then(function (css) {
|
|
50
51
|
return editorRef.current.editor.setValue(css);
|
|
@@ -115,7 +116,7 @@ export function StyleProvider(_ref) {
|
|
|
115
116
|
}
|
|
116
117
|
export function useStyle(full) {
|
|
117
118
|
var _style = useContext(StyleContext);
|
|
118
|
-
return full ? _style : _style[_ROOT_KEY_];
|
|
119
|
+
return (full ? _style : _style[_ROOT_KEY_]) || {};
|
|
119
120
|
}
|
|
120
121
|
export function useStyleDispatch() {
|
|
121
122
|
return useContext(StyleDispatchContext);
|
|
@@ -175,7 +176,7 @@ export var styleToEditor = /*#__PURE__*/function () {
|
|
|
175
176
|
case 4:
|
|
176
177
|
_yield$postcss$proces2 = _context2.sent;
|
|
177
178
|
css = _yield$postcss$proces2.css;
|
|
178
|
-
return _context2.abrupt("return", css);
|
|
179
|
+
return _context2.abrupt("return", css === '' ? "".concat(_ROOT_KEY_, "{\n\t\n}") : css);
|
|
179
180
|
case 7:
|
|
180
181
|
case "end":
|
|
181
182
|
return _context2.stop();
|
|
@@ -3,27 +3,14 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import React, { useRef, useReducer, useEffect } from 'react';
|
|
4
4
|
import { Radio, Icon, Tooltip, Input, Switch } from 'luck-design/antd';
|
|
5
5
|
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
6
|
-
import { Segmented } from '@luck-helper/ui-design';
|
|
7
6
|
import styles from "../style/tabitems.less";
|
|
8
7
|
import { SortBox, SortItem } from "../components/SortBox";
|
|
9
8
|
import { ListEditor, ListEditorItem } from "../components/ListEditor";
|
|
10
9
|
import PopConfirm from "../components/PopConfirm";
|
|
11
10
|
import { PopForm, PopFormItem, PopFormItemLeft, PopFormItemRight } from "../components/PopForm";
|
|
11
|
+
import SerialsSelector from "./SerialsSelector";
|
|
12
12
|
import { listReducer } from "../../engine/tools/helper";
|
|
13
13
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.tabsitems';
|
|
14
|
-
var _SERIAL_EFFECT_OPTIONS_ = [{
|
|
15
|
-
label: formatMessage({
|
|
16
|
-
id: 'luckda.lowcode.painter.hidden',
|
|
17
|
-
label: '隐藏'
|
|
18
|
-
}),
|
|
19
|
-
value: 'hidden'
|
|
20
|
-
}, {
|
|
21
|
-
label: formatMessage({
|
|
22
|
-
id: 'luckda.lowcode.painter.disable',
|
|
23
|
-
label: '禁用'
|
|
24
|
-
}),
|
|
25
|
-
value: 'disable'
|
|
26
|
-
}];
|
|
27
14
|
var TabItems = function TabItems(_ref) {
|
|
28
15
|
var defaultValue = _ref.defaultValue,
|
|
29
16
|
onChange = _ref.onChange;
|
|
@@ -153,25 +140,13 @@ var TabItemEditor = function TabItemEditor(_ref4) {
|
|
|
153
140
|
}
|
|
154
141
|
});
|
|
155
142
|
};
|
|
156
|
-
var
|
|
157
|
-
console.log('value', value);
|
|
143
|
+
var handleResChange = function handleResChange(val) {
|
|
158
144
|
dispatch({
|
|
159
145
|
type: 'edit',
|
|
160
146
|
payload: {
|
|
161
147
|
id: item.id,
|
|
162
148
|
data: _objectSpread(_objectSpread({}, item), {}, {
|
|
163
|
-
|
|
164
|
-
})
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
var handleResChange = function handleResChange(e) {
|
|
169
|
-
dispatch({
|
|
170
|
-
type: 'edit',
|
|
171
|
-
payload: {
|
|
172
|
-
id: item.id,
|
|
173
|
-
data: _objectSpread(_objectSpread({}, item), {}, {
|
|
174
|
-
serial: e.target.value
|
|
149
|
+
serial: val
|
|
175
150
|
})
|
|
176
151
|
}
|
|
177
152
|
});
|
|
@@ -203,21 +178,10 @@ var TabItemEditor = function TabItemEditor(_ref4) {
|
|
|
203
178
|
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
204
179
|
id: "".concat(_I18N_PREFIX_, ".editor.serial"),
|
|
205
180
|
label: '资源串'
|
|
206
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(
|
|
207
|
-
|
|
208
|
-
value: item.serial,
|
|
181
|
+
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(SerialsSelector, {
|
|
182
|
+
defaultValue: item.serial,
|
|
209
183
|
onChange: handleResChange,
|
|
210
|
-
|
|
211
|
-
id: "".concat(_I18N_PREFIX_, ".editor.serial.placeholder"),
|
|
212
|
-
label: '请输入资源串名称'
|
|
213
|
-
})
|
|
214
|
-
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
215
|
-
id: "".concat(_I18N_PREFIX_, ".editor.serialEffect"),
|
|
216
|
-
label: '越权效果'
|
|
217
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(Segmented, {
|
|
218
|
-
options: _SERIAL_EFFECT_OPTIONS_,
|
|
219
|
-
onChange: handleEffectChange,
|
|
220
|
-
value: item.serialEffect
|
|
184
|
+
size: "small"
|
|
221
185
|
}))));
|
|
222
186
|
};
|
|
223
187
|
export default TabItems;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { useMemoizedFn, useSetState, useUpdateEffect } from 'ahooks';
|
|
4
|
+
import { Icon } from 'luck-design/antd';
|
|
5
|
+
import { isNil } from 'lodash';
|
|
6
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
7
|
+
import I18nInput from "./I18nInput";
|
|
8
|
+
import Collapse from "../components/Collapse";
|
|
9
|
+
import PopConfirm from "../components/PopConfirm";
|
|
10
|
+
import FullScreenEditor from "../components/code-editor/FullScreenEditor";
|
|
11
|
+
import JSEditor from "../components/code-editor/JSEditor";
|
|
12
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.textContent';
|
|
13
|
+
var _DEFAULT_FUNC_ = "function getText() {\n return '文本'; \n}";
|
|
14
|
+
var TextContent = function TextContent(_ref) {
|
|
15
|
+
var defaultValue = _ref.defaultValue,
|
|
16
|
+
onChange = _ref.onChange;
|
|
17
|
+
var editorRef = useRef();
|
|
18
|
+
var _useSetState = useSetState(defaultValue),
|
|
19
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
20
|
+
value = _useSetState2[0],
|
|
21
|
+
setValue = _useSetState2[1];
|
|
22
|
+
useUpdateEffect(function () {
|
|
23
|
+
onChange(value);
|
|
24
|
+
}, [value]);
|
|
25
|
+
var handleComfirm = useMemoizedFn(function () {
|
|
26
|
+
var val = editorRef.current.editor.getValue();
|
|
27
|
+
if (val === '') {
|
|
28
|
+
setValue({
|
|
29
|
+
code: void 0
|
|
30
|
+
});
|
|
31
|
+
editorRef.current.editor.setValue(_DEFAULT_FUNC_);
|
|
32
|
+
} else {
|
|
33
|
+
setValue({
|
|
34
|
+
code: val
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var handleChange = useMemoizedFn(function (val) {
|
|
39
|
+
setValue({
|
|
40
|
+
text: val
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
|
44
|
+
field: "render",
|
|
45
|
+
label: formatMessage({
|
|
46
|
+
id: "".concat(_I18N_PREFIX_),
|
|
47
|
+
label: '内容'
|
|
48
|
+
}),
|
|
49
|
+
bodyStyle: {
|
|
50
|
+
padding: '12px 16px'
|
|
51
|
+
},
|
|
52
|
+
suppressIcon: true,
|
|
53
|
+
extraRender: function extraRender() {
|
|
54
|
+
return /*#__PURE__*/React.createElement(PopConfirm, {
|
|
55
|
+
placement: "left",
|
|
56
|
+
title: /*#__PURE__*/React.createElement(FullScreenEditor, {
|
|
57
|
+
ref: editorRef,
|
|
58
|
+
EditorComponent: JSEditor,
|
|
59
|
+
width: "600px",
|
|
60
|
+
height: "400px"
|
|
61
|
+
}, (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.code) || _DEFAULT_FUNC_),
|
|
62
|
+
showBtn: true,
|
|
63
|
+
onConfirm: handleComfirm
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
65
|
+
type: "code",
|
|
66
|
+
style: isNil(value.code) ? null : {
|
|
67
|
+
color: '#1890ff'
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(I18nInput, {
|
|
72
|
+
defaultValue: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text,
|
|
73
|
+
size: "small",
|
|
74
|
+
wrapped: "textarea",
|
|
75
|
+
disabled: !isNil(value.code),
|
|
76
|
+
onChange: handleChange
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
export default TextContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import { stringify } from 'qs';
|
|
4
|
+
import { request } from '@luck-design-biz/base/utils';
|
|
5
|
+
import api from "@/services/ApiConfig";
|
|
6
|
+
export var getFields = /*#__PURE__*/function () {
|
|
7
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(get) {
|
|
8
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10
|
+
case 0:
|
|
11
|
+
return _context.abrupt("return", request("".concat(api.BASE_HOST, "/logic/field/noAuthGetFields?").concat(stringify(get))));
|
|
12
|
+
case 1:
|
|
13
|
+
case "end":
|
|
14
|
+
return _context.stop();
|
|
15
|
+
}
|
|
16
|
+
}, _callee);
|
|
17
|
+
}));
|
|
18
|
+
return function getFields(_x) {
|
|
19
|
+
return _ref.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
}();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.lc-painter-panel-page-vars-drawer {
|
|
2
|
+
:global {
|
|
3
|
+
.ant-drawer-header {
|
|
4
|
+
height: 38px;
|
|
5
|
+
padding: 8px 16px;
|
|
6
|
+
.ant-drawer-close {
|
|
7
|
+
width: 38px !important;
|
|
8
|
+
height: 38px !important;
|
|
9
|
+
line-height: 38px !important;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
.ant-drawer-body {
|
|
13
|
+
height: calc(100% - 38px);
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
padding: 8px 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input,
|
|
19
|
+
button,
|
|
20
|
+
.ant-radio-wrapper,
|
|
21
|
+
.ant-select-sm {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { useEffect } from 'react';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
5
4
|
import styled from 'styled-components';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { useContext, useGet } from "../engine/provider/ContextProvider";
|
|
7
|
+
import { useStateStore } from "../engine/provider/ContextProvider/usePageVar";
|
|
8
8
|
import PageHeader from "./lc-components/PageHeader";
|
|
9
9
|
import PageContent from "./lc-components/PageContent";
|
|
10
10
|
import PageFooter from "./lc-components/PageFooter";
|
|
11
11
|
import PageModal from "./lc-components/PageModal";
|
|
12
12
|
import { LC_BUILDIN_UNIT_KEY } from "../constants";
|
|
13
|
+
import diff from "../engine/tools/diff";
|
|
13
14
|
import styles from "./style/canvas.less";
|
|
14
15
|
var PageRoot = styled.div.withConfig({
|
|
15
16
|
displayName: "PageRoot",
|
|
@@ -18,35 +19,36 @@ var PageRoot = styled.div.withConfig({
|
|
|
18
19
|
return props.$css;
|
|
19
20
|
});
|
|
20
21
|
var Canvas = function Canvas(_ref) {
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
22
|
+
var _dsRef$current;
|
|
23
|
+
var className = _ref.className,
|
|
24
|
+
dsRef = _ref.dsRef;
|
|
25
|
+
(_dsRef$current = dsRef.current) === null || _dsRef$current === void 0 || _dsRef$current.read();
|
|
26
|
+
var _useGet = useGet(['props.css', 'props.advance', 'props.enableHeader', 'props.enableFooter', 'props.vars']),
|
|
27
|
+
_useGet2 = _slicedToArray(_useGet, 5),
|
|
24
28
|
pagerootCss = _useGet2[0],
|
|
25
29
|
advance = _useGet2[1],
|
|
26
30
|
enableHeader = _useGet2[2],
|
|
27
|
-
enableFooter = _useGet2[3]
|
|
31
|
+
enableFooter = _useGet2[3],
|
|
32
|
+
pageVars = _useGet2[4];
|
|
28
33
|
var ctx = useContext();
|
|
29
|
-
|
|
30
|
-
var _advance$events;
|
|
31
|
-
ctx.doAction(advance === null || advance === void 0 || (_advance$events = advance.events) === null || _advance$events === void 0 ? void 0 : _advance$events.onPageMount);
|
|
32
|
-
});
|
|
33
|
-
var handleStateChanged = useMemoizedFn(function (_ref2) {
|
|
34
|
+
useEffect(function () {
|
|
34
35
|
var _advance$events2;
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
var unsub = useStateStore.subscribe(function (store) {
|
|
37
|
+
return store.state;
|
|
38
|
+
}, function (state, prevState) {
|
|
39
|
+
var _advance$events;
|
|
40
|
+
var _diff = diff(prevState, state);
|
|
41
|
+
ctx.doAction(advance === null || advance === void 0 || (_advance$events = advance.events) === null || _advance$events === void 0 ? void 0 : _advance$events.onStateChanged, {
|
|
42
|
+
state: state,
|
|
43
|
+
prevState: prevState,
|
|
44
|
+
diff: _diff
|
|
45
|
+
});
|
|
42
46
|
});
|
|
43
|
-
|
|
44
|
-
useEffect(function () {
|
|
45
|
-
ctx.$subscriber(ctx.topics.PAGE_LOAD_MOUNT).once(handleMount).watch();
|
|
46
|
-
var tid = ctx.$subscriber(ctx.topics.PAGE_STATE_CHANGED).on(handleStateChanged);
|
|
47
|
+
ctx.doAction(advance === null || advance === void 0 || (_advance$events2 = advance.events) === null || _advance$events2 === void 0 ? void 0 : _advance$events2.onPageMount);
|
|
47
48
|
return function () {
|
|
48
49
|
var _advance$events3;
|
|
49
|
-
|
|
50
|
+
unsub();
|
|
51
|
+
useStateStore.getState().clear();
|
|
50
52
|
ctx.doAction(advance === null || advance === void 0 || (_advance$events3 = advance.events) === null || _advance$events3 === void 0 ? void 0 : _advance$events3.onPageUnmount);
|
|
51
53
|
};
|
|
52
54
|
}, []);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import styles from "./style/loading.less";
|
|
5
|
-
var Loading = function Loading(
|
|
6
|
-
var className = _ref.className,
|
|
7
|
-
style = _ref.style;
|
|
4
|
+
var Loading = function Loading() {
|
|
8
5
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className:
|
|
10
|
-
|
|
6
|
+
className: styles.masker
|
|
7
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: styles['lc-painter-loading']
|
|
11
9
|
}, /*#__PURE__*/React.createElement("div", {
|
|
12
10
|
className: styles['cube']
|
|
13
11
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -22,6 +20,6 @@ var Loading = function Loading(_ref) {
|
|
|
22
20
|
className: classNames(styles['side'], styles['side5'])
|
|
23
21
|
}), /*#__PURE__*/React.createElement("div", {
|
|
24
22
|
className: classNames(styles['side'], styles['side6'])
|
|
25
|
-
})));
|
|
23
|
+
}))));
|
|
26
24
|
};
|
|
27
25
|
export default Loading;
|