@zgfe/business-lib 1.0.0-beta.1

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.
Files changed (178) hide show
  1. package/README.md +12 -0
  2. package/es/analysisLayout/demo/index.d.ts +3 -0
  3. package/es/analysisLayout/demo/index.js +30 -0
  4. package/es/analysisLayout/demo/index.less +12 -0
  5. package/es/analysisLayout/index.d.ts +13 -0
  6. package/es/analysisLayout/index.js +153 -0
  7. package/es/analysisLayout/index.less +115 -0
  8. package/es/attributeSelector/data/env.d.ts +11 -0
  9. package/es/attributeSelector/data/env.js +181 -0
  10. package/es/attributeSelector/data/event.d.ts +237 -0
  11. package/es/attributeSelector/data/event.js +3483 -0
  12. package/es/attributeSelector/data/user.d.ts +22 -0
  13. package/es/attributeSelector/data/user.js +218 -0
  14. package/es/attributeSelector/demo/multi.d.ts +2 -0
  15. package/es/attributeSelector/demo/multi.js +39 -0
  16. package/es/attributeSelector/demo/multiForm.d.ts +2 -0
  17. package/es/attributeSelector/demo/multiForm.js +64 -0
  18. package/es/attributeSelector/demo/single.d.ts +2 -0
  19. package/es/attributeSelector/demo/single.js +43 -0
  20. package/es/attributeSelector/demo/singleForm.d.ts +2 -0
  21. package/es/attributeSelector/demo/singleForm.js +66 -0
  22. package/es/attributeSelector/group.d.ts +31 -0
  23. package/es/attributeSelector/group.js +225 -0
  24. package/es/attributeSelector/index.d.ts +110 -0
  25. package/es/attributeSelector/index.js +578 -0
  26. package/es/attributeSelector/index.less +172 -0
  27. package/es/chart/chartConfig.d.ts +28 -0
  28. package/es/chart/chartConfig.js +256 -0
  29. package/es/chart/color.d.ts +1 -0
  30. package/es/chart/color.js +1 -0
  31. package/es/chart/demo/bar.d.ts +2 -0
  32. package/es/chart/demo/bar.js +19 -0
  33. package/es/chart/demo/data.d.ts +11 -0
  34. package/es/chart/demo/data.js +37 -0
  35. package/es/chart/demo/index.d.ts +2 -0
  36. package/es/chart/demo/index.js +9 -0
  37. package/es/chart/demo/pie.d.ts +2 -0
  38. package/es/chart/demo/pie.js +30 -0
  39. package/es/chart/index.d.ts +63 -0
  40. package/es/chart/index.js +76 -0
  41. package/es/chart/index.less +38 -0
  42. package/es/chart/style/circle.svg +4 -0
  43. package/es/commonStyle/icon.less +147 -0
  44. package/es/commonStyle/index.less +171 -0
  45. package/es/commonStyle/select.less +101 -0
  46. package/es/commonStyle/theme.less +432 -0
  47. package/es/commonStyle/variable.less +124 -0
  48. package/es/datePicker/data.d.ts +9 -0
  49. package/es/datePicker/data.js +65 -0
  50. package/es/datePicker/demo/form.d.ts +2 -0
  51. package/es/datePicker/demo/form.js +53 -0
  52. package/es/datePicker/demo/index.d.ts +2 -0
  53. package/es/datePicker/demo/index.js +30 -0
  54. package/es/datePicker/index.d.ts +29 -0
  55. package/es/datePicker/index.js +207 -0
  56. package/es/datePicker/index.less +388 -0
  57. package/es/dialog/components/list.d.ts +15 -0
  58. package/es/dialog/components/list.js +57 -0
  59. package/es/dialog/components/selectToInput.d.ts +43 -0
  60. package/es/dialog/components/selectToInput.js +107 -0
  61. package/es/dialog/components/style/list.less +59 -0
  62. package/es/dialog/components/style/tab.less +61 -0
  63. package/es/dialog/components/tab.d.ts +9 -0
  64. package/es/dialog/components/tab.js +50 -0
  65. package/es/dialog/data/chart.d.ts +11 -0
  66. package/es/dialog/data/chart.js +62 -0
  67. package/es/dialog/demo/index.d.ts +2 -0
  68. package/es/dialog/demo/index.js +122 -0
  69. package/es/dialog/demo/index2.d.ts +2 -0
  70. package/es/dialog/demo/index2.js +79 -0
  71. package/es/dialog/demo/index3.d.ts +2 -0
  72. package/es/dialog/demo/index3.js +61 -0
  73. package/es/dialog/index.d.ts +68 -0
  74. package/es/dialog/index.js +188 -0
  75. package/es/dialog/style/index.less +70 -0
  76. package/es/eventSelector/cascade.less +120 -0
  77. package/es/eventSelector/demo/form.d.ts +2 -0
  78. package/es/eventSelector/demo/form.js +89 -0
  79. package/es/eventSelector/demo/index.d.ts +2 -0
  80. package/es/eventSelector/demo/index.js +69 -0
  81. package/es/eventSelector/demo/nodata.d.ts +2 -0
  82. package/es/eventSelector/demo/nodata.js +13 -0
  83. package/es/eventSelector/index.d.ts +27 -0
  84. package/es/eventSelector/index.js +390 -0
  85. package/es/eventSelector/type.d.ts +41 -0
  86. package/es/eventSelector/type.js +1 -0
  87. package/es/globalAttributes/demo/data/env.d.ts +11 -0
  88. package/es/globalAttributes/demo/data/env.js +181 -0
  89. package/es/globalAttributes/demo/data/event.d.ts +237 -0
  90. package/es/globalAttributes/demo/data/event.js +3483 -0
  91. package/es/globalAttributes/demo/data/user.d.ts +22 -0
  92. package/es/globalAttributes/demo/data/user.js +218 -0
  93. package/es/globalAttributes/demo/index.d.ts +2 -0
  94. package/es/globalAttributes/demo/index.js +50 -0
  95. package/es/globalAttributes/index.d.ts +46 -0
  96. package/es/globalAttributes/index.js +116 -0
  97. package/es/index.d.ts +23 -0
  98. package/es/index.js +25 -0
  99. package/es/multipleSelector/demo/index.d.ts +2 -0
  100. package/es/multipleSelector/demo/index.js +35 -0
  101. package/es/multipleSelector/index.d.ts +36 -0
  102. package/es/multipleSelector/index.js +109 -0
  103. package/es/multipleSelector/index.less +138 -0
  104. package/es/select/demo/index.d.ts +2 -0
  105. package/es/select/demo/index.js +22 -0
  106. package/es/select/index.d.ts +42 -0
  107. package/es/select/index.js +142 -0
  108. package/es/table/demo/data/color.d.ts +1 -0
  109. package/es/table/demo/data/color.js +1 -0
  110. package/es/table/demo/data/data.d.ts +11 -0
  111. package/es/table/demo/data/data.js +37 -0
  112. package/es/table/demo/data/table.d.ts +4 -0
  113. package/es/table/demo/data/table.js +37 -0
  114. package/es/table/demo/index.d.ts +3 -0
  115. package/es/table/demo/index.js +171 -0
  116. package/es/table/demo/index.less +8 -0
  117. package/es/table/demo/index2.d.ts +2 -0
  118. package/es/table/demo/index2.js +9 -0
  119. package/es/table/index.d.ts +32 -0
  120. package/es/table/index.js +80 -0
  121. package/es/table/index.less +102 -0
  122. package/es/targetConditionGroup/components/conditionGroup.d.ts +30 -0
  123. package/es/targetConditionGroup/components/conditionGroup.js +111 -0
  124. package/es/targetConditionGroup/components/conditionItem.d.ts +47 -0
  125. package/es/targetConditionGroup/components/conditionItem.js +259 -0
  126. package/es/targetConditionGroup/components/style/group.less +47 -0
  127. package/es/targetConditionGroup/components/style/index.less +16 -0
  128. package/es/targetConditionGroup/data/operates.d.ts +36 -0
  129. package/es/targetConditionGroup/data/operates.js +98 -0
  130. package/es/targetConditionGroup/demo/data/env.d.ts +11 -0
  131. package/es/targetConditionGroup/demo/data/env.js +181 -0
  132. package/es/targetConditionGroup/demo/data/event.d.ts +237 -0
  133. package/es/targetConditionGroup/demo/data/event.js +3483 -0
  134. package/es/targetConditionGroup/demo/data/user.d.ts +22 -0
  135. package/es/targetConditionGroup/demo/data/user.js +218 -0
  136. package/es/targetConditionGroup/demo/form.d.ts +2 -0
  137. package/es/targetConditionGroup/demo/form.js +96 -0
  138. package/es/targetConditionGroup/demo/index.d.ts +2 -0
  139. package/es/targetConditionGroup/demo/index.js +73 -0
  140. package/es/targetConditionGroup/demo/item.d.ts +2 -0
  141. package/es/targetConditionGroup/demo/item.js +5 -0
  142. package/es/targetConditionGroup/index.d.ts +53 -0
  143. package/es/targetConditionGroup/index.js +265 -0
  144. package/es/targetConditionGroup/index.less +65 -0
  145. package/es/targetConditionGroup/type.d.ts +50 -0
  146. package/es/targetConditionGroup/type.js +1 -0
  147. package/es/targetSelector/components/BizCascadeBox.d.ts +34 -0
  148. package/es/targetSelector/components/BizCascadeBox.js +213 -0
  149. package/es/targetSelector/components/BizEventNameEditBox.d.ts +20 -0
  150. package/es/targetSelector/components/BizEventNameEditBox.js +57 -0
  151. package/es/targetSelector/demo/form.d.ts +2 -0
  152. package/es/targetSelector/demo/form.js +133 -0
  153. package/es/targetSelector/demo/index.d.ts +2 -0
  154. package/es/targetSelector/demo/index.js +107 -0
  155. package/es/targetSelector/demo/nodata.d.ts +2 -0
  156. package/es/targetSelector/demo/nodata.js +13 -0
  157. package/es/targetSelector/index.d.ts +40 -0
  158. package/es/targetSelector/index.js +204 -0
  159. package/es/targetSelector/index.less +53 -0
  160. package/es/userGroup/demo/cluster.d.ts +3 -0
  161. package/es/userGroup/demo/cluster.js +102 -0
  162. package/es/userGroup/demo/index.d.ts +3 -0
  163. package/es/userGroup/demo/index.js +115 -0
  164. package/es/userGroup/demo/index.less +3 -0
  165. package/es/userGroup/index.d.ts +79 -0
  166. package/es/userGroup/index.js +134 -0
  167. package/es/userGroup/index.less +2 -0
  168. package/es/userGroup/userCluster.d.ts +63 -0
  169. package/es/userGroup/userCluster.js +254 -0
  170. package/es/utils/ajax.d.ts +7 -0
  171. package/es/utils/ajax.js +139 -0
  172. package/es/utils/index.d.ts +3 -0
  173. package/es/utils/index.js +3 -0
  174. package/es/utils/type.d.ts +54 -0
  175. package/es/utils/type.js +1 -0
  176. package/es/utils/util.d.ts +67 -0
  177. package/es/utils/util.js +204 -0
  178. package/package.json +55 -0
@@ -0,0 +1,57 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+
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); }
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
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React, { useEffect, useState } from 'react';
14
+ import { IconFont } from '../..';
15
+ import { typeMenus } from '../data/chart';
16
+ import './style/list.less';
17
+
18
+ var BizList = function BizList(props) {
19
+ var _props$options = props.options,
20
+ options = _props$options === void 0 ? typeMenus : _props$options,
21
+ value = props.value,
22
+ onChange = props.onChange;
23
+
24
+ var _useState = useState(value || options[0].id),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ selectList = _useState2[0],
27
+ setSelectList = _useState2[1];
28
+
29
+ useEffect(function () {
30
+ if (!value) {
31
+ onChange && onChange(options[0].id);
32
+ }
33
+ }, []);
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ className: "biz-list-container"
36
+ }, options.map(function (item) {
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ key: item.id,
39
+ className: "biz-list-item ".concat(selectList === item.id ? 'active' : ''),
40
+ onClick: function onClick() {
41
+ setSelectList(function () {
42
+ return item.id;
43
+ });
44
+ onChange && onChange(item.id);
45
+ }
46
+ }, /*#__PURE__*/React.createElement("div", {
47
+ className: "biz-list-title"
48
+ }, item.icon && /*#__PURE__*/React.createElement(IconFont, {
49
+ className: "biz-icon",
50
+ type: item.icon
51
+ }), item.title), /*#__PURE__*/React.createElement("div", {
52
+ className: "biz-list-content"
53
+ }, item.content));
54
+ }));
55
+ };
56
+
57
+ export default BizList;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { SelectProps } from 'antd';
3
+ import '../style/index.less';
4
+ interface fieldNamesProps {
5
+ label: string;
6
+ value: string;
7
+ }
8
+ interface SelectInputProps extends SelectProps {
9
+ fieldNames?: fieldNamesProps;
10
+ /**
11
+ * @description 下拉名称
12
+ * @default false
13
+ */
14
+ name?: string;
15
+ /**
16
+ * @description 创建option回调
17
+ * @default false
18
+ */
19
+ createOption?: () => void;
20
+ /**
21
+ * @description 是否搜索option
22
+ * @default false
23
+ */
24
+ search?: boolean;
25
+ /**
26
+ * @description 是否有创建option
27
+ * @default false
28
+ */
29
+ create?: boolean;
30
+ /**
31
+ * @description 默认值
32
+ * @default false
33
+ */
34
+ value?: string | number;
35
+ /**
36
+ * @description 值改变回调
37
+ * @default -
38
+ */
39
+ onChange?: (value?: string | number) => void;
40
+ onChangeType?: (type: boolean) => void;
41
+ }
42
+ declare const BizSelectToInput: React.FC<SelectInputProps>;
43
+ export default BizSelectToInput;
@@ -0,0 +1,107 @@
1
+ var _excluded = ["options", "search", "create", "name", "value", "onChange", "onChangeType"];
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+
11
+ 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."); }
12
+
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); }
14
+
15
+ 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; }
16
+
17
+ 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; }
18
+
19
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+
21
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
22
+
23
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
+
25
+ import React, { useEffect, useState } from 'react';
26
+ import { BizSelect, IconFont } from '../..';
27
+ import { Input } from 'antd';
28
+ import '../style/index.less';
29
+
30
+ var BizSelectToInput = function BizSelectToInput(props) {
31
+ var options = props.options,
32
+ _props$search = props.search,
33
+ search = _props$search === void 0 ? true : _props$search,
34
+ _props$create = props.create,
35
+ create = _props$create === void 0 ? true : _props$create,
36
+ _props$name = props.name,
37
+ name = _props$name === void 0 ? '' : _props$name,
38
+ value = props.value,
39
+ _onChange = props.onChange,
40
+ onChangeType = props.onChangeType,
41
+ res = _objectWithoutProperties(props, _excluded);
42
+
43
+ var _useState = useState(true),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ isSelect = _useState2[0],
46
+ setIsSelect = _useState2[1];
47
+
48
+ var _useState3 = useState(value),
49
+ _useState4 = _slicedToArray(_useState3, 2),
50
+ selectValue = _useState4[0],
51
+ setSelectValue = _useState4[1];
52
+
53
+ useEffect(function () {
54
+ onChangeType && onChangeType(isSelect);
55
+
56
+ if (isSelect) {
57
+ _onChange && _onChange(selectValue);
58
+ } else {
59
+ _onChange && _onChange();
60
+ }
61
+ }, [isSelect]);
62
+ return /*#__PURE__*/React.createElement("div", null, isSelect ? /*#__PURE__*/React.createElement(BizSelect, _objectSpread(_objectSpread({
63
+ options: options,
64
+ search: search,
65
+ create: create,
66
+ size: "middle",
67
+ value: selectValue,
68
+ name: name
69
+ }, res), {}, {
70
+ createOption: function createOption() {
71
+ setIsSelect(function () {
72
+ return false;
73
+ });
74
+ },
75
+ onChange: function onChange(value) {
76
+ _onChange && _onChange(value);
77
+ setSelectValue(function () {
78
+ return value;
79
+ });
80
+ }
81
+ })) : /*#__PURE__*/React.createElement("div", {
82
+ className: "biz-flex"
83
+ }, /*#__PURE__*/React.createElement(Input, {
84
+ className: "biz-input",
85
+ placeholder: "\u8F93\u5165".concat(name),
86
+ autoFocus: !isSelect,
87
+ allowClear: {
88
+ clearIcon: /*#__PURE__*/React.createElement(IconFont, {
89
+ className: "biz-icon",
90
+ type: 'icon-qingchu'
91
+ })
92
+ },
93
+ onBlur: function onBlur(e) {
94
+ _onChange && _onChange(e.target.value);
95
+ }
96
+ }), /*#__PURE__*/React.createElement(IconFont, {
97
+ className: "biz-icon biz-icon-switch",
98
+ type: "icon-shurukuang_fanhui",
99
+ onClick: function onClick() {
100
+ setIsSelect(function () {
101
+ return true;
102
+ });
103
+ }
104
+ })));
105
+ };
106
+
107
+ export default BizSelectToInput;
@@ -0,0 +1,59 @@
1
+ @import '../../../commonStyle/index.less';
2
+
3
+ .biz-list-container {
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ justify-content: space-between;
7
+ padding: 16px;
8
+ padding-bottom: 1px;
9
+ background-color: @grayBgColor;
10
+ border-radius: 10px;
11
+
12
+ .biz-list-item {
13
+ box-sizing: border-box;
14
+ width: calc((100% - 45px) / 4);
15
+ margin-bottom: 15px;
16
+ padding: 16px 24px;
17
+ border: 1px solid #cacdd4;
18
+ border-radius: 4px;
19
+ cursor: pointer;
20
+ &:not(:nth-child(4n + 1)) {
21
+ margin-left: 15px;
22
+ }
23
+
24
+ &.active {
25
+ border-color: @themeColor;
26
+ }
27
+
28
+ &:hover {
29
+ border-color: @hoverBgColor;
30
+ }
31
+
32
+ &.active,
33
+ &:hover {
34
+ background-color: @hoverBgColor;
35
+
36
+ .biz-list-content,
37
+ .biz-list-title,
38
+ .biz-list-title .biz-icon {
39
+ color: @themeColor;
40
+ }
41
+ }
42
+
43
+ .biz-list-title {
44
+ margin-bottom: 14px;
45
+ color: @fontColor2;
46
+ line-height: 20px;
47
+
48
+ .biz-icon {
49
+ margin-right: 14px;
50
+ color: @fontColor2;
51
+ }
52
+ }
53
+
54
+ .biz-list-content {
55
+ color: @fontColor3;
56
+ font-size: 12px;
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,61 @@
1
+ @import '../../../commonStyle/index.less';
2
+
3
+ .biz-tab-container {
4
+ display: flex;
5
+ color: @titleColor;
6
+
7
+ .biz-tab-item {
8
+ display: flex;
9
+ align-items: center;
10
+ height: 40px;
11
+ padding: 0 12px;
12
+ background: #fff;
13
+ border: 1px solid @borderColor;
14
+ cursor: pointer;
15
+
16
+ .biz-icon {
17
+ margin-right: 7px;
18
+ color: @titleColor;
19
+ font-size: 18px;
20
+ }
21
+
22
+ &:not(:last-child) {
23
+ border-right-color: transparent;
24
+ }
25
+
26
+ &:first-child {
27
+ border-radius: 4px 0px 0px 4px;
28
+ }
29
+
30
+ &:last-child {
31
+ border-radius: 0px 4px 4px 0px;
32
+ }
33
+
34
+ &.disabled {
35
+ color: @disableColor;
36
+ background: #fafafb;
37
+ cursor: not-allowed;
38
+
39
+ .biz-icon {
40
+ color: @disableColor;
41
+ }
42
+ }
43
+
44
+ &:not(.disabled, .active):hover {
45
+ .box-hover();
46
+ .biz-icon {
47
+ color: @themeColor;
48
+ }
49
+ }
50
+
51
+ &:not(.disabled).active {
52
+ color: @themeColor;
53
+ background: @hoverBgColor;
54
+ border: 1px solid @themeColor;
55
+
56
+ .biz-icon {
57
+ color: @themeColor;
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './style/tab.less';
3
+ interface BizTabProps {
4
+ value?: string | number;
5
+ options?: Array<string | number>;
6
+ onChange?: (value: string) => void;
7
+ }
8
+ declare const BizTab: React.FC<BizTabProps>;
9
+ export default BizTab;
@@ -0,0 +1,50 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+
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); }
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
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React, { useState } from 'react';
14
+ import { IconFont } from '../..';
15
+ import { chartTypes } from '../data/chart';
16
+ import './style/tab.less';
17
+
18
+ var BizTab = function BizTab(props) {
19
+ var _props$options = props.options,
20
+ options = _props$options === void 0 ? [] : _props$options,
21
+ value = props.value,
22
+ onChange = props.onChange;
23
+
24
+ var _useState = useState(value),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ tab = _useState2[0],
27
+ setTab = _useState2[1];
28
+
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: "biz-tab-container"
31
+ }, chartTypes.map(function (item) {
32
+ var isDisabled = options.indexOf(item.label) === -1;
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ key: item.value,
35
+ className: "biz-tab-item ".concat(isDisabled ? 'disabled' : '', " ").concat(tab === item.value ? 'active' : ''),
36
+ onClick: function onClick() {
37
+ if (isDisabled || tab === item.value) return;
38
+ setTab(function () {
39
+ return item.value;
40
+ });
41
+ onChange && onChange(item.value);
42
+ }
43
+ }, /*#__PURE__*/React.createElement(IconFont, {
44
+ className: "biz-icon",
45
+ type: item.icon
46
+ }), /*#__PURE__*/React.createElement("span", null, item.label));
47
+ }));
48
+ };
49
+
50
+ export default BizTab;
@@ -0,0 +1,11 @@
1
+ export declare const chartTypes: {
2
+ label: string;
3
+ value: string;
4
+ icon: string;
5
+ }[];
6
+ export declare const typeMenus: {
7
+ id: number;
8
+ title: string;
9
+ content: string;
10
+ icon: string;
11
+ }[];
@@ -0,0 +1,62 @@
1
+ export var chartTypes = [{
2
+ label: '趋势图',
3
+ value: 'line',
4
+ icon: 'icon-qushitu1'
5
+ }, {
6
+ label: '汇总图',
7
+ value: 'bar',
8
+ icon: 'icon-huizongtu'
9
+ }, {
10
+ label: '地图',
11
+ value: 'map',
12
+ icon: 'icon-ditu'
13
+ }, {
14
+ label: '表格',
15
+ value: 'table',
16
+ icon: 'icon-biaoge'
17
+ }, {
18
+ label: '分数',
19
+ value: 'fraction',
20
+ icon: 'icon-fenshu'
21
+ }];
22
+ export var typeMenus = [{
23
+ id: 1,
24
+ title: '整体情况',
25
+ content: '数据、活跃数据、会话时长、使用次数',
26
+ icon: 'icon-fenshu'
27
+ }, {
28
+ id: 2,
29
+ title: '洞察',
30
+ content: '行为触发情况',
31
+ icon: 'icon-fenshu'
32
+ }, {
33
+ id: 3,
34
+ title: '漏斗',
35
+ content: '转换情况',
36
+ icon: 'icon-fenshu'
37
+ }, {
38
+ id: 4,
39
+ title: '自定义指标',
40
+ content: '自定义指标',
41
+ icon: 'icon-fenshu'
42
+ }, {
43
+ id: 5,
44
+ title: '间隔',
45
+ content: '分析用户任意两个行为之间的时长间隔',
46
+ icon: 'icon-fenshu'
47
+ }, {
48
+ id: 6,
49
+ title: '行为路径',
50
+ content: '事件触发后的工作和来源行为',
51
+ icon: 'icon-fenshu'
52
+ }, {
53
+ id: 7,
54
+ title: '留存',
55
+ content: '新增用户、活跃用户、自定义留存',
56
+ icon: 'icon-fenshu'
57
+ }, {
58
+ id: 8,
59
+ title: '收入',
60
+ content: '收入情况',
61
+ icon: 'icon-fenshu'
62
+ }];
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,122 @@
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
+ 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 _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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+
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); }
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
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useState } from 'react';
20
+ import { BizDialog } from 'business-lib';
21
+ import { Button } from 'antd';
22
+ var options = ['分类一', '分类二', '分类三'];
23
+ var chartTypes = ['趋势图', '汇总图', '地图'];
24
+ var fields = [{
25
+ label: '分类',
26
+ name: 'class',
27
+ type: 'selectToInput',
28
+ options: options,
29
+ children: ['range'],
30
+ rules: [{
31
+ required: true,
32
+ message: '请选择分类'
33
+ }]
34
+ }, {
35
+ label: '',
36
+ name: 'range',
37
+ type: 'radio',
38
+ dependencies: 'class',
39
+ hidden: true,
40
+ options: [{
41
+ label: '公开',
42
+ value: 'public'
43
+ }, {
44
+ label: '指定人员明显',
45
+ value: 'appoint'
46
+ }, {
47
+ label: '仅自己可见',
48
+ value: 'own'
49
+ }]
50
+ }, {
51
+ label: '名称',
52
+ name: 'name',
53
+ type: 'input',
54
+ rules: [{
55
+ required: true,
56
+ message: '请输入名称'
57
+ }]
58
+ }, {
59
+ label: '图表',
60
+ name: 'chart',
61
+ type: 'tab',
62
+ options: chartTypes,
63
+ rules: [{
64
+ required: true,
65
+ message: '请选择图表'
66
+ }]
67
+ }, {
68
+ label: '显示',
69
+ name: 'show',
70
+ type: 'radio',
71
+ direction: 'vertical',
72
+ options: [{
73
+ label: '动态显示数据最多的5个分组',
74
+ value: 'dynamic'
75
+ }, {
76
+ label: '固定显示当前选择的分组',
77
+ value: 'fix'
78
+ }],
79
+ rules: [{
80
+ required: true,
81
+ message: '请选择'
82
+ }]
83
+ }];
84
+ var formData = {
85
+ class: '分类一',
86
+ range: 'public',
87
+ show: 'dynamic'
88
+ };
89
+ export default (function () {
90
+ var _useState = useState(false),
91
+ _useState2 = _slicedToArray(_useState, 2),
92
+ visible = _useState2[0],
93
+ setVisible = _useState2[1];
94
+
95
+ var _useState3 = useState(),
96
+ _useState4 = _slicedToArray(_useState3, 2),
97
+ dialogData = _useState4[0],
98
+ setDialogData = _useState4[1];
99
+
100
+ var handleSubmit = function handleSubmit(data) {
101
+ setDialogData(function () {
102
+ return _objectSpread({}, data);
103
+ });
104
+ setVisible(false);
105
+ };
106
+
107
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
108
+ type: "primary",
109
+ onClick: function onClick() {
110
+ setVisible(true);
111
+ }
112
+ }, "\u5411\u770B\u677F\u6DFB\u52A0\u6307\u6807"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, JSON.stringify(dialogData)), /*#__PURE__*/React.createElement(BizDialog, {
113
+ title: "\u5411\u770B\u677F\u6DFB\u52A0\u6307\u6807",
114
+ visible: visible,
115
+ onOk: handleSubmit,
116
+ fields: fields,
117
+ initialValues: formData,
118
+ onCancel: function onCancel() {
119
+ setVisible(false);
120
+ }
121
+ }));
122
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,79 @@
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
+ 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 _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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+
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); }
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
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useState } from 'react';
20
+ import { BizDialog } from 'business-lib';
21
+ import { Button } from 'antd';
22
+ var options = ['分类一', '分类二', '分类三'];
23
+ var fields = [{
24
+ label: '场景分类',
25
+ name: 'class',
26
+ type: 'selectToInput',
27
+ options: options,
28
+ rules: [{
29
+ required: true,
30
+ message: '请选择场景分类'
31
+ }]
32
+ }, {
33
+ label: '场景名称',
34
+ name: 'name',
35
+ type: 'password',
36
+ rules: [{
37
+ required: true,
38
+ message: '请输入场景名称'
39
+ }]
40
+ }];
41
+ var formData = {
42
+ class: '分类一'
43
+ };
44
+ export default (function () {
45
+ var _useState = useState(false),
46
+ _useState2 = _slicedToArray(_useState, 2),
47
+ visible = _useState2[0],
48
+ setVisible = _useState2[1];
49
+
50
+ var _useState3 = useState(),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ dialogData = _useState4[0],
53
+ setDialogData = _useState4[1];
54
+
55
+ var handleSubmit = function handleSubmit(data) {
56
+ setDialogData(function () {
57
+ return _objectSpread({}, data);
58
+ });
59
+ setVisible(false);
60
+ };
61
+
62
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
63
+ type: "primary",
64
+ onClick: function onClick() {
65
+ setVisible(true);
66
+ }
67
+ }, "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, JSON.stringify(dialogData)), /*#__PURE__*/React.createElement(BizDialog, {
68
+ title: "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F",
69
+ visible: visible,
70
+ onOk: handleSubmit,
71
+ fields: fields,
72
+ showMark: true,
73
+ layout: "vertical",
74
+ initialValues: formData,
75
+ onCancel: function onCancel() {
76
+ setVisible(false);
77
+ }
78
+ }));
79
+ });