ls-pro-common 3.1.54 → 3.1.55
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/dist/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/InputTable.js +12 -4
- package/lib/components/InputTable.js +12 -4
- package/package.json +1 -1
|
@@ -7,10 +7,10 @@ import _Popover from "antd/es/popover";
|
|
|
7
7
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
8
8
|
import "antd/es/button/style";
|
|
9
9
|
import _Button from "antd/es/button";
|
|
10
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
11
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
12
11
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
13
12
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
13
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
14
14
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
15
15
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
16
16
|
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer", "placement", "arrowPointAtCenter", "method", "changeOnSelect", "rowKey", "record", "id"],
|
|
@@ -42,6 +42,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
42
42
|
setText = _useState6[1];
|
|
43
43
|
var inputRef = useRef();
|
|
44
44
|
var initRows = useRef(null); //用于存储初始行数据
|
|
45
|
+
var firstMount = useRef(true);
|
|
45
46
|
var columns = prop.columns,
|
|
46
47
|
url = prop.url,
|
|
47
48
|
textName = prop.textName,
|
|
@@ -144,10 +145,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
144
145
|
if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
|
|
145
146
|
if (rowKey) {
|
|
146
147
|
var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
|
|
147
|
-
if (
|
|
148
|
-
|
|
148
|
+
if (firstMount.current && record) {
|
|
149
|
+
firstMount.current = false;
|
|
150
|
+
return record;
|
|
151
|
+
}
|
|
152
|
+
return _objectSpread(_objectSpread({}, record || {}), (formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]) || {});
|
|
149
153
|
}
|
|
150
|
-
|
|
151
154
|
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
|
|
152
155
|
};
|
|
153
156
|
/**
|
|
@@ -158,6 +161,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
158
161
|
var setFormValue = function setFormValue(formValue) {
|
|
159
162
|
var _prop$onChange;
|
|
160
163
|
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
|
|
164
|
+
for (var key in formValue) {
|
|
165
|
+
if (formValue[key] === null) {
|
|
166
|
+
formValue[key] = undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
161
169
|
if (rowKey) {
|
|
162
170
|
var _formRef$current3, _formRef$current3$set;
|
|
163
171
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
|
|
@@ -7,10 +7,10 @@ import _Popover from "antd/es/popover";
|
|
|
7
7
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
8
8
|
import "antd/es/button/style";
|
|
9
9
|
import _Button from "antd/es/button";
|
|
10
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
11
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
12
11
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
13
12
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
13
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
14
14
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
15
15
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
16
16
|
var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer", "placement", "arrowPointAtCenter", "method", "changeOnSelect", "rowKey", "record", "id"],
|
|
@@ -42,6 +42,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
42
42
|
setText = _useState6[1];
|
|
43
43
|
var inputRef = useRef();
|
|
44
44
|
var initRows = useRef(null); //用于存储初始行数据
|
|
45
|
+
var firstMount = useRef(true);
|
|
45
46
|
var columns = prop.columns,
|
|
46
47
|
url = prop.url,
|
|
47
48
|
textName = prop.textName,
|
|
@@ -144,10 +145,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
144
145
|
if (!(formRef === null || formRef === void 0 ? void 0 : formRef.current) && record) return record;
|
|
145
146
|
if (rowKey) {
|
|
146
147
|
var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
|
|
147
|
-
if (
|
|
148
|
-
|
|
148
|
+
if (firstMount.current && record) {
|
|
149
|
+
firstMount.current = false;
|
|
150
|
+
return record;
|
|
151
|
+
}
|
|
152
|
+
return _objectSpread(_objectSpread({}, record || {}), (formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey]) || {});
|
|
149
153
|
}
|
|
150
|
-
|
|
151
154
|
return formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2);
|
|
152
155
|
};
|
|
153
156
|
/**
|
|
@@ -158,6 +161,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
158
161
|
var setFormValue = function setFormValue(formValue) {
|
|
159
162
|
var _prop$onChange;
|
|
160
163
|
(_prop$onChange = prop.onChange) === null || _prop$onChange === void 0 ? void 0 : _prop$onChange.call(prop, formValue[name]);
|
|
164
|
+
for (var key in formValue) {
|
|
165
|
+
if (formValue[key] === null) {
|
|
166
|
+
formValue[key] = undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
161
169
|
if (rowKey) {
|
|
162
170
|
var _formRef$current3, _formRef$current3$set;
|
|
163
171
|
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, _defineProperty({}, rowKey, formValue));
|