@zgfe/business-lib 1.1.34-alpha.0 → 1.1.34-alpha.10
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/context/index.d.ts +2 -0
- package/es/userCondition/conditionTypeList.js +6 -4
- package/es/userCondition/conditions/businessCondition.js +24 -15
- package/es/userCondition/conditions/dataAttribute.js +62 -96
- package/es/userCondition/conditions/eventCondition.js +5 -3
- package/es/userCondition/conditions/textDesc.d.ts +1 -1
- package/es/userCondition/conditions/textDesc.js +161 -2
- package/es/userCondition/index.js +2 -2
- package/es/userCondition/orConditions.js +4 -0
- package/es/userCondition/types.d.ts +24 -7
- package/es/userCondition/util.js +16 -4
- package/package.json +1 -1
package/es/context/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface UserInfo {
|
|
|
10
10
|
username: string;
|
|
11
11
|
email: string;
|
|
12
12
|
companyId: number;
|
|
13
|
+
serviceType: number;
|
|
13
14
|
companyName: string;
|
|
14
15
|
}
|
|
15
16
|
export interface Menu {
|
|
@@ -36,6 +37,7 @@ export interface GlobalContextProps {
|
|
|
36
37
|
router?: any;
|
|
37
38
|
routes?: any;
|
|
38
39
|
envs?: Record<string, any>;
|
|
40
|
+
system?: string;
|
|
39
41
|
}
|
|
40
42
|
declare const BizGlobalDataContext: import("react").Context<GlobalContextProps>;
|
|
41
43
|
export default BizGlobalDataContext;
|
|
@@ -15,7 +15,9 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
15
15
|
openCdpCondition = _useContext.openCdpCondition,
|
|
16
16
|
cdpTip = _useContext.cdpTip;
|
|
17
17
|
var _useContext2 = useContext(BizGlobalDataContext),
|
|
18
|
-
menuNameMap = _useContext2.menuNameMap
|
|
18
|
+
menuNameMap = _useContext2.menuNameMap,
|
|
19
|
+
currentUser = _useContext2.currentUser;
|
|
20
|
+
console.log(666636, menuNameMap, useContext(BizGlobalDataContext));
|
|
19
21
|
if (!show || textMode) return null;
|
|
20
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
23
|
className: "biz-user-condition-type-list"
|
|
@@ -69,7 +71,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
69
71
|
title: cdpTip
|
|
70
72
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
71
73
|
type: "tishiicon"
|
|
72
|
-
})) : null)) : null, /*#__PURE__*/React.createElement("li", {
|
|
74
|
+
})) : null)) : null, !currentUser || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
|
|
73
75
|
className: "condition-type",
|
|
74
76
|
key: "business",
|
|
75
77
|
onClick: function onClick() {
|
|
@@ -77,7 +79,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
77
79
|
}
|
|
78
80
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
79
81
|
key: "business"
|
|
80
|
-
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))), /*#__PURE__*/React.createElement("li", {
|
|
82
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))) : null, !currentUser || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
|
|
81
83
|
className: "condition-type",
|
|
82
84
|
key: "order",
|
|
83
85
|
onClick: function onClick() {
|
|
@@ -85,7 +87,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
85
87
|
}
|
|
86
88
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
87
89
|
key: "order"
|
|
88
|
-
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u8BA2\u5355\u6570\u636E")))));
|
|
90
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u8BA2\u5355\u6570\u636E"))) : null));
|
|
89
91
|
};
|
|
90
92
|
ConditionTypeList.defaultProps = {
|
|
91
93
|
show: true
|
|
@@ -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'
|
|
@@ -58,7 +59,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
58
59
|
key: 'service attribute'
|
|
59
60
|
}]);
|
|
60
61
|
}
|
|
61
|
-
var _useState = useState(),
|
|
62
|
+
var _useState = useState(condition.typeId ? '业务属性' : '订单属性'),
|
|
62
63
|
_useState2 = _slicedToArray(_useState, 2),
|
|
63
64
|
dataAttributeLabel = _useState2[0],
|
|
64
65
|
setDataAttributeLabel = _useState2[1];
|
|
@@ -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({
|
|
@@ -228,8 +230,8 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
228
230
|
attrId: 0,
|
|
229
231
|
attrName: '',
|
|
230
232
|
operator: '',
|
|
231
|
-
params: [
|
|
232
|
-
computeType: '
|
|
233
|
+
params: [],
|
|
234
|
+
computeType: '',
|
|
233
235
|
attrType: '',
|
|
234
236
|
category: ''
|
|
235
237
|
};
|
|
@@ -258,6 +260,9 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
258
260
|
onChange(_objectSpread({}, condition));
|
|
259
261
|
}
|
|
260
262
|
function onServiceAttributeChange(operate) {
|
|
263
|
+
condition.typeId = operate === null || operate === void 0 ? void 0 : operate.value;
|
|
264
|
+
condition.typeName = operate === null || operate === void 0 ? void 0 : operate.name;
|
|
265
|
+
onChange(_objectSpread({}, condition));
|
|
261
266
|
setServiceAttribute(operate);
|
|
262
267
|
}
|
|
263
268
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -269,6 +274,10 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
269
274
|
options: serviceAttributeList,
|
|
270
275
|
labelField: "name",
|
|
271
276
|
keyField: "value",
|
|
277
|
+
value: {
|
|
278
|
+
name: condition.typeId,
|
|
279
|
+
value: condition.typeId
|
|
280
|
+
},
|
|
272
281
|
overlayWidth: 120,
|
|
273
282
|
onChange: onServiceAttributeChange
|
|
274
283
|
})) : null, label === '订单数据' ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -339,7 +348,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
339
348
|
placeholder: condition.runTimes.operator !== 'between' ? '请输入' : '输入最大值',
|
|
340
349
|
onChange: onOperateInput1Change,
|
|
341
350
|
suffix: condition.runTimes.operator !== 'between' ? '次' : null
|
|
342
|
-
})) : null), condition.timeDimensions.map(function (_item, index) {
|
|
351
|
+
})) : null), (_condition$timeDimens3 = condition.timeDimensions) === null || _condition$timeDimens3 === void 0 ? void 0 : _condition$timeDimens3.map(function (_item, index) {
|
|
343
352
|
return /*#__PURE__*/React.createElement("div", {
|
|
344
353
|
style: {
|
|
345
354
|
margin: '10px 0 0 65px'
|
|
@@ -392,7 +401,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
392
401
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
393
402
|
type: "qingchu"
|
|
394
403
|
}))));
|
|
395
|
-
}), condition.timeDimensions.length !== 3 || condition.attrs.length !== 6 ? /*#__PURE__*/React.createElement("div", {
|
|
404
|
+
}), 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", {
|
|
396
405
|
style: {
|
|
397
406
|
margin: '2px 0 0 65px',
|
|
398
407
|
color: '#4075fd',
|
|
@@ -407,7 +416,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
407
416
|
onClick: function onClick(e) {
|
|
408
417
|
return e.preventDefault();
|
|
409
418
|
}
|
|
410
|
-
}, /*#__PURE__*/React.createElement(Space, null, "\u9AD8\u7EA7\u7B5B\u9009", /*#__PURE__*/React.createElement(DownOutlined, null))))) : null);
|
|
419
|
+
}, /*#__PURE__*/React.createElement(Space, null, "\u9AD8\u7EA7\u7B5B\u9009", /*#__PURE__*/React.createElement(DownOutlined, null))))) : null) : null);
|
|
411
420
|
};
|
|
412
421
|
BusinessCondition.defaultProps = {
|
|
413
422
|
isEvent: false,
|
|
@@ -21,9 +21,9 @@ import BizGlobalDataContext from '../../context';
|
|
|
21
21
|
import { DatePicker, Input } from 'antd';
|
|
22
22
|
var RangePicker = DatePicker.RangePicker;
|
|
23
23
|
var DataAttribute = function DataAttribute(props) {
|
|
24
|
+
var _condition$attrs$inde, _condition$paramsList, _condition$paramsList2, _condition$paramsList3;
|
|
24
25
|
var condition = props.condition,
|
|
25
26
|
index = props.index,
|
|
26
|
-
serviceAttrType = props.serviceAttrType,
|
|
27
27
|
onChange = props.onChange;
|
|
28
28
|
var list = [];
|
|
29
29
|
var operateList = [];
|
|
@@ -38,9 +38,10 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
38
38
|
break;
|
|
39
39
|
default:
|
|
40
40
|
list = typeList['cont-date'];
|
|
41
|
+
operateList = typeList['cont-date'];
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
|
-
var _useState = useState((
|
|
44
|
+
var _useState = useState((condition === null || condition === void 0 ? void 0 : condition.typeId) ? list : []),
|
|
44
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
46
|
masterList = _useState2[0],
|
|
46
47
|
setMasterList = _useState2[1];
|
|
@@ -60,22 +61,26 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
60
61
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
61
62
|
searchValue = _useState10[0],
|
|
62
63
|
setSearchValue = _useState10[1];
|
|
63
|
-
var
|
|
64
|
+
var obj = (_condition$attrs$inde = condition.attrs[index]) === null || _condition$attrs$inde === void 0 ? void 0 : _condition$attrs$inde.params.map(function (item) {
|
|
65
|
+
return {
|
|
66
|
+
name: item,
|
|
67
|
+
value: item
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
var _useState11 = useState(obj ? obj : []),
|
|
64
71
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
65
72
|
current = _useState12[0],
|
|
66
73
|
setCurrent = _useState12[1];
|
|
67
74
|
var _useContext = useContext(BizGlobalDataContext),
|
|
68
75
|
currentApp = _useContext.currentApp;
|
|
76
|
+
useEffect(function () {}, [searchValue]);
|
|
69
77
|
useEffect(function () {
|
|
70
|
-
if (
|
|
71
|
-
queryBizDataAttrList(
|
|
78
|
+
if (condition === null || condition === void 0 ? void 0 : condition.typeId) {
|
|
79
|
+
queryBizDataAttrList(condition === null || condition === void 0 ? void 0 : condition.typeId);
|
|
72
80
|
} else {
|
|
73
81
|
setBizDataAttrList(orderTypeList);
|
|
74
82
|
}
|
|
75
|
-
|
|
76
|
-
console.log(66666, searchValue);
|
|
77
|
-
}
|
|
78
|
-
}, [searchValue]);
|
|
83
|
+
}, [condition === null || condition === void 0 ? void 0 : condition.typeId]);
|
|
79
84
|
function queryAppList(type) {
|
|
80
85
|
request(type === 'master' ? '/cep-console/api/v1/cdp/orderAttribute/master' : '/cep-console/api/v1/cdp/orderAttribute/son', {
|
|
81
86
|
headers: {
|
|
@@ -97,75 +102,16 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
97
102
|
});
|
|
98
103
|
});
|
|
99
104
|
setMasterList(_list);
|
|
105
|
+
condition.paramsList[index].masterList = _list;
|
|
100
106
|
} else {
|
|
107
|
+
condition.paramsList[index].masterList = [];
|
|
101
108
|
setMasterList([]);
|
|
102
109
|
}
|
|
103
110
|
}).catch(function () {
|
|
104
|
-
setMasterList([
|
|
105
|
-
|
|
106
|
-
value: 81,
|
|
107
|
-
appId: 99677,
|
|
108
|
-
name: '手机号',
|
|
109
|
-
propType: 1,
|
|
110
|
-
required: 0,
|
|
111
|
-
isOrderShow: 1,
|
|
112
|
-
isUserShow: 1,
|
|
113
|
-
columnName: 'cus4',
|
|
114
|
-
isDelete: null,
|
|
115
|
-
isUniqueOrder: '',
|
|
116
|
-
isUniqueUser: '',
|
|
117
|
-
isUniqueCreatedate: '',
|
|
118
|
-
isUniquePaydate: '',
|
|
119
|
-
orderRelationSon: '',
|
|
120
|
-
createDate: 1678431608000,
|
|
121
|
-
updateDateTime: null,
|
|
122
|
-
hidden: null,
|
|
123
|
-
attrOrder: 5,
|
|
124
|
-
requestHide: null
|
|
125
|
-
}, {
|
|
126
|
-
id: 82,
|
|
127
|
-
value: 82,
|
|
128
|
-
appId: 99677,
|
|
129
|
-
name: 'ID',
|
|
130
|
-
propType: 2,
|
|
131
|
-
required: 1,
|
|
132
|
-
isOrderShow: 1,
|
|
133
|
-
isUserShow: 1,
|
|
134
|
-
columnName: 'cus5',
|
|
135
|
-
isDelete: null,
|
|
136
|
-
isUniqueOrder: '',
|
|
137
|
-
isUniqueUser: '',
|
|
138
|
-
isUniqueCreatedate: 'Y',
|
|
139
|
-
isUniquePaydate: '',
|
|
140
|
-
orderRelationSon: '',
|
|
141
|
-
createDate: 1678431608000,
|
|
142
|
-
updateDateTime: 1678433665000,
|
|
143
|
-
hidden: null,
|
|
144
|
-
attrOrder: 6,
|
|
145
|
-
requestHide: null
|
|
146
|
-
}, {
|
|
147
|
-
id: 83,
|
|
148
|
-
value: 83,
|
|
149
|
-
appId: 99677,
|
|
150
|
-
name: '订单支付时间',
|
|
151
|
-
propType: 3,
|
|
152
|
-
required: 1,
|
|
153
|
-
isOrderShow: 1,
|
|
154
|
-
isUserShow: 1,
|
|
155
|
-
columnName: 'cus6',
|
|
156
|
-
isDelete: null,
|
|
157
|
-
isUniqueOrder: '',
|
|
158
|
-
isUniqueUser: '',
|
|
159
|
-
isUniqueCreatedate: '',
|
|
160
|
-
isUniquePaydate: 'Y',
|
|
161
|
-
orderRelationSon: '',
|
|
162
|
-
createDate: 1678431608000,
|
|
163
|
-
updateDateTime: 1678433668000,
|
|
164
|
-
hidden: null,
|
|
165
|
-
attrOrder: 7,
|
|
166
|
-
requestHide: null
|
|
167
|
-
}]);
|
|
111
|
+
setMasterList([]);
|
|
112
|
+
condition.paramsList[index].masterList = [];
|
|
168
113
|
});
|
|
114
|
+
onChange(_objectSpread({}, condition));
|
|
169
115
|
}
|
|
170
116
|
function queryValueList(keyword, operate) {
|
|
171
117
|
request('/cep-console/api/v1/es/data/attr/value', {
|
|
@@ -191,13 +137,17 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
191
137
|
value: operate.bizDataTypeId ? item : item.id
|
|
192
138
|
};
|
|
193
139
|
});
|
|
140
|
+
condition.paramsList[index].paramsList = _list2;
|
|
194
141
|
setParamsList(_list2);
|
|
195
142
|
} else {
|
|
196
143
|
setParamsList([]);
|
|
144
|
+
condition.paramsList[index].paramsList = [];
|
|
197
145
|
}
|
|
198
146
|
}).catch(function () {
|
|
199
147
|
setParamsList([]);
|
|
148
|
+
condition.paramsList[index].paramsList = [];
|
|
200
149
|
});
|
|
150
|
+
onChange(_objectSpread({}, condition));
|
|
201
151
|
}
|
|
202
152
|
function queryBizDataAttrList(bizDataTypeId) {
|
|
203
153
|
request('/cep-console/api/v1/bizdata/attr/list', {
|
|
@@ -215,20 +165,23 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
215
165
|
value: item.id
|
|
216
166
|
});
|
|
217
167
|
});
|
|
168
|
+
condition.paramsList[index].bizDataAttrList = _list3;
|
|
218
169
|
setBizDataAttrList(_list3);
|
|
219
170
|
} else {
|
|
171
|
+
condition.paramsList[index].bizDataAttrList = [];
|
|
220
172
|
setBizDataAttrList([]);
|
|
221
173
|
}
|
|
222
174
|
}).catch(function () {
|
|
175
|
+
condition.paramsList[index].bizDataAttrList = [];
|
|
223
176
|
setBizDataAttrList([]);
|
|
224
177
|
});
|
|
178
|
+
onChange(_objectSpread({}, condition));
|
|
225
179
|
}
|
|
226
180
|
var onOrderTypeListChange = function onOrderTypeListChange(operate) {
|
|
227
|
-
if (
|
|
181
|
+
if (condition === null || condition === void 0 ? void 0 : condition.typeId) {
|
|
228
182
|
condition.attrs[index].category = 'custom';
|
|
229
183
|
condition.attrs[index].attrId = operate.id;
|
|
230
184
|
condition.attrs[index].attrName = operate.name;
|
|
231
|
-
condition.typeId = operate === null || operate === void 0 ? void 0 : operate.bizDataTypeId;
|
|
232
185
|
switch (operate.propType) {
|
|
233
186
|
case 1:
|
|
234
187
|
setMasterList(typeList['cont-string']);
|
|
@@ -253,7 +206,7 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
253
206
|
onChange(_objectSpread({}, condition));
|
|
254
207
|
};
|
|
255
208
|
var onMasterListChange = function onMasterListChange(operate) {
|
|
256
|
-
if (!(
|
|
209
|
+
if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
|
|
257
210
|
switch (operate.propType) {
|
|
258
211
|
case 1:
|
|
259
212
|
setStringOperateList(typeList['cont-string']);
|
|
@@ -275,13 +228,16 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
275
228
|
break;
|
|
276
229
|
}
|
|
277
230
|
condition.attrs[index].attrId = operate.id;
|
|
231
|
+
condition.attrs[index].computeType = 'origin';
|
|
278
232
|
condition.attrs[index].attrName = operate.name;
|
|
279
233
|
condition.attrs[index].attrMaping = operate.columnName;
|
|
234
|
+
condition.attrs[index].operator = '';
|
|
280
235
|
} else {
|
|
281
236
|
switch (condition.attrs[index].attrType) {
|
|
282
237
|
case 'cont-string':
|
|
283
238
|
case 'cont-date':
|
|
284
239
|
condition.attrs[index].operator = operate.value;
|
|
240
|
+
condition.attrs[index].computeType = 'origin';
|
|
285
241
|
condition.attrs[index].params = [];
|
|
286
242
|
if (condition.attrs[index].operator === 'absolute' && condition.attrs[index].attrType === 'cont-date') {
|
|
287
243
|
var _endDate = moment().format('YYYY-MM-DD');
|
|
@@ -318,21 +274,23 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
318
274
|
onChange(_objectSpread({}, condition));
|
|
319
275
|
};
|
|
320
276
|
var onParamsChange = function onParamsChange(operate) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
277
|
+
if (operate.length > 0) {
|
|
278
|
+
var _obj = operate.map(function (item) {
|
|
279
|
+
return {
|
|
280
|
+
name: item.name,
|
|
281
|
+
value: item.value
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
var params = operate.map(function (item) {
|
|
285
|
+
return item.value;
|
|
286
|
+
});
|
|
287
|
+
if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
|
|
288
|
+
queryValueList(searchValue, {});
|
|
289
|
+
}
|
|
290
|
+
setCurrent(_obj);
|
|
291
|
+
condition.attrs[index].params = params;
|
|
292
|
+
onChange(_objectSpread({}, condition));
|
|
332
293
|
}
|
|
333
|
-
setCurrent(obj);
|
|
334
|
-
condition.attrs[index].params = params;
|
|
335
|
-
onChange(_objectSpread({}, condition));
|
|
336
294
|
};
|
|
337
295
|
function onDateChange(newData) {
|
|
338
296
|
if (condition.attrs[index].operator === 'absolute') {
|
|
@@ -350,20 +308,28 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
350
308
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
351
309
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
352
310
|
className: "".concat(classPrefix, "-select-condition"),
|
|
353
|
-
options: bizDataAttrList,
|
|
311
|
+
options: (bizDataAttrList.length > 0 ? bizDataAttrList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList = condition.paramsList[index]) === null || _condition$paramsList === void 0 ? void 0 : _condition$paramsList.bizDataAttrList) || [],
|
|
354
312
|
labelField: "name",
|
|
355
313
|
keyField: "value",
|
|
314
|
+
value: {
|
|
315
|
+
name: condition.typeId ? condition.attrs[index].attrName : condition.attrs[index].orderType,
|
|
316
|
+
value: condition.typeId ? condition.attrs[index].attrId : condition.attrs[index].orderType
|
|
317
|
+
},
|
|
356
318
|
overlayWidth: 120,
|
|
357
319
|
onChange: onOrderTypeListChange
|
|
358
320
|
})), /*#__PURE__*/React.createElement("div", {
|
|
359
321
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
360
322
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
361
323
|
className: "".concat(classPrefix, "-select-condition"),
|
|
362
|
-
options: masterList,
|
|
324
|
+
options: (masterList.length > 0 ? masterList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList2 = condition.paramsList[index]) === null || _condition$paramsList2 === void 0 ? void 0 : _condition$paramsList2.masterList) || [],
|
|
325
|
+
value: {
|
|
326
|
+
name: condition.typeId ? condition.attrs[index].attrType === 'cont-string' || condition.attrs[index].attrType === 'cont-date' ? condition.attrs[index].operator : condition.attrs[index].computeType : condition.attrs[index].attrName,
|
|
327
|
+
value: condition.typeId ? condition.attrs[index].attrType === 'cont-string' || condition.attrs[index].attrType === 'cont-date' ? condition.attrs[index].operator : condition.attrs[index].computeType : condition.attrs[index].attrId
|
|
328
|
+
},
|
|
363
329
|
labelField: "name",
|
|
364
330
|
keyField: "value",
|
|
365
331
|
onChange: onMasterListChange
|
|
366
|
-
})), !(
|
|
332
|
+
})), !(condition === null || condition === void 0 ? void 0 : condition.typeId) && condition.attrs[index].attrType === 'cont-num' ? /*#__PURE__*/React.createElement("div", {
|
|
367
333
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
368
334
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
369
335
|
className: "".concat(classPrefix, "-select-condition"),
|
|
@@ -376,7 +342,7 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
376
342
|
},
|
|
377
343
|
overlayWidth: 120,
|
|
378
344
|
onChange: onComputeTypeOperateChange
|
|
379
|
-
})) : null, (
|
|
345
|
+
})) : null, (condition === null || condition === void 0 ? void 0 : condition.typeId) && condition.attrs[index].attrType === 'cont-num' || !(condition === null || condition === void 0 ? void 0 : condition.typeId) ? /*#__PURE__*/React.createElement("div", {
|
|
380
346
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
381
347
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
382
348
|
className: "".concat(classPrefix, "-select-condition"),
|
|
@@ -389,7 +355,7 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
389
355
|
},
|
|
390
356
|
overlayWidth: 120,
|
|
391
357
|
onChange: onStringOperateChange
|
|
392
|
-
})) : null, !(
|
|
358
|
+
})) : null, !(condition === null || condition === void 0 ? void 0 : condition.typeId) && condition.attrs[index].attrType === 'cont-string' || condition.attrs[index].attrType === 'cont-string' && condition.attrs[index].operator !== 'is null' && condition.attrs[index].operator !== 'is not null' ? /*#__PURE__*/React.createElement("div", {
|
|
393
359
|
className: "".concat(classPrefix, "-period-condition-operator"),
|
|
394
360
|
style: {
|
|
395
361
|
width: '250px'
|
|
@@ -399,9 +365,9 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
399
365
|
multiple: true,
|
|
400
366
|
size: "middle",
|
|
401
367
|
labelField: "name",
|
|
368
|
+
options: (paramsList.length > 0 ? paramsList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList3 = condition.paramsList[index]) === null || _condition$paramsList3 === void 0 ? void 0 : _condition$paramsList3.paramsList) || [],
|
|
402
369
|
keyField: "value",
|
|
403
370
|
value: current,
|
|
404
|
-
options: paramsList,
|
|
405
371
|
onChange: onParamsChange,
|
|
406
372
|
onSearch: setSearchValue,
|
|
407
373
|
enableCreate: true
|
|
@@ -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',
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BizUserConditionT } from '../types';
|
|
3
3
|
import './styles/textDesc.less';
|
|
4
4
|
export interface TextProps {
|
|
5
|
-
condition: BizUserConditionT.ActiveCondition | BizUserConditionT.AddCondition | BizUserConditionT.PropCondition | BizUserConditionT.EventCondition | BizUserConditionT.TagsCondition | BizUserConditionT.CdpCondition;
|
|
5
|
+
condition: BizUserConditionT.ActiveCondition | BizUserConditionT.AddCondition | BizUserConditionT.PropCondition | BizUserConditionT.EventCondition | BizUserConditionT.TagsCondition | BizUserConditionT.CdpCondition | BizUserConditionT.OrderCondition | BizUserConditionT.BusinessCondition;
|
|
6
6
|
showOrDesc: boolean;
|
|
7
7
|
}
|
|
8
8
|
declare const Text: React.FC<TextProps>;
|
|
@@ -13,6 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
import React, { useContext, useMemo } from 'react';
|
|
15
15
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
16
|
+
import { monthTimeOperatorType, monthValuesType, skyTimeOperatorType, timeDimensionType, timeValuesType, typeList, weekTimeOperatorType, weekValuesType, orderTypeList, computeTypeList, stringOperate } from '../../attrConditions/utils/operates';
|
|
16
17
|
import BizGlobalDataContext from '../../context';
|
|
17
18
|
import { findEvent, findPropAndEnv, buildSelectLayer } from '../util';
|
|
18
19
|
import { durationHandler, operatorMap } from './constants';
|
|
@@ -36,6 +37,7 @@ var Text = function Text(props) {
|
|
|
36
37
|
return renderCdp(condition);
|
|
37
38
|
}
|
|
38
39
|
var data = condition;
|
|
40
|
+
console.log(77773333, data, props);
|
|
39
41
|
if (String(data.eventId) === '-4') {
|
|
40
42
|
return renderPeriod({
|
|
41
43
|
before: '活跃于'
|
|
@@ -49,6 +51,12 @@ var Text = function Text(props) {
|
|
|
49
51
|
if (data.eventId === undefined) {
|
|
50
52
|
return renderProps(data.attrs[0], 'user');
|
|
51
53
|
}
|
|
54
|
+
if (String(data.eventId) === '-13') {
|
|
55
|
+
return renderOrder(data);
|
|
56
|
+
}
|
|
57
|
+
if (String(data.eventId) === '-14') {
|
|
58
|
+
return renderBusiness(data);
|
|
59
|
+
}
|
|
52
60
|
if (data.eventId) {
|
|
53
61
|
return renderEvent(data);
|
|
54
62
|
}
|
|
@@ -103,6 +111,7 @@ var Text = function Text(props) {
|
|
|
103
111
|
}
|
|
104
112
|
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
105
113
|
var runtimes = renderRuntimes(condition.runTimes);
|
|
114
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
106
115
|
var attrs = renderAttrs(event, condition.attrs);
|
|
107
116
|
return /*#__PURE__*/React.createElement("span", {
|
|
108
117
|
style: {
|
|
@@ -111,11 +120,91 @@ var Text = function Text(props) {
|
|
|
111
120
|
}
|
|
112
121
|
}, period, /*#__PURE__*/React.createElement("span", {
|
|
113
122
|
className: "".concat(classPrefix, "-text-desc-value")
|
|
114
|
-
}, event.alias || event.name), attrs, runtimes);
|
|
123
|
+
}, event.alias || event.name), attrs, timeDimensions, runtimes);
|
|
124
|
+
}
|
|
125
|
+
function renderOrder(condition) {
|
|
126
|
+
var periodLabel = {};
|
|
127
|
+
if (condition.runPeriod.operator === 'join_time') {
|
|
128
|
+
periodLabel.before = '在新增后';
|
|
129
|
+
periodLabel.after = '天内';
|
|
130
|
+
}
|
|
131
|
+
if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
|
|
132
|
+
periodLabel.before = '在';
|
|
133
|
+
}
|
|
134
|
+
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
135
|
+
var frequencyValues = renderFrequencyValues(condition.runTimes.values, condition.runTimes.operator, '次数');
|
|
136
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
137
|
+
var property = renderProperty(condition.attrs, '订单属性');
|
|
138
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
139
|
+
style: {
|
|
140
|
+
backgroundColor: '#fffeeb',
|
|
141
|
+
padding: '6px 7px'
|
|
142
|
+
}
|
|
143
|
+
}, "\u8BA2\u5355\u6570\u636E ", period, timeDimensions, property, frequencyValues);
|
|
144
|
+
}
|
|
145
|
+
function renderBusiness(condition) {
|
|
146
|
+
var periodLabel = {};
|
|
147
|
+
if (condition.runPeriod.operator === 'join_time') {
|
|
148
|
+
periodLabel.before = '在新增后';
|
|
149
|
+
periodLabel.after = '天内';
|
|
150
|
+
}
|
|
151
|
+
if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
|
|
152
|
+
periodLabel.before = '在';
|
|
153
|
+
}
|
|
154
|
+
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
155
|
+
var frequencyValues = renderFrequencyValues(condition.runTimes.values, condition.runTimes.operator, '次数');
|
|
156
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
157
|
+
var property = renderProperty(condition.attrs, '业务属性');
|
|
158
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
159
|
+
style: {
|
|
160
|
+
backgroundColor: '#fffeeb',
|
|
161
|
+
padding: '6px 7px'
|
|
162
|
+
}
|
|
163
|
+
}, condition.typeName, period, timeDimensions, property, frequencyValues);
|
|
164
|
+
}
|
|
165
|
+
function renderProperty(attrs, label) {
|
|
166
|
+
var attrsDom = [];
|
|
167
|
+
attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (item, i) {
|
|
168
|
+
var attrTypeList = [];
|
|
169
|
+
var operateList = [];
|
|
170
|
+
switch (item.attrType) {
|
|
171
|
+
case 'cont-string':
|
|
172
|
+
attrTypeList = typeList['cont-string'];
|
|
173
|
+
operateList = stringOperate;
|
|
174
|
+
break;
|
|
175
|
+
case 'cont-num':
|
|
176
|
+
attrTypeList = computeTypeList;
|
|
177
|
+
operateList = typeList['cont-num'];
|
|
178
|
+
break;
|
|
179
|
+
default:
|
|
180
|
+
attrTypeList = typeList['cont-date'];
|
|
181
|
+
operateList = typeList['cont-date'];
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
var orderType = orderTypeList.filter(function (v) {
|
|
185
|
+
return v.value === item.orderType;
|
|
186
|
+
});
|
|
187
|
+
var attrType = attrTypeList.filter(function (v) {
|
|
188
|
+
return v.value === (item.attrType === 'cont-num' ? item.computeType : item.operator);
|
|
189
|
+
});
|
|
190
|
+
var operator = operateList.filter(function (v) {
|
|
191
|
+
return v.value === item.computeType;
|
|
192
|
+
});
|
|
193
|
+
var frequencyValues = renderFrequencyValues(item.params, item.operator, item.attrType === 'cont-date' && item.operator !== 'absolute' ? '天数' : item.operator === 'absolute' ? '日期' : '');
|
|
194
|
+
if (label) {
|
|
195
|
+
var _orderType$, _attrType$, _operator$;
|
|
196
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
197
|
+
key: i
|
|
198
|
+
}, /*#__PURE__*/React.createElement("span", null, (_orderType$ = orderType[0]) === null || _orderType$ === void 0 ? void 0 : _orderType$.name), /*#__PURE__*/React.createElement("span", null, item.attrName), /*#__PURE__*/React.createElement("span", null, (_attrType$ = attrType[0]) === null || _attrType$ === void 0 ? void 0 : _attrType$.name), /*#__PURE__*/React.createElement("span", null, (_operator$ = operator[0]) === null || _operator$ === void 0 ? void 0 : _operator$.name), /*#__PURE__*/React.createElement("span", null, frequencyValues), i !== attrs.length - 1 ? ',' : '');
|
|
199
|
+
attrsDom.push(dom);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
if (!attrsDom.length) return null;
|
|
203
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), label, ":", attrsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
|
|
115
204
|
}
|
|
116
205
|
function renderAttrs(event, attrs) {
|
|
117
206
|
var attrsDom = [];
|
|
118
|
-
attrs.forEach(function (attr, i) {
|
|
207
|
+
attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (attr, i) {
|
|
119
208
|
var index = event.attrList.findIndex(function (item) {
|
|
120
209
|
return item.id === attr.attrId;
|
|
121
210
|
});
|
|
@@ -145,6 +234,76 @@ var Text = function Text(props) {
|
|
|
145
234
|
className: "".concat(classPrefix, "-text-desc-value")
|
|
146
235
|
}, runTimes.values[0]));
|
|
147
236
|
}
|
|
237
|
+
function renderFrequencyValues(frequencyValues, frequencyOperator, frequency) {
|
|
238
|
+
var _frequencyOperatorLis;
|
|
239
|
+
var frequencyValuesDom = [];
|
|
240
|
+
var frequencyOperatorList = typeList['cont-num'].filter(function (v) {
|
|
241
|
+
return v.value === frequencyOperator;
|
|
242
|
+
});
|
|
243
|
+
frequencyValues === null || frequencyValues === void 0 ? void 0 : frequencyValues.forEach(function (item, i) {
|
|
244
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
245
|
+
key: i
|
|
246
|
+
}, /*#__PURE__*/React.createElement("span", null, item, i !== frequencyValues.length - 1 ? '到' : ''));
|
|
247
|
+
frequencyValuesDom.push(dom);
|
|
248
|
+
});
|
|
249
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
|
|
250
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
251
|
+
}, frequency), /*#__PURE__*/React.createElement("span", {
|
|
252
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
253
|
+
}, (_frequencyOperatorLis = frequencyOperatorList[0]) === null || _frequencyOperatorLis === void 0 ? void 0 : _frequencyOperatorLis.name), /*#__PURE__*/React.createElement("span", {
|
|
254
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
255
|
+
}, frequencyValuesDom));
|
|
256
|
+
}
|
|
257
|
+
function renderTimeDimensions(timeDimensions) {
|
|
258
|
+
var timeDimensionsDom = [];
|
|
259
|
+
timeDimensions === null || timeDimensions === void 0 ? void 0 : timeDimensions.forEach(function (item, i) {
|
|
260
|
+
var _label$, _operatorTypeList$;
|
|
261
|
+
var label = [];
|
|
262
|
+
var list = [];
|
|
263
|
+
var valuesList = [];
|
|
264
|
+
switch (item.timeDimension) {
|
|
265
|
+
case 1:
|
|
266
|
+
list = skyTimeOperatorType;
|
|
267
|
+
valuesList = timeValuesType;
|
|
268
|
+
break;
|
|
269
|
+
case 2:
|
|
270
|
+
list = weekTimeOperatorType;
|
|
271
|
+
valuesList = weekValuesType;
|
|
272
|
+
break;
|
|
273
|
+
default:
|
|
274
|
+
list = monthTimeOperatorType;
|
|
275
|
+
valuesList = monthValuesType;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
label = timeDimensionType.filter(function (v) {
|
|
279
|
+
return v.value === item.timeDimension;
|
|
280
|
+
});
|
|
281
|
+
var operatorTypeList = list.filter(function (v) {
|
|
282
|
+
return v.value === item.timeOperator;
|
|
283
|
+
});
|
|
284
|
+
var itemTimeValuesDom = [];
|
|
285
|
+
if (item.timeValues.length > 0) {
|
|
286
|
+
var _item$timeValues;
|
|
287
|
+
(_item$timeValues = item.timeValues) === null || _item$timeValues === void 0 ? void 0 : _item$timeValues.forEach(function (_v, vIndex) {
|
|
288
|
+
var _valuesTypeList$;
|
|
289
|
+
var valuesTypeList = valuesList.filter(function (v) {
|
|
290
|
+
return v.value === _v;
|
|
291
|
+
});
|
|
292
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
293
|
+
key: vIndex
|
|
294
|
+
}, /*#__PURE__*/React.createElement("span", null, (_valuesTypeList$ = valuesTypeList[0]) === null || _valuesTypeList$ === void 0 ? void 0 : _valuesTypeList$.name, vIndex !== item.timeValues.length - 1 ? '到' : ''));
|
|
295
|
+
itemTimeValuesDom.push(dom);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
var frequencyValues = renderFrequencyValues(item.frequencyValues, item.frequencyOperator, '次数');
|
|
299
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
300
|
+
key: i
|
|
301
|
+
}, /*#__PURE__*/React.createElement("span", null, (_label$ = label[0]) === null || _label$ === void 0 ? void 0 : _label$.name, (_operatorTypeList$ = operatorTypeList[0]) === null || _operatorTypeList$ === void 0 ? void 0 : _operatorTypeList$.name, itemTimeValuesDom, frequencyValues, i !== timeDimensions.length - 1 ? ',' : ''));
|
|
302
|
+
timeDimensionsDom.push(dom);
|
|
303
|
+
});
|
|
304
|
+
if (!timeDimensionsDom.length) return null;
|
|
305
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), "\u65F6\u95F4\u7EF4\u5EA6: ", timeDimensionsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
|
|
306
|
+
}
|
|
148
307
|
function renderTags(condition) {
|
|
149
308
|
var labels = condition.labels;
|
|
150
309
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -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;
|
|
@@ -117,6 +117,10 @@ var OrConditions = function OrConditions(props) {
|
|
|
117
117
|
data.condition.labels = newData;
|
|
118
118
|
} else if (type === 'cdp') {
|
|
119
119
|
data.condition.dataset = newData;
|
|
120
|
+
} else if (type === 'business') {
|
|
121
|
+
data.condition = newData;
|
|
122
|
+
} else if (type === 'order') {
|
|
123
|
+
data.condition = newData;
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
126
|
newValue.push(data.condition);
|
|
@@ -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;
|
|
@@ -80,12 +88,17 @@ export declare namespace BizUserConditionT {
|
|
|
80
88
|
category: 'fixed' | 'custom';
|
|
81
89
|
computeType: string;
|
|
82
90
|
}
|
|
91
|
+
interface paramsListCondition {
|
|
92
|
+
masterList: [];
|
|
93
|
+
bizDataAttrList: [];
|
|
94
|
+
paramsList: [];
|
|
95
|
+
}
|
|
83
96
|
interface TimeDimensionsCondition {
|
|
84
97
|
timeDimension: number;
|
|
85
98
|
timeOperator: string;
|
|
86
99
|
timeValues: number[];
|
|
87
100
|
frequencyOperator: string;
|
|
88
|
-
frequencyValues:
|
|
101
|
+
frequencyValues: any[];
|
|
89
102
|
}
|
|
90
103
|
interface EventCondition {
|
|
91
104
|
attrs: AttrCondition[];
|
|
@@ -101,17 +114,21 @@ export declare namespace BizUserConditionT {
|
|
|
101
114
|
runTimes: RunTimesI;
|
|
102
115
|
}
|
|
103
116
|
interface BusinessCondition {
|
|
117
|
+
typeId: undefined;
|
|
118
|
+
typeName: undefined;
|
|
119
|
+
paramsList: paramsListCondition[];
|
|
104
120
|
attrs: AttrsCondition[];
|
|
105
121
|
timeDimensions: TimeDimensionsCondition[];
|
|
106
|
-
runTimes:
|
|
107
|
-
runPeriod:
|
|
122
|
+
runTimes: RunTimesII;
|
|
123
|
+
runPeriod: RunPeriodII;
|
|
108
124
|
eventId: -14;
|
|
109
125
|
}
|
|
110
126
|
interface OrderCondition {
|
|
111
127
|
attrs: AttrsCondition[];
|
|
112
128
|
timeDimensions: TimeDimensionsCondition[];
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
paramsList: paramsListCondition[];
|
|
130
|
+
runTimes: RunTimesII;
|
|
131
|
+
runPeriod: RunPeriodII;
|
|
115
132
|
eventId: -13;
|
|
116
133
|
}
|
|
117
134
|
interface ActiveCondition {
|
|
@@ -157,9 +174,9 @@ export declare namespace BizUserConditionT {
|
|
|
157
174
|
interface CdpCondition {
|
|
158
175
|
dataset: (BizUserConditionT.CdpConditionDetail | undefined)[];
|
|
159
176
|
}
|
|
160
|
-
type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition | TagsCondition | BusinessCondition | CdpCondition;
|
|
177
|
+
type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition | TagsCondition | BusinessCondition | OrderCondition | CdpCondition;
|
|
161
178
|
type Conditions = Condition[][];
|
|
162
|
-
type OtherCondition = EventCondition | AddCondition | ActiveCondition | PropCondition;
|
|
179
|
+
type OtherCondition = EventCondition | AddCondition | ActiveCondition | PropCondition | BusinessCondition | OrderCondition;
|
|
163
180
|
interface ShowItemI {
|
|
164
181
|
id: number;
|
|
165
182
|
orConditions: Conditions[number];
|
package/es/userCondition/util.js
CHANGED
|
@@ -70,15 +70,22 @@ export function buildCondition(type) {
|
|
|
70
70
|
case 'business':
|
|
71
71
|
return {
|
|
72
72
|
eventId: -14,
|
|
73
|
+
typeId: undefined,
|
|
74
|
+
typeName: undefined,
|
|
73
75
|
runTimes: {
|
|
74
76
|
operator: '>=',
|
|
75
|
-
values: [
|
|
77
|
+
values: [1]
|
|
76
78
|
},
|
|
77
79
|
attrs: [],
|
|
80
|
+
paramsList: [{
|
|
81
|
+
masterList: [],
|
|
82
|
+
bizDataAttrList: [],
|
|
83
|
+
paramsList: []
|
|
84
|
+
}],
|
|
78
85
|
timeDimensions: [],
|
|
79
86
|
runPeriod: {
|
|
80
87
|
operator: 'relative',
|
|
81
|
-
values: [
|
|
88
|
+
values: [30, '0']
|
|
82
89
|
}
|
|
83
90
|
};
|
|
84
91
|
case 'order':
|
|
@@ -86,13 +93,18 @@ export function buildCondition(type) {
|
|
|
86
93
|
eventId: -13,
|
|
87
94
|
runTimes: {
|
|
88
95
|
operator: '>=',
|
|
89
|
-
values: [
|
|
96
|
+
values: [1]
|
|
90
97
|
},
|
|
91
98
|
attrs: [],
|
|
99
|
+
paramsList: [{
|
|
100
|
+
masterList: [],
|
|
101
|
+
bizDataAttrList: [],
|
|
102
|
+
paramsList: []
|
|
103
|
+
}],
|
|
92
104
|
timeDimensions: [],
|
|
93
105
|
runPeriod: {
|
|
94
106
|
operator: 'relative',
|
|
95
|
-
values: [
|
|
107
|
+
values: [30, '0']
|
|
96
108
|
}
|
|
97
109
|
};
|
|
98
110
|
}
|