@luck-design-biz/luckda 1.0.0-9-alpha → 1.0.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Builder/index.js +15 -3
- package/es/components/LdAutoForm/index.js +2 -1
- package/es/components/LdFormList/index.js +2 -1
- package/es/locales/zh-CN.js +3 -0
- package/es/lowcode/engine/meta/form.props.default.json +13 -3
- package/es/lowcode/engine/meta/form.props.json +47 -8
- package/es/lowcode/painter/components/field-setting/SettingUI.js +26 -2
- package/es/lowcode/painter/components/field-setting/index.js +26 -12
- package/es/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/es/lowcode/view/lc-components/Dialog/index.js +5 -2
- package/es/lowcode/view/lc-components/Form/index.js +26 -17
- package/es/lowcode/view/lc-components/Form/meta.json +42 -7
- package/es/services.js +19 -0
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/FormItem/index.js +6 -6
- package/es/utils/grid.js +1 -0
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/LdAutoForm/index.js +2 -1
- package/lib/components/LdFormList/index.js +2 -1
- package/lib/locales/zh-CN.js +3 -0
- package/lib/lowcode/engine/meta/form.props.default.json +13 -3
- package/lib/lowcode/engine/meta/form.props.json +47 -8
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +25 -1
- package/lib/lowcode/painter/components/field-setting/index.js +26 -12
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/lib/lowcode/view/lc-components/Dialog/index.js +5 -2
- package/lib/lowcode/view/lc-components/Form/index.js +25 -16
- package/lib/lowcode/view/lc-components/Form/meta.json +42 -7
- package/lib/services.js +20 -0
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/FormItem/index.js +6 -6
- package/lib/utils/grid.js +1 -0
- package/package.json +3 -3
|
@@ -2,13 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
-
import React, { forwardRef, createContext, useState, useRef, useContext } from 'react';
|
|
5
|
+
import React, { forwardRef, createContext, useState, useRef, useContext, useEffect } from 'react';
|
|
6
6
|
import { useRequest, useSetState, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { BasicForm, BasicFormItem } from 'luck-design';
|
|
8
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import { META_TAG_NAME, LC_RUNTIME_KEY } from "../../lowcode/constants";
|
|
10
|
+
import { setMetaAttrs } from "../../lowcode/engine/tools/helper";
|
|
8
11
|
import LdPop from "../LdPop";
|
|
9
|
-
import { readModlue } from "../../services";
|
|
12
|
+
import { readModlue, noAuthTransformCode } from "../../services";
|
|
10
13
|
import { doAction as doActionUtils } from "../../helper/action";
|
|
11
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
12
14
|
export var LuckDaContext = /*#__PURE__*/createContext();
|
|
13
15
|
export var useLDCtx = function useLDCtx() {
|
|
14
16
|
return useContext(LuckDaContext);
|
|
@@ -28,6 +30,16 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
28
30
|
pops = _useSetState2[0],
|
|
29
31
|
setPops = _useSetState2[1];
|
|
30
32
|
var fieldProps = useRef({});
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
setMetaAttrs(LC_RUNTIME_KEY, 'live');
|
|
35
|
+
noAuthTransformCode({
|
|
36
|
+
code: moduleCode
|
|
37
|
+
}).then(function (res) {
|
|
38
|
+
var code = res.code,
|
|
39
|
+
data = res.data;
|
|
40
|
+
if (code === 1) setMetaAttrs(META_TAG_NAME, data);
|
|
41
|
+
});
|
|
42
|
+
}, []);
|
|
31
43
|
var _useRequest = useRequest(readModlue, {
|
|
32
44
|
defaultParams: [{
|
|
33
45
|
moduleCode: moduleCode
|
|
@@ -72,7 +72,8 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
72
72
|
var col = columnsObj[key];
|
|
73
73
|
if ((setting === null || setting === void 0 ? void 0 : setting._type) === 'divider') {
|
|
74
74
|
result.push( /*#__PURE__*/React.createElement(BasicDivider, {
|
|
75
|
-
title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName
|
|
75
|
+
title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName,
|
|
76
|
+
key: key
|
|
76
77
|
}));
|
|
77
78
|
} else if (col !== null && col !== void 0 && col.isShowInForm && (isNil(setting) || setting !== null && setting !== void 0 && setting.isShow)) {
|
|
78
79
|
var customFiled = filedsRewrite.find(function (_field) {
|
|
@@ -120,7 +120,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
120
120
|
var renderExtra = useMemoizedFn(function (formId, extraConfig, type) {
|
|
121
121
|
return /*#__PURE__*/React.createElement(FormBtn, _extends({
|
|
122
122
|
type: type,
|
|
123
|
-
formId: formId
|
|
123
|
+
formId: formId,
|
|
124
|
+
showConfigBtn: false
|
|
124
125
|
}, extraConfig));
|
|
125
126
|
});
|
|
126
127
|
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -227,12 +227,15 @@ export default {
|
|
|
227
227
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.none": "不固定",
|
|
228
228
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.left": "左",
|
|
229
229
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.right": "右",
|
|
230
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode.single": "行修改",
|
|
231
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode.bulk": "批量修改",
|
|
230
232
|
"luckda.lowcode.painter.delete.tip": "确定删除吗?",
|
|
231
233
|
"luckda.lowcode.painter.panel-section.fieldsSetting.width": "列宽",
|
|
232
234
|
"luckda.lowcode.painter.panel-section.fieldsSetting.align": "内容对齐",
|
|
233
235
|
"luckda.lowcode.painter.panel-section.fieldsSetting.headerAlign": "表头对齐",
|
|
234
236
|
"luckda.lowcode.painter.panel-section.fieldsSetting.pinned": "固定列",
|
|
235
237
|
"luckda.lowcode.painter.panel-section.fieldsSetting.tip": "过长提示",
|
|
238
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode": "表单模式",
|
|
236
239
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fieldColumn": "占列数",
|
|
237
240
|
"luckda.lowcode.painter.panel-section.fieldsSetting.isEqual": "唯一校验",
|
|
238
241
|
"luckda.lowcode.painter.panel-section.fieldsSetting.required": "是否必填",
|
|
@@ -30,11 +30,21 @@
|
|
|
30
30
|
"serialEffect": "hidden",
|
|
31
31
|
"header": "collapse",
|
|
32
32
|
"blockSettings": {
|
|
33
|
-
"
|
|
33
|
+
"auto": {
|
|
34
34
|
"readOnly": false,
|
|
35
|
-
"
|
|
35
|
+
"cols": 4
|
|
36
36
|
},
|
|
37
|
-
"
|
|
37
|
+
"grid": {
|
|
38
|
+
"readOnly": false,
|
|
39
|
+
"suppressPreset": false,
|
|
40
|
+
"height": "100%",
|
|
41
|
+
"bordered": false,
|
|
42
|
+
"draggable": false,
|
|
43
|
+
"orderByAdd": "asc",
|
|
44
|
+
"suppressActions": false,
|
|
45
|
+
"actionsColumnWidth": 160
|
|
46
|
+
},
|
|
47
|
+
"writer": {
|
|
38
48
|
"readOnly": false,
|
|
39
49
|
"suppressPreset": false,
|
|
40
50
|
"height": "100%",
|
|
@@ -217,11 +217,21 @@
|
|
|
217
217
|
"type": "_BlockEditor",
|
|
218
218
|
"wrapper": "hidden",
|
|
219
219
|
"default": {
|
|
220
|
-
"
|
|
220
|
+
"auto": {
|
|
221
221
|
"readOnly": false,
|
|
222
|
-
"
|
|
222
|
+
"cols": 4
|
|
223
223
|
},
|
|
224
|
-
"
|
|
224
|
+
"grid": {
|
|
225
|
+
"readOnly": false,
|
|
226
|
+
"suppressPreset": false,
|
|
227
|
+
"height": "100%",
|
|
228
|
+
"bordered": false,
|
|
229
|
+
"draggable": false,
|
|
230
|
+
"orderByAdd": "asc",
|
|
231
|
+
"suppressActions": false,
|
|
232
|
+
"actionsColumnWidth": 160
|
|
233
|
+
},
|
|
234
|
+
"writer": {
|
|
225
235
|
"readOnly": false,
|
|
226
236
|
"suppressPreset": false,
|
|
227
237
|
"height": "100%",
|
|
@@ -282,6 +292,11 @@
|
|
|
282
292
|
}
|
|
283
293
|
],
|
|
284
294
|
"_grid_props": [
|
|
295
|
+
{
|
|
296
|
+
"key": "height",
|
|
297
|
+
"name": "高度",
|
|
298
|
+
"type": "_WidthHeight"
|
|
299
|
+
},
|
|
285
300
|
{
|
|
286
301
|
"key": "readOnly",
|
|
287
302
|
"name": "只读",
|
|
@@ -292,11 +307,6 @@
|
|
|
292
307
|
"name": "关闭预设",
|
|
293
308
|
"type": "switch"
|
|
294
309
|
},
|
|
295
|
-
{
|
|
296
|
-
"key": "height",
|
|
297
|
-
"name": "高度",
|
|
298
|
-
"type": "_WidthHeight"
|
|
299
|
-
},
|
|
300
310
|
{
|
|
301
311
|
"key": "bordered",
|
|
302
312
|
"name": "边框线",
|
|
@@ -307,6 +317,11 @@
|
|
|
307
317
|
"name": "拖拽排序",
|
|
308
318
|
"type": "switch"
|
|
309
319
|
},
|
|
320
|
+
{
|
|
321
|
+
"key": "suppressbatch",
|
|
322
|
+
"name": "关闭批量",
|
|
323
|
+
"type": "switch"
|
|
324
|
+
},
|
|
310
325
|
{
|
|
311
326
|
"key": "orderByAdd",
|
|
312
327
|
"name": "排序方式",
|
|
@@ -322,6 +337,30 @@
|
|
|
322
337
|
}
|
|
323
338
|
]
|
|
324
339
|
},
|
|
340
|
+
{
|
|
341
|
+
"key": "operates",
|
|
342
|
+
"name": "基础操作",
|
|
343
|
+
"type": "checkbox",
|
|
344
|
+
"options": [
|
|
345
|
+
{
|
|
346
|
+
"label": "添加",
|
|
347
|
+
"value": "add"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"label": "删除",
|
|
351
|
+
"value": "delete"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"label": "修改",
|
|
355
|
+
"value": "update"
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"defaultValue": [
|
|
359
|
+
"add",
|
|
360
|
+
"delete",
|
|
361
|
+
"update"
|
|
362
|
+
]
|
|
363
|
+
},
|
|
325
364
|
{
|
|
326
365
|
"key": "actionsColumn",
|
|
327
366
|
"name": "操作列",
|
|
@@ -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, Tooltip, Icon, Radio, Modal } from 'luck-design/antd';
|
|
8
|
+
import { Spin, Input, Segmented, Switch, Checkbox, Tooltip, Icon, Radio, Modal } 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';
|
|
@@ -58,6 +58,19 @@ var _PINNED_OPTIONS_ = [{
|
|
|
58
58
|
}),
|
|
59
59
|
value: 'right'
|
|
60
60
|
}];
|
|
61
|
+
var _FORM_MODE_OPTIONS_ = [{
|
|
62
|
+
label: formatMessage({
|
|
63
|
+
id: "".concat(_I18N_PREFIX_, ".formMode.single"),
|
|
64
|
+
label: '行修改'
|
|
65
|
+
}),
|
|
66
|
+
value: 'single'
|
|
67
|
+
}, {
|
|
68
|
+
label: formatMessage({
|
|
69
|
+
id: "".concat(_I18N_PREFIX_, ".formMode.bulk"),
|
|
70
|
+
label: '批量修改'
|
|
71
|
+
}),
|
|
72
|
+
value: 'bulk'
|
|
73
|
+
}];
|
|
61
74
|
var _TRUE_FALSE_ = ['__TRUE__', '__FALSE__'];
|
|
62
75
|
var CoderWrapper = styled.div.withConfig({
|
|
63
76
|
displayName: "CoderWrapper",
|
|
@@ -317,7 +330,18 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
317
330
|
onChange: function onChange(val) {
|
|
318
331
|
return run('tip', val);
|
|
319
332
|
}
|
|
320
|
-
}))), component === '
|
|
333
|
+
}))), component === 'tableForm' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
334
|
+
label: formatMessage({
|
|
335
|
+
id: "".concat(_I18N_PREFIX_, ".formMode"),
|
|
336
|
+
label: '表单模式'
|
|
337
|
+
})
|
|
338
|
+
}, /*#__PURE__*/React.createElement(Checkbox.Group, {
|
|
339
|
+
options: _FORM_MODE_OPTIONS_,
|
|
340
|
+
defaultValue: fieldData.formMode ? [fieldData.formMode] : ['single', 'bulk'],
|
|
341
|
+
onChange: function onChange(val) {
|
|
342
|
+
return run('formMode', val);
|
|
343
|
+
}
|
|
344
|
+
})), component === 'form' && /*#__PURE__*/React.createElement(PanelItem, {
|
|
321
345
|
label: formatMessage({
|
|
322
346
|
id: "".concat(_I18N_PREFIX_, ".fieldColumn"),
|
|
323
347
|
label: '占列数'
|
|
@@ -224,7 +224,7 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
224
224
|
moduleUid: moduleId
|
|
225
225
|
}, val ? 'uniqueFieldUid' : 'noUniqueFieldUid', fieldData.uid));
|
|
226
226
|
case 3:
|
|
227
|
-
_context.next =
|
|
227
|
+
_context.next = 38;
|
|
228
228
|
break;
|
|
229
229
|
case 5:
|
|
230
230
|
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render')) {
|
|
@@ -232,22 +232,36 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
232
232
|
break;
|
|
233
233
|
}
|
|
234
234
|
handleUIChange(key, val);
|
|
235
|
-
_context.next =
|
|
235
|
+
_context.next = 38;
|
|
236
236
|
break;
|
|
237
237
|
case 9:
|
|
238
|
-
if (!(key === '
|
|
238
|
+
if (!(key === 'formMode')) {
|
|
239
239
|
_context.next = 13;
|
|
240
240
|
break;
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
if (val.includes('single') && !val.includes('bulk')) {
|
|
243
|
+
handleUIChange(key, 'single');
|
|
244
|
+
} else if (!val.includes('single') && val.includes('bulk')) {
|
|
245
|
+
handleUIChange(key, 'bulk');
|
|
246
|
+
} else {
|
|
247
|
+
handleUIChange(key, void 0);
|
|
248
|
+
}
|
|
249
|
+
_context.next = 38;
|
|
244
250
|
break;
|
|
245
251
|
case 13:
|
|
252
|
+
if (!(key === 'col' || key === 'row')) {
|
|
253
|
+
_context.next = 17;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
handleUIChange(key, val);
|
|
257
|
+
_context.next = 38;
|
|
258
|
+
break;
|
|
259
|
+
case 17:
|
|
246
260
|
if (!(key === 'delRule')) {
|
|
247
|
-
_context.next =
|
|
261
|
+
_context.next = 25;
|
|
248
262
|
break;
|
|
249
263
|
}
|
|
250
|
-
_context.next =
|
|
264
|
+
_context.next = 20;
|
|
251
265
|
return fetchDelAttrs({
|
|
252
266
|
moduleDatasetUid: fieldData.datasetFieldUid,
|
|
253
267
|
ccmModuleFieldVerifies: [{
|
|
@@ -255,11 +269,11 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
255
269
|
}],
|
|
256
270
|
scope: FIELD_SCOPES.CHECK_RULES
|
|
257
271
|
});
|
|
258
|
-
case
|
|
272
|
+
case 20:
|
|
259
273
|
_yield$fetchDelAttrs = _context.sent;
|
|
260
274
|
code = _yield$fetchDelAttrs.code;
|
|
261
275
|
return _context.abrupt("return", code === 1);
|
|
262
|
-
case
|
|
276
|
+
case 25:
|
|
263
277
|
mapping = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FIELD_SCOPES.FIELD_REQUIRED, {
|
|
264
278
|
key: 'fieldRequired',
|
|
265
279
|
refresh: requiredRefresh
|
|
@@ -295,15 +309,15 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
295
309
|
if (!_stateItem) {
|
|
296
310
|
d.datasetBusinessUids = [fieldData.uid];
|
|
297
311
|
}
|
|
298
|
-
_context.next =
|
|
312
|
+
_context.next = 35;
|
|
299
313
|
return request(d);
|
|
300
|
-
case
|
|
314
|
+
case 35:
|
|
301
315
|
_yield$request = _context.sent;
|
|
302
316
|
_code = _yield$request.code;
|
|
303
317
|
if (_code === 1) {
|
|
304
318
|
mapping[key].refresh();
|
|
305
319
|
}
|
|
306
|
-
case
|
|
320
|
+
case 38:
|
|
307
321
|
case "end":
|
|
308
322
|
return _context.stop();
|
|
309
323
|
}
|
|
@@ -16,7 +16,7 @@ import { fetchFieldsByDataset } from "../../constants/api-url";
|
|
|
16
16
|
import { listReducer, getLDMetaAttr } from "../../engine/tools/helper";
|
|
17
17
|
import styles from "../style/fields-setting.less";
|
|
18
18
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
19
|
-
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig'];
|
|
19
|
+
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig', 'formMode'];
|
|
20
20
|
var Header = styled.div.withConfig({
|
|
21
21
|
displayName: "Header",
|
|
22
22
|
componentId: "luckda-6530__sc-gcwvp1-0"
|
|
@@ -197,7 +197,7 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
197
197
|
data: {
|
|
198
198
|
uid: groupId,
|
|
199
199
|
id: groupId,
|
|
200
|
-
field:
|
|
200
|
+
field: groupId,
|
|
201
201
|
fieldName: 'Group',
|
|
202
202
|
_type: 'divider'
|
|
203
203
|
}
|
|
@@ -8,6 +8,7 @@ import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
|
|
|
8
8
|
import { Modal, Button } from 'luck-design/antd';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import styled from 'styled-components';
|
|
11
|
+
import { isNil } from 'lodash';
|
|
11
12
|
import { LDActions } from "../../../../index";
|
|
12
13
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
13
14
|
import { omitBadProps } from "../../../engine/tools/helper";
|
|
@@ -151,7 +152,6 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
151
152
|
}, /*#__PURE__*/React.createElement(Modal, _extends({
|
|
152
153
|
title: _title,
|
|
153
154
|
visible: open,
|
|
154
|
-
getContainer: getContainer,
|
|
155
155
|
width: width,
|
|
156
156
|
mask: mask,
|
|
157
157
|
maskStyle: maskStyle,
|
|
@@ -160,7 +160,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
160
160
|
overflowY: 'auto',
|
|
161
161
|
marginTop: 0
|
|
162
162
|
},
|
|
163
|
-
wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName))
|
|
163
|
+
wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName)),
|
|
164
|
+
getContainer: isNil(getContainer) ? function () {
|
|
165
|
+
return document.getElementById('root') || document.getElementById('react-content') || document.body;
|
|
166
|
+
} : getContainer
|
|
164
167
|
}, _footer, {
|
|
165
168
|
onOk: handleOk,
|
|
166
169
|
onCancel: function onCancel() {
|
|
@@ -7,7 +7,7 @@ var _excluded = ["advance", "state", "render"];
|
|
|
7
7
|
import React, { useRef, forwardRef, Fragment, useImperativeHandle } from 'react';
|
|
8
8
|
import { useMemoizedFn, useCreation, useUnmount } from 'ahooks';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import { reduce, includes, isNil, cloneDeep, last, startsWith, isString } from 'lodash';
|
|
10
|
+
import { reduce, includes, isNil, cloneDeep, last, startsWith, isString, xor } from 'lodash';
|
|
11
11
|
import { BasicDivider } from 'luck-design';
|
|
12
12
|
import { Collapse } from '@luck-design-biz/base';
|
|
13
13
|
import { formatMessage, getPageQuery } from '@luck-design-biz/base/utils';
|
|
@@ -56,7 +56,7 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
56
56
|
return [];
|
|
57
57
|
};
|
|
58
58
|
var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
59
|
-
var _ctx$state2;
|
|
59
|
+
var _ctx$state2, _promiseRef$current2;
|
|
60
60
|
var id = _ref3.id,
|
|
61
61
|
className = _ref3.className,
|
|
62
62
|
blocks = _ref3.blocks,
|
|
@@ -406,21 +406,29 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
406
406
|
};
|
|
407
407
|
if (item.type === 'auto') data = _objectSpread(_objectSpread({}, data), {}, {
|
|
408
408
|
col: item.cols
|
|
409
|
-
});else
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
409
|
+
});else {
|
|
410
|
+
data = _objectSpread(_objectSpread({}, data), {}, {
|
|
411
|
+
suppressPreset: item.suppressPreset,
|
|
412
|
+
height: item.height,
|
|
413
|
+
bordered: item.bordered,
|
|
414
|
+
draggable: item.draggable,
|
|
415
|
+
orderByAdd: item.orderByAdd,
|
|
416
|
+
hideActionsColumn: item.suppressActions,
|
|
417
|
+
actionsWidth: item.actionsColumnWidth,
|
|
418
|
+
operates: item.operates ? function (ops) {
|
|
419
|
+
return xor(ops, xor(['add', 'delete', 'update'], item.operates));
|
|
420
|
+
} : null,
|
|
421
|
+
columnsReset: function columnsReset(columns) {
|
|
422
|
+
return handleColumnsReset(item.columnsReset, columns);
|
|
423
|
+
},
|
|
424
|
+
onGridFormReady: function onGridFormReady(_ref, params, gridForm) {
|
|
425
|
+
return handleGridFormReady(item.onGridFormReady, _ref, params, gridForm);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
if (item.suppressbatch) {
|
|
429
|
+
data.rowSelection = false;
|
|
422
430
|
}
|
|
423
|
-
}
|
|
431
|
+
}
|
|
424
432
|
if (item.actionsColumnReset) data = _objectSpread(_objectSpread({}, data), {}, {
|
|
425
433
|
resetActionsColumn: function resetActionsColumn(data, index, actions, params) {
|
|
426
434
|
return handleResetActionsColumn(item.actionsColumnReset, data, index, actions, params);
|
|
@@ -584,7 +592,8 @@ var LCForm = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
584
592
|
}
|
|
585
593
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
586
594
|
},
|
|
587
|
-
afterInit: afterInit
|
|
595
|
+
afterInit: afterInit,
|
|
596
|
+
validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef)
|
|
588
597
|
}));
|
|
589
598
|
});
|
|
590
599
|
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
@@ -203,8 +203,18 @@
|
|
|
203
203
|
"type": "_BlockEditor",
|
|
204
204
|
"wrapper": "hidden",
|
|
205
205
|
"default": {
|
|
206
|
-
"
|
|
207
|
-
"
|
|
206
|
+
"auto": { "readOnly": false, "cols": 4 },
|
|
207
|
+
"grid": {
|
|
208
|
+
"readOnly": false,
|
|
209
|
+
"suppressPreset": false,
|
|
210
|
+
"height": "100%",
|
|
211
|
+
"bordered": false,
|
|
212
|
+
"draggable": false,
|
|
213
|
+
"orderByAdd": "asc",
|
|
214
|
+
"suppressActions": false,
|
|
215
|
+
"actionsColumnWidth": 160
|
|
216
|
+
},
|
|
217
|
+
"writer": {
|
|
208
218
|
"readOnly": false,
|
|
209
219
|
"suppressPreset": false,
|
|
210
220
|
"height": "100%",
|
|
@@ -261,6 +271,11 @@
|
|
|
261
271
|
}
|
|
262
272
|
],
|
|
263
273
|
"_grid_props": [
|
|
274
|
+
{
|
|
275
|
+
"key": "height",
|
|
276
|
+
"name": "高度",
|
|
277
|
+
"type": "_WidthHeight"
|
|
278
|
+
},
|
|
264
279
|
{
|
|
265
280
|
"key": "readOnly",
|
|
266
281
|
"name": "只读",
|
|
@@ -271,11 +286,6 @@
|
|
|
271
286
|
"name": "关闭预设",
|
|
272
287
|
"type": "switch"
|
|
273
288
|
},
|
|
274
|
-
{
|
|
275
|
-
"key": "height",
|
|
276
|
-
"name": "高度",
|
|
277
|
-
"type": "_WidthHeight"
|
|
278
|
-
},
|
|
279
289
|
{
|
|
280
290
|
"key": "bordered",
|
|
281
291
|
"name": "边框线",
|
|
@@ -286,6 +296,11 @@
|
|
|
286
296
|
"name": "拖拽排序",
|
|
287
297
|
"type": "switch"
|
|
288
298
|
},
|
|
299
|
+
{
|
|
300
|
+
"key": "suppressbatch",
|
|
301
|
+
"name": "关闭批量",
|
|
302
|
+
"type": "switch"
|
|
303
|
+
},
|
|
289
304
|
{
|
|
290
305
|
"key": "orderByAdd",
|
|
291
306
|
"name": "排序方式",
|
|
@@ -301,6 +316,26 @@
|
|
|
301
316
|
}
|
|
302
317
|
]
|
|
303
318
|
},
|
|
319
|
+
{
|
|
320
|
+
"key": "operates",
|
|
321
|
+
"name": "基础操作",
|
|
322
|
+
"type": "checkbox",
|
|
323
|
+
"options": [
|
|
324
|
+
{
|
|
325
|
+
"label": "添加",
|
|
326
|
+
"value": "add"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "删除",
|
|
330
|
+
"value": "delete"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"label": "修改",
|
|
334
|
+
"value": "update"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"defaultValue": ["add", "delete", "update"]
|
|
338
|
+
},
|
|
304
339
|
{
|
|
305
340
|
"key": "actionsColumn",
|
|
306
341
|
"name": "操作列",
|
package/es/services.js
CHANGED
|
@@ -20,4 +20,23 @@ function _readModlue() {
|
|
|
20
20
|
}, _callee);
|
|
21
21
|
}));
|
|
22
22
|
return _readModlue.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
export function noAuthTransformCode(_x2) {
|
|
25
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
26
|
+
}
|
|
27
|
+
function _noAuthTransformCode() {
|
|
28
|
+
_noAuthTransformCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
29
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
30
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
return _context2.abrupt("return", request("".concat(api.BASE_HOST, "/page/option/noAuthTransformCode"), {
|
|
33
|
+
params: params
|
|
34
|
+
}));
|
|
35
|
+
case 1:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context2.stop();
|
|
38
|
+
}
|
|
39
|
+
}, _callee2);
|
|
40
|
+
}));
|
|
41
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
23
42
|
}
|
|
@@ -79,7 +79,7 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
79
79
|
var _getDvaApp$_store$get = (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user,
|
|
80
80
|
currentUser = _getDvaApp$_store$get.currentUser;
|
|
81
81
|
var supportUploadTypes = useCreation(function () {
|
|
82
|
-
return getSupportUploadTypes(forbiddenTypes);
|
|
82
|
+
return getSupportUploadTypes(forbiddenTypes, supportTypes);
|
|
83
83
|
}, [forbiddenTypes, supportTypes]);
|
|
84
84
|
|
|
85
85
|
// 下载
|
|
@@ -271,6 +271,9 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
271
271
|
|
|
272
272
|
// 预览
|
|
273
273
|
var resetActionsColumn = useMemoizedFn(function (data, index, _actions, params) {
|
|
274
|
+
if (resetActions) {
|
|
275
|
+
return resetActions(data, index, actionList, params);
|
|
276
|
+
}
|
|
274
277
|
var actions = _actions.filter(function (item) {
|
|
275
278
|
return item.wanted !== 'update' && item.wanted !== 'add';
|
|
276
279
|
});
|
|
@@ -311,9 +314,6 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
311
314
|
});
|
|
312
315
|
}
|
|
313
316
|
});
|
|
314
|
-
if (resetActions) {
|
|
315
|
-
return resetActions(data, index, actions, params);
|
|
316
|
-
}
|
|
317
317
|
return actions;
|
|
318
318
|
});
|
|
319
319
|
var handleBatchOperationsClick = useMemoizedFn(function (key, selectedRows, cb) {
|
|
@@ -382,9 +382,19 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
382
382
|
beforeUpload: _beforeUpload
|
|
383
383
|
});
|
|
384
384
|
},
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
customRequest: function customRequest(_ref2) {
|
|
386
|
+
var file = _ref2.file,
|
|
387
|
+
onProgress = _ref2.onProgress,
|
|
388
|
+
onSuccess = _ref2.onSuccess;
|
|
389
|
+
return new Promise(function (resolve) {
|
|
390
|
+
setTimeout(function () {
|
|
391
|
+
onProgress({
|
|
392
|
+
percent: 100
|
|
393
|
+
});
|
|
394
|
+
onSuccess(file);
|
|
395
|
+
resolve();
|
|
396
|
+
}, 1000);
|
|
397
|
+
});
|
|
388
398
|
}
|
|
389
399
|
})
|
|
390
400
|
}), /*#__PURE__*/React.createElement(BasicFormItem, {
|
|
@@ -5,20 +5,19 @@ var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { BasicFormItem } from 'luck-design';
|
|
7
7
|
import { formatMessage, beforeUpload as _beforeUpload, getSupportUploadTypes } from '@luck-design-biz/base/utils';
|
|
8
|
-
import { getBehaviorUrl } from "../../lowcode/constants/api-url";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* 表单类型富文本上传
|
|
12
11
|
* 是否实体字段: 是
|
|
13
12
|
* 是否接受tag: 是
|
|
14
13
|
* 是否虚拟主键: 否
|
|
15
|
-
* 接受参数:
|
|
14
|
+
* 接受参数:
|
|
16
15
|
* name: 附件名称逗号拼接
|
|
17
16
|
* name_virtual: [{...// 附件所有参数}]
|
|
18
17
|
* ### name=name_virtual ###
|
|
19
|
-
* 传参:
|
|
18
|
+
* 传参:
|
|
20
19
|
* name: [{objectName, marker},...]
|
|
21
|
-
* 其他需求:
|
|
20
|
+
* 其他需求:
|
|
22
21
|
* 支持beforeUpload禁止附加类型
|
|
23
22
|
* =>beforeUpload禁止类型全覆盖
|
|
24
23
|
* =>forbiddenTypes和配置管理中禁止类型合并
|
|
@@ -36,13 +35,14 @@ function buildComponent(props) {
|
|
|
36
35
|
_props$config = props.config,
|
|
37
36
|
config = _props$config === void 0 ? {} : _props$config,
|
|
38
37
|
supportTypes = props.supportTypes,
|
|
39
|
-
forbiddenTypes = props.forbiddenTypes,
|
|
38
|
+
_props$forbiddenTypes = props.forbiddenTypes,
|
|
39
|
+
forbiddenTypes = _props$forbiddenTypes === void 0 ? [] : _props$forbiddenTypes,
|
|
40
40
|
children = props.children,
|
|
41
41
|
dataFormat = props.dataFormat,
|
|
42
42
|
listType = props.listType,
|
|
43
43
|
rest = _objectWithoutProperties(props, _excluded);
|
|
44
44
|
var getUrl = function getUrl(behaviorKey) {
|
|
45
|
-
return "".concat(
|
|
45
|
+
return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "¬e=").concat(note);
|
|
46
46
|
};
|
|
47
47
|
var supportUploadTypes = getSupportUploadTypes(forbiddenTypes, supportTypes);
|
|
48
48
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({
|
package/es/utils/grid.js
CHANGED
|
@@ -45,6 +45,7 @@ export function getColumnRender(name, type) {
|
|
|
45
45
|
case 'select':
|
|
46
46
|
case 'group':
|
|
47
47
|
case 'complex':
|
|
48
|
+
case 'dict':
|
|
48
49
|
render = function render(text, record) {
|
|
49
50
|
if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
|
|
50
51
|
if (isArray(text)) return text.map(function (i) {
|