@zgfe/business-lib 1.1.29-alpha.2 → 1.1.29-alpha.4
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/targetConditionGroup/index.js +61 -25
- package/package.json +2 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
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
|
+
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
|
|
3
9
|
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."); }
|
|
@@ -18,6 +24,7 @@ import BizConditionGroup from '../attrConditions/group';
|
|
|
18
24
|
import { Skeleton } from 'antd';
|
|
19
25
|
import _ from 'lodash';
|
|
20
26
|
import BizGlobalDataContext from '../context';
|
|
27
|
+
import { BuiltinIndicators } from '../constants/common';
|
|
21
28
|
export var classPrefix = 'biz-target';
|
|
22
29
|
|
|
23
30
|
var BizTargetCondition = function BizTargetCondition(props) {
|
|
@@ -98,12 +105,12 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
98
105
|
canDelete = true;
|
|
99
106
|
|
|
100
107
|
if (((_targetData$value$eve = targetData.value.event) === null || _targetData$value$eve === void 0 ? void 0 : _targetData$value$eve.id) === -100 || ((_targetData$value$eve2 = targetData.value.event) === null || _targetData$value$eve2 === void 0 ? void 0 : _targetData$value$eve2.id) === -204 || ((_targetData$value$eve3 = targetData.value.event) === null || _targetData$value$eve3 === void 0 ? void 0 : _targetData$value$eve3.id) === -205) {
|
|
101
|
-
var _targetData$value$gro;
|
|
108
|
+
var _targetData$value$gro, _targetData$value$eve4;
|
|
102
109
|
|
|
103
110
|
canAdd = false;
|
|
104
111
|
setFilters(undefined);
|
|
105
112
|
|
|
106
|
-
if (!((_targetData$value$gro = targetData.value.group) === null || _targetData$value$gro === void 0 ? void 0 : _targetData$value$gro.id)) {
|
|
113
|
+
if (!((_targetData$value$gro = targetData.value.group) === null || _targetData$value$gro === void 0 ? void 0 : _targetData$value$gro.id) && ((_targetData$value$eve4 = targetData.value.event) === null || _targetData$value$eve4 === void 0 ? void 0 : _targetData$value$eve4.id) === -100) {
|
|
107
114
|
canDelete = false;
|
|
108
115
|
}
|
|
109
116
|
} else {
|
|
@@ -142,31 +149,52 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
142
149
|
};
|
|
143
150
|
}
|
|
144
151
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
var hasEvent = false;
|
|
153
|
+
|
|
154
|
+
if (data.isBuiltIn || data.eventId < 0) {
|
|
155
|
+
if (data.eventGroupId) {
|
|
156
|
+
target.value.group = {
|
|
157
|
+
id: data.eventGroupId,
|
|
158
|
+
name: data.eventGroupId === -2 ? '整体' : '所有分组',
|
|
159
|
+
eventList: []
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
BuiltinIndicators.eventList.forEach(function (item) {
|
|
164
|
+
if (item.id === data.eventId) {
|
|
165
|
+
target.value.event = _objectSpread({}, item);
|
|
166
|
+
hasEvent = true;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
151
169
|
}
|
|
152
170
|
|
|
153
|
-
|
|
154
|
-
|
|
171
|
+
if (!hasEvent) {
|
|
172
|
+
if (data.eventId === -100) {
|
|
173
|
+
target.value.event = {
|
|
174
|
+
id: -100,
|
|
175
|
+
name: '事件概览',
|
|
176
|
+
attrList: []
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
for (var i = 0; i < eventGroupList.length; i++) {
|
|
181
|
+
var group = eventGroupList[i];
|
|
155
182
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
183
|
+
if (data.eventId !== -100) {
|
|
184
|
+
for (var j = 0; j < group.eventList.length; j++) {
|
|
185
|
+
var event = group.eventList[j];
|
|
159
186
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
187
|
+
if (event.id === data.eventId) {
|
|
188
|
+
target.value.event = event;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
163
191
|
}
|
|
164
192
|
}
|
|
165
|
-
}
|
|
166
193
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
194
|
+
if (data.eventGroupId && data.eventGroupId === group.id) {
|
|
195
|
+
target.value.group = group;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
170
198
|
}
|
|
171
199
|
}
|
|
172
200
|
}
|
|
@@ -175,13 +203,13 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
175
203
|
};
|
|
176
204
|
|
|
177
205
|
var onChangeTarget = function onChangeTarget(target) {
|
|
178
|
-
var _target$value, _target$value$event, _targetData$value, _targetData$value$
|
|
206
|
+
var _target$value, _target$value$event, _targetData$value, _targetData$value$eve5;
|
|
179
207
|
|
|
180
208
|
setTargetData(target);
|
|
181
209
|
|
|
182
210
|
var filterData = _.cloneDeep(filters);
|
|
183
211
|
|
|
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$
|
|
212
|
+
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$eve5 = _targetData$value.event) === null || _targetData$value$eve5 === void 0 ? void 0 : _targetData$value$eve5.id)) {
|
|
185
213
|
filterData = undefined;
|
|
186
214
|
setFilters(undefined);
|
|
187
215
|
setIsAdd(false);
|
|
@@ -213,15 +241,23 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
213
241
|
|
|
214
242
|
var onChange = function onChange(analysisDimension, target, filterData) {
|
|
215
243
|
if (props.onChange) {
|
|
216
|
-
var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$
|
|
244
|
+
var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$group2;
|
|
217
245
|
|
|
218
246
|
if (!target || !target.value || !((_target$value$event2 = target.value.event) === null || _target$value$event2 === void 0 ? void 0 : _target$value$event2.id)) return;
|
|
247
|
+
var type = target.value.event.type;
|
|
248
|
+
|
|
249
|
+
if (!type) {
|
|
250
|
+
var _target$value$group;
|
|
251
|
+
|
|
252
|
+
type = ((_target$value$group = target.value.group) === null || _target$value$group === void 0 ? void 0 : _target$value$group.id) === -2 ? 'whole' : 'event';
|
|
253
|
+
}
|
|
254
|
+
|
|
219
255
|
var data = {
|
|
220
|
-
type:
|
|
256
|
+
type: type,
|
|
221
257
|
alias: (target === null || target === void 0 ? void 0 : target.alias) || target.value.event.alias || ((_target$value$event3 = target.value.event) === null || _target$value$event3 === void 0 ? void 0 : _target$value$event3.name) || '',
|
|
222
258
|
eventId: (_target$value$event4 = target.value.event) === null || _target$value$event4 === void 0 ? void 0 : _target$value$event4.id,
|
|
223
259
|
eventName: ((_target$value$event5 = target.value.event) === null || _target$value$event5 === void 0 ? void 0 : _target$value$event5.alias) || ((_target$value$event6 = target.value.event) === null || _target$value$event6 === void 0 ? void 0 : _target$value$event6.name),
|
|
224
|
-
eventGroupId: (_target$value$
|
|
260
|
+
eventGroupId: (_target$value$group2 = target.value.group) === null || _target$value$group2 === void 0 ? void 0 : _target$value$group2.id,
|
|
225
261
|
analysisDimension: analysisDimension,
|
|
226
262
|
filters: filterData,
|
|
227
263
|
marked: target.value.event.marked,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.29-alpha.
|
|
3
|
+
"version": "1.1.29-alpha.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"react": "^16.12.0 || ^17.0.0",
|
|
60
60
|
"yorkie": "^2.0.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "92c367ccc1eddc3387d4cc8da77fff9b4f1a6f24"
|
|
63
63
|
}
|