@zgfe/business-lib 1.1.29-visual.9 → 1.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/addToPanel/components/addPanel.js +21 -8
- package/es/addToPanel/components/radioGroup.js +3 -1
- package/es/addToPanel/components/styleList.js +22 -5
- package/es/addToPanel/demo/edit.js +12 -5
- package/es/addToPanel/demo/index.js +12 -5
- package/es/addToPanel/index.js +58 -21
- package/es/addToScene/addGroup.js +4 -0
- package/es/addToScene/demo/index.js +12 -5
- package/es/addToScene/index.js +40 -13
- package/es/assets/demo/index.js +2 -0
- package/es/assets/demo/input.js +12 -5
- package/es/assets/iconfont/iconfont.js +17 -10
- package/es/assets/theme.js +1 -0
- package/es/attrConditions/components/operateList.js +27 -10
- package/es/attrConditions/components/stringList.js +97 -68
- package/es/attrConditions/components/valuesList.js +40 -14
- package/es/attrConditions/demo/group.js +23 -11
- package/es/attrConditions/demo/index.js +26 -17
- package/es/attrConditions/group.js +48 -17
- package/es/attrConditions/index.js +49 -22
- package/es/attrConditions/types.js +1 -0
- package/es/attributeSelector/demo/disable.js +16 -8
- package/es/attributeSelector/demo/index.js +17 -8
- package/es/attributeSelector/index.js +45 -22
- package/es/attributeSelector/listPanel.js +46 -18
- package/es/attributeSelector/option.js +13 -3
- package/es/attributeSelector/types.js +5 -0
- package/es/attributeSelector/util.js +3 -0
- package/es/chart/demo/index.js +14 -5
- package/es/chart/index.js +44 -30
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +37 -13
- package/es/chart/util/data/china.js +4 -1
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +5 -0
- package/es/chart/util/formatOption.js +13 -0
- package/es/chart/util/mapUtil.js +26 -5
- package/es/config.js +2 -0
- package/es/constants/apis.d.ts +0 -1
- package/es/constants/apis.js +1 -2
- package/es/cycleTime/demo/disable.js +1 -0
- package/es/cycleTime/index.js +46 -19
- package/es/cycleTime/month.js +27 -8
- package/es/datePicker/datePicker.js +23 -5
- package/es/datePicker/demo/customType.js +22 -13
- package/es/datePicker/demo/day.js +22 -13
- package/es/datePicker/demo/index.js +21 -12
- package/es/datePicker/index.js +41 -18
- package/es/datePicker/utils.js +7 -0
- package/es/demoWrapper/content.d.ts +1 -2
- package/es/demoWrapper/content.js +64 -42
- package/es/demoWrapper/demo/index.js +4 -5
- package/es/demoWrapper/head.d.ts +1 -3
- package/es/demoWrapper/head.js +27 -25
- package/es/demoWrapper/index.js +36 -28
- package/es/dialog/demo/index.js +12 -5
- package/es/dialog/index.js +6 -4
- package/es/dnd/demo/data.js +28 -19
- package/es/dnd/demo/handle.js +28 -19
- package/es/dnd/index.js +45 -21
- package/es/dnd/item.js +30 -10
- package/es/eventSelector/demo/index.js +23 -12
- package/es/eventSelector/index.js +42 -14
- package/es/eventSelector/listPanel.js +73 -31
- package/es/eventSelector/option.js +11 -6
- package/es/icon/iconFont.js +13 -7
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/layout/analysisLayout/demo/index.js +6 -0
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +34 -16
- package/es/layout/detail/index.js +3 -1
- package/es/loginForm/index.js +18 -7
- package/es/searchInput/index.js +7 -2
- package/es/select/demo/children.js +16 -8
- package/es/select/demo/customLabel.js +2 -0
- package/es/select/demo/group.js +17 -8
- package/es/select/demo/index.js +19 -11
- package/es/select/demo/loading.js +18 -8
- package/es/select/demo/multiple.js +16 -8
- package/es/select/handle.js +34 -14
- package/es/select/index.js +59 -22
- package/es/select/option.js +30 -10
- package/es/select/overlay.js +62 -25
- package/es/table/demo/data/table.js +2 -0
- package/es/table/demo/index.js +39 -13
- package/es/table/demo/index2.js +15 -5
- package/es/table/demo/index3.js +28 -7
- package/es/table/index.js +33 -14
- package/es/targetConditionGroup/components/targetDimension.js +38 -12
- package/es/targetConditionGroup/demo/group.js +36 -21
- package/es/targetConditionGroup/demo/index.js +13 -5
- package/es/targetConditionGroup/index.js +84 -31
- package/es/targetSelector/demo/index.js +28 -15
- package/es/targetSelector/editBox.js +20 -5
- package/es/targetSelector/index.js +36 -15
- package/es/targetSelector/optionIcon.js +5 -1
- package/es/targetSelector/optionMenu.js +3 -0
- package/es/userCondition/conditionTypeList.js +12 -7
- package/es/userCondition/conditionWrap.js +2 -0
- package/es/userCondition/conditions/cdpCondition.js +97 -51
- package/es/userCondition/conditions/eventCondition.js +16 -6
- package/es/userCondition/conditions/periodCondition.js +26 -8
- package/es/userCondition/conditions/propCondition.js +61 -29
- package/es/userCondition/conditions/runTimesCondition.js +10 -5
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +33 -15
- package/es/userCondition/conditions/textDesc.js +67 -16
- package/es/userCondition/demo/index.js +21 -11
- package/es/userCondition/index.js +91 -51
- package/es/userCondition/orConditions.js +48 -11
- package/es/userCondition/relationLabel.js +4 -1
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.js +13 -4
- package/es/userGroup/demo/group.js +23 -14
- package/es/userGroup/demo/index.js +15 -5
- package/es/userGroup/index.js +30 -12
- package/es/userTagsSelector/cascaderOverlay.js +51 -19
- package/es/userTagsSelector/components/search/index.js +2 -0
- package/es/userTagsSelector/demo/index.js +3 -0
- package/es/userTagsSelector/groups/groupOption.js +8 -6
- package/es/userTagsSelector/groups/index.js +30 -15
- package/es/userTagsSelector/index.js +35 -17
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
- package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
- package/es/userTagsSelector/util.js +2 -0
- package/es/utils/ajax.js +71 -45
- package/es/utils/base64.js +22 -3
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +7 -4
- package/es/utils/util.js +16 -0
- package/package.json +2 -2
- package/es/socket/demo/demo.d.ts +0 -2
- package/es/socket/demo/demo.js +0 -139
- package/es/socket/demo/index.less +0 -27
- package/es/socket/index.d.ts +0 -31
- package/es/socket/index.js +0 -278
- package/es/socket/types.d.ts +0 -37
- package/es/socket/types.js +0 -26
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import { BizTargetCondition, BizEventSelector, BizGlobalDataContext, convertAttributeData } from '@zgfe/business-lib';
|
|
9
15
|
import eventData from '../../mock/event';
|
|
@@ -33,12 +39,14 @@ var store = convertAttributeData({
|
|
|
33
39
|
});
|
|
34
40
|
export default (function () {
|
|
35
41
|
var _useState = useState(defaultValue),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
target = _useState2[0],
|
|
44
|
+
setTarget = _useState2[1];
|
|
45
|
+
|
|
39
46
|
var onChange = function onChange(value) {
|
|
40
47
|
setTarget(value);
|
|
41
48
|
};
|
|
49
|
+
|
|
42
50
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
43
51
|
value: {
|
|
44
52
|
eventGroupList: store.eventGroupList,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
14
|
import BizTargetSelector from '../targetSelector';
|
|
9
15
|
import BizTargetDimension from './components/targetDimension';
|
|
@@ -13,83 +19,107 @@ import { Skeleton } from 'antd';
|
|
|
13
19
|
import _ from 'lodash';
|
|
14
20
|
import BizGlobalDataContext from '../context';
|
|
15
21
|
export var classPrefix = 'biz-target';
|
|
22
|
+
|
|
16
23
|
var BizTargetCondition = function BizTargetCondition(props) {
|
|
17
24
|
var _targetData$value2, _targetData$value2$ev, _targetData$value3, _targetData$value3$ev, _targetData$value4, _targetData$value4$ev, _targetData$value5, _targetData$value5$ev;
|
|
25
|
+
|
|
18
26
|
var max = props.max;
|
|
27
|
+
|
|
19
28
|
var _useState = useState(),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
targetData = _useState2[0],
|
|
31
|
+
setTargetData = _useState2[1];
|
|
32
|
+
|
|
23
33
|
var _useContext = useContext(BizGlobalDataContext),
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
_useContext$eventGrou = _useContext.eventGroupList,
|
|
35
|
+
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou;
|
|
36
|
+
|
|
26
37
|
var _useState3 = useState({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
analysisIndex: 'number'
|
|
39
|
+
}),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
dimension = _useState4[0],
|
|
42
|
+
setDimension = _useState4[1];
|
|
43
|
+
|
|
32
44
|
var _useState5 = useState(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
+
filters = _useState6[0],
|
|
47
|
+
setFilters = _useState6[1];
|
|
48
|
+
|
|
36
49
|
var _useState7 = useState(true),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
51
|
+
enableAdd = _useState8[0],
|
|
52
|
+
setEnableAdd = _useState8[1];
|
|
53
|
+
|
|
40
54
|
var _useState9 = useState(true),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
|
+
enableDelete = _useState10[0],
|
|
57
|
+
setEnableDelete = _useState10[1];
|
|
58
|
+
|
|
44
59
|
var _useState11 = useState(0),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
61
|
+
count = _useState12[0],
|
|
62
|
+
setCount = _useState12[1];
|
|
63
|
+
|
|
48
64
|
var _useState13 = useState(true),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
66
|
+
isAdd = _useState14[0],
|
|
67
|
+
setIsAdd = _useState14[1];
|
|
68
|
+
|
|
52
69
|
var conditionRef = useRef(null);
|
|
70
|
+
|
|
53
71
|
var _useState15 = useState(true),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
73
|
+
loading = _useState16[0],
|
|
74
|
+
setLoading = _useState16[1];
|
|
75
|
+
|
|
57
76
|
useEffect(function () {
|
|
58
77
|
var value = props.defaultValue || props.value;
|
|
78
|
+
|
|
59
79
|
if (value) {
|
|
60
80
|
var _value$filters;
|
|
81
|
+
|
|
61
82
|
setTargetData(formateTargetValue(value));
|
|
62
83
|
setDimension(value.analysisDimension);
|
|
63
84
|
setFilters(value.filters);
|
|
85
|
+
|
|
64
86
|
if ((_value$filters = value.filters) === null || _value$filters === void 0 ? void 0 : _value$filters.conditions) {
|
|
65
87
|
setCount(value.filters.conditions.length);
|
|
66
88
|
}
|
|
67
89
|
}
|
|
90
|
+
|
|
68
91
|
setLoading(false);
|
|
69
92
|
}, []);
|
|
70
93
|
useEffect(function () {
|
|
71
94
|
if (targetData === null || targetData === void 0 ? void 0 : targetData.value) {
|
|
72
95
|
var _targetData$value$eve;
|
|
96
|
+
|
|
73
97
|
var canAdd = true,
|
|
74
|
-
|
|
98
|
+
canDelete = true;
|
|
99
|
+
|
|
75
100
|
if (((_targetData$value$eve = targetData.value.event) === null || _targetData$value$eve === void 0 ? void 0 : _targetData$value$eve.id) === -100) {
|
|
76
101
|
var _targetData$value$gro;
|
|
102
|
+
|
|
77
103
|
canAdd = false;
|
|
78
104
|
setFilters(undefined);
|
|
105
|
+
|
|
79
106
|
if (!((_targetData$value$gro = targetData.value.group) === null || _targetData$value$gro === void 0 ? void 0 : _targetData$value$gro.id)) {
|
|
80
107
|
canDelete = false;
|
|
81
108
|
}
|
|
82
109
|
} else {
|
|
83
110
|
canAdd = count < max;
|
|
84
111
|
}
|
|
112
|
+
|
|
85
113
|
setEnableAdd(canAdd);
|
|
86
114
|
setEnableDelete(canDelete);
|
|
87
115
|
} else {
|
|
88
116
|
setEnableAdd(false);
|
|
89
117
|
}
|
|
90
118
|
}, [targetData === null || targetData === void 0 ? void 0 : targetData.value, count]);
|
|
119
|
+
|
|
91
120
|
var formateTargetValue = function formateTargetValue(data) {
|
|
92
121
|
var target = {};
|
|
122
|
+
|
|
93
123
|
if (data.alias) {
|
|
94
124
|
if (data.eventName && data.eventName === data.alias) {
|
|
95
125
|
target.alias = '';
|
|
@@ -97,11 +127,13 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
97
127
|
target.alias = data.alias;
|
|
98
128
|
}
|
|
99
129
|
}
|
|
130
|
+
|
|
100
131
|
if (data.eventId) {
|
|
101
132
|
target.value = {
|
|
102
133
|
event: undefined,
|
|
103
134
|
group: undefined
|
|
104
135
|
};
|
|
136
|
+
|
|
105
137
|
if (!data.eventGroupId) {
|
|
106
138
|
target.value.group = {
|
|
107
139
|
id: 0,
|
|
@@ -109,6 +141,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
109
141
|
eventList: []
|
|
110
142
|
};
|
|
111
143
|
}
|
|
144
|
+
|
|
112
145
|
if (data.eventId === -100) {
|
|
113
146
|
target.value.event = {
|
|
114
147
|
id: -100,
|
|
@@ -116,36 +149,47 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
116
149
|
attrList: []
|
|
117
150
|
};
|
|
118
151
|
}
|
|
152
|
+
|
|
119
153
|
for (var i = 0; i < eventGroupList.length; i++) {
|
|
120
154
|
var group = eventGroupList[i];
|
|
155
|
+
|
|
121
156
|
if (data.eventId !== -100) {
|
|
122
157
|
for (var j = 0; j < group.eventList.length; j++) {
|
|
123
158
|
var event = group.eventList[j];
|
|
159
|
+
|
|
124
160
|
if (event.id === data.eventId) {
|
|
125
161
|
target.value.event = event;
|
|
126
162
|
break;
|
|
127
163
|
}
|
|
128
164
|
}
|
|
129
165
|
}
|
|
166
|
+
|
|
130
167
|
if (data.eventGroupId && data.eventGroupId === group.id) {
|
|
131
168
|
target.value.group = group;
|
|
132
169
|
break;
|
|
133
170
|
}
|
|
134
171
|
}
|
|
135
172
|
}
|
|
173
|
+
|
|
136
174
|
return target;
|
|
137
175
|
};
|
|
176
|
+
|
|
138
177
|
var onChangeTarget = function onChangeTarget(target) {
|
|
139
178
|
var _target$value, _target$value$event, _targetData$value, _targetData$value$eve2;
|
|
179
|
+
|
|
140
180
|
setTargetData(target);
|
|
181
|
+
|
|
141
182
|
var filterData = _.cloneDeep(filters);
|
|
183
|
+
|
|
142
184
|
if (((_target$value = target.value) === null || _target$value === void 0 ? void 0 : (_target$value$event = _target$value.event) === null || _target$value$event === void 0 ? void 0 : _target$value$event.id) !== (targetData === null || targetData === void 0 ? void 0 : (_targetData$value = targetData.value) === null || _targetData$value === void 0 ? void 0 : (_targetData$value$eve2 = _targetData$value.event) === null || _targetData$value$eve2 === void 0 ? void 0 : _targetData$value$eve2.id)) {
|
|
143
185
|
filterData = undefined;
|
|
144
186
|
setFilters(undefined);
|
|
145
187
|
setIsAdd(false);
|
|
146
188
|
setCount(0);
|
|
147
189
|
}
|
|
190
|
+
|
|
148
191
|
var currentDimension = dimension;
|
|
192
|
+
|
|
149
193
|
if (target.alias == (targetData === null || targetData === void 0 ? void 0 : targetData.alias)) {
|
|
150
194
|
currentDimension = {
|
|
151
195
|
analysisIndex: 'number'
|
|
@@ -153,19 +197,24 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
153
197
|
if (currentDimension.analysisAttr) delete currentDimension.analysisAttr;
|
|
154
198
|
setDimension(currentDimension);
|
|
155
199
|
}
|
|
200
|
+
|
|
156
201
|
onChange(currentDimension, target, filterData);
|
|
157
202
|
};
|
|
203
|
+
|
|
158
204
|
var onChangeDimension = function onChangeDimension(data) {
|
|
159
205
|
onChange(data, targetData, filters);
|
|
160
206
|
setDimension(data);
|
|
161
207
|
};
|
|
208
|
+
|
|
162
209
|
var onChangeFilters = function onChangeFilters(data) {
|
|
163
210
|
setFilters(data);
|
|
164
211
|
onChange(dimension, targetData, data);
|
|
165
212
|
};
|
|
213
|
+
|
|
166
214
|
var onChange = function onChange(analysisDimension, target, filterDatas) {
|
|
167
215
|
if (props.onChange) {
|
|
168
216
|
var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$group;
|
|
217
|
+
|
|
169
218
|
if (!target || !target.value || !((_target$value$event2 = target.value.event) === null || _target$value$event2 === void 0 ? void 0 : _target$value$event2.id)) return;
|
|
170
219
|
var data = {
|
|
171
220
|
type: 'event',
|
|
@@ -180,15 +229,18 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
180
229
|
props.onChange(data);
|
|
181
230
|
}
|
|
182
231
|
};
|
|
232
|
+
|
|
183
233
|
var onAdd = function onAdd() {
|
|
184
234
|
setIsAdd(true);
|
|
185
235
|
setTimeout(function () {
|
|
186
236
|
conditionRef.current.add();
|
|
187
237
|
}, 0);
|
|
188
238
|
};
|
|
239
|
+
|
|
189
240
|
var onDelete = function onDelete() {
|
|
190
241
|
if (props.onDelete) props.onDelete();
|
|
191
242
|
};
|
|
243
|
+
|
|
192
244
|
return /*#__PURE__*/React.createElement("div", {
|
|
193
245
|
className: classPrefix
|
|
194
246
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -221,6 +273,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
221
273
|
onConditionsCount: setCount
|
|
222
274
|
})));
|
|
223
275
|
};
|
|
276
|
+
|
|
224
277
|
BizTargetCondition.defaultProps = {
|
|
225
278
|
max: 5
|
|
226
279
|
};
|
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import { BizTargetSelector, BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
9
15
|
import eventData from '../../mock/event';
|
|
10
16
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
17
|
+
|
|
11
18
|
var EventDemo = function EventDemo() {
|
|
12
19
|
var store = convertAttributeData({
|
|
13
20
|
eventList: eventData
|
|
14
21
|
});
|
|
22
|
+
|
|
15
23
|
var _useState = useState({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
24
|
+
alias: '别名',
|
|
25
|
+
value: {
|
|
26
|
+
group: {
|
|
27
|
+
id: 4199
|
|
28
|
+
},
|
|
29
|
+
event: {
|
|
30
|
+
id: 24220583,
|
|
31
|
+
name: '菜单导航'
|
|
25
32
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
value = _useState2[0],
|
|
37
|
+
setValue = _useState2[1];
|
|
38
|
+
|
|
30
39
|
var handleChange = function handleChange(value) {
|
|
31
40
|
setValue(value);
|
|
32
41
|
};
|
|
42
|
+
|
|
33
43
|
var handleAdd = function handleAdd(data) {
|
|
34
44
|
console.log('add', data);
|
|
35
45
|
};
|
|
46
|
+
|
|
36
47
|
var handleDelete = function handleDelete(data) {
|
|
37
48
|
console.log('delete', data);
|
|
38
49
|
};
|
|
50
|
+
|
|
39
51
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
40
52
|
value: {
|
|
41
53
|
eventGroupList: store.eventGroupList
|
|
@@ -49,6 +61,7 @@ var EventDemo = function EventDemo() {
|
|
|
49
61
|
border: false
|
|
50
62
|
}))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u662F\uFF1A\u5206\u7EC4id: ", value.value.group.id, " \u4E8B\u4EF6\u540D\u79F0: ", value.value.event.name));
|
|
51
63
|
};
|
|
64
|
+
|
|
52
65
|
export default (function () {
|
|
53
66
|
return /*#__PURE__*/React.createElement(EventDemo, null);
|
|
54
67
|
});
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { Button, Input, message } from 'antd';
|
|
8
14
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
9
15
|
import { classPrefix } from '.';
|
|
10
16
|
import IconFont from '../icon/iconFont';
|
|
17
|
+
|
|
11
18
|
var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
12
19
|
var inputRef = useRef(null);
|
|
20
|
+
|
|
13
21
|
var _useState = useState(props.defaultValue || ''),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
alias = _useState2[0],
|
|
24
|
+
setAlias = _useState2[1];
|
|
25
|
+
|
|
17
26
|
useEffect(function () {
|
|
18
27
|
inputRef.current.focus({
|
|
19
28
|
cursor: 'end'
|
|
@@ -23,21 +32,26 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
|
23
32
|
var reg = new RegExp("^[0-9A-Za-z\u4E00-\u9FA5]+$");
|
|
24
33
|
return reg.test(alias) || alias === '';
|
|
25
34
|
}, [alias]);
|
|
35
|
+
|
|
26
36
|
var onClick = function onClick() {
|
|
27
37
|
if (aliasStatus) {
|
|
28
38
|
if (props.disabled && props.disabled === alias) {
|
|
29
39
|
message.error('不能与事件名相同!');
|
|
30
40
|
return;
|
|
31
41
|
}
|
|
42
|
+
|
|
32
43
|
props.onChange && props.onChange(alias);
|
|
33
44
|
}
|
|
34
45
|
};
|
|
46
|
+
|
|
35
47
|
var onCancel = function onCancel() {
|
|
36
48
|
props.onCancel && props.onCancel();
|
|
37
49
|
};
|
|
50
|
+
|
|
38
51
|
var onChange = function onChange(e) {
|
|
39
52
|
setAlias(e.target.value);
|
|
40
53
|
};
|
|
54
|
+
|
|
41
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
56
|
className: "".concat(classPrefix, "-modal")
|
|
43
57
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -65,4 +79,5 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
|
65
79
|
type: "primary"
|
|
66
80
|
}, "\u786E\u5B9A")));
|
|
67
81
|
};
|
|
82
|
+
|
|
68
83
|
export default BizEventNameEditBox;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useEffect, useState } from 'react';
|
|
8
14
|
import BizEventNameEditBox from './editBox';
|
|
9
15
|
import { Dropdown } from 'antd';
|
|
@@ -11,26 +17,33 @@ import './styles/index.less';
|
|
|
11
17
|
import BizTargetOptionIcon from './optionIcon';
|
|
12
18
|
import BizTargetOptionMenu from './optionMenu';
|
|
13
19
|
export var classPrefix = 'biz-target-select';
|
|
20
|
+
|
|
14
21
|
var BizTargetSelector = function BizTargetSelector(props) {
|
|
15
22
|
var _targetData$event;
|
|
23
|
+
|
|
16
24
|
var enableAdd = props.enableAdd,
|
|
17
|
-
|
|
25
|
+
enableDelete = props.enableDelete;
|
|
26
|
+
|
|
18
27
|
var _useState = useState(''),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
alias = _useState2[0],
|
|
30
|
+
setAlias = _useState2[1];
|
|
31
|
+
|
|
22
32
|
var _useState3 = useState(),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
targetData = _useState4[0],
|
|
35
|
+
setTargetData = _useState4[1];
|
|
36
|
+
|
|
26
37
|
var _useState5 = useState(false),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
39
|
+
showEditModal = _useState6[0],
|
|
40
|
+
setShowEditModal = _useState6[1];
|
|
41
|
+
|
|
30
42
|
var _useState7 = useState(false),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
44
|
+
visible = _useState8[0],
|
|
45
|
+
setVisible = _useState8[1];
|
|
46
|
+
|
|
34
47
|
useEffect(function () {
|
|
35
48
|
if (!props.defaultValue) return;
|
|
36
49
|
setAlias(props.defaultValue.alias || '');
|
|
@@ -41,8 +54,10 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
41
54
|
setAlias(props.value.alias || '');
|
|
42
55
|
setTargetData(props.value.value || undefined);
|
|
43
56
|
}, [props.value]);
|
|
57
|
+
|
|
44
58
|
var onClickIcon = function onClickIcon(name) {
|
|
45
59
|
setVisible(false);
|
|
60
|
+
|
|
46
61
|
if (name === 'edit') {
|
|
47
62
|
setShowEditModal(true);
|
|
48
63
|
} else if (name === 'add') {
|
|
@@ -61,9 +76,11 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
78
|
};
|
|
79
|
+
|
|
64
80
|
var onCancelEdit = function onCancelEdit() {
|
|
65
81
|
setShowEditModal(false);
|
|
66
82
|
};
|
|
83
|
+
|
|
67
84
|
var onChangeAlias = function onChangeAlias(value) {
|
|
68
85
|
setShowEditModal(false);
|
|
69
86
|
setAlias(value);
|
|
@@ -72,6 +89,7 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
72
89
|
value: targetData
|
|
73
90
|
});
|
|
74
91
|
};
|
|
92
|
+
|
|
75
93
|
var onChange = function onChange(value) {
|
|
76
94
|
setTargetData(value);
|
|
77
95
|
props.onChange && props.onChange({
|
|
@@ -79,9 +97,11 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
79
97
|
value: value
|
|
80
98
|
});
|
|
81
99
|
};
|
|
100
|
+
|
|
82
101
|
var onVisibleChange = function onVisibleChange(flag) {
|
|
83
102
|
setVisible(flag);
|
|
84
103
|
};
|
|
104
|
+
|
|
85
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
86
106
|
className: classPrefix
|
|
87
107
|
}, /*#__PURE__*/React.cloneElement(props.children, {
|
|
@@ -123,6 +143,7 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
123
143
|
onChange: onChangeAlias
|
|
124
144
|
}));
|
|
125
145
|
};
|
|
146
|
+
|
|
126
147
|
BizTargetSelector.defaultProps = {
|
|
127
148
|
enableAdd: true,
|
|
128
149
|
enableDelete: true
|
|
@@ -2,12 +2,15 @@ import { Tooltip } from 'antd';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { classPrefix } from '.';
|
|
4
4
|
import IconFont from '../icon/iconFont';
|
|
5
|
+
|
|
5
6
|
var BizTargetOptionIcon = function BizTargetOptionIcon(props) {
|
|
6
7
|
var enabled = props.enabled,
|
|
7
|
-
|
|
8
|
+
title = props.title;
|
|
9
|
+
|
|
8
10
|
var onClick = function onClick() {
|
|
9
11
|
if (props.onClick && enabled) props.onClick(props.name);
|
|
10
12
|
};
|
|
13
|
+
|
|
11
14
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
15
|
title: title,
|
|
13
16
|
key: props.name
|
|
@@ -17,4 +20,5 @@ var BizTargetOptionIcon = function BizTargetOptionIcon(props) {
|
|
|
17
20
|
onClick: onClick
|
|
18
21
|
}));
|
|
19
22
|
};
|
|
23
|
+
|
|
20
24
|
export default BizTargetOptionIcon;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { classPrefix } from '.';
|
|
3
3
|
import IconFont from '../icon/iconFont';
|
|
4
|
+
|
|
4
5
|
var BizTargetOptionMenu = function BizTargetOptionMenu(props) {
|
|
5
6
|
var _onClick = function onClick(name) {
|
|
6
7
|
if (props.onClick) props.onClick(name);
|
|
7
8
|
};
|
|
9
|
+
|
|
8
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
11
|
className: "".concat(classPrefix, "-menu")
|
|
10
12
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -32,4 +34,5 @@ var BizTargetOptionMenu = function BizTargetOptionMenu(props) {
|
|
|
32
34
|
type: "shanchu"
|
|
33
35
|
}), /*#__PURE__*/React.createElement("span", null, "\u5220\u9664\u6307\u6807")));
|
|
34
36
|
};
|
|
37
|
+
|
|
35
38
|
export default BizTargetOptionMenu;
|
|
@@ -5,17 +5,21 @@ import './styles/conditionTypeList.less';
|
|
|
5
5
|
import { BizUserConditionContext } from '.';
|
|
6
6
|
import BizGlobalDataContext from '../context';
|
|
7
7
|
import IconFont from '../icon/iconFont';
|
|
8
|
+
|
|
8
9
|
var ConditionTypeList = function ConditionTypeList(props) {
|
|
9
10
|
var onAdd = props.onAdd,
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
label = props.label,
|
|
12
|
+
show = props.show;
|
|
13
|
+
|
|
12
14
|
var _useContext = useContext(BizUserConditionContext),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
textMode = _useContext.textMode,
|
|
16
|
+
openTagCondition = _useContext.openTagCondition,
|
|
17
|
+
openCdpCondition = _useContext.openCdpCondition,
|
|
18
|
+
cdpTip = _useContext.cdpTip;
|
|
19
|
+
|
|
17
20
|
var _useContext2 = useContext(BizGlobalDataContext),
|
|
18
|
-
|
|
21
|
+
menuNameMap = _useContext2.menuNameMap;
|
|
22
|
+
|
|
19
23
|
if (!show || textMode) return null;
|
|
20
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
25
|
className: "biz-user-condition-type-list"
|
|
@@ -71,6 +75,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
71
75
|
type: "tishiicon"
|
|
72
76
|
})) : null)) : null));
|
|
73
77
|
};
|
|
78
|
+
|
|
74
79
|
ConditionTypeList.defaultProps = {
|
|
75
80
|
show: true
|
|
76
81
|
};
|