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