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