@zgfe/business-lib 1.1.27 → 1.1.28
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/components/addPanel.js +8 -21
- package/es/addToPanel/components/radioGroup.js +1 -3
- package/es/addToPanel/components/styleList.js +5 -22
- package/es/addToPanel/demo/edit.js +5 -12
- package/es/addToPanel/demo/index.js +5 -12
- package/es/addToPanel/index.js +21 -58
- package/es/addToScene/addGroup.js +0 -4
- package/es/addToScene/demo/index.js +5 -12
- package/es/addToScene/index.js +13 -40
- package/es/assets/demo/index.js +0 -2
- package/es/assets/demo/input.js +5 -12
- package/es/assets/iconfont/iconfont.js +10 -17
- package/es/assets/theme.js +0 -1
- package/es/attrConditions/components/operateList.js +10 -27
- package/es/attrConditions/components/stringList.js +69 -98
- package/es/attrConditions/components/valuesList.js +14 -40
- package/es/attrConditions/demo/group.js +11 -23
- package/es/attrConditions/demo/index.js +17 -26
- package/es/attrConditions/group.js +17 -48
- package/es/attrConditions/index.js +22 -49
- package/es/attrConditions/types.js +0 -1
- package/es/attributeSelector/demo/disable.js +8 -16
- package/es/attributeSelector/demo/index.js +8 -17
- package/es/attributeSelector/index.js +22 -45
- package/es/attributeSelector/listPanel.js +18 -46
- package/es/attributeSelector/option.js +3 -13
- package/es/attributeSelector/types.js +0 -5
- package/es/attributeSelector/util.js +0 -3
- package/es/chart/demo/index.js +5 -14
- package/es/chart/index.js +30 -44
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +13 -37
- package/es/chart/util/data/china.js +1 -4
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +0 -5
- package/es/chart/util/formatOption.js +0 -13
- package/es/chart/util/mapUtil.js +5 -26
- package/es/config.js +0 -2
- package/es/cycleTime/demo/disable.js +0 -1
- package/es/cycleTime/index.js +19 -46
- package/es/cycleTime/month.js +8 -27
- package/es/datePicker/datePicker.js +5 -23
- package/es/datePicker/demo/customType.js +13 -22
- package/es/datePicker/demo/day.js +13 -22
- package/es/datePicker/demo/index.js +12 -21
- package/es/datePicker/index.js +18 -41
- package/es/datePicker/utils.js +0 -7
- package/es/demoWrapper/content.js +31 -56
- package/es/demoWrapper/head.js +9 -23
- package/es/demoWrapper/index.js +14 -30
- package/es/dialog/demo/index.js +5 -12
- package/es/dialog/index.js +4 -6
- package/es/dnd/demo/data.js +19 -28
- package/es/dnd/demo/handle.js +19 -28
- package/es/dnd/index.js +21 -45
- package/es/dnd/item.js +10 -30
- package/es/eventSelector/demo/index.js +12 -23
- package/es/eventSelector/index.js +14 -42
- package/es/eventSelector/listPanel.js +27 -61
- package/es/eventSelector/option.js +6 -11
- package/es/icon/iconFont.js +7 -13
- package/es/layout/analysisLayout/demo/index.js +0 -6
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +16 -34
- package/es/layout/detail/index.js +1 -3
- package/es/loginForm/index.js +7 -18
- package/es/searchInput/index.js +2 -7
- package/es/select/demo/children.js +8 -16
- package/es/select/demo/customLabel.js +0 -2
- package/es/select/demo/group.js +8 -17
- package/es/select/demo/index.js +11 -19
- package/es/select/demo/loading.js +8 -18
- package/es/select/demo/multiple.js +8 -16
- package/es/select/handle.js +14 -34
- package/es/select/index.js +22 -59
- package/es/select/option.js +10 -30
- package/es/select/overlay.js +25 -62
- package/es/table/demo/data/table.js +0 -2
- package/es/table/demo/index.js +13 -39
- package/es/table/demo/index2.js +5 -15
- package/es/table/demo/index3.js +7 -28
- package/es/table/index.js +14 -33
- package/es/targetConditionGroup/components/targetDimension.js +12 -38
- package/es/targetConditionGroup/demo/group.js +21 -36
- package/es/targetConditionGroup/demo/index.js +5 -13
- package/es/targetConditionGroup/index.js +31 -84
- package/es/targetSelector/demo/index.js +15 -28
- package/es/targetSelector/editBox.js +5 -20
- package/es/targetSelector/index.js +15 -36
- package/es/targetSelector/optionIcon.js +1 -5
- package/es/targetSelector/optionMenu.js +0 -3
- package/es/userCondition/conditionTypeList.js +7 -12
- package/es/userCondition/conditionWrap.js +0 -2
- package/es/userCondition/conditions/cdpCondition.js +51 -97
- package/es/userCondition/conditions/eventCondition.js +6 -16
- package/es/userCondition/conditions/periodCondition.js +8 -26
- package/es/userCondition/conditions/propCondition.js +29 -61
- package/es/userCondition/conditions/runTimesCondition.js +5 -10
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +15 -33
- package/es/userCondition/conditions/textDesc.js +16 -67
- package/es/userCondition/demo/index.js +11 -21
- package/es/userCondition/index.js +51 -91
- package/es/userCondition/orConditions.js +11 -48
- package/es/userCondition/relationLabel.js +1 -4
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +0 -1
- package/es/userCondition/util.js +4 -13
- package/es/userGroup/demo/group.js +14 -23
- package/es/userGroup/demo/index.js +5 -15
- package/es/userGroup/index.js +12 -30
- package/es/userTagsSelector/cascaderOverlay.js +19 -51
- package/es/userTagsSelector/components/search/index.js +0 -2
- package/es/userTagsSelector/demo/index.js +0 -3
- package/es/userTagsSelector/groups/groupOption.js +6 -8
- package/es/userTagsSelector/groups/index.js +15 -30
- package/es/userTagsSelector/index.js +17 -35
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
- package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
- package/es/userTagsSelector/util.js +0 -2
- package/es/utils/ajax.js +45 -71
- package/es/utils/base64.js +3 -22
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +4 -7
- package/es/utils/util.js +0 -16
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
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); }
|
|
1
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; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
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
7
|
import React, { useContext } from 'react';
|
|
8
8
|
import BizEventSelector from '../../eventSelector';
|
|
9
9
|
import RunTimesCondition from './runTimesCondition';
|
|
@@ -13,43 +13,35 @@ import './styles/eventCondition.less';
|
|
|
13
13
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
14
14
|
import { Tooltip } from 'antd';
|
|
15
15
|
import IconFont from '../../icon/iconFont';
|
|
16
|
-
|
|
17
16
|
var EventCondition = function EventCondition(props) {
|
|
18
17
|
var _useContext = useContext(BizUserConditionContext),
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
isRealTime = _useContext.isRealTime;
|
|
21
19
|
var condition = props.condition,
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
dataId = props.dataId;
|
|
24
21
|
function onChange(data) {
|
|
25
22
|
props.onChange(dataId, data);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
function onEventChange(data) {
|
|
29
25
|
var event = data.event;
|
|
30
26
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
31
27
|
eventId: event.id
|
|
32
28
|
}));
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
function onRunTimesChange(newRunTimes) {
|
|
36
31
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
37
32
|
runTimes: newRunTimes
|
|
38
33
|
}));
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
function onPeriodChange(_dataId, newPeriod) {
|
|
42
36
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
43
37
|
runPeriod: newPeriod
|
|
44
38
|
}));
|
|
45
39
|
}
|
|
46
|
-
|
|
47
40
|
function onAttrChange(_dataId, newAttrs) {
|
|
48
41
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
49
42
|
attrs: newAttrs
|
|
50
43
|
}));
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
function onAddAttr() {
|
|
54
46
|
onChange(_objectSpread(_objectSpread({}, condition), {}, {
|
|
55
47
|
attrs: [{
|
|
@@ -58,7 +50,6 @@ var EventCondition = function EventCondition(props) {
|
|
|
58
50
|
}]
|
|
59
51
|
}));
|
|
60
52
|
}
|
|
61
|
-
|
|
62
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
54
|
className: "".concat(classPrefix, "-event-condition")
|
|
64
55
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -115,5 +106,4 @@ var EventCondition = function EventCondition(props) {
|
|
|
115
106
|
isRealTime: isRealTime
|
|
116
107
|
})))));
|
|
117
108
|
};
|
|
118
|
-
|
|
119
109
|
export default EventCondition;
|
|
@@ -1,9 +1,9 @@
|
|
|
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); }
|
|
1
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; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
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
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
import BizSelect from '../../select';
|
|
9
9
|
import { Input, DatePicker, Checkbox } from 'antd';
|
|
@@ -12,12 +12,11 @@ import './styles/periodCondition.less';
|
|
|
12
12
|
import { classPrefix } from '..';
|
|
13
13
|
import { operatorMap } from './constants';
|
|
14
14
|
var RangePicker = DatePicker.RangePicker;
|
|
15
|
-
|
|
16
15
|
var PeriodCondition = function PeriodCondition(props) {
|
|
17
16
|
var dataId = props.dataId,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
label = props.label,
|
|
18
|
+
isEvent = props.isEvent,
|
|
19
|
+
runPeriod = props.runPeriod;
|
|
21
20
|
var options = [{
|
|
22
21
|
text: '最近',
|
|
23
22
|
value: 'relative'
|
|
@@ -25,7 +24,6 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
25
24
|
text: '固定时段',
|
|
26
25
|
value: 'absolute'
|
|
27
26
|
}];
|
|
28
|
-
|
|
29
27
|
if (isEvent) {
|
|
30
28
|
options = options.concat([{
|
|
31
29
|
text: '任意时间',
|
|
@@ -35,7 +33,6 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
35
33
|
value: 'join_time'
|
|
36
34
|
}]);
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
var unit = useMemo(function () {
|
|
40
37
|
if (runPeriod.operator === 'absolute' || runPeriod.operator === 'unlimited_time') {
|
|
41
38
|
return '';
|
|
@@ -45,33 +42,26 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
45
42
|
return '天内';
|
|
46
43
|
}
|
|
47
44
|
}, [runPeriod.operator]);
|
|
48
|
-
|
|
49
45
|
function onChange(data) {
|
|
50
46
|
props.onChange(dataId, data);
|
|
51
47
|
}
|
|
52
|
-
|
|
53
48
|
function onOperatorChange(option) {
|
|
54
49
|
var newData = {
|
|
55
50
|
operator: option.value
|
|
56
51
|
};
|
|
57
|
-
|
|
58
52
|
if (newData.operator === 'absolute') {
|
|
59
53
|
var endDate = moment().format('YYYY-MM-DD');
|
|
60
54
|
var startDate = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
|
61
55
|
newData.values = [startDate, endDate];
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
if (newData.operator === 'relative') {
|
|
65
58
|
newData.values = ['30', '0'];
|
|
66
59
|
}
|
|
67
|
-
|
|
68
60
|
if (newData.operator === 'join_time') {
|
|
69
61
|
newData.values = ['3', '0'];
|
|
70
62
|
}
|
|
71
|
-
|
|
72
63
|
onChange(newData);
|
|
73
64
|
}
|
|
74
|
-
|
|
75
65
|
function onDateChange(newData) {
|
|
76
66
|
if (runPeriod.operator === 'absolute') {
|
|
77
67
|
var dateRange = newData;
|
|
@@ -88,23 +78,18 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
88
78
|
}));
|
|
89
79
|
}
|
|
90
80
|
}
|
|
91
|
-
|
|
92
81
|
function onChangeToday(e) {
|
|
93
82
|
var newValues = [runPeriod.values[0], '0'];
|
|
94
|
-
|
|
95
83
|
if (e.target.checked) {
|
|
96
84
|
newValues[1] = '1';
|
|
97
85
|
}
|
|
98
|
-
|
|
99
86
|
onChange(_objectSpread(_objectSpread({}, runPeriod), {}, {
|
|
100
87
|
values: newValues
|
|
101
88
|
}));
|
|
102
89
|
}
|
|
103
|
-
|
|
104
90
|
function renderValues() {
|
|
105
91
|
var operator = runPeriod.operator,
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
values = runPeriod.values;
|
|
108
93
|
if (operator === 'relative' || operator === 'join_time') {
|
|
109
94
|
return /*#__PURE__*/React.createElement(Input, {
|
|
110
95
|
size: "middle",
|
|
@@ -115,7 +100,6 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
115
100
|
}
|
|
116
101
|
});
|
|
117
102
|
}
|
|
118
|
-
|
|
119
103
|
if (operator === 'absolute') {
|
|
120
104
|
return /*#__PURE__*/React.createElement(RangePicker, {
|
|
121
105
|
size: "middle",
|
|
@@ -125,7 +109,6 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
125
109
|
});
|
|
126
110
|
}
|
|
127
111
|
}
|
|
128
|
-
|
|
129
112
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
113
|
className: "".concat(classPrefix, "-period-condition")
|
|
131
114
|
}, label ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -159,7 +142,6 @@ var PeriodCondition = function PeriodCondition(props) {
|
|
|
159
142
|
onChange: onChangeToday
|
|
160
143
|
}, "\u4E0D\u5305\u542B\u4ECA\u5929")) : null);
|
|
161
144
|
};
|
|
162
|
-
|
|
163
145
|
PeriodCondition.defaultProps = {
|
|
164
146
|
isEvent: false,
|
|
165
147
|
isRealTime: false
|
|
@@ -1,29 +1,19 @@
|
|
|
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); }
|
|
1
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; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
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
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
|
|
9
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
|
|
13
10
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
-
|
|
15
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
-
|
|
17
12
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
|
|
19
13
|
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); }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
24
|
-
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
25
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
-
|
|
27
17
|
import React, { useEffect, useState } from 'react';
|
|
28
18
|
import { PlusOutlined } from '@ant-design/icons';
|
|
29
19
|
import BizConditionItem from '../../attrConditions';
|
|
@@ -42,37 +32,30 @@ var attrNumTypeMap = {
|
|
|
42
32
|
'cont-num': 2,
|
|
43
33
|
'cont-date': 3
|
|
44
34
|
};
|
|
45
|
-
|
|
46
35
|
var PropCondition = function PropCondition(props) {
|
|
47
36
|
var _useContext = useContext(BizUserConditionContext),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
envNameList = _useContext.envNameList,
|
|
38
|
+
userPropsMap = _useContext.userPropsMap;
|
|
51
39
|
var _useContext2 = useContext(BizUserConditionContext),
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
eventAttrNum = _useContext2.eventAttrNum;
|
|
54
41
|
var isEvent = props.isEvent,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
label = props.label,
|
|
43
|
+
attrs = props.attrs,
|
|
44
|
+
dataId = props.dataId,
|
|
45
|
+
eventId = props.eventId;
|
|
60
46
|
var _useState = useState([]),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
showList = _useState2[0],
|
|
49
|
+
setShowList = _useState2[1];
|
|
65
50
|
useEffect(function () {
|
|
66
51
|
buildDefault();
|
|
67
52
|
}, []);
|
|
68
|
-
|
|
69
53
|
function buildDefault() {
|
|
70
54
|
var list = [];
|
|
71
55
|
attrs.forEach(function (attr) {
|
|
72
56
|
var attrId = attr.attrId,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
57
|
+
attrName = attr.attrName,
|
|
58
|
+
operator = attr.operator;
|
|
76
59
|
if ((attrName || attrId) && operator) {
|
|
77
60
|
attr.operator = transformNumberOperate(operator, false);
|
|
78
61
|
list.push({
|
|
@@ -89,17 +72,14 @@ var PropCondition = function PropCondition(props) {
|
|
|
89
72
|
});
|
|
90
73
|
setShowList(list);
|
|
91
74
|
}
|
|
92
|
-
|
|
93
75
|
function _onChange(data, i) {
|
|
94
76
|
var attrName = data.attrName,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
attrId = data.attrId,
|
|
78
|
+
category = data.category,
|
|
79
|
+
type = data.type,
|
|
80
|
+
operator = data.operator,
|
|
81
|
+
values = data.values;
|
|
101
82
|
var newAttrs = _toConsumableArray(attrs);
|
|
102
|
-
|
|
103
83
|
var newAttr = {
|
|
104
84
|
attrName: attrName,
|
|
105
85
|
attrId: attrId,
|
|
@@ -111,7 +91,6 @@ var PropCondition = function PropCondition(props) {
|
|
|
111
91
|
Object.assign(newAttrs[i], newAttr);
|
|
112
92
|
props.onChange(dataId, newAttrs);
|
|
113
93
|
}
|
|
114
|
-
|
|
115
94
|
function onAddAttr() {
|
|
116
95
|
var attr = {
|
|
117
96
|
attrId: 0
|
|
@@ -122,37 +101,31 @@ var PropCondition = function PropCondition(props) {
|
|
|
122
101
|
}]));
|
|
123
102
|
props.onChange(dataId, [].concat(_toConsumableArray(attrs), [attr]));
|
|
124
103
|
}
|
|
125
|
-
|
|
126
104
|
function onRemoveAttr(i) {
|
|
127
105
|
var newAttrs = _toConsumableArray(attrs);
|
|
128
|
-
|
|
129
106
|
var newList = _toConsumableArray(showList);
|
|
130
|
-
|
|
131
107
|
newList.splice(i, 1);
|
|
132
108
|
newAttrs.splice(i, 1);
|
|
133
109
|
setShowList(newList);
|
|
134
110
|
props.onChange(dataId, newAttrs);
|
|
135
111
|
}
|
|
136
|
-
|
|
137
112
|
function getPropCategory(attrName) {
|
|
138
113
|
if (!isEvent) return 'userProp';
|
|
139
114
|
if (attrName === undefined) return 'eventProp';
|
|
140
115
|
if (envNameList.includes(attrName)) return 'envProp';
|
|
141
116
|
return 'eventProp';
|
|
142
117
|
}
|
|
143
|
-
|
|
144
118
|
function renderAttr(item, i) {
|
|
145
119
|
var props = {};
|
|
146
120
|
var id = item.id;
|
|
147
|
-
|
|
148
121
|
if (item.default) {
|
|
149
122
|
var _item$default = item.default,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
123
|
+
attrId = _item$default.attrId,
|
|
124
|
+
attrName = _item$default.attrName,
|
|
125
|
+
category = _item$default.category,
|
|
126
|
+
operator = _item$default.operator,
|
|
127
|
+
params = _item$default.params,
|
|
128
|
+
attrType = _item$default.attrType;
|
|
156
129
|
props.defaultValue = {
|
|
157
130
|
attrName: attrName,
|
|
158
131
|
category: category || 'custom',
|
|
@@ -162,16 +135,13 @@ var PropCondition = function PropCondition(props) {
|
|
|
162
135
|
type: attrNumTypeMap[attrType]
|
|
163
136
|
};
|
|
164
137
|
attrId && (props.defaultValue.attrId = attrId);
|
|
165
|
-
|
|
166
138
|
if (userPropsMap[attrName] && userPropsMap[attrName].subtype) {
|
|
167
139
|
props.defaultValue.subtype = userPropsMap[attrName].subtype;
|
|
168
140
|
}
|
|
169
141
|
}
|
|
170
|
-
|
|
171
142
|
if (isEvent) {
|
|
172
143
|
props.eventIdList = [eventId];
|
|
173
144
|
}
|
|
174
|
-
|
|
175
145
|
return /*#__PURE__*/React.createElement("div", {
|
|
176
146
|
className: "".concat(classPrefix, "-prop-condition-attr"),
|
|
177
147
|
key: id
|
|
@@ -193,7 +163,6 @@ var PropCondition = function PropCondition(props) {
|
|
|
193
163
|
theme: "normal"
|
|
194
164
|
}, props))));
|
|
195
165
|
}
|
|
196
|
-
|
|
197
166
|
return /*#__PURE__*/React.createElement("div", {
|
|
198
167
|
className: "".concat(classPrefix, "-prop-condition")
|
|
199
168
|
}, label ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -209,7 +178,6 @@ var PropCondition = function PropCondition(props) {
|
|
|
209
178
|
onClick: onAddAttr
|
|
210
179
|
}, /*#__PURE__*/React.createElement(PlusOutlined, null))) : null);
|
|
211
180
|
};
|
|
212
|
-
|
|
213
181
|
PropCondition.defaultProps = {
|
|
214
182
|
isEvent: false
|
|
215
183
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
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); }
|
|
1
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; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
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
7
|
import React from 'react';
|
|
8
8
|
import { Input, Tooltip, Space } from 'antd';
|
|
9
9
|
import { InfoCircleOutlined } from '@ant-design/icons';
|
|
@@ -29,24 +29,20 @@ var options = [{
|
|
|
29
29
|
value: 'not equal',
|
|
30
30
|
text: '≠'
|
|
31
31
|
}];
|
|
32
|
-
|
|
33
32
|
var RunTimesCondition = function RunTimesCondition(props) {
|
|
34
33
|
var runTimes = props.runTimes,
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
onChange = props.onChange;
|
|
37
35
|
function onOperatorChange(data) {
|
|
38
36
|
onChange(_objectSpread(_objectSpread({}, runTimes), {}, {
|
|
39
37
|
operator: data.value
|
|
40
38
|
}));
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
function onValueChange(e) {
|
|
44
41
|
var value = e.target.value;
|
|
45
42
|
onChange(_objectSpread(_objectSpread({}, runTimes), {}, {
|
|
46
43
|
values: [value]
|
|
47
44
|
}));
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
47
|
className: "".concat(classPrefix, "-runtimes-condition")
|
|
52
48
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -75,5 +71,4 @@ var RunTimesCondition = function RunTimesCondition(props) {
|
|
|
75
71
|
className: "".concat(classPrefix, "-runtimes-tip")
|
|
76
72
|
}, /*#__PURE__*/React.createElement(InfoCircleOutlined, null))))));
|
|
77
73
|
};
|
|
78
|
-
|
|
79
74
|
export default RunTimesCondition;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AllConditionBasePropsI, BizUserConditionT } from '../types';
|
|
3
3
|
import './styles/tagsCondition.less';
|
|
4
|
-
|
|
4
|
+
type Labels = BizUserConditionT.Labels;
|
|
5
5
|
export interface TagsConditionPropI extends AllConditionBasePropsI<Labels> {
|
|
6
6
|
labels: Labels;
|
|
7
7
|
}
|
|
@@ -1,21 +1,15 @@
|
|
|
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); }
|
|
1
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; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
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
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
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."); }
|
|
10
|
-
|
|
11
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); }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
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; } }
|
|
17
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
13
|
import React, { useContext, useMemo, useState } from 'react';
|
|
20
14
|
import { BizUserConditionContext, classPrefix } from '..';
|
|
21
15
|
import BizSelect from '../../select';
|
|
@@ -31,31 +25,25 @@ var options = [{
|
|
|
31
25
|
value: 'not equal',
|
|
32
26
|
text: '不是'
|
|
33
27
|
}];
|
|
34
|
-
|
|
35
28
|
var TagsCondition = function TagsCondition(props) {
|
|
36
29
|
var _useContext = useContext(BizUserConditionContext),
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
userTagsData = _useContext.userTagsData;
|
|
39
31
|
var labels = props.labels,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
dataId = props.dataId,
|
|
33
|
+
onChange = props.onChange;
|
|
43
34
|
var _useState = useState(function () {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
return buildDefaultValues();
|
|
36
|
+
}),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
38
|
+
defaultValues = _useState2[0];
|
|
49
39
|
var tagGroupList = useMemo(function () {
|
|
50
40
|
return buildTagsGroup(userTagsData || []);
|
|
51
41
|
}, [userTagsData]);
|
|
52
|
-
|
|
53
42
|
function onOperatorChange(operator) {
|
|
54
43
|
onChange(dataId, _objectSpread(_objectSpread({}, labels), {}, {
|
|
55
44
|
operator: operator.value
|
|
56
45
|
}));
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
function onTagsChange(data) {
|
|
60
48
|
var values = data.map(function (item) {
|
|
61
49
|
return "".concat(item[1].id, ":").concat(item[2].layerLabelId);
|
|
@@ -64,7 +52,6 @@ var TagsCondition = function TagsCondition(props) {
|
|
|
64
52
|
values: values
|
|
65
53
|
}));
|
|
66
54
|
}
|
|
67
|
-
|
|
68
55
|
function buildDefaultValues() {
|
|
69
56
|
var values = [];
|
|
70
57
|
var findTag = buildSelectLayer(userTagsData);
|
|
@@ -72,20 +59,16 @@ var TagsCondition = function TagsCondition(props) {
|
|
|
72
59
|
if (_.isNumber(value)) {
|
|
73
60
|
return;
|
|
74
61
|
}
|
|
75
|
-
|
|
76
62
|
var _value$split = value.split(':'),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
_value$split2 = _slicedToArray(_value$split, 2),
|
|
64
|
+
layerId = _value$split2[1];
|
|
80
65
|
var selectValue = findTag(Number(layerId));
|
|
81
|
-
|
|
82
66
|
if (selectValue) {
|
|
83
67
|
values.push(selectValue);
|
|
84
68
|
}
|
|
85
69
|
});
|
|
86
70
|
return values;
|
|
87
71
|
}
|
|
88
|
-
|
|
89
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
90
73
|
className: "".concat(classPrefix, "-tags-condition")
|
|
91
74
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -116,5 +99,4 @@ var TagsCondition = function TagsCondition(props) {
|
|
|
116
99
|
className: "".concat(classPrefix, "-tags-condition-unit")
|
|
117
100
|
}));
|
|
118
101
|
};
|
|
119
|
-
|
|
120
102
|
export default TagsCondition;
|