@luck-design-biz/luckda 0.0.16-8 → 0.0.16-9
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.
|
@@ -6,17 +6,17 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
|
-
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra"],
|
|
9
|
+
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps"],
|
|
10
10
|
_excluded2 = ["dataSets", "doAction", "resources"],
|
|
11
11
|
_excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft"],
|
|
12
12
|
_excluded4 = ["ldId", "initData", "overModel"];
|
|
13
|
-
import React, {
|
|
13
|
+
import React, { forwardRef, Fragment, useContext, useImperativeHandle, useRef, useState } from 'react';
|
|
14
14
|
import { connect, getDvaApp, useRouteMatch } from 'umi';
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
16
|
-
import { useCreation, useMemoizedFn
|
|
16
|
+
import { useAsyncEffect, useCreation, useMemoizedFn } from 'ahooks';
|
|
17
17
|
import { BasicDivider } from 'luck-design';
|
|
18
18
|
import { ChildrenUtil } from '@luck-design-biz/base/utils';
|
|
19
|
-
import { FormList, FormListAffix
|
|
19
|
+
import { FormBtn, FormList, FormListAffix } from '@luck-design-biz/base/FormList';
|
|
20
20
|
import buildLdAutoForm from '../LdAutoForm';
|
|
21
21
|
import buildLdGridForm from '../LdGridForm';
|
|
22
22
|
import { Collapse } from '@luck-design-biz/base';
|
|
@@ -24,7 +24,7 @@ import { LuckDaContext } from '../Builder';
|
|
|
24
24
|
import { LuckDaPopContext } from '../LdPop';
|
|
25
25
|
import createModel from './model';
|
|
26
26
|
import { onBatchSubmitAction } from '../../helper/action';
|
|
27
|
-
import { isArray,
|
|
27
|
+
import { isArray, mapValues, sortBy } from 'lodash';
|
|
28
28
|
import { BpmButton } from '@luck-design-biz/base/bpm';
|
|
29
29
|
import { readBehaviorCall } from '../../services';
|
|
30
30
|
|
|
@@ -53,6 +53,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
53
53
|
renderFormExtra = _ref$renderFormExtra === void 0 ? function () {
|
|
54
54
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
55
55
|
} : _ref$renderFormExtra,
|
|
56
|
+
_ref$bpmButtonProps = _ref.bpmButtonProps,
|
|
57
|
+
bpmButtonProps = _ref$bpmButtonProps === void 0 ? {} : _ref$bpmButtonProps,
|
|
56
58
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
var _useState = useState(false),
|
|
58
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -110,10 +112,10 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
110
112
|
|
|
111
113
|
/**zss添加**/
|
|
112
114
|
var renderAffixRightCustom = function renderAffixRightCustom() {
|
|
113
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderAffixRight && renderAffixRight(), /*#__PURE__*/React.createElement(BpmButton, {
|
|
115
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderAffixRight && renderAffixRight(), /*#__PURE__*/React.createElement(BpmButton, _extends({
|
|
114
116
|
bizData: bizData,
|
|
115
117
|
suppressDept: false
|
|
116
|
-
}));
|
|
118
|
+
}, bpmButtonProps)));
|
|
117
119
|
};
|
|
118
120
|
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
119
121
|
var _props$ticketData, _params, response, _yield$readBehaviorCa, code, data, _props$ticketData2, _props$ticketData3, bpmInfoObj, tempObj;
|
|
@@ -149,7 +151,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
149
151
|
data = _yield$readBehaviorCa.data;
|
|
150
152
|
if (code == 1 && data) {
|
|
151
153
|
bpmInfoObj = data.bpmInfo;
|
|
152
|
-
tempObj = {
|
|
154
|
+
tempObj = _objectSpread(_objectSpread({}, props.formData[mainFormLdId]), {}, {
|
|
153
155
|
bizKey: bpmInfoObj.bizKey,
|
|
154
156
|
sname: bpmInfoObj.name,
|
|
155
157
|
modelKey: bpmInfoObj.bpmKey,
|
|
@@ -157,7 +159,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
157
159
|
moduleCode: rest.moduleCode,
|
|
158
160
|
datasetCode: mainDataSetKey,
|
|
159
161
|
indocno: (_props$ticketData3 = props.ticketData) === null || _props$ticketData3 === void 0 ? void 0 : _props$ticketData3.indocno
|
|
160
|
-
};
|
|
162
|
+
});
|
|
161
163
|
setBizData(tempObj);
|
|
162
164
|
setIsCustomRenderAffixRight(true);
|
|
163
165
|
}
|
|
@@ -166,7 +168,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
166
168
|
return _context.stop();
|
|
167
169
|
}
|
|
168
170
|
}, _callee);
|
|
169
|
-
})), []);
|
|
171
|
+
})), [props.formData]);
|
|
170
172
|
var handleBatchSubmit = function handleBatchSubmit(values, action) {
|
|
171
173
|
var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
172
174
|
formCode = _ref7.formCode,
|
package/es/utils/grid.js
CHANGED
|
@@ -31,7 +31,7 @@ var _action = require("../../helper/action");
|
|
|
31
31
|
var _lodash = require("lodash");
|
|
32
32
|
var _bpm = require("@luck-design-biz/base/bpm");
|
|
33
33
|
var _services = require("../../services");
|
|
34
|
-
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra"],
|
|
34
|
+
var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps"],
|
|
35
35
|
_excluded2 = ["dataSets", "doAction", "resources"],
|
|
36
36
|
_excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft"],
|
|
37
37
|
_excluded4 = ["ldId", "initData", "overModel"];
|
|
@@ -60,6 +60,8 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
60
60
|
renderFormExtra = _ref$renderFormExtra === void 0 ? function () {
|
|
61
61
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
62
62
|
} : _ref$renderFormExtra,
|
|
63
|
+
_ref$bpmButtonProps = _ref.bpmButtonProps,
|
|
64
|
+
bpmButtonProps = _ref$bpmButtonProps === void 0 ? {} : _ref$bpmButtonProps,
|
|
63
65
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
64
66
|
var _useState = (0, _react.useState)(false),
|
|
65
67
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -117,10 +119,10 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
117
119
|
|
|
118
120
|
/**zss添加**/
|
|
119
121
|
var renderAffixRightCustom = function renderAffixRightCustom() {
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderAffixRight && renderAffixRight(), /*#__PURE__*/_react.default.createElement(_bpm.BpmButton, {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderAffixRight && renderAffixRight(), /*#__PURE__*/_react.default.createElement(_bpm.BpmButton, (0, _extends2.default)({
|
|
121
123
|
bizData: bizData,
|
|
122
124
|
suppressDept: false
|
|
123
|
-
}));
|
|
125
|
+
}, bpmButtonProps)));
|
|
124
126
|
};
|
|
125
127
|
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
126
128
|
var _props$ticketData, _params, response, _yield$readBehaviorCa, code, data, _props$ticketData2, _props$ticketData3, bpmInfoObj, tempObj;
|
|
@@ -156,7 +158,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
156
158
|
data = _yield$readBehaviorCa.data;
|
|
157
159
|
if (code == 1 && data) {
|
|
158
160
|
bpmInfoObj = data.bpmInfo;
|
|
159
|
-
tempObj = {
|
|
161
|
+
tempObj = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props.formData[mainFormLdId]), {}, {
|
|
160
162
|
bizKey: bpmInfoObj.bizKey,
|
|
161
163
|
sname: bpmInfoObj.name,
|
|
162
164
|
modelKey: bpmInfoObj.bpmKey,
|
|
@@ -164,7 +166,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
164
166
|
moduleCode: rest.moduleCode,
|
|
165
167
|
datasetCode: mainDataSetKey,
|
|
166
168
|
indocno: (_props$ticketData3 = props.ticketData) === null || _props$ticketData3 === void 0 ? void 0 : _props$ticketData3.indocno
|
|
167
|
-
};
|
|
169
|
+
});
|
|
168
170
|
setBizData(tempObj);
|
|
169
171
|
setIsCustomRenderAffixRight(true);
|
|
170
172
|
}
|
|
@@ -173,7 +175,7 @@ var LdFormList = function LdFormList(_ref) {
|
|
|
173
175
|
return _context.stop();
|
|
174
176
|
}
|
|
175
177
|
}, _callee);
|
|
176
|
-
})), []);
|
|
178
|
+
})), [props.formData]);
|
|
177
179
|
var handleBatchSubmit = function handleBatchSubmit(values, action) {
|
|
178
180
|
var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
179
181
|
formCode = _ref7.formCode,
|
package/lib/utils/grid.js
CHANGED
|
@@ -88,7 +88,7 @@ function getColumnRender(name, type) {
|
|
|
88
88
|
name: file.origFileName,
|
|
89
89
|
previewUrl: "".concat(_ApiConfig.default.LUCKDA_HOST).concat(file.previewUrl)
|
|
90
90
|
};
|
|
91
|
-
});
|
|
91
|
+
});
|
|
92
92
|
return /*#__PURE__*/_react.default.createElement(_GridCell.default, {
|
|
93
93
|
fileList: fileList
|
|
94
94
|
});
|