@zgfe/business-lib 1.1.22 → 1.1.24
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.d.ts +3 -1
- 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/styles/resetAntd.less +5 -0
- package/es/assets/theme.js +0 -1
- package/es/attrConditions/components/operateList.js +10 -27
- package/es/attrConditions/components/stringList.js +68 -97
- 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 +26 -60
- 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 -58
- package/es/select/option.js +10 -26
- package/es/select/overlay.js +25 -55
- 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 -37
- package/es/targetConditionGroup/demo/group.js +21 -36
- package/es/targetConditionGroup/demo/index.js +5 -13
- package/es/targetConditionGroup/index.js +31 -82
- 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.d.ts +1 -1
- 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 +2 -2
- 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 +1 -17
- package/package.json +12 -15
|
@@ -1,67 +1,49 @@
|
|
|
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, { useEffect, useImperativeHandle, useState } from 'react';
|
|
22
12
|
import BizConditionItem from './index';
|
|
23
13
|
import './styles/group.less';
|
|
24
14
|
import _ from 'lodash';
|
|
25
15
|
import { Skeleton } from 'antd';
|
|
26
|
-
|
|
27
16
|
var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
28
17
|
var eventIdList = props.eventIdList,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
enableDelete = props.enableDelete,
|
|
19
|
+
enableEventProp = props.enableEventProp,
|
|
20
|
+
enableUserProp = props.enableUserProp,
|
|
21
|
+
enableEnvProp = props.enableEnvProp,
|
|
22
|
+
disableItemList = props.disableItemList,
|
|
23
|
+
onConditionsCount = props.onConditionsCount;
|
|
36
24
|
var _useState = useState('and'),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
relation = _useState2[0],
|
|
27
|
+
setRelation = _useState2[1];
|
|
41
28
|
var _useState3 = useState([]),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
conditions = _useState4[0],
|
|
31
|
+
setConditions = _useState4[1];
|
|
46
32
|
var _useState5 = useState(true),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
|
+
ready = _useState6[0],
|
|
35
|
+
setReady = _useState6[1];
|
|
51
36
|
var classPrefix = 'biz-condition';
|
|
52
37
|
useEffect(function () {
|
|
53
38
|
var data = props.defaultValue || props.value;
|
|
54
|
-
|
|
55
39
|
if (data) {
|
|
56
40
|
if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
|
|
57
|
-
|
|
58
41
|
if (data.conditions) {
|
|
59
42
|
setConditions(function () {
|
|
60
43
|
return addKeyToGroup(data.conditions);
|
|
61
44
|
});
|
|
62
45
|
}
|
|
63
46
|
}
|
|
64
|
-
|
|
65
47
|
setReady(false);
|
|
66
48
|
}, []);
|
|
67
49
|
useImperativeHandle(ref, function () {
|
|
@@ -78,7 +60,6 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
78
60
|
setValue: function setValue(data) {
|
|
79
61
|
if (data) {
|
|
80
62
|
if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
|
|
81
|
-
|
|
82
63
|
if (data.conditions) {
|
|
83
64
|
setConditions(function () {
|
|
84
65
|
return addKeyToGroup(data.conditions);
|
|
@@ -91,7 +72,6 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
91
72
|
}
|
|
92
73
|
};
|
|
93
74
|
});
|
|
94
|
-
|
|
95
75
|
var addKeyToGroup = function addKeyToGroup(data) {
|
|
96
76
|
return data.map(function (item) {
|
|
97
77
|
return {
|
|
@@ -100,7 +80,6 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
100
80
|
};
|
|
101
81
|
});
|
|
102
82
|
};
|
|
103
|
-
|
|
104
83
|
var removeKeyToGroup = function removeKeyToGroup(data) {
|
|
105
84
|
var group = [];
|
|
106
85
|
data.forEach(function (item) {
|
|
@@ -108,12 +87,10 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
108
87
|
});
|
|
109
88
|
return group;
|
|
110
89
|
};
|
|
111
|
-
|
|
112
90
|
var onClickRelation = function onClickRelation(e) {
|
|
113
91
|
e.stopPropagation();
|
|
114
92
|
var data = e.target.innerText === '且' ? 'and' : 'or';
|
|
115
93
|
setRelation(data);
|
|
116
|
-
|
|
117
94
|
if (props.onChange) {
|
|
118
95
|
var group = removeKeyToGroup(conditions);
|
|
119
96
|
props.onChange({
|
|
@@ -122,14 +99,11 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
122
99
|
});
|
|
123
100
|
}
|
|
124
101
|
};
|
|
125
|
-
|
|
126
102
|
var _onChange = function onChange(data, index) {
|
|
127
103
|
var conditionArr = _.cloneDeep(conditions);
|
|
128
|
-
|
|
129
104
|
conditionArr[index].data = data;
|
|
130
105
|
setConditions(conditionArr);
|
|
131
106
|
onConditionsCount && onConditionsCount(conditionArr.length);
|
|
132
|
-
|
|
133
107
|
if (props.onChange) {
|
|
134
108
|
var group = removeKeyToGroup(conditionArr);
|
|
135
109
|
props.onChange({
|
|
@@ -138,14 +112,11 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
138
112
|
});
|
|
139
113
|
}
|
|
140
114
|
};
|
|
141
|
-
|
|
142
115
|
var _onDelete = function onDelete(index) {
|
|
143
116
|
var conditionArr = _.cloneDeep(conditions);
|
|
144
|
-
|
|
145
117
|
conditionArr.splice(index, 1);
|
|
146
118
|
setConditions(conditionArr);
|
|
147
119
|
onConditionsCount && onConditionsCount(conditionArr.length);
|
|
148
|
-
|
|
149
120
|
if (props.onChange) {
|
|
150
121
|
var group = removeKeyToGroup(conditionArr);
|
|
151
122
|
props.onChange({
|
|
@@ -154,7 +125,6 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
154
125
|
});
|
|
155
126
|
}
|
|
156
127
|
};
|
|
157
|
-
|
|
158
128
|
return /*#__PURE__*/React.createElement("div", {
|
|
159
129
|
className: classPrefix
|
|
160
130
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -193,5 +163,4 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
|
|
|
193
163
|
});
|
|
194
164
|
}))));
|
|
195
165
|
};
|
|
196
|
-
|
|
197
166
|
export default /*#__PURE__*/React.forwardRef(BizConditionGroup);
|
|
@@ -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, { useEffect, useState } from 'react';
|
|
14
8
|
import BizAttributeSelector from '../attributeSelector';
|
|
15
9
|
import { PropCategory } from '../attributeSelector/types';
|
|
@@ -18,46 +12,37 @@ import BizOperateList from './components/operateList';
|
|
|
18
12
|
import ValuesList from './components/valuesList';
|
|
19
13
|
import { Skeleton } from 'antd';
|
|
20
14
|
export var classPrefix = 'biz-condition-item';
|
|
21
|
-
|
|
22
15
|
var BizConditionItem = function BizConditionItem(props) {
|
|
23
16
|
var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
|
|
24
|
-
|
|
25
17
|
var defaultValue = props.defaultValue,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
eventIdList = props.eventIdList,
|
|
19
|
+
enableDelete = props.enableDelete,
|
|
20
|
+
enableEventProp = props.enableEventProp,
|
|
21
|
+
enableUserProp = props.enableUserProp,
|
|
22
|
+
enableEnvProp = props.enableEnvProp,
|
|
23
|
+
disableItemList = props.disableItemList,
|
|
24
|
+
border = props.border,
|
|
25
|
+
theme = props.theme;
|
|
35
26
|
var _useState = useState(),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
attr = _useState2[0],
|
|
29
|
+
setAttr = _useState2[1];
|
|
40
30
|
var _useState3 = useState(((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.operator) || ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.operator)),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
+
operate = _useState4[0],
|
|
33
|
+
setOperate = _useState4[1];
|
|
45
34
|
var _useState5 = useState(((_props$defaultValue2 = props.defaultValue) === null || _props$defaultValue2 === void 0 ? void 0 : _props$defaultValue2.values) || ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.values)),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
36
|
+
values = _useState6[0],
|
|
37
|
+
setValues = _useState6[1];
|
|
50
38
|
var _useState7 = useState(true),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
40
|
+
ready = _useState8[0],
|
|
41
|
+
setReady = _useState8[1];
|
|
55
42
|
useEffect(function () {
|
|
56
43
|
var data = defaultValue || props.value;
|
|
57
|
-
|
|
58
44
|
if (data) {
|
|
59
45
|
var attrData;
|
|
60
|
-
|
|
61
46
|
if (data.propCategory === PropCategory.EventProp) {
|
|
62
47
|
if (data.attrId) {
|
|
63
48
|
attrData = {
|
|
@@ -83,17 +68,13 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
83
68
|
};
|
|
84
69
|
}
|
|
85
70
|
}
|
|
86
|
-
|
|
87
71
|
setAttr(attrData);
|
|
88
72
|
}
|
|
89
|
-
|
|
90
73
|
setReady(false);
|
|
91
74
|
}, []);
|
|
92
|
-
|
|
93
75
|
var onDelete = function onDelete() {
|
|
94
76
|
if (props.onDelete) props.onDelete();
|
|
95
77
|
};
|
|
96
|
-
|
|
97
78
|
useEffect(function () {
|
|
98
79
|
if (props.onChange) {
|
|
99
80
|
if (!attr) return;
|
|
@@ -106,34 +87,27 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
106
87
|
dimensionSub: attr.dimensionSub,
|
|
107
88
|
label: attr.label
|
|
108
89
|
};
|
|
109
|
-
|
|
110
90
|
if (attr.propCategory === PropCategory.EventProp) {
|
|
111
91
|
responseData.attrName = attr.label;
|
|
112
92
|
} else {
|
|
113
93
|
responseData.attrName = attr.name;
|
|
114
94
|
responseData.category = attr.category;
|
|
115
|
-
|
|
116
95
|
if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
|
|
117
96
|
responseData.subtype = attr.subtype;
|
|
118
97
|
}
|
|
119
98
|
}
|
|
120
|
-
|
|
121
99
|
props.onChange(responseData);
|
|
122
100
|
}
|
|
123
101
|
}, [attr, operate, values]);
|
|
124
|
-
|
|
125
102
|
var onChangeAttr = function onChangeAttr(attrData) {
|
|
126
103
|
setAttr(attrData);
|
|
127
104
|
};
|
|
128
|
-
|
|
129
105
|
var onChangeOperate = function onChangeOperate(data) {
|
|
130
106
|
setOperate(data);
|
|
131
107
|
};
|
|
132
|
-
|
|
133
108
|
var onChangeValues = function onChangeValues(data) {
|
|
134
109
|
setValues(data);
|
|
135
110
|
};
|
|
136
|
-
|
|
137
111
|
return /*#__PURE__*/React.createElement("div", {
|
|
138
112
|
className: [classPrefix, border ? 'border' : ''].join(' ')
|
|
139
113
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -169,7 +143,6 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
169
143
|
theme: theme
|
|
170
144
|
}))));
|
|
171
145
|
};
|
|
172
|
-
|
|
173
146
|
BizConditionItem.defaultProps = {
|
|
174
147
|
border: true,
|
|
175
148
|
theme: 'secondary'
|
|
@@ -1,31 +1,23 @@
|
|
|
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 { BizAttributeSelector, DemoWrapper } from '@zgfe/business-lib';
|
|
15
9
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
16
10
|
export default (function () {
|
|
17
11
|
var _useState = useState({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
id: 30183426,
|
|
13
|
+
propCategory: 'eventProp'
|
|
14
|
+
}),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
attribute = _useState2[0],
|
|
17
|
+
setAttribute = _useState2[1];
|
|
25
18
|
function onChange(val) {
|
|
26
19
|
setAttribute(val);
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
30
22
|
needMeta: true
|
|
31
23
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
@@ -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 { BizAttributeSelector, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
15
9
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
@@ -19,23 +13,20 @@ import userData from './userData.js';
|
|
|
19
13
|
import convertAttributeData from '../util';
|
|
20
14
|
export default (function () {
|
|
21
15
|
var _useState = useState({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
id: 30183426,
|
|
17
|
+
propCategory: 'eventProp'
|
|
18
|
+
}),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
attribute = _useState2[0],
|
|
21
|
+
setAttribute = _useState2[1];
|
|
29
22
|
var store = convertAttributeData({
|
|
30
23
|
eventList: eventData,
|
|
31
24
|
userPropList: userData,
|
|
32
25
|
envPropList: envData
|
|
33
26
|
});
|
|
34
|
-
|
|
35
27
|
function onChange(val) {
|
|
36
28
|
setAttribute(val);
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
40
31
|
value: {
|
|
41
32
|
eventGroupList: store.eventGroupList,
|
|
@@ -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, { useContext, useEffect, useRef, useState } from 'react';
|
|
20
14
|
import './styles/index.less';
|
|
21
15
|
import { Dropdown, Tooltip } from 'antd';
|
|
@@ -23,40 +17,31 @@ import AttrListPanel from './listPanel';
|
|
|
23
17
|
import IconFont from '../icon/iconFont';
|
|
24
18
|
import { BizGlobalDataContext } from '..';
|
|
25
19
|
import SelectHandle from '../select/handle';
|
|
26
|
-
|
|
27
20
|
var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
28
21
|
var enableDelete = props.enableDelete,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
placeholder = props.placeholder,
|
|
23
|
+
theme = props.theme;
|
|
32
24
|
var _useState = useState(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
currentAttr = _useState2[0],
|
|
27
|
+
setCurrentAttr = _useState2[1];
|
|
37
28
|
var _useState3 = useState(false),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
visible = _useState4[0],
|
|
31
|
+
setVisible = _useState4[1];
|
|
42
32
|
var classPrefix = 'biz-attr-select';
|
|
43
|
-
|
|
44
33
|
var _useState5 = useState(String(Math.random())),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
35
|
+
id = _useState6[0];
|
|
48
36
|
var _useContext = useContext(BizGlobalDataContext),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
eventGroupList = _useContext.eventGroupList,
|
|
38
|
+
userPropList = _useContext.userPropList,
|
|
39
|
+
eventEnvList = _useContext.eventEnvList;
|
|
53
40
|
var boxRef = useRef(null);
|
|
54
|
-
|
|
55
41
|
var _useState7 = useState(200),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
43
|
+
width = _useState8[0],
|
|
44
|
+
setWidth = _useState8[1];
|
|
60
45
|
useEffect(function () {
|
|
61
46
|
setWidth(boxRef.current.width || 284);
|
|
62
47
|
if (!props.defaultValue) return;
|
|
@@ -65,10 +50,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
65
50
|
useEffect(function () {
|
|
66
51
|
setCurrentAttr(getValue(props.value));
|
|
67
52
|
}, [props.value]);
|
|
68
|
-
|
|
69
53
|
function getValue(param) {
|
|
70
54
|
var res = undefined;
|
|
71
|
-
|
|
72
55
|
if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
|
|
73
56
|
eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
|
|
74
57
|
if (attr.name === param.name) res = attr;
|
|
@@ -86,24 +69,19 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
86
69
|
if (attr.name === param.name && attr.category === param.category) res = attr;
|
|
87
70
|
});
|
|
88
71
|
}
|
|
89
|
-
|
|
90
72
|
return res;
|
|
91
73
|
}
|
|
92
|
-
|
|
93
74
|
function onDelete() {
|
|
94
75
|
if (props.onDelete) props.onDelete(currentAttr);
|
|
95
76
|
}
|
|
96
|
-
|
|
97
77
|
function onChange(val) {
|
|
98
78
|
setVisible(false);
|
|
99
79
|
setCurrentAttr(val);
|
|
100
80
|
if (props.onChange) props.onChange(val);
|
|
101
81
|
}
|
|
102
|
-
|
|
103
82
|
var onVisibleChange = function onVisibleChange(flag) {
|
|
104
83
|
setVisible(flag);
|
|
105
84
|
};
|
|
106
|
-
|
|
107
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
108
86
|
className: classPrefix
|
|
109
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -144,7 +122,6 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
|
|
|
144
122
|
onClick: onDelete
|
|
145
123
|
}))));
|
|
146
124
|
};
|
|
147
|
-
|
|
148
125
|
BizAttributeSelector.defaultProps = {
|
|
149
126
|
enableDelete: false,
|
|
150
127
|
placeholder: '请选择',
|