@luck-design-biz/luckda 0.0.25-13 → 0.0.25-15
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/LdFormList/index.js +7 -5
- package/es/locales/zh-CN.js +0 -1
- package/es/lowcode/engine/meta/components-list.json +2 -2
- package/es/lowcode/engine/meta/form.props.default.json +2 -2
- package/es/lowcode/engine/meta/form.props.json +2 -2
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +58 -4
- package/es/lowcode/engine/meta/table.props.default.json +2 -1
- package/es/lowcode/engine/meta/table.props.json +2 -1
- package/es/lowcode/engine/provider/ContextProvider/index.js +59 -16
- package/es/lowcode/painter/DesignToolbar.js +3 -4
- package/es/lowcode/painter/components/PreviewIframe.js +55 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +1 -1
- package/es/lowcode/painter/panel-section/ImpExp.js +64 -55
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +38 -22
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +18 -1
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +1 -1
- package/es/lowcode/view/lc-components/Form/index.js +69 -65
- package/es/lowcode/view/lc-components/Form/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageLayout/index.js +4 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +4 -1
- package/es/lowcode/view/lc-components/Table/index.js +158 -159
- package/es/lowcode/view/lc-components/Table/meta.json +56 -16
- package/lib/components/LdFormList/index.js +7 -5
- package/lib/locales/zh-CN.js +0 -1
- package/lib/lowcode/engine/meta/components-list.json +2 -2
- package/lib/lowcode/engine/meta/form.props.default.json +2 -2
- package/lib/lowcode/engine/meta/form.props.json +2 -2
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +58 -4
- package/lib/lowcode/engine/meta/table.props.default.json +2 -1
- package/lib/lowcode/engine/meta/table.props.json +2 -1
- package/lib/lowcode/engine/provider/ContextProvider/index.js +59 -16
- package/lib/lowcode/painter/DesignToolbar.js +3 -4
- package/lib/lowcode/painter/components/PreviewIframe.js +63 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +1 -1
- package/lib/lowcode/painter/panel-section/ImpExp.js +63 -54
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +37 -21
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +18 -1
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +1 -1
- package/lib/lowcode/view/lc-components/Form/index.js +69 -65
- package/lib/lowcode/view/lc-components/Form/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageLayout/index.js +4 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +4 -1
- package/lib/lowcode/view/lc-components/Table/index.js +156 -157
- package/lib/lowcode/view/lc-components/Table/meta.json +56 -16
- package/package.json +5 -6
|
@@ -6,7 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
|
-
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading"],
|
|
9
|
+
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "apiRef", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "getContainer", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules", "afterSubmitLoading"],
|
|
10
10
|
_excluded2 = ["dataSets", "doAction", "resources"],
|
|
11
11
|
_excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft", "serial"],
|
|
12
12
|
_excluded4 = ["ldId", "initData", "overModel"];
|
|
@@ -36,6 +36,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
36
36
|
formMode = _ref.formMode,
|
|
37
37
|
formOperates = _ref.formOperates,
|
|
38
38
|
loading = _ref.loading,
|
|
39
|
+
apiRef = _ref.apiRef,
|
|
39
40
|
wrapperRef = _ref.wrapperRef,
|
|
40
41
|
readOnly = _ref.readOnly,
|
|
41
42
|
mainFormLdId = _ref.mainFormLdId,
|
|
@@ -88,7 +89,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
88
89
|
resources = _ref3.resources,
|
|
89
90
|
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
90
91
|
var formListRef = useRef(null);
|
|
91
|
-
useImperativeHandle(
|
|
92
|
+
useImperativeHandle(apiRef, function () {
|
|
92
93
|
return _objectSpread(_objectSpread({}, formListRef.current), {}, {
|
|
93
94
|
getCValue: function getCValue() {
|
|
94
95
|
return currentValueRef.current || props.formData;
|
|
@@ -251,7 +252,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
251
252
|
var mainDataSetKey = (_formList$find = formList.find(function (i) {
|
|
252
253
|
return i.id === mainFormLdId;
|
|
253
254
|
})) === null || _formList$find === void 0 ? void 0 : _formList$find.dataSetKey;
|
|
254
|
-
return
|
|
255
|
+
return /*#__PURE__*/React.createElement(FormList, _extends({
|
|
255
256
|
editFlow: true,
|
|
256
257
|
formState: formState,
|
|
257
258
|
formMode: formMode,
|
|
@@ -261,6 +262,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
261
262
|
})
|
|
262
263
|
}, props, {
|
|
263
264
|
modelName: namespace,
|
|
265
|
+
wrapperRef: wrapperRef,
|
|
264
266
|
ref: formListRef,
|
|
265
267
|
onAdd: function onAdd(values, other) {
|
|
266
268
|
return handleBatchSubmit(values, 'add', other);
|
|
@@ -344,7 +346,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
344
346
|
mode: child.props.mode || 'tab'
|
|
345
347
|
}) : child.props);
|
|
346
348
|
})[0];
|
|
347
|
-
}))
|
|
349
|
+
}));
|
|
348
350
|
};
|
|
349
351
|
|
|
350
352
|
// 构建带有model的组件
|
|
@@ -429,6 +431,6 @@ Index.defaultProps = {
|
|
|
429
431
|
};
|
|
430
432
|
export default /*#__PURE__*/forwardRef(function (props, ref) {
|
|
431
433
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
432
|
-
|
|
434
|
+
apiRef: ref
|
|
433
435
|
}, props));
|
|
434
436
|
});
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -66,7 +66,6 @@ export default {
|
|
|
66
66
|
"luckda.lowcode.painter.panel-section.style-panel.sourceedit": "源码编辑",
|
|
67
67
|
"luckda.lowcode.painter.panel-section.impexp.expType.placeholder": "请选择自定义行为",
|
|
68
68
|
"luckda.lowcode.painter.panel-section.impexp.impType.placeholder": "请选择自定义行为",
|
|
69
|
-
"luckda.lowcode.painter.export": "导出",
|
|
70
69
|
"luckda.lowcode.painter.bindCondition": "绑定条件",
|
|
71
70
|
"luckda.lowcode.painter.panel-section.iconConditionSelector.add": "添加条件",
|
|
72
71
|
"luckda.lowcode.painter.panel-section.fieldsSetting.field": "数据字段",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"label": "getInstance",
|
|
166
166
|
"kind": "method",
|
|
167
167
|
"insertText": "getInstance",
|
|
168
|
-
"documentation": " /**\
|
|
168
|
+
"documentation": " /**\n * 获取表格实例\n * @method\n */"
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
},
|
|
@@ -188,17 +188,71 @@
|
|
|
188
188
|
"name": "ContextProvider",
|
|
189
189
|
"triggerWord": "ctx",
|
|
190
190
|
"completions": [
|
|
191
|
+
{
|
|
192
|
+
"label": "pagePublicResource",
|
|
193
|
+
"kind": "property",
|
|
194
|
+
"insertText": "pagePublicResource",
|
|
195
|
+
"documentation": " /**\r\n * @property {object} pagePublicResource - 页面公共资源\r\n */\r"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"label": "setPagePublicResource",
|
|
199
|
+
"kind": "method",
|
|
200
|
+
"insertText": "setPagePublicResource(key, value)",
|
|
201
|
+
"documentation": " /**\r\n * @method - 设置页面公共资源\r\n * @param {string} key - 页面公共资源键\r\n * @param {any} value - 页面公共资源值\r\n */\r"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"label": "loading",
|
|
205
|
+
"kind": "property",
|
|
206
|
+
"insertText": "loading",
|
|
207
|
+
"documentation": " /**\r\n * @property {boolean} loading - loading状态\r\n */\r"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"label": "history",
|
|
211
|
+
"kind": "property",
|
|
212
|
+
"insertText": "history",
|
|
213
|
+
"documentation": " /**\r\n * @property {object} history - 当前路由信息\r\n */\r"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"label": "callBehavior",
|
|
217
|
+
"kind": "method",
|
|
218
|
+
"insertText": "callBehavior(evns, params, data)",
|
|
219
|
+
"documentation": " /**\r\n * @method - 执行行为接口\r\n * @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key\r\n * @param {object} params - 链接参数\r\n * @param {object} data - body参数\r\n */\r"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"label": "topics",
|
|
223
|
+
"kind": "property",
|
|
224
|
+
"insertText": "topics",
|
|
225
|
+
"documentation": " /**\r\n * @property {object} topics - 内置的事件话题\r\n */\r"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"label": "PRIMARY_KEY",
|
|
229
|
+
"kind": "property",
|
|
230
|
+
"insertText": "PRIMARY_KEY",
|
|
231
|
+
"documentation": " /**\r\n * @property {string} PRIMARY_KEY - 主键key\r\n */\r"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"label": "getElementById",
|
|
235
|
+
"kind": "method",
|
|
236
|
+
"insertText": "getElementById(compId)",
|
|
237
|
+
"documentation": " /**\r\n * @method - 根据组件ID获取实例\r\n * @param {string} compId - 组件ID\r\n * @return {object} target - 组件实例\r\n */\r"
|
|
238
|
+
},
|
|
191
239
|
{
|
|
192
240
|
"label": "getParentElement",
|
|
193
241
|
"kind": "method",
|
|
194
|
-
"insertText": "getParentElement(
|
|
195
|
-
"documentation": " /**\r\n * @method
|
|
242
|
+
"insertText": "getParentElement(compId)",
|
|
243
|
+
"documentation": " /**\r\n * @method - 根据组件ID获取父组件实例\r\n * @param {string} compId - 组件ID\r\n * @return {object} target - 父组件实例\r\n */\r"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"label": "doAction",
|
|
247
|
+
"kind": "method",
|
|
248
|
+
"insertText": "doAction(actionPool, args)",
|
|
249
|
+
"documentation": " /**\r\n * @method - 执行行为池\r\n * @param {object} actionPool - 行为池\r\n * @param {object} args - 参数\r\n */\r"
|
|
196
250
|
},
|
|
197
251
|
{
|
|
198
252
|
"label": "getUrlParams",
|
|
199
253
|
"kind": "method",
|
|
200
254
|
"insertText": "getUrlParams",
|
|
201
|
-
"documentation": " /**\r\n * @method
|
|
255
|
+
"documentation": " /**\r\n * @method - 获取URL参数\r\n * @return {object} params - url参数\r\n */\r"
|
|
202
256
|
}
|
|
203
257
|
]
|
|
204
258
|
}
|
|
@@ -75,27 +75,35 @@ export default (function (_ref) {
|
|
|
75
75
|
* compId:string 组件id
|
|
76
76
|
* return:ReactNode
|
|
77
77
|
*/
|
|
78
|
-
var getElementById = useMemoizedFn(function (compId) {
|
|
78
|
+
var getElementById = useMemoizedFn(function (compId) {
|
|
79
|
+
var _componentList$curren;
|
|
80
|
+
return (_componentList$curren = _componentList.current.find(function (_ref4) {
|
|
81
|
+
var _ref5 = _slicedToArray(_ref4, 1),
|
|
82
|
+
_id = _ref5[0];
|
|
83
|
+
return compId === _id;
|
|
84
|
+
})) === null || _componentList$curren === void 0 ? void 0 : _componentList$curren[1];
|
|
85
|
+
});
|
|
79
86
|
|
|
80
87
|
/**
|
|
81
88
|
* 根据组件id获取父组件
|
|
82
89
|
* compId:string 组件id
|
|
83
90
|
* return:ReactNode
|
|
84
91
|
*/
|
|
85
|
-
var getParentElement = useMemoizedFn(function (compId) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var getElementPathById = useMemoizedFn(function (compId) {});
|
|
92
|
+
var getParentElement = useMemoizedFn(function (compId) {
|
|
93
|
+
var compMap = new Map(_componentList.current);
|
|
94
|
+
var _target = compMap.get(compId);
|
|
95
|
+
var _parentId = _target.api.getSelfData().parentId;
|
|
96
|
+
if (!_parentId) return null;
|
|
97
|
+
return compMap(_parentId);
|
|
98
|
+
});
|
|
93
99
|
|
|
94
100
|
/**
|
|
95
101
|
* 获取url参数
|
|
96
102
|
* return:object
|
|
97
103
|
*/
|
|
98
|
-
var getUrlParams = useMemoizedFn(function () {
|
|
104
|
+
var getUrlParams = useMemoizedFn(function () {
|
|
105
|
+
return history.location.query;
|
|
106
|
+
});
|
|
99
107
|
useUpdateEffect(function () {
|
|
100
108
|
eventBus.$publisher(topics.PAGE_PUBLIC_RESOURCE_CHANGED, {
|
|
101
109
|
resource: pagePublicResource,
|
|
@@ -105,28 +113,63 @@ export default (function (_ref) {
|
|
|
105
113
|
var ctx = new Proxy(_objectSpread({
|
|
106
114
|
_register: _register,
|
|
107
115
|
_unregister: _unregister,
|
|
116
|
+
/**
|
|
117
|
+
* @property {object} pagePublicResource - 页面公共资源
|
|
118
|
+
*/
|
|
108
119
|
pagePublicResource: pagePublicResource,
|
|
120
|
+
/**
|
|
121
|
+
* @method - 设置页面公共资源
|
|
122
|
+
* @param {string} key - 页面公共资源键
|
|
123
|
+
* @param {any} value - 页面公共资源值
|
|
124
|
+
*/
|
|
109
125
|
setPagePublicResource: setPagePublicResource,
|
|
126
|
+
/**
|
|
127
|
+
* @property {boolean} loading - loading状态
|
|
128
|
+
*/
|
|
110
129
|
loading: loading,
|
|
130
|
+
/**
|
|
131
|
+
* @property {object} history - 当前路由信息
|
|
132
|
+
*/
|
|
111
133
|
history: history,
|
|
134
|
+
/**
|
|
135
|
+
* @method - 执行行为接口
|
|
136
|
+
* @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key
|
|
137
|
+
* @param {object} params - 链接参数
|
|
138
|
+
* @param {object} data - body参数
|
|
139
|
+
*/
|
|
112
140
|
callBehavior: callBehavior,
|
|
141
|
+
/**
|
|
142
|
+
* @property {object} topics - 内置的事件话题
|
|
143
|
+
*/
|
|
113
144
|
topics: topics,
|
|
145
|
+
/**
|
|
146
|
+
* @property {string} PRIMARY_KEY - 主键key
|
|
147
|
+
*/
|
|
114
148
|
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
115
149
|
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
150
|
+
/**
|
|
151
|
+
* @method - 根据组件ID获取实例
|
|
152
|
+
* @param {string} compId - 组件ID
|
|
153
|
+
* @return {object} target - 组件实例
|
|
154
|
+
*/
|
|
116
155
|
getElementById: getElementById,
|
|
117
156
|
/**
|
|
118
|
-
* @method
|
|
119
|
-
* @param {string}
|
|
120
|
-
* @return {object}
|
|
157
|
+
* @method - 根据组件ID获取父组件实例
|
|
158
|
+
* @param {string} compId - 组件ID
|
|
159
|
+
* @return {object} target - 父组件实例
|
|
121
160
|
*/
|
|
122
161
|
getParentElement: getParentElement,
|
|
123
|
-
|
|
162
|
+
/**
|
|
163
|
+
* @method - 执行行为池
|
|
164
|
+
* @param {object} actionPool - 行为池
|
|
165
|
+
* @param {object} args - 参数
|
|
166
|
+
*/
|
|
124
167
|
doAction: function doAction(actionPool, args) {
|
|
125
168
|
return todo(this, actionPool, args);
|
|
126
169
|
},
|
|
127
170
|
/**
|
|
128
|
-
* @method
|
|
129
|
-
* @return {object}
|
|
171
|
+
* @method - 获取URL参数
|
|
172
|
+
* @return {object} params - url参数
|
|
130
173
|
*/
|
|
131
174
|
getUrlParams: getUrlParams
|
|
132
175
|
}, eventBus), {
|
|
@@ -14,7 +14,7 @@ import { Select, Button, Icon, Divider, Modal, message, Drawer } from 'luck-desi
|
|
|
14
14
|
import { showPop, formatMessage } from '@luck-design-biz/base/utils';
|
|
15
15
|
import { useContext, useGet, resetPageData, useTemporalStore } from "../engine/provider/ContextProvider";
|
|
16
16
|
import JsonEditor from "../painter/components/code-editor/JsonEditor";
|
|
17
|
-
import
|
|
17
|
+
import PreviewIframe from "./components/PreviewIframe";
|
|
18
18
|
import { LC_BUILDIN_UNIT_KEY, COOKIE_VIRTUAL_ACCOUNT_KEY } from "../constants";
|
|
19
19
|
import styles from "./style/design.less";
|
|
20
20
|
import { fetchClearCache, fetchUpdatePageData } from "../constants/api-url";
|
|
@@ -400,10 +400,9 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
400
400
|
getContainer: function getContainer() {
|
|
401
401
|
return document.getElementById('lc-design-workspace');
|
|
402
402
|
}
|
|
403
|
-
}, /*#__PURE__*/React.createElement(
|
|
403
|
+
}, /*#__PURE__*/React.createElement(PreviewIframe, {
|
|
404
404
|
code: location.query.code,
|
|
405
|
-
userId: userId || 'no-user'
|
|
406
|
-
debug: true
|
|
405
|
+
userId: userId || 'no-user'
|
|
407
406
|
})));
|
|
408
407
|
};
|
|
409
408
|
export default DesignToolbar;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useBoolean } from 'ahooks';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import Preview from "../../preview";
|
|
7
|
+
var Iframe = styled.iframe.withConfig({
|
|
8
|
+
displayName: "Iframe",
|
|
9
|
+
componentId: "luckda-6530__sc-cyloc5-0"
|
|
10
|
+
})(["width:100%;height:100%;border:none;"]);
|
|
11
|
+
var PreviewIframe = function PreviewIframe(_ref) {
|
|
12
|
+
var code = _ref.code,
|
|
13
|
+
userId = _ref.userId;
|
|
14
|
+
var ref = useRef();
|
|
15
|
+
var _useBoolean = useBoolean(false),
|
|
16
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
17
|
+
isMount = _useBoolean2[0],
|
|
18
|
+
setTrue = _useBoolean2[1].setTrue;
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
var styles = Array.from(document.styleSheets).map(function (styleSheet) {
|
|
21
|
+
if (styleSheet.href) {
|
|
22
|
+
var link = document.createElement('link');
|
|
23
|
+
link.rel = 'stylesheet';
|
|
24
|
+
link.href = styleSheet.href;
|
|
25
|
+
return link;
|
|
26
|
+
} else {
|
|
27
|
+
try {
|
|
28
|
+
var style = document.createElement('style');
|
|
29
|
+
style.textContent = Array.from(styleSheet.cssRules).map(function (rule) {
|
|
30
|
+
return rule.cssText;
|
|
31
|
+
}).join('\n');
|
|
32
|
+
return style;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error(e);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}).filter(Boolean);
|
|
39
|
+
styles.forEach(function (style) {
|
|
40
|
+
return ref.current.contentDocument.head.appendChild(style);
|
|
41
|
+
});
|
|
42
|
+
ref.current.contentDocument.body.setAttribute('luck-theme', 'base');
|
|
43
|
+
setTrue();
|
|
44
|
+
}, []);
|
|
45
|
+
return /*#__PURE__*/React.createElement(Iframe, {
|
|
46
|
+
ref: ref
|
|
47
|
+
}, isMount && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
id: "root"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Preview, {
|
|
50
|
+
code: code,
|
|
51
|
+
userId: userId,
|
|
52
|
+
debug: true
|
|
53
|
+
})), ref.current.contentDocument.body));
|
|
54
|
+
};
|
|
55
|
+
export default PreviewIframe;
|
|
@@ -83,7 +83,7 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
83
83
|
var dsFields = res.data.dataSets[value];
|
|
84
84
|
exe(fieldsKey, dsFields.map(function (f) {
|
|
85
85
|
var restProps = {
|
|
86
|
-
fieldAliasName: f.fieldAliasName
|
|
86
|
+
fieldAliasName: f.fieldAliasName || f.fieldName
|
|
87
87
|
};
|
|
88
88
|
if (['table', 'tableForm'].includes(component)) {
|
|
89
89
|
var _extra = JSON.parse(f.extra || '{}');
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { useMemoizedFn, useSetState, useUpdateEffect } from 'ahooks';
|
|
4
|
-
import { Checkbox, Row, Col, Input, Switch, Select, Tooltip } from 'luck-design/antd';
|
|
4
|
+
import { Checkbox, Row, Col, Input, Switch, Select, Spin, Tooltip, Radio } from 'luck-design/antd';
|
|
5
5
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
6
6
|
import { isString } from 'lodash';
|
|
7
7
|
import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
8
|
+
import PanelItem from "../components/PanelItem";
|
|
8
9
|
import styles from "../style/impexp.less";
|
|
9
10
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.impexp';
|
|
10
11
|
var ImpExp = function ImpExp(_ref) {
|
|
@@ -18,7 +19,7 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
18
19
|
module = _useRemoteSource.module,
|
|
19
20
|
impTypeList = _useRemoteSource.impTypeList,
|
|
20
21
|
expTypeList = _useRemoteSource.expTypeList;
|
|
21
|
-
var _useState = useState(
|
|
22
|
+
var _useState = useState(false),
|
|
22
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
24
|
exportDisabled = _useState2[0],
|
|
24
25
|
setExportDisabled = _useState2[1];
|
|
@@ -64,34 +65,60 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
64
65
|
import: true
|
|
65
66
|
});
|
|
66
67
|
});
|
|
67
|
-
var
|
|
68
|
+
var handleRadioChangeExport = useMemoizedFn(function (value, _ref2) {
|
|
68
69
|
var key = _ref2.key;
|
|
69
70
|
var _value = value;
|
|
70
71
|
setState({
|
|
71
72
|
export: _value
|
|
72
73
|
});
|
|
74
|
+
setExportDisabled(false);
|
|
73
75
|
});
|
|
74
|
-
var
|
|
76
|
+
var handleSelectChangeExport = useMemoizedFn(function (value, _ref3) {
|
|
75
77
|
var key = _ref3.key;
|
|
76
78
|
var _value = value;
|
|
79
|
+
setState({
|
|
80
|
+
export: _value
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var handleSelectChangeImport = useMemoizedFn(function (value, _ref4) {
|
|
84
|
+
var key = _ref4.key;
|
|
85
|
+
var _value = value;
|
|
77
86
|
setState({
|
|
78
87
|
import: _value
|
|
79
88
|
});
|
|
80
89
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
var handleTypeChange = useMemoizedFn(function (e) {
|
|
91
|
+
var _value = e.target.value;
|
|
92
|
+
setState({
|
|
93
|
+
importType: "".concat(_value) === '2',
|
|
94
|
+
import: true
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
var handleTypeChangeExport = useMemoizedFn(function (e) {
|
|
98
|
+
var _value = e.target.value;
|
|
99
|
+
setState({
|
|
100
|
+
export: "".concat(_value) === '2' ? '' : true
|
|
101
|
+
});
|
|
102
|
+
setExportDisabled("".concat(_value) === '2');
|
|
103
|
+
});
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PanelItem, {
|
|
105
|
+
label: "\u5BFC\u5165",
|
|
106
|
+
suppressPadding: true
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
108
|
+
size: "small",
|
|
109
|
+
defaultChecked: !!state.import,
|
|
110
|
+
onChange: handleSelectChangeImport
|
|
111
|
+
})), state.import && /*#__PURE__*/React.createElement(PanelItem, {
|
|
112
|
+
suppressPadding: true
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
114
|
+
onChange: handleTypeChange,
|
|
115
|
+
defaultValue: !state.importType ? '1' : '2'
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
117
|
+
value: "1"
|
|
118
|
+
}, "\u6A21\u7248ID"), /*#__PURE__*/React.createElement(Radio, {
|
|
119
|
+
value: "2"
|
|
120
|
+
}, "\u81EA\u5B9A\u4E49\u884C\u4E3A"))), state.import && /*#__PURE__*/React.createElement(PanelItem, {
|
|
121
|
+
suppressPadding: true
|
|
95
122
|
}, !state.importType ? /*#__PURE__*/React.createElement(Input, {
|
|
96
123
|
size: "small",
|
|
97
124
|
value: isString(state.import) ? state.import : '',
|
|
@@ -117,40 +144,35 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
117
144
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
118
145
|
title: opt.label
|
|
119
146
|
}, opt.label));
|
|
120
|
-
}))), /*#__PURE__*/React.createElement(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
textAlign: 'center'
|
|
124
|
-
}
|
|
147
|
+
}))), /*#__PURE__*/React.createElement(PanelItem, {
|
|
148
|
+
label: "\u5BFC\u51FA",
|
|
149
|
+
suppressPadding: true
|
|
125
150
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
126
151
|
size: "small",
|
|
127
|
-
defaultChecked: !!state.
|
|
128
|
-
onChange:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}))), /*#__PURE__*/React.createElement(Col, {
|
|
141
|
-
span: 14
|
|
152
|
+
defaultChecked: !!(isString(state.export) ? true : state.export),
|
|
153
|
+
onChange: handleRadioChangeExport
|
|
154
|
+
})), (state.export || isString(state.export)) && /*#__PURE__*/React.createElement(PanelItem, {
|
|
155
|
+
suppressPadding: true
|
|
156
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
157
|
+
onChange: handleTypeChangeExport,
|
|
158
|
+
defaultValue: !isString(state.export) ? '1' : '2'
|
|
159
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
160
|
+
value: "1"
|
|
161
|
+
}, "\u9ED8\u8BA4"), /*#__PURE__*/React.createElement(Radio, {
|
|
162
|
+
value: "2"
|
|
163
|
+
}, "\u81EA\u5B9A\u4E49\u884C\u4E3A"))), (!!exportDisabled || isString(state.export)) && /*#__PURE__*/React.createElement(PanelItem, {
|
|
164
|
+
suppressPadding: true
|
|
142
165
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
143
166
|
size: "small",
|
|
144
167
|
style: {
|
|
145
168
|
width: '100%'
|
|
146
169
|
},
|
|
147
|
-
value: isString(state.export) ? state.export : undefined,
|
|
170
|
+
value: isString(state.export) && state.export ? state.export : undefined,
|
|
148
171
|
onChange: handleSelectChangeExport,
|
|
149
172
|
placeholder: formatMessage({
|
|
150
173
|
id: "".concat(_I18N_PREFIX_, ".expType.placeholder"),
|
|
151
174
|
label: '请选择自定义行为'
|
|
152
|
-
})
|
|
153
|
-
disabled: !!exportDisabled
|
|
175
|
+
})
|
|
154
176
|
}, expTypeList === null || expTypeList === void 0 ? void 0 : expTypeList.map(function (opt) {
|
|
155
177
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
156
178
|
key: opt.key,
|
|
@@ -158,19 +180,6 @@ var ImpExp = function ImpExp(_ref) {
|
|
|
158
180
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
159
181
|
title: opt.label
|
|
160
182
|
}, opt.label));
|
|
161
|
-
})))
|
|
162
|
-
span: 4,
|
|
163
|
-
style: {
|
|
164
|
-
textAlign: 'center'
|
|
165
|
-
}
|
|
166
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
167
|
-
size: "small",
|
|
168
|
-
defaultChecked: false,
|
|
169
|
-
onChange: function onChange(val) {
|
|
170
|
-
setExportDisabled(!val);
|
|
171
|
-
},
|
|
172
|
-
checkedChildren: "\u884C\u4E3A",
|
|
173
|
-
unCheckedChildren: "\u9ED8\u8BA4"
|
|
174
|
-
})));
|
|
183
|
+
}))));
|
|
175
184
|
};
|
|
176
185
|
export default ImpExp;
|