@zat-design/sisyphus-react 3.11.11 → 3.11.13
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.
@@ -661,8 +661,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
661
661
|
if (value && !visible && readOnly && (!isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
662
662
|
var _options$some;
|
663
663
|
preValue.current = value;
|
664
|
+
var _data3 = labelInValue ? value[valueKey] : value;
|
664
665
|
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
665
|
-
return item[valueKey] ===
|
666
|
+
return item[valueKey] === _data3;
|
666
667
|
});
|
667
668
|
if (isHasValue) {
|
668
669
|
return;
|
@@ -673,8 +674,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
673
674
|
var params = withPagination ? {
|
674
675
|
pageNum: 1,
|
675
676
|
pageSize: 50,
|
676
|
-
queryBean: _objectSpread(_objectSpread({}, defaultParams), initParams)
|
677
|
-
} : _objectSpread(_objectSpread({}, defaultParams), initParams);
|
677
|
+
queryBean: _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : valueKey, _data3))
|
678
|
+
} : _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : valueKey, _data3));
|
678
679
|
var nextParams = transformParams ? transformParams(params) : params;
|
679
680
|
run(nextParams);
|
680
681
|
}, 300);
|
@@ -10,7 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
11
11
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
13
|
-
var
|
13
|
+
var _objectSpread5 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
@@ -134,7 +134,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
134
134
|
withPagination: withPagination,
|
135
135
|
transformParams: transformParams,
|
136
136
|
transformResponse: transformResponse
|
137
|
-
}, (0,
|
137
|
+
}, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
138
138
|
manual: true,
|
139
139
|
onSuccess: function onSuccess(res) {
|
140
140
|
var _res$data, _ref5;
|
@@ -158,7 +158,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
158
158
|
withPagination: withPagination,
|
159
159
|
transformParams: transformParams,
|
160
160
|
transformResponse: transformResponse
|
161
|
-
}, (0,
|
161
|
+
}, (0, _objectSpread5.default)({
|
162
162
|
manual: true,
|
163
163
|
ready: (initParams || defaultOne) && !readOnly || visible
|
164
164
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
@@ -192,13 +192,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
192
192
|
return data;
|
193
193
|
}
|
194
194
|
if (Object.prototype.toString.call(data) === '[object Object]') {
|
195
|
-
return handleFormat((0,
|
195
|
+
return handleFormat((0, _objectSpread5.default)((0, _objectSpread5.default)({}, data), {}, {
|
196
196
|
value: data[valueKey],
|
197
197
|
label: data[labelKey]
|
198
198
|
}));
|
199
199
|
}
|
200
200
|
return (0, _lodash.isArray)(data) ? data === null || data === void 0 ? void 0 : (_data$map = data.map(function (item) {
|
201
|
-
return handleFormat((0,
|
201
|
+
return handleFormat((0, _objectSpread5.default)((0, _objectSpread5.default)({}, item), {}, {
|
202
202
|
value: item[valueKey],
|
203
203
|
label: item[labelKey]
|
204
204
|
}));
|
@@ -403,7 +403,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
403
403
|
return form.validateFields();
|
404
404
|
case 2:
|
405
405
|
values = _context3.sent;
|
406
|
-
onSearch((0,
|
406
|
+
onSearch((0, _objectSpread5.default)((0, _objectSpread5.default)({}, values), {}, {
|
407
407
|
d: Date.now()
|
408
408
|
}));
|
409
409
|
case 4:
|
@@ -416,7 +416,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
416
416
|
return _ref9.apply(this, arguments);
|
417
417
|
};
|
418
418
|
}();
|
419
|
-
var _rowSelection = (0,
|
419
|
+
var _rowSelection = (0, _objectSpread5.default)({
|
420
420
|
type: type,
|
421
421
|
onChange: function onChange(rowKeys, rows) {
|
422
422
|
setState({
|
@@ -476,12 +476,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
476
476
|
_context4.next = 9;
|
477
477
|
break;
|
478
478
|
}
|
479
|
-
queryBean = (0,
|
480
|
-
page = (0,
|
479
|
+
queryBean = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, defaultParams), initParams || {});
|
480
|
+
page = (0, _objectSpread5.default)({
|
481
481
|
pageNum: 1,
|
482
482
|
pageSize: 10
|
483
483
|
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
484
|
-
params = withPagination ? (0,
|
484
|
+
params = withPagination ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, page), {}, {
|
485
485
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
486
486
|
}) : queryBean;
|
487
487
|
params = transformParams ? transformParams(params) : params;
|
@@ -534,12 +534,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
534
534
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
535
535
|
while (1) switch (_context5.prev = _context5.next) {
|
536
536
|
case 0:
|
537
|
-
queryBean = (0,
|
538
|
-
page = (0,
|
537
|
+
queryBean = (0, _objectSpread5.default)({}, defaultParams);
|
538
|
+
page = (0, _objectSpread5.default)({
|
539
539
|
pageNum: 1,
|
540
540
|
pageSize: 10
|
541
541
|
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.page);
|
542
|
-
params = withPagination ? (0,
|
542
|
+
params = withPagination ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, page), {}, {
|
543
543
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
544
544
|
}) : queryBean;
|
545
545
|
params = transformParams ? transformParams(params) : params;
|
@@ -656,8 +656,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
656
656
|
if (value && !visible && readOnly && (!(0, _lodash.isEqual)(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
657
657
|
var _options$some;
|
658
658
|
preValue.current = value;
|
659
|
+
var _data3 = labelInValue ? value[valueKey] : value;
|
659
660
|
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
660
|
-
return item[valueKey] ===
|
661
|
+
return item[valueKey] === _data3;
|
661
662
|
});
|
662
663
|
if (isHasValue) {
|
663
664
|
return;
|
@@ -668,8 +669,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
668
669
|
var params = withPagination ? {
|
669
670
|
pageNum: 1,
|
670
671
|
pageSize: 50,
|
671
|
-
queryBean: (0,
|
672
|
-
} : (0,
|
672
|
+
queryBean: (0, _objectSpread5.default)((0, _objectSpread5.default)((0, _objectSpread5.default)({}, defaultParams), initParams), {}, (0, _defineProperty2.default)({}, searchKey !== null && searchKey !== void 0 ? searchKey : valueKey, _data3))
|
673
|
+
} : (0, _objectSpread5.default)((0, _objectSpread5.default)((0, _objectSpread5.default)({}, defaultParams), initParams), {}, (0, _defineProperty2.default)({}, searchKey !== null && searchKey !== void 0 ? searchKey : valueKey, _data3));
|
673
674
|
var nextParams = transformParams ? transformParams(params) : params;
|
674
675
|
run(nextParams);
|
675
676
|
}, 300);
|
@@ -697,7 +698,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
697
698
|
};
|
698
699
|
var handleSelectSearch = (0, _lodash.debounce)(function (val) {
|
699
700
|
if (useRequest) {
|
700
|
-
var queryBean = (0,
|
701
|
+
var queryBean = (0, _objectSpread5.default)((0, _objectSpread5.default)({}, defaultParams), {}, (0, _defineProperty2.default)({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
701
702
|
var params = withPagination ? {
|
702
703
|
pageNum: 1,
|
703
704
|
pageSize: 50,
|
@@ -742,7 +743,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
742
743
|
width: '100%'
|
743
744
|
},
|
744
745
|
block: true,
|
745
|
-
children: [readOnly ? (0, _jsxRuntime.jsx)(_index.ProSelect, (0,
|
746
|
+
children: [readOnly ? (0, _jsxRuntime.jsx)(_index.ProSelect, (0, _objectSpread5.default)({
|
746
747
|
value: value,
|
747
748
|
onChange: handleSelectValue,
|
748
749
|
disabled: disabled,
|
@@ -761,7 +762,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
761
762
|
style: {
|
762
763
|
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
763
764
|
}
|
764
|
-
}, restProps)) : (0, _jsxRuntime.jsx)(_antd.Input, (0,
|
765
|
+
}, restProps)) : (0, _jsxRuntime.jsx)(_antd.Input, (0, _objectSpread5.default)({
|
765
766
|
value: viewText,
|
766
767
|
onChange: handleChangeValue,
|
767
768
|
disabled: disabled,
|
@@ -856,7 +857,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
856
857
|
title: viewText,
|
857
858
|
children: initRender
|
858
859
|
}) : initRender
|
859
|
-
}), (0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0,
|
860
|
+
}), (0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0, _objectSpread5.default)((0, _objectSpread5.default)({
|
860
861
|
showType: "Modal",
|
861
862
|
title: title,
|
862
863
|
onOk: handleFinish,
|
@@ -871,7 +872,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
871
872
|
onFinish: handleSearch,
|
872
873
|
confirmLoading: loading,
|
873
874
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
874
|
-
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0,
|
875
|
+
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0, _objectSpread5.default)({
|
875
876
|
onRow: function onRow(record) {
|
876
877
|
return {
|
877
878
|
onClick: function onClick() {
|