@luck-design-biz/luckda 0.0.10 → 0.0.11
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/LdAutoForm/index.js +12 -3
- package/es/components/LdFormList/index.js +10 -6
- package/es/components/LdGridForm/index.js +6 -2
- package/es/helper/FromItems.js +59 -38
- package/es/helper/action.js +3 -1
- package/es/services.js +15 -19
- package/es/utils/action.js +11 -13
- package/es/utils/form.js +4 -0
- package/es/utils/grid.js +13 -8
- package/lib/components/LdAutoForm/index.js +12 -3
- package/lib/components/LdFormList/index.js +10 -6
- package/lib/components/LdGridForm/index.js +6 -2
- package/lib/helper/FromItems.js +61 -39
- package/lib/helper/action.js +3 -1
- package/lib/services.js +15 -19
- package/lib/utils/action.js +11 -13
- package/lib/utils/form.js +4 -0
- package/lib/utils/grid.js +12 -8
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ 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 _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData"];
|
|
5
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "formRef", "formMode"];
|
|
6
6
|
import React, { useContext, useRef, useState } from 'react';
|
|
7
7
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
8
8
|
import { transform } from 'lodash';
|
|
@@ -41,6 +41,8 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
41
41
|
} : _ref$defaultDataSourc,
|
|
42
42
|
_ref$ticketData = _ref.ticketData,
|
|
43
43
|
ticketData = _ref$ticketData === void 0 ? {} : _ref$ticketData,
|
|
44
|
+
formRef = _ref.formRef,
|
|
45
|
+
formMode = _ref.formMode,
|
|
44
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
47
|
var _ref2 = useContext(LuckDaContext) || {},
|
|
46
48
|
setFieldProps = _ref2.setFieldProps;
|
|
@@ -55,7 +57,12 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
55
57
|
return field.name === col.field;
|
|
56
58
|
}) || {};
|
|
57
59
|
_defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, col.field, col['optDefaultValue']), _defineProperty(_objectSpread2, "".concat(col.field, "_virtual"), col['optDefaultValueCvt']), _objectSpread2));
|
|
58
|
-
result.push(getFormItem(col, _objectSpread(_objectSpread({
|
|
60
|
+
result.push(getFormItem(col, _objectSpread(_objectSpread({
|
|
61
|
+
formId: ldId,
|
|
62
|
+
moduleCode: moduleCode,
|
|
63
|
+
formRef: formRef,
|
|
64
|
+
formMode: formMode
|
|
65
|
+
}, customFiled), {}, {
|
|
59
66
|
handleValueChange: function handleValueChange(value) {
|
|
60
67
|
return onValueChange(_defineProperty({}, ldId, _defineProperty({}, col.field, value)));
|
|
61
68
|
}
|
|
@@ -85,11 +92,13 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
85
92
|
return behaviorCall(get, post, formData);
|
|
86
93
|
},
|
|
87
94
|
get: function get() {
|
|
88
|
-
|
|
95
|
+
var _get = {
|
|
89
96
|
moduleCode: moduleCode,
|
|
90
97
|
datasetCode: dataSetKey,
|
|
91
98
|
behaviorKey: behaviorKey
|
|
92
99
|
};
|
|
100
|
+
if (!isMain) _get.relationDs = mainDataSetKey;
|
|
101
|
+
return _get;
|
|
93
102
|
}
|
|
94
103
|
}, _onOperate), {}, {
|
|
95
104
|
post: function post(_ref3) {
|
|
@@ -81,8 +81,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
81
81
|
var _ref5 = formListRef.current || {},
|
|
82
82
|
formRefs = _ref5.formRefs;
|
|
83
83
|
var data = formRefs && Object.keys(formRefs).map(function (key) {
|
|
84
|
-
var _formRefs$key$current;
|
|
85
|
-
var getValue = formRefs[key].getData || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
84
|
+
var _formRefs$key, _formRefs$key$formRef, _formRefs$key$current;
|
|
85
|
+
var getValue = (((_formRefs$key = formRefs[key]) === null || _formRefs$key === void 0 ? void 0 : (_formRefs$key$formRef = _formRefs$key.formRef) === null || _formRefs$key$formRef === void 0 ? void 0 : _formRefs$key$formRef.current) ? formRefs[key].getData : null) || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
86
86
|
return _defineProperty({}, key, getValue && getValue());
|
|
87
87
|
});
|
|
88
88
|
onValueChange(change, data);
|
|
@@ -194,19 +194,21 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
194
194
|
var _props$type = _props.type,
|
|
195
195
|
type = _props$type === void 0 ? 'auto' : _props$type;
|
|
196
196
|
var renderForm = type === 'auto' ? buildLdAutoForm : buildLdGridForm;
|
|
197
|
-
if (header === 'collapse') return /*#__PURE__*/React.createElement(Collapse, {
|
|
197
|
+
if (header === 'collapse' || header === 'collapseFollow') return /*#__PURE__*/React.createElement(Collapse, {
|
|
198
198
|
title: title || ldId,
|
|
199
199
|
extra: renderExtra(ldId, extraConfig),
|
|
200
200
|
id: ldId,
|
|
201
201
|
key: ldId,
|
|
202
|
-
mode: ldId !== mainFormLdId && 'tab'
|
|
202
|
+
mode: header === 'collapse' && ldId !== mainFormLdId && 'tab'
|
|
203
203
|
}, renderForm(_objectSpread(_objectSpread({}, _props), {}, {
|
|
204
204
|
ldId: ldId,
|
|
205
205
|
mainFormLdId: mainFormLdId,
|
|
206
206
|
mainDataSetKey: mainDataSetKey,
|
|
207
207
|
readOnly: readOnly || _readOnly,
|
|
208
208
|
onValueChange: handleValueChange,
|
|
209
|
-
ticketData: props.ticketData
|
|
209
|
+
ticketData: props.ticketData,
|
|
210
|
+
formRef: formListRef,
|
|
211
|
+
formMode: formMode
|
|
210
212
|
})));
|
|
211
213
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
212
214
|
key: ldId
|
|
@@ -223,7 +225,9 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
223
225
|
mainDataSetKey: mainDataSetKey,
|
|
224
226
|
readOnly: readOnly || _readOnly,
|
|
225
227
|
onValueChange: handleValueChange,
|
|
226
|
-
ticketData: props.ticketData
|
|
228
|
+
ticketData: props.ticketData,
|
|
229
|
+
formRef: formListRef,
|
|
230
|
+
formMode: formMode
|
|
227
231
|
})));
|
|
228
232
|
}), ChildrenUtil.deepMap(renderFormExtra(formConfig), function (child) {
|
|
229
233
|
var _child$type;
|
|
@@ -106,16 +106,20 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
106
106
|
return behaviorCall(_objectSpread(_objectSpread({}, get), {}, _defineProperty({}, isMain ? 'indocno' : 'relationId', ((_formData$mainFormLdI = formData[mainFormLdId]) === null || _formData$mainFormLdI === void 0 ? void 0 : _formData$mainFormLdI.indocno) || ticketData.indocno)), post, formData);
|
|
107
107
|
},
|
|
108
108
|
get: function get() {
|
|
109
|
-
|
|
109
|
+
var _get = {
|
|
110
110
|
moduleCode: moduleCode,
|
|
111
111
|
datasetCode: dataSetKey,
|
|
112
112
|
behaviorKey: behaviorKey
|
|
113
113
|
};
|
|
114
|
+
if (!isMain) _get.relationDs = mainDataSetKey;
|
|
115
|
+
return _get;
|
|
114
116
|
}
|
|
115
117
|
}, _onOperate), {}, {
|
|
116
118
|
post: function post(data) {
|
|
117
119
|
var _submitData = data.map(function (item) {
|
|
118
|
-
return dataFormat(gridColumns, item)
|
|
120
|
+
return behaviorKey === 'add' ? _objectSpread(_objectSpread({}, dataFormat(gridColumns, item)), {}, {
|
|
121
|
+
indocno: null
|
|
122
|
+
}) : dataFormat(gridColumns, item);
|
|
119
123
|
});
|
|
120
124
|
if (_onOperate === null || _onOperate === void 0 ? void 0 : _onOperate.post) return _onOperate.post(_submitData); // 以预设为主
|
|
121
125
|
return _defineProperty({}, dataSetKey, _defineProperty({}, "".concat(behaviorKey, "List"), _submitData));
|
package/es/helper/FromItems.js
CHANGED
|
@@ -23,19 +23,21 @@ var _excluded = ["onBlur"],
|
|
|
23
23
|
_excluded19 = ["handleValueChange"],
|
|
24
24
|
_excluded20 = ["handleValueChange", "config"],
|
|
25
25
|
_excluded21 = ["onBlur"],
|
|
26
|
-
_excluded22 = ["handleValueChange", "config"]
|
|
26
|
+
_excluded22 = ["handleValueChange", "config"],
|
|
27
|
+
_excluded23 = ["onBlur"],
|
|
28
|
+
_excluded24 = ["handleValueChange", "config"];
|
|
27
29
|
import React, { useState, useEffect } from 'react';
|
|
28
30
|
import { getDvaApp } from 'umi';
|
|
29
31
|
import { BasicFormItem } from 'luck-design';
|
|
30
|
-
import { TreeSelector, RegionFormItem } from '@luck-design-biz/base';
|
|
32
|
+
import { TreeSelector, RegionFormItem, UploadFormItemV3 } from '@luck-design-biz/base';
|
|
31
33
|
import { DatadicDropDown, UserSelectDropDown as UserItem } from '@luck-design-biz/base/sys/dropdown';
|
|
32
34
|
export var getNumberItem = function getNumberItem() {
|
|
33
35
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
34
36
|
handleValueChange = _ref.handleValueChange,
|
|
35
|
-
_ref$config = _ref.config
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_config = _objectWithoutProperties(_ref$
|
|
37
|
+
_ref$config = _ref.config,
|
|
38
|
+
_ref$config2 = _ref$config === void 0 ? {} : _ref$config,
|
|
39
|
+
_onBlur = _ref$config2.onBlur,
|
|
40
|
+
_config = _objectWithoutProperties(_ref$config2, _excluded),
|
|
39
41
|
props = _objectWithoutProperties(_ref, _excluded2);
|
|
40
42
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
41
43
|
type: "input",
|
|
@@ -50,10 +52,10 @@ export var getNumberItem = function getNumberItem() {
|
|
|
50
52
|
};
|
|
51
53
|
export var getStringItem = function getStringItem(_ref2) {
|
|
52
54
|
var handleValueChange = _ref2.handleValueChange,
|
|
53
|
-
_ref2$config = _ref2.config
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_config = _objectWithoutProperties(_ref2$
|
|
55
|
+
_ref2$config = _ref2.config,
|
|
56
|
+
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
57
|
+
_onBlur2 = _ref2$config2.onBlur,
|
|
58
|
+
_config = _objectWithoutProperties(_ref2$config2, _excluded3),
|
|
57
59
|
props = _objectWithoutProperties(_ref2, _excluded4);
|
|
58
60
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
59
61
|
config: _objectSpread(_objectSpread({}, _config), {}, {
|
|
@@ -68,10 +70,10 @@ export var getStringItem = function getStringItem(_ref2) {
|
|
|
68
70
|
export var getTextareaItem = function getTextareaItem() {
|
|
69
71
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
70
72
|
handleValueChange = _ref3.handleValueChange,
|
|
71
|
-
_ref3$config = _ref3.config
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
_config = _objectWithoutProperties(_ref3$
|
|
73
|
+
_ref3$config = _ref3.config,
|
|
74
|
+
_ref3$config2 = _ref3$config === void 0 ? {} : _ref3$config,
|
|
75
|
+
_onBlur3 = _ref3$config2.onBlur,
|
|
76
|
+
_config = _objectWithoutProperties(_ref3$config2, _excluded5),
|
|
75
77
|
props = _objectWithoutProperties(_ref3, _excluded6);
|
|
76
78
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
77
79
|
type: "input",
|
|
@@ -87,10 +89,10 @@ export var getTextareaItem = function getTextareaItem() {
|
|
|
87
89
|
export var getDateItem = function getDateItem() {
|
|
88
90
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
89
91
|
handleValueChange = _ref4.handleValueChange,
|
|
90
|
-
_ref4$config = _ref4.config
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
_config = _objectWithoutProperties(_ref4$
|
|
92
|
+
_ref4$config = _ref4.config,
|
|
93
|
+
_ref4$config2 = _ref4$config === void 0 ? {} : _ref4$config,
|
|
94
|
+
_onChange = _ref4$config2.onChange,
|
|
95
|
+
_config = _objectWithoutProperties(_ref4$config2, _excluded7),
|
|
94
96
|
props = _objectWithoutProperties(_ref4, _excluded8);
|
|
95
97
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
96
98
|
type: "datePicker",
|
|
@@ -116,10 +118,10 @@ export var getUserItem = function getUserItem(_ref5) {
|
|
|
116
118
|
};
|
|
117
119
|
export var getSelectItem = function getSelectItem(_ref6) {
|
|
118
120
|
var handleValueChange = _ref6.handleValueChange,
|
|
119
|
-
_ref6$config = _ref6.config
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
_config = _objectWithoutProperties(_ref6$
|
|
121
|
+
_ref6$config = _ref6.config,
|
|
122
|
+
_ref6$config2 = _ref6$config === void 0 ? {} : _ref6$config,
|
|
123
|
+
_onChange3 = _ref6$config2.onChange,
|
|
124
|
+
_config = _objectWithoutProperties(_ref6$config2, _excluded10),
|
|
123
125
|
props = _objectWithoutProperties(_ref6, _excluded11);
|
|
124
126
|
var config = _objectSpread(_objectSpread({}, _config), {}, {
|
|
125
127
|
onChange: function onChange(value, e) {
|
|
@@ -182,10 +184,10 @@ export var getRadioItem = function getRadioItem() {
|
|
|
182
184
|
};
|
|
183
185
|
export var getGroupItem = function getGroupItem(_ref8) {
|
|
184
186
|
var handleValueChange = _ref8.handleValueChange,
|
|
185
|
-
_ref8$config = _ref8.config
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
_config = _objectWithoutProperties(_ref8$
|
|
187
|
+
_ref8$config = _ref8.config,
|
|
188
|
+
_ref8$config2 = _ref8$config === void 0 ? {} : _ref8$config,
|
|
189
|
+
_onChange4 = _ref8$config2.onChange,
|
|
190
|
+
_config = _objectWithoutProperties(_ref8$config2, _excluded13),
|
|
189
191
|
props = _objectWithoutProperties(_ref8, _excluded14);
|
|
190
192
|
return /*#__PURE__*/React.createElement(TreeSelector, _extends({}, props, {
|
|
191
193
|
api: "/api/base/group/sysGroupTree/noAuthReadJurisTree?sclassKey=".concat(props.sclassKey),
|
|
@@ -199,10 +201,10 @@ export var getGroupItem = function getGroupItem(_ref8) {
|
|
|
199
201
|
};
|
|
200
202
|
export var getColorItem = function getColorItem(_ref9) {
|
|
201
203
|
var handleValueChange = _ref9.handleValueChange,
|
|
202
|
-
_ref9$config = _ref9.config
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
_config = _objectWithoutProperties(_ref9$
|
|
204
|
+
_ref9$config = _ref9.config,
|
|
205
|
+
_ref9$config2 = _ref9$config === void 0 ? {} : _ref9$config,
|
|
206
|
+
_onClose = _ref9$config2.onClose,
|
|
207
|
+
_config = _objectWithoutProperties(_ref9$config2, _excluded15),
|
|
206
208
|
props = _objectWithoutProperties(_ref9, _excluded16);
|
|
207
209
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({
|
|
208
210
|
formOptions: {
|
|
@@ -220,10 +222,10 @@ export var getColorItem = function getColorItem(_ref9) {
|
|
|
220
222
|
};
|
|
221
223
|
export var getSwitchItem = function getSwitchItem(_ref10) {
|
|
222
224
|
var handleValueChange = _ref10.handleValueChange,
|
|
223
|
-
_ref10$config = _ref10.config
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
_config = _objectWithoutProperties(_ref10$
|
|
225
|
+
_ref10$config = _ref10.config,
|
|
226
|
+
_ref10$config2 = _ref10$config === void 0 ? {} : _ref10$config,
|
|
227
|
+
_onChange5 = _ref10$config2.onChange,
|
|
228
|
+
_config = _objectWithoutProperties(_ref10$config2, _excluded17),
|
|
227
229
|
props = _objectWithoutProperties(_ref10, _excluded18);
|
|
228
230
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
229
231
|
type: "switch",
|
|
@@ -270,10 +272,10 @@ export var getYearItem = function getYearItem() {
|
|
|
270
272
|
export var getEditorItem = function getEditorItem() {
|
|
271
273
|
var _ref13 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
272
274
|
handleValueChange = _ref13.handleValueChange,
|
|
273
|
-
_ref13$config = _ref13.config
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
_config = _objectWithoutProperties(_ref13$
|
|
275
|
+
_ref13$config = _ref13.config,
|
|
276
|
+
_ref13$config2 = _ref13$config === void 0 ? {} : _ref13$config,
|
|
277
|
+
_onBlur4 = _ref13$config2.onBlur,
|
|
278
|
+
_config = _objectWithoutProperties(_ref13$config2, _excluded21),
|
|
277
279
|
props = _objectWithoutProperties(_ref13, _excluded22);
|
|
278
280
|
return /*#__PURE__*/React.createElement(BasicFormItem, _extends({}, props, {
|
|
279
281
|
type: "editor",
|
|
@@ -289,4 +291,23 @@ export var getEditorItem = function getEditorItem() {
|
|
|
289
291
|
}
|
|
290
292
|
})
|
|
291
293
|
}));
|
|
294
|
+
};
|
|
295
|
+
export var getUploadItem = function getUploadItem() {
|
|
296
|
+
var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
297
|
+
handleValueChange = _ref14.handleValueChange,
|
|
298
|
+
_ref14$config = _ref14.config,
|
|
299
|
+
_ref14$config2 = _ref14$config === void 0 ? {} : _ref14$config,
|
|
300
|
+
_onBlur5 = _ref14$config2.onBlur,
|
|
301
|
+
_config = _objectWithoutProperties(_ref14$config2, _excluded23),
|
|
302
|
+
props = _objectWithoutProperties(_ref14, _excluded24);
|
|
303
|
+
return /*#__PURE__*/React.createElement(UploadFormItemV3, _extends({}, props, {
|
|
304
|
+
config: _objectSpread(_objectSpread({
|
|
305
|
+
listType: 'picture-card'
|
|
306
|
+
}, _config), {}, {
|
|
307
|
+
onBlur: function onBlur(value) {
|
|
308
|
+
handleValueChange && handleValueChange(value);
|
|
309
|
+
_onBlur5 && _onBlur5(value);
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
}));
|
|
292
313
|
};
|
package/es/helper/action.js
CHANGED
|
@@ -111,7 +111,9 @@ export var onBatchSubmitAction = function onBatchSubmitAction(_ref3, callback) {
|
|
|
111
111
|
if (isArray(values[value.id])) {
|
|
112
112
|
_submitData = {
|
|
113
113
|
addList: values[value.id].map(function (item) {
|
|
114
|
-
return dataFormat(gridColumns, item)
|
|
114
|
+
return _objectSpread(_objectSpread({}, dataFormat(gridColumns, item)), {}, {
|
|
115
|
+
indocno: null
|
|
116
|
+
});
|
|
115
117
|
})
|
|
116
118
|
};
|
|
117
119
|
} else {
|
package/es/services.js
CHANGED
|
@@ -9,14 +9,12 @@ export function readModlue(_x) {
|
|
|
9
9
|
function _readModlue() {
|
|
10
10
|
_readModlue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(get) {
|
|
11
11
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12
|
-
while (1) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return _context.stop();
|
|
19
|
-
}
|
|
12
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13
|
+
case 0:
|
|
14
|
+
return _context.abrupt("return", request("".concat(api.LUCKDA_HOST, "/ui/builder/noAuthFetchModule?").concat(stringify(get))));
|
|
15
|
+
case 1:
|
|
16
|
+
case "end":
|
|
17
|
+
return _context.stop();
|
|
20
18
|
}
|
|
21
19
|
}, _callee);
|
|
22
20
|
}));
|
|
@@ -28,17 +26,15 @@ export function readBehaviorCall(_x2, _x3) {
|
|
|
28
26
|
function _readBehaviorCall() {
|
|
29
27
|
_readBehaviorCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(get, post) {
|
|
30
28
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
31
|
-
while (1) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return _context2.stop();
|
|
41
|
-
}
|
|
29
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
return _context2.abrupt("return", request("".concat(api.LUCKDA_HOST, "/to/behavior/call?").concat(stringify(get)), {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
body: post
|
|
34
|
+
}));
|
|
35
|
+
case 1:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context2.stop();
|
|
42
38
|
}
|
|
43
39
|
}, _callee2);
|
|
44
40
|
}));
|
package/es/utils/action.js
CHANGED
|
@@ -13,19 +13,17 @@ function _behaviorCall() {
|
|
|
13
13
|
datasetCode,
|
|
14
14
|
_args = arguments;
|
|
15
15
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return _context.stop();
|
|
28
|
-
}
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
get = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
19
|
+
post = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
20
|
+
datasetCode = get.datasetCode;
|
|
21
|
+
return _context.abrupt("return", readBehaviorCall(_objectSpread(_objectSpread({}, get), {}, {
|
|
22
|
+
datasetCode: datasetCode || Object.keys(post).join(',')
|
|
23
|
+
}), post));
|
|
24
|
+
case 4:
|
|
25
|
+
case "end":
|
|
26
|
+
return _context.stop();
|
|
29
27
|
}
|
|
30
28
|
}, _callee);
|
|
31
29
|
}));
|
package/es/utils/form.js
CHANGED
|
@@ -63,6 +63,7 @@ export var formItemDataFormat = function formItemDataFormat() {
|
|
|
63
63
|
var propsList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
64
64
|
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
65
65
|
var data = transform(propsList, function (result, n) {
|
|
66
|
+
var _values$name, _values$name2;
|
|
66
67
|
var _ref2 = n || {},
|
|
67
68
|
comName = _ref2.comName,
|
|
68
69
|
property = _ref2.property,
|
|
@@ -99,6 +100,9 @@ export var formItemDataFormat = function formItemDataFormat() {
|
|
|
99
100
|
case 'radio':
|
|
100
101
|
result[name] = values[name];
|
|
101
102
|
break;
|
|
103
|
+
case 'upload':
|
|
104
|
+
result[name] = ((_values$name = values[name]) === null || _values$name === void 0 ? void 0 : _values$name.spath) || ((_values$name2 = values[name]) === null || _values$name2 === void 0 ? void 0 : _values$name2.url);
|
|
105
|
+
break;
|
|
102
106
|
default:
|
|
103
107
|
if (!isNil(values["".concat(name, "_virtual")] || values[name])) result[name] = values["".concat(name, "_virtual")] || values[name];
|
|
104
108
|
}
|
package/es/utils/grid.js
CHANGED
|
@@ -2,7 +2,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
var _excluded = ["comName", "property"],
|
|
3
3
|
_excluded2 = ["name"],
|
|
4
4
|
_excluded3 = ["filter", "filterParams"];
|
|
5
|
-
var _getDvaApp;
|
|
6
5
|
import React from "react";
|
|
7
6
|
import { getDvaApp } from 'umi';
|
|
8
7
|
import { merge, isNil, isArray, includes } from 'lodash';
|
|
@@ -10,8 +9,9 @@ import { Switch, Tag } from 'antd';
|
|
|
10
9
|
import moment from 'moment';
|
|
11
10
|
import { defaultComName, translator, formatCustomProps } from '../helper/form';
|
|
12
11
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
// const { dispatch } = getDvaApp()?._store;
|
|
14
|
+
|
|
15
15
|
export function getColumnRender(name, type) {
|
|
16
16
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
17
|
var render = function render(text, record) {
|
|
@@ -130,12 +130,14 @@ export var getGridColumn = function getGridColumn() {
|
|
|
130
130
|
data.filter = 'select';
|
|
131
131
|
data.filterParams = {
|
|
132
132
|
options: function options() {
|
|
133
|
-
|
|
133
|
+
var _getDvaApp, _getDvaApp$_store;
|
|
134
|
+
return (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 ? void 0 : (_getDvaApp$_store = _getDvaApp._store) === null || _getDvaApp$_store === void 0 ? void 0 : _getDvaApp$_store.dispatch({
|
|
134
135
|
type: 'global/getUser'
|
|
135
136
|
});
|
|
136
137
|
},
|
|
137
138
|
searchData: function searchData(str) {
|
|
138
|
-
|
|
139
|
+
var _getDvaApp2, _getDvaApp2$_store;
|
|
140
|
+
return (_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 ? void 0 : (_getDvaApp2$_store = _getDvaApp2._store) === null || _getDvaApp2$_store === void 0 ? void 0 : _getDvaApp2$_store.dispatch({
|
|
139
141
|
type: "global/getUser",
|
|
140
142
|
payload: str
|
|
141
143
|
});
|
|
@@ -152,7 +154,8 @@ export var getGridColumn = function getGridColumn() {
|
|
|
152
154
|
var _props$config3;
|
|
153
155
|
data.filterParams = {
|
|
154
156
|
options: function options() {
|
|
155
|
-
|
|
157
|
+
var _getDvaApp3, _getDvaApp3$_store;
|
|
158
|
+
return (_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 ? void 0 : (_getDvaApp3$_store = _getDvaApp3._store) === null || _getDvaApp3$_store === void 0 ? void 0 : _getDvaApp3$_store.dispatch({
|
|
156
159
|
type: 'global/getDatadic',
|
|
157
160
|
payload: {
|
|
158
161
|
snamealias: _props.alias
|
|
@@ -168,7 +171,8 @@ export var getGridColumn = function getGridColumn() {
|
|
|
168
171
|
data.filter = 'treeSelect';
|
|
169
172
|
data.filterParams = {
|
|
170
173
|
options: function options() {
|
|
171
|
-
|
|
174
|
+
var _getDvaApp4, _getDvaApp4$_store;
|
|
175
|
+
return (_getDvaApp4 = getDvaApp()) === null || _getDvaApp4 === void 0 ? void 0 : (_getDvaApp4$_store = _getDvaApp4._store) === null || _getDvaApp4$_store === void 0 ? void 0 : _getDvaApp4$_store.dispatch({
|
|
172
176
|
type: 'global/readGroup',
|
|
173
177
|
payload: {
|
|
174
178
|
sclassKey: _props.sclassKey
|
|
@@ -176,7 +180,8 @@ export var getGridColumn = function getGridColumn() {
|
|
|
176
180
|
});
|
|
177
181
|
},
|
|
178
182
|
searchData: function searchData(str) {
|
|
179
|
-
|
|
183
|
+
var _getDvaApp5, _getDvaApp5$_store;
|
|
184
|
+
return (_getDvaApp5 = getDvaApp()) === null || _getDvaApp5 === void 0 ? void 0 : (_getDvaApp5$_store = _getDvaApp5._store) === null || _getDvaApp5$_store === void 0 ? void 0 : _getDvaApp5$_store.dispatch({
|
|
180
185
|
type: 'global/readGroup',
|
|
181
186
|
payload: {
|
|
182
187
|
sclassKey: _props.sclassKey,
|
|
@@ -17,7 +17,7 @@ var _FormList = require("@luck-design-biz/base/FormList");
|
|
|
17
17
|
var _ldBuilder = _interopRequireDefault(require("../../helper/ldBuilder"));
|
|
18
18
|
var _utils = require("../../utils");
|
|
19
19
|
var _Builder = require("../Builder");
|
|
20
|
-
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData"];
|
|
20
|
+
var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "formRef", "formMode"];
|
|
21
21
|
var defaultOpe = ['read', 'add', 'update', 'delete'];
|
|
22
22
|
var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
23
23
|
var _ref$columns = _ref.columns,
|
|
@@ -49,6 +49,8 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
49
49
|
} : _ref$defaultDataSourc,
|
|
50
50
|
_ref$ticketData = _ref.ticketData,
|
|
51
51
|
ticketData = _ref$ticketData === void 0 ? {} : _ref$ticketData,
|
|
52
|
+
formRef = _ref.formRef,
|
|
53
|
+
formMode = _ref.formMode,
|
|
52
54
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
55
|
var _ref2 = (0, _react.useContext)(_Builder.LuckDaContext) || {},
|
|
54
56
|
setFieldProps = _ref2.setFieldProps;
|
|
@@ -63,7 +65,12 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
63
65
|
return field.name === col.field;
|
|
64
66
|
}) || {};
|
|
65
67
|
_defaultValues = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, _defaultValues), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, col.field, col['optDefaultValue']), (0, _defineProperty2.default)(_objectSpread2, "".concat(col.field, "_virtual"), col['optDefaultValueCvt']), _objectSpread2));
|
|
66
|
-
result.push((0, _utils.getFormItem)(col, (0, _objectSpread3.default)((0, _objectSpread3.default)({
|
|
68
|
+
result.push((0, _utils.getFormItem)(col, (0, _objectSpread3.default)((0, _objectSpread3.default)({
|
|
69
|
+
formId: ldId,
|
|
70
|
+
moduleCode: moduleCode,
|
|
71
|
+
formRef: formRef,
|
|
72
|
+
formMode: formMode
|
|
73
|
+
}, customFiled), {}, {
|
|
67
74
|
handleValueChange: function handleValueChange(value) {
|
|
68
75
|
return onValueChange((0, _defineProperty2.default)({}, ldId, (0, _defineProperty2.default)({}, col.field, value)));
|
|
69
76
|
}
|
|
@@ -93,11 +100,13 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
|
|
|
93
100
|
return (0, _utils.behaviorCall)(get, post, formData);
|
|
94
101
|
},
|
|
95
102
|
get: function get() {
|
|
96
|
-
|
|
103
|
+
var _get = {
|
|
97
104
|
moduleCode: moduleCode,
|
|
98
105
|
datasetCode: dataSetKey,
|
|
99
106
|
behaviorKey: behaviorKey
|
|
100
107
|
};
|
|
108
|
+
if (!isMain) _get.relationDs = mainDataSetKey;
|
|
109
|
+
return _get;
|
|
101
110
|
}
|
|
102
111
|
}, _onOperate), {}, {
|
|
103
112
|
post: function post(_ref3) {
|
|
@@ -88,8 +88,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
88
88
|
var _ref5 = formListRef.current || {},
|
|
89
89
|
formRefs = _ref5.formRefs;
|
|
90
90
|
var data = formRefs && Object.keys(formRefs).map(function (key) {
|
|
91
|
-
var _formRefs$key$current;
|
|
92
|
-
var getValue = formRefs[key].getData || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
91
|
+
var _formRefs$key, _formRefs$key$formRef, _formRefs$key$current;
|
|
92
|
+
var getValue = (((_formRefs$key = formRefs[key]) === null || _formRefs$key === void 0 ? void 0 : (_formRefs$key$formRef = _formRefs$key.formRef) === null || _formRefs$key$formRef === void 0 ? void 0 : _formRefs$key$formRef.current) ? formRefs[key].getData : null) || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
|
|
93
93
|
return (0, _defineProperty2.default)({}, key, getValue && getValue());
|
|
94
94
|
});
|
|
95
95
|
onValueChange(change, data);
|
|
@@ -201,19 +201,21 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
201
201
|
var _props$type = _props.type,
|
|
202
202
|
type = _props$type === void 0 ? 'auto' : _props$type;
|
|
203
203
|
var renderForm = type === 'auto' ? _LdAutoForm.default : _LdGridForm.default;
|
|
204
|
-
if (header === 'collapse') return /*#__PURE__*/_react.default.createElement(_base.Collapse, {
|
|
204
|
+
if (header === 'collapse' || header === 'collapseFollow') return /*#__PURE__*/_react.default.createElement(_base.Collapse, {
|
|
205
205
|
title: title || ldId,
|
|
206
206
|
extra: renderExtra(ldId, extraConfig),
|
|
207
207
|
id: ldId,
|
|
208
208
|
key: ldId,
|
|
209
|
-
mode: ldId !== mainFormLdId && 'tab'
|
|
209
|
+
mode: header === 'collapse' && ldId !== mainFormLdId && 'tab'
|
|
210
210
|
}, renderForm((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _props), {}, {
|
|
211
211
|
ldId: ldId,
|
|
212
212
|
mainFormLdId: mainFormLdId,
|
|
213
213
|
mainDataSetKey: mainDataSetKey,
|
|
214
214
|
readOnly: readOnly || _readOnly,
|
|
215
215
|
onValueChange: handleValueChange,
|
|
216
|
-
ticketData: props.ticketData
|
|
216
|
+
ticketData: props.ticketData,
|
|
217
|
+
formRef: formListRef,
|
|
218
|
+
formMode: formMode
|
|
217
219
|
})));
|
|
218
220
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
219
221
|
key: ldId
|
|
@@ -230,7 +232,9 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
230
232
|
mainDataSetKey: mainDataSetKey,
|
|
231
233
|
readOnly: readOnly || _readOnly,
|
|
232
234
|
onValueChange: handleValueChange,
|
|
233
|
-
ticketData: props.ticketData
|
|
235
|
+
ticketData: props.ticketData,
|
|
236
|
+
formRef: formListRef,
|
|
237
|
+
formMode: formMode
|
|
234
238
|
})));
|
|
235
239
|
}), _utils.ChildrenUtil.deepMap(renderFormExtra(formConfig), function (child) {
|
|
236
240
|
var _child$type;
|
|
@@ -114,16 +114,20 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
|
|
|
114
114
|
return (0, _utils.behaviorCall)((0, _objectSpread4.default)((0, _objectSpread4.default)({}, get), {}, (0, _defineProperty2.default)({}, isMain ? 'indocno' : 'relationId', ((_formData$mainFormLdI = formData[mainFormLdId]) === null || _formData$mainFormLdI === void 0 ? void 0 : _formData$mainFormLdI.indocno) || ticketData.indocno)), post, formData);
|
|
115
115
|
},
|
|
116
116
|
get: function get() {
|
|
117
|
-
|
|
117
|
+
var _get = {
|
|
118
118
|
moduleCode: moduleCode,
|
|
119
119
|
datasetCode: dataSetKey,
|
|
120
120
|
behaviorKey: behaviorKey
|
|
121
121
|
};
|
|
122
|
+
if (!isMain) _get.relationDs = mainDataSetKey;
|
|
123
|
+
return _get;
|
|
122
124
|
}
|
|
123
125
|
}, _onOperate), {}, {
|
|
124
126
|
post: function post(data) {
|
|
125
127
|
var _submitData = data.map(function (item) {
|
|
126
|
-
return (0, _utils.dataFormat)(gridColumns, item)
|
|
128
|
+
return behaviorKey === 'add' ? (0, _objectSpread4.default)((0, _objectSpread4.default)({}, (0, _utils.dataFormat)(gridColumns, item)), {}, {
|
|
129
|
+
indocno: null
|
|
130
|
+
}) : (0, _utils.dataFormat)(gridColumns, item);
|
|
127
131
|
});
|
|
128
132
|
if (_onOperate === null || _onOperate === void 0 ? void 0 : _onOperate.post) return _onOperate.post(_submitData); // 以预设为主
|
|
129
133
|
return (0, _defineProperty2.default)({}, dataSetKey, (0, _defineProperty2.default)({}, "".concat(behaviorKey, "List"), _submitData));
|
package/lib/helper/FromItems.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getYearItem = exports.getUserItem = exports.getTextareaItem = exports.getSwitchItem = exports.getStringItem = exports.getSelectItem = exports.getRegionItem = exports.getRadioItem = exports.getNumberItem = exports.getGroupItem = exports.getEditorItem = exports.getDateItem = exports.getColorItem = void 0;
|
|
8
|
+
exports.getYearItem = exports.getUserItem = exports.getUploadItem = exports.getTextareaItem = exports.getSwitchItem = exports.getStringItem = exports.getSelectItem = exports.getRegionItem = exports.getRadioItem = exports.getNumberItem = exports.getGroupItem = exports.getEditorItem = exports.getDateItem = exports.getColorItem = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -36,14 +36,16 @@ var _excluded = ["onBlur"],
|
|
|
36
36
|
_excluded19 = ["handleValueChange"],
|
|
37
37
|
_excluded20 = ["handleValueChange", "config"],
|
|
38
38
|
_excluded21 = ["onBlur"],
|
|
39
|
-
_excluded22 = ["handleValueChange", "config"]
|
|
39
|
+
_excluded22 = ["handleValueChange", "config"],
|
|
40
|
+
_excluded23 = ["onBlur"],
|
|
41
|
+
_excluded24 = ["handleValueChange", "config"];
|
|
40
42
|
var getNumberItem = function getNumberItem() {
|
|
41
43
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
42
44
|
handleValueChange = _ref.handleValueChange,
|
|
43
|
-
_ref$config = _ref.config
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_config = (0, _objectWithoutProperties2.default)(_ref$
|
|
45
|
+
_ref$config = _ref.config,
|
|
46
|
+
_ref$config2 = _ref$config === void 0 ? {} : _ref$config,
|
|
47
|
+
_onBlur = _ref$config2.onBlur,
|
|
48
|
+
_config = (0, _objectWithoutProperties2.default)(_ref$config2, _excluded),
|
|
47
49
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded2);
|
|
48
50
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
49
51
|
type: "input",
|
|
@@ -59,10 +61,10 @@ var getNumberItem = function getNumberItem() {
|
|
|
59
61
|
exports.getNumberItem = getNumberItem;
|
|
60
62
|
var getStringItem = function getStringItem(_ref2) {
|
|
61
63
|
var handleValueChange = _ref2.handleValueChange,
|
|
62
|
-
_ref2$config = _ref2.config
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_config = (0, _objectWithoutProperties2.default)(_ref2$
|
|
64
|
+
_ref2$config = _ref2.config,
|
|
65
|
+
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
66
|
+
_onBlur2 = _ref2$config2.onBlur,
|
|
67
|
+
_config = (0, _objectWithoutProperties2.default)(_ref2$config2, _excluded3),
|
|
66
68
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded4);
|
|
67
69
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
68
70
|
config: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _config), {}, {
|
|
@@ -78,10 +80,10 @@ exports.getStringItem = getStringItem;
|
|
|
78
80
|
var getTextareaItem = function getTextareaItem() {
|
|
79
81
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
80
82
|
handleValueChange = _ref3.handleValueChange,
|
|
81
|
-
_ref3$config = _ref3.config
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
_config = (0, _objectWithoutProperties2.default)(_ref3$
|
|
83
|
+
_ref3$config = _ref3.config,
|
|
84
|
+
_ref3$config2 = _ref3$config === void 0 ? {} : _ref3$config,
|
|
85
|
+
_onBlur3 = _ref3$config2.onBlur,
|
|
86
|
+
_config = (0, _objectWithoutProperties2.default)(_ref3$config2, _excluded5),
|
|
85
87
|
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded6);
|
|
86
88
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
87
89
|
type: "input",
|
|
@@ -98,10 +100,10 @@ exports.getTextareaItem = getTextareaItem;
|
|
|
98
100
|
var getDateItem = function getDateItem() {
|
|
99
101
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
100
102
|
handleValueChange = _ref4.handleValueChange,
|
|
101
|
-
_ref4$config = _ref4.config
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
_config = (0, _objectWithoutProperties2.default)(_ref4$
|
|
103
|
+
_ref4$config = _ref4.config,
|
|
104
|
+
_ref4$config2 = _ref4$config === void 0 ? {} : _ref4$config,
|
|
105
|
+
_onChange = _ref4$config2.onChange,
|
|
106
|
+
_config = (0, _objectWithoutProperties2.default)(_ref4$config2, _excluded7),
|
|
105
107
|
props = (0, _objectWithoutProperties2.default)(_ref4, _excluded8);
|
|
106
108
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
107
109
|
type: "datePicker",
|
|
@@ -129,10 +131,10 @@ var getUserItem = function getUserItem(_ref5) {
|
|
|
129
131
|
exports.getUserItem = getUserItem;
|
|
130
132
|
var getSelectItem = function getSelectItem(_ref6) {
|
|
131
133
|
var handleValueChange = _ref6.handleValueChange,
|
|
132
|
-
_ref6$config = _ref6.config
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
_config = (0, _objectWithoutProperties2.default)(_ref6$
|
|
134
|
+
_ref6$config = _ref6.config,
|
|
135
|
+
_ref6$config2 = _ref6$config === void 0 ? {} : _ref6$config,
|
|
136
|
+
_onChange3 = _ref6$config2.onChange,
|
|
137
|
+
_config = (0, _objectWithoutProperties2.default)(_ref6$config2, _excluded10),
|
|
136
138
|
props = (0, _objectWithoutProperties2.default)(_ref6, _excluded11);
|
|
137
139
|
var config = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _config), {}, {
|
|
138
140
|
onChange: function onChange(value, e) {
|
|
@@ -197,10 +199,10 @@ var getRadioItem = function getRadioItem() {
|
|
|
197
199
|
exports.getRadioItem = getRadioItem;
|
|
198
200
|
var getGroupItem = function getGroupItem(_ref8) {
|
|
199
201
|
var handleValueChange = _ref8.handleValueChange,
|
|
200
|
-
_ref8$config = _ref8.config
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
_config = (0, _objectWithoutProperties2.default)(_ref8$
|
|
202
|
+
_ref8$config = _ref8.config,
|
|
203
|
+
_ref8$config2 = _ref8$config === void 0 ? {} : _ref8$config,
|
|
204
|
+
_onChange4 = _ref8$config2.onChange,
|
|
205
|
+
_config = (0, _objectWithoutProperties2.default)(_ref8$config2, _excluded13),
|
|
204
206
|
props = (0, _objectWithoutProperties2.default)(_ref8, _excluded14);
|
|
205
207
|
return /*#__PURE__*/_react.default.createElement(_base.TreeSelector, (0, _extends2.default)({}, props, {
|
|
206
208
|
api: "/api/base/group/sysGroupTree/noAuthReadJurisTree?sclassKey=".concat(props.sclassKey),
|
|
@@ -215,10 +217,10 @@ var getGroupItem = function getGroupItem(_ref8) {
|
|
|
215
217
|
exports.getGroupItem = getGroupItem;
|
|
216
218
|
var getColorItem = function getColorItem(_ref9) {
|
|
217
219
|
var handleValueChange = _ref9.handleValueChange,
|
|
218
|
-
_ref9$config = _ref9.config
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
_config = (0, _objectWithoutProperties2.default)(_ref9$
|
|
220
|
+
_ref9$config = _ref9.config,
|
|
221
|
+
_ref9$config2 = _ref9$config === void 0 ? {} : _ref9$config,
|
|
222
|
+
_onClose = _ref9$config2.onClose,
|
|
223
|
+
_config = (0, _objectWithoutProperties2.default)(_ref9$config2, _excluded15),
|
|
222
224
|
props = (0, _objectWithoutProperties2.default)(_ref9, _excluded16);
|
|
223
225
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({
|
|
224
226
|
formOptions: {
|
|
@@ -237,10 +239,10 @@ var getColorItem = function getColorItem(_ref9) {
|
|
|
237
239
|
exports.getColorItem = getColorItem;
|
|
238
240
|
var getSwitchItem = function getSwitchItem(_ref10) {
|
|
239
241
|
var handleValueChange = _ref10.handleValueChange,
|
|
240
|
-
_ref10$config = _ref10.config
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
_config = (0, _objectWithoutProperties2.default)(_ref10$
|
|
242
|
+
_ref10$config = _ref10.config,
|
|
243
|
+
_ref10$config2 = _ref10$config === void 0 ? {} : _ref10$config,
|
|
244
|
+
_onChange5 = _ref10$config2.onChange,
|
|
245
|
+
_config = (0, _objectWithoutProperties2.default)(_ref10$config2, _excluded17),
|
|
244
246
|
props = (0, _objectWithoutProperties2.default)(_ref10, _excluded18);
|
|
245
247
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
246
248
|
type: "switch",
|
|
@@ -290,10 +292,10 @@ exports.getYearItem = getYearItem;
|
|
|
290
292
|
var getEditorItem = function getEditorItem() {
|
|
291
293
|
var _ref13 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
292
294
|
handleValueChange = _ref13.handleValueChange,
|
|
293
|
-
_ref13$config = _ref13.config
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
_config = (0, _objectWithoutProperties2.default)(_ref13$
|
|
295
|
+
_ref13$config = _ref13.config,
|
|
296
|
+
_ref13$config2 = _ref13$config === void 0 ? {} : _ref13$config,
|
|
297
|
+
_onBlur4 = _ref13$config2.onBlur,
|
|
298
|
+
_config = (0, _objectWithoutProperties2.default)(_ref13$config2, _excluded21),
|
|
297
299
|
props = (0, _objectWithoutProperties2.default)(_ref13, _excluded22);
|
|
298
300
|
return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({}, props, {
|
|
299
301
|
type: "editor",
|
|
@@ -310,4 +312,24 @@ var getEditorItem = function getEditorItem() {
|
|
|
310
312
|
})
|
|
311
313
|
}));
|
|
312
314
|
};
|
|
313
|
-
exports.getEditorItem = getEditorItem;
|
|
315
|
+
exports.getEditorItem = getEditorItem;
|
|
316
|
+
var getUploadItem = function getUploadItem() {
|
|
317
|
+
var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
318
|
+
handleValueChange = _ref14.handleValueChange,
|
|
319
|
+
_ref14$config = _ref14.config,
|
|
320
|
+
_ref14$config2 = _ref14$config === void 0 ? {} : _ref14$config,
|
|
321
|
+
_onBlur5 = _ref14$config2.onBlur,
|
|
322
|
+
_config = (0, _objectWithoutProperties2.default)(_ref14$config2, _excluded23),
|
|
323
|
+
props = (0, _objectWithoutProperties2.default)(_ref14, _excluded24);
|
|
324
|
+
return /*#__PURE__*/_react.default.createElement(_base.UploadFormItemV3, (0, _extends2.default)({}, props, {
|
|
325
|
+
config: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
326
|
+
listType: 'picture-card'
|
|
327
|
+
}, _config), {}, {
|
|
328
|
+
onBlur: function onBlur(value) {
|
|
329
|
+
handleValueChange && handleValueChange(value);
|
|
330
|
+
_onBlur5 && _onBlur5(value);
|
|
331
|
+
}
|
|
332
|
+
})
|
|
333
|
+
}));
|
|
334
|
+
};
|
|
335
|
+
exports.getUploadItem = getUploadItem;
|
package/lib/helper/action.js
CHANGED
|
@@ -119,7 +119,9 @@ var onBatchSubmitAction = function onBatchSubmitAction(_ref3, callback) {
|
|
|
119
119
|
if ((0, _lodash.isArray)(values[value.id])) {
|
|
120
120
|
_submitData = {
|
|
121
121
|
addList: values[value.id].map(function (item) {
|
|
122
|
-
return (0, _utils2.dataFormat)(gridColumns, item)
|
|
122
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _utils2.dataFormat)(gridColumns, item)), {}, {
|
|
123
|
+
indocno: null
|
|
124
|
+
});
|
|
123
125
|
})
|
|
124
126
|
};
|
|
125
127
|
} else {
|
package/lib/services.js
CHANGED
|
@@ -17,14 +17,12 @@ function readModlue(_x) {
|
|
|
17
17
|
function _readModlue() {
|
|
18
18
|
_readModlue = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(get) {
|
|
19
19
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
20
|
-
while (1) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _context.stop();
|
|
27
|
-
}
|
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21
|
+
case 0:
|
|
22
|
+
return _context.abrupt("return", (0, _utils.request)("".concat(_ApiConfig.default.LUCKDA_HOST, "/ui/builder/noAuthFetchModule?").concat((0, _querystring.stringify)(get))));
|
|
23
|
+
case 1:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
28
26
|
}
|
|
29
27
|
}, _callee);
|
|
30
28
|
}));
|
|
@@ -36,17 +34,15 @@ function readBehaviorCall(_x2, _x3) {
|
|
|
36
34
|
function _readBehaviorCall() {
|
|
37
35
|
_readBehaviorCall = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(get, post) {
|
|
38
36
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
39
|
-
while (1) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return _context2.stop();
|
|
49
|
-
}
|
|
37
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
return _context2.abrupt("return", (0, _utils.request)("".concat(_ApiConfig.default.LUCKDA_HOST, "/to/behavior/call?").concat((0, _querystring.stringify)(get)), {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
body: post
|
|
42
|
+
}));
|
|
43
|
+
case 1:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context2.stop();
|
|
50
46
|
}
|
|
51
47
|
}, _callee2);
|
|
52
48
|
}));
|
package/lib/utils/action.js
CHANGED
|
@@ -20,19 +20,17 @@ function _behaviorCall() {
|
|
|
20
20
|
datasetCode,
|
|
21
21
|
_args = arguments;
|
|
22
22
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
23
|
-
while (1) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _context.stop();
|
|
35
|
-
}
|
|
23
|
+
while (1) switch (_context.prev = _context.next) {
|
|
24
|
+
case 0:
|
|
25
|
+
get = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
26
|
+
post = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
27
|
+
datasetCode = get.datasetCode;
|
|
28
|
+
return _context.abrupt("return", (0, _services.readBehaviorCall)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, get), {}, {
|
|
29
|
+
datasetCode: datasetCode || Object.keys(post).join(',')
|
|
30
|
+
}), post));
|
|
31
|
+
case 4:
|
|
32
|
+
case "end":
|
|
33
|
+
return _context.stop();
|
|
36
34
|
}
|
|
37
35
|
}, _callee);
|
|
38
36
|
}));
|
package/lib/utils/form.js
CHANGED
|
@@ -71,6 +71,7 @@ var formItemDataFormat = function formItemDataFormat() {
|
|
|
71
71
|
var propsList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
72
72
|
var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
73
73
|
var data = (0, _lodash.transform)(propsList, function (result, n) {
|
|
74
|
+
var _values$name, _values$name2;
|
|
74
75
|
var _ref2 = n || {},
|
|
75
76
|
comName = _ref2.comName,
|
|
76
77
|
property = _ref2.property,
|
|
@@ -107,6 +108,9 @@ var formItemDataFormat = function formItemDataFormat() {
|
|
|
107
108
|
case 'radio':
|
|
108
109
|
result[name] = values[name];
|
|
109
110
|
break;
|
|
111
|
+
case 'upload':
|
|
112
|
+
result[name] = ((_values$name = values[name]) === null || _values$name === void 0 ? void 0 : _values$name.spath) || ((_values$name2 = values[name]) === null || _values$name2 === void 0 ? void 0 : _values$name2.url);
|
|
113
|
+
break;
|
|
110
114
|
default:
|
|
111
115
|
if (!(0, _lodash.isNil)(values["".concat(name, "_virtual")] || values[name])) result[name] = values["".concat(name, "_virtual")] || values[name];
|
|
112
116
|
}
|
package/lib/utils/grid.js
CHANGED
|
@@ -17,9 +17,8 @@ var _utils = require("@luck-design-biz/base/utils");
|
|
|
17
17
|
var _excluded = ["comName", "property"],
|
|
18
18
|
_excluded2 = ["name"],
|
|
19
19
|
_excluded3 = ["filter", "filterParams"];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dispatch = _getDvaApp$_store.dispatch;
|
|
20
|
+
// const { dispatch } = getDvaApp()?._store;
|
|
21
|
+
|
|
23
22
|
function getColumnRender(name, type) {
|
|
24
23
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
25
24
|
var render = function render(text, record) {
|
|
@@ -138,12 +137,14 @@ var getGridColumn = function getGridColumn() {
|
|
|
138
137
|
data.filter = 'select';
|
|
139
138
|
data.filterParams = {
|
|
140
139
|
options: function options() {
|
|
141
|
-
|
|
140
|
+
var _getDvaApp, _getDvaApp$_store;
|
|
141
|
+
return (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 ? void 0 : (_getDvaApp$_store = _getDvaApp._store) === null || _getDvaApp$_store === void 0 ? void 0 : _getDvaApp$_store.dispatch({
|
|
142
142
|
type: 'global/getUser'
|
|
143
143
|
});
|
|
144
144
|
},
|
|
145
145
|
searchData: function searchData(str) {
|
|
146
|
-
|
|
146
|
+
var _getDvaApp2, _getDvaApp2$_store;
|
|
147
|
+
return (_getDvaApp2 = (0, _umi.getDvaApp)()) === null || _getDvaApp2 === void 0 ? void 0 : (_getDvaApp2$_store = _getDvaApp2._store) === null || _getDvaApp2$_store === void 0 ? void 0 : _getDvaApp2$_store.dispatch({
|
|
147
148
|
type: "global/getUser",
|
|
148
149
|
payload: str
|
|
149
150
|
});
|
|
@@ -160,7 +161,8 @@ var getGridColumn = function getGridColumn() {
|
|
|
160
161
|
var _props$config3;
|
|
161
162
|
data.filterParams = {
|
|
162
163
|
options: function options() {
|
|
163
|
-
|
|
164
|
+
var _getDvaApp3, _getDvaApp3$_store;
|
|
165
|
+
return (_getDvaApp3 = (0, _umi.getDvaApp)()) === null || _getDvaApp3 === void 0 ? void 0 : (_getDvaApp3$_store = _getDvaApp3._store) === null || _getDvaApp3$_store === void 0 ? void 0 : _getDvaApp3$_store.dispatch({
|
|
164
166
|
type: 'global/getDatadic',
|
|
165
167
|
payload: {
|
|
166
168
|
snamealias: _props.alias
|
|
@@ -176,7 +178,8 @@ var getGridColumn = function getGridColumn() {
|
|
|
176
178
|
data.filter = 'treeSelect';
|
|
177
179
|
data.filterParams = {
|
|
178
180
|
options: function options() {
|
|
179
|
-
|
|
181
|
+
var _getDvaApp4, _getDvaApp4$_store;
|
|
182
|
+
return (_getDvaApp4 = (0, _umi.getDvaApp)()) === null || _getDvaApp4 === void 0 ? void 0 : (_getDvaApp4$_store = _getDvaApp4._store) === null || _getDvaApp4$_store === void 0 ? void 0 : _getDvaApp4$_store.dispatch({
|
|
180
183
|
type: 'global/readGroup',
|
|
181
184
|
payload: {
|
|
182
185
|
sclassKey: _props.sclassKey
|
|
@@ -184,7 +187,8 @@ var getGridColumn = function getGridColumn() {
|
|
|
184
187
|
});
|
|
185
188
|
},
|
|
186
189
|
searchData: function searchData(str) {
|
|
187
|
-
|
|
190
|
+
var _getDvaApp5, _getDvaApp5$_store;
|
|
191
|
+
return (_getDvaApp5 = (0, _umi.getDvaApp)()) === null || _getDvaApp5 === void 0 ? void 0 : (_getDvaApp5$_store = _getDvaApp5._store) === null || _getDvaApp5$_store === void 0 ? void 0 : _getDvaApp5$_store.dispatch({
|
|
188
192
|
type: 'global/readGroup',
|
|
189
193
|
payload: {
|
|
190
194
|
sclassKey: _props.sclassKey,
|