@zgfe/business-lib 1.1.30-insight.0 → 1.1.31-alpha.0
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/assets/styles/resetAntd.less +36 -12
- package/es/attrConditions/index.js +0 -2
- package/es/attrConditions/utils/operates.d.ts +50 -0
- package/es/attrConditions/utils/operates.js +126 -0
- package/es/attributeSelector/types.d.ts +0 -2
- package/es/eventSelector/demo/index.js +0 -1
- package/es/eventSelector/index.js +2 -5
- package/es/eventSelector/listPanel.js +7 -33
- package/es/eventSelector/types.d.ts +0 -2
- package/es/targetConditionGroup/demo/index.js +1 -2
- package/es/targetConditionGroup/index.js +34 -65
- package/es/targetConditionGroup/types.d.ts +0 -1
- package/es/userCondition/conditionTypeList.js +17 -1
- package/es/userCondition/conditions/businessCondition.d.ts +11 -0
- package/es/userCondition/conditions/businessCondition.js +396 -0
- package/es/userCondition/conditions/dataAttribute.d.ts +10 -0
- package/es/userCondition/conditions/dataAttribute.js +313 -0
- package/es/userCondition/conditions/eventCondition.js +77 -2
- package/es/userCondition/conditions/timeDimension.d.ts +9 -0
- package/es/userCondition/conditions/timeDimension.js +173 -0
- package/es/userCondition/orConditions.js +15 -0
- package/es/userCondition/types.d.ts +33 -2
- package/es/userCondition/util.d.ts +1 -1
- package/es/userCondition/util.js +29 -0
- package/package.json +61 -61
- package/es/constants/common.d.ts +0 -11
- package/es/constants/common.js +0 -35
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
border-color: @primary-color!important;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
&.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
20
|
-
|
|
19
|
+
&.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
20
|
+
.ant-input-affix-wrapper-borderless
|
|
21
|
+
):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper,
|
|
22
|
+
&.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
23
|
+
.ant-input-affix-wrapper-borderless
|
|
24
|
+
):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper:hover {
|
|
21
25
|
background-color: @background-color-base!important;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
@@ -31,8 +35,12 @@
|
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
35
|
-
.ant-input-affix-wrapper-
|
|
38
|
+
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
39
|
+
.ant-input-affix-wrapper-borderless
|
|
40
|
+
).ant-input-affix-wrapper,
|
|
41
|
+
.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
|
|
42
|
+
.ant-input-affix-wrapper-borderless
|
|
43
|
+
).ant-input-affix-wrapper:hover {
|
|
36
44
|
border-color: @error-color!important;
|
|
37
45
|
}
|
|
38
46
|
// 输入框
|
|
@@ -62,7 +70,9 @@
|
|
|
62
70
|
background-color: @background-color-base!important;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
|
-
.ant-select:not(.ant-select-customize-input):not(.ant-pagination-size-changer):not(
|
|
73
|
+
.ant-select:not(.ant-select-customize-input):not(.ant-pagination-size-changer):not(
|
|
74
|
+
.ant-select-status-error
|
|
75
|
+
)
|
|
66
76
|
.ant-select-selector {
|
|
67
77
|
background: #fafafb;
|
|
68
78
|
border-color: rgba(0, 0, 0, 0);
|
|
@@ -229,7 +239,9 @@
|
|
|
229
239
|
/*日期hover*/
|
|
230
240
|
&:hover {
|
|
231
241
|
&:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,
|
|
232
|
-
&:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(
|
|
242
|
+
&:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(
|
|
243
|
+
.ant-picker-cell-range-end
|
|
244
|
+
):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end)
|
|
233
245
|
.ant-picker-cell-inner {
|
|
234
246
|
background-color: transparent !important;
|
|
235
247
|
border: 1px solid @primary-color!important;
|
|
@@ -239,9 +251,13 @@
|
|
|
239
251
|
|
|
240
252
|
/*选中的日期范围*/
|
|
241
253
|
/* 日期范围的起始时间radius */
|
|
242
|
-
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(
|
|
254
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(
|
|
255
|
+
.ant-picker-cell-range-end
|
|
256
|
+
)
|
|
243
257
|
.ant-picker-cell-inner,
|
|
244
|
-
.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(
|
|
258
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(
|
|
259
|
+
.ant-picker-cell-range-start
|
|
260
|
+
)
|
|
245
261
|
.ant-picker-cell-inner {
|
|
246
262
|
border-radius: 50% !important;
|
|
247
263
|
}
|
|
@@ -272,8 +288,12 @@
|
|
|
272
288
|
.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover::before,
|
|
273
289
|
.ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover::before,
|
|
274
290
|
.ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover::before,
|
|
275
|
-
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(
|
|
276
|
-
|
|
291
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(
|
|
292
|
+
.ant-picker-cell-range-start-single
|
|
293
|
+
).ant-picker-cell-range-hover-start::before,
|
|
294
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-end:not(
|
|
295
|
+
.ant-picker-cell-range-end-single
|
|
296
|
+
).ant-picker-cell-range-hover-end::before,
|
|
277
297
|
.ant-picker-panel
|
|
278
298
|
> :not(.ant-picker-date-panel)
|
|
279
299
|
.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start::before,
|
|
@@ -296,8 +316,12 @@
|
|
|
296
316
|
}
|
|
297
317
|
}
|
|
298
318
|
}
|
|
299
|
-
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(
|
|
300
|
-
|
|
319
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-start:not(
|
|
320
|
+
.ant-picker-cell-range-start-single
|
|
321
|
+
)::before,
|
|
322
|
+
.ant-picker-cell-in-view.ant-picker-cell-range-end:not(
|
|
323
|
+
.ant-picker-cell-range-end-single
|
|
324
|
+
)::before {
|
|
301
325
|
background: @primary-color-hover !important;
|
|
302
326
|
}
|
|
303
327
|
}
|
|
@@ -50,7 +50,6 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
50
50
|
propCategory: data.propCategory,
|
|
51
51
|
type: data.type,
|
|
52
52
|
key: data.attrId,
|
|
53
|
-
label: data.label,
|
|
54
53
|
dimensionSub: data.dimensionSub || 'event_attr'
|
|
55
54
|
};
|
|
56
55
|
}
|
|
@@ -60,7 +59,6 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
60
59
|
attrData = {
|
|
61
60
|
id: aId,
|
|
62
61
|
name: data.attrName,
|
|
63
|
-
label: data.label,
|
|
64
62
|
propCategory: data.propCategory,
|
|
65
63
|
type: data.type,
|
|
66
64
|
category: data.category,
|
|
@@ -6,6 +6,56 @@ export declare const numberOperate: {
|
|
|
6
6
|
name: string;
|
|
7
7
|
value: string;
|
|
8
8
|
}[];
|
|
9
|
+
export declare const computeTypeList: {
|
|
10
|
+
value: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const typeList: {
|
|
14
|
+
'cont-string': {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
'cont-date': {
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
'cont-num': {
|
|
23
|
+
name: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
export declare const timeDimensionType: {
|
|
28
|
+
name: string;
|
|
29
|
+
value: number;
|
|
30
|
+
}[];
|
|
31
|
+
export declare const orderTypeList: {
|
|
32
|
+
name: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}[];
|
|
35
|
+
export declare const skyTimeOperatorType: {
|
|
36
|
+
name: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[];
|
|
39
|
+
export declare const weekTimeOperatorType: {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}[];
|
|
43
|
+
export declare const monthTimeOperatorType: {
|
|
44
|
+
name: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[];
|
|
47
|
+
export declare const timeValuesType: {
|
|
48
|
+
name: string;
|
|
49
|
+
value: any;
|
|
50
|
+
}[];
|
|
51
|
+
export declare const weekValuesType: {
|
|
52
|
+
name: string;
|
|
53
|
+
value: number;
|
|
54
|
+
}[];
|
|
55
|
+
export declare const monthValuesType: {
|
|
56
|
+
name: string;
|
|
57
|
+
value: any;
|
|
58
|
+
}[];
|
|
9
59
|
export declare const dateOperate: {
|
|
10
60
|
name: string;
|
|
11
61
|
value: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _Array$from, _Array$from2;
|
|
1
2
|
export var stringOperate = [{
|
|
2
3
|
name: '是',
|
|
3
4
|
value: 'equal'
|
|
@@ -48,6 +49,131 @@ export var numberOperate = [{
|
|
|
48
49
|
name: '≠',
|
|
49
50
|
value: 'not equal'
|
|
50
51
|
}];
|
|
52
|
+
export var computeTypeList = [{
|
|
53
|
+
value: 'origin',
|
|
54
|
+
name: '原值'
|
|
55
|
+
}, {
|
|
56
|
+
value: 'max',
|
|
57
|
+
name: '最大值'
|
|
58
|
+
}, {
|
|
59
|
+
value: 'min',
|
|
60
|
+
name: '最小值'
|
|
61
|
+
}, {
|
|
62
|
+
value: 'sum',
|
|
63
|
+
name: '累计值'
|
|
64
|
+
}, {
|
|
65
|
+
value: 'avg',
|
|
66
|
+
name: '平均值'
|
|
67
|
+
}];
|
|
68
|
+
export var typeList = {
|
|
69
|
+
'cont-string': stringOperate,
|
|
70
|
+
'cont-date': [{
|
|
71
|
+
name: '最近',
|
|
72
|
+
value: 'relative'
|
|
73
|
+
}, {
|
|
74
|
+
name: '最近区间',
|
|
75
|
+
value: 'relativeInterval'
|
|
76
|
+
}, {
|
|
77
|
+
name: '未来',
|
|
78
|
+
value: 'future'
|
|
79
|
+
}, {
|
|
80
|
+
name: '未来区间',
|
|
81
|
+
value: 'futureInterval'
|
|
82
|
+
}, {
|
|
83
|
+
name: '固定时段',
|
|
84
|
+
value: 'absolute'
|
|
85
|
+
}],
|
|
86
|
+
'cont-num': [{
|
|
87
|
+
name: '>',
|
|
88
|
+
value: '>'
|
|
89
|
+
}, {
|
|
90
|
+
name: '=',
|
|
91
|
+
value: '='
|
|
92
|
+
}, {
|
|
93
|
+
name: '<',
|
|
94
|
+
value: '<'
|
|
95
|
+
}, {
|
|
96
|
+
name: '>=',
|
|
97
|
+
value: '>='
|
|
98
|
+
}, {
|
|
99
|
+
name: '<=',
|
|
100
|
+
value: '<='
|
|
101
|
+
}, {
|
|
102
|
+
name: '≠',
|
|
103
|
+
value: 'not equal'
|
|
104
|
+
}, {
|
|
105
|
+
name: '区间',
|
|
106
|
+
value: 'between'
|
|
107
|
+
}]
|
|
108
|
+
};
|
|
109
|
+
export var timeDimensionType = [{
|
|
110
|
+
name: '每天',
|
|
111
|
+
value: 1
|
|
112
|
+
}, {
|
|
113
|
+
name: '每周',
|
|
114
|
+
value: 2
|
|
115
|
+
}, {
|
|
116
|
+
name: '每月',
|
|
117
|
+
value: 3
|
|
118
|
+
}];
|
|
119
|
+
export var orderTypeList = [{
|
|
120
|
+
name: '主订单',
|
|
121
|
+
value: 'master'
|
|
122
|
+
}, {
|
|
123
|
+
name: '子订单',
|
|
124
|
+
value: 'son'
|
|
125
|
+
}];
|
|
126
|
+
export var skyTimeOperatorType = [{
|
|
127
|
+
name: '整天',
|
|
128
|
+
value: 'all'
|
|
129
|
+
}, {
|
|
130
|
+
name: '在',
|
|
131
|
+
value: 'in'
|
|
132
|
+
}, {
|
|
133
|
+
name: '在区间',
|
|
134
|
+
value: 'between'
|
|
135
|
+
}];
|
|
136
|
+
export var weekTimeOperatorType = [{
|
|
137
|
+
name: '整周',
|
|
138
|
+
value: 'all'
|
|
139
|
+
}, {
|
|
140
|
+
name: '在',
|
|
141
|
+
value: 'in'
|
|
142
|
+
}, {
|
|
143
|
+
name: '在区间',
|
|
144
|
+
value: 'between'
|
|
145
|
+
}];
|
|
146
|
+
export var monthTimeOperatorType = [{
|
|
147
|
+
name: '整月',
|
|
148
|
+
value: 'all'
|
|
149
|
+
}, {
|
|
150
|
+
name: '在',
|
|
151
|
+
value: 'in'
|
|
152
|
+
}, {
|
|
153
|
+
name: '在区间',
|
|
154
|
+
value: 'between'
|
|
155
|
+
}];
|
|
156
|
+
var arr1 = new Array(24).keys();
|
|
157
|
+
export var timeValuesType = (_Array$from = Array.from(arr1)) === null || _Array$from === void 0 ? void 0 : _Array$from.map(function (item) {
|
|
158
|
+
return {
|
|
159
|
+
name: item + '时',
|
|
160
|
+
value: item
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
var arr2 = ['一', '二', '三', '四', '五', '六', '日'];
|
|
164
|
+
export var weekValuesType = arr2.map(function (item, index) {
|
|
165
|
+
return {
|
|
166
|
+
name: '周' + item,
|
|
167
|
+
value: index + 1
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
var arr3 = new Array(31).keys();
|
|
171
|
+
export var monthValuesType = (_Array$from2 = Array.from(arr3)) === null || _Array$from2 === void 0 ? void 0 : _Array$from2.map(function (item) {
|
|
172
|
+
return {
|
|
173
|
+
name: item + 1 + '号',
|
|
174
|
+
value: item + 1
|
|
175
|
+
};
|
|
176
|
+
});
|
|
51
177
|
export var dateOperate = [{
|
|
52
178
|
name: '最近',
|
|
53
179
|
value: 'relative'
|
|
@@ -10,7 +10,6 @@ import SelectHandle from '../select/handle';
|
|
|
10
10
|
import BizGlobalDataContext from '../context';
|
|
11
11
|
import EventListPanel from './listPanel';
|
|
12
12
|
import './styles/index.less';
|
|
13
|
-
import { BuiltinIndicators } from '../constants/common';
|
|
14
13
|
export var classPrefix = 'biz-event-select';
|
|
15
14
|
var BizEventSelector = function BizEventSelector(props) {
|
|
16
15
|
var alias = props.alias,
|
|
@@ -43,14 +42,13 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
43
42
|
var getValue = function getValue(param) {
|
|
44
43
|
var _param$group, _param$event;
|
|
45
44
|
var res = {};
|
|
46
|
-
var allEvents = props.showBuiltInTarget ? eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.concat(BuiltinIndicators) : eventGroupList;
|
|
47
45
|
if (!((_param$group = param.group) === null || _param$group === void 0 ? void 0 : _param$group.id)) {
|
|
48
46
|
res.group = {
|
|
49
47
|
id: 0,
|
|
50
48
|
name: '所有分组',
|
|
51
49
|
eventList: function () {
|
|
52
50
|
var list = [];
|
|
53
|
-
|
|
51
|
+
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
|
|
54
52
|
list = list.concat(group.eventList);
|
|
55
53
|
});
|
|
56
54
|
return list;
|
|
@@ -64,7 +62,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
64
62
|
attrList: []
|
|
65
63
|
};
|
|
66
64
|
}
|
|
67
|
-
|
|
65
|
+
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
|
|
68
66
|
var _param$group2;
|
|
69
67
|
if (group.id === ((_param$group2 = param.group) === null || _param$group2 === void 0 ? void 0 : _param$group2.id)) res.group = group;
|
|
70
68
|
group.eventList.forEach(function (event) {
|
|
@@ -106,7 +104,6 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
106
104
|
value: currentValue,
|
|
107
105
|
onChange: onChange,
|
|
108
106
|
showOverview: showAllEvent,
|
|
109
|
-
showBuiltInTarget: props.showBuiltInTarget,
|
|
110
107
|
defaultSelectAble: defaultSelectAble
|
|
111
108
|
}),
|
|
112
109
|
trigger: ['click'],
|
|
@@ -15,7 +15,6 @@ import InfiniteScroll from 'react-infinite-scroll-component';
|
|
|
15
15
|
import { classPrefix } from '.';
|
|
16
16
|
import { BizGlobalDataContext } from '..';
|
|
17
17
|
import { ShowStatus } from '../attributeSelector/types';
|
|
18
|
-
import { BuiltinIndicators } from '../constants/common';
|
|
19
18
|
import BizSearchInput from '../searchInput';
|
|
20
19
|
import EventListOption from './option';
|
|
21
20
|
var EventListPanel = function EventListPanel(props) {
|
|
@@ -69,33 +68,15 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
69
68
|
}
|
|
70
69
|
});
|
|
71
70
|
});
|
|
72
|
-
list =
|
|
71
|
+
list = [].concat(markList, _toConsumableArray(list));
|
|
73
72
|
return list;
|
|
74
73
|
}(),
|
|
75
74
|
name: '所有分组'
|
|
76
75
|
};
|
|
77
76
|
setGroupList(function (list) {
|
|
78
|
-
return
|
|
79
|
-
});
|
|
80
|
-
setCurrentGroup(function () {
|
|
81
|
-
var _props$value;
|
|
82
|
-
if (props.defaultSelectAble && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.group)) {
|
|
83
|
-
if (props.showBuiltInTarget && props.value.group.id === -2) {
|
|
84
|
-
return BuiltinIndicators;
|
|
85
|
-
} else {
|
|
86
|
-
var _currentGroup = group;
|
|
87
|
-
eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (eGroup) {
|
|
88
|
-
var _props$value2, _props$value2$group;
|
|
89
|
-
if (eGroup.id === ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : (_props$value2$group = _props$value2.group) === null || _props$value2$group === void 0 ? void 0 : _props$value2$group.id)) {
|
|
90
|
-
_currentGroup = eGroup;
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
return _currentGroup;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return group;
|
|
77
|
+
return [group].concat(_toConsumableArray(list));
|
|
98
78
|
});
|
|
79
|
+
setCurrentGroup(group);
|
|
99
80
|
}, []);
|
|
100
81
|
useEffect(function () {
|
|
101
82
|
setCurrentValue(props.value);
|
|
@@ -185,26 +166,18 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
185
166
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
186
167
|
showList = _useState12[0],
|
|
187
168
|
setShowList = _useState12[1];
|
|
188
|
-
var _useState13 = useState([]),
|
|
189
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
190
|
-
canShowList = _useState14[0],
|
|
191
|
-
setCanShowList = _useState14[1];
|
|
192
169
|
useEffect(function () {
|
|
193
|
-
|
|
194
|
-
return item.eventHidden !== ShowStatus.hidden;
|
|
195
|
-
});
|
|
196
|
-
setCanShowList(data);
|
|
197
|
-
setShowList(data.slice(0, 10));
|
|
170
|
+
setShowList(searchEventList.slice(0, 10));
|
|
198
171
|
}, [searchEventList]);
|
|
199
172
|
var loadMoreData = function loadMoreData() {
|
|
200
|
-
var moreData =
|
|
173
|
+
var moreData = searchEventList.slice(showList.length, showList.length + 10);
|
|
201
174
|
setShowList(function (list) {
|
|
202
175
|
return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
|
|
203
176
|
});
|
|
204
177
|
};
|
|
205
178
|
return /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
206
179
|
dataLength: showList.length,
|
|
207
|
-
hasMore: showList.length <
|
|
180
|
+
hasMore: showList.length < searchEventList.length,
|
|
208
181
|
loader: /*#__PURE__*/React.createElement(Skeleton, {
|
|
209
182
|
paragraph: {
|
|
210
183
|
rows: 1
|
|
@@ -217,6 +190,7 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
217
190
|
key: Math.random()
|
|
218
191
|
}, showList.map(function (e) {
|
|
219
192
|
var _currentValue$event2;
|
|
193
|
+
if (e.eventHidden === ShowStatus.hidden) return null;
|
|
220
194
|
return /*#__PURE__*/React.createElement(EventListOption, {
|
|
221
195
|
label: e.alias || e.name,
|
|
222
196
|
key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
|
|
@@ -23,7 +23,6 @@ export declare namespace EventSelectTypes {
|
|
|
23
23
|
showAllEvent?: boolean;
|
|
24
24
|
defaultSelectAble?: boolean;
|
|
25
25
|
popupContainer?: boolean;
|
|
26
|
-
showBuiltInTarget?: boolean;
|
|
27
26
|
onVisibleChange?: (visible: boolean) => void;
|
|
28
27
|
border?: boolean;
|
|
29
28
|
theme?: string;
|
|
@@ -34,7 +33,6 @@ export declare namespace EventSelectTypes {
|
|
|
34
33
|
interface DropdownProps {
|
|
35
34
|
value?: Value;
|
|
36
35
|
showOverview?: boolean;
|
|
37
|
-
showBuiltInTarget?: boolean;
|
|
38
36
|
defaultSelectAble?: boolean;
|
|
39
37
|
onChange?: (value: Value, isOverview?: boolean) => void;
|
|
40
38
|
}
|
|
@@ -51,7 +51,6 @@ export default (function () {
|
|
|
51
51
|
max: 3
|
|
52
52
|
}, /*#__PURE__*/React.createElement(BizEventSelector, {
|
|
53
53
|
showAllEvent: true,
|
|
54
|
-
border: false
|
|
55
|
-
showBuiltInTarget: true
|
|
54
|
+
border: false
|
|
56
55
|
}))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(target)));
|
|
57
56
|
});
|
|
@@ -1,9 +1,3 @@
|
|
|
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); }
|
|
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; }
|
|
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
|
-
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
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
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."); }
|
|
9
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); }
|
|
@@ -18,10 +12,9 @@ import BizConditionGroup from '../attrConditions/group';
|
|
|
18
12
|
import { Skeleton } from 'antd';
|
|
19
13
|
import _ from 'lodash';
|
|
20
14
|
import BizGlobalDataContext from '../context';
|
|
21
|
-
import { BuiltinIndicators } from '../constants/common';
|
|
22
15
|
export var classPrefix = 'biz-target';
|
|
23
16
|
var BizTargetCondition = function BizTargetCondition(props) {
|
|
24
|
-
var _targetData$value2, _targetData$value2$
|
|
17
|
+
var _targetData$value2, _targetData$value2$ev, _targetData$value3, _targetData$value3$ev, _targetData$value4, _targetData$value4$ev, _targetData$value5, _targetData$value5$ev;
|
|
25
18
|
var max = props.max;
|
|
26
19
|
var _useState = useState(),
|
|
27
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -76,14 +69,14 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
76
69
|
}, []);
|
|
77
70
|
useEffect(function () {
|
|
78
71
|
if (targetData === null || targetData === void 0 ? void 0 : targetData.value) {
|
|
79
|
-
var _targetData$value$eve
|
|
72
|
+
var _targetData$value$eve;
|
|
80
73
|
var canAdd = true,
|
|
81
74
|
canDelete = true;
|
|
82
|
-
if (((_targetData$value$eve = targetData.value.event) === null || _targetData$value$eve === void 0 ? void 0 : _targetData$value$eve.id) === -100
|
|
83
|
-
var _targetData$value$gro
|
|
75
|
+
if (((_targetData$value$eve = targetData.value.event) === null || _targetData$value$eve === void 0 ? void 0 : _targetData$value$eve.id) === -100) {
|
|
76
|
+
var _targetData$value$gro;
|
|
84
77
|
canAdd = false;
|
|
85
78
|
setFilters(undefined);
|
|
86
|
-
if (!((_targetData$value$gro = targetData.value.group) === null || _targetData$value$gro === void 0 ? void 0 : _targetData$value$gro.id)
|
|
79
|
+
if (!((_targetData$value$gro = targetData.value.group) === null || _targetData$value$gro === void 0 ? void 0 : _targetData$value$gro.id)) {
|
|
87
80
|
canDelete = false;
|
|
88
81
|
}
|
|
89
82
|
} else {
|
|
@@ -116,55 +109,37 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
116
109
|
eventList: []
|
|
117
110
|
};
|
|
118
111
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
eventList: []
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
BuiltinIndicators.eventList.forEach(function (item) {
|
|
129
|
-
if (item.id === data.eventId) {
|
|
130
|
-
target.value.event = _objectSpread({}, item);
|
|
131
|
-
hasEvent = true;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
112
|
+
if (data.eventId === -100) {
|
|
113
|
+
target.value.event = {
|
|
114
|
+
id: -100,
|
|
115
|
+
name: '事件概览',
|
|
116
|
+
attrList: []
|
|
117
|
+
};
|
|
134
118
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
for (var i = 0; i < eventGroupList.length; i++) {
|
|
144
|
-
var group = eventGroupList[i];
|
|
145
|
-
if (data.eventId !== -100) {
|
|
146
|
-
for (var j = 0; j < group.eventList.length; j++) {
|
|
147
|
-
var event = group.eventList[j];
|
|
148
|
-
if (event.id === data.eventId) {
|
|
149
|
-
target.value.event = event;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
119
|
+
for (var i = 0; i < eventGroupList.length; i++) {
|
|
120
|
+
var group = eventGroupList[i];
|
|
121
|
+
if (data.eventId !== -100) {
|
|
122
|
+
for (var j = 0; j < group.eventList.length; j++) {
|
|
123
|
+
var event = group.eventList[j];
|
|
124
|
+
if (event.id === data.eventId) {
|
|
125
|
+
target.value.event = event;
|
|
126
|
+
break;
|
|
152
127
|
}
|
|
153
128
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
129
|
+
}
|
|
130
|
+
if (data.eventGroupId && data.eventGroupId === group.id) {
|
|
131
|
+
target.value.group = group;
|
|
132
|
+
break;
|
|
158
133
|
}
|
|
159
134
|
}
|
|
160
135
|
}
|
|
161
136
|
return target;
|
|
162
137
|
};
|
|
163
138
|
var onChangeTarget = function onChangeTarget(target) {
|
|
164
|
-
var _target$value, _target$value$event, _targetData$value, _targetData$value$
|
|
139
|
+
var _target$value, _target$value$event, _targetData$value, _targetData$value$eve2;
|
|
165
140
|
setTargetData(target);
|
|
166
141
|
var filterData = _.cloneDeep(filters);
|
|
167
|
-
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$
|
|
142
|
+
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)) {
|
|
168
143
|
filterData = undefined;
|
|
169
144
|
setFilters(undefined);
|
|
170
145
|
setIsAdd(false);
|
|
@@ -188,25 +163,19 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
188
163
|
setFilters(data);
|
|
189
164
|
onChange(dimension, targetData, data);
|
|
190
165
|
};
|
|
191
|
-
var onChange = function onChange(analysisDimension, target,
|
|
166
|
+
var onChange = function onChange(analysisDimension, target, filterDatas) {
|
|
192
167
|
if (props.onChange) {
|
|
193
|
-
var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$
|
|
168
|
+
var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$group;
|
|
194
169
|
if (!target || !target.value || !((_target$value$event2 = target.value.event) === null || _target$value$event2 === void 0 ? void 0 : _target$value$event2.id)) return;
|
|
195
|
-
var type = target.value.event.type;
|
|
196
|
-
if (!type) {
|
|
197
|
-
var _target$value$group;
|
|
198
|
-
type = ((_target$value$group = target.value.group) === null || _target$value$group === void 0 ? void 0 : _target$value$group.id) === -2 ? 'whole' : 'event';
|
|
199
|
-
}
|
|
200
170
|
var data = {
|
|
201
|
-
type:
|
|
171
|
+
type: 'event',
|
|
202
172
|
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) || '',
|
|
203
173
|
eventId: (_target$value$event4 = target.value.event) === null || _target$value$event4 === void 0 ? void 0 : _target$value$event4.id,
|
|
204
174
|
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),
|
|
205
|
-
eventGroupId: (_target$value$
|
|
175
|
+
eventGroupId: (_target$value$group = target.value.group) === null || _target$value$group === void 0 ? void 0 : _target$value$group.id,
|
|
206
176
|
analysisDimension: analysisDimension,
|
|
207
|
-
filters:
|
|
208
|
-
marked: target.value.event.marked
|
|
209
|
-
isBuiltIn: target.value.event.isBuiltIn
|
|
177
|
+
filters: filterDatas,
|
|
178
|
+
marked: target.value.event.marked
|
|
210
179
|
};
|
|
211
180
|
props.onChange(data);
|
|
212
181
|
}
|
|
@@ -237,8 +206,8 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
237
206
|
onAdd: onAdd,
|
|
238
207
|
onDelete: onDelete,
|
|
239
208
|
onChange: onChangeTarget
|
|
240
|
-
}, props.children),
|
|
241
|
-
eventId: (targetData === null || targetData === void 0 ? void 0 : (_targetData$
|
|
209
|
+
}, props.children), /*#__PURE__*/React.createElement(BizTargetDimension, {
|
|
210
|
+
eventId: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value2 = targetData.value) === null || _targetData$value2 === void 0 ? void 0 : (_targetData$value2$ev = _targetData$value2.event) === null || _targetData$value2$ev === void 0 ? void 0 : _targetData$value2$ev.id) ? targetData === null || targetData === void 0 ? void 0 : (_targetData$value3 = targetData.value) === null || _targetData$value3 === void 0 ? void 0 : (_targetData$value3$ev = _targetData$value3.event) === null || _targetData$value3$ev === void 0 ? void 0 : _targetData$value3$ev.id : undefined,
|
|
242
211
|
value: dimension,
|
|
243
212
|
onChange: onChangeDimension
|
|
244
213
|
})), (filters || isAdd) && /*#__PURE__*/React.createElement(BizConditionGroup, {
|
|
@@ -247,7 +216,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
|
|
|
247
216
|
onlyAnd: props.onlyAnd,
|
|
248
217
|
enableEventProp: true,
|
|
249
218
|
enableDelete: true,
|
|
250
|
-
eventIdList: (targetData === null || targetData === void 0 ? void 0 : (_targetData$
|
|
219
|
+
eventIdList: (targetData === null || targetData === void 0 ? void 0 : (_targetData$value4 = targetData.value) === null || _targetData$value4 === void 0 ? void 0 : (_targetData$value4$ev = _targetData$value4.event) === null || _targetData$value4$ev === void 0 ? void 0 : _targetData$value4$ev.id) ? [targetData === null || targetData === void 0 ? void 0 : (_targetData$value5 = targetData.value) === null || _targetData$value5 === void 0 ? void 0 : (_targetData$value5$ev = _targetData$value5.event) === null || _targetData$value5$ev === void 0 ? void 0 : _targetData$value5$ev.id] : undefined,
|
|
251
220
|
onChange: onChangeFilters,
|
|
252
221
|
onConditionsCount: setCount
|
|
253
222
|
})));
|