cloud-b2b 1.1.3 → 1.1.6

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/es/adjust.less CHANGED
@@ -1,89 +1,89 @@
1
-
2
- .ant-table-small {
3
- .ant-table-thead {
4
- background-color: @table-header-bg;
5
-
6
- > tr > th {
7
- padding: 12px 8px 11px !important;
8
- }
9
- }
10
-
11
- .ant-table-tbody > tr > td {
12
- padding: 8px 8px 7px !important;
13
- }
14
-
15
- .ant-table-tbody > tr.ant-table-row-selected td {
16
- background-color: @primary-1 !important;
17
- }
18
-
19
- .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
20
- background-color: @table-header-bg !important;
21
- }
22
-
23
- .ant-table-selection-column {
24
- min-width: 62px;
25
- }
26
-
27
- table {
28
- border-collapse: separate;
29
- border-spacing: 0;
30
- }
31
- }
32
-
33
- .ant-modal {
34
- top: 50px;
35
- padding-bottom: 0;
36
- }
37
-
38
- .ant-form-item {
39
- margin-bottom: 6px;
40
- }
41
-
42
- .ant-select-sm .ant-select-selection--single {
43
- height: @input-height-sm !important;
44
- overflow: hidden;
45
- }
46
-
47
- .ant-form-vertical .ant-form-item {
48
- padding-bottom: 0;
49
- }
50
-
51
- .ant-form-item-control {
52
- line-height: @input-height-sm;
53
-
54
- > .ant-form-explain-holder[aria-hidden='true'] {
55
- display: none;
56
- }
57
- }
58
-
59
- .ant-form-vertical .ant-form-item-label {
60
- padding: 0;
61
- line-height: 1.2;
62
- }
63
-
64
- .ant-input-lg {
65
- font-size: 12px;
66
- }
67
-
68
- .ant-btn-lg {
69
- height: @input-height-lg;
70
- }
71
-
72
- .ant-menu-inline .ant-menu-item {
73
- margin-top: 0;
74
- margin-bottom: 0 !important;
75
- }
76
-
77
- .ant-modal-header {
78
- padding: 13px 16px;
79
- }
80
-
81
- .ant-modal-body {
82
- padding: 16px;
83
- }
84
-
85
- .ant-btn-primary:focus {
86
- background-color: white;
87
- color: @primary-color;
88
- text-shadow: none;
89
- }
1
+
2
+ .ant-table-small {
3
+ .ant-table-thead {
4
+ background-color: @table-header-bg;
5
+
6
+ > tr > th {
7
+ padding: 12px 8px 11px !important;
8
+ }
9
+ }
10
+
11
+ .ant-table-tbody > tr > td {
12
+ padding: 8px 8px 7px !important;
13
+ }
14
+
15
+ .ant-table-tbody > tr.ant-table-row-selected td {
16
+ background-color: @primary-1 !important;
17
+ }
18
+
19
+ .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
20
+ background-color: @table-header-bg !important;
21
+ }
22
+
23
+ .ant-table-selection-column {
24
+ min-width: 62px;
25
+ }
26
+
27
+ table {
28
+ border-collapse: separate;
29
+ border-spacing: 0;
30
+ }
31
+ }
32
+
33
+ .ant-modal {
34
+ top: 50px;
35
+ padding-bottom: 0;
36
+ }
37
+
38
+ .ant-form-item {
39
+ margin-bottom: 6px;
40
+ }
41
+
42
+ .ant-select-sm .ant-select-selection--single {
43
+ height: @input-height-sm !important;
44
+ overflow: hidden;
45
+ }
46
+
47
+ .ant-form-vertical .ant-form-item {
48
+ padding-bottom: 0;
49
+ }
50
+
51
+ .ant-form-item-control {
52
+ line-height: @input-height-sm;
53
+
54
+ > .ant-form-explain-holder[aria-hidden='true'] {
55
+ display: none;
56
+ }
57
+ }
58
+
59
+ .ant-form-vertical .ant-form-item-label {
60
+ padding: 0;
61
+ line-height: 1.2;
62
+ }
63
+
64
+ .ant-input-lg {
65
+ font-size: 12px;
66
+ }
67
+
68
+ .ant-btn-lg {
69
+ height: @input-height-lg;
70
+ }
71
+
72
+ .ant-menu-inline .ant-menu-item {
73
+ margin-top: 0;
74
+ margin-bottom: 0 !important;
75
+ }
76
+
77
+ .ant-modal-header {
78
+ padding: 13px 16px;
79
+ }
80
+
81
+ .ant-modal-body {
82
+ padding: 16px;
83
+ }
84
+
85
+ .ant-btn-primary:focus {
86
+ background-color: white;
87
+ color: @primary-color;
88
+ text-shadow: none;
89
+ }
package/lib/Area/Area.js CHANGED
@@ -91,7 +91,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
91
91
  var _this$props = _this.props,
92
92
  onParentChange = _this$props.onParentChange,
93
93
  child = _this$props.child,
94
- value = _this$props.value;
94
+ _this$props$value = _this$props.value,
95
+ value = _this$props$value === void 0 ? {} : _this$props$value;
95
96
  var newValue = {};
96
97
  newValue[key] = keyValue;
97
98
  var CheckValue, checkIndex;
@@ -114,7 +115,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
114
115
  var _this$props2 = _this.props,
115
116
  onAreaSearch = _this$props2.onAreaSearch,
116
117
  child = _this$props2.child,
117
- value = _this$props2.value;
118
+ _this$props2$value = _this$props2.value,
119
+ value = _this$props2$value === void 0 ? {} : _this$props2$value;
118
120
  var flag = true;
119
121
  (0, _map["default"])(child).call(child, function (item, index) {
120
122
  if (item.key === key && index !== 0) {
@@ -141,7 +143,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
141
143
  value: function componentWillReceiveProps(props) {
142
144
  if (props.value !== this.props.value) {
143
145
  this.setState({
144
- value: props.value
146
+ value: props.value || {}
145
147
  });
146
148
  }
147
149
  }
@@ -157,7 +159,8 @@ var Area = /*#__PURE__*/function (_React$Component) {
157
159
  options = _this$props3$options === void 0 ? {} : _this$props3$options,
158
160
  _this$props3$readonly = _this$props3.readonly,
159
161
  readonly = _this$props3$readonly === void 0 ? false : _this$props3$readonly,
160
- value = _this$props3.value;
162
+ _this$props3$value = _this$props3.value,
163
+ value = _this$props3$value === void 0 ? {} : _this$props3$value;
161
164
  return /*#__PURE__*/_react["default"].createElement(_row["default"], null, (0, _map["default"])(child).call(child, function (item, index) {
162
165
  var _context, _context2, _context3;
163
166
 
@@ -176,7 +179,7 @@ var Area = /*#__PURE__*/function (_React$Component) {
176
179
  onSearch: (0, _bind["default"])(_context2 = _this2.onSearch).call(_context2, _this2, item.key, item, parentKey),
177
180
  onChange: (0, _bind["default"])(_context3 = _this2.onChange).call(_context3, _this2, item.key),
178
181
  options: childOptions,
179
- value: _this2.props.value[item.key].title ? _this2.props.value[item.key].title : _this2.props.value[item.key],
182
+ value: value[item.key] && value[item.key].title ? value[item.key].title : value[item.key],
180
183
  type: readonly ? 'readonly' : item.type
181
184
  });
182
185
 
@@ -383,16 +383,11 @@ var captcha = function captcha(props) {
383
383
  };
384
384
 
385
385
  var uploadImg = function uploadImg(props) {
386
- var uploadProps = {
386
+ var uploadProps = _objectSpread(_objectSpread({}, props), {}, {
387
387
  fileList: props.value || [],
388
- required: props.require,
389
- multiple: false,
390
- limitNumber: props.limitNumber || 10,
391
- onFileChange: props.onFileChange,
392
- needText: props.needText,
393
- remark: props.remark,
394
388
  readonly: props.readonly || false
395
- };
389
+ });
390
+
396
391
  return /*#__PURE__*/_react["default"].createElement(_SuperUpload["default"], uploadProps);
397
392
  }; // 支持的控件类型
398
393
 
@@ -90,7 +90,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
90
90
 
91
91
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
92
92
 
93
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context20, _context21; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context20 = ownKeys(Object(source), !0)).call(_context20, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context21 = ownKeys(Object(source))).call(_context21, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
93
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context23, _context24; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context23 = ownKeys(Object(source), !0)).call(_context23, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context24 = ownKeys(Object(source))).call(_context24, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
94
94
 
95
95
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
96
96
 
@@ -360,57 +360,74 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
360
360
  readonly: true,
361
361
  onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, (0, _assertThisInitialized2["default"])(_this2), key)
362
362
  };
363
- } else {
363
+ } else if (originType === 'uploadImg') {
364
364
  var _context4;
365
365
 
366
- return {
366
+ var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
367
+ return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
368
+ readonly: true,
367
369
  onBlur: (0, _bind["default"])(_context4 = _this2.onExitValid).call(_context4, (0, _assertThisInitialized2["default"])(_this2), key)
370
+ });
371
+ } else {
372
+ var _context5;
373
+
374
+ return {
375
+ onBlur: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key)
368
376
  };
369
377
  }
370
378
  } else if (type === 'text' || type === 'textArea') {
371
- var _context5, _context6;
379
+ var _context6, _context7;
372
380
 
373
381
  return _objectSpread(_objectSpread({}, props), {}, {
374
- onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key),
375
- onBlur: (0, _bind["default"])(_context6 = _this2.onChange).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key)
382
+ onChange: (0, _bind["default"])(_context6 = _this2.onExitValid).call(_context6, (0, _assertThisInitialized2["default"])(_this2), key),
383
+ onBlur: (0, _bind["default"])(_context7 = _this2.onChange).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key)
376
384
  });
377
385
  } else if (type === 'date') {
378
- var _context7, _context8;
386
+ var _context8, _context9;
379
387
 
380
388
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
381
- onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key),
382
- onBlur: (0, _bind["default"])(_context8 = _this2.onExitValid).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key)
389
+ onChange: (0, _bind["default"])(_context8 = _this2.onBlur).call(_context8, (0, _assertThisInitialized2["default"])(_this2), key),
390
+ onBlur: (0, _bind["default"])(_context9 = _this2.onExitValid).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key)
383
391
  });
384
392
 
385
393
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
386
- var _context9;
394
+ var _context10;
387
395
 
388
- propsObj.onOpenChange = (0, _bind["default"])(_context9 = _this2.props.onOpenChange).call(_context9, (0, _assertThisInitialized2["default"])(_this2), key);
396
+ propsObj.onOpenChange = (0, _bind["default"])(_context10 = _this2.props.onOpenChange).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key);
389
397
  }
390
398
 
391
399
  return propsObj;
392
400
  } else if (type === 'captcha') {
393
- var _context10, _context11, _context12;
401
+ var _context11, _context12, _context13;
394
402
 
395
403
  return _objectSpread(_objectSpread({}, props), {}, {
396
- onChange: (0, _bind["default"])(_context10 = _this2.onBlur).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key),
397
- onBlur: (0, _bind["default"])(_context11 = _this2.onExitValid).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
398
- onGetCode: (0, _bind["default"])(_context12 = _this2.onGetCode).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key)
404
+ onChange: (0, _bind["default"])(_context11 = _this2.onBlur).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
405
+ onBlur: (0, _bind["default"])(_context12 = _this2.onExitValid).call(_context12, (0, _assertThisInitialized2["default"])(_this2), key),
406
+ onGetCode: (0, _bind["default"])(_context13 = _this2.onGetCode).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key)
399
407
  });
400
408
  } else if (type === 'area') {
401
- var _context13, _context14;
409
+ var _context14, _context15;
402
410
 
403
411
  return _objectSpread(_objectSpread({}, props), {}, {
404
- onChange: (0, _bind["default"])(_context13 = _this2.onBlur).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key),
405
- onBlur: (0, _bind["default"])(_context14 = _this2.onExitValid).call(_context14, (0, _assertThisInitialized2["default"])(_this2), key),
412
+ onChange: (0, _bind["default"])(_context14 = _this2.onBlur).call(_context14, (0, _assertThisInitialized2["default"])(_this2), key),
413
+ onBlur: (0, _bind["default"])(_context15 = _this2.onExitValid).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
406
414
  onAreaSearch: _this2.props.onAreaSearch
407
415
  });
416
+ } else if (type === 'uploadImg') {
417
+ var _context16, _context17;
418
+
419
+ var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
420
+
421
+ return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
422
+ onChange: (0, _bind["default"])(_context16 = _this2.onBlur).call(_context16, (0, _assertThisInitialized2["default"])(_this2), key),
423
+ onBlur: (0, _bind["default"])(_context17 = _this2.onExitValid).call(_context17, (0, _assertThisInitialized2["default"])(_this2), key)
424
+ });
408
425
  } else {
409
- var _context15, _context16;
426
+ var _context18, _context19;
410
427
 
411
428
  return _objectSpread(_objectSpread({}, props), {}, {
412
- onChange: (0, _bind["default"])(_context15 = _this2.onBlur).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
413
- onBlur: (0, _bind["default"])(_context16 = _this2.onExitValid).call(_context16, (0, _assertThisInitialized2["default"])(_this2), key)
429
+ onChange: (0, _bind["default"])(_context18 = _this2.onBlur).call(_context18, (0, _assertThisInitialized2["default"])(_this2), key),
430
+ onBlur: (0, _bind["default"])(_context19 = _this2.onExitValid).call(_context19, (0, _assertThisInitialized2["default"])(_this2), key)
414
431
  });
415
432
  }
416
433
  });
@@ -548,11 +565,11 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
548
565
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
549
566
  });
550
567
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
551
- var _context17;
568
+ var _context20;
552
569
 
553
570
  var readonly = _this2.props.readonly;
554
571
  props.required = control.required || false;
555
- props.onFileChange = (0, _bind["default"])(_context17 = _this2.onFileChange).call(_context17, (0, _assertThisInitialized2["default"])(_this2), control);
572
+ props.onFileChange = (0, _bind["default"])(_context20 = _this2.onFileChange).call(_context20, (0, _assertThisInitialized2["default"])(_this2), control);
556
573
  props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
557
574
  return readonlyKey === control.key;
558
575
  }) ? true : false;
@@ -633,9 +650,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
633
650
  key = _ref11.key;
634
651
 
635
652
  if (showAdd && type !== 'readonly') {
636
- var _context18;
653
+ var _context21;
637
654
 
638
- var onClick = (0, _bind["default"])(_context18 = _this2.onAdd).call(_context18, (0, _assertThisInitialized2["default"])(_this2), key, title);
655
+ var onClick = (0, _bind["default"])(_context21 = _this2.onAdd).call(_context21, (0, _assertThisInitialized2["default"])(_this2), key, title);
639
656
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
640
657
  role: "add",
641
658
  type: "plus-circle-o",
@@ -694,7 +711,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
694
711
  });
695
712
  });
696
713
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
697
- var _context19;
714
+ var _context22;
698
715
 
699
716
  var _this2$props4 = _this2.props,
700
717
  _this2$props4$colNum = _this2$props4.colNum,
@@ -706,7 +723,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
706
723
  }
707
724
 
708
725
  var span = 24 / colNum;
709
- return (0, _map["default"])(_context19 = _this2.getControls()).call(_context19, function (control) {
726
+ return (0, _map["default"])(_context22 = _this2.getControls()).call(_context22, function (control) {
710
727
  if (allFullFather) {
711
728
  control.allFullFather = allFullFather;
712
729
  }
@@ -752,7 +769,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
752
769
  onOpenChange: _propTypes["default"].func,
753
770
  onGetCode: _propTypes["default"].func,
754
771
  onFileChange: _propTypes["default"].func,
755
- onAreaSearch: _propTypes["default"].func
772
+ onAreaSearch: _propTypes["default"].func,
773
+ buildSuperUploadProps: _propTypes["default"].func //构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
774
+
756
775
  });
757
776
  var _default = SuperForm2;
758
777
  exports["default"] = _default;
@@ -1,30 +1,30 @@
1
- @import '../variables.less';
2
-
3
- .@{cloudlink-prefix}-FilterDropDown {
4
- background: white;
5
- padding: @padding-vertical @padding-horizontal;
6
- border-radius: @border-radius-base;
7
- border: 1px solid #d9d9d9;
8
-
9
- > :first-child {
10
- width: 135px;
11
- margin-right: 10px;
12
- }
13
- .date{
14
- background: white;
15
- padding: @padding-vertical @padding-horizontal;
16
- border-radius: @border-radius-base;
17
- border: 1px solid #d9d9d9;
18
-
19
- > :first-child > div {
20
- display: inline-block;
21
- }
22
-
23
- > :last-child {
24
- text-align: right;
25
- margin-top: 5px;
26
- }
27
- }
28
- }
29
-
30
-
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-FilterDropDown {
4
+ background: white;
5
+ padding: @padding-vertical @padding-horizontal;
6
+ border-radius: @border-radius-base;
7
+ border: 1px solid #d9d9d9;
8
+
9
+ > :first-child {
10
+ width: 135px;
11
+ margin-right: 10px;
12
+ }
13
+ .date{
14
+ background: white;
15
+ padding: @padding-vertical @padding-horizontal;
16
+ border-radius: @border-radius-base;
17
+ border: 1px solid #d9d9d9;
18
+
19
+ > :first-child > div {
20
+ display: inline-block;
21
+ }
22
+
23
+ > :last-child {
24
+ text-align: right;
25
+ margin-top: 5px;
26
+ }
27
+ }
28
+ }
29
+
30
+
@@ -1,6 +1,6 @@
1
- {
2
- "name": "SuperTable",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./SuperTable.js"
6
- }
1
+ {
2
+ "name": "SuperTable",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperTable.js"
6
+ }
@@ -478,14 +478,16 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
478
478
  return value ? typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("img", {
479
479
  src: value,
480
480
  style: {
481
- maxWidth: '100px'
481
+ width: '80px',
482
+ height: '80px'
482
483
  }
483
484
  }) : /*#__PURE__*/_react["default"].createElement("div", {
484
485
  role: 'imgBox'
485
486
  }, /*#__PURE__*/_react["default"].createElement("img", {
486
487
  src: value.img,
487
488
  style: {
488
- maxWidth: '100px'
489
+ width: '80px',
490
+ height: '80px'
489
491
  }
490
492
  }), /*#__PURE__*/_react["default"].createElement("span", null, value.title)) : /*#__PURE__*/_react["default"].createElement("div", null);
491
493
 
@@ -1,6 +1,6 @@
1
- {
2
- "name": "SuperTable2",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./SuperTable2.js"
6
- }
1
+ {
2
+ "name": "SuperTable2",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SuperTable2.js"
6
+ }
@@ -58,8 +58,6 @@ var _Title = _interopRequireDefault(require("../Title"));
58
58
 
59
59
  var _variables = _interopRequireDefault(require("../variables"));
60
60
 
61
- var _this = void 0;
62
-
63
61
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
64
62
 
65
63
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -160,6 +158,9 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
160
158
  while (1) {
161
159
  switch (_context2.prev = _context2.next) {
162
160
  case 0:
161
+ props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList, onFileChange);
162
+
163
+ case 1:
163
164
  case "end":
164
165
  return _context2.stop();
165
166
  }
@@ -173,7 +174,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
173
174
  }();
174
175
 
175
176
  return {
176
- action: _this.props.action || '/api/proxy/zuul/ict-service/file/upload/document',
177
+ action: props.action || '/api/proxy/zuul/archiver-service/file/upload/document',
177
178
  fileList: fileList,
178
179
  listType: listType,
179
180
  multiple: multiple,
@@ -211,7 +212,11 @@ function UploadButton(_ref3) {
211
212
  _ref3$limitNumber = _ref3.limitNumber,
212
213
  limitNumber = _ref3$limitNumber === void 0 ? 10 : _ref3$limitNumber,
213
214
  _ref3$listType = _ref3.listType,
214
- listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType;
215
+ listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType,
216
+ _ref3$needText = _ref3.needText,
217
+ needText = _ref3$needText === void 0 ? false : _ref3$needText,
218
+ _ref3$remark = _ref3.remark,
219
+ remark = _ref3$remark === void 0 ? '大小>=5M' : _ref3$remark;
215
220
  var canUpload = fileList.length < limitNumber;
216
221
  return canUpload ? listType === 'picture-card' ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
217
222
  type: "plus"
@@ -233,8 +238,6 @@ function UploadButton(_ref3) {
233
238
  }
234
239
 
235
240
  function SuperUpload(props) {
236
- var _this2 = this;
237
-
238
241
  var _useState = (0, _react.useState)(true),
239
242
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
240
243
  loading = _useState2[0],
@@ -245,7 +248,6 @@ function SuperUpload(props) {
245
248
  fileList = _useState4[0],
246
249
  setFileList = _useState4[1];
247
250
 
248
- var getFileList = this.props.getFileList;
249
251
  (0, _react.useEffect)(function () {
250
252
  function fetchImgData() {
251
253
  return _fetchImgData.apply(this, arguments);
@@ -258,15 +260,28 @@ function SuperUpload(props) {
258
260
  while (1) {
259
261
  switch (_context3.prev = _context3.next) {
260
262
  case 0:
261
- _context3.next = 2;
262
- return getFileList(props.fileList);
263
+ if (!props.getFileList) {
264
+ _context3.next = 6;
265
+ break;
266
+ }
267
+
268
+ _context3.next = 3;
269
+ return props.getFileList(props.fileList);
270
+
271
+ case 3:
272
+ _context3.t0 = _context3.sent;
273
+ _context3.next = 7;
274
+ break;
275
+
276
+ case 6:
277
+ _context3.t0 = [];
263
278
 
264
- case 2:
265
- initFileList = _context3.sent;
279
+ case 7:
280
+ initFileList = _context3.t0;
266
281
  setFileList(initFileList);
267
282
  setLoading(false);
268
283
 
269
- case 5:
284
+ case 10:
270
285
  case "end":
271
286
  return _context3.stop();
272
287
  }
@@ -281,15 +296,13 @@ function SuperUpload(props) {
281
296
 
282
297
  var onPreview = /*#__PURE__*/function () {
283
298
  var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(file) {
284
- var onPreview;
285
299
  return _regenerator["default"].wrap(function _callee3$(_context4) {
286
300
  while (1) {
287
301
  switch (_context4.prev = _context4.next) {
288
302
  case 0:
289
- onPreview = _this2.props.onPreview;
290
- onPreview && onPreview(file);
303
+ props.onPreview && props.onPreview(file, fileList);
291
304
 
292
- case 2:
305
+ case 1:
293
306
  case "end":
294
307
  return _context4.stop();
295
308
  }
@@ -317,7 +330,7 @@ function SuperUpload(props) {
317
330
  required: props.required
318
331
  }) : null, /*#__PURE__*/_react["default"].createElement(_upload["default"], uploadProps, readonly ? null : /*#__PURE__*/_react["default"].createElement(UploadButton, _objectSpread(_objectSpread({}, props), {}, {
319
332
  fileList: fileList
320
- }))));
333
+ }))), props.needText ? /*#__PURE__*/_react["default"].createElement("span", null, props.remark) : null);
321
334
  }
322
335
 
323
336
  var _default = SuperUpload;