@lemon-fe/kits 1.0.0-182 → 1.0.0-184

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.
@@ -167,9 +167,10 @@ function DurationPicker(props) {
167
167
  var handleChangeDates = function handleChangeDates(dates) {
168
168
  var newDurationPickerValue = _objectSpread({}, value);
169
169
 
170
+ newDurationPickerValue.option = defaultOptions[0].label;
171
+
170
172
  if (dates === null) {
171
173
  newDurationPickerValue.dates = emptyValue;
172
- newDurationPickerValue.option = defaultOptions[0].label;
173
174
  } else {
174
175
  if (restProps.showTime) {
175
176
  newDurationPickerValue.dates = [moment(dates[0]).format(dateFormat), moment(dates[1]).format(dateFormat)];
@@ -10,6 +10,8 @@ declare type ProcessStepParams<T> = {
10
10
  payload?: any;
11
11
  };
12
12
  declare type ProcessStep<T, R> = {
13
+ /** 在不传入render warning会自动进行二次确认 */
14
+ mode?: 'warning';
13
15
  handler: (params: ProcessStepParams<T>) => Promise<any> | any;
14
16
  /**
15
17
  * 出现错误或者最后一步的 渲染函数
@@ -66,6 +68,11 @@ interface Props<RecordType extends Record<string, any> = Record<string, any>, Re
66
68
  */
67
69
  reload: (params?: any) => any;
68
70
  }) => ReactElement | string | number | null;
71
+ /**
72
+ * isError 应该与自定义渲染有关
73
+ * @param result
74
+ * @returns
75
+ */
69
76
  isError?: (result: ResultType) => boolean;
70
77
  params?: ParamsType;
71
78
  /**
@@ -234,7 +234,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
234
234
  var _processNode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(id, stepIdx, payload, next) {
235
235
  var _this2 = this;
236
236
 
237
- var process, grid, node, data, _process$stepIdx, handler, renderResult, isFinal, done, _result;
237
+ var process, grid, node, data, _process$stepIdx, handler, renderResult, mode, isFinal, done, _result;
238
238
 
239
239
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
240
240
  while (1) {
@@ -281,7 +281,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
281
281
  return _context2.abrupt("return");
282
282
 
283
283
  case 13:
284
- _process$stepIdx = process[stepIdx], handler = _process$stepIdx.handler, renderResult = _process$stepIdx.render;
284
+ _process$stepIdx = process[stepIdx], handler = _process$stepIdx.handler, renderResult = _process$stepIdx.render, mode = _process$stepIdx.mode;
285
285
  isFinal = stepIdx === process.length - 1;
286
286
 
287
287
  done = function done(result, error) {
@@ -295,12 +295,22 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
295
295
  payload: payload,
296
296
  render: function render() {
297
297
  if (error) {
298
+ if (mode === 'warning') {
299
+ return /*#__PURE__*/React.createElement(Row, {
300
+ justify: 'space-between'
301
+ }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icons.Tip, {
302
+ type: "warning"
303
+ }), /*#__PURE__*/React.createElement("span", null, " ", error.message, " ")), /*#__PURE__*/React.createElement("a", {
304
+ onClick: function onClick() {
305
+ _this2.processNode(id, stepIdx + 1);
306
+ }
307
+ }, "\u7EE7\u7EED"));
308
+ }
309
+
298
310
  return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icons.Tip, {
299
311
  type: "error"
300
312
  }), /*#__PURE__*/React.createElement("span", null, " ", error.message, " "), /*#__PURE__*/React.createElement(ReloadOutlined, {
301
313
  onClick: function onClick() {
302
- debugger;
303
-
304
314
  _this2.processNode(id, 0, _this2.props.params);
305
315
  }
306
316
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-182",
3
+ "version": "1.0.0-184",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",