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