@zat-design/sisyphus-react 3.4.3-beta.9 → 3.4.4
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/index.esm.css +14 -1
- package/dist/less.esm.css +14 -1
- package/es/ProEditTable/components/RenderField/index.js +2 -1
- package/es/ProEditTable/index.js +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -4
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +116 -63
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +8 -2
- package/es/ProForm/components/render/Render.js +3 -1
- package/es/ProForm/components/render/propsType.d.ts +3 -3
- package/es/ProForm/style/index.less +17 -0
- package/es/ProForm/utils/index.js +5 -1
- package/es/assets/view.svg +20 -1
- package/es/locale/en_US.d.ts +2 -2
- package/es/locale/en_US.js +2 -2
- package/es/locale/zh_CN.d.ts +2 -2
- package/es/locale/zh_CN.js +2 -2
- package/es/style/components.less +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +2 -1
- package/lib/ProEditTable/index.js +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +5 -5
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +123 -74
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +8 -2
- package/lib/ProForm/components/render/Render.js +3 -1
- package/lib/ProForm/components/render/propsType.d.ts +3 -3
- package/lib/ProForm/style/index.less +17 -0
- package/lib/ProForm/utils/index.js +5 -1
- package/lib/assets/view.svg +20 -1
- package/lib/locale/en_US.d.ts +2 -2
- package/lib/locale/en_US.js +2 -2
- package/lib/locale/zh_CN.d.ts +2 -2
- package/lib/locale/zh_CN.js +2 -2
- package/lib/style/components.less +0 -3
- package/package.json +1 -1
|
@@ -9,12 +9,13 @@ exports.default = void 0;
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var
|
|
12
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _icons = require("@ant-design/icons");
|
|
17
17
|
var _ahooks = require("ahooks");
|
|
18
|
+
var _umi = require("umi");
|
|
18
19
|
var _antd = require("antd");
|
|
19
20
|
var _lodash = require("lodash");
|
|
20
21
|
var _reactSvg = require("react-svg");
|
|
@@ -50,7 +51,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
50
51
|
isTooltip = props.isTooltip,
|
|
51
52
|
searchForm = props.searchForm,
|
|
52
53
|
defaultOne = props.defaultOne,
|
|
53
|
-
|
|
54
|
+
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
54
55
|
var contentForm = _antd.Form.useFormInstance();
|
|
55
56
|
if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
|
|
56
57
|
throw new Error('error: 请检查枚举选择弹框的配置项【configOption】');
|
|
@@ -103,6 +104,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
103
104
|
onOff: false,
|
|
104
105
|
visible: false,
|
|
105
106
|
open: false,
|
|
107
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || [],
|
|
106
108
|
selectedRows: [],
|
|
107
109
|
selectedRowKeys: []
|
|
108
110
|
}),
|
|
@@ -113,6 +115,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
113
115
|
onOff = _useSetState2$.onOff,
|
|
114
116
|
visible = _useSetState2$.visible,
|
|
115
117
|
open = _useSetState2$.open,
|
|
118
|
+
options = _useSetState2$.options,
|
|
116
119
|
_selectedRows = _useSetState2$.selectedRows,
|
|
117
120
|
_selectedRowKeys = _useSetState2$.selectedRowKeys,
|
|
118
121
|
setState = _useSetState2[1];
|
|
@@ -121,13 +124,23 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
121
124
|
form = _Form$useForm2[0];
|
|
122
125
|
var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
|
|
123
126
|
var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
|
|
127
|
+
var _useUmiRequest = (0, _umi.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
128
|
+
manual: true,
|
|
129
|
+
onSuccess: function onSuccess(data) {
|
|
130
|
+
var list = withPagination ? data === null || data === void 0 ? void 0 : data.list : data;
|
|
131
|
+
setState({
|
|
132
|
+
options: list
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
})),
|
|
136
|
+
run = _useUmiRequest.run;
|
|
124
137
|
var _useRequestList = (0, _useRequestList2.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
|
125
138
|
withPagination: withPagination,
|
|
126
139
|
transformParams: transformParams,
|
|
127
140
|
transformResponse: transformResponse
|
|
128
|
-
}, (0,
|
|
141
|
+
}, (0, _objectSpread3.default)({
|
|
129
142
|
manual: true,
|
|
130
|
-
ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) ||
|
|
143
|
+
ready: ((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne) && !readOnly || visible
|
|
131
144
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
|
132
145
|
data = _useRequestList.data,
|
|
133
146
|
loading = _useRequestList.loading,
|
|
@@ -159,13 +172,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
159
172
|
return data;
|
|
160
173
|
}
|
|
161
174
|
if (Object.prototype.toString.call(data) === '[object Object]') {
|
|
162
|
-
return handleFormat((0,
|
|
175
|
+
return handleFormat((0, _objectSpread3.default)((0, _objectSpread3.default)({}, data), {}, {
|
|
163
176
|
value: data[valueKey],
|
|
164
177
|
label: data[labelKey]
|
|
165
178
|
}));
|
|
166
179
|
}
|
|
167
180
|
return (0, _lodash.isArray)(data) ? data === null || data === void 0 ? void 0 : (_data$map = data.map(function (item) {
|
|
168
|
-
return handleFormat((0,
|
|
181
|
+
return handleFormat((0, _objectSpread3.default)((0, _objectSpread3.default)({}, item), {}, {
|
|
169
182
|
value: item[valueKey],
|
|
170
183
|
label: item[labelKey]
|
|
171
184
|
}));
|
|
@@ -208,14 +221,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
208
221
|
});
|
|
209
222
|
}
|
|
210
223
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
onChange(undefined, {});
|
|
214
|
-
setState({
|
|
215
|
-
_value: undefined,
|
|
216
|
-
selectedRowKeys: [],
|
|
217
|
-
selectedRows: []
|
|
218
|
-
});
|
|
224
|
+
var handleSelectValue = function handleSelectValue(val, option) {
|
|
225
|
+
onChange(val, option);
|
|
219
226
|
};
|
|
220
227
|
var handleClick = /*#__PURE__*/function () {
|
|
221
228
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
@@ -318,7 +325,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
318
325
|
onChange === null || onChange === void 0 ? void 0 : onChange(labelInValue ? _data : getNextValues(_data), _data);
|
|
319
326
|
// 更新内部展示值
|
|
320
327
|
setState({
|
|
321
|
-
_value: _data
|
|
328
|
+
_value: _data,
|
|
329
|
+
options: (0, _lodash.isArray)(_data) ? _data : [_data]
|
|
322
330
|
});
|
|
323
331
|
handleClose();
|
|
324
332
|
}
|
|
@@ -347,7 +355,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
347
355
|
return form.validateFields();
|
|
348
356
|
case 2:
|
|
349
357
|
values = _context3.sent;
|
|
350
|
-
onSearch((0,
|
|
358
|
+
onSearch((0, _objectSpread3.default)((0, _objectSpread3.default)({}, values), {}, {
|
|
351
359
|
d: Date.now()
|
|
352
360
|
}));
|
|
353
361
|
case 4:
|
|
@@ -360,7 +368,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
360
368
|
return _ref8.apply(this, arguments);
|
|
361
369
|
};
|
|
362
370
|
}();
|
|
363
|
-
var _rowSelection = (0,
|
|
371
|
+
var _rowSelection = (0, _objectSpread3.default)({
|
|
364
372
|
type: type,
|
|
365
373
|
onChange: function onChange(rowKeys, rows) {
|
|
366
374
|
setState({
|
|
@@ -423,12 +431,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
423
431
|
_context4.next = 10;
|
|
424
432
|
break;
|
|
425
433
|
}
|
|
426
|
-
queryBean = (0,
|
|
427
|
-
page = (0,
|
|
434
|
+
queryBean = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || {});
|
|
435
|
+
page = (0, _objectSpread3.default)({
|
|
428
436
|
pageNum: 1,
|
|
429
437
|
pageSize: 10
|
|
430
438
|
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.page);
|
|
431
|
-
params = withPagination ? (0,
|
|
439
|
+
params = withPagination ? (0, _objectSpread3.default)((0, _objectSpread3.default)({}, page), {}, {
|
|
432
440
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
|
433
441
|
}) : queryBean;
|
|
434
442
|
params = transformParams ? transformParams(params) : params;
|
|
@@ -482,12 +490,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
482
490
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
483
491
|
while (1) switch (_context5.prev = _context5.next) {
|
|
484
492
|
case 0:
|
|
485
|
-
queryBean = (0,
|
|
486
|
-
page = (0,
|
|
493
|
+
queryBean = (0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options4 = useRequest.options) === null || _useRequest$options4 === void 0 ? void 0 : _useRequest$options4.defaultParams);
|
|
494
|
+
page = (0, _objectSpread3.default)({
|
|
487
495
|
pageNum: 1,
|
|
488
496
|
pageSize: 10
|
|
489
497
|
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
|
490
|
-
params = withPagination ? (0,
|
|
498
|
+
params = withPagination ? (0, _objectSpread3.default)((0, _objectSpread3.default)({}, page), {}, {
|
|
491
499
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
|
492
500
|
}) : queryBean;
|
|
493
501
|
params = transformParams ? transformParams(params) : params;
|
|
@@ -587,9 +595,30 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
587
595
|
}, [onOff, visible, value]);
|
|
588
596
|
(0, _react.useEffect)(function () {
|
|
589
597
|
if (value && !visible && isInit) {
|
|
590
|
-
|
|
598
|
+
if (readOnly) {
|
|
599
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
600
|
+
setTimeout(function () {
|
|
601
|
+
var _useRequest$options7, _useRequest$options8;
|
|
602
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
603
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
604
|
+
var _contentForm$getField2;
|
|
605
|
+
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
606
|
+
}
|
|
607
|
+
var params = withPagination ? {
|
|
608
|
+
pageNum: 1,
|
|
609
|
+
pageSize: 50,
|
|
610
|
+
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
611
|
+
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
612
|
+
run(params);
|
|
613
|
+
setState({
|
|
614
|
+
isInit: false
|
|
615
|
+
});
|
|
616
|
+
}, 300);
|
|
617
|
+
} else {
|
|
618
|
+
getInitValues();
|
|
619
|
+
}
|
|
591
620
|
}
|
|
592
|
-
}, [value, visible, isInit]);
|
|
621
|
+
}, [value, visible, isInit, useRequest]);
|
|
593
622
|
(0, _react.useEffect)(function () {
|
|
594
623
|
if (!value) {
|
|
595
624
|
if (defaultOne) {
|
|
@@ -602,59 +631,79 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
602
631
|
});
|
|
603
632
|
}
|
|
604
633
|
}
|
|
605
|
-
if (
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
634
|
+
if (!readOnly) {
|
|
635
|
+
if (labelInValue && _value && !(0, _lodash.isEqual)(value, _value)) {
|
|
636
|
+
setState({
|
|
637
|
+
_value: value,
|
|
638
|
+
selectedRowKeys: [],
|
|
639
|
+
selectedRows: []
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
if (!labelInValue && (_value === null || _value === void 0 ? void 0 : _value[valueKey]) && !(0, _lodash.isEqual)(value, _value === null || _value === void 0 ? void 0 : _value[valueKey])) {
|
|
643
|
+
setState({
|
|
644
|
+
_value: value,
|
|
645
|
+
selectedRowKeys: [],
|
|
646
|
+
selectedRows: []
|
|
647
|
+
});
|
|
648
|
+
}
|
|
618
649
|
}
|
|
619
650
|
}, [value, _value]);
|
|
620
|
-
var defaultAddonAfter = (0, _jsxRuntime.jsxs)("div", {
|
|
621
|
-
className: "pro-enum-input-addonAfter",
|
|
622
|
-
children: [value && !disabled && (0, _jsxRuntime.jsx)("span", {
|
|
623
|
-
className: "close-icon",
|
|
624
|
-
children: (0, _jsxRuntime.jsx)(_icons.CloseOutlined, {
|
|
625
|
-
onClick: handleClearValue
|
|
626
|
-
})
|
|
627
|
-
}), (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
628
|
-
className: "viewSvg",
|
|
629
|
-
src: _view.default,
|
|
630
|
-
onClick: handleClick
|
|
631
|
-
})]
|
|
632
|
-
});
|
|
633
|
-
var forceAddonAfterRender = function forceAddonAfterRender() {
|
|
634
|
-
if (isView || disabled) {
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
if (addonAfter) {
|
|
638
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
639
|
-
onClick: handleClick,
|
|
640
|
-
children: addonAfter
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
return defaultAddonAfter;
|
|
644
|
-
};
|
|
645
651
|
// 加个中间状态Input
|
|
646
|
-
var initRender = (0, _jsxRuntime.jsxs)(
|
|
647
|
-
|
|
652
|
+
var initRender = (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
|
653
|
+
style: {
|
|
654
|
+
width: '100%'
|
|
655
|
+
},
|
|
656
|
+
block: true,
|
|
657
|
+
children: [readOnly ? (0, _jsxRuntime.jsx)(_index.ProSelect, (0, _objectSpread3.default)({
|
|
658
|
+
value: value,
|
|
659
|
+
onChange: handleSelectValue,
|
|
660
|
+
disabled: disabled,
|
|
661
|
+
fieldNames: fieldNames,
|
|
662
|
+
showCodeName: showCodeName,
|
|
663
|
+
labelInValue: labelInValue,
|
|
664
|
+
dataSource: options,
|
|
665
|
+
scrollFollowParent: false,
|
|
666
|
+
onClick: function onClick() {
|
|
667
|
+
// 没有值的时候,初始化点击默认查询前五十条
|
|
668
|
+
if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
|
|
669
|
+
var _useRequest$options9;
|
|
670
|
+
var queryBean = useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams;
|
|
671
|
+
var params = withPagination ? {
|
|
672
|
+
pageNum: 1,
|
|
673
|
+
pageSize: 50,
|
|
674
|
+
queryBean: queryBean
|
|
675
|
+
} : queryBean;
|
|
676
|
+
run(params);
|
|
677
|
+
setState({
|
|
678
|
+
isInit: false
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
onSearch: (0, _lodash.debounce)(function (val) {
|
|
683
|
+
var _useRequest$options10;
|
|
684
|
+
var queryBean = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams), {}, (0, _defineProperty2.default)({}, labelKey, val));
|
|
685
|
+
var params = withPagination ? {
|
|
686
|
+
pageNum: 1,
|
|
687
|
+
pageSize: 50,
|
|
688
|
+
queryBean: queryBean
|
|
689
|
+
} : queryBean;
|
|
690
|
+
run(params);
|
|
691
|
+
}, 800),
|
|
692
|
+
style: {
|
|
693
|
+
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
|
694
|
+
}
|
|
695
|
+
}, (0, _lodash.omit)(restProps, ['otherProps']))) : (0, _jsxRuntime.jsx)(_antd.Input, (0, _objectSpread3.default)({
|
|
648
696
|
value: viewText,
|
|
649
|
-
readOnly: readOnly,
|
|
650
|
-
onClick: readOnly ? handleClick : undefined,
|
|
651
697
|
onChange: handleChangeValue,
|
|
652
698
|
disabled: disabled,
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}, (0, _lodash.omit)(
|
|
656
|
-
|
|
657
|
-
|
|
699
|
+
autoComplete: "off",
|
|
700
|
+
allowClear: true
|
|
701
|
+
}, (0, _lodash.omit)(restProps, ['otherProps']))), isView || disabled ? null : (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
702
|
+
icon: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
703
|
+
className: "viewSvg",
|
|
704
|
+
src: _view.default,
|
|
705
|
+
onClick: handleClick
|
|
706
|
+
})
|
|
658
707
|
})]
|
|
659
708
|
});
|
|
660
709
|
if (customRender && /*#__PURE__*/_react.default.isValidElement(customRender)) {
|
|
@@ -731,7 +780,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
731
780
|
open: open,
|
|
732
781
|
title: viewText,
|
|
733
782
|
children: initRender
|
|
734
|
-
}) : initRender, (0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0,
|
|
783
|
+
}) : initRender, (0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0, _objectSpread3.default)((0, _objectSpread3.default)({
|
|
735
784
|
showType: "Modal",
|
|
736
785
|
title: title,
|
|
737
786
|
onOk: handleFinish,
|
|
@@ -745,7 +794,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
745
794
|
columns: formColumns,
|
|
746
795
|
onFinish: handleSearch,
|
|
747
796
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
|
748
|
-
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0,
|
|
797
|
+
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0, _objectSpread3.default)({
|
|
749
798
|
onRow: function onRow(record) {
|
|
750
799
|
return {
|
|
751
800
|
onClick: function onClick() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormInstance, InputProps, ModalProps } from 'antd';
|
|
1
|
+
import { FormInstance, InputProps, SelectProps, ModalProps } from 'antd';
|
|
2
2
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ProColumnProps } from '../../render/propsType';
|
|
@@ -43,5 +43,5 @@ interface ProModalPropsType {
|
|
|
43
43
|
showCodeName?: boolean;
|
|
44
44
|
searchForm?: FormInstance;
|
|
45
45
|
}
|
|
46
|
-
export declare type ProModalSelectPropsType = InputProps & ProModalPropsType;
|
|
46
|
+
export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
|
|
47
47
|
export {};
|
|
@@ -12,7 +12,7 @@ var _lodash = require("lodash");
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _antd = require("antd");
|
|
14
14
|
var _index = _interopRequireDefault(require("../../index"));
|
|
15
|
-
var _excluded = ["onChange", "children", "confirm"];
|
|
15
|
+
var _excluded = ["onChange", "children", "confirm", "otherProps"];
|
|
16
16
|
var defaultConfirmProps = {
|
|
17
17
|
title: '操作提示',
|
|
18
18
|
content: '确定要修改该字段吗?'
|
|
@@ -21,6 +21,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
21
21
|
var onChange = props.onChange,
|
|
22
22
|
children = props.children,
|
|
23
23
|
confirm = props.confirm,
|
|
24
|
+
otherProps = props.otherProps,
|
|
24
25
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
25
26
|
var _ProForm$useFieldProp = _index.default.useFieldProps(),
|
|
26
27
|
form = _ProForm$useFieldProp.form;
|
|
@@ -29,7 +30,12 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
29
30
|
other[_key - 1] = arguments[_key];
|
|
30
31
|
}
|
|
31
32
|
var _value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
|
|
32
|
-
var confirmProps = (0, _lodash.isFunction)(confirm) ? confirm(form.getFieldsValue()
|
|
33
|
+
var confirmProps = (0, _lodash.isFunction)(confirm) ? confirm(value, form.getFieldsValue(), {
|
|
34
|
+
option: other[0],
|
|
35
|
+
form: form,
|
|
36
|
+
namePath: otherProps.namePath,
|
|
37
|
+
index: otherProps.index
|
|
38
|
+
}) : confirm;
|
|
33
39
|
if (confirmProps === true) {
|
|
34
40
|
_antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), {}, {
|
|
35
41
|
onOk: function onOk() {
|
|
@@ -153,7 +153,9 @@ var Render = function Render(props) {
|
|
|
153
153
|
Object.assign(otherFormItemProps, transforms, {
|
|
154
154
|
names: otherProps.names
|
|
155
155
|
}, internalRule, {
|
|
156
|
-
required: typeof labelRequired === 'boolean' ? labelRequired : _required
|
|
156
|
+
required: typeof labelRequired === 'boolean' ? labelRequired : _required || (rules === null || rules === void 0 ? void 0 : rules.some(function (item) {
|
|
157
|
+
return item === null || item === void 0 ? void 0 : item.required;
|
|
158
|
+
}))
|
|
157
159
|
}, otherProps.isView && !requiredOnView ? {
|
|
158
160
|
required: false
|
|
159
161
|
} : null, (0, _objectSpread2.default)({}, (0, _index.isTrim)(type, trim, (0, _ProConfigProvider.useProConfig)())), // 优先取传进来的,其次取ProConfigProvider配置的
|
|
@@ -52,12 +52,12 @@ interface ControlProps {
|
|
|
52
52
|
/**
|
|
53
53
|
* 扩展函数的参数
|
|
54
54
|
*/
|
|
55
|
-
type FunctionArgs<Values> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
55
|
+
type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
|
|
56
56
|
form: FormInstance<Values>;
|
|
57
57
|
index?: number;
|
|
58
58
|
namePath?: NamePath;
|
|
59
59
|
[key: string]: any;
|
|
60
|
-
}) =>
|
|
60
|
+
}) => R;
|
|
61
61
|
type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T, 'onChange' | 'value'> & {
|
|
62
62
|
value?: T['value'];
|
|
63
63
|
onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], form: FormInstance<Values>) => void;
|
|
@@ -220,7 +220,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
220
220
|
extra?: string | React.ReactNode;
|
|
221
221
|
/** 是否固定字段, 不隐藏 */
|
|
222
222
|
fixed?: boolean;
|
|
223
|
-
confirm?: boolean | ModalFuncProps |
|
|
223
|
+
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
224
224
|
}
|
|
225
225
|
export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
|
|
226
226
|
/**
|
|
@@ -347,4 +347,21 @@
|
|
|
347
347
|
.delete-icon {
|
|
348
348
|
width: 18px;
|
|
349
349
|
}
|
|
350
|
+
.pro-form-list-tool-btn {
|
|
351
|
+
margin-left: 8px;
|
|
352
|
+
padding: 0;
|
|
353
|
+
cursor: pointer;
|
|
354
|
+
.anticon {
|
|
355
|
+
color: var(--zaui-text-weak, #a0a0a0);
|
|
356
|
+
font-size: 16px;
|
|
357
|
+
vertical-align: middle;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
.pro-form-list-mode-block{
|
|
361
|
+
.pro-collapse-content{
|
|
362
|
+
.@{ant-prefix}-row{
|
|
363
|
+
width: auto;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
350
367
|
}
|
|
@@ -151,7 +151,7 @@ var filterInternalFields = exports.filterInternalFields = function filterInterna
|
|
|
151
151
|
if ((0, _lodash.isObject)(nextValues)) {
|
|
152
152
|
var result = {};
|
|
153
153
|
Object.keys(nextValues).forEach(function (key) {
|
|
154
|
-
|
|
154
|
+
if (key.includes('-')) return;
|
|
155
155
|
result[key] = filterInternalFields(nextValues[key]);
|
|
156
156
|
});
|
|
157
157
|
return result;
|
|
@@ -317,6 +317,10 @@ function initialValuesToNames() {
|
|
|
317
317
|
values[key] = formInitialValue;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
+
// 给FormList默认增加一行
|
|
321
|
+
if (item.type === 'FormList' && !item.initialValue && !(0, _lodash.get)(values, item.name)) {
|
|
322
|
+
item.initialValue = [{}];
|
|
323
|
+
}
|
|
320
324
|
});
|
|
321
325
|
return values;
|
|
322
326
|
}
|
package/lib/assets/view.svg
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
<?xml version="1.0"
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="19px" height="15px" viewBox="0 0 19 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>icon-dropdown-searchlist</title>
|
|
4
|
+
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="询报价录入交互说明" transform="translate(-531, -308)" fill="#999999" fill-rule="nonzero">
|
|
6
|
+
<g id="Dropdown/下拉弹窗切换/default备份-2" transform="translate(215, 299)">
|
|
7
|
+
<g id="编组-2" transform="translate(288, 1)">
|
|
8
|
+
<g id="编组" transform="translate(22, 0)">
|
|
9
|
+
<g id="icon-dropdown-searchlist" transform="translate(6, 8)">
|
|
10
|
+
<path d="M18.8595156,13.853235 L15.9118005,9.83277831 C16.9574103,8.79234063 17.6131433,7.33016175 17.6131433,5.70884872 C17.6131433,2.56113225 15.1539732,0 12.1315716,0 C9.10917008,0 6.65,2.56113225 6.65,5.70884872 C6.65,8.85656518 9.10917008,11.4176974 12.1315716,11.4176974 C13.1052358,11.4176974 14.0179175,11.1493815 14.811375,10.6841104 L17.7693681,14.7188392 C17.9043518,14.9029496 18.1078551,15 18.3147844,15 C18.4593609,15 18.6059929,14.952902 18.7293283,14.8537108 C19.0314999,14.6139391 19.0890564,14.1657945 18.8595156,13.853235 Z M8.02107811,5.70813511 C8.02107811,3.34681256 9.86494177,1.42649857 12.1322568,1.42649857 C14.3995719,1.42649857 16.2434356,3.34681256 16.2434356,5.70813511 C16.2434356,8.06945766 14.3995719,9.98977165 12.1322568,9.98977165 C9.86494177,9.98977165 8.02107811,8.06945766 8.02107811,5.70813511 Z" id="形状"></path>
|
|
11
|
+
<path d="M4.9875,2.34375 L0.7125,2.34375 C0.3192,2.34375 0,2.02875 0,1.640625 C0,1.2525 0.3192,0.9375 0.7125,0.9375 L4.9875,0.9375 C5.3808,0.9375 5.7,1.2525 5.7,1.640625 C5.7,2.02875 5.3808,2.34375 4.9875,2.34375 Z" id="路径"></path>
|
|
12
|
+
<path d="M3.95833333,7.96875 L0.791666667,7.96875 C0.354666667,7.96875 0,7.65445313 0,7.265625 C0,6.8775 0.354666667,6.5625 0.791666667,6.5625 L3.95833333,6.5625 C4.39533333,6.5625 4.75,6.8775 4.75,7.265625 C4.75,7.65445313 4.39533333,7.96875 3.95833333,7.96875 Z" id="路径"></path>
|
|
13
|
+
<path d="M7.89230769,13.59375 L0.657692308,13.59375 C0.294646154,13.59375 0,13.2794531 0,12.890625 C0,12.5017969 0.294646154,12.1875 0.657692308,12.1875 L7.89230769,12.1875 C8.25535385,12.1875 8.55,12.5017969 8.55,12.890625 C8.55,13.2794531 8.25535385,13.59375 7.89230769,13.59375 Z" id="路径"></path>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
package/lib/locale/en_US.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ declare const _default: {
|
|
|
33
33
|
ruleText: string;
|
|
34
34
|
completeText: string;
|
|
35
35
|
halfRuleText: string;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
formListActions: string[];
|
|
37
|
+
formListConfirmMessage: string;
|
|
38
38
|
};
|
|
39
39
|
ProAction: {
|
|
40
40
|
errorMessage: string;
|
package/lib/locale/en_US.js
CHANGED
|
@@ -39,8 +39,8 @@ var _default = exports.default = {
|
|
|
39
39
|
ruleText: 'correct',
|
|
40
40
|
completeText: 'enter in full',
|
|
41
41
|
halfRuleText: 'Enter the value of ({total})',
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line'],
|
|
43
|
+
formListConfirmMessage: 'Are you sure delete it?'
|
|
44
44
|
},
|
|
45
45
|
ProAction: {
|
|
46
46
|
errorMessage: 'The configuration config for ProAction must be data',
|
package/lib/locale/zh_CN.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ declare const _default: {
|
|
|
33
33
|
ruleText: string;
|
|
34
34
|
completeText: string;
|
|
35
35
|
halfRuleText: string;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
formListActions: string[];
|
|
37
|
+
formListConfirmMessage: string;
|
|
38
38
|
};
|
|
39
39
|
ProAction: {
|
|
40
40
|
errorMessage: string;
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -39,8 +39,8 @@ var _default = exports.default = {
|
|
|
39
39
|
ruleText: '正确的',
|
|
40
40
|
completeText: '请完整输入',
|
|
41
41
|
halfRuleText: '请输入第({total})个表单的值',
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行'],
|
|
43
|
+
formListConfirmMessage: '确认删除吗?'
|
|
44
44
|
},
|
|
45
45
|
ProAction: {
|
|
46
46
|
errorMessage: 'ProAction 配置 config 必须为数据',
|
|
@@ -19,13 +19,10 @@
|
|
|
19
19
|
@import '../ProEditTable/style/index';
|
|
20
20
|
@import '../ProEditLabel/style/index';
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
// 通用
|
|
24
23
|
@import '../ProIcon/style/index';
|
|
25
24
|
@import '../ProThemeTools/style/index';
|
|
26
25
|
@import '../ProDownload/style/index';
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
27
|
// old 待废弃
|
|
31
28
|
@import '../old/ProEditableTable/style/index';
|