@zgfe/business-lib 1.1.29-visual.8 → 1.1.29
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 +21 -8
- package/es/addToPanel/components/radioGroup.js +3 -1
- package/es/addToPanel/components/styleList.js +22 -5
- package/es/addToPanel/demo/edit.js +12 -5
- package/es/addToPanel/demo/index.js +12 -5
- package/es/addToPanel/index.js +58 -21
- package/es/addToScene/addGroup.js +4 -0
- package/es/addToScene/demo/index.js +12 -5
- package/es/addToScene/index.js +40 -13
- package/es/assets/demo/index.js +2 -0
- package/es/assets/demo/input.js +12 -5
- package/es/assets/iconfont/iconfont.js +17 -10
- package/es/assets/theme.js +1 -0
- package/es/attrConditions/components/operateList.js +27 -10
- package/es/attrConditions/components/stringList.js +97 -68
- package/es/attrConditions/components/valuesList.js +40 -14
- package/es/attrConditions/demo/group.js +23 -11
- package/es/attrConditions/demo/index.js +26 -17
- package/es/attrConditions/group.js +48 -17
- package/es/attrConditions/index.js +49 -22
- package/es/attrConditions/types.js +1 -0
- package/es/attributeSelector/demo/disable.js +16 -8
- package/es/attributeSelector/demo/index.js +17 -8
- package/es/attributeSelector/index.js +45 -22
- package/es/attributeSelector/listPanel.js +46 -18
- package/es/attributeSelector/option.js +13 -3
- package/es/attributeSelector/types.js +5 -0
- package/es/attributeSelector/util.js +3 -0
- package/es/chart/demo/index.js +14 -5
- package/es/chart/index.js +44 -30
- package/es/chart/util/chartOptionConfig.d.ts +3 -3
- package/es/chart/util/chartOptionConfig.js +37 -13
- package/es/chart/util/data/china.js +4 -1
- package/es/chart/util/formatData.d.ts +2 -2
- package/es/chart/util/formatData.js +5 -0
- package/es/chart/util/formatOption.js +13 -0
- package/es/chart/util/mapUtil.js +26 -5
- package/es/config.js +2 -0
- package/es/constants/apis.d.ts +0 -1
- package/es/constants/apis.js +1 -2
- package/es/cycleTime/demo/disable.js +1 -0
- package/es/cycleTime/index.js +46 -19
- package/es/cycleTime/month.js +27 -8
- package/es/datePicker/datePicker.js +23 -5
- package/es/datePicker/demo/customType.js +22 -13
- package/es/datePicker/demo/day.js +22 -13
- package/es/datePicker/demo/index.js +21 -12
- package/es/datePicker/index.js +41 -18
- package/es/datePicker/utils.js +7 -0
- package/es/demoWrapper/content.d.ts +1 -2
- package/es/demoWrapper/content.js +64 -42
- package/es/demoWrapper/demo/index.js +4 -5
- package/es/demoWrapper/head.d.ts +1 -3
- package/es/demoWrapper/head.js +27 -25
- package/es/demoWrapper/index.js +36 -28
- package/es/dialog/demo/index.js +12 -5
- package/es/dialog/index.js +6 -4
- package/es/dnd/demo/data.js +28 -19
- package/es/dnd/demo/handle.js +28 -19
- package/es/dnd/index.js +45 -21
- package/es/dnd/item.js +30 -10
- package/es/eventSelector/demo/index.js +23 -12
- package/es/eventSelector/index.js +42 -14
- package/es/eventSelector/listPanel.js +73 -31
- package/es/eventSelector/option.js +11 -6
- package/es/icon/iconFont.js +13 -7
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/es/layout/analysisLayout/demo/index.js +6 -0
- package/es/layout/analysisLayout/index.d.ts +1 -1
- package/es/layout/analysisLayout/index.js +34 -16
- package/es/layout/detail/index.js +3 -1
- package/es/loginForm/index.js +18 -7
- package/es/searchInput/index.js +7 -2
- package/es/select/demo/children.js +16 -8
- package/es/select/demo/customLabel.js +2 -0
- package/es/select/demo/group.js +17 -8
- package/es/select/demo/index.js +19 -11
- package/es/select/demo/loading.js +18 -8
- package/es/select/demo/multiple.js +16 -8
- package/es/select/handle.js +34 -14
- package/es/select/index.js +59 -22
- package/es/select/option.js +30 -10
- package/es/select/overlay.js +62 -25
- package/es/table/demo/data/table.js +2 -0
- package/es/table/demo/index.js +39 -13
- package/es/table/demo/index2.js +15 -5
- package/es/table/demo/index3.js +28 -7
- package/es/table/index.js +33 -14
- package/es/targetConditionGroup/components/targetDimension.js +38 -12
- package/es/targetConditionGroup/demo/group.js +36 -21
- package/es/targetConditionGroup/demo/index.js +13 -5
- package/es/targetConditionGroup/index.js +84 -31
- package/es/targetSelector/demo/index.js +28 -15
- package/es/targetSelector/editBox.js +20 -5
- package/es/targetSelector/index.js +36 -15
- package/es/targetSelector/optionIcon.js +5 -1
- package/es/targetSelector/optionMenu.js +3 -0
- package/es/userCondition/conditionTypeList.js +12 -7
- package/es/userCondition/conditionWrap.js +2 -0
- package/es/userCondition/conditions/cdpCondition.js +97 -51
- package/es/userCondition/conditions/eventCondition.js +16 -6
- package/es/userCondition/conditions/periodCondition.js +26 -8
- package/es/userCondition/conditions/propCondition.js +61 -29
- package/es/userCondition/conditions/runTimesCondition.js +10 -5
- package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
- package/es/userCondition/conditions/tagsCondition.js +33 -15
- package/es/userCondition/conditions/textDesc.js +67 -16
- package/es/userCondition/demo/index.js +21 -11
- package/es/userCondition/index.js +91 -51
- package/es/userCondition/orConditions.js +48 -11
- package/es/userCondition/relationLabel.js +4 -1
- package/es/userCondition/types.d.ts +1 -1
- package/es/userCondition/types.js +1 -0
- package/es/userCondition/util.js +13 -4
- package/es/userGroup/demo/group.js +23 -14
- package/es/userGroup/demo/index.js +15 -5
- package/es/userGroup/index.js +30 -12
- package/es/userTagsSelector/cascaderOverlay.js +51 -19
- package/es/userTagsSelector/components/search/index.js +2 -0
- package/es/userTagsSelector/demo/index.js +3 -0
- package/es/userTagsSelector/groups/groupOption.js +8 -6
- package/es/userTagsSelector/groups/index.js +30 -15
- package/es/userTagsSelector/index.js +35 -17
- package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
- package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
- package/es/userTagsSelector/util.js +2 -0
- package/es/utils/ajax.js +71 -45
- package/es/utils/base64.js +22 -3
- package/es/utils/type.d.ts +1 -1
- package/es/utils/type.js +7 -4
- package/es/utils/util.js +16 -0
- package/package.json +2 -2
- package/es/socket/demo/demo.d.ts +0 -2
- package/es/socket/demo/demo.js +0 -139
- package/es/socket/demo/index.less +0 -27
- package/es/socket/index.d.ts +0 -31
- package/es/socket/index.js +0 -284
- package/es/socket/types.d.ts +0 -37
- package/es/socket/types.js +0 -26
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useState } from 'react';
|
|
8
14
|
import { BizDatePicker } from '@zgfe/business-lib';
|
|
9
15
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
16
|
import { Divider, Switch } from 'antd';
|
|
11
17
|
export default (function () {
|
|
12
18
|
var _useState = useState({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
unit: 'day',
|
|
20
|
+
begin: '2022-05-03',
|
|
21
|
+
end: '2022-05-30',
|
|
22
|
+
relative: [0, 1]
|
|
23
|
+
}),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
time = _useState2[0],
|
|
26
|
+
setTime = _useState2[1];
|
|
27
|
+
|
|
21
28
|
var _useState3 = useState(false),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
includeToday = _useState4[0],
|
|
31
|
+
setIncludeToday = _useState4[1];
|
|
32
|
+
|
|
25
33
|
var handleChange = function handleChange(data) {
|
|
26
34
|
setTime(function () {
|
|
27
35
|
return data;
|
|
28
36
|
});
|
|
29
37
|
};
|
|
38
|
+
|
|
30
39
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
31
40
|
defaultChecked: includeToday,
|
|
32
41
|
onChange: setIncludeToday
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { BizDatePicker } from '@zgfe/business-lib';
|
|
8
14
|
import React, { useState } from 'react';
|
|
9
15
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
16
|
import { Divider, Switch } from 'antd';
|
|
11
17
|
export default (function () {
|
|
12
18
|
var _useState = useState({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
unit: 'day',
|
|
20
|
+
begin: '2022-05-03',
|
|
21
|
+
end: '2022-05-30',
|
|
22
|
+
relative: [0, 1]
|
|
23
|
+
}),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
time = _useState2[0],
|
|
26
|
+
setTime = _useState2[1];
|
|
27
|
+
|
|
21
28
|
var _useState3 = useState(false),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
includeToday = _useState4[0],
|
|
31
|
+
setIncludeToday = _useState4[1];
|
|
32
|
+
|
|
25
33
|
var handleChange = function handleChange(data) {
|
|
26
34
|
setTime(function () {
|
|
27
35
|
return data;
|
|
28
36
|
});
|
|
29
37
|
};
|
|
38
|
+
|
|
30
39
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
31
40
|
defaultChecked: includeToday,
|
|
32
41
|
onChange: setIncludeToday
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { BizDatePicker } from '@zgfe/business-lib';
|
|
8
14
|
import React, { useState } from 'react';
|
|
9
15
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
16
|
import { Divider, Switch } from 'antd';
|
|
11
17
|
export default (function () {
|
|
12
18
|
var _useState = useState({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
unit: 'week',
|
|
20
|
+
begin: '2022-05-03',
|
|
21
|
+
end: '2022-05-30'
|
|
22
|
+
}),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
time = _useState2[0],
|
|
25
|
+
setTime = _useState2[1];
|
|
26
|
+
|
|
20
27
|
var _useState3 = useState(false),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
includeToday = _useState4[0],
|
|
30
|
+
setIncludeToday = _useState4[1];
|
|
31
|
+
|
|
24
32
|
var handleChange = function handleChange(data) {
|
|
25
33
|
setTime(function () {
|
|
26
34
|
return data;
|
|
27
35
|
});
|
|
28
36
|
};
|
|
37
|
+
|
|
29
38
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
30
39
|
defaultChecked: includeToday,
|
|
31
40
|
onChange: setIncludeToday
|
package/es/datePicker/index.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
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
1
|
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
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
8
9
|
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
|
+
|
|
9
11
|
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
|
-
|
|
11
|
-
function
|
|
12
|
+
|
|
13
|
+
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; }
|
|
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
|
+
|
|
12
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
13
19
|
import React, { useEffect, useState } from 'react';
|
|
14
20
|
import { getDateList } from './utils';
|
|
15
21
|
import BizSelect from '../select';
|
|
@@ -17,39 +23,49 @@ import BizDate from './datePicker';
|
|
|
17
23
|
import './styles/index.less';
|
|
18
24
|
import { Skeleton } from 'antd';
|
|
19
25
|
export var classPrefix = 'biz-date-picker';
|
|
26
|
+
|
|
20
27
|
var BizDatePicker = function BizDatePicker(props) {
|
|
21
28
|
var dateList = getDateList(props.mode, props.dateTypeList);
|
|
29
|
+
|
|
22
30
|
var _useState = useState(dateList[0]),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
currentType = _useState2[0],
|
|
33
|
+
setCurrentType = _useState2[1];
|
|
34
|
+
|
|
26
35
|
var _useState3 = useState(),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
+
dateRange = _useState4[0],
|
|
38
|
+
setDateRange = _useState4[1];
|
|
39
|
+
|
|
30
40
|
var _useState5 = useState(),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
+
currentTime = _useState6[0],
|
|
43
|
+
setCurrentTime = _useState6[1];
|
|
44
|
+
|
|
34
45
|
var _useState7 = useState(true),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
47
|
+
ready = _useState8[0],
|
|
48
|
+
setReady = _useState8[1];
|
|
49
|
+
|
|
38
50
|
useEffect(function () {
|
|
39
51
|
var data = props.defaultValue || props.value;
|
|
52
|
+
|
|
40
53
|
if (data) {
|
|
41
54
|
setCurrentType(function () {
|
|
42
55
|
var list = dateList.filter(function (item) {
|
|
43
56
|
return item.value === data.unit;
|
|
44
57
|
})[0] || dateList[0];
|
|
58
|
+
|
|
45
59
|
if (data.relative) {
|
|
46
60
|
var valueData = list.children.filter(function (item) {
|
|
47
61
|
return item.count === data.relative[0];
|
|
48
62
|
})[0];
|
|
63
|
+
|
|
49
64
|
if (valueData) {
|
|
50
65
|
setCurrentTime(valueData);
|
|
51
66
|
}
|
|
52
67
|
}
|
|
68
|
+
|
|
53
69
|
return list;
|
|
54
70
|
});
|
|
55
71
|
setDateRange(function () {
|
|
@@ -59,6 +75,7 @@ var BizDatePicker = function BizDatePicker(props) {
|
|
|
59
75
|
};
|
|
60
76
|
});
|
|
61
77
|
}
|
|
78
|
+
|
|
62
79
|
setReady(false);
|
|
63
80
|
}, []);
|
|
64
81
|
useEffect(function () {
|
|
@@ -67,19 +84,24 @@ var BizDatePicker = function BizDatePicker(props) {
|
|
|
67
84
|
relative: currentTime ? [currentTime === null || currentTime === void 0 ? void 0 : currentTime.count, props.includeToday && currentType.value === 'day' ? 0 : 1] : undefined
|
|
68
85
|
}, dateRange));
|
|
69
86
|
}, [currentType, currentTime, dateRange]);
|
|
87
|
+
|
|
70
88
|
var onChangeDateType = function onChangeDateType(data) {
|
|
71
89
|
setCurrentType(data);
|
|
72
90
|
setCurrentTime(data.children[0]);
|
|
73
91
|
};
|
|
92
|
+
|
|
74
93
|
var onClickShortcut = function onClickShortcut(value) {
|
|
75
94
|
setCurrentTime(value);
|
|
76
95
|
};
|
|
96
|
+
|
|
77
97
|
var onChangeRange = function onChangeRange(value, changed) {
|
|
78
98
|
setDateRange(value);
|
|
99
|
+
|
|
79
100
|
if (!changed) {
|
|
80
101
|
setCurrentTime(undefined);
|
|
81
102
|
}
|
|
82
103
|
};
|
|
104
|
+
|
|
83
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
84
106
|
className: classPrefix
|
|
85
107
|
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
@@ -114,6 +136,7 @@ var BizDatePicker = function BizDatePicker(props) {
|
|
|
114
136
|
onChange: onChangeRange
|
|
115
137
|
})));
|
|
116
138
|
};
|
|
139
|
+
|
|
117
140
|
BizDatePicker.defaultProps = {
|
|
118
141
|
includeToday: true,
|
|
119
142
|
mode: 'general',
|
package/es/datePicker/utils.js
CHANGED
|
@@ -111,22 +111,27 @@ export function getDateList(mode, typeList) {
|
|
|
111
111
|
return typeList.includes(item.value);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
+
|
|
114
115
|
function getAbsoluteDate(unit, count, maxDate) {
|
|
115
116
|
var res = {};
|
|
116
117
|
var dayTime = 24 * 60 * 60 * 1000;
|
|
118
|
+
|
|
117
119
|
switch (unit) {
|
|
118
120
|
case 'hour':
|
|
119
121
|
res.endDate = res.startDate = moment().subtract(count, 'days').toDate();
|
|
120
122
|
break;
|
|
123
|
+
|
|
121
124
|
case 'day':
|
|
122
125
|
res.startDate = moment().subtract(count, 'days').toDate();
|
|
123
126
|
count == 1 ? res.endDate = moment().subtract(count, 'days').toDate() : res.endDate = maxDate;
|
|
124
127
|
break;
|
|
128
|
+
|
|
125
129
|
case 'week':
|
|
126
130
|
res.endDate = maxDate;
|
|
127
131
|
var firstOfWeek = new Date(maxDate.getTime() - (maxDate.getDay() - 1) * dayTime);
|
|
128
132
|
res.startDate = new Date(firstOfWeek.getTime() - count * 7 * dayTime);
|
|
129
133
|
break;
|
|
134
|
+
|
|
130
135
|
case 'month':
|
|
131
136
|
res.endDate = maxDate;
|
|
132
137
|
var firstOfMonth = new Date(maxDate.getTime() - (maxDate.getDate() - 1) * dayTime);
|
|
@@ -134,8 +139,10 @@ function getAbsoluteDate(unit, count, maxDate) {
|
|
|
134
139
|
res.startDate = new Date(firstOfMonth);
|
|
135
140
|
break;
|
|
136
141
|
}
|
|
142
|
+
|
|
137
143
|
return res;
|
|
138
144
|
}
|
|
145
|
+
|
|
139
146
|
export var getDateRange = function getDateRange(type, count, includeToday) {
|
|
140
147
|
var maxDate = moment().subtract(includeToday || count == 0 ? 0 : 1, 'days').toDate();
|
|
141
148
|
var res = getAbsoluteDate(type, count, maxDate);
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
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
|
+
|
|
3
5
|
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); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
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; }
|
|
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
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { Spin } from 'antd';
|
|
8
14
|
import React, { useEffect, useState } from 'react';
|
|
9
15
|
import convertAttributeData from '../attributeSelector/util';
|
|
10
16
|
import BizGlobalDataContext from '../context';
|
|
11
17
|
import request from '../utils/ajax';
|
|
12
18
|
var catchPool = {};
|
|
19
|
+
|
|
13
20
|
function ajax(url, options) {
|
|
14
21
|
return new Promise(function (resolve, reject) {
|
|
15
22
|
if (!catchPool[url]) {
|
|
@@ -40,58 +47,63 @@ function ajax(url, options) {
|
|
|
40
47
|
}
|
|
41
48
|
});
|
|
42
49
|
}
|
|
50
|
+
|
|
43
51
|
var DemoContent = function DemoContent(_ref3) {
|
|
44
52
|
var children = _ref3.children,
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
currentApp = _ref3.currentApp,
|
|
54
|
+
needMeta = _ref3.needMeta;
|
|
55
|
+
|
|
47
56
|
var _useState = useState([]),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
eventGroups = _useState2[0],
|
|
59
|
+
setEventGroups = _useState2[1];
|
|
60
|
+
|
|
51
61
|
var _useState3 = useState([]),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
+
userProps = _useState4[0],
|
|
64
|
+
setUserProps = _useState4[1];
|
|
65
|
+
|
|
55
66
|
var _useState5 = useState([]),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
68
|
+
envList = _useState6[0],
|
|
69
|
+
setEnvList = _useState6[1];
|
|
70
|
+
|
|
59
71
|
var _useState7 = useState([]),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
73
|
+
userGroups = _useState8[0],
|
|
74
|
+
setUserGroups = _useState8[1];
|
|
75
|
+
|
|
63
76
|
var _useState9 = useState(true),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
78
|
+
loadEvent = _useState10[0],
|
|
79
|
+
setLoadEvent = _useState10[1];
|
|
80
|
+
|
|
67
81
|
var _useState11 = useState(true),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
83
|
+
loadEnv = _useState12[0],
|
|
84
|
+
setLoadEnv = _useState12[1];
|
|
85
|
+
|
|
71
86
|
var _useState13 = useState(true),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
87
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
88
|
+
loadUsers = _useState14[0],
|
|
89
|
+
setLoadUsers = _useState14[1];
|
|
90
|
+
|
|
75
91
|
var _useState15 = useState(true),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
92
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
93
|
+
loadUserGroups = _useState16[0],
|
|
94
|
+
setLoadUserGroups = _useState16[1];
|
|
95
|
+
|
|
79
96
|
var _useState17 = useState(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
98
|
+
store = _useState18[0],
|
|
99
|
+
setStore = _useState18[1];
|
|
100
|
+
|
|
83
101
|
useEffect(function () {
|
|
84
102
|
if (!needMeta || !currentApp) return;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
loadUserGroup();
|
|
90
|
-
} else {
|
|
91
|
-
setLoadEnv(false);
|
|
92
|
-
setLoadEvent(false);
|
|
93
|
-
setLoadUsers(false);
|
|
94
|
-
}
|
|
103
|
+
loadUserProps();
|
|
104
|
+
loadEvents();
|
|
105
|
+
loadEnvList();
|
|
106
|
+
loadUserGroup();
|
|
95
107
|
}, [currentApp, needMeta]);
|
|
96
108
|
useEffect(function () {
|
|
97
109
|
if (loadEnv || loadEvent || loadUsers || loadUserGroups) return;
|
|
@@ -101,6 +113,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
101
113
|
envPropList: envList
|
|
102
114
|
}));
|
|
103
115
|
}, [loadEvent, loadEnv, loadUsers, loadUserGroups]);
|
|
116
|
+
|
|
104
117
|
function loadUserGroup() {
|
|
105
118
|
setLoadUserGroups(true);
|
|
106
119
|
ajax('/analysis/api/common/proxy/usergroup/getAll.jsp', {
|
|
@@ -116,6 +129,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
116
129
|
setLoadUserGroups(false);
|
|
117
130
|
});
|
|
118
131
|
}
|
|
132
|
+
|
|
119
133
|
function loadUserProps() {
|
|
120
134
|
setLoadUsers(true);
|
|
121
135
|
ajax('/analysis/api/common/proxy/appusergroup/getUserPropMeta.jsp', {
|
|
@@ -129,6 +143,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
129
143
|
setLoadUsers(false);
|
|
130
144
|
});
|
|
131
145
|
}
|
|
146
|
+
|
|
132
147
|
function loadEvents() {
|
|
133
148
|
setLoadEvent(true);
|
|
134
149
|
ajax('/analysis/api/common/proxy/data/queryEventMetasOfGroup.jsp', {
|
|
@@ -143,6 +158,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
143
158
|
setLoadEvent(false);
|
|
144
159
|
});
|
|
145
160
|
}
|
|
161
|
+
|
|
146
162
|
function loadEnvList() {
|
|
147
163
|
setLoadEnv(true);
|
|
148
164
|
ajax('/analysis/api/common/proxy/appusergroup/getEventEnvData.jsp', {
|
|
@@ -156,14 +172,19 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
156
172
|
setLoadEnv(false);
|
|
157
173
|
});
|
|
158
174
|
}
|
|
175
|
+
|
|
159
176
|
if (needMeta && (loadEnv || loadEvent || loadUsers)) {
|
|
160
177
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
161
178
|
tip: "\u57FA\u7840\u6570\u636E\u52A0\u8F7D\u4E2D"
|
|
162
179
|
});
|
|
163
180
|
}
|
|
181
|
+
|
|
164
182
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
165
183
|
value: {
|
|
166
|
-
currentApp:
|
|
184
|
+
currentApp: {
|
|
185
|
+
appId: currentApp,
|
|
186
|
+
platform: 0
|
|
187
|
+
},
|
|
167
188
|
eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
|
|
168
189
|
userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
|
|
169
190
|
eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
|
|
@@ -171,4 +192,5 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
171
192
|
}
|
|
172
193
|
}, children));
|
|
173
194
|
};
|
|
195
|
+
|
|
174
196
|
export default DemoContent;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { DemoWrapper
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DemoWrapper } from '@zgfe/business-lib';
|
|
3
3
|
export default (function () {
|
|
4
|
-
var ctx = useContext(BizGlobalDataContext);
|
|
5
4
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
6
|
-
defaultApp:
|
|
5
|
+
defaultApp: 3,
|
|
7
6
|
needMeta: true
|
|
8
|
-
},
|
|
7
|
+
}, "xxx");
|
|
9
8
|
});
|
package/es/demoWrapper/head.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AppInfoProps } from '../context';
|
|
3
2
|
declare const DemoHeader: React.FC<{
|
|
4
3
|
defaultApp?: number;
|
|
5
|
-
onChangeApp?: (
|
|
6
|
-
onLoading?: (loading: boolean) => void;
|
|
4
|
+
onChangeApp?: (appId: number) => void;
|
|
7
5
|
}>;
|
|
8
6
|
export default DemoHeader;
|