@luck-design-biz/luckda 1.0.6-13tl → 1.0.7
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 +37 -27
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LdAutoForm/index.js +25 -12
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +5 -4
- package/es/components/LdGrid/index.js +29 -20
- package/es/components/LdGridForm/index.js +16 -7
- package/es/components/LdInfoPanel/index.js +16 -10
- package/es/helper/FromItems.js +64 -5
- package/es/helper/form.js +8 -2
- package/es/helper/ldBuilder.js +9 -5
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +40 -4
- package/es/lowcode/constants/api-url.js +202 -175
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -0
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/pagecomponent.props.default.json +8 -0
- package/es/lowcode/engine/meta/pagecomponent.props.json +41 -0
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +44 -5
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +129 -27
- package/es/lowcode/painter/DesignToolbar.js +88 -173
- package/es/lowcode/painter/components/AdvancePanel.js +28 -10
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -4
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +0 -1
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/es/lowcode/painter/panel-section/JSEditor/index.js +15 -5
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/Page.js +8 -3
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +9 -7
- package/es/lowcode/view/lc-components/Drawer/index.js +2 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -0
- package/es/lowcode/view/lc-components/Form/index.js +3 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +5 -23
- package/es/lowcode/view/lc-components/Table/index.js +12 -6
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Wrapper.js +7 -1
- package/es/services.js +25 -7
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +37 -4
- package/es/utils/grid.js +2 -1
- package/lib/components/Builder/index.js +36 -26
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LdAutoForm/index.js +22 -9
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +4 -3
- package/lib/components/LdGrid/index.js +29 -20
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/components/LdInfoPanel/index.js +15 -9
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/form.js +8 -2
- package/lib/helper/ldBuilder.js +8 -5
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +40 -4
- package/lib/lowcode/constants/api-url.js +204 -175
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -0
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/pagecomponent.props.default.json +8 -0
- package/lib/lowcode/engine/meta/pagecomponent.props.json +41 -0
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +44 -4
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +126 -24
- package/lib/lowcode/painter/DesignToolbar.js +84 -169
- package/lib/lowcode/painter/components/AdvancePanel.js +27 -9
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -3
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +0 -1
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +14 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/Page.js +8 -3
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +9 -7
- package/lib/lowcode/view/lc-components/Drawer/index.js +2 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -0
- package/lib/lowcode/view/lc-components/Form/index.js +3 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +4 -22
- package/lib/lowcode/view/lc-components/Table/index.js +12 -6
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +6 -0
- package/lib/services.js +26 -7
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +38 -4
- package/lib/utils/grid.js +2 -1
- package/package.json +1 -1
- package/es/lowcode/engine/meta/button.api.json +0 -0
- package/lib/lowcode/engine/meta/button.api.json +0 -0
|
@@ -1,39 +1,60 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
6
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
|
-
var _excluded = ["key", "label"];
|
|
9
5
|
import React, { useRef, useEffect, useState } from 'react';
|
|
10
|
-
import { useLocation } from 'umi';
|
|
6
|
+
import { useLocation, getCreateHistoryOptions } from 'umi';
|
|
11
7
|
import classNames from 'classnames';
|
|
12
|
-
import { useMemoizedFn, useRequest
|
|
13
|
-
import { Select,
|
|
8
|
+
import { useMemoizedFn, useRequest } from 'ahooks';
|
|
9
|
+
import { Select, Icon, Divider, Modal, message } from 'luck-design/antd';
|
|
14
10
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
15
11
|
import { useContext, useGet, resetPageData, setNeedPrompt, getNeedPrompt, useTemporalStore } from "../engine/provider/ContextProvider";
|
|
16
12
|
import JsonEditor from "../painter/components/code-editor/JsonEditor";
|
|
17
|
-
import
|
|
18
|
-
import { LC_BUILDIN_UNIT_KEY, COOKIE_VIRTUAL_ACCOUNT_KEY } from "../constants";
|
|
13
|
+
import { LC_BUILDIN_UNIT_KEY } from "../constants";
|
|
19
14
|
import styles from "./style/design.less";
|
|
20
|
-
import { fetchClearCache, fetchUpdatePageData
|
|
15
|
+
import { fetchClearCache, fetchUpdatePageData } from "../constants/api-url";
|
|
21
16
|
import { getLDMetaAttr } from "../engine/tools/helper";
|
|
22
17
|
import TipIcon from "./components/TipIcon";
|
|
18
|
+
import ShortcutModal from "./components/shortcut-modal";
|
|
23
19
|
var CodeSvg = function CodeSvg() {
|
|
24
20
|
return /*#__PURE__*/React.createElement("svg", {
|
|
25
21
|
width: "18",
|
|
26
22
|
height: "18",
|
|
27
23
|
viewBox: "0 0 18 18",
|
|
28
|
-
fill: "none"
|
|
29
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
24
|
+
fill: "none"
|
|
30
25
|
}, /*#__PURE__*/React.createElement("path", {
|
|
31
26
|
d: "M2.4749 9.0916L5.45264 6.20703L5.45439 5.93457V4.69707L0.91748 9.0916L5.45439 13.4844V12.2469L5.45264 11.9744L2.4749 9.0916ZM15.2067 9.00723L12.229 6.12441L12.2272 5.85195V4.61445L16.7642 9.00723L12.2272 13.4018V12.1625L12.229 11.89L15.2067 9.00723ZM8.12451 15.0295H6.76045L9.55713 2.80566H10.9212L8.12451 15.0295Z",
|
|
32
27
|
fill: "currentColor"
|
|
33
28
|
}));
|
|
34
29
|
};
|
|
30
|
+
var KeyboardSvg = function KeyboardSvg() {
|
|
31
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
32
|
+
fill: "none",
|
|
33
|
+
width: "18",
|
|
34
|
+
height: "18",
|
|
35
|
+
viewBox: "0 0 1024 1024"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
fill: "currentColor",
|
|
38
|
+
d: "M800 544h-96a32 32 0 0 1 0-64h64v-128a32 32 0 0 1 64 0v160a32 32 0 0 1-32 32zM128 192h768a64 64 0 0 1 64 64v512a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V256a64 64 0 0 1 64-64z m32 64a32 32 0 0 0-32 32v448a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32V288a32 32 0 0 0-32-32H160z m64 64h64a32 32 0 1 1 0 64H224a32 32 0 1 1 0-64z m192 0h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64z m192 0h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64zM224 480h32a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64z m160 0h32a32 32 0 0 1 0 64h-32a32 32 0 0 1 0-64z m160 0h32a32 32 0 0 1 0 64h-32a32 32 0 0 1 0-64zM224 640h32a32 32 0 0 1 0 64H224a32 32 0 0 1 0-64z m160 0h256a32 32 0 0 1 0 64h-256a32 32 0 0 1 0-64z m384 0h32a32 32 0 0 1 0 64h-32a32 32 0 0 1 0-64z"
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
var clearSvg = function clearSvg() {
|
|
42
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
43
|
+
fill: "none",
|
|
44
|
+
viewBox: "0 0 1024 1024",
|
|
45
|
+
width: "18",
|
|
46
|
+
height: "18"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
d: "M837.818182 915.549091h-131.956364c-12.8 0-23.272727-10.472727-23.272727-23.272727v-58.181819c0-4.189091-8.843636-11.636364-23.272727-11.636363s-23.272727 7.447273-23.272728 11.636363v58.181819c0 12.8-10.472727 23.272727-23.272727 23.272727H465.454545c-12.8 0-23.272727-10.472727-23.272727-23.272727s10.472727-23.272727 23.272727-23.272728h124.043637v-34.909091c0-32.581818 30.72-58.181818 69.818182-58.181818s69.818182 25.6 69.818181 58.181818v34.909091H814.545455v-232.727272H209.454545v232.727272h93.789091c12.8 0 23.272727 10.472727 23.272728 23.272728s-10.472727 23.272727-23.272728 23.272727H186.181818c-12.8 0-23.272727-10.472727-23.272727-23.272727v-279.272728c0-12.8 10.472727-23.272727 23.272727-23.272727h651.636364c12.8 0 23.272727 10.472727 23.272727 23.272727v279.272728c0 12.8-10.472727 23.272727-23.272727 23.272727z",
|
|
49
|
+
fill: "currentColor"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
51
|
+
d: "M837.818182 636.276364H186.181818c-12.8 0-23.272727-10.472727-23.272727-23.272728v-69.818181c0-11.403636 8.145455-20.945455 19.316364-22.807273l244.596363-43.054546V124.276364c0-26.065455 23.970909-46.545455 54.225455-46.545455h62.138182c30.487273 0 54.225455 20.48 54.225454 46.545455V477.090909l244.596364 43.054546c11.170909 1.861818 19.316364 11.636364 19.316363 22.807272v69.818182A23.738182 23.738182 0 0 1 837.818182 636.276364z m-628.363637-46.545455h605.09091v-26.996364l-244.596364-43.054545a23.202909 23.202909 0 0 1-19.316364-22.807273V126.138182a13.172364 13.172364 0 0 0-7.68-2.094546h-62.138182c-3.723636 0-6.516364 1.163636-7.68 2.094546v370.269091c0 11.403636-8.145455 20.945455-19.316363 22.807272L209.454545 562.734545v26.996364z",
|
|
52
|
+
fill: "currentColor"
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
35
55
|
var DesignToolbar = function DesignToolbar(_ref) {
|
|
36
|
-
var
|
|
56
|
+
var canvas = _ref.canvas,
|
|
57
|
+
locale = _ref.locale,
|
|
37
58
|
onLangChange = _ref.onLangChange;
|
|
38
59
|
var location = useLocation();
|
|
39
60
|
var editorRef = useRef();
|
|
@@ -53,12 +74,8 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
53
74
|
setShow = _useState6[1];
|
|
54
75
|
var _useState7 = useState(false),
|
|
55
76
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var _useState9 = useState([]),
|
|
59
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
60
|
-
userOptions = _useState10[0],
|
|
61
|
-
setUserOptions = _useState10[1];
|
|
77
|
+
showShortcut = _useState8[0],
|
|
78
|
+
setShowShortcut = _useState8[1];
|
|
62
79
|
var _useTemporalStore = useTemporalStore(function (state) {
|
|
63
80
|
return {
|
|
64
81
|
undo: state.undo,
|
|
@@ -71,10 +88,6 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
71
88
|
canRedo = _useTemporalStore.canRedo,
|
|
72
89
|
undo = _useTemporalStore.undo,
|
|
73
90
|
redo = _useTemporalStore.redo;
|
|
74
|
-
var _useCookieState = useCookieState(COOKIE_VIRTUAL_ACCOUNT_KEY),
|
|
75
|
-
_useCookieState2 = _slicedToArray(_useCookieState, 2),
|
|
76
|
-
userId = _useCookieState2[0],
|
|
77
|
-
setUserId = _useCookieState2[1];
|
|
78
91
|
var _useRequest = useRequest(fetchClearCache, {
|
|
79
92
|
manual: true
|
|
80
93
|
}),
|
|
@@ -134,7 +147,6 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
134
147
|
var lssid = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref3) {
|
|
135
148
|
var _langList = _ref3.langList;
|
|
136
149
|
setLangList(_langList);
|
|
137
|
-
console.log(11111, _langList);
|
|
138
150
|
}).watch();
|
|
139
151
|
var dasid = context.$subscriber(context.topics.DESIGN_OPERATE_SAVE).on(handleSave).watch();
|
|
140
152
|
return function () {
|
|
@@ -142,11 +154,6 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
142
154
|
context.$unsubscriber(context.topics.DESIGN_OPERATE_SAVE, dasid);
|
|
143
155
|
};
|
|
144
156
|
}, []);
|
|
145
|
-
useEffect(function () {
|
|
146
|
-
if (!showPreview) {
|
|
147
|
-
setUserId(void 0);
|
|
148
|
-
}
|
|
149
|
-
}, [showPreview]);
|
|
150
157
|
var handleClearCache = useMemoizedFn(function () {
|
|
151
158
|
Modal.confirm({
|
|
152
159
|
title: formatMessage({
|
|
@@ -181,43 +188,6 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
181
188
|
}));
|
|
182
189
|
}
|
|
183
190
|
});
|
|
184
|
-
var _useDebounceFn = useDebounceFn( /*#__PURE__*/function () {
|
|
185
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value) {
|
|
186
|
-
var _yield$fetchSearchUse, code, list, detail;
|
|
187
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
188
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
189
|
-
case 0:
|
|
190
|
-
_context2.next = 2;
|
|
191
|
-
return fetchSearchUser({
|
|
192
|
-
sname: value
|
|
193
|
-
});
|
|
194
|
-
case 2:
|
|
195
|
-
_yield$fetchSearchUse = _context2.sent;
|
|
196
|
-
code = _yield$fetchSearchUse.code;
|
|
197
|
-
list = _yield$fetchSearchUse.list;
|
|
198
|
-
detail = _yield$fetchSearchUse.detail;
|
|
199
|
-
if (code === 1) {
|
|
200
|
-
setUserOptions(list.map(function (id) {
|
|
201
|
-
var item = detail[id];
|
|
202
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
203
|
-
key: "".concat(item.indocno),
|
|
204
|
-
label: item.sname
|
|
205
|
-
});
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
case 7:
|
|
209
|
-
case "end":
|
|
210
|
-
return _context2.stop();
|
|
211
|
-
}
|
|
212
|
-
}, _callee2);
|
|
213
|
-
}));
|
|
214
|
-
return function (_x) {
|
|
215
|
-
return _ref4.apply(this, arguments);
|
|
216
|
-
};
|
|
217
|
-
}(), {
|
|
218
|
-
wait: 500
|
|
219
|
-
}),
|
|
220
|
-
handleSearch = _useDebounceFn.run;
|
|
221
191
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
222
192
|
className: styles['lc-painter-design-toolbar']
|
|
223
193
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
@@ -302,18 +272,37 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
302
272
|
label: '页面属性'
|
|
303
273
|
})), /*#__PURE__*/React.createElement(Divider, {
|
|
304
274
|
type: "vertical"
|
|
305
|
-
}), /*#__PURE__*/React.createElement(
|
|
306
|
-
|
|
275
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
276
|
+
title: formatMessage({
|
|
277
|
+
id: 'luckda.lowcode.design.toolbar.shortcut',
|
|
278
|
+
label: '快捷键'
|
|
279
|
+
}),
|
|
280
|
+
component: KeyboardSvg,
|
|
281
|
+
className: styles.hoverPrimary,
|
|
307
282
|
style: {
|
|
308
283
|
fontSize: 14,
|
|
309
|
-
margin: '0
|
|
284
|
+
margin: '0 8px 0 6px'
|
|
310
285
|
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
286
|
+
onClick: function onClick() {
|
|
287
|
+
return setShowShortcut(true);
|
|
288
|
+
}
|
|
289
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
290
|
+
title: formatMessage({
|
|
291
|
+
id: 'luckda.lowcode.design.toolbar.code',
|
|
292
|
+
label: 'Schema面板'
|
|
293
|
+
}),
|
|
294
|
+
component: CodeSvg,
|
|
295
|
+
className: styles.hoverPrimary,
|
|
296
|
+
style: {
|
|
297
|
+
fontSize: 14,
|
|
298
|
+
margin: '0 8px 0 6px'
|
|
299
|
+
},
|
|
300
|
+
onClick: function onClick() {
|
|
301
|
+
if (!updatePageDataLoading) setShow(true);
|
|
302
|
+
}
|
|
303
|
+
}), /*#__PURE__*/React.createElement(Divider, {
|
|
304
|
+
type: "vertical"
|
|
305
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
317
306
|
title: formatMessage({
|
|
318
307
|
id: 'luckda.lowcode.design.toolbar.debug',
|
|
319
308
|
label: '调试'
|
|
@@ -324,45 +313,34 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
324
313
|
margin: '0 8px 0 6px'
|
|
325
314
|
},
|
|
326
315
|
className: styles.hoverPrimary,
|
|
327
|
-
onClick:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
case 1:
|
|
339
|
-
case "end":
|
|
340
|
-
return _context3.stop();
|
|
316
|
+
onClick: function onClick() {
|
|
317
|
+
if (!updatePageDataLoading) {
|
|
318
|
+
var _getCreateHistoryOpti = getCreateHistoryOptions(),
|
|
319
|
+
basename = _getCreateHistoryOpti.basename;
|
|
320
|
+
var previewUrl = "".concat(basename === '/' ? '' : basename, "/byteman/preview/").concat(location.query.code);
|
|
321
|
+
if (getNeedPrompt()) {
|
|
322
|
+
context.$publisherOnce(context.topics.DESIGN_OPERATE_SAVE).then(function () {
|
|
323
|
+
window.open(previewUrl, '_blank');
|
|
324
|
+
});
|
|
325
|
+
} else {
|
|
326
|
+
window.open(previewUrl, '_blank');
|
|
341
327
|
}
|
|
342
|
-
|
|
343
|
-
|
|
328
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, null);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
344
331
|
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
345
332
|
title: formatMessage({
|
|
346
|
-
id: 'luckda.lowcode.design.toolbar.
|
|
347
|
-
label: '
|
|
333
|
+
id: 'luckda.lowcode.design.toolbar.clear',
|
|
334
|
+
label: '清除缓存'
|
|
348
335
|
}),
|
|
349
|
-
component:
|
|
336
|
+
component: clearSvg,
|
|
350
337
|
className: styles.hoverPrimary,
|
|
338
|
+
loading: clearCacheLoading,
|
|
351
339
|
style: {
|
|
352
340
|
fontSize: 14,
|
|
353
341
|
margin: '0 8px 0 6px'
|
|
354
342
|
},
|
|
355
|
-
onClick:
|
|
356
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
357
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
358
|
-
case 0:
|
|
359
|
-
if (!updatePageDataLoading) setShow(true);
|
|
360
|
-
case 1:
|
|
361
|
-
case "end":
|
|
362
|
-
return _context4.stop();
|
|
363
|
-
}
|
|
364
|
-
}, _callee4);
|
|
365
|
-
}))
|
|
343
|
+
onClick: handleClearCache
|
|
366
344
|
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
367
345
|
title: formatMessage({
|
|
368
346
|
id: 'luckda.lowcode.design.toolbar.save',
|
|
@@ -392,75 +370,12 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
392
370
|
style: {
|
|
393
371
|
height: '70vh'
|
|
394
372
|
}
|
|
395
|
-
}, JSON.stringify(pageData, null, '\t'))), /*#__PURE__*/React.createElement(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
style: {
|
|
399
|
-
display: 'flex',
|
|
400
|
-
height: 54,
|
|
401
|
-
alignItems: 'center',
|
|
402
|
-
justifyContent: 'space-between'
|
|
403
|
-
}
|
|
404
|
-
}, /*#__PURE__*/React.createElement("h3", {
|
|
405
|
-
style: {
|
|
406
|
-
marginBottom: 0
|
|
407
|
-
}
|
|
408
|
-
}, formatMessage({
|
|
409
|
-
id: 'luckda.lowcode.design.toolbar.pagePreview',
|
|
410
|
-
label: '页面预览'
|
|
411
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
412
|
-
placeholder: formatMessage({
|
|
413
|
-
id: 'luckda.lowcode.design.toolbar.selectUser',
|
|
414
|
-
label: '请选择模拟登录人'
|
|
415
|
-
}),
|
|
416
|
-
allowClear: true,
|
|
417
|
-
style: {
|
|
418
|
-
width: 180
|
|
419
|
-
},
|
|
420
|
-
filterOption: false,
|
|
421
|
-
labelInValue: true,
|
|
422
|
-
showSearch: true,
|
|
423
|
-
getPopupContainer: function getPopupContainer() {
|
|
424
|
-
return document.getElementById('preview-drawer-header').closest('.ant-drawer-wrapper-body');
|
|
425
|
-
},
|
|
426
|
-
onSearch: handleSearch,
|
|
427
|
-
onChange: function onChange(_, _opt) {
|
|
428
|
-
if (_opt) {
|
|
429
|
-
setUserId(_opt.props.sloginid);
|
|
430
|
-
} else {
|
|
431
|
-
setUserId(void 0);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}, userOptions.map(function (_ref7) {
|
|
435
|
-
var key = _ref7.key,
|
|
436
|
-
label = _ref7.label,
|
|
437
|
-
rest = _objectWithoutProperties(_ref7, _excluded);
|
|
438
|
-
return /*#__PURE__*/React.createElement(Select.Option, _extends({
|
|
439
|
-
key: key,
|
|
440
|
-
value: key
|
|
441
|
-
}, rest), label);
|
|
442
|
-
})))),
|
|
443
|
-
placement: "bottom",
|
|
444
|
-
height: "94vh",
|
|
445
|
-
footer: false,
|
|
446
|
-
headerStyle: {
|
|
447
|
-
padding: '0 48px 0 24px'
|
|
448
|
-
},
|
|
449
|
-
bodyStyle: {
|
|
450
|
-
height: 'calc(100% - 54px)',
|
|
451
|
-
backgroundColor: 'var(--ant-component-background,#F0F2F5)'
|
|
452
|
-
},
|
|
453
|
-
visible: showPreview,
|
|
454
|
-
destroyOnClose: true,
|
|
373
|
+
}, JSON.stringify(pageData, null, '\t'))), /*#__PURE__*/React.createElement(ShortcutModal, {
|
|
374
|
+
target: canvas,
|
|
375
|
+
show: showShortcut,
|
|
455
376
|
onClose: function onClose() {
|
|
456
|
-
return
|
|
457
|
-
},
|
|
458
|
-
getContainer: function getContainer() {
|
|
459
|
-
return document.getElementById('lc-design-workspace');
|
|
377
|
+
return setShowShortcut(false);
|
|
460
378
|
}
|
|
461
|
-
}
|
|
462
|
-
code: location.query.code,
|
|
463
|
-
userId: userId
|
|
464
|
-
})));
|
|
379
|
+
}));
|
|
465
380
|
};
|
|
466
381
|
export default DesignToolbar;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
@@ -5,10 +6,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
6
|
var _excluded = ["events"],
|
|
6
7
|
_excluded2 = ["events"],
|
|
7
8
|
_excluded3 = ["render"],
|
|
8
|
-
_excluded4 = ["render"]
|
|
9
|
+
_excluded4 = ["render"],
|
|
10
|
+
_excluded5 = ["render"];
|
|
9
11
|
import React, { useRef, useState } from 'react';
|
|
10
12
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
11
|
-
import { Menu, Dropdown, Button, Tooltip, Icon, Switch } from 'luck-design/antd';
|
|
13
|
+
import { Menu, Dropdown, Button, Tooltip, Icon, Switch, Badge } from 'luck-design/antd';
|
|
12
14
|
import styled from 'styled-components';
|
|
13
15
|
import { isNil, keyBy, keys, omit, reduce } from 'lodash';
|
|
14
16
|
import { useGet } from "../../engine/provider/ContextProvider";
|
|
@@ -23,7 +25,7 @@ var EventItem = styled.div.withConfig({
|
|
|
23
25
|
})(["display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border:1px solid #e5e6e8;border-radius:6px;margin-bottom:6px;font-size:12px;i{color:var(--ant-text-color);cursor:pointer;}i:not(:last-child){margin-right:6px;}"]);
|
|
24
26
|
var _DEFAULT_FUNC_ = 'function isTrue() {\n return true; \n}';
|
|
25
27
|
var AdvancePanel = function AdvancePanel(_ref) {
|
|
26
|
-
var _value$
|
|
28
|
+
var _value$render4, _Map$get;
|
|
27
29
|
var meta = _ref.meta,
|
|
28
30
|
nodeId = _ref.nodeId,
|
|
29
31
|
target = _ref.target,
|
|
@@ -91,10 +93,20 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
91
93
|
}
|
|
92
94
|
}));
|
|
93
95
|
});
|
|
94
|
-
var
|
|
96
|
+
var handleRenderClear = useMemoizedFn(function (_code) {
|
|
95
97
|
var _ref5 = value || {},
|
|
96
98
|
render = _ref5.render,
|
|
97
99
|
rest = _objectWithoutProperties(_ref5, _excluded4);
|
|
100
|
+
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
101
|
+
render: {
|
|
102
|
+
value: isNil(render === null || render === void 0 ? void 0 : render.value) ? true : render.value
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
var handleRenderChange = useMemoizedFn(function (checked) {
|
|
107
|
+
var _ref6 = value || {},
|
|
108
|
+
render = _ref6.render,
|
|
109
|
+
rest = _objectWithoutProperties(_ref6, _excluded5);
|
|
98
110
|
onChange(_objectSpread(_objectSpread({}, rest), {}, {
|
|
99
111
|
render: {
|
|
100
112
|
value: checked,
|
|
@@ -142,16 +154,21 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
142
154
|
},
|
|
143
155
|
suppressIcon: true,
|
|
144
156
|
extraRender: function extraRender() {
|
|
145
|
-
var _value$render;
|
|
157
|
+
var _value$render, _value$render2, _value$render3;
|
|
146
158
|
return /*#__PURE__*/React.createElement(JSEditor, {
|
|
147
159
|
defaultCode: (value === null || value === void 0 || (_value$render = value.render) === null || _value$render === void 0 ? void 0 : _value$render.code) || _DEFAULT_FUNC_,
|
|
148
|
-
onChange: handleRenderComfirm
|
|
149
|
-
|
|
160
|
+
onChange: handleRenderComfirm,
|
|
161
|
+
onClear: handleRenderClear
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Badge, _extends({
|
|
163
|
+
dot: value === null || value === void 0 || (_value$render2 = value.render) === null || _value$render2 === void 0 ? void 0 : _value$render2.code
|
|
164
|
+
}, value !== null && value !== void 0 && (_value$render3 = value.render) !== null && _value$render3 !== void 0 && _value$render3.code ? {
|
|
165
|
+
color: "lime"
|
|
166
|
+
} : {}), /*#__PURE__*/React.createElement(Icon, {
|
|
150
167
|
type: "code"
|
|
151
|
-
}));
|
|
168
|
+
})));
|
|
152
169
|
}
|
|
153
170
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
154
|
-
checked: isNil(value === null || value === void 0 || (_value$
|
|
171
|
+
checked: isNil(value === null || value === void 0 || (_value$render4 = value.render) === null || _value$render4 === void 0 ? void 0 : _value$render4.value) ? true : value.render.value,
|
|
155
172
|
onChange: handleRenderChange
|
|
156
173
|
})), /*#__PURE__*/React.createElement(Collapse, {
|
|
157
174
|
field: "events",
|
|
@@ -204,7 +221,8 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
204
221
|
})))), /*#__PURE__*/React.createElement(JSEditor, {
|
|
205
222
|
trigger: jseditorTrigger,
|
|
206
223
|
defaultCode: ((_Map$get = new Map(event === null || event === void 0 ? void 0 : event.actionPool).get('coding')) === null || _Map$get === void 0 ? void 0 : _Map$get.code) || (event === null || event === void 0 ? void 0 : event.func),
|
|
207
|
-
onChange: handleComfirm
|
|
224
|
+
onChange: handleComfirm,
|
|
225
|
+
showClear: false
|
|
208
226
|
}));
|
|
209
227
|
};
|
|
210
228
|
export default AdvancePanel;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["title", "type"];
|
|
3
|
+
var _excluded = ["title", "type", "loading", "component"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Icon, Tooltip } from 'luck-design/antd';
|
|
6
6
|
var TipIcon = function TipIcon(_ref) {
|
|
7
7
|
var title = _ref.title,
|
|
8
8
|
type = _ref.type,
|
|
9
|
+
loading = _ref.loading,
|
|
10
|
+
component = _ref.component,
|
|
9
11
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
10
12
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
|
-
title: title
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
title: title,
|
|
14
|
+
getPopupContainer: function getPopupContainer() {
|
|
15
|
+
return document.getElementById('lc-design-workspace');
|
|
16
|
+
}
|
|
17
|
+
}, loading ? /*#__PURE__*/React.createElement(Icon, _extends({
|
|
18
|
+
type: "loading"
|
|
19
|
+
}, rest)) : /*#__PURE__*/React.createElement(Icon, _extends({
|
|
20
|
+
type: type,
|
|
21
|
+
component: component
|
|
14
22
|
}, rest)));
|
|
15
23
|
};
|
|
16
24
|
export default TipIcon;
|
|
@@ -5,7 +5,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { useRequest, useMemoizedFn, useCreation } from 'ahooks';
|
|
8
|
-
import { Spin, Input, Segmented, Switch, Checkbox, Tooltip, Icon, Radio, Modal } from 'luck-design/antd';
|
|
8
|
+
import { Spin, Input, Segmented, Switch, Checkbox, Tooltip, Icon, Radio, Modal, Select } from 'luck-design/antd';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
import { isArray, keyBy, isNil, groupBy } from 'lodash';
|
|
11
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
@@ -20,6 +20,37 @@ import { fetchFieldCondition, fetchAttrs } from "../../../constants/api-url";
|
|
|
20
20
|
import { getFrontRules } from "./meta/frontRules";
|
|
21
21
|
import { FIELD_SCOPES } from "../../../constants";
|
|
22
22
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
23
|
+
var _DATA_FORMAT_OPTIONS = [{
|
|
24
|
+
value: 'YYYY-MM-DD HH:mm:ss',
|
|
25
|
+
label: '年-月-日 时:分:秒'
|
|
26
|
+
}, {
|
|
27
|
+
value: 'YYYY-MM-DD HH:mm',
|
|
28
|
+
label: '年-月-日 时:分'
|
|
29
|
+
}, {
|
|
30
|
+
value: 'YYYY-MM-DD HH',
|
|
31
|
+
label: '年-月-日 时'
|
|
32
|
+
}, {
|
|
33
|
+
value: 'YYYY-MM-DD',
|
|
34
|
+
label: '年-月-日'
|
|
35
|
+
}, {
|
|
36
|
+
value: 'YYYY-MM',
|
|
37
|
+
label: '年-月'
|
|
38
|
+
}, {
|
|
39
|
+
value: 'YYYY',
|
|
40
|
+
label: '年'
|
|
41
|
+
}, {
|
|
42
|
+
value: 'HH:mm:ss',
|
|
43
|
+
label: '时:分:秒'
|
|
44
|
+
}, {
|
|
45
|
+
value: 'HH:mm',
|
|
46
|
+
label: '时:分'
|
|
47
|
+
}, {
|
|
48
|
+
value: 'mm:ss',
|
|
49
|
+
label: '分:秒'
|
|
50
|
+
}, {
|
|
51
|
+
value: 'YYYY-wo',
|
|
52
|
+
label: '年-周'
|
|
53
|
+
}];
|
|
23
54
|
var _ALIGN_OPTIONS_ = [{
|
|
24
55
|
label: formatMessage({
|
|
25
56
|
id: "".concat(_I18N_PREFIX_, ".align.left"),
|
|
@@ -399,7 +430,25 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
399
430
|
id: "".concat(_I18N_PREFIX_, ".readonly"),
|
|
400
431
|
label: '是否只读'
|
|
401
432
|
})
|
|
402
|
-
}, renderCodeIcon(fieldReadonly, FIELD_SCOPES.FIELD_READONLY)), !isBatch ? /*#__PURE__*/React.createElement(React.Fragment, null, ['table', 'tableForm'].includes(component) ? /*#__PURE__*/React.createElement(
|
|
433
|
+
}, renderCodeIcon(fieldReadonly, FIELD_SCOPES.FIELD_READONLY)), !isBatch ? /*#__PURE__*/React.createElement(React.Fragment, null, ['table', 'tableForm'].includes(component) ? /*#__PURE__*/React.createElement(React.Fragment, null, fieldData.property === 'date' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
434
|
+
label: formatMessage({
|
|
435
|
+
id: "".concat(_I18N_PREFIX_, ".dateFormat"),
|
|
436
|
+
label: '日期格式'
|
|
437
|
+
})
|
|
438
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
439
|
+
size: "small",
|
|
440
|
+
onChange: function onChange(val) {
|
|
441
|
+
return run('dateFormat', val);
|
|
442
|
+
},
|
|
443
|
+
defaultValue: fieldData.dateFormat || 'YYYY-MM-DD HH:mm:ss'
|
|
444
|
+
}, _DATA_FORMAT_OPTIONS.map(function (opt) {
|
|
445
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
446
|
+
key: opt.value,
|
|
447
|
+
value: opt.value
|
|
448
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
449
|
+
title: opt.label
|
|
450
|
+
}, opt.label));
|
|
451
|
+
}))), /*#__PURE__*/React.createElement(Collapse, {
|
|
403
452
|
label: formatMessage({
|
|
404
453
|
id: "".concat(_I18N_PREFIX_, ".render"),
|
|
405
454
|
label: '内容定制渲染'
|
|
@@ -409,8 +458,11 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
409
458
|
onChange: function onChange(val) {
|
|
410
459
|
return run('render', val);
|
|
411
460
|
},
|
|
412
|
-
defaultCode: _DEFAULT_RENDER_CODE
|
|
413
|
-
|
|
461
|
+
defaultCode: _DEFAULT_RENDER_CODE,
|
|
462
|
+
onClear: function onClear() {
|
|
463
|
+
return run('render');
|
|
464
|
+
}
|
|
465
|
+
}))) : null, /*#__PURE__*/React.createElement(Collapse, {
|
|
414
466
|
label: formatMessage({
|
|
415
467
|
id: "".concat(_I18N_PREFIX_, ".defaultValue"),
|
|
416
468
|
label: '默认值'
|
|
@@ -5,9 +5,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useRequest, useSetState, useDebounceFn, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { dropWhile, startsWith } from 'lodash';
|
|
8
|
+
import moment from 'moment';
|
|
8
9
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
9
10
|
import SettingUI from "./SettingUI";
|
|
10
11
|
import { fetchUpdateUniqueField, fetchAttrs, fetchAddFieldAttrs, fetchUpdateFieldAttrs, fetchDelAttrs } from "../../../constants/api-url";
|
|
12
|
+
import RuntimeComp from "../../../view/lc-components/JSX/RuntimeComp";
|
|
11
13
|
import { FIELD_SCOPES } from "../../../constants";
|
|
12
14
|
var _TRUE_FALSE_ = ['__TRUE__', '__FALSE__'];
|
|
13
15
|
var FieldSetting = function FieldSetting(_ref) {
|
|
@@ -192,6 +194,27 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
192
194
|
columns: [fieldData.field],
|
|
193
195
|
force: true
|
|
194
196
|
});
|
|
197
|
+
} else if ('dateFormat' === key && !fieldData.render) {
|
|
198
|
+
col.colDef.cellRendererFramework = function (params) {
|
|
199
|
+
return params.value ? moment(params.value).format(val) : '';
|
|
200
|
+
};
|
|
201
|
+
gridApi.api.refreshCells({
|
|
202
|
+
columns: [fieldData.field],
|
|
203
|
+
force: true
|
|
204
|
+
});
|
|
205
|
+
} else if ('render' === key) {
|
|
206
|
+
col.colDef.cellRendererFramework = function (params) {
|
|
207
|
+
return /*#__PURE__*/React.createElement(RuntimeComp, {
|
|
208
|
+
value: params.value,
|
|
209
|
+
data: params.data,
|
|
210
|
+
rowIndex: params.rowIndex,
|
|
211
|
+
params: params
|
|
212
|
+
}, val.replace(/(function\s*\w*\s*)\([^)]*\)(\s*{)/, '$1()$2'));
|
|
213
|
+
};
|
|
214
|
+
gridApi.api.refreshCells({
|
|
215
|
+
columns: [fieldData.field],
|
|
216
|
+
force: true
|
|
217
|
+
});
|
|
195
218
|
}
|
|
196
219
|
}
|
|
197
220
|
onChange(newFields);
|
|
@@ -227,7 +250,7 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
227
250
|
_context.next = 38;
|
|
228
251
|
break;
|
|
229
252
|
case 5:
|
|
230
|
-
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render')) {
|
|
253
|
+
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render' || key === 'dateFormat')) {
|
|
231
254
|
_context.next = 9;
|
|
232
255
|
break;
|
|
233
256
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
var Wrapper = styled.div.withConfig({
|
|
4
|
+
displayName: "Wrapper",
|
|
5
|
+
componentId: "luckda-6530__sc-o36flt-0"
|
|
6
|
+
})(["min-width:12px;height:22px;line-height:22px;text-align:center;border:1px solid var(--ant-border-color-base,#d9d9d9);border-radius:3px;padding:0 7px;color:var(--ant-text-color,rgba(0,0,0,0.65));margin:0 2px;"]);
|
|
7
|
+
var KeyIcon = function KeyIcon(_ref) {
|
|
8
|
+
var children = _ref.children;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, children);
|
|
10
|
+
};
|
|
11
|
+
export default KeyIcon;
|