@zgfe/business-lib 1.1.34-alpha.4 → 1.1.34-alpha.6
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.
|
@@ -26,6 +26,7 @@ import IconFont from '../../icon/iconFont';
|
|
|
26
26
|
import BizGlobalDataContext from '../../context';
|
|
27
27
|
var RangePicker = DatePicker.RangePicker;
|
|
28
28
|
var BusinessCondition = function BusinessCondition(props) {
|
|
29
|
+
var _condition$timeDimens, _condition$timeDimens3, _condition$timeDimens4, _condition$attrs;
|
|
29
30
|
var condition = props.condition,
|
|
30
31
|
dataId = props.dataId,
|
|
31
32
|
isEvent = props.isEvent,
|
|
@@ -41,7 +42,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
41
42
|
}
|
|
42
43
|
}, []);
|
|
43
44
|
var items = [];
|
|
44
|
-
if (condition.timeDimensions.length < 3) {
|
|
45
|
+
if (((_condition$timeDimens = condition.timeDimensions) === null || _condition$timeDimens === void 0 ? void 0 : _condition$timeDimens.length) < 3) {
|
|
45
46
|
items = items.concat([{
|
|
46
47
|
label: '时间维度',
|
|
47
48
|
key: 'time dimension'
|
|
@@ -121,13 +122,13 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
121
122
|
newData.values = [startDate, endDate];
|
|
122
123
|
}
|
|
123
124
|
if (newData.operator === 'relative') {
|
|
124
|
-
newData.values = [
|
|
125
|
+
newData.values = [30, '0'];
|
|
125
126
|
}
|
|
126
127
|
if (newData.operator === 'unlimited_time') {
|
|
127
|
-
newData.values = [
|
|
128
|
+
newData.values = [30, '0'];
|
|
128
129
|
}
|
|
129
130
|
if (newData.operator === 'join_time') {
|
|
130
|
-
newData.values = [
|
|
131
|
+
newData.values = [3, '0'];
|
|
131
132
|
}
|
|
132
133
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
133
134
|
runPeriod: newData
|
|
@@ -148,7 +149,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
148
149
|
var newValue = newData.target.value;
|
|
149
150
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
150
151
|
runPeriod: _objectSpread(_objectSpread({}, condition.runPeriod), {}, {
|
|
151
|
-
values: [newValue, '0']
|
|
152
|
+
values: [Number(newValue), '0']
|
|
152
153
|
})
|
|
153
154
|
}));
|
|
154
155
|
}
|
|
@@ -182,7 +183,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
var onOperateChange = function onOperateChange(operate) {
|
|
185
|
-
condition.runTimes.values = [condition.runTimes.values[0]];
|
|
186
|
+
condition.runTimes.values = [Number(condition.runTimes.values[0])];
|
|
186
187
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
187
188
|
runTimes: _objectSpread(_objectSpread({}, condition.runTimes), {}, {
|
|
188
189
|
operator: operate.value
|
|
@@ -191,7 +192,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
191
192
|
};
|
|
192
193
|
var onOperateInput0Change = function onOperateInput0Change(value) {
|
|
193
194
|
var newValue = value.target.value;
|
|
194
|
-
condition.runTimes.values[0] = newValue;
|
|
195
|
+
condition.runTimes.values[0] = Number(newValue);
|
|
195
196
|
onChange(_objectSpread({}, condition));
|
|
196
197
|
};
|
|
197
198
|
var onOperateInput1Change = function onOperateInput1Change(value) {
|
|
@@ -209,14 +210,15 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
209
210
|
setDataAttributeLabel((_labelProps$ = labelProps[0]) === null || _labelProps$ === void 0 ? void 0 : _labelProps$.label);
|
|
210
211
|
}
|
|
211
212
|
if (key === 'time dimension') {
|
|
213
|
+
var _condition$timeDimens2;
|
|
212
214
|
var obj = {
|
|
213
|
-
frequencyValues: [
|
|
215
|
+
frequencyValues: [1],
|
|
214
216
|
frequencyOperator: '>',
|
|
215
217
|
timeDimension: 1,
|
|
216
218
|
timeOperator: 'all',
|
|
217
219
|
timeValues: []
|
|
218
220
|
};
|
|
219
|
-
if (condition.timeDimensions.length !== 3) {
|
|
221
|
+
if (((_condition$timeDimens2 = condition.timeDimensions) === null || _condition$timeDimens2 === void 0 ? void 0 : _condition$timeDimens2.length) !== 3) {
|
|
220
222
|
condition.timeDimensions.push(obj);
|
|
221
223
|
} else {
|
|
222
224
|
notification.info({
|
|
@@ -345,7 +347,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
345
347
|
placeholder: condition.runTimes.operator !== 'between' ? '请输入' : '输入最大值',
|
|
346
348
|
onChange: onOperateInput1Change,
|
|
347
349
|
suffix: condition.runTimes.operator !== 'between' ? '次' : null
|
|
348
|
-
})) : null), condition.timeDimensions.map(function (_item, index) {
|
|
350
|
+
})) : null), (_condition$timeDimens3 = condition.timeDimensions) === null || _condition$timeDimens3 === void 0 ? void 0 : _condition$timeDimens3.map(function (_item, index) {
|
|
349
351
|
return /*#__PURE__*/React.createElement("div", {
|
|
350
352
|
style: {
|
|
351
353
|
margin: '10px 0 0 65px'
|
|
@@ -398,7 +400,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
398
400
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
399
401
|
type: "qingchu"
|
|
400
402
|
}))));
|
|
401
|
-
}), condition.typeId && label === '业务数据' || label === '订单数据' ? /*#__PURE__*/React.createElement("div", null, condition.timeDimensions.length !== 3 || condition.attrs.length !== 6 ? /*#__PURE__*/React.createElement("div", {
|
|
403
|
+
}), condition.typeId && label === '业务数据' || label === '订单数据' ? /*#__PURE__*/React.createElement("div", null, ((_condition$timeDimens4 = condition.timeDimensions) === null || _condition$timeDimens4 === void 0 ? void 0 : _condition$timeDimens4.length) !== 3 || ((_condition$attrs = condition.attrs) === null || _condition$attrs === void 0 ? void 0 : _condition$attrs.length) !== 6 ? /*#__PURE__*/React.createElement("div", {
|
|
402
404
|
style: {
|
|
403
405
|
margin: '2px 0 0 65px',
|
|
404
406
|
color: '#4075fd',
|
|
@@ -17,6 +17,7 @@ import TimeDimension from './timeDimension';
|
|
|
17
17
|
import { Tooltip } from 'antd';
|
|
18
18
|
import IconFont from '../../icon/iconFont';
|
|
19
19
|
var EventCondition = function EventCondition(props) {
|
|
20
|
+
var _condition$timeDimens2, _condition$timeDimens3;
|
|
20
21
|
var _useContext = useContext(BizUserConditionContext),
|
|
21
22
|
isRealTime = _useContext.isRealTime;
|
|
22
23
|
var condition = props.condition,
|
|
@@ -56,6 +57,7 @@ var EventCondition = function EventCondition(props) {
|
|
|
56
57
|
var onClick = function onClick(_ref) {
|
|
57
58
|
var key = _ref.key;
|
|
58
59
|
if (key === 'time dimension') {
|
|
60
|
+
var _condition$timeDimens;
|
|
59
61
|
var obj = {
|
|
60
62
|
frequencyValues: ['1'],
|
|
61
63
|
frequencyOperator: '>',
|
|
@@ -63,7 +65,7 @@ var EventCondition = function EventCondition(props) {
|
|
|
63
65
|
timeOperator: 'all',
|
|
64
66
|
timeValues: []
|
|
65
67
|
};
|
|
66
|
-
if (condition.timeDimensions.length < 3) {
|
|
68
|
+
if (((_condition$timeDimens = condition.timeDimensions) === null || _condition$timeDimens === void 0 ? void 0 : _condition$timeDimens.length) < 3) {
|
|
67
69
|
condition.timeDimensions.push(obj);
|
|
68
70
|
} else {
|
|
69
71
|
notification.info({
|
|
@@ -138,7 +140,7 @@ var EventCondition = function EventCondition(props) {
|
|
|
138
140
|
onChange: onPeriodChange,
|
|
139
141
|
isEvent: true,
|
|
140
142
|
isRealTime: isRealTime
|
|
141
|
-
}))))), condition.timeDimensions.map(function (_item, index) {
|
|
143
|
+
}))))), (_condition$timeDimens2 = condition.timeDimensions) === null || _condition$timeDimens2 === void 0 ? void 0 : _condition$timeDimens2.map(function (_item, index) {
|
|
142
144
|
return /*#__PURE__*/React.createElement("div", {
|
|
143
145
|
style: {
|
|
144
146
|
margin: '10px 0 0 38px'
|
|
@@ -164,7 +166,7 @@ var EventCondition = function EventCondition(props) {
|
|
|
164
166
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
165
167
|
type: "qingchu"
|
|
166
168
|
}))));
|
|
167
|
-
}), condition.timeDimensions.length < 3 ? /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
}), ((_condition$timeDimens3 = condition.timeDimensions) === null || _condition$timeDimens3 === void 0 ? void 0 : _condition$timeDimens3.length) < 3 ? /*#__PURE__*/React.createElement("div", {
|
|
168
170
|
style: {
|
|
169
171
|
margin: '2px 0 0 38px',
|
|
170
172
|
color: '#4075fd',
|
|
@@ -58,10 +58,10 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
58
58
|
var showTag = openTagCondition && (!menuNameMap || menuNameMap['userTags']);
|
|
59
59
|
var showCdp = openCdpCondition && (!menuNameMap || menuNameMap['dataset']);
|
|
60
60
|
var flag = false;
|
|
61
|
-
defaultValue.forEach(function (item) {
|
|
61
|
+
defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.forEach(function (item) {
|
|
62
62
|
var showItem = _toConsumableArray(item);
|
|
63
63
|
if (!(showTag && showCdp)) {
|
|
64
|
-
item.forEach(function (data, index) {
|
|
64
|
+
item === null || item === void 0 ? void 0 : item.forEach(function (data, index) {
|
|
65
65
|
if (data.dataset && !showCdp || data.labels && !showTag) {
|
|
66
66
|
showItem.splice(index, 1);
|
|
67
67
|
flag = true;
|
|
@@ -7,10 +7,18 @@ export interface RunPeriodI {
|
|
|
7
7
|
operator: 'relative' | 'unlimited_time' | 'join_time' | 'absolute';
|
|
8
8
|
values: string[];
|
|
9
9
|
}
|
|
10
|
+
export interface RunPeriodII {
|
|
11
|
+
operator: 'relative' | 'unlimited_time' | 'join_time' | 'absolute';
|
|
12
|
+
values: any[];
|
|
13
|
+
}
|
|
10
14
|
export interface RunTimesI {
|
|
11
15
|
operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal' | 'between';
|
|
12
16
|
values: string[];
|
|
13
17
|
}
|
|
18
|
+
export interface RunTimesII {
|
|
19
|
+
operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal' | 'between';
|
|
20
|
+
values: any[];
|
|
21
|
+
}
|
|
14
22
|
export interface AllConditionBasePropsI<T> {
|
|
15
23
|
dataId: number;
|
|
16
24
|
onChange: (dataId: number, newData: T) => void;
|
|
@@ -85,7 +93,7 @@ export declare namespace BizUserConditionT {
|
|
|
85
93
|
timeOperator: string;
|
|
86
94
|
timeValues: number[];
|
|
87
95
|
frequencyOperator: string;
|
|
88
|
-
frequencyValues:
|
|
96
|
+
frequencyValues: any[];
|
|
89
97
|
}
|
|
90
98
|
interface EventCondition {
|
|
91
99
|
attrs: AttrCondition[];
|
|
@@ -104,15 +112,15 @@ export declare namespace BizUserConditionT {
|
|
|
104
112
|
typeId: undefined;
|
|
105
113
|
attrs: AttrsCondition[];
|
|
106
114
|
timeDimensions: TimeDimensionsCondition[];
|
|
107
|
-
runTimes:
|
|
108
|
-
runPeriod:
|
|
115
|
+
runTimes: RunTimesII;
|
|
116
|
+
runPeriod: RunPeriodII;
|
|
109
117
|
eventId: -14;
|
|
110
118
|
}
|
|
111
119
|
interface OrderCondition {
|
|
112
120
|
attrs: AttrsCondition[];
|
|
113
121
|
timeDimensions: TimeDimensionsCondition[];
|
|
114
|
-
runTimes:
|
|
115
|
-
runPeriod:
|
|
122
|
+
runTimes: RunTimesII;
|
|
123
|
+
runPeriod: RunPeriodII;
|
|
116
124
|
eventId: -13;
|
|
117
125
|
}
|
|
118
126
|
interface ActiveCondition {
|
package/es/userCondition/util.js
CHANGED
|
@@ -73,13 +73,13 @@ export function buildCondition(type) {
|
|
|
73
73
|
typeId: undefined,
|
|
74
74
|
runTimes: {
|
|
75
75
|
operator: '>=',
|
|
76
|
-
values: [
|
|
76
|
+
values: [1]
|
|
77
77
|
},
|
|
78
78
|
attrs: [],
|
|
79
79
|
timeDimensions: [],
|
|
80
80
|
runPeriod: {
|
|
81
81
|
operator: 'relative',
|
|
82
|
-
values: [
|
|
82
|
+
values: [30, '0']
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
case 'order':
|
|
@@ -87,13 +87,13 @@ export function buildCondition(type) {
|
|
|
87
87
|
eventId: -13,
|
|
88
88
|
runTimes: {
|
|
89
89
|
operator: '>=',
|
|
90
|
-
values: [
|
|
90
|
+
values: [1]
|
|
91
91
|
},
|
|
92
92
|
attrs: [],
|
|
93
93
|
timeDimensions: [],
|
|
94
94
|
runPeriod: {
|
|
95
95
|
operator: 'relative',
|
|
96
|
-
values: [
|
|
96
|
+
values: [30, '0']
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
}
|