@zgfe/business-lib 1.1.34-alpha.2 → 1.1.34-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/addToPanel/index.js +7 -1
- package/es/addToScene/index.js +1 -1
- package/es/assets/colorIcon/demo.css +539 -0
- package/es/assets/colorIcon/demo_index.html +741 -0
- package/es/assets/colorIcon/iconfont.css +112 -0
- package/es/assets/colorIcon/iconfont.js +43 -0
- package/es/assets/colorIcon/iconfont.json +177 -0
- package/es/assets/colorIcon/iconfont.svg +67 -0
- package/es/assets/colorIcon/iconfont.ttf +0 -0
- package/es/assets/colorIcon/iconfont.woff +0 -0
- package/es/assets/colorIcon/iconfont.woff2 +0 -0
- package/es/assets/iconfont/demo_index.html +95 -3
- package/es/assets/iconfont/iconfont.css +19 -3
- package/es/assets/iconfont/iconfont.js +1 -1
- package/es/assets/iconfont/iconfont.json +28 -0
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/assets/theme.js +1 -2
- package/es/attrConditions/components/stringList.js +0 -1
- package/es/attrConditions/components/valuesList.js +1 -0
- package/es/attrConditions/demo/group.js +3 -2
- package/es/attrConditions/demo/index.js +1 -11
- package/es/attrConditions/index.d.ts +3 -1
- package/es/attrConditions/index.js +24 -19
- package/es/attrConditions/types.d.ts +1 -1
- package/es/attributeSelector/index.js +10 -8
- package/es/attributeSelector/types.d.ts +4 -0
- package/es/attributeSelector/util.js +5 -1
- package/es/chart/util/formatOption.js +1 -1
- package/es/colorIcon/demo/index.d.ts +3 -0
- package/es/colorIcon/demo/index.js +10 -0
- package/es/colorIcon/index.d.ts +9 -0
- package/es/colorIcon/index.js +19 -0
- package/es/constants/apis.d.ts +6 -0
- package/es/constants/apis.js +7 -1
- package/es/constants/common.d.ts +11 -0
- package/es/constants/common.js +35 -0
- package/es/context/index.d.ts +4 -1
- package/es/cycleTime/month.js +17 -15
- package/es/datePicker/index.d.ts +1 -1
- package/es/datePicker/index.js +1 -1
- package/es/datePicker/styles/index.less +1 -1
- package/es/demoWrapper/content.d.ts +2 -1
- package/es/demoWrapper/content.js +25 -12
- package/es/demoWrapper/demo/index.js +5 -3
- package/es/demoWrapper/head.d.ts +3 -1
- package/es/demoWrapper/head.js +17 -5
- package/es/demoWrapper/index.js +18 -10
- package/es/dialog/index.js +1 -1
- package/es/eventSelector/demo/index.js +1 -0
- package/es/eventSelector/index.js +15 -10
- package/es/eventSelector/listPanel.js +33 -7
- package/es/eventSelector/types.d.ts +2 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/select/handle.js +6 -2
- package/es/select/index.js +13 -11
- package/es/socket/demo/demo.d.ts +2 -0
- package/es/socket/demo/demo.js +145 -0
- package/es/socket/demo/index.less +27 -0
- package/es/socket/index.d.ts +33 -0
- package/es/socket/index.js +304 -0
- package/es/socket/types.d.ts +38 -0
- package/es/socket/types.js +28 -0
- package/es/targetConditionGroup/components/targetDimension.js +29 -27
- package/es/targetConditionGroup/data/operates.js +0 -3
- package/es/targetConditionGroup/demo/index.js +2 -1
- package/es/targetConditionGroup/index.js +65 -34
- package/es/targetConditionGroup/types.d.ts +1 -0
- package/es/targetSelector/index.js +9 -7
- package/es/userCondition/conditionTypeList.js +11 -8
- package/es/userCondition/conditions/business/operatorCondition.d.ts +11 -0
- package/es/userCondition/conditions/business/operatorCondition.js +181 -0
- package/es/userCondition/conditions/business/paramsCondition.d.ts +9 -0
- package/es/userCondition/conditions/business/paramsCondition.js +79 -0
- package/es/userCondition/conditions/businessCondition.d.ts +2 -8
- package/es/userCondition/conditions/businessCondition.js +37 -203
- package/es/userCondition/conditions/cdpCondition.js +1 -1
- package/es/userCondition/conditions/dataAttribute.js +78 -274
- package/es/userCondition/conditions/eventCondition.js +7 -4
- package/es/userCondition/conditions/order/runPeriodCondition.d.ts +11 -0
- package/es/userCondition/conditions/order/runPeriodCondition.js +142 -0
- package/es/userCondition/conditions/order/runTimesCondition.d.ts +11 -0
- package/es/userCondition/conditions/order/runTimesCondition.js +112 -0
- package/es/userCondition/conditions/textDesc.d.ts +1 -1
- package/es/userCondition/conditions/textDesc.js +160 -2
- package/es/userCondition/conditions/timeDimension.d.ts +1 -0
- package/es/userCondition/conditions/timeDimension.js +26 -76
- package/es/userCondition/demo/business.d.ts +3 -0
- package/es/userCondition/demo/business.js +71 -0
- package/es/userCondition/index.js +14 -2
- package/es/userCondition/orConditions.js +9 -4
- package/es/userCondition/types.d.ts +42 -8
- package/es/userCondition/types.js +8 -1
- package/es/userCondition/util.d.ts +1 -1
- package/es/userCondition/util.js +7 -4
- package/es/userTagsSelector/index.js +5 -3
- package/es/utils/ajax.js +0 -1
- package/package.json +60 -60
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import { Input, DatePicker } from 'antd';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import '../styles/periodCondition.less';
|
|
11
|
+
import { classPrefix } from '../..';
|
|
12
|
+
import { operatorMap } from '../constants';
|
|
13
|
+
import BizSelect from '../../../select';
|
|
14
|
+
import RunTimesCondition from './runTimesCondition';
|
|
15
|
+
var RangePicker = DatePicker.RangePicker;
|
|
16
|
+
var RunPeriodCondition = function RunPeriodCondition(props) {
|
|
17
|
+
var onChange = props.onChange,
|
|
18
|
+
condition = props.condition,
|
|
19
|
+
isEvent = props.isEvent;
|
|
20
|
+
var options = [{
|
|
21
|
+
text: '最近',
|
|
22
|
+
value: 'relative'
|
|
23
|
+
}, {
|
|
24
|
+
text: '任意时间',
|
|
25
|
+
value: 'unlimited_time'
|
|
26
|
+
}, {
|
|
27
|
+
text: '固定时段',
|
|
28
|
+
value: 'absolute'
|
|
29
|
+
}];
|
|
30
|
+
if (isEvent) {
|
|
31
|
+
options = options.concat([{
|
|
32
|
+
text: '任意时间',
|
|
33
|
+
value: 'unlimited_time'
|
|
34
|
+
}, {
|
|
35
|
+
text: '新增后*',
|
|
36
|
+
value: 'join_time'
|
|
37
|
+
}]);
|
|
38
|
+
}
|
|
39
|
+
function onOperatorChange(option) {
|
|
40
|
+
var newData = {
|
|
41
|
+
operator: option.value
|
|
42
|
+
};
|
|
43
|
+
if (newData.operator === 'absolute') {
|
|
44
|
+
var endDate = moment().format('YYYY-MM-DD');
|
|
45
|
+
var startDate = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
|
46
|
+
newData.values = [startDate, endDate];
|
|
47
|
+
}
|
|
48
|
+
if (newData.operator === 'relative') {
|
|
49
|
+
newData.values = [30, '0'];
|
|
50
|
+
}
|
|
51
|
+
if (newData.operator === 'unlimited_time') {
|
|
52
|
+
newData.values = [30, '0'];
|
|
53
|
+
}
|
|
54
|
+
if (newData.operator === 'join_time') {
|
|
55
|
+
newData.values = [3, '0'];
|
|
56
|
+
}
|
|
57
|
+
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
58
|
+
runPeriod: newData
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
function onDateChange(newData) {
|
|
62
|
+
if (condition.runPeriod.operator === 'absolute') {
|
|
63
|
+
var dateRange = newData;
|
|
64
|
+
var newValues = dateRange.map(function (date) {
|
|
65
|
+
return date.format('YYYY-MM-DD');
|
|
66
|
+
});
|
|
67
|
+
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
68
|
+
runPeriod: _objectSpread(_objectSpread({}, condition.runPeriod), {}, {
|
|
69
|
+
values: newValues
|
|
70
|
+
})
|
|
71
|
+
}));
|
|
72
|
+
} else if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'join_time') {
|
|
73
|
+
var newValue = newData.target.value;
|
|
74
|
+
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
75
|
+
runPeriod: _objectSpread(_objectSpread({}, condition.runPeriod), {}, {
|
|
76
|
+
values: [Number(newValue), '0']
|
|
77
|
+
})
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function renderValues() {
|
|
82
|
+
var _condition$runPeriod = condition.runPeriod,
|
|
83
|
+
operator = _condition$runPeriod.operator,
|
|
84
|
+
values = _condition$runPeriod.values;
|
|
85
|
+
if (operator === 'relative' || operator === 'join_time') {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
87
|
+
key: "relative-date",
|
|
88
|
+
className: "".concat(classPrefix, "-select-condition"),
|
|
89
|
+
type: "number",
|
|
90
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
91
|
+
value: values[0],
|
|
92
|
+
size: "middle",
|
|
93
|
+
onChange: onDateChange,
|
|
94
|
+
style: {
|
|
95
|
+
width: 80
|
|
96
|
+
},
|
|
97
|
+
suffix: "\u5929"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (operator === 'absolute') {
|
|
101
|
+
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
102
|
+
size: "middle",
|
|
103
|
+
defaultValue: [moment(values[0]), moment(values[1])],
|
|
104
|
+
onChange: onDateChange,
|
|
105
|
+
allowClear: false
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "".concat(classPrefix, "-period-condition")
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: "".concat(classPrefix, "-period-condition-operator")
|
|
113
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
114
|
+
dropdownExtra: isEvent ? /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
style: {
|
|
116
|
+
lineHeight: '29px'
|
|
117
|
+
}
|
|
118
|
+
}, "*\u7528\u6237\u65B0\u589E\u6570\u636E\u4E3A\u6BCF\u65E5\u51CC\u6668\u751F\u6210") : null,
|
|
119
|
+
overlayWidth: isEvent ? 210 : 114,
|
|
120
|
+
options: options,
|
|
121
|
+
labelField: "text",
|
|
122
|
+
keyField: "value",
|
|
123
|
+
size: "middle",
|
|
124
|
+
value: {
|
|
125
|
+
value: condition.runPeriod.operator,
|
|
126
|
+
text: operatorMap[condition.runPeriod.operator]
|
|
127
|
+
},
|
|
128
|
+
onChange: onOperatorChange
|
|
129
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "".concat(classPrefix, "-period-condition-values")
|
|
131
|
+
}, renderValues()), /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: "".concat(classPrefix, "-period-condition-values")
|
|
133
|
+
}, /*#__PURE__*/React.createElement(RunTimesCondition, {
|
|
134
|
+
dataId: props.dataId,
|
|
135
|
+
condition: condition,
|
|
136
|
+
onChange: onChange
|
|
137
|
+
}))));
|
|
138
|
+
};
|
|
139
|
+
RunPeriodCondition.defaultProps = {
|
|
140
|
+
isEvent: false
|
|
141
|
+
};
|
|
142
|
+
export default RunPeriodCondition;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AllConditionBasePropsI, BizUserConditionT } from '../../types';
|
|
3
|
+
import '../styles/periodCondition.less';
|
|
4
|
+
export interface RunTimesConditionPropsI extends AllConditionBasePropsI<any> {
|
|
5
|
+
onChange: (condition: any) => void;
|
|
6
|
+
isEvent?: boolean;
|
|
7
|
+
index?: number;
|
|
8
|
+
condition: BizUserConditionT.BusinessCondition;
|
|
9
|
+
}
|
|
10
|
+
declare const RunTimesCondition: React.FC<RunTimesConditionPropsI>;
|
|
11
|
+
export default RunTimesCondition;
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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
|
+
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); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import { Input } from 'antd';
|
|
15
|
+
import '../styles/periodCondition.less';
|
|
16
|
+
import { classPrefix } from '../..';
|
|
17
|
+
import BizSelect from '../../../select';
|
|
18
|
+
import { typeList } from '../../../attrConditions/utils/operates';
|
|
19
|
+
var RunTimesCondition = function RunTimesCondition(props) {
|
|
20
|
+
var onChange = props.onChange,
|
|
21
|
+
index = props.index,
|
|
22
|
+
condition = props.condition;
|
|
23
|
+
var _useState = useState(''),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
operator = _useState2[0],
|
|
26
|
+
setOperator = _useState2[1];
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (index !== undefined) {
|
|
29
|
+
setOperator(condition === null || condition === void 0 ? void 0 : condition.timeDimensions[index].frequencyOperator);
|
|
30
|
+
} else {
|
|
31
|
+
setOperator(condition === null || condition === void 0 ? void 0 : condition.runTimes.operator);
|
|
32
|
+
}
|
|
33
|
+
}, [index]);
|
|
34
|
+
var onOperateChange = function onOperateChange(operate) {
|
|
35
|
+
if (index !== undefined) {
|
|
36
|
+
condition.timeDimensions[index].frequencyOperator = operate.value;
|
|
37
|
+
condition.timeDimensions[index].frequencyValues = [condition.timeDimensions[index].frequencyValues[0]];
|
|
38
|
+
onChange(_objectSpread({}, condition));
|
|
39
|
+
} else {
|
|
40
|
+
condition.runTimes.values = [Number(condition.runTimes.values[0])];
|
|
41
|
+
condition.runTimes.operator = operate.value;
|
|
42
|
+
onChange(_objectSpread({}, condition));
|
|
43
|
+
}
|
|
44
|
+
setOperator(operate.value);
|
|
45
|
+
};
|
|
46
|
+
var onOperateInput0Change = function onOperateInput0Change(value) {
|
|
47
|
+
var newValue = value.target.value;
|
|
48
|
+
if (index !== undefined) {
|
|
49
|
+
condition.timeDimensions[index].frequencyValues[0] = Number(newValue);
|
|
50
|
+
} else {
|
|
51
|
+
condition.runTimes.values[0] = Number(newValue);
|
|
52
|
+
}
|
|
53
|
+
onChange(_objectSpread({}, condition));
|
|
54
|
+
};
|
|
55
|
+
var onOperateInput1Change = function onOperateInput1Change(value) {
|
|
56
|
+
var newValue = value.target.value;
|
|
57
|
+
if (index !== undefined) {
|
|
58
|
+
condition.timeDimensions[index].frequencyValues[1] = newValue;
|
|
59
|
+
} else {
|
|
60
|
+
condition.runTimes.values[1] = newValue;
|
|
61
|
+
}
|
|
62
|
+
onChange(_objectSpread({}, condition));
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "".concat(classPrefix, "-period-condition")
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "".concat(classPrefix, "-period-condition-operator")
|
|
68
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
69
|
+
className: "".concat(classPrefix, "-select-condition"),
|
|
70
|
+
options: typeList['cont-num'],
|
|
71
|
+
labelField: "name",
|
|
72
|
+
keyField: "value",
|
|
73
|
+
overlayWidth: 80,
|
|
74
|
+
value: {
|
|
75
|
+
value: operator,
|
|
76
|
+
name: operator
|
|
77
|
+
},
|
|
78
|
+
onChange: onOperateChange
|
|
79
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: "".concat(classPrefix, "-period-condition")
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
82
|
+
key: "relative-date",
|
|
83
|
+
className: "".concat(classPrefix, "-select-condition"),
|
|
84
|
+
type: operator !== 'between' ? 'number' : '',
|
|
85
|
+
size: "middle",
|
|
86
|
+
value: index !== undefined ? condition === null || condition === void 0 ? void 0 : condition.timeDimensions[index].frequencyValues[0] : condition === null || condition === void 0 ? void 0 : condition.runTimes.values[0],
|
|
87
|
+
placeholder: operator !== 'between' ? '请输入' : '输入最小值',
|
|
88
|
+
style: {
|
|
89
|
+
width: 100
|
|
90
|
+
},
|
|
91
|
+
onChange: onOperateInput0Change,
|
|
92
|
+
suffix: operator !== 'between' ? '次' : null
|
|
93
|
+
})), operator === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: "".concat(classPrefix, "-period-condition"),
|
|
95
|
+
style: {
|
|
96
|
+
marginLeft: 10
|
|
97
|
+
}
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
99
|
+
key: "relative-date",
|
|
100
|
+
className: "".concat(classPrefix, "-select-condition"),
|
|
101
|
+
type: operator !== 'between' ? 'number' : '',
|
|
102
|
+
size: "middle",
|
|
103
|
+
value: index !== undefined ? condition === null || condition === void 0 ? void 0 : condition.timeDimensions[index].frequencyValues[1] : condition === null || condition === void 0 ? void 0 : condition.runTimes.values[1],
|
|
104
|
+
style: {
|
|
105
|
+
width: 100
|
|
106
|
+
},
|
|
107
|
+
placeholder: operator !== 'between' ? '请输入' : '输入最大值',
|
|
108
|
+
onChange: onOperateInput1Change,
|
|
109
|
+
suffix: operator !== 'between' ? '次' : null
|
|
110
|
+
})) : null));
|
|
111
|
+
};
|
|
112
|
+
export default RunTimesCondition;
|
|
@@ -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';
|
|
@@ -49,6 +50,12 @@ var Text = function Text(props) {
|
|
|
49
50
|
if (data.eventId === undefined) {
|
|
50
51
|
return renderProps(data.attrs[0], 'user');
|
|
51
52
|
}
|
|
53
|
+
if (String(data.eventId) === '-13') {
|
|
54
|
+
return renderOrder(data);
|
|
55
|
+
}
|
|
56
|
+
if (String(data.eventId) === '-14') {
|
|
57
|
+
return renderBusiness(data);
|
|
58
|
+
}
|
|
52
59
|
if (data.eventId) {
|
|
53
60
|
return renderEvent(data);
|
|
54
61
|
}
|
|
@@ -103,6 +110,7 @@ var Text = function Text(props) {
|
|
|
103
110
|
}
|
|
104
111
|
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
105
112
|
var runtimes = renderRuntimes(condition.runTimes);
|
|
113
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
106
114
|
var attrs = renderAttrs(event, condition.attrs);
|
|
107
115
|
return /*#__PURE__*/React.createElement("span", {
|
|
108
116
|
style: {
|
|
@@ -111,11 +119,91 @@ var Text = function Text(props) {
|
|
|
111
119
|
}
|
|
112
120
|
}, period, /*#__PURE__*/React.createElement("span", {
|
|
113
121
|
className: "".concat(classPrefix, "-text-desc-value")
|
|
114
|
-
}, event.alias || event.name), attrs, runtimes);
|
|
122
|
+
}, event.alias || event.name), attrs, timeDimensions, runtimes);
|
|
123
|
+
}
|
|
124
|
+
function renderOrder(condition) {
|
|
125
|
+
var periodLabel = {};
|
|
126
|
+
if (condition.runPeriod.operator === 'join_time') {
|
|
127
|
+
periodLabel.before = '在新增后';
|
|
128
|
+
periodLabel.after = '天内';
|
|
129
|
+
}
|
|
130
|
+
if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
|
|
131
|
+
periodLabel.before = '在';
|
|
132
|
+
}
|
|
133
|
+
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
134
|
+
var frequencyValues = renderFrequencyValues(condition.runTimes.values, condition.runTimes.operator, '次数');
|
|
135
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
136
|
+
var property = renderProperty(condition.attrs, '订单属性');
|
|
137
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
style: {
|
|
139
|
+
backgroundColor: '#fffeeb',
|
|
140
|
+
padding: '6px 7px'
|
|
141
|
+
}
|
|
142
|
+
}, "\u8BA2\u5355\u6570\u636E ", period, timeDimensions, property, frequencyValues);
|
|
143
|
+
}
|
|
144
|
+
function renderBusiness(condition) {
|
|
145
|
+
var periodLabel = {};
|
|
146
|
+
if (condition.runPeriod.operator === 'join_time') {
|
|
147
|
+
periodLabel.before = '在新增后';
|
|
148
|
+
periodLabel.after = '天内';
|
|
149
|
+
}
|
|
150
|
+
if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'absolute') {
|
|
151
|
+
periodLabel.before = '在';
|
|
152
|
+
}
|
|
153
|
+
var period = renderPeriod(periodLabel, condition.runPeriod, true);
|
|
154
|
+
var frequencyValues = renderFrequencyValues(condition.runTimes.values, condition.runTimes.operator, '次数');
|
|
155
|
+
var timeDimensions = renderTimeDimensions(condition.timeDimensions);
|
|
156
|
+
var property = renderProperty(condition.attrs, '业务属性');
|
|
157
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
158
|
+
style: {
|
|
159
|
+
backgroundColor: '#fffeeb',
|
|
160
|
+
padding: '6px 7px'
|
|
161
|
+
}
|
|
162
|
+
}, condition.typeName, period, timeDimensions, property, frequencyValues);
|
|
163
|
+
}
|
|
164
|
+
function renderProperty(attrs, label) {
|
|
165
|
+
var attrsDom = [];
|
|
166
|
+
attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (item, i) {
|
|
167
|
+
var attrTypeList = [];
|
|
168
|
+
var operateList = [];
|
|
169
|
+
switch (item.attrType) {
|
|
170
|
+
case 'cont-string':
|
|
171
|
+
attrTypeList = typeList['cont-string'];
|
|
172
|
+
operateList = stringOperate;
|
|
173
|
+
break;
|
|
174
|
+
case 'cont-num':
|
|
175
|
+
attrTypeList = computeTypeList;
|
|
176
|
+
operateList = typeList['cont-num'];
|
|
177
|
+
break;
|
|
178
|
+
default:
|
|
179
|
+
attrTypeList = typeList['cont-date'];
|
|
180
|
+
operateList = typeList['cont-date'];
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
var orderType = orderTypeList.filter(function (v) {
|
|
184
|
+
return v.value === item.orderType;
|
|
185
|
+
});
|
|
186
|
+
var attrType = attrTypeList.filter(function (v) {
|
|
187
|
+
return v.value === (item.attrType === 'cont-num' ? item.computeType : item.operator);
|
|
188
|
+
});
|
|
189
|
+
var operator = operateList.filter(function (v) {
|
|
190
|
+
return v.value === item.computeType;
|
|
191
|
+
});
|
|
192
|
+
var frequencyValues = renderFrequencyValues(item.params, item.operator, item.attrType === 'cont-date' && item.operator !== 'absolute' ? '天数' : item.operator === 'absolute' ? '日期' : '');
|
|
193
|
+
if (label) {
|
|
194
|
+
var _orderType$, _attrType$, _operator$;
|
|
195
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
196
|
+
key: i
|
|
197
|
+
}, /*#__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 ? ',' : '');
|
|
198
|
+
attrsDom.push(dom);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
if (!attrsDom.length) return null;
|
|
202
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), label, ":", attrsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
|
|
115
203
|
}
|
|
116
204
|
function renderAttrs(event, attrs) {
|
|
117
205
|
var attrsDom = [];
|
|
118
|
-
attrs.forEach(function (attr, i) {
|
|
206
|
+
attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (attr, i) {
|
|
119
207
|
var index = event.attrList.findIndex(function (item) {
|
|
120
208
|
return item.id === attr.attrId;
|
|
121
209
|
});
|
|
@@ -145,6 +233,76 @@ var Text = function Text(props) {
|
|
|
145
233
|
className: "".concat(classPrefix, "-text-desc-value")
|
|
146
234
|
}, runTimes.values[0]));
|
|
147
235
|
}
|
|
236
|
+
function renderFrequencyValues(frequencyValues, frequencyOperator, frequency) {
|
|
237
|
+
var _frequencyOperatorLis;
|
|
238
|
+
var frequencyValuesDom = [];
|
|
239
|
+
var frequencyOperatorList = typeList['cont-num'].filter(function (v) {
|
|
240
|
+
return v.value === frequencyOperator;
|
|
241
|
+
});
|
|
242
|
+
frequencyValues === null || frequencyValues === void 0 ? void 0 : frequencyValues.forEach(function (item, i) {
|
|
243
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
244
|
+
key: i
|
|
245
|
+
}, /*#__PURE__*/React.createElement("span", null, item, i !== frequencyValues.length - 1 ? '到' : ''));
|
|
246
|
+
frequencyValuesDom.push(dom);
|
|
247
|
+
});
|
|
248
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
|
|
249
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
250
|
+
}, frequency), /*#__PURE__*/React.createElement("span", {
|
|
251
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
252
|
+
}, (_frequencyOperatorLis = frequencyOperatorList[0]) === null || _frequencyOperatorLis === void 0 ? void 0 : _frequencyOperatorLis.name), /*#__PURE__*/React.createElement("span", {
|
|
253
|
+
className: "".concat(classPrefix, "-text-desc-value")
|
|
254
|
+
}, frequencyValuesDom));
|
|
255
|
+
}
|
|
256
|
+
function renderTimeDimensions(timeDimensions) {
|
|
257
|
+
var timeDimensionsDom = [];
|
|
258
|
+
timeDimensions === null || timeDimensions === void 0 ? void 0 : timeDimensions.forEach(function (item, i) {
|
|
259
|
+
var _label$, _operatorTypeList$;
|
|
260
|
+
var label = [];
|
|
261
|
+
var list = [];
|
|
262
|
+
var valuesList = [];
|
|
263
|
+
switch (item.timeDimension) {
|
|
264
|
+
case 1:
|
|
265
|
+
list = skyTimeOperatorType;
|
|
266
|
+
valuesList = timeValuesType;
|
|
267
|
+
break;
|
|
268
|
+
case 2:
|
|
269
|
+
list = weekTimeOperatorType;
|
|
270
|
+
valuesList = weekValuesType;
|
|
271
|
+
break;
|
|
272
|
+
default:
|
|
273
|
+
list = monthTimeOperatorType;
|
|
274
|
+
valuesList = monthValuesType;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
label = timeDimensionType.filter(function (v) {
|
|
278
|
+
return v.value === item.timeDimension;
|
|
279
|
+
});
|
|
280
|
+
var operatorTypeList = list.filter(function (v) {
|
|
281
|
+
return v.value === item.timeOperator;
|
|
282
|
+
});
|
|
283
|
+
var itemTimeValuesDom = [];
|
|
284
|
+
if (item.timeValues.length > 0) {
|
|
285
|
+
var _item$timeValues;
|
|
286
|
+
(_item$timeValues = item.timeValues) === null || _item$timeValues === void 0 ? void 0 : _item$timeValues.forEach(function (_v, vIndex) {
|
|
287
|
+
var _valuesTypeList$;
|
|
288
|
+
var valuesTypeList = valuesList.filter(function (v) {
|
|
289
|
+
return v.value === _v;
|
|
290
|
+
});
|
|
291
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
292
|
+
key: vIndex
|
|
293
|
+
}, /*#__PURE__*/React.createElement("span", null, (_valuesTypeList$ = valuesTypeList[0]) === null || _valuesTypeList$ === void 0 ? void 0 : _valuesTypeList$.name, vIndex !== item.timeValues.length - 1 ? '到' : ''));
|
|
294
|
+
itemTimeValuesDom.push(dom);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
var frequencyValues = renderFrequencyValues(item.frequencyValues, item.frequencyOperator, '次数');
|
|
298
|
+
var dom = /*#__PURE__*/React.createElement("span", {
|
|
299
|
+
key: i
|
|
300
|
+
}, /*#__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 ? ',' : ''));
|
|
301
|
+
timeDimensionsDom.push(dom);
|
|
302
|
+
});
|
|
303
|
+
if (!timeDimensionsDom.length) return null;
|
|
304
|
+
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\uFF08"), "\u65F6\u95F4\u7EF4\u5EA6: ", timeDimensionsDom, /*#__PURE__*/React.createElement("span", null, "\uFF09"));
|
|
305
|
+
}
|
|
148
306
|
function renderTags(condition) {
|
|
149
307
|
var labels = condition.labels;
|
|
150
308
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -11,15 +11,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useState } from 'react';
|
|
14
|
-
import { Input } from 'antd';
|
|
15
14
|
import BizSelect from '../../select';
|
|
16
15
|
import './styles/runTimesCondition.less';
|
|
17
16
|
import { classPrefix } from '..';
|
|
18
|
-
import { timeDimensionType, skyTimeOperatorType, weekTimeOperatorType, monthTimeOperatorType, timeValuesType, weekValuesType, monthValuesType
|
|
17
|
+
import { timeDimensionType, skyTimeOperatorType, weekTimeOperatorType, monthTimeOperatorType, timeValuesType, weekValuesType, monthValuesType } from '../../attrConditions/utils/operates';
|
|
18
|
+
import RunTimesCondition from './order/runTimesCondition';
|
|
19
19
|
var TimeDimension = function TimeDimension(props) {
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var _condition$timeDimens, _condition$timeDimens3, _condition$timeDimens4, _condition$timeDimens5, _condition$timeDimens6, _condition$timeDimens7, _condition$timeDimens8, _condition$timeDimens9, _condition$timeDimens10, _condition$timeDimens11, _condition$timeDimens12, _condition$timeDimens13;
|
|
21
|
+
var onChange = props.onChange,
|
|
22
|
+
condition = props.condition,
|
|
23
|
+
index = props.index;
|
|
23
24
|
var _useState = useState({
|
|
24
25
|
name: '每天',
|
|
25
26
|
value: 1
|
|
@@ -28,7 +29,7 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
28
29
|
setTimeDimensionTypeList = _useState2[1];
|
|
29
30
|
var list = [];
|
|
30
31
|
var valuesList = [];
|
|
31
|
-
switch (condition.timeDimensions[index].timeDimension) {
|
|
32
|
+
switch (condition === null || condition === void 0 ? void 0 : (_condition$timeDimens = condition.timeDimensions[index]) === null || _condition$timeDimens === void 0 ? void 0 : _condition$timeDimens.timeDimension) {
|
|
32
33
|
case 1:
|
|
33
34
|
list = skyTimeOperatorType;
|
|
34
35
|
valuesList = timeValuesType;
|
|
@@ -50,21 +51,6 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
50
51
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
51
52
|
timeValuesTypeList = _useState6[0],
|
|
52
53
|
setTimeValuesTypeList = _useState6[1];
|
|
53
|
-
function onOperatorChange(data) {
|
|
54
|
-
condition.timeDimensions[index].frequencyOperator = data.value;
|
|
55
|
-
condition.timeDimensions[index].frequencyValues = [condition.timeDimensions[index].frequencyValues[0]];
|
|
56
|
-
onChange(_objectSpread({}, condition));
|
|
57
|
-
}
|
|
58
|
-
function onValue0Change(e) {
|
|
59
|
-
var value = e.target.value;
|
|
60
|
-
condition.timeDimensions[index].frequencyValues[0] = value;
|
|
61
|
-
onChange(_objectSpread({}, condition));
|
|
62
|
-
}
|
|
63
|
-
function onValue1Change(e) {
|
|
64
|
-
var value = e.target.value;
|
|
65
|
-
condition.timeDimensions[index].frequencyValues[1] = value;
|
|
66
|
-
onChange(_objectSpread({}, condition));
|
|
67
|
-
}
|
|
68
54
|
var onTimeDimensionTypeChange = function onTimeDimensionTypeChange(operate) {
|
|
69
55
|
setTimeDimensionTypeList(operate);
|
|
70
56
|
switch (operate.value) {
|
|
@@ -85,7 +71,8 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
85
71
|
onChange(_objectSpread({}, condition));
|
|
86
72
|
};
|
|
87
73
|
var onTimeOperatorTypeChange = function onTimeOperatorTypeChange(operate) {
|
|
88
|
-
|
|
74
|
+
var _condition$timeDimens2;
|
|
75
|
+
condition.timeDimensions[index].timeValues = [(_condition$timeDimens2 = condition.timeDimensions[index]) === null || _condition$timeDimens2 === void 0 ? void 0 : _condition$timeDimens2.timeValues[0]];
|
|
89
76
|
condition.timeDimensions[index].timeOperator = operate.value;
|
|
90
77
|
onChange(_objectSpread({}, condition));
|
|
91
78
|
};
|
|
@@ -108,8 +95,8 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
108
95
|
keyField: "value",
|
|
109
96
|
overlayWidth: 80,
|
|
110
97
|
value: {
|
|
111
|
-
name: condition.timeDimensions[index].timeDimension,
|
|
112
|
-
value: condition.timeDimensions[index].timeDimension
|
|
98
|
+
name: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens3 = condition.timeDimensions[index]) === null || _condition$timeDimens3 === void 0 ? void 0 : _condition$timeDimens3.timeDimension,
|
|
99
|
+
value: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens4 = condition.timeDimensions[index]) === null || _condition$timeDimens4 === void 0 ? void 0 : _condition$timeDimens4.timeDimension
|
|
113
100
|
},
|
|
114
101
|
onChange: onTimeDimensionTypeChange
|
|
115
102
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -121,11 +108,11 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
121
108
|
keyField: "value",
|
|
122
109
|
overlayWidth: 120,
|
|
123
110
|
value: {
|
|
124
|
-
name: condition.timeDimensions[index].timeOperator,
|
|
125
|
-
value: condition.timeDimensions[index].timeOperator
|
|
111
|
+
name: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens5 = condition.timeDimensions[index]) === null || _condition$timeDimens5 === void 0 ? void 0 : _condition$timeDimens5.timeOperator,
|
|
112
|
+
value: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens6 = condition.timeDimensions[index]) === null || _condition$timeDimens6 === void 0 ? void 0 : _condition$timeDimens6.timeOperator
|
|
126
113
|
},
|
|
127
114
|
onChange: onTimeOperatorTypeChange
|
|
128
|
-
})), condition.timeDimensions[index].timeOperator === 'in' || condition.timeDimensions[index].timeOperator === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
})), (condition === null || condition === void 0 ? void 0 : (_condition$timeDimens7 = condition.timeDimensions[index]) === null || _condition$timeDimens7 === void 0 ? void 0 : _condition$timeDimens7.timeOperator) === 'in' || (condition === null || condition === void 0 ? void 0 : (_condition$timeDimens8 = condition.timeDimensions[index]) === null || _condition$timeDimens8 === void 0 ? void 0 : _condition$timeDimens8.timeOperator) === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
129
116
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
130
117
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
131
118
|
className: "".concat(classPrefix, "-select-condition"),
|
|
@@ -134,11 +121,11 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
134
121
|
keyField: "value",
|
|
135
122
|
overlayWidth: 120,
|
|
136
123
|
value: {
|
|
137
|
-
name: condition.timeDimensions[index].timeValues[0],
|
|
138
|
-
value: condition.timeDimensions[index].timeValues[0]
|
|
124
|
+
name: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens9 = condition.timeDimensions[index]) === null || _condition$timeDimens9 === void 0 ? void 0 : _condition$timeDimens9.timeValues[0],
|
|
125
|
+
value: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens10 = condition.timeDimensions[index]) === null || _condition$timeDimens10 === void 0 ? void 0 : _condition$timeDimens10.timeValues[0]
|
|
139
126
|
},
|
|
140
127
|
onChange: onTimeValuesType0Change
|
|
141
|
-
})) : null, condition.timeDimensions[index].timeOperator === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
})) : null, (condition === null || condition === void 0 ? void 0 : (_condition$timeDimens11 = condition.timeDimensions[index]) === null || _condition$timeDimens11 === void 0 ? void 0 : _condition$timeDimens11.timeOperator) === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
142
129
|
className: "".concat(classPrefix, "-period-condition-operator")
|
|
143
130
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
144
131
|
className: "".concat(classPrefix, "-select-condition"),
|
|
@@ -147,54 +134,17 @@ var TimeDimension = function TimeDimension(props) {
|
|
|
147
134
|
keyField: "value",
|
|
148
135
|
overlayWidth: 120,
|
|
149
136
|
value: {
|
|
150
|
-
name: condition.timeDimensions[index].timeValues[1],
|
|
151
|
-
value: condition.timeDimensions[index].timeValues[1]
|
|
137
|
+
name: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens12 = condition.timeDimensions[index]) === null || _condition$timeDimens12 === void 0 ? void 0 : _condition$timeDimens12.timeValues[1],
|
|
138
|
+
value: condition === null || condition === void 0 ? void 0 : (_condition$timeDimens13 = condition.timeDimensions[index]) === null || _condition$timeDimens13 === void 0 ? void 0 : _condition$timeDimens13.timeValues[1]
|
|
152
139
|
},
|
|
153
140
|
onChange: onTimeValuesType1Change
|
|
154
141
|
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
155
|
-
className: "".concat(classPrefix, "-period-condition-
|
|
156
|
-
}, /*#__PURE__*/React.createElement(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
value: condition.timeDimensions[index].frequencyOperator,
|
|
163
|
-
name: condition.timeDimensions[index].frequencyOperator
|
|
164
|
-
},
|
|
165
|
-
size: "middle",
|
|
166
|
-
onChange: onOperatorChange
|
|
167
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
168
|
-
className: "".concat(classPrefix, "-period-condition")
|
|
169
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
170
|
-
key: "relative-date",
|
|
171
|
-
className: "".concat(classPrefix, "-select-condition"),
|
|
172
|
-
type: condition.timeDimensions[index].frequencyOperator !== 'between' ? 'number' : '',
|
|
173
|
-
size: "middle",
|
|
174
|
-
value: condition.timeDimensions[index].frequencyValues[0],
|
|
175
|
-
placeholder: condition.timeDimensions[index].frequencyOperator !== 'between' ? '请输入' : '输入最小值',
|
|
176
|
-
style: {
|
|
177
|
-
width: 100
|
|
178
|
-
},
|
|
179
|
-
onChange: onValue0Change,
|
|
180
|
-
suffix: condition.timeDimensions[index].frequencyOperator !== 'between' ? '次' : null
|
|
181
|
-
})), condition.timeDimensions[index].frequencyOperator === 'between' ? /*#__PURE__*/React.createElement("div", {
|
|
182
|
-
className: "".concat(classPrefix, "-period-condition"),
|
|
183
|
-
style: {
|
|
184
|
-
marginLeft: 10
|
|
185
|
-
}
|
|
186
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
187
|
-
key: "relative-date",
|
|
188
|
-
className: "".concat(classPrefix, "-select-condition"),
|
|
189
|
-
type: condition.timeDimensions[index].frequencyOperator !== 'between' ? 'number' : '',
|
|
190
|
-
size: "middle",
|
|
191
|
-
placeholder: condition.timeDimensions[index].frequencyOperator !== 'between' ? '请输入' : '输入最大值',
|
|
192
|
-
value: condition.timeDimensions[index].frequencyValues[1],
|
|
193
|
-
style: {
|
|
194
|
-
width: 100
|
|
195
|
-
},
|
|
196
|
-
onChange: onValue1Change,
|
|
197
|
-
suffix: condition.timeDimensions[index].frequencyOperator !== 'between' ? '次' : null
|
|
198
|
-
})) : null));
|
|
142
|
+
className: "".concat(classPrefix, "-period-condition-values")
|
|
143
|
+
}, /*#__PURE__*/React.createElement(RunTimesCondition, {
|
|
144
|
+
index: index,
|
|
145
|
+
dataId: props.dataId,
|
|
146
|
+
condition: condition,
|
|
147
|
+
onChange: onChange
|
|
148
|
+
}))));
|
|
199
149
|
};
|
|
200
150
|
export default TimeDimension;
|