@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
|
@@ -13,10 +13,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _ahooks = require("ahooks");
|
|
15
15
|
var _luckDesign = require("luck-design");
|
|
16
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
17
|
+
var _constants = require("../../lowcode/constants");
|
|
18
|
+
var _helper = require("../../lowcode/engine/tools/helper");
|
|
16
19
|
var _LdPop = _interopRequireDefault(require("../LdPop"));
|
|
17
20
|
var _services = require("../../services");
|
|
18
21
|
var _action2 = require("../../helper/action");
|
|
19
|
-
var _utils = require("@luck-design-biz/base/utils");
|
|
20
22
|
var LuckDaContext = exports.LuckDaContext = /*#__PURE__*/(0, _react.createContext)();
|
|
21
23
|
var useLDCtx = exports.useLDCtx = function useLDCtx() {
|
|
22
24
|
return (0, _react.useContext)(LuckDaContext);
|
|
@@ -36,6 +38,16 @@ var builder = function builder(WrappedComponent, moduleCode) {
|
|
|
36
38
|
pops = _useSetState2[0],
|
|
37
39
|
setPops = _useSetState2[1];
|
|
38
40
|
var fieldProps = (0, _react.useRef)({});
|
|
41
|
+
(0, _react.useEffect)(function () {
|
|
42
|
+
(0, _helper.setMetaAttrs)(_constants.LC_RUNTIME_KEY, 'live');
|
|
43
|
+
(0, _services.noAuthTransformCode)({
|
|
44
|
+
code: moduleCode
|
|
45
|
+
}).then(function (res) {
|
|
46
|
+
var code = res.code,
|
|
47
|
+
data = res.data;
|
|
48
|
+
if (code === 1) (0, _helper.setMetaAttrs)(_constants.META_TAG_NAME, data);
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
39
51
|
var _useRequest = (0, _ahooks.useRequest)(_services.readModlue, {
|
|
40
52
|
defaultParams: [{
|
|
41
53
|
moduleCode: moduleCode
|
|
@@ -80,7 +80,8 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
80
80
|
var col = columnsObj[key];
|
|
81
81
|
if ((setting === null || setting === void 0 ? void 0 : setting._type) === 'divider') {
|
|
82
82
|
result.push( /*#__PURE__*/_react.default.createElement(_luckDesign.BasicDivider, {
|
|
83
|
-
title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName
|
|
83
|
+
title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName,
|
|
84
|
+
key: key
|
|
84
85
|
}));
|
|
85
86
|
} else if (col !== null && col !== void 0 && col.isShowInForm && ((0, _lodash.isNil)(setting) || setting !== null && setting !== void 0 && setting.isShow)) {
|
|
86
87
|
var customFiled = filedsRewrite.find(function (_field) {
|
|
@@ -127,7 +127,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
127
127
|
var renderExtra = (0, _ahooks.useMemoizedFn)(function (formId, extraConfig, type) {
|
|
128
128
|
return /*#__PURE__*/_react.default.createElement(_FormList.FormBtn, (0, _extends2.default)({
|
|
129
129
|
type: type,
|
|
130
|
-
formId: formId
|
|
130
|
+
formId: formId,
|
|
131
|
+
showConfigBtn: false
|
|
131
132
|
}, extraConfig));
|
|
132
133
|
});
|
|
133
134
|
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -233,12 +233,15 @@ var _default = exports.default = {
|
|
|
233
233
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.none": "不固定",
|
|
234
234
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.left": "左",
|
|
235
235
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fixed.right": "右",
|
|
236
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode.single": "行修改",
|
|
237
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode.bulk": "批量修改",
|
|
236
238
|
"luckda.lowcode.painter.delete.tip": "确定删除吗?",
|
|
237
239
|
"luckda.lowcode.painter.panel-section.fieldsSetting.width": "列宽",
|
|
238
240
|
"luckda.lowcode.painter.panel-section.fieldsSetting.align": "内容对齐",
|
|
239
241
|
"luckda.lowcode.painter.panel-section.fieldsSetting.headerAlign": "表头对齐",
|
|
240
242
|
"luckda.lowcode.painter.panel-section.fieldsSetting.pinned": "固定列",
|
|
241
243
|
"luckda.lowcode.painter.panel-section.fieldsSetting.tip": "过长提示",
|
|
244
|
+
"luckda.lowcode.painter.panel-section.fieldsSetting.formMode": "表单模式",
|
|
242
245
|
"luckda.lowcode.painter.panel-section.fieldsSetting.fieldColumn": "占列数",
|
|
243
246
|
"luckda.lowcode.painter.panel-section.fieldsSetting.isEqual": "唯一校验",
|
|
244
247
|
"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": "操作列",
|
|
@@ -66,6 +66,19 @@ var _PINNED_OPTIONS_ = [{
|
|
|
66
66
|
}),
|
|
67
67
|
value: 'right'
|
|
68
68
|
}];
|
|
69
|
+
var _FORM_MODE_OPTIONS_ = [{
|
|
70
|
+
label: (0, _utils.formatMessage)({
|
|
71
|
+
id: "".concat(_I18N_PREFIX_, ".formMode.single"),
|
|
72
|
+
label: '行修改'
|
|
73
|
+
}),
|
|
74
|
+
value: 'single'
|
|
75
|
+
}, {
|
|
76
|
+
label: (0, _utils.formatMessage)({
|
|
77
|
+
id: "".concat(_I18N_PREFIX_, ".formMode.bulk"),
|
|
78
|
+
label: '批量修改'
|
|
79
|
+
}),
|
|
80
|
+
value: 'bulk'
|
|
81
|
+
}];
|
|
69
82
|
var _TRUE_FALSE_ = ['__TRUE__', '__FALSE__'];
|
|
70
83
|
var CoderWrapper = _styledComponents.default.div.withConfig({
|
|
71
84
|
displayName: "CoderWrapper",
|
|
@@ -325,7 +338,18 @@ var SettingUI = function SettingUI(_ref) {
|
|
|
325
338
|
onChange: function onChange(val) {
|
|
326
339
|
return run('tip', val);
|
|
327
340
|
}
|
|
328
|
-
}))), component === '
|
|
341
|
+
}))), component === 'tableForm' && /*#__PURE__*/_react.default.createElement(_PanelItem.default, {
|
|
342
|
+
label: (0, _utils.formatMessage)({
|
|
343
|
+
id: "".concat(_I18N_PREFIX_, ".formMode"),
|
|
344
|
+
label: '表单模式'
|
|
345
|
+
})
|
|
346
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Checkbox.Group, {
|
|
347
|
+
options: _FORM_MODE_OPTIONS_,
|
|
348
|
+
defaultValue: fieldData.formMode ? [fieldData.formMode] : ['single', 'bulk'],
|
|
349
|
+
onChange: function onChange(val) {
|
|
350
|
+
return run('formMode', val);
|
|
351
|
+
}
|
|
352
|
+
})), component === 'form' && /*#__PURE__*/_react.default.createElement(_PanelItem.default, {
|
|
329
353
|
label: (0, _utils.formatMessage)({
|
|
330
354
|
id: "".concat(_I18N_PREFIX_, ".fieldColumn"),
|
|
331
355
|
label: '占列数'
|
|
@@ -231,7 +231,7 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
231
231
|
moduleUid: moduleId
|
|
232
232
|
}, val ? 'uniqueFieldUid' : 'noUniqueFieldUid', fieldData.uid));
|
|
233
233
|
case 3:
|
|
234
|
-
_context.next =
|
|
234
|
+
_context.next = 38;
|
|
235
235
|
break;
|
|
236
236
|
case 5:
|
|
237
237
|
if (!(key === 'align' || key === 'headerAlign' || key === 'pinned' || key === 'tip' || key === 'render')) {
|
|
@@ -239,22 +239,36 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
239
239
|
break;
|
|
240
240
|
}
|
|
241
241
|
handleUIChange(key, val);
|
|
242
|
-
_context.next =
|
|
242
|
+
_context.next = 38;
|
|
243
243
|
break;
|
|
244
244
|
case 9:
|
|
245
|
-
if (!(key === '
|
|
245
|
+
if (!(key === 'formMode')) {
|
|
246
246
|
_context.next = 13;
|
|
247
247
|
break;
|
|
248
248
|
}
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
if (val.includes('single') && !val.includes('bulk')) {
|
|
250
|
+
handleUIChange(key, 'single');
|
|
251
|
+
} else if (!val.includes('single') && val.includes('bulk')) {
|
|
252
|
+
handleUIChange(key, 'bulk');
|
|
253
|
+
} else {
|
|
254
|
+
handleUIChange(key, void 0);
|
|
255
|
+
}
|
|
256
|
+
_context.next = 38;
|
|
251
257
|
break;
|
|
252
258
|
case 13:
|
|
259
|
+
if (!(key === 'col' || key === 'row')) {
|
|
260
|
+
_context.next = 17;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
handleUIChange(key, val);
|
|
264
|
+
_context.next = 38;
|
|
265
|
+
break;
|
|
266
|
+
case 17:
|
|
253
267
|
if (!(key === 'delRule')) {
|
|
254
|
-
_context.next =
|
|
268
|
+
_context.next = 25;
|
|
255
269
|
break;
|
|
256
270
|
}
|
|
257
|
-
_context.next =
|
|
271
|
+
_context.next = 20;
|
|
258
272
|
return (0, _apiUrl.fetchDelAttrs)({
|
|
259
273
|
moduleDatasetUid: fieldData.datasetFieldUid,
|
|
260
274
|
ccmModuleFieldVerifies: [{
|
|
@@ -262,11 +276,11 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
262
276
|
}],
|
|
263
277
|
scope: _constants.FIELD_SCOPES.CHECK_RULES
|
|
264
278
|
});
|
|
265
|
-
case
|
|
279
|
+
case 20:
|
|
266
280
|
_yield$fetchDelAttrs = _context.sent;
|
|
267
281
|
code = _yield$fetchDelAttrs.code;
|
|
268
282
|
return _context.abrupt("return", code === 1);
|
|
269
|
-
case
|
|
283
|
+
case 25:
|
|
270
284
|
mapping = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.FIELD_SCOPES.FIELD_REQUIRED, {
|
|
271
285
|
key: 'fieldRequired',
|
|
272
286
|
refresh: requiredRefresh
|
|
@@ -302,15 +316,15 @@ var FieldSetting = function FieldSetting(_ref) {
|
|
|
302
316
|
if (!_stateItem) {
|
|
303
317
|
d.datasetBusinessUids = [fieldData.uid];
|
|
304
318
|
}
|
|
305
|
-
_context.next =
|
|
319
|
+
_context.next = 35;
|
|
306
320
|
return request(d);
|
|
307
|
-
case
|
|
321
|
+
case 35:
|
|
308
322
|
_yield$request = _context.sent;
|
|
309
323
|
_code = _yield$request.code;
|
|
310
324
|
if (_code === 1) {
|
|
311
325
|
mapping[key].refresh();
|
|
312
326
|
}
|
|
313
|
-
case
|
|
327
|
+
case 38:
|
|
314
328
|
case "end":
|
|
315
329
|
return _context.stop();
|
|
316
330
|
}
|
|
@@ -24,7 +24,7 @@ var _apiUrl = require("../../constants/api-url");
|
|
|
24
24
|
var _helper = require("../../engine/tools/helper");
|
|
25
25
|
var _fieldsSetting = _interopRequireDefault(require("../style/fields-setting.less"));
|
|
26
26
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
27
|
-
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig'];
|
|
27
|
+
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'render', 'col', 'row', 'note', 'placeholder', 'fieldAliasName', 'complexConfig', 'formMode'];
|
|
28
28
|
var Header = _styledComponents.default.div.withConfig({
|
|
29
29
|
displayName: "Header",
|
|
30
30
|
componentId: "luckda-6530__sc-gcwvp1-0"
|
|
@@ -205,7 +205,7 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
205
205
|
data: {
|
|
206
206
|
uid: groupId,
|
|
207
207
|
id: groupId,
|
|
208
|
-
field:
|
|
208
|
+
field: groupId,
|
|
209
209
|
fieldName: 'Group',
|
|
210
210
|
_type: 'divider'
|
|
211
211
|
}
|
|
@@ -16,6 +16,7 @@ var _ahooks = require("ahooks");
|
|
|
16
16
|
var _antd = require("luck-design/antd");
|
|
17
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
var _lodash = require("lodash");
|
|
19
20
|
var _index = require("../../../../index");
|
|
20
21
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
21
22
|
var _helper = require("../../../engine/tools/helper");
|
|
@@ -159,7 +160,6 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
159
160
|
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, (0, _extends2.default)({
|
|
160
161
|
title: _title,
|
|
161
162
|
visible: open,
|
|
162
|
-
getContainer: getContainer,
|
|
163
163
|
width: width,
|
|
164
164
|
mask: mask,
|
|
165
165
|
maskStyle: maskStyle,
|
|
@@ -168,7 +168,10 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
168
168
|
overflowY: 'auto',
|
|
169
169
|
marginTop: 0
|
|
170
170
|
},
|
|
171
|
-
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName))
|
|
171
|
+
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName)),
|
|
172
|
+
getContainer: (0, _lodash.isNil)(getContainer) ? function () {
|
|
173
|
+
return document.getElementById('root') || document.getElementById('react-content') || document.body;
|
|
174
|
+
} : getContainer
|
|
172
175
|
}, _footer, {
|
|
173
176
|
onOk: handleOk,
|
|
174
177
|
onCancel: function onCancel() {
|
|
@@ -64,7 +64,7 @@ var getMthodParams = function getMthodParams(methodStr) {
|
|
|
64
64
|
return [];
|
|
65
65
|
};
|
|
66
66
|
var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
67
|
-
var _ctx$state2;
|
|
67
|
+
var _ctx$state2, _promiseRef$current2;
|
|
68
68
|
var id = _ref3.id,
|
|
69
69
|
className = _ref3.className,
|
|
70
70
|
blocks = _ref3.blocks,
|
|
@@ -414,21 +414,29 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
|
414
414
|
};
|
|
415
415
|
if (item.type === 'auto') data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
416
416
|
col: item.cols
|
|
417
|
-
});else
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
417
|
+
});else {
|
|
418
|
+
data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
419
|
+
suppressPreset: item.suppressPreset,
|
|
420
|
+
height: item.height,
|
|
421
|
+
bordered: item.bordered,
|
|
422
|
+
draggable: item.draggable,
|
|
423
|
+
orderByAdd: item.orderByAdd,
|
|
424
|
+
hideActionsColumn: item.suppressActions,
|
|
425
|
+
actionsWidth: item.actionsColumnWidth,
|
|
426
|
+
operates: item.operates ? function (ops) {
|
|
427
|
+
return (0, _lodash.xor)(ops, (0, _lodash.xor)(['add', 'delete', 'update'], item.operates));
|
|
428
|
+
} : null,
|
|
429
|
+
columnsReset: function columnsReset(columns) {
|
|
430
|
+
return handleColumnsReset(item.columnsReset, columns);
|
|
431
|
+
},
|
|
432
|
+
onGridFormReady: function onGridFormReady(_ref, params, gridForm) {
|
|
433
|
+
return handleGridFormReady(item.onGridFormReady, _ref, params, gridForm);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
if (item.suppressbatch) {
|
|
437
|
+
data.rowSelection = false;
|
|
430
438
|
}
|
|
431
|
-
}
|
|
439
|
+
}
|
|
432
440
|
if (item.actionsColumnReset) data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
433
441
|
resetActionsColumn: function resetActionsColumn(data, index, actions, params) {
|
|
434
442
|
return handleResetActionsColumn(item.actionsColumnReset, data, index, actions, params);
|
|
@@ -592,7 +600,8 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
|
592
600
|
}
|
|
593
601
|
return (_promiseRef$current = promiseRef.current) === null || _promiseRef$current === void 0 ? void 0 : _promiseRef$current.call.apply(_promiseRef$current, [promiseRef].concat(rest));
|
|
594
602
|
},
|
|
595
|
-
afterInit: afterInit
|
|
603
|
+
afterInit: afterInit,
|
|
604
|
+
validateErrorCallback: (_promiseRef$current2 = promiseRef.current) === null || _promiseRef$current2 === void 0 ? void 0 : _promiseRef$current2.call(promiseRef)
|
|
596
605
|
}));
|
|
597
606
|
});
|
|
598
607
|
LCForm.defaultProps = (0, _helper.omitBadProps)(_formPropsDefault.default);
|
|
@@ -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/lib/services.js
CHANGED
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.noAuthTransformCode = noAuthTransformCode;
|
|
7
8
|
exports.readModlue = readModlue;
|
|
8
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -27,4 +28,23 @@ function _readModlue() {
|
|
|
27
28
|
}, _callee);
|
|
28
29
|
}));
|
|
29
30
|
return _readModlue.apply(this, arguments);
|
|
31
|
+
}
|
|
32
|
+
function noAuthTransformCode(_x2) {
|
|
33
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
function _noAuthTransformCode() {
|
|
36
|
+
_noAuthTransformCode = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(params) {
|
|
37
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
38
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
return _context2.abrupt("return", (0, _utils.request)("".concat(_ApiConfig.default.BASE_HOST, "/page/option/noAuthTransformCode"), {
|
|
41
|
+
params: params
|
|
42
|
+
}));
|
|
43
|
+
case 1:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context2.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee2);
|
|
48
|
+
}));
|
|
49
|
+
return _noAuthTransformCode.apply(this, arguments);
|
|
30
50
|
}
|
|
@@ -87,7 +87,7 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
87
87
|
var _getDvaApp$_store$get = (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user,
|
|
88
88
|
currentUser = _getDvaApp$_store$get.currentUser;
|
|
89
89
|
var supportUploadTypes = (0, _ahooks.useCreation)(function () {
|
|
90
|
-
return (0, _utils.getSupportUploadTypes)(forbiddenTypes);
|
|
90
|
+
return (0, _utils.getSupportUploadTypes)(forbiddenTypes, supportTypes);
|
|
91
91
|
}, [forbiddenTypes, supportTypes]);
|
|
92
92
|
|
|
93
93
|
// 下载
|
|
@@ -279,6 +279,9 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
279
279
|
|
|
280
280
|
// 预览
|
|
281
281
|
var resetActionsColumn = (0, _ahooks.useMemoizedFn)(function (data, index, _actions, params) {
|
|
282
|
+
if (resetActions) {
|
|
283
|
+
return resetActions(data, index, actionList, params);
|
|
284
|
+
}
|
|
282
285
|
var actions = _actions.filter(function (item) {
|
|
283
286
|
return item.wanted !== 'update' && item.wanted !== 'add';
|
|
284
287
|
});
|
|
@@ -319,9 +322,6 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
319
322
|
});
|
|
320
323
|
}
|
|
321
324
|
});
|
|
322
|
-
if (resetActions) {
|
|
323
|
-
return resetActions(data, index, actions, params);
|
|
324
|
-
}
|
|
325
325
|
return actions;
|
|
326
326
|
});
|
|
327
327
|
var handleBatchOperationsClick = (0, _ahooks.useMemoizedFn)(function (key, selectedRows, cb) {
|
|
@@ -390,9 +390,19 @@ var UploadGridForm = function UploadGridForm(_ref) {
|
|
|
390
390
|
beforeUpload: _beforeUpload
|
|
391
391
|
});
|
|
392
392
|
},
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
customRequest: function customRequest(_ref2) {
|
|
394
|
+
var file = _ref2.file,
|
|
395
|
+
onProgress = _ref2.onProgress,
|
|
396
|
+
onSuccess = _ref2.onSuccess;
|
|
397
|
+
return new Promise(function (resolve) {
|
|
398
|
+
setTimeout(function () {
|
|
399
|
+
onProgress({
|
|
400
|
+
percent: 100
|
|
401
|
+
});
|
|
402
|
+
onSuccess(file);
|
|
403
|
+
resolve();
|
|
404
|
+
}, 1000);
|
|
405
|
+
});
|
|
396
406
|
}
|
|
397
407
|
})
|
|
398
408
|
}), /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, {
|
|
@@ -11,20 +11,19 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _luckDesign = require("luck-design");
|
|
13
13
|
var _utils = require("@luck-design-biz/base/utils");
|
|
14
|
-
var _apiUrl = require("../../lowcode/constants/api-url");
|
|
15
14
|
var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "supportTypes", "forbiddenTypes", "children", "dataFormat", "listType"];
|
|
16
15
|
/**
|
|
17
16
|
* 表单类型富文本上传
|
|
18
17
|
* 是否实体字段: 是
|
|
19
18
|
* 是否接受tag: 是
|
|
20
19
|
* 是否虚拟主键: 否
|
|
21
|
-
* 接受参数:
|
|
20
|
+
* 接受参数:
|
|
22
21
|
* name: 附件名称逗号拼接
|
|
23
22
|
* name_virtual: [{...// 附件所有参数}]
|
|
24
23
|
* ### name=name_virtual ###
|
|
25
|
-
* 传参:
|
|
24
|
+
* 传参:
|
|
26
25
|
* name: [{objectName, marker},...]
|
|
27
|
-
* 其他需求:
|
|
26
|
+
* 其他需求:
|
|
28
27
|
* 支持beforeUpload禁止附加类型
|
|
29
28
|
* =>beforeUpload禁止类型全覆盖
|
|
30
29
|
* =>forbiddenTypes和配置管理中禁止类型合并
|
|
@@ -42,13 +41,14 @@ function buildComponent(props) {
|
|
|
42
41
|
_props$config = props.config,
|
|
43
42
|
config = _props$config === void 0 ? {} : _props$config,
|
|
44
43
|
supportTypes = props.supportTypes,
|
|
45
|
-
forbiddenTypes = props.forbiddenTypes,
|
|
44
|
+
_props$forbiddenTypes = props.forbiddenTypes,
|
|
45
|
+
forbiddenTypes = _props$forbiddenTypes === void 0 ? [] : _props$forbiddenTypes,
|
|
46
46
|
children = props.children,
|
|
47
47
|
dataFormat = props.dataFormat,
|
|
48
48
|
listType = props.listType,
|
|
49
49
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
50
50
|
var getUrl = function getUrl(behaviorKey) {
|
|
51
|
-
return "".concat(
|
|
51
|
+
return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "¬e=").concat(note);
|
|
52
52
|
};
|
|
53
53
|
var supportUploadTypes = (0, _utils.getSupportUploadTypes)(forbiddenTypes, supportTypes);
|
|
54
54
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({
|
package/lib/utils/grid.js
CHANGED
|
@@ -53,6 +53,7 @@ function getColumnRender(name, type) {
|
|
|
53
53
|
case 'select':
|
|
54
54
|
case 'group':
|
|
55
55
|
case 'complex':
|
|
56
|
+
case 'dict':
|
|
56
57
|
render = function render(text, record) {
|
|
57
58
|
if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
|
|
58
59
|
if ((0, _lodash.isArray)(text)) return text.map(function (i) {
|