cloud-b2b 1.1.64 → 1.1.66

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.
Files changed (80) hide show
  1. package/es/Area/Area.js +11 -8
  2. package/es/CodeInput/CodeInput.js +19 -16
  3. package/es/Enhance/Dialogs.js +14 -11
  4. package/es/Enhance/Loading.js +18 -15
  5. package/es/Header/Header.js +20 -17
  6. package/es/Header/Vertical.js +14 -11
  7. package/es/ImageView/ImageView.js +13 -10
  8. package/es/InpurCascader/InputCascader.js +14 -11
  9. package/es/InputEditor/InputEditor.js +18 -16
  10. package/es/InputSearch/InputSearch.js +22 -19
  11. package/es/InputSelect/InputSelect.js +17 -14
  12. package/es/InputTreeSelect/InputTreeSelect.js +13 -10
  13. package/es/InputWriting/InputWriting.js +15 -12
  14. package/es/Layout/Layout.js +17 -14
  15. package/es/Link/Link.js +10 -7
  16. package/es/NumberInput/NumberInput.js +16 -13
  17. package/es/Search/Search.js +55 -52
  18. package/es/Search2/Search.js +110 -109
  19. package/es/Search2/Search.less +64 -64
  20. package/es/Search2/package.json +6 -6
  21. package/es/Sidebar/Sidebar.js +14 -11
  22. package/es/Sidebar2/Sidebar.js +16 -13
  23. package/es/SuperForm/SuperForm.js +79 -74
  24. package/es/SuperForm2/SuperForm.js +100 -95
  25. package/es/SuperPagination/SuperPagination.js +11 -8
  26. package/es/SuperTab/SuperTab.js +15 -12
  27. package/es/SuperTab2/SuperTab2.js +16 -13
  28. package/es/SuperTable/DragSortRow.js +15 -12
  29. package/es/SuperTable/FilterDropDown.js +14 -11
  30. package/es/SuperTable/SuperTable.js +71 -68
  31. package/es/SuperTable2/SuperTable2.js +115 -96
  32. package/es/SuperTable2/SuperTableCell.js +30 -27
  33. package/es/SuperTable3/FilterDropDown.js +14 -11
  34. package/es/SuperTable3/SuperTable.js +61 -58
  35. package/es/SuperToolbar/SuperToolbar.js +14 -11
  36. package/es/SuperUpload/SuperUpload.js +74 -74
  37. package/es/Viewer/ImageViews.js +19 -16
  38. package/es/Viewer/Viewer.js +14 -11
  39. package/es/helper.js +17 -18
  40. package/lib/Area/Area.js +11 -8
  41. package/lib/CodeInput/CodeInput.js +19 -16
  42. package/lib/Enhance/Dialogs.js +14 -11
  43. package/lib/Enhance/Loading.js +18 -15
  44. package/lib/Header/Header.js +20 -17
  45. package/lib/Header/Vertical.js +14 -11
  46. package/lib/ImageView/ImageView.js +13 -10
  47. package/lib/InpurCascader/InputCascader.js +14 -11
  48. package/lib/InputEditor/InputEditor.js +18 -16
  49. package/lib/InputSearch/InputSearch.js +22 -19
  50. package/lib/InputSelect/InputSelect.js +17 -14
  51. package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
  52. package/lib/InputWriting/InputWriting.js +15 -12
  53. package/lib/Layout/Layout.js +17 -14
  54. package/lib/LayoutLink/LayoutLink.js +2 -1
  55. package/lib/Link/Link.js +10 -7
  56. package/lib/NumberInput/NumberInput.js +16 -13
  57. package/lib/Search/Search.js +57 -53
  58. package/lib/Search2/Search.js +112 -110
  59. package/lib/Search2/Search.less +64 -64
  60. package/lib/Search2/package.json +6 -6
  61. package/lib/Sidebar/Sidebar.js +14 -11
  62. package/lib/Sidebar2/Sidebar.js +16 -13
  63. package/lib/SuperForm/SuperForm.js +81 -75
  64. package/lib/SuperForm2/SuperForm.js +102 -96
  65. package/lib/SuperPagination/SuperPagination.js +11 -8
  66. package/lib/SuperTab/SuperTab.js +15 -12
  67. package/lib/SuperTab2/SuperTab2.js +16 -13
  68. package/lib/SuperTable/DragSortRow.js +15 -12
  69. package/lib/SuperTable/FilterDropDown.js +14 -11
  70. package/lib/SuperTable/SuperTable.js +71 -68
  71. package/lib/SuperTable2/SuperTable2.js +117 -97
  72. package/lib/SuperTable2/SuperTableCell.js +30 -27
  73. package/lib/SuperTable3/FilterDropDown.js +14 -11
  74. package/lib/SuperTable3/SuperTable.js +61 -58
  75. package/lib/SuperToolbar/SuperToolbar.js +14 -11
  76. package/lib/SuperUpload/SuperUpload.js +76 -75
  77. package/lib/Viewer/ImageViews.js +19 -16
  78. package/lib/Viewer/Viewer.js +14 -11
  79. package/lib/helper.js +17 -18
  80. package/package.json +1 -1
@@ -27,9 +27,7 @@ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stabl
27
27
  var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
28
28
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
29
29
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
30
- var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
31
30
  var _row = _interopRequireDefault(require("antd/lib/row"));
32
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
33
31
  var _col = _interopRequireDefault(require("antd/lib/col"));
34
32
  var _icon = _interopRequireDefault(require("antd/lib/icon"));
35
33
  var _button = _interopRequireDefault(require("antd/lib/button"));
@@ -37,9 +35,10 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
37
35
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
38
36
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
39
37
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
38
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
39
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
40
40
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
41
41
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
42
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
43
42
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
44
43
  var _form = _interopRequireDefault(require("antd/lib/form"));
45
44
  var _react = _interopRequireDefault(require("react"));
@@ -49,11 +48,12 @@ var _withStyles = _interopRequireDefault(require("isomorphic-style-loader/withSt
49
48
  var _Control = _interopRequireWildcard(require("../Control"));
50
49
  var _helper = require("../helper");
51
50
  var _variables = _interopRequireDefault(require("../variables"));
52
- function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
51
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
52
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
53
53
  function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
54
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context19, _context20; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context19 = ownKeys(Object(t), !0)).call(_context19, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context20 = ownKeys(Object(t))).call(_context20, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
55
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
56
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // import helper from '../../common/common';
54
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context20, _context21; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context20 = ownKeys(Object(t), !0)).call(_context20, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context21 = ownKeys(Object(t))).call(_context21, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
55
+ 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); }; }
56
+ 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; } } // import helper from '../../common/common';
57
57
  // import s from './Search.less';
58
58
  // import showAddDialog from './AddDialog';
59
59
  // import showDeleteDialog from './DeleteDialog';
@@ -67,11 +67,11 @@ var insertTimeKeyMap = {
67
67
  var TYPE = ['text', 'search', 'searchText', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader' //级联选择下拉
68
68
  ];
69
69
 
70
- /**
71
- * search: 搜索按钮的标题
72
- * more:更多按钮的标题
73
- * reset:重置按钮的标题
74
- * sort:排序按钮的标题
70
+ /**
71
+ * search: 搜索按钮的标题
72
+ * more:更多按钮的标题
73
+ * reset:重置按钮的标题
74
+ * sort:排序按钮的标题
75
75
  */
76
76
  var ConfigType = {
77
77
  search: _propTypes["default"].string.isRequired,
@@ -80,11 +80,11 @@ var ConfigType = {
80
80
  more: _propTypes["default"].string
81
81
  };
82
82
 
83
- /**
84
- * key: 唯一标识一个表单元素
85
- * title:表单元素旁边的标题
86
- * type:表单元素的类型
87
- * props:传递给表单元素的额外属性
83
+ /**
84
+ * key: 唯一标识一个表单元素
85
+ * title:表单元素旁边的标题
86
+ * type:表单元素的类型
87
+ * props:传递给表单元素的额外属性
88
88
  */
89
89
  var FilterType = {
90
90
  key: _propTypes["default"].string.isRequired,
@@ -94,16 +94,18 @@ var FilterType = {
94
94
  props: _propTypes["default"].object
95
95
  };
96
96
 
97
- /**
98
- * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
99
- * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
100
- * options: 作用同FilterType.options类似,但优先级高于它
101
- * onClick:按钮点击事件,原型为func(key)
102
- * onChange:表单控件内容改变时触发,原型为func(key, value)
103
- * onSearch:search控件发出的事件,原型为func(key, value)
104
- * displayRow:折叠时需要展示的行数,整数,默认为2
97
+ /**
98
+ * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
99
+ * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
100
+ * options: 作用同FilterType.options类似,但优先级高于它
101
+ * onClick:按钮点击事件,原型为func(key)
102
+ * onChange:表单控件内容改变时触发,原型为func(key, value)
103
+ * onSearch:search控件发出的事件,原型为func(key, value)
104
+ * displayRow:折叠时需要展示的行数,整数,默认为2
105
105
  */
106
106
  var Search2 = /*#__PURE__*/function (_React$Component) {
107
+ (0, _inherits2["default"])(Search2, _React$Component);
108
+ var _super = _createSuper(Search2);
107
109
  function Search2() {
108
110
  var _context;
109
111
  var _this;
@@ -111,15 +113,15 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
111
113
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
112
114
  args[_key] = arguments[_key];
113
115
  }
114
- _this = _callSuper(this, Search2, (0, _concat["default"])(_context = []).call(_context, args));
115
- (0, _defineProperty2["default"])(_this, "state", {
116
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
117
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
116
118
  more: false
117
119
  });
118
- (0, _defineProperty2["default"])(_this, "getPathFun", /*#__PURE__*/function () {
119
- var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(key) {
120
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPathFun", /*#__PURE__*/function () {
121
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(key) {
120
122
  var _context2, _context8;
121
123
  var pathArr, _global$store$getStat, sidebars, navigation, title, body, url;
122
- return _regenerator["default"].wrap(function (_context9) {
124
+ return _regenerator["default"].wrap(function _callee$(_context9) {
123
125
  while (1) switch (_context9.prev = _context9.next) {
124
126
  case 0:
125
127
  pathArr = global.location.pathname.split('/');
@@ -156,7 +158,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
156
158
  menuName: title
157
159
  };
158
160
  url = '/api/standard/log'; // await helper.fetchJson(url, helper.postOption(body))
159
- case 1:
161
+ case 5:
160
162
  case "end":
161
163
  return _context9.stop();
162
164
  }
@@ -166,49 +168,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
166
168
  return _ref.apply(this, arguments);
167
169
  };
168
170
  }());
169
- (0, _defineProperty2["default"])(_this, "onClick", function (key) {
171
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onClick", function (key) {
170
172
  var onClick = _this.props.onClick;
171
173
  if (key === 'search') {
172
174
  // this.getPathFun(key);
173
175
  }
174
176
  onClick && onClick(key);
175
177
  });
176
- (0, _defineProperty2["default"])(_this, "onMore", function () {
178
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMore", function () {
177
179
  var onHeightChange = _this.props.onHeightChange;
178
180
  _this.setState({
179
181
  more: !_this.state.more
180
182
  });
181
183
  onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
182
184
  });
183
- (0, _defineProperty2["default"])(_this, "onChange", function (dictionary, key, value) {
184
- var _context0, _context1;
185
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (dictionary, key, value) {
186
+ var _context10, _context11;
185
187
  var onChange = _this.props.onChange;
186
- if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !(0, _includes["default"])(_context0 = (0, _map["default"])(_context1 = global.dictionary[dictionary]).call(_context1, function (item) {
188
+ if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !(0, _includes["default"])(_context10 = (0, _map["default"])(_context11 = global.dictionary[dictionary]).call(_context11, function (item) {
187
189
  return item.value;
188
- })).call(_context0, value)) {
189
- var _context10;
190
+ })).call(_context10, value)) {
191
+ var _context12;
190
192
  var realValue = JSON.parse(value);
191
193
  _this.onClick('reset');
192
- (0, _map["default"])(_context10 = (0, _keys["default"])(realValue)).call(_context10, function (objectKey) {
194
+ (0, _map["default"])(_context12 = (0, _keys["default"])(realValue)).call(_context12, function (objectKey) {
193
195
  onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
194
196
  });
195
197
  }
196
198
  onChange && onChange(key, value);
197
199
  });
198
- (0, _defineProperty2["default"])(_this, "onPressEnter", function () {
200
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPressEnter", function () {
199
201
  _reactDom["default"].findDOMNode(_this.refs.search).click();
200
202
  });
201
- (0, _defineProperty2["default"])(_this, "toButton", function (key) {
202
- var _context11;
203
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toButton", function (key) {
204
+ var _context13;
203
205
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
204
206
  var config = _this.props.config;
205
- var onClick = (0, _bind["default"])(_context11 = _this.onClick).call(_context11, _this, key);
207
+ var onClick = (0, _bind["default"])(_context13 = _this.onClick).call(_context13, (0, _assertThisInitialized2["default"])(_this), key);
206
208
  return /*#__PURE__*/_react["default"].createElement(_button["default"], (0, _extends2["default"])({
207
209
  size: defaultSize,
208
210
  onClick: onClick
209
211
  }, props), config[key]);
210
212
  });
211
- (0, _defineProperty2["default"])(_this, "toMore", function () {
213
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toMore", function () {
212
214
  return /*#__PURE__*/_react["default"].createElement("a", {
213
215
  role: "more",
214
216
  onClick: _this.onMore
@@ -217,7 +219,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
217
219
  "data-status": !_this.state.more ? 'down' : 'up'
218
220
  }));
219
221
  });
220
- (0, _defineProperty2["default"])(_this, "toButtons", function () {
222
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toButtons", function () {
221
223
  var config = _this.props.config;
222
224
  return /*#__PURE__*/_react["default"].createElement("div", {
223
225
  role: "buttons"
@@ -226,7 +228,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
226
228
  type: 'primary'
227
229
  }), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
228
230
  });
229
- (0, _defineProperty2["default"])(_this, "isSort", function () {
231
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isSort", function () {
230
232
  var _this$props = _this.props,
231
233
  config = _this$props.config,
232
234
  _this$props$colNum = _this$props.colNum,
@@ -236,7 +238,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
236
238
  isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
237
239
  return isSort && (0, _sort["default"])(config) && filters.length > colNum;
238
240
  });
239
- (0, _defineProperty2["default"])(_this, "isMore", function () {
241
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isMore", function () {
240
242
  var _this$props2 = _this.props,
241
243
  config = _this$props2.config,
242
244
  _this$props2$colNum = _this$props2.colNum,
@@ -248,7 +250,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
248
250
  return !item.hide;
249
251
  }).length > colNum * displayRow;
250
252
  });
251
- (0, _defineProperty2["default"])(_this, "getOptions", function (filter) {
253
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (filter) {
252
254
  var options = _this.props.options;
253
255
  if (options && (0, _isArray["default"])(options[filter.key])) {
254
256
  return options[filter.key];
@@ -256,21 +258,21 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
256
258
  return filter.options || filter.typeRelated || [];
257
259
  }
258
260
  });
259
- (0, _defineProperty2["default"])(_this, "getContainer", function () {
261
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getContainer", function () {
260
262
  return _this.props.getContainer;
261
263
  });
262
- (0, _defineProperty2["default"])(_this, "getControlProps", function (control) {
263
- var _context12;
264
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getControlProps", function (control) {
265
+ var _context14;
264
266
  var _this$props$data = _this.props.data,
265
267
  data = _this$props$data === void 0 ? {} : _this$props$data;
266
268
  return _objectSpread(_objectSpread({}, control.props || {}), {}, {
267
269
  size: defaultSize,
268
270
  type: control.type,
269
271
  value: (0, _Control.makeString)(data[control.key]),
270
- onChange: (0, _bind["default"])(_context12 = _this.onChange).call(_context12, _this, control.dictionary, control.key)
272
+ onChange: (0, _bind["default"])(_context14 = _this.onChange).call(_context14, (0, _assertThisInitialized2["default"])(_this), control.dictionary, control.key)
271
273
  });
272
274
  });
273
- (0, _defineProperty2["default"])(_this, "validDate", function (_ref2) {
275
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validDate", function (_ref2) {
274
276
  var key = _ref2.key,
275
277
  type = _ref2.type;
276
278
  return function (date) {
@@ -289,16 +291,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
289
291
  }
290
292
  };
291
293
  });
292
- (0, _defineProperty2["default"])(_this, "toText", function (props) {
294
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toText", function (props) {
293
295
  props.onPressEnter = _this.onPressEnter;
294
296
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
295
297
  });
296
- (0, _defineProperty2["default"])(_this, "toNumber", function (props) {
298
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toNumber", function (props) {
297
299
  props.defaultValue = props.value;
298
300
  delete props.value;
299
301
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
300
302
  });
301
- (0, _defineProperty2["default"])(_this, "getQueryGroupOptions", function (_ref3) {
303
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getQueryGroupOptions", function (_ref3) {
302
304
  var dictionary = _ref3.dictionary,
303
305
  _ref3$configCode = _ref3.configCode,
304
306
  configCode = _ref3$configCode === void 0 ? 'unknown' : _ref3$configCode;
@@ -319,14 +321,14 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
319
321
  };
320
322
  }));
321
323
  });
322
- (0, _defineProperty2["default"])(_this, "toSelect", function (props, filter) {
324
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSelect", function (props, filter) {
323
325
  var container = _this.getContainer();
324
326
  container && (props.getPopupContainer = container);
325
327
  props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
326
328
  props.dropdownMatchSelectWidth = false;
327
329
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
328
330
  });
329
- (0, _defineProperty2["default"])(_this, "createSearchEvent", function (filter) {
331
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "createSearchEvent", function (filter) {
330
332
  if (_this.props.onSearch) {
331
333
  return function (value) {
332
334
  return _this.props.onSearch(filter.key, value, filter);
@@ -335,7 +337,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
335
337
  return null;
336
338
  }
337
339
  });
338
- (0, _defineProperty2["default"])(_this, "toSearch", function (props, filter) {
340
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toSearch", function (props, filter) {
339
341
  var container = _this.getContainer();
340
342
  container && (props.getPopupContainer = container);
341
343
  props.options = _this.getOptions(filter);
@@ -343,7 +345,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
343
345
  props.dropdownMatchSelectWidth = false;
344
346
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
345
347
  });
346
- (0, _defineProperty2["default"])(_this, "selectSearch", function (props, filter) {
348
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "selectSearch", function (props, filter) {
347
349
  var container = _this.getContainer();
348
350
  container && (props.getPopupContainer = container);
349
351
  props.options = _this.getOptions(filter);
@@ -351,7 +353,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
351
353
  props.dropdownMatchSelectWidth = false;
352
354
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
353
355
  });
354
- (0, _defineProperty2["default"])(_this, "toDate", function (props, _ref5) {
356
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toDate", function (props, _ref5) {
355
357
  var rule = _ref5.rule;
356
358
  var container = _this.getContainer();
357
359
  container && (props.getCalendarContainer = container);
@@ -361,11 +363,11 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
361
363
  };
362
364
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
363
365
  });
364
- (0, _defineProperty2["default"])(_this, "toReadonly", function (props, filter) {
366
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toReadonly", function (props, filter) {
365
367
  props.value = (0, _Control.getTitle)(props.value, _this.getOptions(filter));
366
368
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
367
369
  });
368
- (0, _defineProperty2["default"])(_this, "toCascader", function (props, filter) {
370
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCascader", function (props, filter) {
369
371
  var container = _this.getContainer();
370
372
  container && (props.getPopupContainer = container);
371
373
  props.options = _this.getOptions(filter);
@@ -373,7 +375,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
373
375
  props.placeholder = filter.placeholder || '';
374
376
  return /*#__PURE__*/_react["default"].createElement(_Control["default"], props);
375
377
  });
376
- (0, _defineProperty2["default"])(_this, "toControl", function (control) {
378
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toControl", function (control) {
377
379
  var props = _this.getControlProps(control);
378
380
  switch (control.type) {
379
381
  case 'text':
@@ -397,29 +399,29 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
397
399
  return 'type error';
398
400
  }
399
401
  });
400
- (0, _defineProperty2["default"])(_this, "toLabel", function (_ref6) {
402
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toLabel", function (_ref6) {
401
403
  var title = _ref6.title,
402
404
  key = _ref6.key,
403
405
  dictionary = _ref6.dictionary,
404
406
  _ref6$configCode = _ref6.configCode,
405
407
  configCode = _ref6$configCode === void 0 ? 'unknown' : _ref6$configCode;
406
408
  if (key === 'queryGroup') {
407
- var _context13, _context14;
409
+ var _context15, _context16;
408
410
  //查询组合
409
411
  return /*#__PURE__*/_react["default"].createElement("span", null, title, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
410
412
  role: "icon",
411
413
  type: "plus-circle-o",
412
- onClick: (0, _bind["default"])(_context13 = _this.onAddQueryGroup).call(_context13, _this, configCode, _this.props.data, dictionary)
414
+ onClick: (0, _bind["default"])(_context15 = _this.onAddQueryGroup).call(_context15, (0, _assertThisInitialized2["default"])(_this), configCode, _this.props.data, dictionary)
413
415
  }), /*#__PURE__*/_react["default"].createElement(_icon["default"], {
414
416
  role: "icon",
415
417
  type: "minus-circle-o",
416
- onClick: (0, _bind["default"])(_context14 = _this.onDelQueryGroup).call(_context14, _this, configCode, _this.props.data, dictionary)
418
+ onClick: (0, _bind["default"])(_context16 = _this.onDelQueryGroup).call(_context16, (0, _assertThisInitialized2["default"])(_this), configCode, _this.props.data, dictionary)
417
419
  }));
418
420
  } else {
419
421
  return title;
420
422
  }
421
423
  });
422
- (0, _defineProperty2["default"])(_this, "toCol", function (span, control, more) {
424
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCol", function (span, control, more) {
423
425
  var factor = control.span || 1;
424
426
  return /*#__PURE__*/_react["default"].createElement(_col["default"], {
425
427
  span: span * factor,
@@ -434,49 +436,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
434
436
  required: control.required
435
437
  }, _this.toControl(control)));
436
438
  });
437
- (0, _defineProperty2["default"])(_this, "toCols", function () {
439
+ // toCols = () => {
440
+ // const {insertTimeKey='from',colNum=defaultColNum, filters, displayRow=filters.length > defaultColNum ? 2 :1} = this.props;
441
+ // let span = 24 / Math.min(colNum, filters.filter(item => !item.hide).length);
442
+ // let newFilters = filters.filter(item => !item.hide);
443
+ // const insertKeys = insertTimeKeyMap[insertTimeKey];
444
+ // const insertTimeCols = newFilters.filter(x=>insertKeys.includes(x.key));
445
+ // const otherCols = newFilters.filter(x=>!insertKeys.includes(x.key));
446
+ // if (insertTimeCols.length>0){
447
+ // if (otherCols.length>=defaultColNum){
448
+ // otherCols.splice(6,0,...insertTimeCols);
449
+ // newFilters = otherCols;
450
+ // }else{
451
+ // newFilters = otherCols.concat(insertTimeCols);
452
+ // }
453
+ // }
454
+ // if (span == 4.8){ //特殊处理filters为5的时候,span不能为小数
455
+ // return newFilters.map((control, index) => this.toCol(index==0?4:5, control, index >= colNum * displayRow));
456
+ // }else{
457
+ // return newFilters.map((control, index) => this.toCol(span, control, index >= colNum * displayRow));
458
+ // }
459
+ // };
460
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toCols", function () {
438
461
  var _this$props3 = _this.props,
439
- _this$props3$insertTi = _this$props3.insertTimeKey,
440
- insertTimeKey = _this$props3$insertTi === void 0 ? 'from' : _this$props3$insertTi,
441
462
  _this$props3$colNum = _this$props3.colNum,
442
463
  colNum = _this$props3$colNum === void 0 ? defaultColNum : _this$props3$colNum,
443
464
  filters = _this$props3.filters,
444
465
  _this$props3$displayR = _this$props3.displayRow,
445
- displayRow = _this$props3$displayR === void 0 ? filters.length > defaultColNum ? 2 : 1 : _this$props3$displayR;
466
+ displayRow = _this$props3$displayR === void 0 ? 1 : _this$props3$displayR;
446
467
  var span = 24 / Math.min(colNum, (0, _filter["default"])(filters).call(filters, function (item) {
447
468
  return !item.hide;
448
469
  }).length);
449
- var newFilters = (0, _filter["default"])(filters).call(filters, function (item) {
450
- return !item.hide;
451
- });
452
- var insertKeys = insertTimeKeyMap[insertTimeKey];
453
- var insertTimeCols = (0, _filter["default"])(newFilters).call(newFilters, function (x) {
454
- return (0, _includes["default"])(insertKeys).call(insertKeys, x.key);
455
- });
456
- var otherCols = (0, _filter["default"])(newFilters).call(newFilters, function (x) {
457
- return !(0, _includes["default"])(insertKeys).call(insertKeys, x.key);
458
- });
459
- if (insertTimeCols.length > 0) {
460
- if (otherCols.length >= defaultColNum) {
461
- var _context15;
462
- (0, _splice["default"])(otherCols).apply(otherCols, (0, _concat["default"])(_context15 = [6, 0]).call(_context15, (0, _toConsumableArray2["default"])(insertTimeCols)));
463
- newFilters = otherCols;
464
- } else {
465
- newFilters = (0, _concat["default"])(otherCols).call(otherCols, insertTimeCols);
466
- }
467
- }
468
470
  if (span == 4.8) {
469
471
  //特殊处理filters为5的时候,span不能为小数
470
- return (0, _map["default"])(newFilters).call(newFilters, function (control, index) {
472
+ return (0, _map["default"])(filters).call(filters, function (control, index) {
471
473
  return _this.toCol(index == 0 ? 4 : 5, control, index >= colNum * displayRow);
472
474
  });
473
475
  } else {
474
- return (0, _map["default"])(newFilters).call(newFilters, function (control, index) {
476
+ return (0, _map["default"])(filters).call(filters, function (control, index) {
475
477
  return _this.toCol(span, control, index >= colNum * displayRow);
476
478
  });
477
479
  }
478
480
  });
479
- (0, _defineProperty2["default"])(_this, "calWidth", function () {
481
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "calWidth", function () {
480
482
  var _this$props4 = _this.props,
481
483
  _this$props4$colNum = _this$props4.colNum,
482
484
  colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
@@ -490,7 +492,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
490
492
  return "".concat(defaultColNum * 13.6, "%");
491
493
  }
492
494
  });
493
- (0, _defineProperty2["default"])(_this, "calHeight", function (more) {
495
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "calHeight", function (more) {
494
496
  var _this$props5 = _this.props,
495
497
  _this$props5$colNum = _this$props5.colNum,
496
498
  colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
@@ -508,17 +510,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
508
510
  });
509
511
  return _this;
510
512
  }
511
- (0, _inherits2["default"])(Search2, _React$Component);
512
- return (0, _createClass2["default"])(Search2, [{
513
+ (0, _createClass2["default"])(Search2, [{
513
514
  key: "onAddQueryGroup",
514
515
  value: function () {
515
- var _onAddQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(configCode, searchData, dictionary) {
516
- var _context16;
516
+ var _onAddQueryGroup = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(configCode, searchData, dictionary) {
517
+ var _context17;
517
518
  var filter, dicOptionNameArr, dicOptions;
518
- return _regenerator["default"].wrap(function (_context17) {
519
- while (1) switch (_context17.prev = _context17.next) {
519
+ return _regenerator["default"].wrap(function _callee2$(_context18) {
520
+ while (1) switch (_context18.prev = _context18.next) {
520
521
  case 0:
521
- filter = (0, _reduce["default"])(_context16 = (0, _keys["default"])(searchData)).call(_context16, function (state, key) {
522
+ filter = (0, _reduce["default"])(_context17 = (0, _keys["default"])(searchData)).call(_context17, function (state, key) {
522
523
  if (searchData[key] && key !== 'queryGroup') {
523
524
  state[key] = searchData[key];
524
525
  }
@@ -534,9 +535,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
534
535
  // if (true === await showAddDialog(configCode, filter, dicOptionNameArr)) {
535
536
  // this.onChange(undefined, 'queryGroup', '');
536
537
  // }
537
- case 1:
538
+ case 3:
538
539
  case "end":
539
- return _context17.stop();
540
+ return _context18.stop();
540
541
  }
541
542
  }, _callee2);
542
543
  }));
@@ -548,10 +549,10 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
548
549
  }, {
549
550
  key: "onDelQueryGroup",
550
551
  value: function () {
551
- var _onDelQueryGroup = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(configCode, searchData, dictionary) {
552
+ var _onDelQueryGroup = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(configCode, searchData, dictionary) {
552
553
  var queryGroup, dicOptions, _JSON$parse, queryId;
553
- return _regenerator["default"].wrap(function (_context18) {
554
- while (1) switch (_context18.prev = _context18.next) {
554
+ return _regenerator["default"].wrap(function _callee3$(_context19) {
555
+ while (1) switch (_context19.prev = _context19.next) {
555
556
  case 0:
556
557
  queryGroup = searchData.queryGroup; // if (!queryGroup) return helper.showError(`请先选择要删除的查询组合`);
557
558
  if (dictionary && global.dictionary) {
@@ -560,9 +561,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
560
561
  _JSON$parse = JSON.parse(queryGroup), queryId = _JSON$parse.queryId; // if(true === await showDeleteDialog(configCode, queryId)) {
561
562
  // this.onClick('reset');
562
563
  // }
563
- case 1:
564
+ case 3:
564
565
  case "end":
565
- return _context18.stop();
566
+ return _context19.stop();
566
567
  }
567
568
  }, _callee3);
568
569
  }));
@@ -589,6 +590,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
589
590
  }, this.toCols())), this.toButtons());
590
591
  }
591
592
  }]);
593
+ return Search2;
592
594
  }(_react["default"].Component);
593
595
  (0, _defineProperty2["default"])(Search2, "propTypes", {
594
596
  config: _propTypes["default"].shape(ConfigType).isRequired,