cloud-b2b 1.1.46 → 1.1.50
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 +45 -16
- package/es/Card/Card.js +4 -3
- package/es/CodeInput/CodeInput.js +59 -30
- package/es/Control/Control.js +117 -58
- package/es/Control/event.js +14 -0
- package/es/Enhance/Dialogs.js +21 -6
- package/es/Enhance/Loading.js +46 -26
- package/es/Enhance/index.js +2 -0
- package/es/Header/Header.js +35 -3
- package/es/Header/Vertical.js +24 -1
- package/es/ImageView/ImageView.js +22 -5
- package/es/Indent/Indent.js +7 -3
- package/es/InpurCascader/InputCascader.js +36 -10
- package/es/InputEditor/InputEditor.js +52 -53
- package/es/InputSearch/InputSearch.js +71 -26
- package/es/InputSelect/InputSelect.js +48 -17
- package/es/InputTreeSelect/InputTreeSelect.js +147 -0
- package/es/InputTreeSelect/package.json +6 -0
- package/es/InputWriting/InputWriting.js +28 -6
- package/es/Layout/Layout.js +59 -28
- package/es/LayoutLink/LayoutLink.js +20 -11
- package/es/Link/Link.js +27 -4
- package/es/Loading/Loading.js +3 -1
- package/es/Loading2/Loading2.js +2 -0
- package/es/ModalWithDrag/ModalWithDrag.js +8 -3
- package/es/ModalWithDrag/drag.js +29 -12
- package/es/NumberInput/NumberInput.js +64 -24
- package/es/Search/Search.js +164 -54
- package/es/Sidebar/Sidebar.js +34 -13
- package/es/Sidebar2/Sidebar.js +30 -3
- package/es/SuperForm/SuperForm.js +164 -27
- package/es/SuperForm2/SuperForm.js +182 -31
- package/es/SuperIcon/SuperIcon.js +6 -3
- package/es/SuperPagination/SuperPagination.js +32 -15
- package/es/SuperTab/SuperTab.js +27 -4
- package/es/SuperTab2/SuperTab2.js +33 -11
- package/es/SuperTable/DragSortRow.js +34 -6
- package/es/SuperTable/FilterDropDown.js +34 -10
- package/es/SuperTable/SuperTable.js +216 -84
- package/es/SuperTable/fixed.js +9 -1
- package/es/SuperTable2/SuperTable2.js +226 -101
- package/es/SuperTable2/SuperTableCell.js +60 -16
- package/es/SuperTable3/FilterDropDown.js +34 -10
- package/es/SuperTable3/SuperTable.js +175 -50
- package/es/SuperTable3/fixed.js +9 -1
- package/es/SuperToolbar/SuperToolbar.js +49 -21
- package/es/SuperUpload/SuperUpload.js +233 -156
- package/es/Title/Title.js +15 -12
- package/es/Viewer/ImageViews.js +60 -7
- package/es/Viewer/Viewer.js +32 -5
- package/es/WingBlank/WingBlank.js +6 -2
- package/es/helper.js +29 -7
- package/es/history.js +2 -3
- package/lib/Area/Area.js +64 -16
- package/lib/Card/Card.js +13 -3
- package/lib/CodeInput/CodeInput.js +77 -30
- package/lib/Control/Control.js +160 -58
- package/lib/Control/event.js +16 -0
- package/lib/Enhance/Dialogs.js +32 -6
- package/lib/Enhance/Loading.js +62 -26
- package/lib/Enhance/index.js +9 -0
- package/lib/Header/Header.js +48 -3
- package/lib/Header/Vertical.js +36 -1
- package/lib/ImageView/ImageView.js +30 -5
- package/lib/Indent/Indent.js +13 -3
- package/lib/InpurCascader/InputCascader.js +50 -11
- package/lib/InputEditor/InputEditor.js +61 -53
- package/lib/InputSearch/InputSearch.js +78 -26
- package/lib/InputSelect/InputSelect.js +62 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +35 -6
- package/lib/Layout/Layout.js +76 -28
- package/lib/LayoutLink/LayoutLink.js +38 -11
- package/lib/Link/Link.js +40 -4
- package/lib/Loading/Loading.js +9 -1
- package/lib/Loading2/Loading2.js +8 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
- package/lib/ModalWithDrag/drag.js +34 -12
- package/lib/NumberInput/NumberInput.js +77 -24
- package/lib/Search/Search.js +171 -54
- package/lib/Sidebar/Sidebar.js +46 -13
- package/lib/Sidebar2/Sidebar.js +42 -3
- package/lib/SuperForm/SuperForm.js +162 -27
- package/lib/SuperForm2/SuperForm.js +175 -31
- package/lib/SuperIcon/SuperIcon.js +14 -3
- package/lib/SuperPagination/SuperPagination.js +42 -15
- package/lib/SuperTab/SuperTab.js +34 -4
- package/lib/SuperTab2/SuperTab2.js +48 -11
- package/lib/SuperTable/DragSortRow.js +42 -6
- package/lib/SuperTable/FilterDropDown.js +42 -10
- package/lib/SuperTable/SuperTable.js +211 -83
- package/lib/SuperTable/fixed.js +13 -1
- package/lib/SuperTable2/SuperTable2.js +240 -101
- package/lib/SuperTable2/SuperTableCell.js +67 -13
- package/lib/SuperTable3/FilterDropDown.js +42 -10
- package/lib/SuperTable3/SuperTable.js +170 -49
- package/lib/SuperTable3/fixed.js +13 -1
- package/lib/SuperToolbar/SuperToolbar.js +64 -20
- package/lib/SuperUpload/SuperUpload.js +267 -156
- package/lib/Title/Title.js +24 -12
- package/lib/Viewer/ImageViews.js +63 -7
- package/lib/Viewer/Viewer.js +41 -5
- package/lib/WingBlank/WingBlank.js +14 -2
- package/lib/helper.js +47 -6
- package/lib/history.js +5 -0
- package/lib/index.js +76 -0
- package/lib/variables.js +4 -0
- package/package.json +2 -2
package/es/Search/Search.js
CHANGED
|
@@ -20,8 +20,11 @@ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
|
20
20
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
21
21
|
import _Form from "antd/es/form";
|
|
22
22
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
23
|
+
|
|
23
24
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
24
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context12, _context13; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context12 = ownKeys(Object(source), !0)).call(_context12, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context13 = ownKeys(Object(source))).call(_context13, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
25
28
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
26
29
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
27
30
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
@@ -31,8 +34,11 @@ import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
31
34
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
32
35
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
33
36
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
37
|
+
|
|
34
38
|
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); }; }
|
|
39
|
+
|
|
35
40
|
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; } }
|
|
41
|
+
|
|
36
42
|
import React from 'react';
|
|
37
43
|
import PropTypes from 'prop-types';
|
|
38
44
|
import ReactDOM from 'react-dom';
|
|
@@ -42,28 +48,29 @@ import variables from '../variables';
|
|
|
42
48
|
var FormItem = _Form.Item;
|
|
43
49
|
var defaultSize = 'small';
|
|
44
50
|
var defaultColNum = 4;
|
|
45
|
-
var TYPE = ['text', 'search', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader' //级联选择下拉
|
|
51
|
+
var TYPE = ['text', 'search', 'select', 'number', 'date', 'readonly', 'selectSearch', 'cascader', //级联选择下拉
|
|
52
|
+
'treeSelect' //树选择
|
|
46
53
|
];
|
|
47
|
-
|
|
48
54
|
/**
|
|
49
55
|
* search: 搜索按钮的标题
|
|
50
56
|
* more:更多按钮的标题
|
|
51
57
|
* reset:重置按钮的标题
|
|
52
58
|
* sort:排序按钮的标题
|
|
53
59
|
*/
|
|
60
|
+
|
|
54
61
|
var ConfigType = {
|
|
55
62
|
search: PropTypes.string.isRequired,
|
|
56
63
|
reset: PropTypes.string,
|
|
57
64
|
sort: PropTypes.string,
|
|
58
65
|
more: PropTypes.string
|
|
59
66
|
};
|
|
60
|
-
|
|
61
67
|
/**
|
|
62
68
|
* key: 唯一标识一个表单元素
|
|
63
69
|
* title:表单元素旁边的标题
|
|
64
70
|
* type:表单元素的类型
|
|
65
71
|
* props:传递给表单元素的额外属性
|
|
66
72
|
*/
|
|
73
|
+
|
|
67
74
|
var FilterType = {
|
|
68
75
|
key: PropTypes.string.isRequired,
|
|
69
76
|
title: PropTypes.string.isRequired,
|
|
@@ -71,7 +78,6 @@ var FilterType = {
|
|
|
71
78
|
options: PropTypes.array,
|
|
72
79
|
props: PropTypes.object
|
|
73
80
|
};
|
|
74
|
-
|
|
75
81
|
/**
|
|
76
82
|
* data:传递给filters的默认值,为key:value的形式,此处的key为FilterType中的key
|
|
77
83
|
* isSort:是否需要排序按钮,默认false,当设置为true时,onClick函数需要实现key为sort的响应函数
|
|
@@ -81,59 +87,84 @@ var FilterType = {
|
|
|
81
87
|
* onSearch:search控件发出的事件,原型为func(key, value)
|
|
82
88
|
* displayRow:折叠时需要展示的行数,整数,默认为1
|
|
83
89
|
*/
|
|
90
|
+
|
|
84
91
|
var Search = /*#__PURE__*/function (_React$Component) {
|
|
85
92
|
_inherits(Search, _React$Component);
|
|
93
|
+
|
|
86
94
|
var _super = _createSuper(Search);
|
|
95
|
+
|
|
87
96
|
function Search() {
|
|
88
97
|
var _context;
|
|
98
|
+
|
|
89
99
|
var _this;
|
|
100
|
+
|
|
90
101
|
_classCallCheck(this, Search);
|
|
102
|
+
|
|
91
103
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
92
104
|
args[_key] = arguments[_key];
|
|
93
105
|
}
|
|
106
|
+
|
|
94
107
|
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
108
|
+
|
|
95
109
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
96
110
|
more: false
|
|
97
111
|
});
|
|
112
|
+
|
|
98
113
|
_defineProperty(_assertThisInitialized(_this), "onClick", function (key) {
|
|
99
114
|
var onClick = _this.props.onClick;
|
|
100
115
|
onClick && onClick(key);
|
|
101
116
|
});
|
|
117
|
+
|
|
102
118
|
_defineProperty(_assertThisInitialized(_this), "onMore", function () {
|
|
103
119
|
var onHeightChange = _this.props.onHeightChange;
|
|
120
|
+
|
|
104
121
|
_this.setState({
|
|
105
122
|
more: !_this.state.more
|
|
106
123
|
});
|
|
124
|
+
|
|
107
125
|
onHeightChange && onHeightChange(_this.calHeight(!_this.state.more));
|
|
108
126
|
});
|
|
127
|
+
|
|
109
128
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (dictionary, key, value) {
|
|
110
129
|
var _context2, _context3;
|
|
130
|
+
|
|
111
131
|
var onChange = _this.props.onChange;
|
|
132
|
+
|
|
112
133
|
if (value && key === 'queryGroup' && dictionary && global.dictionary && global.dictionary[dictionary] && !_includesInstanceProperty(_context2 = _mapInstanceProperty(_context3 = global.dictionary[dictionary]).call(_context3, function (item) {
|
|
113
134
|
return item.value;
|
|
114
135
|
})).call(_context2, value)) {
|
|
115
136
|
var _context4;
|
|
137
|
+
|
|
116
138
|
var realValue = JSON.parse(value);
|
|
139
|
+
|
|
117
140
|
_this.onClick('reset');
|
|
141
|
+
|
|
118
142
|
_mapInstanceProperty(_context4 = _Object$keys(realValue)).call(_context4, function (objectKey) {
|
|
119
143
|
onChange && objectKey !== 'queryId' && onChange(objectKey, realValue[objectKey]);
|
|
120
144
|
});
|
|
121
145
|
}
|
|
146
|
+
|
|
122
147
|
onChange && onChange(key, value);
|
|
123
148
|
});
|
|
149
|
+
|
|
124
150
|
_defineProperty(_assertThisInitialized(_this), "onPressEnter", function () {
|
|
125
151
|
ReactDOM.findDOMNode(_this.refs.search).click();
|
|
126
152
|
});
|
|
153
|
+
|
|
127
154
|
_defineProperty(_assertThisInitialized(_this), "toButton", function (key) {
|
|
128
155
|
var _context5;
|
|
156
|
+
|
|
129
157
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
130
158
|
var config = _this.props.config;
|
|
159
|
+
|
|
131
160
|
var onClick = _bindInstanceProperty(_context5 = _this.onClick).call(_context5, _assertThisInitialized(_this), key);
|
|
161
|
+
|
|
132
162
|
return /*#__PURE__*/React.createElement(_Button, _extends({
|
|
133
163
|
size: defaultSize,
|
|
134
164
|
onClick: onClick
|
|
135
165
|
}, props), config[key]);
|
|
136
166
|
});
|
|
167
|
+
|
|
137
168
|
_defineProperty(_assertThisInitialized(_this), "toMore", function () {
|
|
138
169
|
return /*#__PURE__*/React.createElement("a", {
|
|
139
170
|
role: "more",
|
|
@@ -143,6 +174,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
143
174
|
"data-status": !_this.state.more ? 'down' : 'up'
|
|
144
175
|
}));
|
|
145
176
|
});
|
|
177
|
+
|
|
146
178
|
_defineProperty(_assertThisInitialized(_this), "toButtons", function () {
|
|
147
179
|
var config = _this.props.config;
|
|
148
180
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -152,43 +184,50 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
152
184
|
type: 'primary'
|
|
153
185
|
}), config.reset ? _this.toButton('reset') : null, _this.isSort() ? _this.toButton('sort') : null, _this.isMore() ? _this.toMore() : null);
|
|
154
186
|
});
|
|
187
|
+
|
|
155
188
|
_defineProperty(_assertThisInitialized(_this), "isSort", function () {
|
|
156
189
|
var _this$props = _this.props,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
190
|
+
config = _this$props.config,
|
|
191
|
+
_this$props$colNum = _this$props.colNum,
|
|
192
|
+
colNum = _this$props$colNum === void 0 ? defaultColNum : _this$props$colNum,
|
|
193
|
+
filters = _this$props.filters,
|
|
194
|
+
_this$props$isSort = _this$props.isSort,
|
|
195
|
+
isSort = _this$props$isSort === void 0 ? false : _this$props$isSort;
|
|
163
196
|
return isSort && _sortInstanceProperty(config) && filters.length > colNum;
|
|
164
197
|
});
|
|
198
|
+
|
|
165
199
|
_defineProperty(_assertThisInitialized(_this), "isMore", function () {
|
|
166
200
|
var _this$props2 = _this.props,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
201
|
+
config = _this$props2.config,
|
|
202
|
+
_this$props2$colNum = _this$props2.colNum,
|
|
203
|
+
colNum = _this$props2$colNum === void 0 ? defaultColNum : _this$props2$colNum,
|
|
204
|
+
filters = _this$props2.filters,
|
|
205
|
+
_this$props2$displayR = _this$props2.displayRow,
|
|
206
|
+
displayRow = _this$props2$displayR === void 0 ? 1 : _this$props2$displayR;
|
|
173
207
|
return config.more && _filterInstanceProperty(filters).call(filters, function (item) {
|
|
174
208
|
return !item.hide;
|
|
175
209
|
}).length > colNum * displayRow;
|
|
176
210
|
});
|
|
211
|
+
|
|
177
212
|
_defineProperty(_assertThisInitialized(_this), "getOptions", function (filter) {
|
|
178
213
|
var options = _this.props.options;
|
|
214
|
+
|
|
179
215
|
if (options && _Array$isArray(options[filter.key])) {
|
|
180
216
|
return options[filter.key];
|
|
181
217
|
} else {
|
|
182
218
|
return filter.options || filter.typeRelated || [];
|
|
183
219
|
}
|
|
184
220
|
});
|
|
221
|
+
|
|
185
222
|
_defineProperty(_assertThisInitialized(_this), "getContainer", function () {
|
|
186
223
|
return _this.props.getContainer;
|
|
187
224
|
});
|
|
225
|
+
|
|
188
226
|
_defineProperty(_assertThisInitialized(_this), "getControlProps", function (control) {
|
|
189
227
|
var _context6;
|
|
228
|
+
|
|
190
229
|
var _this$props$data = _this.props.data,
|
|
191
|
-
|
|
230
|
+
data = _this$props$data === void 0 ? {} : _this$props$data;
|
|
192
231
|
return _objectSpread(_objectSpread({}, control.props || {}), {}, {
|
|
193
232
|
size: defaultSize,
|
|
194
233
|
type: control.type,
|
|
@@ -196,12 +235,14 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
196
235
|
onChange: _bindInstanceProperty(_context6 = _this.onChange).call(_context6, _assertThisInitialized(_this), control.dictionary, control.key)
|
|
197
236
|
});
|
|
198
237
|
});
|
|
238
|
+
|
|
199
239
|
_defineProperty(_assertThisInitialized(_this), "validDate", function (_ref) {
|
|
200
240
|
var key = _ref.key,
|
|
201
|
-
|
|
241
|
+
type = _ref.type;
|
|
202
242
|
return function (date) {
|
|
203
243
|
var _this$props$data2 = _this.props.data,
|
|
204
|
-
|
|
244
|
+
data = _this$props$data2 === void 0 ? {} : _this$props$data2;
|
|
245
|
+
|
|
205
246
|
if (!date || !data[key]) {
|
|
206
247
|
return false;
|
|
207
248
|
} else {
|
|
@@ -215,29 +256,36 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
215
256
|
}
|
|
216
257
|
};
|
|
217
258
|
});
|
|
259
|
+
|
|
218
260
|
_defineProperty(_assertThisInitialized(_this), "toText", function (props) {
|
|
219
261
|
props.onPressEnter = _this.onPressEnter;
|
|
220
262
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
221
263
|
});
|
|
264
|
+
|
|
222
265
|
_defineProperty(_assertThisInitialized(_this), "toNumber", function (props) {
|
|
223
266
|
props.defaultValue = props.value;
|
|
224
267
|
delete props.value;
|
|
225
268
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
226
269
|
});
|
|
270
|
+
|
|
227
271
|
_defineProperty(_assertThisInitialized(_this), "getQueryGroupOptions", function (_ref2) {
|
|
228
272
|
var dictionary = _ref2.dictionary,
|
|
229
|
-
|
|
230
|
-
|
|
273
|
+
_ref2$configCode = _ref2.configCode,
|
|
274
|
+
configCode = _ref2$configCode === void 0 ? 'unknown' : _ref2$configCode;
|
|
231
275
|
var realOptions = [];
|
|
276
|
+
|
|
232
277
|
if (dictionary && global.dictionary) {
|
|
233
278
|
var dicOptions = global.dictionary[dictionary] || [];
|
|
234
279
|
realOptions = _concatInstanceProperty(realOptions).call(realOptions, dicOptions);
|
|
235
280
|
}
|
|
281
|
+
|
|
236
282
|
var state = global.store.getState();
|
|
237
283
|
var path = ['layout', 'tableColsSetting', configCode];
|
|
284
|
+
|
|
238
285
|
var _ref3 = getPathValue(state, path) || {},
|
|
239
|
-
|
|
240
|
-
|
|
286
|
+
_ref3$queryList = _ref3.queryList,
|
|
287
|
+
queryList = _ref3$queryList === void 0 ? [] : _ref3$queryList;
|
|
288
|
+
|
|
241
289
|
return _concatInstanceProperty(realOptions).call(realOptions, _mapInstanceProperty(queryList).call(queryList, function (item) {
|
|
242
290
|
return {
|
|
243
291
|
title: item.name,
|
|
@@ -245,13 +293,16 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
245
293
|
};
|
|
246
294
|
}));
|
|
247
295
|
});
|
|
296
|
+
|
|
248
297
|
_defineProperty(_assertThisInitialized(_this), "toSelect", function (props, filter) {
|
|
249
298
|
var container = _this.getContainer();
|
|
299
|
+
|
|
250
300
|
container && (props.getPopupContainer = container);
|
|
251
301
|
props.options = filter.key === 'queryGroup' ? _this.getQueryGroupOptions(filter) : _this.getOptions(filter);
|
|
252
302
|
props.dropdownMatchSelectWidth = false;
|
|
253
303
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
254
304
|
});
|
|
305
|
+
|
|
255
306
|
_defineProperty(_assertThisInitialized(_this), "createSearchEvent", function (filter) {
|
|
256
307
|
if (_this.props.onSearch) {
|
|
257
308
|
return function (value) {
|
|
@@ -261,25 +312,32 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
261
312
|
return null;
|
|
262
313
|
}
|
|
263
314
|
});
|
|
315
|
+
|
|
264
316
|
_defineProperty(_assertThisInitialized(_this), "toSearch", function (props, filter) {
|
|
265
317
|
var container = _this.getContainer();
|
|
318
|
+
|
|
266
319
|
container && (props.getPopupContainer = container);
|
|
267
320
|
props.options = _this.getOptions(filter);
|
|
268
321
|
props.onSearch = _this.createSearchEvent(filter);
|
|
269
322
|
props.dropdownMatchSelectWidth = false;
|
|
270
323
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
271
324
|
});
|
|
325
|
+
|
|
272
326
|
_defineProperty(_assertThisInitialized(_this), "selectSearch", function (props, filter) {
|
|
273
327
|
var container = _this.getContainer();
|
|
328
|
+
|
|
274
329
|
container && (props.getPopupContainer = container);
|
|
275
330
|
props.options = _this.getOptions(filter);
|
|
276
331
|
props.onSearch = _this.createSearchEvent(filter);
|
|
277
332
|
props.dropdownMatchSelectWidth = false;
|
|
278
333
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
279
334
|
});
|
|
335
|
+
|
|
280
336
|
_defineProperty(_assertThisInitialized(_this), "toDate", function (props, _ref4) {
|
|
281
337
|
var rule = _ref4.rule;
|
|
338
|
+
|
|
282
339
|
var container = _this.getContainer();
|
|
340
|
+
|
|
283
341
|
container && (props.getCalendarContainer = container);
|
|
284
342
|
rule && (props.disabledDate = _this.validDate(rule));
|
|
285
343
|
props.style = {
|
|
@@ -287,49 +345,78 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
287
345
|
};
|
|
288
346
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
289
347
|
});
|
|
348
|
+
|
|
290
349
|
_defineProperty(_assertThisInitialized(_this), "toReadonly", function (props, filter) {
|
|
291
350
|
props.value = getTitle(props.value, _this.getOptions(filter));
|
|
292
351
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
293
352
|
});
|
|
353
|
+
|
|
294
354
|
_defineProperty(_assertThisInitialized(_this), "toCascader", function (props, filter) {
|
|
295
355
|
var container = _this.getContainer();
|
|
356
|
+
|
|
296
357
|
container && (props.getPopupContainer = container);
|
|
297
358
|
props.options = _this.getOptions(filter);
|
|
298
359
|
props.onSearch = _this.createSearchEvent(filter);
|
|
299
360
|
props.placeholder = filter.placeholder || '';
|
|
300
361
|
return /*#__PURE__*/React.createElement(Control, props);
|
|
301
362
|
});
|
|
363
|
+
|
|
364
|
+
_defineProperty(_assertThisInitialized(_this), "toTreeSelect", function (props, filter) {
|
|
365
|
+
var container = _this.getContainer();
|
|
366
|
+
|
|
367
|
+
container && (props.getPopupContainer = container);
|
|
368
|
+
props.options = _this.getOptions(filter);
|
|
369
|
+
props.onSearch = _this.createSearchEvent(filter);
|
|
370
|
+
props.placeholder = filter.placeholder || '';
|
|
371
|
+
return /*#__PURE__*/React.createElement(Control, props);
|
|
372
|
+
});
|
|
373
|
+
|
|
302
374
|
_defineProperty(_assertThisInitialized(_this), "toControl", function (control) {
|
|
303
375
|
var props = _this.getControlProps(control);
|
|
376
|
+
|
|
304
377
|
switch (control.type) {
|
|
305
378
|
case 'text':
|
|
306
379
|
return _this.toText(props, control);
|
|
380
|
+
|
|
307
381
|
case 'number':
|
|
308
382
|
return _this.toNumber(props, control);
|
|
383
|
+
|
|
309
384
|
case 'select':
|
|
310
385
|
return _this.toSelect(props, control);
|
|
386
|
+
|
|
311
387
|
case 'selectSearch':
|
|
312
388
|
return _this.selectSearch(props, control);
|
|
389
|
+
|
|
313
390
|
case 'search':
|
|
314
391
|
return _this.toSearch(props, control);
|
|
392
|
+
|
|
315
393
|
case 'date':
|
|
316
394
|
return _this.toDate(props, control);
|
|
395
|
+
|
|
317
396
|
case 'readonly':
|
|
318
397
|
return _this.toReadonly(props, control);
|
|
398
|
+
|
|
319
399
|
case 'cascader':
|
|
320
400
|
return _this.toCascader(props, control);
|
|
401
|
+
|
|
402
|
+
case 'treeSelect':
|
|
403
|
+
return _this.toTreeSelect(props, control);
|
|
404
|
+
|
|
321
405
|
default:
|
|
322
406
|
return 'type error';
|
|
323
407
|
}
|
|
324
408
|
});
|
|
409
|
+
|
|
325
410
|
_defineProperty(_assertThisInitialized(_this), "toLabel", function (_ref5) {
|
|
326
411
|
var title = _ref5.title,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
412
|
+
key = _ref5.key,
|
|
413
|
+
dictionary = _ref5.dictionary,
|
|
414
|
+
_ref5$configCode = _ref5.configCode,
|
|
415
|
+
configCode = _ref5$configCode === void 0 ? 'unknown' : _ref5$configCode;
|
|
416
|
+
|
|
331
417
|
if (key === 'queryGroup') {
|
|
332
418
|
var _context7, _context8;
|
|
419
|
+
|
|
333
420
|
//查询组合
|
|
334
421
|
return /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(_Icon, {
|
|
335
422
|
role: "icon",
|
|
@@ -344,6 +431,7 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
344
431
|
return title;
|
|
345
432
|
}
|
|
346
433
|
});
|
|
434
|
+
|
|
347
435
|
_defineProperty(_assertThisInitialized(_this), "toCol", function (span, control, more) {
|
|
348
436
|
var factor = control.span || 1;
|
|
349
437
|
return /*#__PURE__*/React.createElement(_Col, {
|
|
@@ -359,14 +447,16 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
359
447
|
required: control.required
|
|
360
448
|
}, _this.toControl(control)));
|
|
361
449
|
});
|
|
450
|
+
|
|
362
451
|
_defineProperty(_assertThisInitialized(_this), "toCols", function () {
|
|
363
452
|
var _context9;
|
|
453
|
+
|
|
364
454
|
var _this$props3 = _this.props,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
455
|
+
_this$props3$colNum = _this$props3.colNum,
|
|
456
|
+
colNum = _this$props3$colNum === void 0 ? defaultColNum : _this$props3$colNum,
|
|
457
|
+
filters = _this$props3.filters,
|
|
458
|
+
_this$props3$displayR = _this$props3.displayRow,
|
|
459
|
+
displayRow = _this$props3$displayR === void 0 ? 1 : _this$props3$displayR;
|
|
370
460
|
var span = 24 / Math.min(colNum, _filterInstanceProperty(filters).call(filters, function (item) {
|
|
371
461
|
return !item.hide;
|
|
372
462
|
}).length);
|
|
@@ -376,27 +466,32 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
376
466
|
return _this.toCol(span, control, index >= colNum * displayRow);
|
|
377
467
|
});
|
|
378
468
|
});
|
|
469
|
+
|
|
379
470
|
_defineProperty(_assertThisInitialized(_this), "calWidth", function () {
|
|
380
471
|
var _this$props4 = _this.props,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
472
|
+
_this$props4$colNum = _this$props4.colNum,
|
|
473
|
+
colNum = _this$props4$colNum === void 0 ? defaultColNum : _this$props4$colNum,
|
|
474
|
+
filters = _this$props4.filters;
|
|
475
|
+
|
|
384
476
|
var length = _filterInstanceProperty(filters).call(filters, function (item) {
|
|
385
477
|
return !item.hide;
|
|
386
478
|
}).length;
|
|
479
|
+
|
|
387
480
|
if (length < colNum) {
|
|
388
481
|
return "".concat(length * 18, "%");
|
|
389
482
|
} else {
|
|
390
483
|
return "".concat(defaultColNum * 18, "%");
|
|
391
484
|
}
|
|
392
485
|
});
|
|
486
|
+
|
|
393
487
|
_defineProperty(_assertThisInitialized(_this), "calHeight", function (more) {
|
|
394
488
|
var _this$props5 = _this.props,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
489
|
+
_this$props5$colNum = _this$props5.colNum,
|
|
490
|
+
colNum = _this$props5$colNum === void 0 ? defaultColNum : _this$props5$colNum,
|
|
491
|
+
filters = _this$props5.filters,
|
|
492
|
+
_this$props5$displayR = _this$props5.displayRow,
|
|
493
|
+
displayRow = _this$props5$displayR === void 0 ? 1 : _this$props5$displayR;
|
|
494
|
+
|
|
400
495
|
if (more) {
|
|
401
496
|
var row = Math.ceil(_filterInstanceProperty(filters).call(filters, function (item) {
|
|
402
497
|
return !item.hide;
|
|
@@ -406,27 +501,34 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
406
501
|
return displayRow * 36 + (displayRow - 1) * 10;
|
|
407
502
|
}
|
|
408
503
|
});
|
|
504
|
+
|
|
409
505
|
return _this;
|
|
410
506
|
}
|
|
507
|
+
|
|
411
508
|
_createClass(Search, [{
|
|
412
509
|
key: "onAddQueryGroup",
|
|
413
510
|
value: function () {
|
|
414
511
|
var _onAddQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(configCode, searchData, dictionary) {
|
|
415
512
|
var onAddQueryGroup;
|
|
416
513
|
return _regeneratorRuntime.wrap(function _callee$(_context10) {
|
|
417
|
-
while (1)
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
514
|
+
while (1) {
|
|
515
|
+
switch (_context10.prev = _context10.next) {
|
|
516
|
+
case 0:
|
|
517
|
+
onAddQueryGroup = this.props.onAddQueryGroup;
|
|
518
|
+
onAddQueryGroup && onAddQueryGroup(configCode, searchData, dictionary);
|
|
519
|
+
|
|
520
|
+
case 2:
|
|
521
|
+
case "end":
|
|
522
|
+
return _context10.stop();
|
|
523
|
+
}
|
|
424
524
|
}
|
|
425
525
|
}, _callee, this);
|
|
426
526
|
}));
|
|
527
|
+
|
|
427
528
|
function onAddQueryGroup(_x, _x2, _x3) {
|
|
428
529
|
return _onAddQueryGroup.apply(this, arguments);
|
|
429
530
|
}
|
|
531
|
+
|
|
430
532
|
return onAddQueryGroup;
|
|
431
533
|
}()
|
|
432
534
|
}, {
|
|
@@ -435,19 +537,24 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
435
537
|
var _onDelQueryGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(configCode, searchData, dictionary) {
|
|
436
538
|
var onDelQueryGroup;
|
|
437
539
|
return _regeneratorRuntime.wrap(function _callee2$(_context11) {
|
|
438
|
-
while (1)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
540
|
+
while (1) {
|
|
541
|
+
switch (_context11.prev = _context11.next) {
|
|
542
|
+
case 0:
|
|
543
|
+
onDelQueryGroup = this.props.onDelQueryGroup;
|
|
544
|
+
onDelQueryGroup && onDelQueryGroup(configCode, searchData, dictionary);
|
|
545
|
+
|
|
546
|
+
case 2:
|
|
547
|
+
case "end":
|
|
548
|
+
return _context11.stop();
|
|
549
|
+
}
|
|
445
550
|
}
|
|
446
551
|
}, _callee2, this);
|
|
447
552
|
}));
|
|
553
|
+
|
|
448
554
|
function onDelQueryGroup(_x4, _x5, _x6) {
|
|
449
555
|
return _onDelQueryGroup.apply(this, arguments);
|
|
450
556
|
}
|
|
557
|
+
|
|
451
558
|
return onDelQueryGroup;
|
|
452
559
|
}()
|
|
453
560
|
}, {
|
|
@@ -468,8 +575,10 @@ var Search = /*#__PURE__*/function (_React$Component) {
|
|
|
468
575
|
}, this.toCols())), this.toButtons());
|
|
469
576
|
}
|
|
470
577
|
}]);
|
|
578
|
+
|
|
471
579
|
return Search;
|
|
472
580
|
}(React.Component);
|
|
581
|
+
|
|
473
582
|
_defineProperty(Search, "propTypes", {
|
|
474
583
|
config: PropTypes.shape(ConfigType).isRequired,
|
|
475
584
|
filters: PropTypes.arrayOf(PropTypes.shape(FilterType)).isRequired,
|
|
@@ -482,4 +591,5 @@ _defineProperty(Search, "propTypes", {
|
|
|
482
591
|
onHeightChange: PropTypes.func,
|
|
483
592
|
displayRow: PropTypes.number
|
|
484
593
|
});
|
|
594
|
+
|
|
485
595
|
export default Search;
|