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
@@ -6,7 +6,6 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
6
6
  import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
7
7
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
8
8
  import _Row from "antd/es/row";
9
- import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
10
9
  import _Col from "antd/es/col";
11
10
  import _Icon from "antd/es/icon";
12
11
  import _Button from "antd/es/button";
@@ -14,13 +13,14 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
14
13
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
15
14
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
16
15
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
16
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
17
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
17
18
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
18
19
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
19
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
20
20
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
21
21
  import _Form from "antd/es/form";
22
22
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
- 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) { _defineProperty(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; }
23
+ 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) { _defineProperty(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; }
24
24
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
25
25
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
26
26
  import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
@@ -32,9 +32,8 @@ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instanc
32
32
  import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
33
33
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
34
34
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
35
- import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
36
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
37
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
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
+ 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; } }
38
37
  import React from 'react';
39
38
  import PropTypes from 'prop-types';
40
39
  import ReactDOM from 'react-dom';
@@ -56,11 +55,11 @@ var insertTimeKeyMap = {
56
55
  var TYPE = ['text', 'search', 'searchText', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader' //级联选择下拉
57
56
  ];
58
57
 
59
- /**
60
- * search: 搜索按钮的标题
61
- * more:更多按钮的标题
62
- * reset:重置按钮的标题
63
- * sort:排序按钮的标题
58
+ /**
59
+ * search: 搜索按钮的标题
60
+ * more:更多按钮的标题
61
+ * reset:重置按钮的标题
62
+ * sort:排序按钮的标题
64
63
  */
65
64
  var ConfigType = {
66
65
  search: PropTypes.string.isRequired,
@@ -69,11 +68,11 @@ var ConfigType = {
69
68
  more: PropTypes.string
70
69
  };
71
70
 
72
- /**
73
- * key: 唯一标识一个表单元素
74
- * title:表单元素旁边的标题
75
- * type:表单元素的类型
76
- * props:传递给表单元素的额外属性
71
+ /**
72
+ * key: 唯一标识一个表单元素
73
+ * title:表单元素旁边的标题
74
+ * type:表单元素的类型
75
+ * props:传递给表单元素的额外属性
77
76
  */
78
77
  var FilterType = {
79
78
  key: PropTypes.string.isRequired,
@@ -83,16 +82,18 @@ var FilterType = {
83
82
  props: PropTypes.object
84
83
  };
85
84
 
86
- /**
87
- * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
88
- * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
89
- * options: 作用同FilterType.options类似,但优先级高于它
90
- * onClick:按钮点击事件,原型为func(key)
91
- * onChange:表单控件内容改变时触发,原型为func(key, value)
92
- * onSearch:search控件发出的事件,原型为func(key, value)
93
- * displayRow:折叠时需要展示的行数,整数,默认为2
85
+ /**
86
+ * data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
87
+ * isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
88
+ * options: 作用同FilterType.options类似,但优先级高于它
89
+ * onClick:按钮点击事件,原型为func(key)
90
+ * onChange:表单控件内容改变时触发,原型为func(key, value)
91
+ * onSearch:search控件发出的事件,原型为func(key, value)
92
+ * displayRow:折叠时需要展示的行数,整数,默认为2
94
93
  */
95
94
  var Search2 = /*#__PURE__*/function (_React$Component) {
95
+ _inherits(Search2, _React$Component);
96
+ var _super = _createSuper(Search2);
96
97
  function Search2() {
97
98
  var _context;
98
99
  var _this;
@@ -100,15 +101,15 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
100
101
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
101
102
  args[_key] = arguments[_key];
102
103
  }
103
- _this = _callSuper(this, Search2, _concatInstanceProperty(_context = []).call(_context, args));
104
- _defineProperty(_this, "state", {
104
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
105
+ _defineProperty(_assertThisInitialized(_this), "state", {
105
106
  more: false
106
107
  });
107
- _defineProperty(_this, "getPathFun", /*#__PURE__*/function () {
108
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(key) {
108
+ _defineProperty(_assertThisInitialized(_this), "getPathFun", /*#__PURE__*/function () {
109
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(key) {
109
110
  var _context2, _context8;
110
111
  var pathArr, _global$store$getStat, sidebars, navigation, title, body, url;
111
- return _regeneratorRuntime.wrap(function (_context9) {
112
+ return _regeneratorRuntime.wrap(function _callee$(_context9) {
112
113
  while (1) switch (_context9.prev = _context9.next) {
113
114
  case 0:
114
115
  pathArr = global.location.pathname.split('/');
@@ -145,7 +146,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
145
146
  menuName: title
146
147
  };
147
148
  url = '/api/standard/log'; // await helper.fetchJson(url, helper.postOption(body))
148
- case 1:
149
+ case 5:
149
150
  case "end":
150
151
  return _context9.stop();
151
152
  }
@@ -155,49 +156,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
155
156
  return _ref.apply(this, arguments);
156
157
  };
157
158
  }());
158
- _defineProperty(_this, "onClick", function (key) {
159
+ _defineProperty(_assertThisInitialized(_this), "onClick", function (key) {
159
160
  var onClick = _this.props.onClick;
160
161
  if (key === 'search') {
161
162
  // this.getPathFun(key);
162
163
  }
163
164
  onClick && onClick(key);
164
165
  });
165
- _defineProperty(_this, "onMore", function () {
166
+ _defineProperty(_assertThisInitialized(_this), "onMore", function () {
166
167
  var onHeightChange = _this.props.onHeightChange;
167
168
  _this.setState({
168
169
  more: !_this.state.more
169
170
  });
170
171
  onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
171
172
  });
172
- _defineProperty(_this, "onChange", function (dictionary, key, value) {
173
- var _context0, _context1;
173
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (dictionary, key, value) {
174
+ var _context10, _context11;
174
175
  var onChange = _this.props.onChange;
175
- if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(_context0 = _mapInstanceProperty(_context1 = global.dictionary[dictionary]).call(_context1, function (item) {
176
+ if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(_context10 = _mapInstanceProperty(_context11 = global.dictionary[dictionary]).call(_context11, function (item) {
176
177
  return item.value;
177
- })).call(_context0, value)) {
178
- var _context10;
178
+ })).call(_context10, value)) {
179
+ var _context12;
179
180
  var realValue = JSON.parse(value);
180
181
  _this.onClick('reset');
181
- _mapInstanceProperty(_context10 = _Object$keys(realValue)).call(_context10, function (objectKey) {
182
+ _mapInstanceProperty(_context12 = _Object$keys(realValue)).call(_context12, function (objectKey) {
182
183
  onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
183
184
  });
184
185
  }
185
186
  onChange && onChange(key, value);
186
187
  });
187
- _defineProperty(_this, "onPressEnter", function () {
188
+ _defineProperty(_assertThisInitialized(_this), "onPressEnter", function () {
188
189
  ReactDOM.findDOMNode(_this.refs.search).click();
189
190
  });
190
- _defineProperty(_this, "toButton", function (key) {
191
- var _context11;
191
+ _defineProperty(_assertThisInitialized(_this), "toButton", function (key) {
192
+ var _context13;
192
193
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
193
194
  var config = _this.props.config;
194
- var onClick = _bindInstanceProperty(_context11 = _this.onClick).call(_context11, _this, key);
195
+ var onClick = _bindInstanceProperty(_context13 = _this.onClick).call(_context13, _assertThisInitialized(_this), key);
195
196
  return /*#__PURE__*/React.createElement(_Button, _extends({
196
197
  size: defaultSize,
197
198
  onClick: onClick
198
199
  }, props), config[key]);
199
200
  });
200
- _defineProperty(_this, "toMore", function () {
201
+ _defineProperty(_assertThisInitialized(_this), "toMore", function () {
201
202
  return /*#__PURE__*/React.createElement("a", {
202
203
  role: "more",
203
204
  onClick: _this.onMore
@@ -206,7 +207,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
206
207
  "data-status": !_this.state.more ? 'down' : 'up'
207
208
  }));
208
209
  });
209
- _defineProperty(_this, "toButtons", function () {
210
+ _defineProperty(_assertThisInitialized(_this), "toButtons", function () {
210
211
  var config = _this.props.config;
211
212
  return /*#__PURE__*/React.createElement("div", {
212
213
  role: "buttons"
@@ -215,7 +216,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
215
216
  type: 'primary'
216
217
  }), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
217
218
  });
218
- _defineProperty(_this, "isSort", function () {
219
+ _defineProperty(_assertThisInitialized(_this), "isSort", function () {
219
220
  var _this$props = _this.props,
220
221
  config = _this$props.config,
221
222
  _this$props$colNum = _this$props.colNum,
@@ -225,7 +226,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
225
226
  isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
226
227
  return isSort && _sortInstanceProperty(config) && filters.length > colNum;
227
228
  });
228
- _defineProperty(_this, "isMore", function () {
229
+ _defineProperty(_assertThisInitialized(_this), "isMore", function () {
229
230
  var _this$props2 = _this.props,
230
231
  config = _this$props2.config,
231
232
  _this$props2$colNum = _this$props2.colNum,
@@ -237,7 +238,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
237
238
  return !item.hide;
238
239
  }).length > colNum * displayRow;
239
240
  });
240
- _defineProperty(_this, "getOptions", function (filter) {
241
+ _defineProperty(_assertThisInitialized(_this), "getOptions", function (filter) {
241
242
  var options = _this.props.options;
242
243
  if (options && _Array$isArray(options[filter.key])) {
243
244
  return options[filter.key];
@@ -245,21 +246,21 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
245
246
  return filter.options || filter.typeRelated || [];
246
247
  }
247
248
  });
248
- _defineProperty(_this, "getContainer", function () {
249
+ _defineProperty(_assertThisInitialized(_this), "getContainer", function () {
249
250
  return _this.props.getContainer;
250
251
  });
251
- _defineProperty(_this, "getControlProps", function (control) {
252
- var _context12;
252
+ _defineProperty(_assertThisInitialized(_this), "getControlProps", function (control) {
253
+ var _context14;
253
254
  var _this$props$data = _this.props.data,
254
255
  data = _this$props$data === void 0 ? {} : _this$props$data;
255
256
  return _objectSpread(_objectSpread({}, control.props || {}), {}, {
256
257
  size: defaultSize,
257
258
  type: control.type,
258
259
  value: makeString(data[control.key]),
259
- onChange: _bindInstanceProperty(_context12 = _this.onChange).call(_context12, _this, control.dictionary, control.key)
260
+ onChange: _bindInstanceProperty(_context14 = _this.onChange).call(_context14, _assertThisInitialized(_this), control.dictionary, control.key)
260
261
  });
261
262
  });
262
- _defineProperty(_this, "validDate", function (_ref2) {
263
+ _defineProperty(_assertThisInitialized(_this), "validDate", function (_ref2) {
263
264
  var key = _ref2.key,
264
265
  type = _ref2.type;
265
266
  return function (date) {
@@ -278,16 +279,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
278
279
  }
279
280
  };
280
281
  });
281
- _defineProperty(_this, "toText", function (props) {
282
+ _defineProperty(_assertThisInitialized(_this), "toText", function (props) {
282
283
  props.onPressEnter = _this.onPressEnter;
283
284
  return /*#__PURE__*/React.createElement(Control, props);
284
285
  });
285
- _defineProperty(_this, "toNumber", function (props) {
286
+ _defineProperty(_assertThisInitialized(_this), "toNumber", function (props) {
286
287
  props.defaultValue = props.value;
287
288
  delete props.value;
288
289
  return /*#__PURE__*/React.createElement(Control, props);
289
290
  });
290
- _defineProperty(_this, "getQueryGroupOptions", function (_ref3) {
291
+ _defineProperty(_assertThisInitialized(_this), "getQueryGroupOptions", function (_ref3) {
291
292
  var dictionary = _ref3.dictionary,
292
293
  _ref3$configCode = _ref3.configCode,
293
294
  configCode = _ref3$configCode === void 0 ? 'unknown' : _ref3$configCode;
@@ -308,14 +309,14 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
308
309
  };
309
310
  }));
310
311
  });
311
- _defineProperty(_this, "toSelect", function (props, filter) {
312
+ _defineProperty(_assertThisInitialized(_this), "toSelect", function (props, filter) {
312
313
  var container = _this.getContainer();
313
314
  container && (props.getPopupContainer = container);
314
315
  props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
315
316
  props.dropdownMatchSelectWidth = false;
316
317
  return /*#__PURE__*/React.createElement(Control, props);
317
318
  });
318
- _defineProperty(_this, "createSearchEvent", function (filter) {
319
+ _defineProperty(_assertThisInitialized(_this), "createSearchEvent", function (filter) {
319
320
  if (_this.props.onSearch) {
320
321
  return function (value) {
321
322
  return _this.props.onSearch(filter.key, value, filter);
@@ -324,7 +325,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
324
325
  return null;
325
326
  }
326
327
  });
327
- _defineProperty(_this, "toSearch", function (props, filter) {
328
+ _defineProperty(_assertThisInitialized(_this), "toSearch", function (props, filter) {
328
329
  var container = _this.getContainer();
329
330
  container && (props.getPopupContainer = container);
330
331
  props.options = _this.getOptions(filter);
@@ -332,7 +333,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
332
333
  props.dropdownMatchSelectWidth = false;
333
334
  return /*#__PURE__*/React.createElement(Control, props);
334
335
  });
335
- _defineProperty(_this, "selectSearch", function (props, filter) {
336
+ _defineProperty(_assertThisInitialized(_this), "selectSearch", function (props, filter) {
336
337
  var container = _this.getContainer();
337
338
  container && (props.getPopupContainer = container);
338
339
  props.options = _this.getOptions(filter);
@@ -340,7 +341,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
340
341
  props.dropdownMatchSelectWidth = false;
341
342
  return /*#__PURE__*/React.createElement(Control, props);
342
343
  });
343
- _defineProperty(_this, "toDate", function (props, _ref5) {
344
+ _defineProperty(_assertThisInitialized(_this), "toDate", function (props, _ref5) {
344
345
  var rule = _ref5.rule;
345
346
  var container = _this.getContainer();
346
347
  container && (props.getCalendarContainer = container);
@@ -350,11 +351,11 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
350
351
  };
351
352
  return /*#__PURE__*/React.createElement(Control, props);
352
353
  });
353
- _defineProperty(_this, "toReadonly", function (props, filter) {
354
+ _defineProperty(_assertThisInitialized(_this), "toReadonly", function (props, filter) {
354
355
  props.value = getTitle(props.value, _this.getOptions(filter));
355
356
  return /*#__PURE__*/React.createElement(Control, props);
356
357
  });
357
- _defineProperty(_this, "toCascader", function (props, filter) {
358
+ _defineProperty(_assertThisInitialized(_this), "toCascader", function (props, filter) {
358
359
  var container = _this.getContainer();
359
360
  container && (props.getPopupContainer = container);
360
361
  props.options = _this.getOptions(filter);
@@ -362,7 +363,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
362
363
  props.placeholder = filter.placeholder || '';
363
364
  return /*#__PURE__*/React.createElement(Control, props);
364
365
  });
365
- _defineProperty(_this, "toControl", function (control) {
366
+ _defineProperty(_assertThisInitialized(_this), "toControl", function (control) {
366
367
  var props = _this.getControlProps(control);
367
368
  switch (control.type) {
368
369
  case 'text':
@@ -386,29 +387,29 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
386
387
  return 'type error';
387
388
  }
388
389
  });
389
- _defineProperty(_this, "toLabel", function (_ref6) {
390
+ _defineProperty(_assertThisInitialized(_this), "toLabel", function (_ref6) {
390
391
  var title = _ref6.title,
391
392
  key = _ref6.key,
392
393
  dictionary = _ref6.dictionary,
393
394
  _ref6$configCode = _ref6.configCode,
394
395
  configCode = _ref6$configCode === void 0 ? 'unknown' : _ref6$configCode;
395
396
  if (key === 'queryGroup') {
396
- var _context13, _context14;
397
+ var _context15, _context16;
397
398
  //查询组合
398
399
  return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
399
400
  role: "icon",
400
401
  type: "plus-circle-o",
401
- onClick: _bindInstanceProperty(_context13 = _this.onAddQueryGroup).call(_context13, _this, configCode, _this.props.data, dictionary)
402
+ onClick: _bindInstanceProperty(_context15 = _this.onAddQueryGroup).call(_context15, _assertThisInitialized(_this), configCode, _this.props.data, dictionary)
402
403
  }), /*#__PURE__*/React.createElement(_Icon, {
403
404
  role: "icon",
404
405
  type: "minus-circle-o",
405
- onClick: _bindInstanceProperty(_context14 = _this.onDelQueryGroup).call(_context14, _this, configCode, _this.props.data, dictionary)
406
+ onClick: _bindInstanceProperty(_context16 = _this.onDelQueryGroup).call(_context16, _assertThisInitialized(_this), configCode, _this.props.data, dictionary)
406
407
  }));
407
408
  } else {
408
409
  return title;
409
410
  }
410
411
  });
411
- _defineProperty(_this, "toCol", function (span, control, more) {
412
+ _defineProperty(_assertThisInitialized(_this), "toCol", function (span, control, more) {
412
413
  var factor = control.span || 1;
413
414
  return /*#__PURE__*/React.createElement(_Col, {
414
415
  span: span * factor,
@@ -423,49 +424,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
423
424
  required: control.required
424
425
  }, _this.toControl(control)));
425
426
  });
426
- _defineProperty(_this, "toCols", function () {
427
+ // toCols = () => {
428
+ // const {insertTimeKey='from',colNum=defaultColNum, filters, displayRow=filters.length > defaultColNum ? 2 :1} = this.props;
429
+ // let span = 24 / Math.min(colNum, filters.filter(item => !item.hide).length);
430
+ // let newFilters = filters.filter(item => !item.hide);
431
+ // const insertKeys = insertTimeKeyMap[insertTimeKey];
432
+ // const insertTimeCols = newFilters.filter(x=>insertKeys.includes(x.key));
433
+ // const otherCols = newFilters.filter(x=>!insertKeys.includes(x.key));
434
+ // if (insertTimeCols.length>0){
435
+ // if (otherCols.length>=defaultColNum){
436
+ // otherCols.splice(6,0,...insertTimeCols);
437
+ // newFilters = otherCols;
438
+ // }else{
439
+ // newFilters = otherCols.concat(insertTimeCols);
440
+ // }
441
+ // }
442
+ // if (span == 4.8){ //特殊处理filters为5的时候,span不能为小数
443
+ // return newFilters.map((control, index) => this.toCol(index==0?4:5, control, index >= colNum * displayRow));
444
+ // }else{
445
+ // return newFilters.map((control, index) => this.toCol(span, control, index >= colNum * displayRow));
446
+ // }
447
+ // };
448
+ _defineProperty(_assertThisInitialized(_this), "toCols", function () {
427
449
  var _this$props3 = _this.props,
428
- _this$props3$insertTi = _this$props3.insertTimeKey,
429
- insertTimeKey = _this$props3$insertTi === void 0 ? 'from' : _this$props3$insertTi,
430
450
  _this$props3$colNum = _this$props3.colNum,
431
451
  colNum = _this$props3$colNum === void 0 ? defaultColNum : _this$props3$colNum,
432
452
  filters = _this$props3.filters,
433
453
  _this$props3$displayR = _this$props3.displayRow,
434
- displayRow = _this$props3$displayR === void 0 ? filters.length > defaultColNum ? 2 : 1 : _this$props3$displayR;
454
+ displayRow = _this$props3$displayR === void 0 ? 1 : _this$props3$displayR;
435
455
  var span = 24 / Math.min(colNum, _filterInstanceProperty(filters).call(filters, function (item) {
436
456
  return !item.hide;
437
457
  }).length);
438
- var newFilters = _filterInstanceProperty(filters).call(filters, function (item) {
439
- return !item.hide;
440
- });
441
- var insertKeys = insertTimeKeyMap[insertTimeKey];
442
- var insertTimeCols = _filterInstanceProperty(newFilters).call(newFilters, function (x) {
443
- return _includesInstanceProperty(insertKeys).call(insertKeys, x.key);
444
- });
445
- var otherCols = _filterInstanceProperty(newFilters).call(newFilters, function (x) {
446
- return !_includesInstanceProperty(insertKeys).call(insertKeys, x.key);
447
- });
448
- if (insertTimeCols.length > 0) {
449
- if (otherCols.length >= defaultColNum) {
450
- var _context15;
451
- _spliceInstanceProperty(otherCols).apply(otherCols, _concatInstanceProperty(_context15 = [6, 0]).call(_context15, _toConsumableArray(insertTimeCols)));
452
- newFilters = otherCols;
453
- } else {
454
- newFilters = _concatInstanceProperty(otherCols).call(otherCols, insertTimeCols);
455
- }
456
- }
457
458
  if (span == 4.8) {
458
459
  //特殊处理filters为5的时候,span不能为小数
459
- return _mapInstanceProperty(newFilters).call(newFilters, function (control, index) {
460
+ return _mapInstanceProperty(filters).call(filters, function (control, index) {
460
461
  return _this.toCol(index == 0 ? 4 : 5, control, index >= colNum * displayRow);
461
462
  });
462
463
  } else {
463
- return _mapInstanceProperty(newFilters).call(newFilters, function (control, index) {
464
+ return _mapInstanceProperty(filters).call(filters, function (control, index) {
464
465
  return _this.toCol(span, control, index >= colNum * displayRow);
465
466
  });
466
467
  }
467
468
  });
468
- _defineProperty(_this, "calWidth", function () {
469
+ _defineProperty(_assertThisInitialized(_this), "calWidth", function () {
469
470
  var _this$props4 = _this.props,
470
471
  _this$props4$colNum = _this$props4.colNum,
471
472
  colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
@@ -479,7 +480,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
479
480
  return "".concat(defaultColNum * 13.6, "%");
480
481
  }
481
482
  });
482
- _defineProperty(_this, "calHeight", function (more) {
483
+ _defineProperty(_assertThisInitialized(_this), "calHeight", function (more) {
483
484
  var _this$props5 = _this.props,
484
485
  _this$props5$colNum = _this$props5.colNum,
485
486
  colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
@@ -497,17 +498,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
497
498
  });
498
499
  return _this;
499
500
  }
500
- _inherits(Search2, _React$Component);
501
- return _createClass(Search2, [{
501
+ _createClass(Search2, [{
502
502
  key: "onAddQueryGroup",
503
503
  value: function () {
504
- var _onAddQueryGroup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(configCode, searchData, dictionary) {
505
- var _context16;
504
+ var _onAddQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(configCode, searchData, dictionary) {
505
+ var _context17;
506
506
  var filter, dicOptionNameArr, dicOptions;
507
- return _regeneratorRuntime.wrap(function (_context17) {
508
- while (1) switch (_context17.prev = _context17.next) {
507
+ return _regeneratorRuntime.wrap(function _callee2$(_context18) {
508
+ while (1) switch (_context18.prev = _context18.next) {
509
509
  case 0:
510
- filter = _reduceInstanceProperty(_context16 = _Object$keys(searchData)).call(_context16, function (state, key) {
510
+ filter = _reduceInstanceProperty(_context17 = _Object$keys(searchData)).call(_context17, function (state, key) {
511
511
  if (searchData[key] && key !== 'queryGroup') {
512
512
  state[key] = searchData[key];
513
513
  }
@@ -523,9 +523,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
523
523
  // if (true === await showAddDialog(configCode, filter, dicOptionNameArr)) {
524
524
  // this.onChange(undefined, 'queryGroup', '');
525
525
  // }
526
- case 1:
526
+ case 3:
527
527
  case "end":
528
- return _context17.stop();
528
+ return _context18.stop();
529
529
  }
530
530
  }, _callee2);
531
531
  }));
@@ -537,10 +537,10 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
537
537
  }, {
538
538
  key: "onDelQueryGroup",
539
539
  value: function () {
540
- var _onDelQueryGroup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(configCode, searchData, dictionary) {
540
+ var _onDelQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(configCode, searchData, dictionary) {
541
541
  var queryGroup, dicOptions, _JSON$parse, queryId;
542
- return _regeneratorRuntime.wrap(function (_context18) {
543
- while (1) switch (_context18.prev = _context18.next) {
542
+ return _regeneratorRuntime.wrap(function _callee3$(_context19) {
543
+ while (1) switch (_context19.prev = _context19.next) {
544
544
  case 0:
545
545
  queryGroup = searchData.queryGroup; // if (!queryGroup) return helper.showError(`请先选择要删除的查询组合`);
546
546
  if (dictionary && global.dictionary) {
@@ -549,9 +549,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
549
549
  _JSON$parse = JSON.parse(queryGroup), queryId = _JSON$parse.queryId; // if(true === await showDeleteDialog(configCode, queryId)) {
550
550
  // this.onClick('reset');
551
551
  // }
552
- case 1:
552
+ case 3:
553
553
  case "end":
554
- return _context18.stop();
554
+ return _context19.stop();
555
555
  }
556
556
  }, _callee3);
557
557
  }));
@@ -578,6 +578,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
578
578
  }, this.toCols())), this.toButtons());
579
579
  }
580
580
  }]);
581
+ return Search2;
581
582
  }(React.Component);
582
583
  _defineProperty(Search2, "propTypes", {
583
584
  config: PropTypes.shape(ConfigType).isRequired,
@@ -1,64 +1,64 @@
1
- @import '../variables.less';
2
-
3
- .@{cloudlink-prefix}-Search2 {
4
- transition: all 0.3s;
5
- > *:first-child {
6
- display: inline-block;
7
- vertical-align: top;
8
- margin-bottom: -10px;
9
-
10
- :global(.ant-form-item) {
11
- margin-bottom: 10px;
12
-
13
- :global(.ant-select-selection--multiple) {
14
- border-top-width: 1px;
15
- height: 22px;
16
- overflow: auto;
17
- }
18
-
19
- [role='icon'] {
20
- cursor: pointer;
21
- margin-left: 10px;
22
- color: @primary-color;
23
- }
24
- }
25
- }
26
-
27
- > *:last-child {
28
- display: inline-block;
29
- vertical-align: top;
30
- padding-left: 20px;
31
- padding-top: 14px;
32
- width: 18%;
33
- }
34
-
35
- :global(.ant-form-item-control) input,
36
- :global(.ant-calendar-picker),
37
- :global(.ant-select) {
38
- display: block;
39
- }
40
- :global(.ant-calendar-picker-small) {
41
- min-width: 100px !important;
42
- }
43
- [role='buttons'] > * {
44
- margin-right: 5px;
45
- }
46
-
47
- [role='more'] {
48
- color: rgba(0, 0, 0, 0.65);
49
- user-select: none;
50
-
51
- &:hover {
52
- color: @brand-primary;
53
- }
54
-
55
- > i {
56
- transform: scale(0.75);
57
- transition: all 0.2s;
58
-
59
- &[data-status='up'] {
60
- transform: scale(0.75) rotate(-180deg);
61
- }
62
- }
63
- }
64
- }
1
+ @import '../variables.less';
2
+
3
+ .@{cloudlink-prefix}-Search2 {
4
+ transition: all 0.3s;
5
+ > *:first-child {
6
+ display: inline-block;
7
+ vertical-align: top;
8
+ margin-bottom: -10px;
9
+
10
+ :global(.ant-form-item) {
11
+ margin-bottom: 10px;
12
+
13
+ :global(.ant-select-selection--multiple) {
14
+ border-top-width: 1px;
15
+ height: 22px;
16
+ overflow: auto;
17
+ }
18
+
19
+ [role='icon'] {
20
+ cursor: pointer;
21
+ margin-left: 10px;
22
+ color: @primary-color;
23
+ }
24
+ }
25
+ }
26
+
27
+ > *:last-child {
28
+ display: inline-block;
29
+ vertical-align: top;
30
+ padding-left: 20px;
31
+ padding-top: 14px;
32
+ width: 18%;
33
+ }
34
+
35
+ :global(.ant-form-item-control) input,
36
+ :global(.ant-calendar-picker),
37
+ :global(.ant-select) {
38
+ display: block;
39
+ }
40
+ :global(.ant-calendar-picker-small) {
41
+ min-width: 100px !important;
42
+ }
43
+ [role='buttons'] > * {
44
+ margin-right: 5px;
45
+ }
46
+
47
+ [role='more'] {
48
+ color: rgba(0, 0, 0, 0.65);
49
+ user-select: none;
50
+
51
+ &:hover {
52
+ color: @brand-primary;
53
+ }
54
+
55
+ > i {
56
+ transform: scale(0.75);
57
+ transition: all 0.2s;
58
+
59
+ &[data-status='up'] {
60
+ transform: scale(0.75) rotate(-180deg);
61
+ }
62
+ }
63
+ }
64
+ }