cloud-b2b 1.1.1 → 1.1.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.
@@ -334,16 +334,11 @@ var captcha = function captcha(props) {
334
334
  };
335
335
 
336
336
  var uploadImg = function uploadImg(props) {
337
- var uploadProps = {
337
+ var uploadProps = _objectSpread(_objectSpread({}, props), {}, {
338
338
  fileList: props.value || [],
339
- required: props.require,
340
- multiple: false,
341
- limitNumber: props.limitNumber || 10,
342
- onFileChange: props.onFileChange,
343
- needText: props.needText,
344
- remark: props.remark,
345
339
  readonly: props.readonly || false
346
- };
340
+ });
341
+
347
342
  return /*#__PURE__*/React.createElement(SuperUpload, uploadProps);
348
343
  }; // 支持的控件类型
349
344
 
@@ -45,7 +45,7 @@ import variables from '../variables';
45
45
  var FormItem = _Form.Item;
46
46
  var defaultSize = 'small';
47
47
  var defaultColNum = 4;
48
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg'];
48
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg', 'cascader'];
49
49
  /**
50
50
  * key:[必须],用于唯一标识该Form下的一个表单元素
51
51
  * title:[必须],表单元素的标签
@@ -256,6 +256,10 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
256
256
  return colNum * 250;
257
257
  });
258
258
 
259
+ _defineProperty(_assertThisInitialized(_this2), "getContainer", function () {
260
+ return _this2.props.getContainer;
261
+ });
262
+
259
263
  _defineProperty(_assertThisInitialized(_this2), "getControls", function () {
260
264
  var _this2$props2 = _this2.props,
261
265
  hideControls = _this2$props2.hideControls,
@@ -515,6 +519,17 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
515
519
  return /*#__PURE__*/React.createElement(Control, props);
516
520
  });
517
521
 
522
+ _defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
523
+ var container = _this2.getContainer();
524
+
525
+ container && (props.getPopupContainer = container);
526
+ props.options = control.options || [];
527
+ props.onSearch = _this2.createSearchEvent(control);
528
+ props.placeholder = props.placeholder || '';
529
+ props.loadData = _this2.createSearchEvent(control);
530
+ return /*#__PURE__*/React.createElement(Control, props);
531
+ });
532
+
518
533
  _defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
519
534
  switch (props.type) {
520
535
  case 'readonly':
@@ -564,6 +579,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
564
579
  case 'uploadImg':
565
580
  return _this2.uploadImg(props, control);
566
581
 
582
+ case 'cascader':
583
+ return _this2.toCascader(props, control);
584
+
567
585
  default:
568
586
  return 'type error';
569
587
  }
@@ -30,7 +30,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
30
30
 
31
31
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
32
 
33
- 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) { _defineProperty(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; }
33
+ 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) { _defineProperty(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; }
34
34
 
35
35
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
36
36
 
@@ -45,7 +45,7 @@ import variables from '../variables';
45
45
  var FormItem = _Form.Item;
46
46
  var defaultSize = 'small';
47
47
  var defaultColNum = 4;
48
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg'];
48
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
49
49
  /**
50
50
  * key:[必须],用于唯一标识该Form下的一个表单元素
51
51
  * title:[必须],表单元素的标签
@@ -267,6 +267,10 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
267
267
  return colNum * 1200;
268
268
  });
269
269
 
270
+ _defineProperty(_assertThisInitialized(_this2), "getContainer", function () {
271
+ return _this2.props.getContainer;
272
+ });
273
+
270
274
  _defineProperty(_assertThisInitialized(_this2), "getControls", function () {
271
275
  var _this2$props2 = _this2.props,
272
276
  hideControls = _this2$props2.hideControls,
@@ -320,57 +324,74 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
320
324
  readonly: true,
321
325
  onBlur: _bindInstanceProperty(_context3 = _this2.onExitValid).call(_context3, _assertThisInitialized(_this2), key)
322
326
  };
323
- } else {
327
+ } else if (originType === 'uploadImg') {
324
328
  var _context4;
325
329
 
326
- return {
330
+ var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
331
+ return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
332
+ readonly: true,
327
333
  onBlur: _bindInstanceProperty(_context4 = _this2.onExitValid).call(_context4, _assertThisInitialized(_this2), key)
334
+ });
335
+ } else {
336
+ var _context5;
337
+
338
+ return {
339
+ onBlur: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key)
328
340
  };
329
341
  }
330
342
  } else if (type === 'text' || type === 'textArea') {
331
- var _context5, _context6;
343
+ var _context6, _context7;
332
344
 
333
345
  return _objectSpread(_objectSpread({}, props), {}, {
334
- onChange: _bindInstanceProperty(_context5 = _this2.onExitValid).call(_context5, _assertThisInitialized(_this2), key),
335
- onBlur: _bindInstanceProperty(_context6 = _this2.onChange).call(_context6, _assertThisInitialized(_this2), key)
346
+ onChange: _bindInstanceProperty(_context6 = _this2.onExitValid).call(_context6, _assertThisInitialized(_this2), key),
347
+ onBlur: _bindInstanceProperty(_context7 = _this2.onChange).call(_context7, _assertThisInitialized(_this2), key)
336
348
  });
337
349
  } else if (type === 'date') {
338
- var _context7, _context8;
350
+ var _context8, _context9;
339
351
 
340
352
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
341
- onChange: _bindInstanceProperty(_context7 = _this2.onBlur).call(_context7, _assertThisInitialized(_this2), key),
342
- onBlur: _bindInstanceProperty(_context8 = _this2.onExitValid).call(_context8, _assertThisInitialized(_this2), key)
353
+ onChange: _bindInstanceProperty(_context8 = _this2.onBlur).call(_context8, _assertThisInitialized(_this2), key),
354
+ onBlur: _bindInstanceProperty(_context9 = _this2.onExitValid).call(_context9, _assertThisInitialized(_this2), key)
343
355
  });
344
356
 
345
357
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
346
- var _context9;
358
+ var _context10;
347
359
 
348
- propsObj.onOpenChange = _bindInstanceProperty(_context9 = _this2.props.onOpenChange).call(_context9, _assertThisInitialized(_this2), key);
360
+ propsObj.onOpenChange = _bindInstanceProperty(_context10 = _this2.props.onOpenChange).call(_context10, _assertThisInitialized(_this2), key);
349
361
  }
350
362
 
351
363
  return propsObj;
352
364
  } else if (type === 'captcha') {
353
- var _context10, _context11, _context12;
365
+ var _context11, _context12, _context13;
354
366
 
355
367
  return _objectSpread(_objectSpread({}, props), {}, {
356
- onChange: _bindInstanceProperty(_context10 = _this2.onBlur).call(_context10, _assertThisInitialized(_this2), key),
357
- onBlur: _bindInstanceProperty(_context11 = _this2.onExitValid).call(_context11, _assertThisInitialized(_this2), key),
358
- onGetCode: _bindInstanceProperty(_context12 = _this2.onGetCode).call(_context12, _assertThisInitialized(_this2), key)
368
+ onChange: _bindInstanceProperty(_context11 = _this2.onBlur).call(_context11, _assertThisInitialized(_this2), key),
369
+ onBlur: _bindInstanceProperty(_context12 = _this2.onExitValid).call(_context12, _assertThisInitialized(_this2), key),
370
+ onGetCode: _bindInstanceProperty(_context13 = _this2.onGetCode).call(_context13, _assertThisInitialized(_this2), key)
359
371
  });
360
372
  } else if (type === 'area') {
361
- var _context13, _context14;
373
+ var _context14, _context15;
362
374
 
363
375
  return _objectSpread(_objectSpread({}, props), {}, {
364
- onChange: _bindInstanceProperty(_context13 = _this2.onBlur).call(_context13, _assertThisInitialized(_this2), key),
365
- onBlur: _bindInstanceProperty(_context14 = _this2.onExitValid).call(_context14, _assertThisInitialized(_this2), key),
376
+ onChange: _bindInstanceProperty(_context14 = _this2.onBlur).call(_context14, _assertThisInitialized(_this2), key),
377
+ onBlur: _bindInstanceProperty(_context15 = _this2.onExitValid).call(_context15, _assertThisInitialized(_this2), key),
366
378
  onAreaSearch: _this2.props.onAreaSearch
367
379
  });
380
+ } else if (type === 'uploadImg') {
381
+ var _context16, _context17;
382
+
383
+ var _commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
384
+
385
+ return _objectSpread(_objectSpread(_objectSpread({}, props), _commonProps), {}, {
386
+ onChange: _bindInstanceProperty(_context16 = _this2.onBlur).call(_context16, _assertThisInitialized(_this2), key),
387
+ onBlur: _bindInstanceProperty(_context17 = _this2.onExitValid).call(_context17, _assertThisInitialized(_this2), key)
388
+ });
368
389
  } else {
369
- var _context15, _context16;
390
+ var _context18, _context19;
370
391
 
371
392
  return _objectSpread(_objectSpread({}, props), {}, {
372
- onChange: _bindInstanceProperty(_context15 = _this2.onBlur).call(_context15, _assertThisInitialized(_this2), key),
373
- onBlur: _bindInstanceProperty(_context16 = _this2.onExitValid).call(_context16, _assertThisInitialized(_this2), key)
393
+ onChange: _bindInstanceProperty(_context18 = _this2.onBlur).call(_context18, _assertThisInitialized(_this2), key),
394
+ onBlur: _bindInstanceProperty(_context19 = _this2.onExitValid).call(_context19, _assertThisInitialized(_this2), key)
374
395
  });
375
396
  }
376
397
  });
@@ -528,17 +549,28 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
528
549
  });
529
550
 
530
551
  _defineProperty(_assertThisInitialized(_this2), "uploadImg", function (props, control) {
531
- var _context17;
552
+ var _context20;
532
553
 
533
554
  var readonly = _this2.props.readonly;
534
555
  props.required = control.required || false;
535
- props.onFileChange = _bindInstanceProperty(_context17 = _this2.onFileChange).call(_context17, _assertThisInitialized(_this2), control);
556
+ props.onFileChange = _bindInstanceProperty(_context20 = _this2.onFileChange).call(_context20, _assertThisInitialized(_this2), control);
536
557
  props.readonly = readonly === true || _Array$isArray(readonly) && _someInstanceProperty(readonly).call(readonly, function (readonlyKey) {
537
558
  return readonlyKey === control.key;
538
559
  }) ? true : false;
539
560
  return /*#__PURE__*/React.createElement(Control, props);
540
561
  });
541
562
 
563
+ _defineProperty(_assertThisInitialized(_this2), "toCascader", function (props, control) {
564
+ var container = _this2.getContainer();
565
+
566
+ container && (props.getPopupContainer = container);
567
+ props.options = control.options || [];
568
+ props.onSearch = _this2.createSearchEvent(control);
569
+ props.placeholder = props.placeholder || '';
570
+ props.loadData = _this2.createSearchEvent(control);
571
+ return /*#__PURE__*/React.createElement(Control, props);
572
+ });
573
+
542
574
  _defineProperty(_assertThisInitialized(_this2), "toControl", function (props, control) {
543
575
  switch (props.type) {
544
576
  case 'readonly':
@@ -591,6 +623,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
591
623
  case 'uploadImg':
592
624
  return _this2.uploadImg(props, control);
593
625
 
626
+ case 'cascader':
627
+ return _this2.toCascader(props, control);
628
+
594
629
  default:
595
630
  return 'type error';
596
631
  }
@@ -602,9 +637,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
602
637
  key = _ref11.key;
603
638
 
604
639
  if (showAdd && type !== 'readonly') {
605
- var _context18;
640
+ var _context21;
606
641
 
607
- var onClick = _bindInstanceProperty(_context18 = _this2.onAdd).call(_context18, _assertThisInitialized(_this2), key, title);
642
+ var onClick = _bindInstanceProperty(_context21 = _this2.onAdd).call(_context21, _assertThisInitialized(_this2), key, title);
608
643
 
609
644
  return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
610
645
  role: "add",
@@ -666,7 +701,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
666
701
  });
667
702
 
668
703
  _defineProperty(_assertThisInitialized(_this2), "toCols", function () {
669
- var _context19;
704
+ var _context22;
670
705
 
671
706
  var _this2$props4 = _this2.props,
672
707
  _this2$props4$colNum = _this2$props4.colNum,
@@ -678,7 +713,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
678
713
  }
679
714
 
680
715
  var span = 24 / colNum;
681
- return _mapInstanceProperty(_context19 = _this2.getControls()).call(_context19, function (control) {
716
+ return _mapInstanceProperty(_context22 = _this2.getControls()).call(_context22, function (control) {
682
717
  if (allFullFather) {
683
718
  control.allFullFather = allFullFather;
684
719
  }
@@ -726,7 +761,9 @@ _defineProperty(SuperForm2, "propTypes", {
726
761
  onOpenChange: PropTypes.func,
727
762
  onGetCode: PropTypes.func,
728
763
  onFileChange: PropTypes.func,
729
- onAreaSearch: PropTypes.func
764
+ onAreaSearch: PropTypes.func,
765
+ buildSuperUploadProps: PropTypes.func //构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
766
+
730
767
  });
731
768
 
732
769
  export default SuperForm2;
@@ -4,9 +4,6 @@ import _Button from "antd/es/button";
4
4
  import _Icon from "antd/es/icon";
5
5
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
6
6
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
7
-
8
- var _this = this;
9
-
10
7
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
11
8
 
12
9
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -119,6 +116,9 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
119
116
  while (1) {
120
117
  switch (_context2.prev = _context2.next) {
121
118
  case 0:
119
+ props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList, onFileChange);
120
+
121
+ case 1:
122
122
  case "end":
123
123
  return _context2.stop();
124
124
  }
@@ -132,7 +132,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
132
132
  }();
133
133
 
134
134
  return {
135
- action: _this.props.action || '/api/proxy/zuul/ict-service/file/upload/document',
135
+ action: props.action || '/api/proxy/zuul/archiver-service/file/upload/document',
136
136
  fileList: fileList,
137
137
  listType: listType,
138
138
  multiple: multiple,
@@ -170,7 +170,11 @@ function UploadButton(_ref3) {
170
170
  _ref3$limitNumber = _ref3.limitNumber,
171
171
  limitNumber = _ref3$limitNumber === void 0 ? 10 : _ref3$limitNumber,
172
172
  _ref3$listType = _ref3.listType,
173
- listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType;
173
+ listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType,
174
+ _ref3$needText = _ref3.needText,
175
+ needText = _ref3$needText === void 0 ? false : _ref3$needText,
176
+ _ref3$remark = _ref3.remark,
177
+ remark = _ref3$remark === void 0 ? '大小>=5M' : _ref3$remark;
174
178
  var canUpload = fileList.length < limitNumber;
175
179
  return canUpload ? listType === 'picture-card' ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Icon, {
176
180
  type: "plus"
@@ -192,8 +196,6 @@ function UploadButton(_ref3) {
192
196
  }
193
197
 
194
198
  function SuperUpload(props) {
195
- var _this2 = this;
196
-
197
199
  var _useState = useState(true),
198
200
  _useState2 = _slicedToArray(_useState, 2),
199
201
  loading = _useState2[0],
@@ -204,7 +206,6 @@ function SuperUpload(props) {
204
206
  fileList = _useState4[0],
205
207
  setFileList = _useState4[1];
206
208
 
207
- var getFileList = this.props.getFileList;
208
209
  useEffect(function () {
209
210
  function fetchImgData() {
210
211
  return _fetchImgData.apply(this, arguments);
@@ -217,15 +218,28 @@ function SuperUpload(props) {
217
218
  while (1) {
218
219
  switch (_context3.prev = _context3.next) {
219
220
  case 0:
220
- _context3.next = 2;
221
- return getFileList(props.fileList);
221
+ if (!props.getFileList) {
222
+ _context3.next = 6;
223
+ break;
224
+ }
225
+
226
+ _context3.next = 3;
227
+ return props.getFileList(props.fileList);
228
+
229
+ case 3:
230
+ _context3.t0 = _context3.sent;
231
+ _context3.next = 7;
232
+ break;
233
+
234
+ case 6:
235
+ _context3.t0 = [];
222
236
 
223
- case 2:
224
- initFileList = _context3.sent;
237
+ case 7:
238
+ initFileList = _context3.t0;
225
239
  setFileList(initFileList);
226
240
  setLoading(false);
227
241
 
228
- case 5:
242
+ case 10:
229
243
  case "end":
230
244
  return _context3.stop();
231
245
  }
@@ -240,15 +254,13 @@ function SuperUpload(props) {
240
254
 
241
255
  var onPreview = /*#__PURE__*/function () {
242
256
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
243
- var onPreview;
244
257
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
245
258
  while (1) {
246
259
  switch (_context4.prev = _context4.next) {
247
260
  case 0:
248
- onPreview = _this2.props.onPreview;
249
- onPreview && onPreview(file);
261
+ props.onPreview && props.onPreview(file, fileList);
250
262
 
251
- case 2:
263
+ case 1:
252
264
  case "end":
253
265
  return _context4.stop();
254
266
  }
@@ -276,7 +288,7 @@ function SuperUpload(props) {
276
288
  required: props.required
277
289
  }) : null, /*#__PURE__*/React.createElement(_Upload, uploadProps, readonly ? null : /*#__PURE__*/React.createElement(UploadButton, _objectSpread(_objectSpread({}, props), {}, {
278
290
  fileList: fileList
279
- }))));
291
+ }))), props.needText ? /*#__PURE__*/React.createElement("span", null, props.remark) : null);
280
292
  }
281
293
 
282
294
  export default SuperUpload;
@@ -1,35 +1,35 @@
1
- @import '../variables';
2
-
3
- .@{cloudlink-prefix}-title {
4
- > *:first-child {
5
- display: inline-block;
6
- color: @brand-primary;
7
- line-height: 1.2;
8
-
9
- &[data-border='true'] {
10
- padding: 0 5px;
11
- border-left: @brand-primary solid 3px;
12
- }
13
-
14
- &[data-fold='true'] {
15
- cursor: pointer;
16
- margin: 8px 0;
17
- }
18
-
19
- &[data-required='true'] {
20
- &::after {
21
- display: inline-block;
22
- margin-left: 4px;
23
- color: #f5222d;
24
- font-size: 12px;
25
- font-family: SimSun, sans-serif;
26
- line-height: 1;
27
- content: '*';
28
- }
29
- }
30
- }
31
-
32
- > [role = 'toolbar'] {
33
- display: inline-block;
34
- }
35
- }
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-title {
4
+ > *:first-child {
5
+ display: inline-block;
6
+ color: @brand-primary;
7
+ line-height: 1.2;
8
+
9
+ &[data-border='true'] {
10
+ padding: 0 5px;
11
+ border-left: @brand-primary solid 3px;
12
+ }
13
+
14
+ &[data-fold='true'] {
15
+ cursor: pointer;
16
+ margin: 8px 0;
17
+ }
18
+
19
+ &[data-required='true'] {
20
+ &::after {
21
+ display: inline-block;
22
+ margin-left: 4px;
23
+ color: #f5222d;
24
+ font-size: 12px;
25
+ font-family: SimSun, sans-serif;
26
+ line-height: 1;
27
+ content: '*';
28
+ }
29
+ }
30
+ }
31
+
32
+ > [role = 'toolbar'] {
33
+ display: inline-block;
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Title",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Title.js"
6
- }
1
+ {
2
+ "name": "Title",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Title.js"
6
+ }
@@ -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
 
@@ -99,7 +99,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
99
99
  var FormItem = _form["default"].Item;
100
100
  var defaultSize = 'small';
101
101
  var defaultColNum = 4;
102
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg'];
102
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'area', 'uploadImg', 'cascader'];
103
103
  /**
104
104
  * key:[必须],用于唯一标识该Form下的一个表单元素
105
105
  * title:[必须],表单元素的标签
@@ -297,6 +297,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
297
297
  colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
298
298
  return colNum * 250;
299
299
  });
300
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
301
+ return _this2.props.getContainer;
302
+ });
300
303
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
301
304
  var _this2$props2 = _this2.props,
302
305
  hideControls = _this2$props2.hideControls,
@@ -535,6 +538,16 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
535
538
  }) ? true : false;
536
539
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
537
540
  });
541
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
542
+ var container = _this2.getContainer();
543
+
544
+ container && (props.getPopupContainer = container);
545
+ props.options = control.options || [];
546
+ props.onSearch = _this2.createSearchEvent(control);
547
+ props.placeholder = props.placeholder || '';
548
+ props.loadData = _this2.createSearchEvent(control);
549
+ return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
550
+ });
538
551
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toControl", function (props, control) {
539
552
  switch (props.type) {
540
553
  case 'readonly':
@@ -584,6 +597,9 @@ var SuperForm = /*#__PURE__*/function (_React$Component2) {
584
597
  case 'uploadImg':
585
598
  return _this2.uploadImg(props, control);
586
599
 
600
+ case 'cascader':
601
+ return _this2.toCascader(props, control);
602
+
587
603
  default:
588
604
  return 'type error';
589
605
  }
@@ -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
 
@@ -99,7 +99,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
99
99
  var FormItem = _form["default"].Item;
100
100
  var defaultSize = 'small';
101
101
  var defaultColNum = 4;
102
- var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg'];
102
+ var TYPE = ['readonly', 'text', 'search', 'searchText', 'select', 'selectText', 'radioGroup', 'number', 'date', 'textArea', 'password', 'editor', 'selectWriting', 'selectSearch', 'empty', 'captcha', 'area', 'uploadImg', 'cascader'];
103
103
  /**
104
104
  * key:[必须],用于唯一标识该Form下的一个表单元素
105
105
  * title:[必须],表单元素的标签
@@ -306,6 +306,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
306
306
  colNum = _this2$props$colNum === void 0 ? defaultColNum : _this2$props$colNum;
307
307
  return colNum * 1200;
308
308
  });
309
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getContainer", function () {
310
+ return _this2.props.getContainer;
311
+ });
309
312
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "getControls", function () {
310
313
  var _this2$props2 = _this2.props,
311
314
  hideControls = _this2$props2.hideControls,
@@ -357,57 +360,74 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
357
360
  readonly: true,
358
361
  onBlur: (0, _bind["default"])(_context3 = _this2.onExitValid).call(_context3, (0, _assertThisInitialized2["default"])(_this2), key)
359
362
  };
360
- } else {
363
+ } else if (originType === 'uploadImg') {
361
364
  var _context4;
362
365
 
363
- return {
366
+ var commonProps = _this2.props.buildSuperUploadProps ? _this2.props.buildSuperUploadProps() : {};
367
+ return _objectSpread(_objectSpread(_objectSpread({}, props), commonProps), {}, {
368
+ readonly: true,
364
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)
365
376
  };
366
377
  }
367
378
  } else if (type === 'text' || type === 'textArea') {
368
- var _context5, _context6;
379
+ var _context6, _context7;
369
380
 
370
381
  return _objectSpread(_objectSpread({}, props), {}, {
371
- onChange: (0, _bind["default"])(_context5 = _this2.onExitValid).call(_context5, (0, _assertThisInitialized2["default"])(_this2), key),
372
- 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)
373
384
  });
374
385
  } else if (type === 'date') {
375
- var _context7, _context8;
386
+ var _context8, _context9;
376
387
 
377
388
  var propsObj = _objectSpread(_objectSpread({}, props), {}, {
378
- onChange: (0, _bind["default"])(_context7 = _this2.onBlur).call(_context7, (0, _assertThisInitialized2["default"])(_this2), key),
379
- 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)
380
391
  });
381
392
 
382
393
  if (_this2.props.onOpenChange && typeof _this2.props.onOpenChange === 'function') {
383
- var _context9;
394
+ var _context10;
384
395
 
385
- 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);
386
397
  }
387
398
 
388
399
  return propsObj;
389
400
  } else if (type === 'captcha') {
390
- var _context10, _context11, _context12;
401
+ var _context11, _context12, _context13;
391
402
 
392
403
  return _objectSpread(_objectSpread({}, props), {}, {
393
- onChange: (0, _bind["default"])(_context10 = _this2.onBlur).call(_context10, (0, _assertThisInitialized2["default"])(_this2), key),
394
- onBlur: (0, _bind["default"])(_context11 = _this2.onExitValid).call(_context11, (0, _assertThisInitialized2["default"])(_this2), key),
395
- 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)
396
407
  });
397
408
  } else if (type === 'area') {
398
- var _context13, _context14;
409
+ var _context14, _context15;
399
410
 
400
411
  return _objectSpread(_objectSpread({}, props), {}, {
401
- onChange: (0, _bind["default"])(_context13 = _this2.onBlur).call(_context13, (0, _assertThisInitialized2["default"])(_this2), key),
402
- 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),
403
414
  onAreaSearch: _this2.props.onAreaSearch
404
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
+ });
405
425
  } else {
406
- var _context15, _context16;
426
+ var _context18, _context19;
407
427
 
408
428
  return _objectSpread(_objectSpread({}, props), {}, {
409
- onChange: (0, _bind["default"])(_context15 = _this2.onBlur).call(_context15, (0, _assertThisInitialized2["default"])(_this2), key),
410
- 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)
411
431
  });
412
432
  }
413
433
  });
@@ -545,16 +565,26 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
545
565
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
546
566
  });
547
567
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "uploadImg", function (props, control) {
548
- var _context17;
568
+ var _context20;
549
569
 
550
570
  var readonly = _this2.props.readonly;
551
571
  props.required = control.required || false;
552
- 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);
553
573
  props.readonly = readonly === true || (0, _isArray["default"])(readonly) && (0, _some["default"])(readonly).call(readonly, function (readonlyKey) {
554
574
  return readonlyKey === control.key;
555
575
  }) ? true : false;
556
576
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
557
577
  });
578
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCascader", function (props, control) {
579
+ var container = _this2.getContainer();
580
+
581
+ container && (props.getPopupContainer = container);
582
+ props.options = control.options || [];
583
+ props.onSearch = _this2.createSearchEvent(control);
584
+ props.placeholder = props.placeholder || '';
585
+ props.loadData = _this2.createSearchEvent(control);
586
+ return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
587
+ });
558
588
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toControl", function (props, control) {
559
589
  switch (props.type) {
560
590
  case 'readonly':
@@ -607,6 +637,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
607
637
  case 'uploadImg':
608
638
  return _this2.uploadImg(props, control);
609
639
 
640
+ case 'cascader':
641
+ return _this2.toCascader(props, control);
642
+
610
643
  default:
611
644
  return 'type error';
612
645
  }
@@ -617,9 +650,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
617
650
  key = _ref11.key;
618
651
 
619
652
  if (showAdd && type !== 'readonly') {
620
- var _context18;
653
+ var _context21;
621
654
 
622
- 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);
623
656
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
624
657
  role: "add",
625
658
  type: "plus-circle-o",
@@ -678,7 +711,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
678
711
  });
679
712
  });
680
713
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "toCols", function () {
681
- var _context19;
714
+ var _context22;
682
715
 
683
716
  var _this2$props4 = _this2.props,
684
717
  _this2$props4$colNum = _this2$props4.colNum,
@@ -690,7 +723,7 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
690
723
  }
691
724
 
692
725
  var span = 24 / colNum;
693
- return (0, _map["default"])(_context19 = _this2.getControls()).call(_context19, function (control) {
726
+ return (0, _map["default"])(_context22 = _this2.getControls()).call(_context22, function (control) {
694
727
  if (allFullFather) {
695
728
  control.allFullFather = allFullFather;
696
729
  }
@@ -736,7 +769,9 @@ var SuperForm2 = /*#__PURE__*/function (_React$Component2) {
736
769
  onOpenChange: _propTypes["default"].func,
737
770
  onGetCode: _propTypes["default"].func,
738
771
  onFileChange: _propTypes["default"].func,
739
- onAreaSearch: _propTypes["default"].func
772
+ onAreaSearch: _propTypes["default"].func,
773
+ buildSuperUploadProps: _propTypes["default"].func //构建type===uploadImg时,SuperUpload组件需要的公共属性函数,已在项目公共文件state.js中提供,可直接引用
774
+
740
775
  });
741
776
  var _default = SuperForm2;
742
777
  exports["default"] = _default;
@@ -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;
@@ -1,35 +1,35 @@
1
- @import '../variables';
2
-
3
- .@{cloudlink-prefix}-title {
4
- > *:first-child {
5
- display: inline-block;
6
- color: @brand-primary;
7
- line-height: 1.2;
8
-
9
- &[data-border='true'] {
10
- padding: 0 5px;
11
- border-left: @brand-primary solid 3px;
12
- }
13
-
14
- &[data-fold='true'] {
15
- cursor: pointer;
16
- margin: 8px 0;
17
- }
18
-
19
- &[data-required='true'] {
20
- &::after {
21
- display: inline-block;
22
- margin-left: 4px;
23
- color: #f5222d;
24
- font-size: 12px;
25
- font-family: SimSun, sans-serif;
26
- line-height: 1;
27
- content: '*';
28
- }
29
- }
30
- }
31
-
32
- > [role = 'toolbar'] {
33
- display: inline-block;
34
- }
35
- }
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-title {
4
+ > *:first-child {
5
+ display: inline-block;
6
+ color: @brand-primary;
7
+ line-height: 1.2;
8
+
9
+ &[data-border='true'] {
10
+ padding: 0 5px;
11
+ border-left: @brand-primary solid 3px;
12
+ }
13
+
14
+ &[data-fold='true'] {
15
+ cursor: pointer;
16
+ margin: 8px 0;
17
+ }
18
+
19
+ &[data-required='true'] {
20
+ &::after {
21
+ display: inline-block;
22
+ margin-left: 4px;
23
+ color: #f5222d;
24
+ font-size: 12px;
25
+ font-family: SimSun, sans-serif;
26
+ line-height: 1;
27
+ content: '*';
28
+ }
29
+ }
30
+ }
31
+
32
+ > [role = 'toolbar'] {
33
+ display: inline-block;
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "name": "Title",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./Title.js"
6
- }
1
+ {
2
+ "name": "Title",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Title.js"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-b2b",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "A react component library dependent antd",
5
5
  "keywords": [
6
6
  "react",