@zgfe/business-lib 1.1.27 → 1.1.28
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/addToPanel/components/addPanel.js +8 -21
- package/es/addToPanel/components/radioGroup.js +1 -3
- package/es/addToPanel/components/styleList.js +5 -22
- package/es/addToPanel/demo/edit.js +5 -12
- package/es/addToPanel/demo/index.js +5 -12
- package/es/addToPanel/index.js +21 -58
- package/es/addToScene/addGroup.js +0 -4
- package/es/addToScene/demo/index.js +5 -12
- package/es/addToScene/index.js +13 -40
- package/es/assets/demo/index.js +0 -2
- package/es/assets/demo/input.js +5 -12
- package/es/assets/iconfont/iconfont.js +10 -17
- package/es/assets/theme.js +0 -1
- package/es/attrConditions/components/operateList.js +10 -27
- package/es/attrConditions/components/stringList.js +69 -98
- package/es/attrConditions/components/valuesList.js +14 -40
- package/es/attrConditions/demo/group.js +11 -23
- package/es/attrConditions/demo/index.js +17 -26
- package/es/attrConditions/group.js +17 -48
- package/es/attrConditions/index.js +22 -49
- package/es/attrConditions/types.js +0 -1
- package/es/attributeSelector/demo/disable.js +8 -16
- package/es/attributeSelector/demo/index.js +8 -17
- package/es/attributeSelector/index.js +22 -45
- package/es/attributeSelector/listPanel.js +18 -46
- package/es/attributeSelector/option.js +3 -13
- package/es/attributeSelector/types.js +0 -5
- package/es/attributeSelector/util.js +0 -3
- package/es/chart/demo/index.js +5 -14
- package/es/chart/index.js +30 -44
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +13 -37
- package/es/chart/util/data/china.js +1 -4
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +0 -5
- package/es/chart/util/formatOption.js +0 -13
- package/es/chart/util/mapUtil.js +5 -26
- package/es/config.js +0 -2
- package/es/cycleTime/demo/disable.js +0 -1
- package/es/cycleTime/index.js +19 -46
- package/es/cycleTime/month.js +8 -27
- package/es/datePicker/datePicker.js +5 -23
- package/es/datePicker/demo/customType.js +13 -22
- package/es/datePicker/demo/day.js +13 -22
- package/es/datePicker/demo/index.js +12 -21
- package/es/datePicker/index.js +18 -41
- package/es/datePicker/utils.js +0 -7
- package/es/demoWrapper/content.js +31 -56
- package/es/demoWrapper/head.js +9 -23
- package/es/demoWrapper/index.js +14 -30
- package/es/dialog/demo/index.js +5 -12
- package/es/dialog/index.js +4 -6
- package/es/dnd/demo/data.js +19 -28
- package/es/dnd/demo/handle.js +19 -28
- package/es/dnd/index.js +21 -45
- package/es/dnd/item.js +10 -30
- package/es/eventSelector/demo/index.js +12 -23
- package/es/eventSelector/index.js +14 -42
- package/es/eventSelector/listPanel.js +27 -61
- package/es/eventSelector/option.js +6 -11
- package/es/icon/iconFont.js +7 -13
- package/es/layout/analysisLayout/demo/index.js +0 -6
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +16 -34
- package/es/layout/detail/index.js +1 -3
- package/es/loginForm/index.js +7 -18
- package/es/searchInput/index.js +2 -7
- package/es/select/demo/children.js +8 -16
- package/es/select/demo/customLabel.js +0 -2
- package/es/select/demo/group.js +8 -17
- package/es/select/demo/index.js +11 -19
- package/es/select/demo/loading.js +8 -18
- package/es/select/demo/multiple.js +8 -16
- package/es/select/handle.js +14 -34
- package/es/select/index.js +22 -59
- package/es/select/option.js +10 -30
- package/es/select/overlay.js +25 -62
- package/es/table/demo/data/table.js +0 -2
- package/es/table/demo/index.js +13 -39
- package/es/table/demo/index2.js +5 -15
- package/es/table/demo/index3.js +7 -28
- package/es/table/index.js +14 -33
- package/es/targetConditionGroup/components/targetDimension.js +12 -38
- package/es/targetConditionGroup/demo/group.js +21 -36
- package/es/targetConditionGroup/demo/index.js +5 -13
- package/es/targetConditionGroup/index.js +31 -84
- package/es/targetSelector/demo/index.js +15 -28
- package/es/targetSelector/editBox.js +5 -20
- package/es/targetSelector/index.js +15 -36
- package/es/targetSelector/optionIcon.js +1 -5
- package/es/targetSelector/optionMenu.js +0 -3
- package/es/userCondition/conditionTypeList.js +7 -12
- package/es/userCondition/conditionWrap.js +0 -2
- package/es/userCondition/conditions/cdpCondition.js +51 -97
- package/es/userCondition/conditions/eventCondition.js +6 -16
- package/es/userCondition/conditions/periodCondition.js +8 -26
- package/es/userCondition/conditions/propCondition.js +29 -61
- package/es/userCondition/conditions/runTimesCondition.js +5 -10
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +15 -33
- package/es/userCondition/conditions/textDesc.js +16 -67
- package/es/userCondition/demo/index.js +11 -21
- package/es/userCondition/index.js +51 -91
- package/es/userCondition/orConditions.js +11 -48
- package/es/userCondition/relationLabel.js +1 -4
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +0 -1
- package/es/userCondition/util.js +4 -13
- package/es/userGroup/demo/group.js +14 -23
- package/es/userGroup/demo/index.js +5 -15
- package/es/userGroup/index.js +12 -30
- package/es/userTagsSelector/cascaderOverlay.js +19 -51
- package/es/userTagsSelector/components/search/index.js +0 -2
- package/es/userTagsSelector/demo/index.js +0 -3
- package/es/userTagsSelector/groups/groupOption.js +6 -8
- package/es/userTagsSelector/groups/index.js +15 -30
- package/es/userTagsSelector/index.js +17 -35
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
- package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
- package/es/userTagsSelector/util.js +0 -2
- package/es/utils/ajax.js +45 -71
- package/es/utils/base64.js +3 -22
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +4 -7
- package/es/utils/util.js +0 -16
- package/package.json +2 -2
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
4
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
|
|
11
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
|
|
13
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
18
|
-
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
|
|
21
11
|
import React, { useContext, useEffect, useState } from 'react';
|
|
22
12
|
import { BizUserConditionContext } from '.';
|
|
23
13
|
import './styles/orConditions.less';
|
|
@@ -33,28 +23,23 @@ import TagsCondition from './conditions/tagsCondition';
|
|
|
33
23
|
import { classPrefix } from '.';
|
|
34
24
|
import Text from './conditions/textDesc';
|
|
35
25
|
import CdpCondition from './conditions/cdpCondition';
|
|
36
|
-
|
|
37
26
|
var OrConditions = function OrConditions(props) {
|
|
38
27
|
var _useContext = useContext(BizUserConditionContext),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
orConditionNum = _useContext.orConditionNum,
|
|
29
|
+
textMode = _useContext.textMode,
|
|
30
|
+
openTagCondition = _useContext.openTagCondition,
|
|
31
|
+
openCdpCondition = _useContext.openCdpCondition;
|
|
44
32
|
var orConditions = props.orConditions,
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
showAndDesc = props.showAndDesc;
|
|
47
34
|
var _useState = useState([]),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
showList = _useState2[0],
|
|
37
|
+
setShowList = _useState2[1];
|
|
52
38
|
useEffect(function () {
|
|
53
39
|
if (orConditions) {
|
|
54
40
|
initShowList();
|
|
55
41
|
}
|
|
56
42
|
}, [orConditions]);
|
|
57
|
-
|
|
58
43
|
function initShowList() {
|
|
59
44
|
var showList = [];
|
|
60
45
|
orConditions.forEach(function (condition) {
|
|
@@ -66,7 +51,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
66
51
|
});
|
|
67
52
|
setShowList(showList);
|
|
68
53
|
}
|
|
69
|
-
|
|
70
54
|
function onAdd(type) {
|
|
71
55
|
var condition = buildCondition(type);
|
|
72
56
|
var newData = {
|
|
@@ -79,54 +63,45 @@ var OrConditions = function OrConditions(props) {
|
|
|
79
63
|
setShowList([].concat(_toConsumableArray(showList), [newData]));
|
|
80
64
|
props.onChange(newValue);
|
|
81
65
|
}
|
|
82
|
-
|
|
83
66
|
function onChangeRunPeriod(id, newData) {
|
|
84
67
|
var newValue = [];
|
|
85
68
|
showList.forEach(function (data) {
|
|
86
69
|
if (id === data.id) {
|
|
87
70
|
data.condition.runPeriod = newData;
|
|
88
71
|
}
|
|
89
|
-
|
|
90
72
|
newValue.push(data.condition);
|
|
91
73
|
});
|
|
92
74
|
setShowList(_toConsumableArray(showList));
|
|
93
75
|
props.onChange(newValue);
|
|
94
76
|
}
|
|
95
|
-
|
|
96
77
|
function onChangeAttrs(id, newAttrs) {
|
|
97
78
|
var newValue = [];
|
|
98
79
|
showList.forEach(function (data) {
|
|
99
80
|
if (id === data.id) {
|
|
100
81
|
data.condition.attrs = newAttrs;
|
|
101
82
|
}
|
|
102
|
-
|
|
103
83
|
newValue.push(data.condition);
|
|
104
84
|
});
|
|
105
85
|
setShowList(_toConsumableArray(showList));
|
|
106
86
|
props.onChange(newValue);
|
|
107
87
|
}
|
|
108
|
-
|
|
109
88
|
function onChangeEvent(id, newEvnet) {
|
|
110
89
|
var newValue = [];
|
|
111
90
|
showList.forEach(function (data) {
|
|
112
91
|
if (id === data.id) {
|
|
113
92
|
data.condition = newEvnet;
|
|
114
93
|
}
|
|
115
|
-
|
|
116
94
|
newValue.push(data.condition);
|
|
117
95
|
});
|
|
118
96
|
setShowList(_toConsumableArray(showList));
|
|
119
97
|
props.onChange(newValue);
|
|
120
98
|
}
|
|
121
|
-
|
|
122
99
|
function onChangeTags(id, newTags) {
|
|
123
100
|
changeData('tag', id, newTags);
|
|
124
101
|
}
|
|
125
|
-
|
|
126
102
|
function onChangeCdp(id, newCdp) {
|
|
127
103
|
changeData('cdp', id, newCdp);
|
|
128
104
|
}
|
|
129
|
-
|
|
130
105
|
function changeData(type, id, newData) {
|
|
131
106
|
var newValue = [];
|
|
132
107
|
showList.forEach(function (data) {
|
|
@@ -143,28 +118,23 @@ var OrConditions = function OrConditions(props) {
|
|
|
143
118
|
data.condition.dataset = newData;
|
|
144
119
|
}
|
|
145
120
|
}
|
|
146
|
-
|
|
147
121
|
newValue.push(data.condition);
|
|
148
122
|
});
|
|
149
123
|
setShowList(_toConsumableArray(showList));
|
|
150
124
|
props.onChange(newValue);
|
|
151
125
|
}
|
|
152
|
-
|
|
153
126
|
function onDelete(id) {
|
|
154
127
|
var index = showList.findIndex(function (item) {
|
|
155
128
|
return item.id === id;
|
|
156
129
|
});
|
|
157
130
|
showList.splice(index, 1);
|
|
158
|
-
|
|
159
131
|
var newList = _toConsumableArray(showList);
|
|
160
|
-
|
|
161
132
|
setShowList(newList);
|
|
162
133
|
var newValue = newList.map(function (item) {
|
|
163
134
|
return item.condition;
|
|
164
135
|
});
|
|
165
136
|
props.onChange(newValue);
|
|
166
137
|
}
|
|
167
|
-
|
|
168
138
|
if (textMode) {
|
|
169
139
|
return /*#__PURE__*/React.createElement(React.Fragment, null, textMode && showAndDesc ? /*#__PURE__*/React.createElement("span", {
|
|
170
140
|
className: "".concat(classPrefix, "-and-desc")
|
|
@@ -172,12 +142,10 @@ var OrConditions = function OrConditions(props) {
|
|
|
172
142
|
return renderCondition(item, i);
|
|
173
143
|
}), /*#__PURE__*/React.createElement("span", null, ")"));
|
|
174
144
|
}
|
|
175
|
-
|
|
176
145
|
function renderCondition(data, i) {
|
|
177
146
|
var condition = data.condition,
|
|
178
|
-
|
|
147
|
+
id = data.id;
|
|
179
148
|
var conditionDom = null;
|
|
180
|
-
|
|
181
149
|
if (textMode) {
|
|
182
150
|
return /*#__PURE__*/React.createElement(Text, {
|
|
183
151
|
showOrDesc: i > 0,
|
|
@@ -185,7 +153,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
185
153
|
condition: condition
|
|
186
154
|
});
|
|
187
155
|
}
|
|
188
|
-
|
|
189
156
|
if (condition.labels) {
|
|
190
157
|
if (!openTagCondition) return null;
|
|
191
158
|
conditionDom = /*#__PURE__*/React.createElement(TagsCondition, {
|
|
@@ -202,7 +169,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
202
169
|
});
|
|
203
170
|
} else {
|
|
204
171
|
var conditionData = condition;
|
|
205
|
-
|
|
206
172
|
if (conditionData.eventId === undefined) {
|
|
207
173
|
conditionDom = /*#__PURE__*/React.createElement(PropCondition, {
|
|
208
174
|
label: "\u5C5E\u6027",
|
|
@@ -233,7 +199,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
233
199
|
}));
|
|
234
200
|
}
|
|
235
201
|
}
|
|
236
|
-
|
|
237
202
|
return /*#__PURE__*/React.createElement(ConditionWrap, {
|
|
238
203
|
key: id,
|
|
239
204
|
onDelte: function onDelte() {
|
|
@@ -241,7 +206,6 @@ var OrConditions = function OrConditions(props) {
|
|
|
241
206
|
}
|
|
242
207
|
}, conditionDom);
|
|
243
208
|
}
|
|
244
|
-
|
|
245
209
|
return /*#__PURE__*/React.createElement("div", {
|
|
246
210
|
className: ["".concat(classPrefix, "-or"),, textMode ? 'text-mode' : ''].join(' ')
|
|
247
211
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -258,5 +222,4 @@ var OrConditions = function OrConditions(props) {
|
|
|
258
222
|
show: showList.length < orConditionNum
|
|
259
223
|
}));
|
|
260
224
|
};
|
|
261
|
-
|
|
262
225
|
export default OrConditions;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { BizUserConditionContext } from '.';
|
|
3
3
|
import './styles/relationLabel.less';
|
|
4
|
-
|
|
5
4
|
var RelationLabel = function RelationLabel(props) {
|
|
6
5
|
var _useContext = useContext(BizUserConditionContext),
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
textMode = _useContext.textMode;
|
|
9
7
|
if (textMode) return null;
|
|
10
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
9
|
className: "biz-user-condition-relation"
|
|
@@ -13,5 +11,4 @@ var RelationLabel = function RelationLabel(props) {
|
|
|
13
11
|
className: "biz-user-condition-relation-label"
|
|
14
12
|
}, props.children) : null);
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
export default RelationLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { UserProp } from '../attributeSelector/types';
|
|
3
|
-
export
|
|
3
|
+
export type Unpacked<T, U extends keyof T> = Required<T> extends {
|
|
4
4
|
[key in U]: infer R;
|
|
5
5
|
} ? R : never;
|
|
6
6
|
export interface RunPeriodI {
|
package/es/userCondition/util.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
export function buildCondition(type) {
|
|
8
8
|
switch (type) {
|
|
9
9
|
case 'add':
|
|
@@ -20,7 +20,6 @@ export function buildCondition(type) {
|
|
|
20
20
|
attrs: []
|
|
21
21
|
};
|
|
22
22
|
return condition;
|
|
23
|
-
|
|
24
23
|
case 'active':
|
|
25
24
|
return {
|
|
26
25
|
eventId: '-4',
|
|
@@ -34,7 +33,6 @@ export function buildCondition(type) {
|
|
|
34
33
|
},
|
|
35
34
|
attrs: []
|
|
36
35
|
};
|
|
37
|
-
|
|
38
36
|
case 'event':
|
|
39
37
|
return {
|
|
40
38
|
eventId: 0,
|
|
@@ -48,7 +46,6 @@ export function buildCondition(type) {
|
|
|
48
46
|
values: ['30', '0']
|
|
49
47
|
}
|
|
50
48
|
};
|
|
51
|
-
|
|
52
49
|
case 'prop':
|
|
53
50
|
return {
|
|
54
51
|
eventId: undefined,
|
|
@@ -56,7 +53,6 @@ export function buildCondition(type) {
|
|
|
56
53
|
attrId: 0
|
|
57
54
|
}]
|
|
58
55
|
};
|
|
59
|
-
|
|
60
56
|
case 'tag':
|
|
61
57
|
return {
|
|
62
58
|
attrs: [],
|
|
@@ -66,7 +62,6 @@ export function buildCondition(type) {
|
|
|
66
62
|
},
|
|
67
63
|
eventId: undefined
|
|
68
64
|
};
|
|
69
|
-
|
|
70
65
|
case 'cdp':
|
|
71
66
|
return {
|
|
72
67
|
dataset: [undefined]
|
|
@@ -95,19 +90,16 @@ export function transformNumberOperate(key) {
|
|
|
95
90
|
export function findEvent(eventId, eventGroupList) {
|
|
96
91
|
for (var i = 0; i < eventGroupList.length; i++) {
|
|
97
92
|
var eventList = eventGroupList[i].eventList;
|
|
98
|
-
|
|
99
93
|
for (var j = 0; j < eventList.length; j++) {
|
|
100
94
|
if (eventList[j].id === eventId) return eventList[j];
|
|
101
95
|
}
|
|
102
96
|
}
|
|
103
|
-
|
|
104
97
|
return null;
|
|
105
98
|
}
|
|
106
99
|
export function findPropAndEnv(name, list) {
|
|
107
100
|
for (var i = 0; i < list.length; i++) {
|
|
108
101
|
if (list[i].name === name) return list[i];
|
|
109
102
|
}
|
|
110
|
-
|
|
111
103
|
return null;
|
|
112
104
|
}
|
|
113
105
|
export function buildSelectLayer(data) {
|
|
@@ -137,7 +129,6 @@ export function buildTagsGroup(list) {
|
|
|
137
129
|
list.forEach(function (label) {
|
|
138
130
|
if (!label.sequence) return;
|
|
139
131
|
var index = label.sequence - 1;
|
|
140
|
-
|
|
141
132
|
if (options[index]) {
|
|
142
133
|
options[index].children.push(label);
|
|
143
134
|
} else {
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
13
|
import React, { useState } from 'react';
|
|
20
14
|
import { BizUserGroup, IconFont } from '@zgfe/business-lib';
|
|
21
15
|
import { Form } from 'antd';
|
|
@@ -44,20 +38,17 @@ var initValue = {
|
|
|
44
38
|
};
|
|
45
39
|
export default (function () {
|
|
46
40
|
var _useState = useState({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
user: [initValue]
|
|
42
|
+
}),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
target = _useState2[0],
|
|
45
|
+
setTarget = _useState2[1];
|
|
53
46
|
var _Form$useForm = Form.useForm(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
48
|
+
form = _Form$useForm2[0];
|
|
57
49
|
var onValuesChange = function onValuesChange() {
|
|
58
50
|
setTarget(arguments.length <= 1 ? undefined : arguments[1]);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
52
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
62
53
|
initialValues: target,
|
|
63
54
|
form: form,
|
|
@@ -68,7 +59,7 @@ export default (function () {
|
|
|
68
59
|
name: "user"
|
|
69
60
|
}, function (fields, _ref) {
|
|
70
61
|
var add = _ref.add,
|
|
71
|
-
|
|
62
|
+
remove = _ref.remove;
|
|
72
63
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
|
|
73
64
|
return /*#__PURE__*/React.createElement(Form.Item, _objectSpread(_objectSpread({}, field), {}, {
|
|
74
65
|
key: field.key
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useState } from 'react';
|
|
14
8
|
import { BizUserGroup } from '@zgfe/business-lib';
|
|
15
9
|
var groupOptions = [{
|
|
@@ -31,18 +25,15 @@ var groupOptions = [{
|
|
|
31
25
|
id: 6,
|
|
32
26
|
name: '用户群6'
|
|
33
27
|
}];
|
|
34
|
-
|
|
35
28
|
var UserGroupDemo = function UserGroupDemo() {
|
|
36
29
|
var _useState = useState(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
group = _useState2[0],
|
|
32
|
+
setGroup = _useState2[1];
|
|
41
33
|
var handleChange = function handleChange(value) {
|
|
42
34
|
console.log('change', value);
|
|
43
35
|
setGroup(value);
|
|
44
36
|
};
|
|
45
|
-
|
|
46
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
38
|
className: "biz-user-group-demo",
|
|
48
39
|
style: {
|
|
@@ -55,7 +46,6 @@ var UserGroupDemo = function UserGroupDemo() {
|
|
|
55
46
|
enableDelete: true
|
|
56
47
|
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", JSON.stringify(group)));
|
|
57
48
|
};
|
|
58
|
-
|
|
59
49
|
export default (function () {
|
|
60
50
|
return /*#__PURE__*/React.createElement(UserGroupDemo, null);
|
|
61
51
|
});
|
package/es/userGroup/index.js
CHANGED
|
@@ -1,62 +1,45 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useContext, useEffect, useState } from 'react';
|
|
14
8
|
import './styles/index.less';
|
|
15
9
|
import BizSelect from '../select';
|
|
16
10
|
import BizTargetOptionIcon from '../targetSelector/optionIcon';
|
|
17
11
|
import { Skeleton } from 'antd';
|
|
18
12
|
import BizGlobalDataContext from '../context';
|
|
19
|
-
|
|
20
13
|
var BizUserGroup = function BizUserGroup(props) {
|
|
21
14
|
var enableDelete = props.enableDelete,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
keyField = props.keyField,
|
|
16
|
+
labelField = props.labelField;
|
|
25
17
|
var _useState = useState(),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
current = _useState2[0],
|
|
20
|
+
setCurrent = _useState2[1];
|
|
30
21
|
var _useState3 = useState(true),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
loading = _useState4[0],
|
|
24
|
+
setLoading = _useState4[1];
|
|
35
25
|
var classPrefix = 'biz-user';
|
|
36
|
-
|
|
37
26
|
var _useContext = useContext(BizGlobalDataContext),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
_useContext$userGroup = _useContext.userGroupList,
|
|
28
|
+
userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
|
|
41
29
|
useEffect(function () {
|
|
42
30
|
var value = props.defaultValue || props.value;
|
|
43
|
-
|
|
44
31
|
if (value) {
|
|
45
32
|
setCurrent(value);
|
|
46
33
|
}
|
|
47
|
-
|
|
48
34
|
setLoading(false);
|
|
49
35
|
}, []);
|
|
50
|
-
|
|
51
36
|
var onClickDelete = function onClickDelete() {
|
|
52
37
|
if (props.onDelete) props.onDelete(current);
|
|
53
38
|
};
|
|
54
|
-
|
|
55
39
|
var onChange = function onChange(value) {
|
|
56
40
|
setCurrent(value);
|
|
57
41
|
if (props.onChange) props.onChange(value);
|
|
58
42
|
};
|
|
59
|
-
|
|
60
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
61
44
|
className: classPrefix
|
|
62
45
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -83,7 +66,6 @@ var BizUserGroup = function BizUserGroup(props) {
|
|
|
83
66
|
onClick: onClickDelete
|
|
84
67
|
})));
|
|
85
68
|
};
|
|
86
|
-
|
|
87
69
|
BizUserGroup.defaultProps = {
|
|
88
70
|
keyField: 'id',
|
|
89
71
|
labelField: 'name'
|