@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,53 +1,41 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useState } from 'react';
|
|
14
8
|
import { BizTargetSelector, BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
15
9
|
import eventData from '../../mock/event';
|
|
16
10
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
17
|
-
|
|
18
11
|
var EventDemo = function EventDemo() {
|
|
19
12
|
var store = convertAttributeData({
|
|
20
13
|
eventList: eventData
|
|
21
14
|
});
|
|
22
|
-
|
|
23
15
|
var _useState = useState({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
alias: '别名',
|
|
17
|
+
value: {
|
|
18
|
+
group: {
|
|
19
|
+
id: 4199
|
|
20
|
+
},
|
|
21
|
+
event: {
|
|
22
|
+
id: 24220583,
|
|
23
|
+
name: '菜单导航'
|
|
24
|
+
}
|
|
32
25
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
setValue = _useState2[1];
|
|
38
|
-
|
|
26
|
+
}),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
value = _useState2[0],
|
|
29
|
+
setValue = _useState2[1];
|
|
39
30
|
var handleChange = function handleChange(value) {
|
|
40
31
|
setValue(value);
|
|
41
32
|
};
|
|
42
|
-
|
|
43
33
|
var handleAdd = function handleAdd(data) {
|
|
44
34
|
console.log('add', data);
|
|
45
35
|
};
|
|
46
|
-
|
|
47
36
|
var handleDelete = function handleDelete(data) {
|
|
48
37
|
console.log('delete', data);
|
|
49
38
|
};
|
|
50
|
-
|
|
51
39
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
52
40
|
value: {
|
|
53
41
|
eventGroupList: store.eventGroupList
|
|
@@ -61,7 +49,6 @@ var EventDemo = function EventDemo() {
|
|
|
61
49
|
border: false
|
|
62
50
|
}))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u662F\uFF1A\u5206\u7EC4id: ", value.value.group.id, " \u4E8B\u4EF6\u540D\u79F0: ", value.value.event.name));
|
|
63
51
|
};
|
|
64
|
-
|
|
65
52
|
export default (function () {
|
|
66
53
|
return /*#__PURE__*/React.createElement(EventDemo, null);
|
|
67
54
|
});
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import { Button, Input, message } from 'antd';
|
|
14
8
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
9
|
import { classPrefix } from '.';
|
|
16
10
|
import IconFont from '../icon/iconFont';
|
|
17
|
-
|
|
18
11
|
var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
19
12
|
var inputRef = useRef(null);
|
|
20
|
-
|
|
21
13
|
var _useState = useState(props.defaultValue || ''),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
alias = _useState2[0],
|
|
16
|
+
setAlias = _useState2[1];
|
|
26
17
|
useEffect(function () {
|
|
27
18
|
inputRef.current.focus({
|
|
28
19
|
cursor: 'end'
|
|
@@ -32,26 +23,21 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
|
32
23
|
var reg = new RegExp("^[0-9A-Za-z\u4E00-\u9FA5]+$");
|
|
33
24
|
return reg.test(alias) || alias === '';
|
|
34
25
|
}, [alias]);
|
|
35
|
-
|
|
36
26
|
var onClick = function onClick() {
|
|
37
27
|
if (aliasStatus) {
|
|
38
28
|
if (props.disabled && props.disabled === alias) {
|
|
39
29
|
message.error('不能与事件名相同!');
|
|
40
30
|
return;
|
|
41
31
|
}
|
|
42
|
-
|
|
43
32
|
props.onChange && props.onChange(alias);
|
|
44
33
|
}
|
|
45
34
|
};
|
|
46
|
-
|
|
47
35
|
var onCancel = function onCancel() {
|
|
48
36
|
props.onCancel && props.onCancel();
|
|
49
37
|
};
|
|
50
|
-
|
|
51
38
|
var onChange = function onChange(e) {
|
|
52
39
|
setAlias(e.target.value);
|
|
53
40
|
};
|
|
54
|
-
|
|
55
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
42
|
className: "".concat(classPrefix, "-modal")
|
|
57
43
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -79,5 +65,4 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
|
|
|
79
65
|
type: "primary"
|
|
80
66
|
}, "\u786E\u5B9A")));
|
|
81
67
|
};
|
|
82
|
-
|
|
83
68
|
export default BizEventNameEditBox;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useEffect, useState } from 'react';
|
|
14
8
|
import BizEventNameEditBox from './editBox';
|
|
15
9
|
import { Dropdown } from 'antd';
|
|
@@ -17,33 +11,26 @@ import './styles/index.less';
|
|
|
17
11
|
import BizTargetOptionIcon from './optionIcon';
|
|
18
12
|
import BizTargetOptionMenu from './optionMenu';
|
|
19
13
|
export var classPrefix = 'biz-target-select';
|
|
20
|
-
|
|
21
14
|
var BizTargetSelector = function BizTargetSelector(props) {
|
|
22
15
|
var _targetData$event;
|
|
23
|
-
|
|
24
16
|
var enableAdd = props.enableAdd,
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
enableDelete = props.enableDelete;
|
|
27
18
|
var _useState = useState(''),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
alias = _useState2[0],
|
|
21
|
+
setAlias = _useState2[1];
|
|
32
22
|
var _useState3 = useState(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
24
|
+
targetData = _useState4[0],
|
|
25
|
+
setTargetData = _useState4[1];
|
|
37
26
|
var _useState5 = useState(false),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
28
|
+
showEditModal = _useState6[0],
|
|
29
|
+
setShowEditModal = _useState6[1];
|
|
42
30
|
var _useState7 = useState(false),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
32
|
+
visible = _useState8[0],
|
|
33
|
+
setVisible = _useState8[1];
|
|
47
34
|
useEffect(function () {
|
|
48
35
|
if (!props.defaultValue) return;
|
|
49
36
|
setAlias(props.defaultValue.alias || '');
|
|
@@ -54,10 +41,8 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
54
41
|
setAlias(props.value.alias || '');
|
|
55
42
|
setTargetData(props.value.value || undefined);
|
|
56
43
|
}, [props.value]);
|
|
57
|
-
|
|
58
44
|
var onClickIcon = function onClickIcon(name) {
|
|
59
45
|
setVisible(false);
|
|
60
|
-
|
|
61
46
|
if (name === 'edit') {
|
|
62
47
|
setShowEditModal(true);
|
|
63
48
|
} else if (name === 'add') {
|
|
@@ -76,11 +61,9 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
63
|
};
|
|
79
|
-
|
|
80
64
|
var onCancelEdit = function onCancelEdit() {
|
|
81
65
|
setShowEditModal(false);
|
|
82
66
|
};
|
|
83
|
-
|
|
84
67
|
var onChangeAlias = function onChangeAlias(value) {
|
|
85
68
|
setShowEditModal(false);
|
|
86
69
|
setAlias(value);
|
|
@@ -89,7 +72,6 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
89
72
|
value: targetData
|
|
90
73
|
});
|
|
91
74
|
};
|
|
92
|
-
|
|
93
75
|
var onChange = function onChange(value) {
|
|
94
76
|
setTargetData(value);
|
|
95
77
|
props.onChange && props.onChange({
|
|
@@ -97,11 +79,9 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
97
79
|
value: value
|
|
98
80
|
});
|
|
99
81
|
};
|
|
100
|
-
|
|
101
82
|
var onVisibleChange = function onVisibleChange(flag) {
|
|
102
83
|
setVisible(flag);
|
|
103
84
|
};
|
|
104
|
-
|
|
105
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
106
86
|
className: classPrefix
|
|
107
87
|
}, /*#__PURE__*/React.cloneElement(props.children, {
|
|
@@ -143,7 +123,6 @@ var BizTargetSelector = function BizTargetSelector(props) {
|
|
|
143
123
|
onChange: onChangeAlias
|
|
144
124
|
}));
|
|
145
125
|
};
|
|
146
|
-
|
|
147
126
|
BizTargetSelector.defaultProps = {
|
|
148
127
|
enableAdd: true,
|
|
149
128
|
enableDelete: true
|
|
@@ -2,15 +2,12 @@ import { Tooltip } from 'antd';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { classPrefix } from '.';
|
|
4
4
|
import IconFont from '../icon/iconFont';
|
|
5
|
-
|
|
6
5
|
var BizTargetOptionIcon = function BizTargetOptionIcon(props) {
|
|
7
6
|
var enabled = props.enabled,
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
title = props.title;
|
|
10
8
|
var onClick = function onClick() {
|
|
11
9
|
if (props.onClick && enabled) props.onClick(props.name);
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
15
12
|
title: title,
|
|
16
13
|
key: props.name
|
|
@@ -20,5 +17,4 @@ var BizTargetOptionIcon = function BizTargetOptionIcon(props) {
|
|
|
20
17
|
onClick: onClick
|
|
21
18
|
}));
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
export default BizTargetOptionIcon;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { classPrefix } from '.';
|
|
3
3
|
import IconFont from '../icon/iconFont';
|
|
4
|
-
|
|
5
4
|
var BizTargetOptionMenu = function BizTargetOptionMenu(props) {
|
|
6
5
|
var _onClick = function onClick(name) {
|
|
7
6
|
if (props.onClick) props.onClick(name);
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
9
|
className: "".concat(classPrefix, "-menu")
|
|
12
10
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -34,5 +32,4 @@ var BizTargetOptionMenu = function BizTargetOptionMenu(props) {
|
|
|
34
32
|
type: "shanchu"
|
|
35
33
|
}), /*#__PURE__*/React.createElement("span", null, "\u5220\u9664\u6307\u6807")));
|
|
36
34
|
};
|
|
37
|
-
|
|
38
35
|
export default BizTargetOptionMenu;
|
|
@@ -5,21 +5,17 @@ import './styles/conditionTypeList.less';
|
|
|
5
5
|
import { BizUserConditionContext } from '.';
|
|
6
6
|
import BizGlobalDataContext from '../context';
|
|
7
7
|
import IconFont from '../icon/iconFont';
|
|
8
|
-
|
|
9
8
|
var ConditionTypeList = function ConditionTypeList(props) {
|
|
10
9
|
var onAdd = props.onAdd,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
label = props.label,
|
|
11
|
+
show = props.show;
|
|
14
12
|
var _useContext = useContext(BizUserConditionContext),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
textMode = _useContext.textMode,
|
|
14
|
+
openTagCondition = _useContext.openTagCondition,
|
|
15
|
+
openCdpCondition = _useContext.openCdpCondition,
|
|
16
|
+
cdpTip = _useContext.cdpTip;
|
|
20
17
|
var _useContext2 = useContext(BizGlobalDataContext),
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
menuNameMap = _useContext2.menuNameMap;
|
|
23
19
|
if (!show || textMode) return null;
|
|
24
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
21
|
className: "biz-user-condition-type-list"
|
|
@@ -75,7 +71,6 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
75
71
|
type: "tishiicon"
|
|
76
72
|
})) : null)) : null));
|
|
77
73
|
};
|
|
78
|
-
|
|
79
74
|
ConditionTypeList.defaultProps = {
|
|
80
75
|
show: true
|
|
81
76
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import IconFont from '../icon/iconFont';
|
|
3
3
|
import './styles/conditionWrap.less';
|
|
4
|
-
|
|
5
4
|
var ConditionWrap = function ConditionWrap(props) {
|
|
6
5
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
6
|
className: "biz-user-condition-item-wrap"
|
|
@@ -16,5 +15,4 @@ var ConditionWrap = function ConditionWrap(props) {
|
|
|
16
15
|
type: "qingchu"
|
|
17
16
|
})));
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
export default ConditionWrap;
|
|
@@ -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, useEffect, useState } from 'react';
|
|
20
14
|
import BizSelect from '../../select';
|
|
21
15
|
import { PropType } from '../types';
|
|
@@ -29,74 +23,62 @@ import request from '../../utils/ajax';
|
|
|
29
23
|
import Apis from '../../constants/apis';
|
|
30
24
|
import BizGlobalDataContext from '../../context';
|
|
31
25
|
var classPrefix = 'biz-user-condition-cdp';
|
|
32
|
-
|
|
33
26
|
var CdpConditionItem = function CdpConditionItem(props) {
|
|
34
27
|
var _useContext = useContext(BizGlobalDataContext),
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
currentApp = _useContext.currentApp;
|
|
37
29
|
var _useContext2 = useContext(BizUserConditionContext),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
_useContext2$datasetL = _useContext2.datasetList,
|
|
31
|
+
datasetList = _useContext2$datasetL === void 0 ? [] : _useContext2$datasetL;
|
|
41
32
|
var _useState = useState(function () {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
setDataset = _useState2[1];
|
|
54
|
-
|
|
33
|
+
if (props.value) {
|
|
34
|
+
return {
|
|
35
|
+
id: props.value.datasetId,
|
|
36
|
+
tableName: props.value.datasetTable
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
dataset = _useState2[0],
|
|
43
|
+
setDataset = _useState2[1];
|
|
55
44
|
var _useState3 = useState(false),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
|
+
loading = _useState4[0],
|
|
47
|
+
setLoading = _useState4[1];
|
|
60
48
|
var _useState5 = useState(),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
+
field = _useState6[0],
|
|
51
|
+
setField = _useState6[1];
|
|
65
52
|
var _useState7 = useState(),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
54
|
+
operator = _useState8[0],
|
|
55
|
+
setOperator = _useState8[1];
|
|
70
56
|
var _useState9 = useState(),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
58
|
+
fieldValue = _useState10[0],
|
|
59
|
+
setFieldValue = _useState10[1];
|
|
75
60
|
var _useState11 = useState([]),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
62
|
+
fieldList = _useState12[0],
|
|
63
|
+
setFieldList = _useState12[1];
|
|
80
64
|
var _useState13 = useState(true),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
66
|
+
isFirst = _useState14[0],
|
|
67
|
+
setIsFirst = _useState14[1];
|
|
85
68
|
useEffect(function () {
|
|
86
69
|
if (!props.value) {
|
|
87
70
|
setIsFirst(false);
|
|
88
71
|
return;
|
|
89
72
|
}
|
|
90
|
-
|
|
91
73
|
var _props$value = props.value,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
74
|
+
datasetId = _props$value.datasetId,
|
|
75
|
+
datasetTable = _props$value.datasetTable,
|
|
76
|
+
datasetName = _props$value.datasetName,
|
|
77
|
+
fieldName = _props$value.fieldName,
|
|
78
|
+
fieldType = _props$value.fieldType,
|
|
79
|
+
webType = _props$value.webType,
|
|
80
|
+
operator = _props$value.operator,
|
|
81
|
+
params = _props$value.params;
|
|
100
82
|
setDataset({
|
|
101
83
|
id: datasetId,
|
|
102
84
|
tableName: datasetTable,
|
|
@@ -110,11 +92,9 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
110
92
|
setOperator({
|
|
111
93
|
value: operator
|
|
112
94
|
});
|
|
113
|
-
|
|
114
95
|
if (params) {
|
|
115
96
|
setFieldValue(params);
|
|
116
97
|
}
|
|
117
|
-
|
|
118
98
|
onDatasetChange(datasetId);
|
|
119
99
|
setTimeout(function () {
|
|
120
100
|
setIsFirst(false);
|
|
@@ -139,29 +119,23 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
139
119
|
if (isFirst) return;
|
|
140
120
|
if (['absolute', 'relative', 'is null', 'is not null'].includes(operator === null || operator === void 0 ? void 0 : operator.value)) setFieldValue([]);
|
|
141
121
|
}, [operator]);
|
|
142
|
-
|
|
143
122
|
var getType = function getType(type) {
|
|
144
123
|
if (!type) return;
|
|
145
|
-
|
|
146
124
|
if (type === PropType.STRING2) {
|
|
147
125
|
return PropType.STRING;
|
|
148
126
|
}
|
|
149
|
-
|
|
150
127
|
if (type === PropType.NUMBER2) {
|
|
151
128
|
return PropType.NUMBER;
|
|
152
129
|
}
|
|
153
|
-
|
|
154
130
|
if (type === PropType.DATE2) {
|
|
155
131
|
return PropType.DATE;
|
|
156
132
|
}
|
|
157
133
|
};
|
|
158
|
-
|
|
159
134
|
var onDatasetChange = function onDatasetChange(datasetId) {
|
|
160
135
|
if (!datasetId) {
|
|
161
136
|
setFieldList([]);
|
|
162
137
|
return;
|
|
163
138
|
}
|
|
164
|
-
|
|
165
139
|
setLoading(true);
|
|
166
140
|
request(Apis.queryDatasetDetail, {
|
|
167
141
|
method: 'post',
|
|
@@ -179,7 +153,6 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
179
153
|
setFieldList([]);
|
|
180
154
|
});
|
|
181
155
|
};
|
|
182
|
-
|
|
183
156
|
var onTableChange = function onTableChange(data) {
|
|
184
157
|
setDataset(data);
|
|
185
158
|
setField({
|
|
@@ -189,41 +162,32 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
189
162
|
setFieldValue([]);
|
|
190
163
|
onDatasetChange(data.id);
|
|
191
164
|
};
|
|
192
|
-
|
|
193
165
|
var onFieldChange = function onFieldChange(data) {
|
|
194
166
|
setField(data);
|
|
195
167
|
setOperator(getOptions(data.webType)[0]);
|
|
196
168
|
setFieldValue([]);
|
|
197
169
|
};
|
|
198
|
-
|
|
199
170
|
var onOperateChange = function onOperateChange(operate) {
|
|
200
171
|
setOperator(operate);
|
|
201
172
|
setFieldValue([]);
|
|
202
173
|
};
|
|
203
|
-
|
|
204
174
|
function getOptions(type) {
|
|
205
175
|
var list = [];
|
|
206
|
-
|
|
207
176
|
switch (type) {
|
|
208
177
|
case PropType.DATE2:
|
|
209
178
|
list = dateOperate;
|
|
210
179
|
break;
|
|
211
|
-
|
|
212
180
|
case PropType.NUMBER2:
|
|
213
181
|
list = numberOperate;
|
|
214
182
|
break;
|
|
215
|
-
|
|
216
183
|
case PropType.STRING2:
|
|
217
184
|
list = stringOperate;
|
|
218
185
|
break;
|
|
219
|
-
|
|
220
186
|
default:
|
|
221
187
|
list = [];
|
|
222
188
|
}
|
|
223
|
-
|
|
224
189
|
return list;
|
|
225
190
|
}
|
|
226
|
-
|
|
227
191
|
function renderByType() {
|
|
228
192
|
if (!field || !field.name) return null;
|
|
229
193
|
var optionList = getOptions(field.webType);
|
|
@@ -265,7 +229,6 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
265
229
|
},
|
|
266
230
|
suffix: "\u5929"
|
|
267
231
|
});
|
|
268
|
-
|
|
269
232
|
case PropType.STRING2:
|
|
270
233
|
if (['is null', 'is not null'].includes(operator === null || operator === void 0 ? void 0 : operator.value)) return null;
|
|
271
234
|
return /*#__PURE__*/React.createElement(Input, {
|
|
@@ -277,7 +240,6 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
277
240
|
setFieldValue([e.target.value]);
|
|
278
241
|
}
|
|
279
242
|
});
|
|
280
|
-
|
|
281
243
|
case PropType.NUMBER2:
|
|
282
244
|
return /*#__PURE__*/React.createElement(Input, {
|
|
283
245
|
type: "number",
|
|
@@ -292,7 +254,6 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
292
254
|
}
|
|
293
255
|
}());
|
|
294
256
|
}
|
|
295
|
-
|
|
296
257
|
return /*#__PURE__*/React.createElement("div", {
|
|
297
258
|
className: "".concat(classPrefix, "-content")
|
|
298
259
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
@@ -316,30 +277,24 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
316
277
|
onChange: onFieldChange
|
|
317
278
|
}), renderByType()) : null);
|
|
318
279
|
};
|
|
319
|
-
|
|
320
280
|
var CdpCondition = function CdpCondition(props) {
|
|
321
281
|
var dataId = props.dataId,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
282
|
+
defaultValue = props.defaultValue,
|
|
283
|
+
onChange = props.onChange;
|
|
325
284
|
var _useState15 = useState([undefined]),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
285
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
286
|
+
cdpConditions = _useState16[0],
|
|
287
|
+
setCdpConditions = _useState16[1];
|
|
330
288
|
useEffect(function () {
|
|
331
289
|
if (defaultValue && defaultValue.dataset) {
|
|
332
290
|
setCdpConditions(defaultValue.dataset);
|
|
333
291
|
}
|
|
334
292
|
}, []);
|
|
335
|
-
|
|
336
293
|
var onChangeCondition = function onChangeCondition(condition, index) {
|
|
337
294
|
var resData = _.cloneDeep(cdpConditions);
|
|
338
|
-
|
|
339
295
|
resData[index] = _objectSpread({}, condition);
|
|
340
296
|
onChange(dataId, resData);
|
|
341
297
|
};
|
|
342
|
-
|
|
343
298
|
return /*#__PURE__*/React.createElement("div", {
|
|
344
299
|
className: classPrefix
|
|
345
300
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -354,5 +309,4 @@ var CdpCondition = function CdpCondition(props) {
|
|
|
354
309
|
});
|
|
355
310
|
}));
|
|
356
311
|
};
|
|
357
|
-
|
|
358
312
|
export default CdpCondition;
|