@luck-design-biz/luckda 1.0.1-12 → 1.0.1-14
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.less +3 -1
- package/es/components/LdCard/index.js +154 -67
- package/es/components/LdTree/index.js +14 -8
- package/es/components/LdTree/index.less +2 -0
- package/es/helper/ldBuilder.js +1 -1
- package/es/locales/zh-CN.js +4 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +27 -7
- package/es/lowcode/engine/meta/cardlist.props.json +252 -71
- package/es/lowcode/engine/meta/components-list.json +24 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.json +2 -4
- package/es/lowcode/engine/meta/image.props.default.json +3 -3
- package/es/lowcode/engine/meta/image.props.json +50 -16
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
- package/es/lowcode/engine/meta/link.props.default.json +1 -2
- package/es/lowcode/engine/meta/link.props.json +8 -9
- package/es/lowcode/painter/DesignToolbar.js +1 -1
- package/es/lowcode/painter/Ribbon.js +12 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/es/lowcode/painter/style/action-bind-modal.less +5 -3
- package/es/lowcode/painter/style/design.less +10 -7
- package/es/lowcode/painter/style/list-editor.less +5 -3
- package/es/lowcode/painter/style/number-input.less +3 -1
- package/es/lowcode/painter/style/outline.less +3 -1
- package/es/lowcode/painter/style/panel-attrs.less +7 -3
- package/es/lowcode/painter/style/panel.less +9 -7
- package/es/lowcode/painter/style/radio.less +1 -1
- package/es/lowcode/painter/style/ribbon.less +4 -2
- package/es/lowcode/view/lc-components/CardList/index.js +476 -12
- package/es/lowcode/view/lc-components/CardList/meta.json +253 -72
- package/es/lowcode/view/lc-components/GroupTree/index.js +24 -8
- package/es/lowcode/view/lc-components/Iframe/index.js +57 -7
- package/es/lowcode/view/lc-components/Iframe/meta.json +2 -4
- package/es/lowcode/view/lc-components/Image/index.js +82 -6
- package/es/lowcode/view/lc-components/Image/index.less +27 -0
- package/es/lowcode/view/lc-components/Image/meta.json +50 -16
- package/es/lowcode/view/lc-components/Link/index.js +53 -5
- package/es/lowcode/view/lc-components/Link/index.less +15 -0
- package/es/lowcode/view/lc-components/Link/meta.json +8 -9
- package/es/lowcode/view/lc-components/Table/index.js +3 -5
- package/es/lowcode/view/lc-components/Tree/index.js +18 -11
- package/lib/components/LDActions/index.less +3 -1
- package/lib/components/LdCard/index.js +153 -66
- package/lib/components/LdTree/index.js +14 -8
- package/lib/components/LdTree/index.less +2 -0
- package/lib/helper/ldBuilder.js +2 -2
- package/lib/locales/zh-CN.js +4 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -7
- package/lib/lowcode/engine/meta/cardlist.props.json +252 -71
- package/lib/lowcode/engine/meta/components-list.json +24 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.json +2 -4
- package/lib/lowcode/engine/meta/image.props.default.json +3 -3
- package/lib/lowcode/engine/meta/image.props.json +50 -16
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
- package/lib/lowcode/engine/meta/link.props.default.json +1 -2
- package/lib/lowcode/engine/meta/link.props.json +8 -9
- package/lib/lowcode/painter/DesignToolbar.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +12 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/lib/lowcode/painter/style/action-bind-modal.less +5 -3
- package/lib/lowcode/painter/style/design.less +10 -7
- package/lib/lowcode/painter/style/list-editor.less +5 -3
- package/lib/lowcode/painter/style/number-input.less +3 -1
- package/lib/lowcode/painter/style/outline.less +3 -1
- package/lib/lowcode/painter/style/panel-attrs.less +7 -3
- package/lib/lowcode/painter/style/panel.less +9 -7
- package/lib/lowcode/painter/style/radio.less +1 -1
- package/lib/lowcode/painter/style/ribbon.less +4 -2
- package/lib/lowcode/view/lc-components/CardList/index.js +475 -11
- package/lib/lowcode/view/lc-components/CardList/meta.json +253 -72
- package/lib/lowcode/view/lc-components/GroupTree/index.js +22 -6
- package/lib/lowcode/view/lc-components/Iframe/index.js +55 -5
- package/lib/lowcode/view/lc-components/Iframe/meta.json +2 -4
- package/lib/lowcode/view/lc-components/Image/index.js +80 -4
- package/lib/lowcode/view/lc-components/Image/index.less +27 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +50 -16
- package/lib/lowcode/view/lc-components/Link/index.js +52 -4
- package/lib/lowcode/view/lc-components/Link/index.less +15 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +8 -9
- package/lib/lowcode/view/lc-components/Table/index.js +3 -5
- package/lib/lowcode/view/lc-components/Tree/index.js +17 -10
- package/package.json +5 -5
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '~@luck-helper/ui-design/es/style/themes/default.less';
|
|
2
|
+
|
|
1
3
|
@spanDefault: #262626;
|
|
2
4
|
@spanPrimary: var(--ant-primary-color);
|
|
3
5
|
@spanDanger: #ff4d4f;
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
button.default {
|
|
19
|
-
background-color:
|
|
21
|
+
background-color: @component-background;
|
|
20
22
|
}
|
|
21
23
|
span.default {
|
|
22
24
|
color: @spanDefault;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "afterInit", "namespace", "loading", "wrapperRef", "hasMore", "list", "detail", "params", "doQuery", "onQuery", "unclosableSet", "formatDataSource", "resultSet", "cardConfig", "maxActionsCount", "cardActions", "onOperationsClick", "readOnly", "batchOperations", "readFilter", "wrapper", "wrapperProps", "draggable", "onDrop", "onMount", "onUnmount"],
|
|
6
7
|
_excluded2 = ["ldId", "moduleCode", "suppressInit", "overModel", "afterQuery"];
|
|
7
|
-
import React, { forwardRef, useImperativeHandle, useRef, useEffect } from 'react';
|
|
8
|
+
import React, { forwardRef, useImperativeHandle, useRef, useEffect, useLayoutEffect } from 'react';
|
|
8
9
|
import { getDvaApp } from 'umi';
|
|
10
|
+
import classNames from 'classnames';
|
|
9
11
|
import PropTypes from 'prop-types';
|
|
10
12
|
import { Icon, Tooltip } from 'luck-design/antd';
|
|
11
13
|
import { ResultSet, PermissionUtil } from 'luck-design';
|
|
@@ -16,37 +18,92 @@ import ldBuilder from "../../helper/ldBuilder";
|
|
|
16
18
|
import { CardList, Card } from '@luck-design-biz/base/List';
|
|
17
19
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
18
20
|
import { build } from '@luck-design-biz/base/Component';
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
actions = _ref.actions,
|
|
23
|
-
doAction = _ref.doAction,
|
|
24
|
-
afterInit = _ref.afterInit,
|
|
25
|
-
namespace = _ref.namespace,
|
|
26
|
-
loading = _ref.loading,
|
|
27
|
-
wrapperRef = _ref.wrapperRef,
|
|
28
|
-
hasMore = _ref.hasMore,
|
|
29
|
-
list = _ref.list,
|
|
30
|
-
detail = _ref.detail,
|
|
31
|
-
params = _ref.params,
|
|
32
|
-
doQuery = _ref.doQuery,
|
|
33
|
-
onQuery = _ref.onQuery,
|
|
34
|
-
unclosableSet = _ref.unclosableSet,
|
|
35
|
-
formatDataSource = _ref.formatDataSource,
|
|
36
|
-
resultSet = _ref.resultSet,
|
|
37
|
-
cardConfig = _ref.cardConfig,
|
|
38
|
-
cardActions = _ref.cardActions,
|
|
21
|
+
var Action = function Action(_ref) {
|
|
22
|
+
var data = _ref.data,
|
|
23
|
+
action = _ref.action,
|
|
39
24
|
onOperationsClick = _ref.onOperationsClick,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
_ref$inPopover = _ref.inPopover,
|
|
26
|
+
inPopover = _ref$inPopover === void 0 ? false : _ref$inPopover;
|
|
27
|
+
var style = _objectSpread({
|
|
28
|
+
fontSize: '18px'
|
|
29
|
+
}, action.style);
|
|
30
|
+
if (action.disabled) style.color = 'var(--luck-color-disabled)';
|
|
31
|
+
if (inPopover) style = _objectSpread(_objectSpread({}, style), {}, {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
cursor: 'pointer'
|
|
34
|
+
});
|
|
35
|
+
if (action.render) return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
style: style
|
|
37
|
+
}, action.render());
|
|
38
|
+
var renderDiv = function renderDiv(_title) {
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
style: style,
|
|
41
|
+
onClick: function onClick(e) {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
action.onClick ? action.onClick(data, e) : onOperationsClick(action.key, data, e);
|
|
44
|
+
}
|
|
45
|
+
}, action.iconNode ? action.iconNode : /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
+
type: action.icon
|
|
47
|
+
}), _title && /*#__PURE__*/React.createElement("span", {
|
|
48
|
+
style: {
|
|
49
|
+
marginLeft: '4px',
|
|
50
|
+
fontSize: '12px'
|
|
51
|
+
}
|
|
52
|
+
}, _title));
|
|
53
|
+
};
|
|
54
|
+
if (inPopover) return renderDiv(action.title);
|
|
55
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
|
+
placement: "top",
|
|
57
|
+
title: action.title
|
|
58
|
+
}, renderDiv());
|
|
59
|
+
};
|
|
60
|
+
var LdCard = function LdCard(_ref2) {
|
|
61
|
+
var columns = _ref2.columns,
|
|
62
|
+
resources = _ref2.resources,
|
|
63
|
+
actions = _ref2.actions,
|
|
64
|
+
doAction = _ref2.doAction,
|
|
65
|
+
afterInit = _ref2.afterInit,
|
|
66
|
+
namespace = _ref2.namespace,
|
|
67
|
+
loading = _ref2.loading,
|
|
68
|
+
wrapperRef = _ref2.wrapperRef,
|
|
69
|
+
hasMore = _ref2.hasMore,
|
|
70
|
+
list = _ref2.list,
|
|
71
|
+
detail = _ref2.detail,
|
|
72
|
+
params = _ref2.params,
|
|
73
|
+
doQuery = _ref2.doQuery,
|
|
74
|
+
onQuery = _ref2.onQuery,
|
|
75
|
+
unclosableSet = _ref2.unclosableSet,
|
|
76
|
+
formatDataSource = _ref2.formatDataSource,
|
|
77
|
+
resultSet = _ref2.resultSet,
|
|
78
|
+
cardConfig = _ref2.cardConfig,
|
|
79
|
+
maxActionsCount = _ref2.maxActionsCount,
|
|
80
|
+
cardActions = _ref2.cardActions,
|
|
81
|
+
onOperationsClick = _ref2.onOperationsClick,
|
|
82
|
+
readOnly = _ref2.readOnly,
|
|
83
|
+
batchOperations = _ref2.batchOperations,
|
|
84
|
+
readFilter = _ref2.readFilter,
|
|
85
|
+
wrapper = _ref2.wrapper,
|
|
86
|
+
wrapperProps = _ref2.wrapperProps,
|
|
87
|
+
draggable = _ref2.draggable,
|
|
88
|
+
onDrop = _ref2.onDrop,
|
|
89
|
+
onMount = _ref2.onMount,
|
|
90
|
+
onUnmount = _ref2.onUnmount,
|
|
91
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
44
92
|
var cardRef = useRef(null);
|
|
45
93
|
useEffect(function () {
|
|
46
94
|
readFilter && readFilter(params);
|
|
47
95
|
}, [params]);
|
|
48
96
|
useImperativeHandle(wrapperRef, function () {
|
|
49
97
|
return _objectSpread(_objectSpread({}, cardRef.current), {}, {
|
|
98
|
+
getProps: function getProps() {
|
|
99
|
+
var _getDvaApp;
|
|
100
|
+
return {
|
|
101
|
+
apiUrl: (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || (_getDvaApp = _getDvaApp._store.getState()[namespace]) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp.apiUrl,
|
|
102
|
+
filter: {
|
|
103
|
+
params: params
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
},
|
|
50
107
|
onLdQuery: function onLdQuery() {
|
|
51
108
|
var _params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
52
109
|
doQuery({
|
|
@@ -56,6 +113,14 @@ var LdCard = function LdCard(_ref) {
|
|
|
56
113
|
}
|
|
57
114
|
});
|
|
58
115
|
});
|
|
116
|
+
useLayoutEffect(function () {
|
|
117
|
+
onMount && onMount({
|
|
118
|
+
params: params
|
|
119
|
+
});
|
|
120
|
+
return function () {
|
|
121
|
+
onUnmount && onUnmount();
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
59
124
|
var _batchOperations = useCreation(function () {
|
|
60
125
|
return (batchOperations || []).map(function (i) {
|
|
61
126
|
return _objectSpread(_objectSpread({}, i), {}, {
|
|
@@ -66,6 +131,7 @@ var LdCard = function LdCard(_ref) {
|
|
|
66
131
|
var renderCard = useMemoizedFn(function (item) {
|
|
67
132
|
return /*#__PURE__*/React.createElement(Card, _extends({}, cardConfig, {
|
|
68
133
|
dataSource: item,
|
|
134
|
+
showDragHandle: draggable,
|
|
69
135
|
operates: readOnly ? [] : item['__infuse_serial__'] || resources,
|
|
70
136
|
onCardClick: function onCardClick(_item, e) {
|
|
71
137
|
return onOperationsClick && onOperationsClick('read', _item, e);
|
|
@@ -73,33 +139,51 @@ var LdCard = function LdCard(_ref) {
|
|
|
73
139
|
onCardDelete: function onCardDelete(_item, e) {
|
|
74
140
|
return onOperationsClick && onOperationsClick('delete', _item, e);
|
|
75
141
|
},
|
|
76
|
-
actions: PermissionUtil(cardActions.map(function (
|
|
77
|
-
return
|
|
78
|
-
key:
|
|
79
|
-
wanted:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
key: i.key,
|
|
85
|
-
wanted: i.resource || 'virtual',
|
|
86
|
-
placement: "top",
|
|
87
|
-
title: i.title
|
|
88
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
style: {
|
|
90
|
-
fontSize: '18px'
|
|
91
|
-
},
|
|
92
|
-
onClick: function onClick(e) {
|
|
93
|
-
e.stopPropagation();
|
|
94
|
-
i.onClick ? i.onClick(item, e) : onOperationsClick(i.key, item, e);
|
|
95
|
-
}
|
|
96
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
97
|
-
type: i.icon
|
|
98
|
-
})));
|
|
99
|
-
}), readOnly ? [] : [].concat(_toConsumableArray(item['__infuse_serial__'] || resources), ['virtual']))
|
|
142
|
+
actions: PermissionUtil(cardActions.map(function (action) {
|
|
143
|
+
return /*#__PURE__*/React.createElement(Action, {
|
|
144
|
+
key: action.key,
|
|
145
|
+
wanted: action.resource || 'virtual',
|
|
146
|
+
data: item,
|
|
147
|
+
action: action
|
|
148
|
+
});
|
|
149
|
+
}), readOnly ? [] : [].concat(_toConsumableArray(item['__infuse_serial__'] || resources), ['virtual']), false, 'right', maxActionsCount)
|
|
100
150
|
}));
|
|
101
151
|
});
|
|
102
|
-
|
|
152
|
+
var handleDragEnd = useMemoizedFn(function (evt) {
|
|
153
|
+
var oldIndex = evt.oldIndex,
|
|
154
|
+
newIndex = evt.newIndex;
|
|
155
|
+
var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
|
|
156
|
+
var dragNodeProps = detail[list[oldIndex]];
|
|
157
|
+
var targetNodeProps = detail[list[newIndex]];
|
|
158
|
+
if (onDrop) onDrop({
|
|
159
|
+
dragNodeProps: dragNodeProps,
|
|
160
|
+
targetNodeProps: targetNodeProps,
|
|
161
|
+
evt: evt
|
|
162
|
+
});else {
|
|
163
|
+
doAction('drag', {
|
|
164
|
+
get: {
|
|
165
|
+
datasetCode: props.dataSetKey
|
|
166
|
+
},
|
|
167
|
+
post: {
|
|
168
|
+
fromId: dragNodeProps[PRIMARY],
|
|
169
|
+
toId: targetNodeProps[PRIMARY]
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
showConfirm: false,
|
|
173
|
+
callback: function callback(success) {
|
|
174
|
+
return success && doQuery();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
var _ref3 = wrapperProps || {},
|
|
180
|
+
className = _ref3.className,
|
|
181
|
+
_wrapperProps = _ref3._wrapperProps;
|
|
182
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
183
|
+
ref: wrapper
|
|
184
|
+
}, _wrapperProps, {
|
|
185
|
+
className: classNames('luck-card-list', _defineProperty({}, className, !!className))
|
|
186
|
+
}), difference(Object.keys(params), resultSet.invisibleSet || []).length > 0 && /*#__PURE__*/React.createElement(ResultSet, _extends({
|
|
103
187
|
set: params,
|
|
104
188
|
onQuery: onQuery
|
|
105
189
|
}, resultSet, {
|
|
@@ -107,14 +191,16 @@ var LdCard = function LdCard(_ref) {
|
|
|
107
191
|
})), /*#__PURE__*/React.createElement(CardList, _extends({
|
|
108
192
|
col: 4,
|
|
109
193
|
loading: loading,
|
|
110
|
-
renderCard: renderCard
|
|
194
|
+
renderCard: renderCard,
|
|
195
|
+
onDragEnd: handleDragEnd
|
|
111
196
|
}, props, {
|
|
112
197
|
operates: [].concat(_toConsumableArray(resources), ['virtual']),
|
|
113
198
|
modelName: namespace,
|
|
114
199
|
dataSource: formatDataSource(list, detail),
|
|
115
200
|
hasMore: !!hasMore,
|
|
116
201
|
batchOperations: _batchOperations,
|
|
117
|
-
ref: cardRef
|
|
202
|
+
ref: cardRef,
|
|
203
|
+
draggable: draggable
|
|
118
204
|
})));
|
|
119
205
|
};
|
|
120
206
|
var ForwardLdCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -122,23 +208,23 @@ var ForwardLdCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
122
208
|
wrapperRef: ref
|
|
123
209
|
}, props));
|
|
124
210
|
});
|
|
125
|
-
var LdIndex = function LdIndex(
|
|
126
|
-
var namespace =
|
|
127
|
-
moduleCode =
|
|
128
|
-
suppressInit =
|
|
129
|
-
overModel =
|
|
130
|
-
afterQuery =
|
|
131
|
-
props = _objectWithoutProperties(
|
|
211
|
+
var LdIndex = function LdIndex(_ref4) {
|
|
212
|
+
var namespace = _ref4.ldId,
|
|
213
|
+
moduleCode = _ref4.moduleCode,
|
|
214
|
+
suppressInit = _ref4.suppressInit,
|
|
215
|
+
overModel = _ref4.overModel,
|
|
216
|
+
afterQuery = _ref4.afterQuery,
|
|
217
|
+
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
132
218
|
if (includes(props.isTree, props.dataSetKey)) return formatMessage({
|
|
133
219
|
id: 'luckda.ldCard.notTres',
|
|
134
220
|
label: '此数据集为树形数据集,请选择非树形数据集'
|
|
135
221
|
});
|
|
136
222
|
var Component = useCreation(function () {
|
|
137
|
-
var
|
|
138
|
-
(
|
|
139
|
-
if (!((
|
|
140
|
-
var
|
|
141
|
-
(
|
|
223
|
+
var _getDvaApp2, _getDvaApp3;
|
|
224
|
+
(_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2.unmodel(namespace);
|
|
225
|
+
if (!((_getDvaApp3 = getDvaApp()) !== null && _getDvaApp3 !== void 0 && _getDvaApp3._store.getState()[namespace])) {
|
|
226
|
+
var _getDvaApp4;
|
|
227
|
+
(_getDvaApp4 = getDvaApp()) === null || _getDvaApp4 === void 0 || _getDvaApp4.model(createModel(namespace, _objectSpread(_objectSpread({
|
|
142
228
|
isFlow: !!props.isFlow
|
|
143
229
|
}, overModel), {}, {
|
|
144
230
|
dataSetKey: props.dataSetKey,
|
|
@@ -190,7 +276,8 @@ Index.defaultProps = {
|
|
|
190
276
|
},
|
|
191
277
|
cardActions: [],
|
|
192
278
|
overModel: {},
|
|
193
|
-
cardKey: window.appConfig.constraintKeys.PRIMARY
|
|
279
|
+
cardKey: window.appConfig.constraintKeys.PRIMARY,
|
|
280
|
+
maxActionsCount: 3
|
|
194
281
|
};
|
|
195
282
|
export default /*#__PURE__*/forwardRef(function (props, ref) {
|
|
196
283
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "wrapperRef", "ldId", "dataSetKey", "defaultParmas", "moduleCode", "readOnly", "title", "rowKey", "treeNodeTitle", "unselectableNodes", "rightMenus", "defaultExpandDeep", "draggable", "onDrop", "className", "treeClassName", "rootAdd", "suppressInit", "afterQuery", "afterInit", "isTree", "service", "dataToTreeFormat", "
|
|
7
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "wrapperRef", "ldId", "dataSetKey", "defaultParmas", "moduleCode", "readOnly", "title", "rowKey", "treeNodeTitle", "unselectableNodes", "rightMenus", "defaultExpandDeep", "draggable", "onDrop", "className", "treeClassName", "rootAdd", "suppressInit", "afterQuery", "afterInit", "isTree", "service", "dataToTreeFormat", "wrapper", "wrapperProps", "doubleClickExpand", "onNodeDoubleClick", "width", "height", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "treeNodeIcon", "asyncLoad", "parentKey", "onMount", "onUnmount", "onDataSetChange", "onTreeNodeRender", "onlyRoot"],
|
|
8
8
|
_excluded2 = ["0"],
|
|
9
9
|
_excluded3 = ["onClick"];
|
|
10
10
|
import React, { useState, useRef, useImperativeHandle, forwardRef, useLayoutEffect } from 'react';
|
|
@@ -16,7 +16,7 @@ import { Icon, Popover } from 'luck-design/antd';
|
|
|
16
16
|
import { LuckTree } from 'luck-design';
|
|
17
17
|
import { formatMessage, dataToTree, dragTreeData } from '@luck-design-biz/base/utils';
|
|
18
18
|
import { TreeBox } from '@luck-design-biz/base';
|
|
19
|
-
import ldBuilder from "../../helper/ldBuilder";
|
|
19
|
+
import ldBuilder, { ErrorWrapper } from "../../helper/ldBuilder";
|
|
20
20
|
import { behaviorCall } from "../../utils";
|
|
21
21
|
import styles from "./index.less";
|
|
22
22
|
var _window$appConfig$con = window.appConfig.constraintKeys,
|
|
@@ -59,7 +59,8 @@ var LdTree = function LdTree(_ref) {
|
|
|
59
59
|
isTree = _ref.isTree,
|
|
60
60
|
service = _ref.service,
|
|
61
61
|
dataToTreeFormat = _ref.dataToTreeFormat,
|
|
62
|
-
|
|
62
|
+
wrapper = _ref.wrapper,
|
|
63
|
+
wrapperProps = _ref.wrapperProps,
|
|
63
64
|
doubleClickExpand = _ref.doubleClickExpand,
|
|
64
65
|
onNodeDoubleClick = _ref.onNodeDoubleClick,
|
|
65
66
|
width = _ref.width,
|
|
@@ -76,10 +77,14 @@ var LdTree = function LdTree(_ref) {
|
|
|
76
77
|
onTreeNodeRender = _ref.onTreeNodeRender,
|
|
77
78
|
onlyRoot = _ref.onlyRoot,
|
|
78
79
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
79
|
-
if (!includes(isTree, dataSetKey)) return
|
|
80
|
+
if (!includes(isTree, dataSetKey)) return /*#__PURE__*/React.createElement(ErrorWrapper, {
|
|
81
|
+
ref: wrapper,
|
|
82
|
+
className: className,
|
|
83
|
+
style: props.style
|
|
84
|
+
}, formatMessage({
|
|
80
85
|
id: 'luckda.ldTree.notTrees',
|
|
81
86
|
label: '此数据集非树形数据集,请选择树形数据集'
|
|
82
|
-
});
|
|
87
|
+
}));
|
|
83
88
|
var _useState = useState(null),
|
|
84
89
|
_useState2 = _slicedToArray(_useState, 2),
|
|
85
90
|
dataSource = _useState2[0],
|
|
@@ -319,19 +324,20 @@ var LdTree = function LdTree(_ref) {
|
|
|
319
324
|
loadData: onLoadData
|
|
320
325
|
} : {};
|
|
321
326
|
}, []);
|
|
322
|
-
return /*#__PURE__*/React.createElement(TreeBox, {
|
|
327
|
+
return /*#__PURE__*/React.createElement(TreeBox, _extends({
|
|
323
328
|
suppressTitle: !title,
|
|
324
329
|
title: title,
|
|
325
330
|
loading: loading,
|
|
326
331
|
id: ldId,
|
|
327
332
|
onAdd: onAdd,
|
|
328
333
|
className: className,
|
|
329
|
-
ref:
|
|
334
|
+
ref: wrapper
|
|
335
|
+
}, wrapperProps, {
|
|
330
336
|
style: {
|
|
331
337
|
width: width,
|
|
332
338
|
height: height
|
|
333
339
|
}
|
|
334
|
-
}, dataSource && /*#__PURE__*/React.createElement(LuckTree, _extends({
|
|
340
|
+
}), dataSource && /*#__PURE__*/React.createElement(LuckTree, _extends({
|
|
335
341
|
blockNode: true,
|
|
336
342
|
className: classNames(styles.tree, _defineProperty({}, className, !!treeClassName)),
|
|
337
343
|
draggable: !readOnly && draggable,
|
package/es/helper/ldBuilder.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useContext } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { LuckDaContext } from "../components/Builder";
|
|
5
5
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
6
|
-
var ErrorWrapper = styled.span.withConfig({
|
|
6
|
+
export var ErrorWrapper = styled.span.withConfig({
|
|
7
7
|
displayName: "ErrorWrapper",
|
|
8
8
|
componentId: "luckda-6530__sc-ek28r3-0"
|
|
9
9
|
})(["display:inline-block;width:100%;height:auto;padding:24px 16px;color:#ff4d4f;"]);
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"luckda.lowcode.view.lc-components.label.all": "全部",
|
|
3
3
|
"luckda.lowcode.painter.import": "导入",
|
|
4
|
+
"luckda.lowcode.painter.components.fullscreen-exit.tip": "退出全屏",
|
|
5
|
+
"luckda.lowcode.painter.components.fullscreen.tip": "全屏",
|
|
4
6
|
"lc.form.validator.maxLength": "字数不得超过",
|
|
5
7
|
"lc.form.validator.textNum": "个字符",
|
|
6
8
|
"lc.form.validator.numberBelowMin": "低于最小值",
|
|
@@ -182,6 +184,7 @@ export default {
|
|
|
182
184
|
"luckda.lowcode.painter.panel-section.actionEditor.destroy": "毁灭",
|
|
183
185
|
"luckda.lowcode.painter.panel-section.actionEditor.name": "名称",
|
|
184
186
|
"luckda.lowcode.painter.panel-section.actionEditor.name.placeholder": "请输入行为名称",
|
|
187
|
+
"luckda.lowcode.painter.panel-section.actionEditor.icon": "图标",
|
|
185
188
|
"luckda.lowcode.painter.panel-section.actionEditor.serial": "资源串",
|
|
186
189
|
"luckda.lowcode.painter.panel-section.actionEditor.serialEffect": "越权效果",
|
|
187
190
|
"luckda.lowcode.painter.panel-section.actionEditor.riskLevel": "风险等级",
|
|
@@ -268,6 +271,5 @@ export default {
|
|
|
268
271
|
"luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.message.verifyType": "请选择校验规则",
|
|
269
272
|
"luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.errorMsg": "错误提示",
|
|
270
273
|
"luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.message.errorMsg": "请输入错误提示",
|
|
271
|
-
"luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.logic": "校验逻辑"
|
|
272
|
-
"luckda.lowcode.painter.components.fullscreen.tip": "全屏"
|
|
274
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.logic": "校验逻辑"
|
|
273
275
|
};
|
|
@@ -5,16 +5,36 @@
|
|
|
5
5
|
"icon": "icon-cardlist",
|
|
6
6
|
"group": "advance",
|
|
7
7
|
"groupName": "高级",
|
|
8
|
-
"hidden": true,
|
|
9
8
|
"order": 1,
|
|
10
9
|
"autoLoad": true,
|
|
11
10
|
"readOnly": false,
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
11
|
+
"draggable": false,
|
|
12
|
+
"col": 4,
|
|
13
|
+
"pagination": true,
|
|
14
|
+
"pageSize": 40,
|
|
15
|
+
"nocardBoxborder": false,
|
|
16
|
+
"showAvatar": true,
|
|
17
|
+
"showTitle": true,
|
|
18
|
+
"showDesc": true,
|
|
19
|
+
"describeLines": 2,
|
|
20
|
+
"showAddCard": false,
|
|
21
|
+
"addCardHeight": 240,
|
|
22
|
+
"addCardWords": "新建",
|
|
23
|
+
"topActionGroup": {
|
|
24
|
+
"display": "button",
|
|
25
|
+
"max": 2,
|
|
26
|
+
"moreText": "操作",
|
|
27
|
+
"todoList": []
|
|
28
|
+
},
|
|
29
|
+
"rowSelection": false,
|
|
30
|
+
"batchOperations": {
|
|
31
|
+
"todoList": []
|
|
32
|
+
},
|
|
33
|
+
"suppressActions": false,
|
|
34
|
+
"actions": {
|
|
35
|
+
"max": 3,
|
|
36
|
+
"todoList": []
|
|
37
|
+
},
|
|
18
38
|
"advance": {
|
|
19
39
|
"events": {}
|
|
20
40
|
}
|