cloud-b2b 1.1.61 → 1.1.63
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.
- package/es/Area/Area.js +8 -11
- package/es/CodeInput/CodeInput.js +16 -19
- package/es/Enhance/Dialogs.js +11 -14
- package/es/Enhance/Loading.js +15 -18
- package/es/Header/Header.js +17 -20
- package/es/Header/Vertical.js +11 -14
- package/es/ImageView/ImageView.js +10 -13
- package/es/InpurCascader/InputCascader.js +11 -14
- package/es/InputEditor/InputEditor.js +16 -18
- package/es/InputSearch/InputSearch.js +19 -22
- package/es/InputSelect/InputSelect.js +14 -17
- package/es/InputTreeSelect/InputTreeSelect.js +10 -13
- package/es/InputWriting/InputWriting.js +12 -15
- package/es/Layout/Layout.js +14 -17
- package/es/Link/Link.js +7 -10
- package/es/NumberInput/NumberInput.js +13 -16
- package/es/Search/Search.js +52 -55
- package/es/Search2/Search.js +85 -88
- package/es/Search2/Search.less +64 -64
- package/es/Search2/package.json +6 -6
- package/es/Sidebar/Sidebar.js +11 -14
- package/es/Sidebar2/Sidebar.js +13 -16
- package/es/SuperForm/SuperForm.js +74 -79
- package/es/SuperForm2/SuperForm.js +95 -100
- package/es/SuperPagination/SuperPagination.js +8 -11
- package/es/SuperTab/SuperTab.js +12 -15
- package/es/SuperTab2/SuperTab2.js +13 -16
- package/es/SuperTable/DragSortRow.js +12 -15
- package/es/SuperTable/FilterDropDown.js +11 -14
- package/es/SuperTable/SuperTable.js +68 -71
- package/es/SuperTable2/SuperTable2.js +90 -88
- package/es/SuperTable2/SuperTableCell.js +27 -30
- package/es/SuperTable3/FilterDropDown.js +11 -14
- package/es/SuperTable3/SuperTable.js +58 -61
- package/es/SuperToolbar/SuperToolbar.js +11 -14
- package/es/SuperUpload/SuperUpload.js +107 -91
- package/es/Viewer/ImageViews.js +16 -19
- package/es/Viewer/Viewer.js +11 -14
- package/es/helper.js +18 -17
- package/lib/Area/Area.js +8 -11
- package/lib/CodeInput/CodeInput.js +16 -19
- package/lib/Enhance/Dialogs.js +11 -14
- package/lib/Enhance/Loading.js +15 -18
- package/lib/Header/Header.js +17 -20
- package/lib/Header/Vertical.js +11 -14
- package/lib/ImageView/ImageView.js +10 -13
- package/lib/InpurCascader/InputCascader.js +11 -14
- package/lib/InputEditor/InputEditor.js +16 -18
- package/lib/InputSearch/InputSearch.js +19 -22
- package/lib/InputSelect/InputSelect.js +14 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +10 -13
- package/lib/InputWriting/InputWriting.js +12 -15
- package/lib/Layout/Layout.js +14 -17
- package/lib/LayoutLink/LayoutLink.js +1 -2
- package/lib/Link/Link.js +7 -10
- package/lib/NumberInput/NumberInput.js +13 -16
- package/lib/Search/Search.js +53 -57
- package/lib/Search2/Search.js +86 -90
- package/lib/Search2/Search.less +64 -64
- package/lib/Search2/package.json +6 -6
- package/lib/Sidebar/Sidebar.js +11 -14
- package/lib/Sidebar2/Sidebar.js +13 -16
- package/lib/SuperForm/SuperForm.js +75 -81
- package/lib/SuperForm2/SuperForm.js +96 -102
- package/lib/SuperPagination/SuperPagination.js +8 -11
- package/lib/SuperTab/SuperTab.js +12 -15
- package/lib/SuperTab2/SuperTab2.js +13 -16
- package/lib/SuperTable/DragSortRow.js +12 -15
- package/lib/SuperTable/FilterDropDown.js +11 -14
- package/lib/SuperTable/SuperTable.js +68 -71
- package/lib/SuperTable2/SuperTable2.js +91 -90
- package/lib/SuperTable2/SuperTableCell.js +27 -30
- package/lib/SuperTable3/FilterDropDown.js +11 -14
- package/lib/SuperTable3/SuperTable.js +58 -61
- package/lib/SuperToolbar/SuperToolbar.js +11 -14
- package/lib/SuperUpload/SuperUpload.js +96 -81
- package/lib/Viewer/ImageViews.js +16 -19
- package/lib/Viewer/Viewer.js +11 -14
- package/lib/helper.js +18 -17
- package/package.json +1 -1
package/es/Search2/Search.js
CHANGED
|
@@ -14,14 +14,13 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
14
14
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
15
15
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
16
16
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
17
|
-
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
18
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
19
17
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
20
18
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
19
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
21
20
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
22
21
|
import _Form from "antd/es/form";
|
|
23
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; }
|
|
24
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
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; }
|
|
25
24
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
26
25
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
27
26
|
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
@@ -34,8 +33,8 @@ import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
34
33
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
35
34
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
36
35
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
|
|
37
|
-
function
|
|
38
|
-
function _isNativeReflectConstruct() {
|
|
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; })(); }
|
|
39
38
|
import React from 'react';
|
|
40
39
|
import PropTypes from 'prop-types';
|
|
41
40
|
import ReactDOM from 'react-dom';
|
|
@@ -57,11 +56,11 @@ var insertTimeKeyMap = {
|
|
|
57
56
|
var TYPE = ['text', 'search', 'searchText', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader' //级联选择下拉
|
|
58
57
|
];
|
|
59
58
|
|
|
60
|
-
/**
|
|
61
|
-
* search: 搜索按钮的标题
|
|
62
|
-
* more:更多按钮的标题
|
|
63
|
-
* reset:重置按钮的标题
|
|
64
|
-
* sort:排序按钮的标题
|
|
59
|
+
/**
|
|
60
|
+
* search: 搜索按钮的标题
|
|
61
|
+
* more:更多按钮的标题
|
|
62
|
+
* reset:重置按钮的标题
|
|
63
|
+
* sort:排序按钮的标题
|
|
65
64
|
*/
|
|
66
65
|
var ConfigType = {
|
|
67
66
|
search: PropTypes.string.isRequired,
|
|
@@ -70,11 +69,11 @@ var ConfigType = {
|
|
|
70
69
|
more: PropTypes.string
|
|
71
70
|
};
|
|
72
71
|
|
|
73
|
-
/**
|
|
74
|
-
* key: 唯一标识一个表单元素
|
|
75
|
-
* title:表单元素旁边的标题
|
|
76
|
-
* type:表单元素的类型
|
|
77
|
-
* props:传递给表单元素的额外属性
|
|
72
|
+
/**
|
|
73
|
+
* key: 唯一标识一个表单元素
|
|
74
|
+
* title:表单元素旁边的标题
|
|
75
|
+
* type:表单元素的类型
|
|
76
|
+
* props:传递给表单元素的额外属性
|
|
78
77
|
*/
|
|
79
78
|
var FilterType = {
|
|
80
79
|
key: PropTypes.string.isRequired,
|
|
@@ -84,18 +83,16 @@ var FilterType = {
|
|
|
84
83
|
props: PropTypes.object
|
|
85
84
|
};
|
|
86
85
|
|
|
87
|
-
/**
|
|
88
|
-
* data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
|
|
89
|
-
* isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
|
|
90
|
-
* options: 作用同FilterType.options类似,但优先级高于它
|
|
91
|
-
* onClick:按钮点击事件,原型为func(key)
|
|
92
|
-
* onChange:表单控件内容改变时触发,原型为func(key, value)
|
|
93
|
-
* onSearch:search控件发出的事件,原型为func(key, value)
|
|
94
|
-
* displayRow:折叠时需要展示的行数,整数,默认为2
|
|
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
|
|
95
94
|
*/
|
|
96
95
|
var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
97
|
-
_inherits(Search2, _React$Component);
|
|
98
|
-
var _super = _createSuper(Search2);
|
|
99
96
|
function Search2() {
|
|
100
97
|
var _context;
|
|
101
98
|
var _this;
|
|
@@ -103,15 +100,15 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
103
100
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
104
101
|
args[_key] = arguments[_key];
|
|
105
102
|
}
|
|
106
|
-
_this =
|
|
107
|
-
_defineProperty(
|
|
103
|
+
_this = _callSuper(this, Search2, _concatInstanceProperty(_context = []).call(_context, args));
|
|
104
|
+
_defineProperty(_this, "state", {
|
|
108
105
|
more: false
|
|
109
106
|
});
|
|
110
|
-
_defineProperty(
|
|
111
|
-
var _ref = _asyncToGenerator(
|
|
107
|
+
_defineProperty(_this, "getPathFun", /*#__PURE__*/function () {
|
|
108
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(key) {
|
|
112
109
|
var _context2, _context8;
|
|
113
110
|
var pathArr, _global$store$getStat, sidebars, navigation, title, body, url;
|
|
114
|
-
return _regeneratorRuntime.wrap(function
|
|
111
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
115
112
|
while (1) switch (_context9.prev = _context9.next) {
|
|
116
113
|
case 0:
|
|
117
114
|
pathArr = global.location.pathname.split('/');
|
|
@@ -148,7 +145,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
148
145
|
menuName: title
|
|
149
146
|
};
|
|
150
147
|
url = '/api/standard/log'; // await helper.fetchJson(url, helper.postOption(body))
|
|
151
|
-
case
|
|
148
|
+
case 1:
|
|
152
149
|
case "end":
|
|
153
150
|
return _context9.stop();
|
|
154
151
|
}
|
|
@@ -158,49 +155,49 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
158
155
|
return _ref.apply(this, arguments);
|
|
159
156
|
};
|
|
160
157
|
}());
|
|
161
|
-
_defineProperty(
|
|
158
|
+
_defineProperty(_this, "onClick", function (key) {
|
|
162
159
|
var onClick = _this.props.onClick;
|
|
163
160
|
if (key === 'search') {
|
|
164
161
|
// this.getPathFun(key);
|
|
165
162
|
}
|
|
166
163
|
onClick && onClick(key);
|
|
167
164
|
});
|
|
168
|
-
_defineProperty(
|
|
165
|
+
_defineProperty(_this, "onMore", function () {
|
|
169
166
|
var onHeightChange = _this.props.onHeightChange;
|
|
170
167
|
_this.setState({
|
|
171
168
|
more: !_this.state.more
|
|
172
169
|
});
|
|
173
170
|
onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
|
|
174
171
|
});
|
|
175
|
-
_defineProperty(
|
|
176
|
-
var
|
|
172
|
+
_defineProperty(_this, "onChange", function (dictionary, key, value) {
|
|
173
|
+
var _context0, _context1;
|
|
177
174
|
var onChange = _this.props.onChange;
|
|
178
|
-
if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(
|
|
175
|
+
if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(_context0 = _mapInstanceProperty(_context1 = global.dictionary[dictionary]).call(_context1, function (item) {
|
|
179
176
|
return item.value;
|
|
180
|
-
})).call(
|
|
181
|
-
var
|
|
177
|
+
})).call(_context0, value)) {
|
|
178
|
+
var _context10;
|
|
182
179
|
var realValue = JSON.parse(value);
|
|
183
180
|
_this.onClick('reset');
|
|
184
|
-
_mapInstanceProperty(
|
|
181
|
+
_mapInstanceProperty(_context10 = _Object$keys(realValue)).call(_context10, function (objectKey) {
|
|
185
182
|
onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
|
|
186
183
|
});
|
|
187
184
|
}
|
|
188
185
|
onChange && onChange(key, value);
|
|
189
186
|
});
|
|
190
|
-
_defineProperty(
|
|
187
|
+
_defineProperty(_this, "onPressEnter", function () {
|
|
191
188
|
ReactDOM.findDOMNode(_this.refs.search).click();
|
|
192
189
|
});
|
|
193
|
-
_defineProperty(
|
|
194
|
-
var
|
|
190
|
+
_defineProperty(_this, "toButton", function (key) {
|
|
191
|
+
var _context11;
|
|
195
192
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
196
193
|
var config = _this.props.config;
|
|
197
|
-
var onClick = _bindInstanceProperty(
|
|
194
|
+
var onClick = _bindInstanceProperty(_context11 = _this.onClick).call(_context11, _this, key);
|
|
198
195
|
return /*#__PURE__*/React.createElement(_Button, _extends({
|
|
199
196
|
size: defaultSize,
|
|
200
197
|
onClick: onClick
|
|
201
198
|
}, props), config[key]);
|
|
202
199
|
});
|
|
203
|
-
_defineProperty(
|
|
200
|
+
_defineProperty(_this, "toMore", function () {
|
|
204
201
|
return /*#__PURE__*/React.createElement("a", {
|
|
205
202
|
role: "more",
|
|
206
203
|
onClick: _this.onMore
|
|
@@ -209,7 +206,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
209
206
|
"data-status": !_this.state.more ? 'down' : 'up'
|
|
210
207
|
}));
|
|
211
208
|
});
|
|
212
|
-
_defineProperty(
|
|
209
|
+
_defineProperty(_this, "toButtons", function () {
|
|
213
210
|
var config = _this.props.config;
|
|
214
211
|
return /*#__PURE__*/React.createElement("div", {
|
|
215
212
|
role: "buttons"
|
|
@@ -218,7 +215,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
218
215
|
type: 'primary'
|
|
219
216
|
}), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
|
|
220
217
|
});
|
|
221
|
-
_defineProperty(
|
|
218
|
+
_defineProperty(_this, "isSort", function () {
|
|
222
219
|
var _this$props = _this.props,
|
|
223
220
|
config = _this$props.config,
|
|
224
221
|
_this$props$colNum = _this$props.colNum,
|
|
@@ -228,7 +225,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
228
225
|
isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
|
|
229
226
|
return isSort && _sortInstanceProperty(config) && filters.length > colNum;
|
|
230
227
|
});
|
|
231
|
-
_defineProperty(
|
|
228
|
+
_defineProperty(_this, "isMore", function () {
|
|
232
229
|
var _this$props2 = _this.props,
|
|
233
230
|
config = _this$props2.config,
|
|
234
231
|
_this$props2$colNum = _this$props2.colNum,
|
|
@@ -240,7 +237,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
240
237
|
return !item.hide;
|
|
241
238
|
}).length > colNum * displayRow;
|
|
242
239
|
});
|
|
243
|
-
_defineProperty(
|
|
240
|
+
_defineProperty(_this, "getOptions", function (filter) {
|
|
244
241
|
var options = _this.props.options;
|
|
245
242
|
if (options && _Array$isArray(options[filter.key])) {
|
|
246
243
|
return options[filter.key];
|
|
@@ -248,21 +245,21 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
248
245
|
return filter.options || filter.typeRelated || [];
|
|
249
246
|
}
|
|
250
247
|
});
|
|
251
|
-
_defineProperty(
|
|
248
|
+
_defineProperty(_this, "getContainer", function () {
|
|
252
249
|
return _this.props.getContainer;
|
|
253
250
|
});
|
|
254
|
-
_defineProperty(
|
|
255
|
-
var
|
|
251
|
+
_defineProperty(_this, "getControlProps", function (control) {
|
|
252
|
+
var _context12;
|
|
256
253
|
var _this$props$data = _this.props.data,
|
|
257
254
|
data = _this$props$data === void 0 ? {} : _this$props$data;
|
|
258
255
|
return _objectSpread(_objectSpread({}, control.props || {}), {}, {
|
|
259
256
|
size: defaultSize,
|
|
260
257
|
type: control.type,
|
|
261
258
|
value: makeString(data[control.key]),
|
|
262
|
-
onChange: _bindInstanceProperty(
|
|
259
|
+
onChange: _bindInstanceProperty(_context12 = _this.onChange).call(_context12, _this, control.dictionary, control.key)
|
|
263
260
|
});
|
|
264
261
|
});
|
|
265
|
-
_defineProperty(
|
|
262
|
+
_defineProperty(_this, "validDate", function (_ref2) {
|
|
266
263
|
var key = _ref2.key,
|
|
267
264
|
type = _ref2.type;
|
|
268
265
|
return function (date) {
|
|
@@ -281,16 +278,16 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
281
278
|
}
|
|
282
279
|
};
|
|
283
280
|
});
|
|
284
|
-
_defineProperty(
|
|
281
|
+
_defineProperty(_this, "toText", function (props) {
|
|
285
282
|
props.onPressEnter = _this.onPressEnter;
|
|
286
283
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
287
284
|
});
|
|
288
|
-
_defineProperty(
|
|
285
|
+
_defineProperty(_this, "toNumber", function (props) {
|
|
289
286
|
props.defaultValue = props.value;
|
|
290
287
|
delete props.value;
|
|
291
288
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
292
289
|
});
|
|
293
|
-
_defineProperty(
|
|
290
|
+
_defineProperty(_this, "getQueryGroupOptions", function (_ref3) {
|
|
294
291
|
var dictionary = _ref3.dictionary,
|
|
295
292
|
_ref3$configCode = _ref3.configCode,
|
|
296
293
|
configCode = _ref3$configCode === void 0 ? 'unknown' : _ref3$configCode;
|
|
@@ -311,14 +308,14 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
311
308
|
};
|
|
312
309
|
}));
|
|
313
310
|
});
|
|
314
|
-
_defineProperty(
|
|
311
|
+
_defineProperty(_this, "toSelect", function (props, filter) {
|
|
315
312
|
var container = _this.getContainer();
|
|
316
313
|
container && (props.getPopupContainer = container);
|
|
317
314
|
props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
|
|
318
315
|
props.dropdownMatchSelectWidth = false;
|
|
319
316
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
320
317
|
});
|
|
321
|
-
_defineProperty(
|
|
318
|
+
_defineProperty(_this, "createSearchEvent", function (filter) {
|
|
322
319
|
if (_this.props.onSearch) {
|
|
323
320
|
return function (value) {
|
|
324
321
|
return _this.props.onSearch(filter.key, value, filter);
|
|
@@ -327,7 +324,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
327
324
|
return null;
|
|
328
325
|
}
|
|
329
326
|
});
|
|
330
|
-
_defineProperty(
|
|
327
|
+
_defineProperty(_this, "toSearch", function (props, filter) {
|
|
331
328
|
var container = _this.getContainer();
|
|
332
329
|
container && (props.getPopupContainer = container);
|
|
333
330
|
props.options = _this.getOptions(filter);
|
|
@@ -335,7 +332,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
335
332
|
props.dropdownMatchSelectWidth = false;
|
|
336
333
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
337
334
|
});
|
|
338
|
-
_defineProperty(
|
|
335
|
+
_defineProperty(_this, "selectSearch", function (props, filter) {
|
|
339
336
|
var container = _this.getContainer();
|
|
340
337
|
container && (props.getPopupContainer = container);
|
|
341
338
|
props.options = _this.getOptions(filter);
|
|
@@ -343,7 +340,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
343
340
|
props.dropdownMatchSelectWidth = false;
|
|
344
341
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
345
342
|
});
|
|
346
|
-
_defineProperty(
|
|
343
|
+
_defineProperty(_this, "toDate", function (props, _ref5) {
|
|
347
344
|
var rule = _ref5.rule;
|
|
348
345
|
var container = _this.getContainer();
|
|
349
346
|
container && (props.getCalendarContainer = container);
|
|
@@ -353,11 +350,11 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
353
350
|
};
|
|
354
351
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
355
352
|
});
|
|
356
|
-
_defineProperty(
|
|
353
|
+
_defineProperty(_this, "toReadonly", function (props, filter) {
|
|
357
354
|
props.value = getTitle(props.value, _this.getOptions(filter));
|
|
358
355
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
359
356
|
});
|
|
360
|
-
_defineProperty(
|
|
357
|
+
_defineProperty(_this, "toCascader", function (props, filter) {
|
|
361
358
|
var container = _this.getContainer();
|
|
362
359
|
container && (props.getPopupContainer = container);
|
|
363
360
|
props.options = _this.getOptions(filter);
|
|
@@ -365,7 +362,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
365
362
|
props.placeholder = filter.placeholder || '';
|
|
366
363
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
367
364
|
});
|
|
368
|
-
_defineProperty(
|
|
365
|
+
_defineProperty(_this, "toControl", function (control) {
|
|
369
366
|
var props = _this.getControlProps(control);
|
|
370
367
|
switch (control.type) {
|
|
371
368
|
case 'text':
|
|
@@ -389,29 +386,29 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
389
386
|
return 'type error';
|
|
390
387
|
}
|
|
391
388
|
});
|
|
392
|
-
_defineProperty(
|
|
389
|
+
_defineProperty(_this, "toLabel", function (_ref6) {
|
|
393
390
|
var title = _ref6.title,
|
|
394
391
|
key = _ref6.key,
|
|
395
392
|
dictionary = _ref6.dictionary,
|
|
396
393
|
_ref6$configCode = _ref6.configCode,
|
|
397
394
|
configCode = _ref6$configCode === void 0 ? 'unknown' : _ref6$configCode;
|
|
398
395
|
if (key === 'queryGroup') {
|
|
399
|
-
var
|
|
396
|
+
var _context13, _context14;
|
|
400
397
|
//查询组合
|
|
401
398
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
402
399
|
role: "icon",
|
|
403
400
|
type: "plus-circle-o",
|
|
404
|
-
onClick: _bindInstanceProperty(
|
|
401
|
+
onClick: _bindInstanceProperty(_context13 = _this.onAddQueryGroup).call(_context13, _this, configCode, _this.props.data, dictionary)
|
|
405
402
|
}), /*#__PURE__*/React.createElement(_Icon, {
|
|
406
403
|
role: "icon",
|
|
407
404
|
type: "minus-circle-o",
|
|
408
|
-
onClick: _bindInstanceProperty(
|
|
405
|
+
onClick: _bindInstanceProperty(_context14 = _this.onDelQueryGroup).call(_context14, _this, configCode, _this.props.data, dictionary)
|
|
409
406
|
}));
|
|
410
407
|
} else {
|
|
411
408
|
return title;
|
|
412
409
|
}
|
|
413
410
|
});
|
|
414
|
-
_defineProperty(
|
|
411
|
+
_defineProperty(_this, "toCol", function (span, control, more) {
|
|
415
412
|
var factor = control.span || 1;
|
|
416
413
|
return /*#__PURE__*/React.createElement(_Col, {
|
|
417
414
|
span: span * factor,
|
|
@@ -426,7 +423,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
426
423
|
required: control.required
|
|
427
424
|
}, _this.toControl(control)));
|
|
428
425
|
});
|
|
429
|
-
_defineProperty(
|
|
426
|
+
_defineProperty(_this, "toCols", function () {
|
|
430
427
|
var _this$props3 = _this.props,
|
|
431
428
|
_this$props3$insertTi = _this$props3.insertTimeKey,
|
|
432
429
|
insertTimeKey = _this$props3$insertTi === void 0 ? 'from' : _this$props3$insertTi,
|
|
@@ -450,8 +447,8 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
450
447
|
});
|
|
451
448
|
if (insertTimeCols.length > 0) {
|
|
452
449
|
if (otherCols.length >= defaultColNum) {
|
|
453
|
-
var
|
|
454
|
-
_spliceInstanceProperty(otherCols).apply(otherCols, _concatInstanceProperty(
|
|
450
|
+
var _context15;
|
|
451
|
+
_spliceInstanceProperty(otherCols).apply(otherCols, _concatInstanceProperty(_context15 = [6, 0]).call(_context15, _toConsumableArray(insertTimeCols)));
|
|
455
452
|
newFilters = otherCols;
|
|
456
453
|
} else {
|
|
457
454
|
newFilters = _concatInstanceProperty(otherCols).call(otherCols, insertTimeCols);
|
|
@@ -468,7 +465,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
468
465
|
});
|
|
469
466
|
}
|
|
470
467
|
});
|
|
471
|
-
_defineProperty(
|
|
468
|
+
_defineProperty(_this, "calWidth", function () {
|
|
472
469
|
var _this$props4 = _this.props,
|
|
473
470
|
_this$props4$colNum = _this$props4.colNum,
|
|
474
471
|
colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
|
|
@@ -482,7 +479,7 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
482
479
|
return "".concat(defaultColNum * 13.6, "%");
|
|
483
480
|
}
|
|
484
481
|
});
|
|
485
|
-
_defineProperty(
|
|
482
|
+
_defineProperty(_this, "calHeight", function (more) {
|
|
486
483
|
var _this$props5 = _this.props,
|
|
487
484
|
_this$props5$colNum = _this$props5.colNum,
|
|
488
485
|
colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
|
|
@@ -500,16 +497,17 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
500
497
|
});
|
|
501
498
|
return _this;
|
|
502
499
|
}
|
|
503
|
-
|
|
500
|
+
_inherits(Search2, _React$Component);
|
|
501
|
+
return _createClass(Search2, [{
|
|
504
502
|
key: "onAddQueryGroup",
|
|
505
503
|
value: function () {
|
|
506
|
-
var _onAddQueryGroup = _asyncToGenerator(
|
|
507
|
-
var
|
|
504
|
+
var _onAddQueryGroup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(configCode, searchData, dictionary) {
|
|
505
|
+
var _context16;
|
|
508
506
|
var filter, dicOptionNameArr, dicOptions;
|
|
509
|
-
return _regeneratorRuntime.wrap(function
|
|
510
|
-
while (1) switch (
|
|
507
|
+
return _regeneratorRuntime.wrap(function (_context17) {
|
|
508
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
511
509
|
case 0:
|
|
512
|
-
filter = _reduceInstanceProperty(
|
|
510
|
+
filter = _reduceInstanceProperty(_context16 = _Object$keys(searchData)).call(_context16, function (state, key) {
|
|
513
511
|
if (searchData[key] && key !== 'queryGroup') {
|
|
514
512
|
state[key] = searchData[key];
|
|
515
513
|
}
|
|
@@ -525,9 +523,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
525
523
|
// if (true === await showAddDialog(configCode, filter, dicOptionNameArr)) {
|
|
526
524
|
// this.onChange(undefined, 'queryGroup', '');
|
|
527
525
|
// }
|
|
528
|
-
case
|
|
526
|
+
case 1:
|
|
529
527
|
case "end":
|
|
530
|
-
return
|
|
528
|
+
return _context17.stop();
|
|
531
529
|
}
|
|
532
530
|
}, _callee2);
|
|
533
531
|
}));
|
|
@@ -539,10 +537,10 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
539
537
|
}, {
|
|
540
538
|
key: "onDelQueryGroup",
|
|
541
539
|
value: function () {
|
|
542
|
-
var _onDelQueryGroup = _asyncToGenerator(
|
|
540
|
+
var _onDelQueryGroup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(configCode, searchData, dictionary) {
|
|
543
541
|
var queryGroup, dicOptions, _JSON$parse, queryId;
|
|
544
|
-
return _regeneratorRuntime.wrap(function
|
|
545
|
-
while (1) switch (
|
|
542
|
+
return _regeneratorRuntime.wrap(function (_context18) {
|
|
543
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
546
544
|
case 0:
|
|
547
545
|
queryGroup = searchData.queryGroup; // if (!queryGroup) return helper.showError(`请先选择要删除的查询组合`);
|
|
548
546
|
if (dictionary && global.dictionary) {
|
|
@@ -551,9 +549,9 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
551
549
|
_JSON$parse = JSON.parse(queryGroup), queryId = _JSON$parse.queryId; // if(true === await showDeleteDialog(configCode, queryId)) {
|
|
552
550
|
// this.onClick('reset');
|
|
553
551
|
// }
|
|
554
|
-
case
|
|
552
|
+
case 1:
|
|
555
553
|
case "end":
|
|
556
|
-
return
|
|
554
|
+
return _context18.stop();
|
|
557
555
|
}
|
|
558
556
|
}, _callee3);
|
|
559
557
|
}));
|
|
@@ -580,7 +578,6 @@ var Search2 = /*#__PURE__*/function (_React$Component) {
|
|
|
580
578
|
}, this.toCols())), this.toButtons());
|
|
581
579
|
}
|
|
582
580
|
}]);
|
|
583
|
-
return Search2;
|
|
584
581
|
}(React.Component);
|
|
585
582
|
_defineProperty(Search2, "propTypes", {
|
|
586
583
|
config: PropTypes.shape(ConfigType).isRequired,
|
package/es/Search2/Search.less
CHANGED
|
@@ -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
|
+
}
|
package/es/Search2/package.json
CHANGED
|
@@ -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
|
+
}
|