cloud-b2b 1.1.54 → 1.1.56
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.
|
@@ -25,6 +25,7 @@ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
|
25
25
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
26
26
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
27
27
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
28
|
+
import _Radio from "antd/es/radio";
|
|
28
29
|
var _excluded = ["onRowClick"];
|
|
29
30
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
30
31
|
function _unsupportedIterableToArray(o, minLen) { var _context20; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context20 = Object.prototype.toString.call(o)).call(_context20, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -33,8 +34,8 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
|
|
|
33
34
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
34
35
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
35
36
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
36
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
37
37
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
38
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
38
39
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
39
40
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
40
41
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
@@ -52,17 +53,18 @@ import SuperToolbar from '../SuperToolbar';
|
|
|
52
53
|
import variables from '../variables';
|
|
53
54
|
import helper, { getObjectExclude } from '../helper';
|
|
54
55
|
import DragSortRow from "../SuperTable/DragSortRow";
|
|
56
|
+
var RadioGroup = _Radio.Group;
|
|
55
57
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
56
58
|
//存储value
|
|
57
59
|
'selectText',
|
|
58
60
|
//存储title
|
|
59
61
|
'search', 'searchText', 'selectSearch',
|
|
60
62
|
//多选下拉搜索
|
|
61
|
-
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
63
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'cascader', 'toolbar',
|
|
62
64
|
//按钮组
|
|
63
65
|
'img',
|
|
64
66
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
65
|
-
'uploadImg', 'double'];
|
|
67
|
+
'uploadImg', 'double', 'radioGroup'];
|
|
66
68
|
|
|
67
69
|
/**
|
|
68
70
|
* key:标识所在列,在一个表格中必须唯一
|
|
@@ -240,6 +242,25 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
240
242
|
return true;
|
|
241
243
|
}
|
|
242
244
|
});
|
|
245
|
+
_defineProperty(_assertThisInitialized(_this), "toRadio", function (_ref12, index) {
|
|
246
|
+
var value = _ref12.value,
|
|
247
|
+
title = _ref12.title;
|
|
248
|
+
return /*#__PURE__*/React.createElement(_Radio, {
|
|
249
|
+
key: index,
|
|
250
|
+
value: String(value)
|
|
251
|
+
}, title);
|
|
252
|
+
});
|
|
253
|
+
_defineProperty(_assertThisInitialized(_this), "renderRadioGroup", function (config, value, index) {
|
|
254
|
+
var key = config.key,
|
|
255
|
+
options = config.options;
|
|
256
|
+
var radioGroupProps = {
|
|
257
|
+
onChange: function onChange(e) {
|
|
258
|
+
_this.onChange(key, index)(e.target.value);
|
|
259
|
+
},
|
|
260
|
+
value: value
|
|
261
|
+
};
|
|
262
|
+
return /*#__PURE__*/React.createElement(RadioGroup, radioGroupProps, _mapInstanceProperty(options).call(options, _this.toRadio));
|
|
263
|
+
});
|
|
243
264
|
_defineProperty(_assertThisInitialized(_this), "renderEditableCell", function (config, value, index) {
|
|
244
265
|
var key = config.key,
|
|
245
266
|
type = config.type,
|
|
@@ -373,8 +394,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
373
394
|
var _context2;
|
|
374
395
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
375
396
|
var onClick = function onClick() {
|
|
376
|
-
var
|
|
377
|
-
onLink =
|
|
397
|
+
var _ref13 = _this.props.callback || {},
|
|
398
|
+
onLink = _ref13.onLink;
|
|
378
399
|
onLink && onLink(col.key, index, item2);
|
|
379
400
|
};
|
|
380
401
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -385,8 +406,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
385
406
|
} else {
|
|
386
407
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
387
408
|
var onClick = function onClick() {
|
|
388
|
-
var
|
|
389
|
-
onLink =
|
|
409
|
+
var _ref14 = _this.props.callback || {},
|
|
410
|
+
onLink = _ref14.onLink;
|
|
390
411
|
onLink && onLink(col.key, index, record);
|
|
391
412
|
};
|
|
392
413
|
return /*#__PURE__*/React.createElement("a", {
|
|
@@ -452,6 +473,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
452
473
|
type: col.bsStyle
|
|
453
474
|
}, record[col.key] || col.typeRelated);
|
|
454
475
|
}
|
|
476
|
+
case 'radioGroup':
|
|
477
|
+
return _this.renderRadioGroup(col, value, record.key);
|
|
455
478
|
case 'switch':
|
|
456
479
|
return typeof value === 'string' ? /*#__PURE__*/React.createElement("div", null, value) : /*#__PURE__*/React.createElement(_Switch, {
|
|
457
480
|
checkedChildren: col.props.checkedChildren || '',
|
|
@@ -571,12 +594,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
571
594
|
return null;
|
|
572
595
|
}
|
|
573
596
|
});
|
|
574
|
-
_defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (
|
|
575
|
-
var required =
|
|
576
|
-
title =
|
|
577
|
-
type =
|
|
578
|
-
key =
|
|
579
|
-
showAdd =
|
|
597
|
+
_defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref15) {
|
|
598
|
+
var required = _ref15.required,
|
|
599
|
+
title = _ref15.title,
|
|
600
|
+
type = _ref15.type,
|
|
601
|
+
key = _ref15.key,
|
|
602
|
+
showAdd = _ref15.showAdd;
|
|
580
603
|
if (type === 'checkbox') {
|
|
581
604
|
var status = _this.getCheckedStatus(key);
|
|
582
605
|
return /*#__PURE__*/React.createElement(_Checkbox, _extends({
|
|
@@ -589,9 +612,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
589
612
|
}, title, _this.toAdd(key, showAdd));
|
|
590
613
|
}
|
|
591
614
|
});
|
|
592
|
-
_defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (
|
|
593
|
-
var type =
|
|
594
|
-
align =
|
|
615
|
+
_defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref16) {
|
|
616
|
+
var type = _ref16.type,
|
|
617
|
+
align = _ref16.align;
|
|
595
618
|
if (type === 'index' || type === 'checkbox') {
|
|
596
619
|
return 'ant-table-selection-column';
|
|
597
620
|
} else {
|
|
@@ -607,9 +630,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
607
630
|
var readonly = _this.props.readonly;
|
|
608
631
|
return _mapInstanceProperty(_context12 = _filterInstanceProperty(cols).call(cols, function (col) {
|
|
609
632
|
return !col.hide;
|
|
610
|
-
})).call(_context12, function (
|
|
633
|
+
})).call(_context12, function (_ref17, index) {
|
|
611
634
|
var _context13;
|
|
612
|
-
var col = _extends({}, (_objectDestructuringEmpty(
|
|
635
|
+
var col = _extends({}, (_objectDestructuringEmpty(_ref17), _ref17));
|
|
613
636
|
col.className = _this.getColumnClassName(col);
|
|
614
637
|
col.title = _this.getColumnTitle(col);
|
|
615
638
|
col.dataIndex = col.key;
|
|
@@ -639,17 +662,26 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
639
662
|
return col;
|
|
640
663
|
});
|
|
641
664
|
});
|
|
665
|
+
_defineProperty(_assertThisInitialized(_this), "getText", function (value, options) {
|
|
666
|
+
if (_Array$isArray(value)) {
|
|
667
|
+
return _mapInstanceProperty(value).call(value, function (v) {
|
|
668
|
+
return getTitle(v, options);
|
|
669
|
+
}).toString();
|
|
670
|
+
} else {
|
|
671
|
+
return getTitle(value, options);
|
|
672
|
+
}
|
|
673
|
+
});
|
|
642
674
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
643
675
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
644
|
-
return _reduceInstanceProperty(cols).call(cols, function (result,
|
|
676
|
+
return _reduceInstanceProperty(cols).call(cols, function (result, _ref18) {
|
|
645
677
|
var _context14, _context15;
|
|
646
|
-
var key =
|
|
647
|
-
type =
|
|
648
|
-
options =
|
|
678
|
+
var key = _ref18.key,
|
|
679
|
+
type = _ref18.type,
|
|
680
|
+
options = _ref18.options;
|
|
649
681
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context14 = item.isReadonly).call(_context14, key)) || _includesInstanceProperty(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
|
|
650
682
|
result[key] = item[key];
|
|
651
683
|
} else {
|
|
652
|
-
result[key] =
|
|
684
|
+
result[key] = _this.getText(item[key], options);
|
|
653
685
|
}
|
|
654
686
|
return result;
|
|
655
687
|
}, _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -118,6 +118,11 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
118
118
|
props.dropdownMatchSelectWidth = false;
|
|
119
119
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
120
120
|
});
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "toCascader", function (props) {
|
|
122
|
+
props.options = _this.options() || [];
|
|
123
|
+
props.onSearch = _this.props.onSearch;
|
|
124
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
125
|
+
});
|
|
121
126
|
_defineProperty(_assertThisInitialized(_this), "controlProps", function (_ref2) {
|
|
122
127
|
var type = _ref2.type,
|
|
123
128
|
value = _ref2.value,
|
|
@@ -174,6 +179,8 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
174
179
|
}, this.toDateComponent(props));
|
|
175
180
|
case 'readonly':
|
|
176
181
|
return this.toReadonlyComponent(props);
|
|
182
|
+
case 'cascader':
|
|
183
|
+
return this.toCascader(props);
|
|
177
184
|
case 'double':
|
|
178
185
|
return /*#__PURE__*/React.createElement("div", {
|
|
179
186
|
className: className
|
|
@@ -25,8 +25,8 @@ var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
|
25
25
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
26
26
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
27
27
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
28
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
29
28
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
29
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
30
30
|
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
|
|
31
31
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
32
32
|
var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
|
|
@@ -45,6 +45,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/
|
|
|
45
45
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
46
46
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
47
47
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
48
|
+
var _radio = _interopRequireDefault(require("antd/lib/radio"));
|
|
48
49
|
var _react = _interopRequireDefault(require("react"));
|
|
49
50
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
50
51
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
@@ -65,17 +66,18 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
|
|
|
65
66
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
66
67
|
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); }; }
|
|
67
68
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
|
+
var RadioGroup = _radio["default"].Group;
|
|
68
70
|
var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
69
71
|
//存储value
|
|
70
72
|
'selectText',
|
|
71
73
|
//存储title
|
|
72
74
|
'search', 'searchText', 'selectSearch',
|
|
73
75
|
//多选下拉搜索
|
|
74
|
-
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
76
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'cascader', 'toolbar',
|
|
75
77
|
//按钮组
|
|
76
78
|
'img',
|
|
77
79
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
78
|
-
'uploadImg', 'double'];
|
|
80
|
+
'uploadImg', 'double', 'radioGroup'];
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
83
|
* key:标识所在列,在一个表格中必须唯一
|
|
@@ -253,6 +255,25 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
253
255
|
return true;
|
|
254
256
|
}
|
|
255
257
|
});
|
|
258
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadio", function (_ref12, index) {
|
|
259
|
+
var value = _ref12.value,
|
|
260
|
+
title = _ref12.title;
|
|
261
|
+
return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
|
|
262
|
+
key: index,
|
|
263
|
+
value: String(value)
|
|
264
|
+
}, title);
|
|
265
|
+
});
|
|
266
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderRadioGroup", function (config, value, index) {
|
|
267
|
+
var key = config.key,
|
|
268
|
+
options = config.options;
|
|
269
|
+
var radioGroupProps = {
|
|
270
|
+
onChange: function onChange(e) {
|
|
271
|
+
_this.onChange(key, index)(e.target.value);
|
|
272
|
+
},
|
|
273
|
+
value: value
|
|
274
|
+
};
|
|
275
|
+
return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
|
|
276
|
+
});
|
|
256
277
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
|
|
257
278
|
var key = config.key,
|
|
258
279
|
type = config.type,
|
|
@@ -386,8 +407,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
386
407
|
var _context2;
|
|
387
408
|
var split = index2 === list.length - 1 ? '' : ',';
|
|
388
409
|
var onClick = function onClick() {
|
|
389
|
-
var
|
|
390
|
-
onLink =
|
|
410
|
+
var _ref13 = _this.props.callback || {},
|
|
411
|
+
onLink = _ref13.onLink;
|
|
391
412
|
onLink && onLink(col.key, index, item2);
|
|
392
413
|
};
|
|
393
414
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -398,8 +419,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
398
419
|
} else {
|
|
399
420
|
var title = typeof col.link === 'string' ? col.link : value;
|
|
400
421
|
var onClick = function onClick() {
|
|
401
|
-
var
|
|
402
|
-
onLink =
|
|
422
|
+
var _ref14 = _this.props.callback || {},
|
|
423
|
+
onLink = _ref14.onLink;
|
|
403
424
|
onLink && onLink(col.key, index, record);
|
|
404
425
|
};
|
|
405
426
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -465,6 +486,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
465
486
|
type: col.bsStyle
|
|
466
487
|
}, record[col.key] || col.typeRelated);
|
|
467
488
|
}
|
|
489
|
+
case 'radioGroup':
|
|
490
|
+
return _this.renderRadioGroup(col, value, record.key);
|
|
468
491
|
case 'switch':
|
|
469
492
|
return typeof value === 'string' ? /*#__PURE__*/_react["default"].createElement("div", null, value) : /*#__PURE__*/_react["default"].createElement(_switch["default"], {
|
|
470
493
|
checkedChildren: col.props.checkedChildren || '',
|
|
@@ -584,12 +607,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
584
607
|
return null;
|
|
585
608
|
}
|
|
586
609
|
});
|
|
587
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (
|
|
588
|
-
var required =
|
|
589
|
-
title =
|
|
590
|
-
type =
|
|
591
|
-
key =
|
|
592
|
-
showAdd =
|
|
610
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref15) {
|
|
611
|
+
var required = _ref15.required,
|
|
612
|
+
title = _ref15.title,
|
|
613
|
+
type = _ref15.type,
|
|
614
|
+
key = _ref15.key,
|
|
615
|
+
showAdd = _ref15.showAdd;
|
|
593
616
|
if (type === 'checkbox') {
|
|
594
617
|
var status = _this.getCheckedStatus(key);
|
|
595
618
|
return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
|
|
@@ -602,9 +625,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
602
625
|
}, title, _this.toAdd(key, showAdd));
|
|
603
626
|
}
|
|
604
627
|
});
|
|
605
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (
|
|
606
|
-
var type =
|
|
607
|
-
align =
|
|
628
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref16) {
|
|
629
|
+
var type = _ref16.type,
|
|
630
|
+
align = _ref16.align;
|
|
608
631
|
if (type === 'index' || type === 'checkbox') {
|
|
609
632
|
return 'ant-table-selection-column';
|
|
610
633
|
} else {
|
|
@@ -620,9 +643,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
620
643
|
var readonly = _this.props.readonly;
|
|
621
644
|
return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
|
|
622
645
|
return !col.hide;
|
|
623
|
-
})).call(_context12, function (
|
|
646
|
+
})).call(_context12, function (_ref17, index) {
|
|
624
647
|
var _context13;
|
|
625
|
-
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(
|
|
648
|
+
var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref17), _ref17));
|
|
626
649
|
col.className = _this.getColumnClassName(col);
|
|
627
650
|
col.title = _this.getColumnTitle(col);
|
|
628
651
|
col.dataIndex = col.key;
|
|
@@ -652,17 +675,26 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
652
675
|
return col;
|
|
653
676
|
});
|
|
654
677
|
});
|
|
678
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
|
|
679
|
+
if ((0, _isArray["default"])(value)) {
|
|
680
|
+
return (0, _map["default"])(value).call(value, function (v) {
|
|
681
|
+
return (0, _Control.getTitle)(v, options);
|
|
682
|
+
}).toString();
|
|
683
|
+
} else {
|
|
684
|
+
return (0, _Control.getTitle)(value, options);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
655
687
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
656
688
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
657
|
-
return (0, _reduce["default"])(cols).call(cols, function (result,
|
|
689
|
+
return (0, _reduce["default"])(cols).call(cols, function (result, _ref18) {
|
|
658
690
|
var _context14, _context15;
|
|
659
|
-
var key =
|
|
660
|
-
type =
|
|
661
|
-
options =
|
|
691
|
+
var key = _ref18.key,
|
|
692
|
+
type = _ref18.type,
|
|
693
|
+
options = _ref18.options;
|
|
662
694
|
if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context14 = item.isReadonly).call(_context14, key)) || (0, _includes["default"])(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
|
|
663
695
|
result[key] = item[key];
|
|
664
696
|
} else {
|
|
665
|
-
result[key] =
|
|
697
|
+
result[key] = _this.getText(item[key], options);
|
|
666
698
|
}
|
|
667
699
|
return result;
|
|
668
700
|
}, _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -124,6 +124,11 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
124
124
|
props.dropdownMatchSelectWidth = false;
|
|
125
125
|
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
126
126
|
});
|
|
127
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCascader", function (props) {
|
|
128
|
+
props.options = _this.options() || [];
|
|
129
|
+
props.onSearch = _this.props.onSearch;
|
|
130
|
+
return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
|
|
131
|
+
});
|
|
127
132
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "controlProps", function (_ref2) {
|
|
128
133
|
var type = _ref2.type,
|
|
129
134
|
value = _ref2.value,
|
|
@@ -180,6 +185,8 @@ var SuperTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
180
185
|
}, this.toDateComponent(props));
|
|
181
186
|
case 'readonly':
|
|
182
187
|
return this.toReadonlyComponent(props);
|
|
188
|
+
case 'cascader':
|
|
189
|
+
return this.toCascader(props);
|
|
183
190
|
case 'double':
|
|
184
191
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
192
|
className: className
|