cloud-b2b 1.1.86 → 1.1.87

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