@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,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,61 @@
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 fields = [{
23
+ label: '创建指标',
24
+ name: 'target',
25
+ type: 'list'
26
+ }];
27
+ export default (function () {
28
+ var _useState = useState(false),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ visible = _useState2[0],
31
+ setVisible = _useState2[1];
32
+
33
+ var _useState3 = useState(),
34
+ _useState4 = _slicedToArray(_useState3, 2),
35
+ dialogData = _useState4[0],
36
+ setDialogData = _useState4[1];
37
+
38
+ var handleSubmit = function handleSubmit(data) {
39
+ setDialogData(function () {
40
+ return _objectSpread({}, data);
41
+ });
42
+ setVisible(false);
43
+ };
44
+
45
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
46
+ type: "primary",
47
+ onClick: function onClick() {
48
+ setVisible(true);
49
+ }
50
+ }, "\u9009\u62E9\u56FE\u5F62\u7C7B\u578B"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, JSON.stringify(dialogData)), /*#__PURE__*/React.createElement(BizDialog, {
51
+ title: "\u9009\u62E9\u56FE\u5F62\u7C7B\u578B",
52
+ width: 900,
53
+ visible: visible,
54
+ onOk: handleSubmit,
55
+ layout: "vertical",
56
+ fields: fields,
57
+ onCancel: function onCancel() {
58
+ setVisible(false);
59
+ }
60
+ }));
61
+ });
@@ -0,0 +1,68 @@
1
+ import { FormItemProps, ModalProps } from 'antd';
2
+ import React from 'react';
3
+ interface FieldProps {
4
+ /**
5
+ * @description form.item类型
6
+ * @default input
7
+ */
8
+ type?: string;
9
+ /**
10
+ * @description form.item 默认值
11
+ * @default -
12
+ */
13
+ value?: string | number;
14
+ /**
15
+ * @description 提示
16
+ * @default -
17
+ */
18
+ placeholder?: string;
19
+ /**
20
+ * @description form.item p排列方向
21
+ * @default horizontal
22
+ */
23
+ direction?: 'horizontal' | 'vertical';
24
+ /**
25
+ * @description form.item 下拉内容
26
+ * @default -
27
+ */
28
+ options?: Array<any>;
29
+ /**
30
+ * @description 影响的表单项
31
+ * @default -
32
+ */
33
+ children?: Array<string>;
34
+ }
35
+ interface BizDialogProps {
36
+ /**
37
+ * @description 弹窗类型
38
+ * @default input
39
+ */
40
+ layout?: 'horizontal' | 'vertical' | 'inline';
41
+ /**
42
+ * @description 弹窗表单字段
43
+ * @default -
44
+ */
45
+ fields: Array<FieldProps & FormItemProps>;
46
+ /**
47
+ * @description 表单默认值,只有初始化以及重置时生效
48
+ * @default -
49
+ */
50
+ initialValues?: object;
51
+ /**
52
+ * @description 是否显示必填标记
53
+ * @default -
54
+ */
55
+ showMark?: boolean;
56
+ /**
57
+ * @description 提交表单且数据验证成功后回调事件
58
+ * @default -
59
+ */
60
+ onOk?: (data: object) => void;
61
+ /**
62
+ * @description 取消
63
+ * @default -
64
+ */
65
+ onCancel?: () => void;
66
+ }
67
+ declare const BizDialog: React.FC<ModalProps & BizDialogProps>;
68
+ export default BizDialog;
@@ -0,0 +1,188 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+
13
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
+
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+
19
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
20
+
21
+ function _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; }
22
+
23
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
24
+
25
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
+
27
+ import { Form, Input, Modal, Radio, Space } from 'antd';
28
+ import React, { useEffect, useState } from 'react';
29
+ import BizSelectToInput from './components/selectToInput';
30
+ import { IconFont, BizSelect } from '..';
31
+ import BizTab from './components/tab';
32
+ import BizList from './components/list';
33
+
34
+ var BizDialog = function BizDialog(props) {
35
+ var _props$width = props.width,
36
+ width = _props$width === void 0 ? 520 : _props$width,
37
+ _props$title = props.title,
38
+ title = _props$title === void 0 ? 'Title' : _props$title,
39
+ initialValues = props.initialValues,
40
+ fields = props.fields,
41
+ _props$visible = props.visible,
42
+ visible = _props$visible === void 0 ? false : _props$visible,
43
+ _props$showMark = props.showMark,
44
+ showMark = _props$showMark === void 0 ? false : _props$showMark,
45
+ _props$layout = props.layout,
46
+ layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
47
+ _onOk = props.onOk,
48
+ _onCancel = props.onCancel;
49
+
50
+ var _Form$useForm = Form.useForm(),
51
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
52
+ form = _Form$useForm2[0];
53
+
54
+ var _useState = useState(fields),
55
+ _useState2 = _slicedToArray(_useState, 2),
56
+ formFields = _useState2[0],
57
+ setFormFields = _useState2[1];
58
+
59
+ var getFormItem = function getFormItem(data) {
60
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'input';
61
+ var name = arguments.length > 2 ? arguments[2] : undefined;
62
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
63
+
64
+ if (type === 'selectToInput') {
65
+ return /*#__PURE__*/React.createElement(BizSelectToInput, {
66
+ name: name,
67
+ options: options,
68
+ onChangeType: function onChangeType(isSelect) {
69
+ if (data.children && data.children.length > 0) {
70
+ var children = _toConsumableArray(data.children);
71
+
72
+ var arr = [];
73
+ fields.forEach(function (item) {
74
+ var field = _objectSpread({}, item);
75
+
76
+ if (children.indexOf(item.name) > -1) {
77
+ field.hidden = isSelect;
78
+ }
79
+
80
+ arr.push(field);
81
+ });
82
+ setFormFields(function () {
83
+ return [].concat(arr);
84
+ });
85
+ }
86
+ }
87
+ });
88
+ } else if (type === 'select') {
89
+ return /*#__PURE__*/React.createElement(BizSelect, {
90
+ options: options,
91
+ name: name,
92
+ size: "middle"
93
+ });
94
+ } else if (type === 'input') {
95
+ return /*#__PURE__*/React.createElement(Input, {
96
+ className: "biz-input",
97
+ placeholder: data.placeholder || "\u8BF7\u8F93\u5165".concat(name),
98
+ autoComplete: "off",
99
+ allowClear: {
100
+ clearIcon: /*#__PURE__*/React.createElement(IconFont, {
101
+ className: "biz-icon",
102
+ type: 'icon-qingchu'
103
+ })
104
+ }
105
+ });
106
+ } else if (type === 'password') {
107
+ return /*#__PURE__*/React.createElement(Input.Password, {
108
+ className: "biz-input",
109
+ placeholder: data.placeholder || "\u8BF7\u8F93\u5165".concat(name)
110
+ });
111
+ } else if (type === 'tab') {
112
+ return /*#__PURE__*/React.createElement(BizTab, {
113
+ options: options
114
+ });
115
+ } else if (type === 'radio') {
116
+ return /*#__PURE__*/React.createElement(Radio.Group, null, /*#__PURE__*/React.createElement(Space, {
117
+ direction: data.direction || 'horizontal'
118
+ }, options.map(function (item) {
119
+ return /*#__PURE__*/React.createElement(Radio, {
120
+ key: item.value,
121
+ value: item.value
122
+ }, item.label);
123
+ })));
124
+ } else if (type === 'list') {
125
+ return /*#__PURE__*/React.createElement(BizList, {
126
+ options: options.length > 0 ? options : undefined
127
+ });
128
+ }
129
+ };
130
+
131
+ useEffect(function () {
132
+ if (visible) {
133
+ form.resetFields();
134
+ }
135
+ }, [visible]);
136
+ useEffect(function () {
137
+ setFormFields(function () {
138
+ return _toConsumableArray(fields);
139
+ });
140
+ }, [fields]);
141
+ return /*#__PURE__*/React.createElement(Modal, {
142
+ width: width,
143
+ centered: true,
144
+ visible: visible,
145
+ title: title,
146
+ maskStyle: {
147
+ background: '#021429',
148
+ opacity: 0.8
149
+ },
150
+ bodyStyle: {
151
+ borderRadius: '10px'
152
+ },
153
+ cancelText: "\u53D6\u6D88",
154
+ okText: "\u786E\u5B9A",
155
+ closable: false,
156
+ onCancel: function onCancel() {
157
+ return _onCancel && _onCancel();
158
+ },
159
+ onOk: function onOk() {
160
+ form.validateFields().then(function (values) {
161
+ _onOk && _onOk(values);
162
+ }).catch(function (info) {
163
+ console.log('Validate Failed:', info);
164
+ });
165
+ }
166
+ }, /*#__PURE__*/React.createElement(Form, {
167
+ className: "biz-dialog",
168
+ form: form,
169
+ name: "form_in_modal",
170
+ requiredMark: showMark,
171
+ initialValues: initialValues,
172
+ layout: layout
173
+ }, formFields === null || formFields === void 0 ? void 0 : formFields.map(function (item, index) {
174
+ return /*#__PURE__*/React.createElement(Form.Item, {
175
+ key: item.name,
176
+ label: item.label,
177
+ name: item.name,
178
+ hidden: item.hidden,
179
+ rules: item.rules,
180
+ help: item.help,
181
+ wrapperCol: {
182
+ offset: !item.label && layout === 'horizontal' ? 2 : 0
183
+ }
184
+ }, getFormItem(item, item.type, item.label, item.options));
185
+ })));
186
+ };
187
+
188
+ export default BizDialog;
@@ -0,0 +1,70 @@
1
+ @import '../../commonStyle/index.less';
2
+
3
+ .biz-flex {
4
+ display: flex;
5
+ align-items: center;
6
+ }
7
+
8
+ .biz-input {
9
+ flex: 1;
10
+ }
11
+
12
+ .biz-icon-switch {
13
+ margin-left: 5px;
14
+ cursor: pointer;
15
+
16
+ &:hover {
17
+ color: @themeColor;
18
+ }
19
+ }
20
+
21
+ .biz-dialog {
22
+ .ant-select:not(.ant-select-customize-input) {
23
+ .ant-select-selector {
24
+ background-color: @grayColor;
25
+ border-color: @grayColor;
26
+ }
27
+
28
+ &.ant-select-focused:not(.ant-select-disabled),
29
+ &:hover {
30
+ .ant-select-selector {
31
+ background: #fff;
32
+ border-color: @themeColor;
33
+ box-shadow: 0 0 0 4px #e8efff;
34
+
35
+ & + .ant-select-arrow .biz-icon {
36
+ color: @themeColor;
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ .ant-form-item-label > label {
43
+ height: 40px;
44
+ }
45
+ }
46
+
47
+ .ant-modal-footer {
48
+ padding-bottom: 32px;
49
+ border-top: none;
50
+
51
+ .ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
52
+ margin-left: 16px;
53
+ }
54
+ }
55
+
56
+ .ant-modal-header {
57
+ padding-top: 24px;
58
+ border-bottom: none;
59
+
60
+ .ant-modal-title {
61
+ color: #000;
62
+ font-weight: 500;
63
+ font-size: 24px;
64
+ }
65
+ }
66
+
67
+ .ant-modal-body {
68
+ max-height: 400px;
69
+ overflow: auto;
70
+ }
@@ -0,0 +1,120 @@
1
+ @import '../commonStyle/theme.less';
2
+
3
+ .dropdown {
4
+ height: 100%;
5
+ padding: @dropdownPadding;
6
+ overflow: auto;
7
+ background: #ffffff;
8
+ border-radius: @boxRadius2;
9
+ box-shadow: @boxShadow;
10
+ }
11
+
12
+ .biz-cascade {
13
+ position: relative;
14
+ width: 100%;
15
+ color: @fontColor;
16
+ font-size: @fontSize;
17
+ }
18
+
19
+ .biz-dropdown-cascade {
20
+ position: absolute;
21
+ top: 40px;
22
+ left: -4px;
23
+ z-index: 9999;
24
+ display: none;
25
+ height: @dropdownHeight;
26
+ transition: all 0.3s;
27
+
28
+ &.biz-flex {
29
+ display: flex;
30
+ }
31
+
32
+ .biz-dropdown-menu {
33
+ width: @dropdownWidth3;
34
+ .dropdown();
35
+
36
+ .biz-dropdown-item {
37
+ display: flex;
38
+ justify-content: space-between;
39
+ height: @selectItemHeight;
40
+ padding: @selectItemPadding;
41
+ line-height: 20px;
42
+
43
+ .biz-count {
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ height: 20px;
48
+ padding: 0 4px;
49
+ border-radius: @boxRadius2;
50
+ }
51
+
52
+ &:hover .biz-count,
53
+ &.box-hover .biz-count {
54
+ .box-active();
55
+ }
56
+ }
57
+ }
58
+
59
+ .biz-dropdown-content {
60
+ width: @dropdownWidth;
61
+ .dropdown();
62
+
63
+ .biz-dropdown-item {
64
+ list-style-type: none;
65
+ border: none;
66
+ }
67
+
68
+ .biz-dropdown-box {
69
+ height: calc(100% - 60px);
70
+ overflow: auto;
71
+ }
72
+
73
+ .biz-dropdown-search {
74
+ background: #f6f6f6;
75
+ border-radius: 8px;
76
+ }
77
+ }
78
+
79
+ .biz-dropdown-item {
80
+ border-radius: @boxRadius2;
81
+ cursor: pointer;
82
+
83
+ &:not(.box-active):hover {
84
+ .box-hover();
85
+ }
86
+ }
87
+ }
88
+
89
+ .biz-edit-modal {
90
+ position: absolute;
91
+ top: 40px;
92
+ left: 0;
93
+ z-index: 1000;
94
+ width: 390px;
95
+ padding: 4px;
96
+ background: #ffffff;
97
+ border-radius: 10px;
98
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
99
+
100
+ .biz-modal-footer {
101
+ display: flex;
102
+ flex-direction: row-reverse;
103
+ width: 100%;
104
+ margin-top: 8px;
105
+
106
+ .biz-modal-btn {
107
+ padding: 5px 12px;
108
+ font-weight: 400;
109
+ font-size: @fontSize;
110
+ line-height: 22px;
111
+ border-radius: 6px;
112
+ cursor: pointer;
113
+
114
+ &.biz-modal-btn-primary {
115
+ color: @btnPrimaryFontColor;
116
+ background: @btnPrimaryBgColor;
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,89 @@
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 { Button, Form } from 'antd';
14
+ import React, { useState } from 'react';
15
+ import { BizEventSelector } from 'business-lib';
16
+ var cascadeOptions = [{
17
+ value: 1,
18
+ label: '整体',
19
+ children: [{
20
+ value: 'xihu',
21
+ label: 'West Lake'
22
+ }, {
23
+ value: 'xiasha',
24
+ label: 'Xia Sha'
25
+ }]
26
+ }, {
27
+ value: 2,
28
+ label: '分组',
29
+ children: [{
30
+ value: 'xihu2',
31
+ label: 'West Lake2'
32
+ }, {
33
+ value: 'xiasha2',
34
+ label: 'Xia Sha2j'
35
+ }]
36
+ }];
37
+
38
+ var EventDemo = function EventDemo() {
39
+ var _Form$useForm = Form.useForm(),
40
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
41
+ form = _Form$useForm2[0];
42
+
43
+ var _useState = useState({
44
+ target: 'xiasha2'
45
+ }),
46
+ _useState2 = _slicedToArray(_useState, 2),
47
+ formData = _useState2[0],
48
+ setFormData = _useState2[1];
49
+
50
+ var onFinish = function onFinish(values) {
51
+ setFormData(values);
52
+ };
53
+
54
+ var onFinishFailed = function onFinishFailed(errorInfo) {
55
+ console.log('Failed:', errorInfo);
56
+ };
57
+
58
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
59
+ form: form,
60
+ onFinish: onFinish,
61
+ onFinishFailed: onFinishFailed,
62
+ initialValues: formData
63
+ }, /*#__PURE__*/React.createElement(Form.Item, {
64
+ label: "\u6307\u6807",
65
+ name: "target"
66
+ }, /*#__PURE__*/React.createElement(BizEventSelector, {
67
+ responseType: 'object',
68
+ options: cascadeOptions,
69
+ fieldNames: {
70
+ label: 'label',
71
+ value: 'value',
72
+ groupLabel: 'label',
73
+ groupValue: 'value',
74
+ children: 'children'
75
+ }
76
+ })), /*#__PURE__*/React.createElement(Form.Item, {
77
+ wrapperCol: {
78
+ offset: 8,
79
+ span: 16
80
+ }
81
+ }, /*#__PURE__*/React.createElement(Button, {
82
+ type: "primary",
83
+ htmlType: "submit"
84
+ }, "Submit"))), /*#__PURE__*/React.createElement("p", null, JSON.stringify(formData)));
85
+ };
86
+
87
+ export default (function () {
88
+ return /*#__PURE__*/React.createElement(EventDemo, null);
89
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,69 @@
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 { BizEventSelector } from 'business-lib';
15
+ var cascadeOptions = [{
16
+ value: 1,
17
+ label: '整体',
18
+ children: [{
19
+ value: 'xihu',
20
+ label: 'West Lake'
21
+ }, {
22
+ value: 'xiasha',
23
+ label: 'Xia Sha'
24
+ }]
25
+ }, {
26
+ value: 2,
27
+ label: '分组',
28
+ children: [{
29
+ value: 'xihu2',
30
+ label: 'West Lake2'
31
+ }, {
32
+ value: 'xiasha2',
33
+ label: 'Xia Sha2j'
34
+ }]
35
+ }];
36
+
37
+ var EventDemo = function EventDemo() {
38
+ var _useState = useState('xiasha2'),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ test = _useState2[0],
41
+ setTest = _useState2[1];
42
+
43
+ var _useState3 = useState(),
44
+ _useState4 = _slicedToArray(_useState3, 2),
45
+ option = _useState4[0],
46
+ setOption = _useState4[1];
47
+
48
+ var handleChange = function handleChange(value, data) {
49
+ setTest(value);
50
+ setOption(data);
51
+ };
52
+
53
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizEventSelector, {
54
+ defaultValue: test,
55
+ onChange: handleChange,
56
+ options: cascadeOptions,
57
+ fieldNames: {
58
+ label: 'label',
59
+ value: 'value',
60
+ groupLabel: 'label',
61
+ groupValue: 'value',
62
+ children: 'children'
63
+ }
64
+ }), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6id\u662F\uFF1A", test), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u4FE1\u606F\u662F\uFF1A", JSON.stringify(option)));
65
+ };
66
+
67
+ export default (function () {
68
+ return /*#__PURE__*/React.createElement(EventDemo, null);
69
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;