cloud-b2b 1.1.55 → 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.
|
@@ -60,7 +60,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
|
60
60
|
//存储title
|
|
61
61
|
'search', 'searchText', 'selectSearch',
|
|
62
62
|
//多选下拉搜索
|
|
63
|
-
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
63
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'cascader', 'toolbar',
|
|
64
64
|
//按钮组
|
|
65
65
|
'img',
|
|
66
66
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
@@ -662,6 +662,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
662
662
|
return col;
|
|
663
663
|
});
|
|
664
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
|
+
});
|
|
665
674
|
_defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
|
|
666
675
|
return _mapInstanceProperty(items).call(items, function (item, index) {
|
|
667
676
|
return _reduceInstanceProperty(cols).call(cols, function (result, _ref18) {
|
|
@@ -672,7 +681,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
672
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)) {
|
|
673
682
|
result[key] = item[key];
|
|
674
683
|
} else {
|
|
675
|
-
result[key] =
|
|
684
|
+
result[key] = _this.getText(item[key], options);
|
|
676
685
|
}
|
|
677
686
|
return result;
|
|
678
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
|
|
@@ -73,7 +73,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
|
|
|
73
73
|
//存储title
|
|
74
74
|
'search', 'searchText', 'selectSearch',
|
|
75
75
|
//多选下拉搜索
|
|
76
|
-
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'toolbar',
|
|
76
|
+
'date', 'button', 'custom', 'switch', 'textArea', 'link', 'cascader', 'toolbar',
|
|
77
77
|
//按钮组
|
|
78
78
|
'img',
|
|
79
79
|
//图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
|
|
@@ -675,6 +675,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
675
675
|
return col;
|
|
676
676
|
});
|
|
677
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
|
+
});
|
|
678
687
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
|
|
679
688
|
return (0, _map["default"])(items).call(items, function (item, index) {
|
|
680
689
|
return (0, _reduce["default"])(cols).call(cols, function (result, _ref18) {
|
|
@@ -685,7 +694,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
|
|
|
685
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)) {
|
|
686
695
|
result[key] = item[key];
|
|
687
696
|
} else {
|
|
688
|
-
result[key] =
|
|
697
|
+
result[key] = _this.getText(item[key], options);
|
|
689
698
|
}
|
|
690
699
|
return result;
|
|
691
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
|