@zgfe/business-lib 1.0.8 → 1.0.11

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 (80) hide show
  1. package/es/addToPanel/components/addPanel.d.ts +7 -0
  2. package/es/addToPanel/components/addPanel.js +101 -0
  3. package/es/addToPanel/components/radioGroup.d.ts +7 -0
  4. package/es/addToPanel/components/radioGroup.js +29 -0
  5. package/es/addToPanel/components/styleList.d.ts +5 -0
  6. package/es/{dialog/components/tab.js → addToPanel/components/styleList.js} +9 -6
  7. package/es/{dialog/demo/index2.d.ts → addToPanel/demo/edit.d.ts} +0 -0
  8. package/es/{dialog/components/list.js → addToPanel/demo/edit.js} +63 -44
  9. package/es/{dialog/demo/index3.d.ts → addToPanel/demo/index.d.ts} +0 -0
  10. package/es/addToPanel/demo/index.js +78 -0
  11. package/es/addToPanel/index.d.ts +6 -0
  12. package/es/addToPanel/index.js +253 -0
  13. package/es/addToPanel/styles/addPanel.less +25 -0
  14. package/es/addToPanel/styles/index.less +6 -0
  15. package/es/{dialog/components/styles/tab.less → addToPanel/styles/style.less} +7 -2
  16. package/es/addToPanel/types.d.ts +56 -0
  17. package/es/addToPanel/types.js +1 -0
  18. package/es/addToScene/addGroup.d.ts +11 -0
  19. package/es/addToScene/addGroup.js +34 -0
  20. package/es/addToScene/demo/index.d.ts +2 -0
  21. package/es/addToScene/demo/index.js +34 -0
  22. package/es/addToScene/index.d.ts +6 -0
  23. package/es/addToScene/index.js +192 -0
  24. package/es/addToScene/styles/index.less +23 -0
  25. package/es/addToScene/types.d.ts +29 -0
  26. package/es/addToScene/types.js +1 -0
  27. package/es/analysisLayout/demo/index.d.ts +1 -0
  28. package/es/analysisLayout/demo/index.js +7 -1
  29. package/es/analysisLayout/index.d.ts +1 -0
  30. package/es/analysisLayout/index.js +2 -1
  31. package/es/analysisLayout/index.less +3 -2
  32. package/es/assets/styles/chunks.less +19 -3
  33. package/es/assets/styles/resetAntd.less +61 -20
  34. package/es/assets/styles/variable.less +8 -1
  35. package/es/assets/theme.d.ts +3 -0
  36. package/es/assets/theme.js +4 -1
  37. package/es/attrConditions/components/stringList.js +4 -3
  38. package/es/attributeSelector/demo/index.js +1 -1
  39. package/es/attributeSelector/index.js +12 -2
  40. package/es/attributeSelector/styles/index.less +2 -1
  41. package/es/chart/demo/index.js +36 -4
  42. package/es/chart/index.d.ts +1 -1
  43. package/es/chart/index.js +16 -5
  44. package/es/config.d.ts +15 -0
  45. package/es/config.js +8 -0
  46. package/es/constants/apis.d.ts +8 -0
  47. package/es/constants/apis.js +8 -0
  48. package/es/datePicker/styles/index.less +4 -0
  49. package/es/dialog/demo/index.d.ts +0 -29
  50. package/es/dialog/demo/index.js +6 -130
  51. package/es/dialog/index.d.ts +1 -2
  52. package/es/dialog/index.js +15 -183
  53. package/es/dialog/types.d.ts +2 -74
  54. package/es/eventSelector/listPanel.js +8 -0
  55. package/es/eventSelector/styles/index.less +11 -5
  56. package/es/index.d.ts +4 -1
  57. package/es/index.js +4 -1
  58. package/es/select/index.js +4 -2
  59. package/es/select/overlay.js +3 -1
  60. package/es/select/styles/handle.less +2 -0
  61. package/es/select/styles/index.less +0 -3
  62. package/es/select/types.d.ts +2 -0
  63. package/es/targetSelector/styles/index.less +3 -1
  64. package/es/userGroup/demo/index.js +4 -1
  65. package/es/userGroup/index.js +1 -1
  66. package/es/utils/ajax.d.ts +33 -7
  67. package/es/utils/ajax.js +212 -111
  68. package/package.json +4 -3
  69. package/es/dialog/components/itemNode.d.ts +0 -10
  70. package/es/dialog/components/itemNode.js +0 -109
  71. package/es/dialog/components/list.d.ts +0 -5
  72. package/es/dialog/components/selectToInput.d.ts +0 -6
  73. package/es/dialog/components/selectToInput.js +0 -175
  74. package/es/dialog/components/styles/handle.less +0 -39
  75. package/es/dialog/components/styles/list.less +0 -60
  76. package/es/dialog/components/tab.d.ts +0 -5
  77. package/es/dialog/data/data.d.ts +0 -20
  78. package/es/dialog/data/data.js +0 -73
  79. package/es/dialog/demo/index2.js +0 -109
  80. package/es/dialog/demo/index3.js +0 -61
@@ -5,6 +5,7 @@
5
5
  // 输入框(带icon)
6
6
  .ant-input-affix-wrapper {
7
7
  height: @height-lg;
8
+ padding: 0 @padding-xs;
8
9
  line-height: @height-lg;
9
10
  background-color: @background-color-base;
10
11
  border-color: #fff;
@@ -17,6 +18,11 @@
17
18
  &:hover {
18
19
  border-color: @primary-color;
19
20
  }
21
+
22
+ &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper,
23
+ &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper:hover {
24
+ background-color: @background-color-base;
25
+ }
20
26
  }
21
27
 
22
28
  .ant-input-affix-wrapper-focused {
@@ -42,28 +48,10 @@
42
48
  }
43
49
 
44
50
  .ant-input-group-addon {
51
+ color: @text-color-secondary;
45
52
  background-color: @background-color-base;
46
53
  }
47
54
 
48
- .ant-btn-default {
49
- border-radius: 4px;
50
-
51
- &:hover,
52
- &:active,
53
- &:focus {
54
- .__default-hover();
55
- }
56
- }
57
-
58
- .ant-btn-primary {
59
- border-radius: @border-radius-small;
60
- }
61
-
62
- .ant-btn-sm {
63
- padding: 0 5px;
64
- font-size: 12px;
65
- }
66
-
67
55
  .ant-select-dropdown {
68
56
  .__select-panel();
69
57
  }
@@ -71,7 +59,7 @@
71
59
  // 选择框下拉选项
72
60
  .ant-select-item {
73
61
  height: @height-lg;
74
- padding: 10px 8px;
62
+ padding: 0 @padding-sm;
75
63
  border-radius: @border-radius-normal;
76
64
 
77
65
  &:hover:not(.ant-select-item-option-disabled, .ant-select-item-option-selected) {
@@ -130,6 +118,14 @@
130
118
  .ant-picker {
131
119
  border-radius: @border-radius-small;
132
120
 
121
+ span {
122
+ color: @text-color-secondary;
123
+ }
124
+
125
+ .ant-picker-input > input {
126
+ color: @text-color;
127
+ }
128
+
133
129
  &:hover,
134
130
  &.ant-picker-focused {
135
131
  .__default-hover();
@@ -376,6 +372,10 @@
376
372
  }
377
373
  }
378
374
 
375
+ .ant-table-tbody {
376
+ color: @text-color-secondary;
377
+ }
378
+
379
379
  .ant-table-tbody > tr:not(:last-child) > td {
380
380
  border-bottom: 1px solid @border-color-base;
381
381
  }
@@ -396,3 +396,44 @@
396
396
  background: @primary-1;
397
397
  }
398
398
  }
399
+
400
+ /* 提示框 */
401
+ .ant-tooltip-inner {
402
+ padding: @padding-sm @padding-md;
403
+ border-radius: @border-radius-normal;
404
+ }
405
+
406
+ .ant-form-item-label > label {
407
+ color: @text-color-secondary;
408
+ }
409
+
410
+ .ant-btn {
411
+ border-radius: @border-radius-small;
412
+ }
413
+
414
+ .ant-btn-text {
415
+ background-color: @background-color-gray;
416
+ border: none;
417
+
418
+ &:hover {
419
+ color: @text-color;
420
+ background-color: @btn-text-hover-bg;
421
+ }
422
+
423
+ &:focus {
424
+ color: @text-color;
425
+ background-color: #94a6ce;
426
+ }
427
+ }
428
+
429
+ .ant-btn-primary {
430
+ color: #fff;
431
+ }
432
+
433
+ .ant-btn-ghost {
434
+ color: @text-color-secondary;
435
+ }
436
+
437
+ .ant-form-item-explain-error {
438
+ color: @error-color;
439
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  @border-radius-sx: 2px;
4
4
  @border-radius-small: 4px;
5
- @border-radius-normal: 10px;
5
+ @border-radius-normal: 8px;
6
6
  @border-radius-large: 20px;
7
7
  @option-height: @height-lg;
8
8
  @background-color-base: #fafafb;
@@ -19,3 +19,10 @@
19
19
  @text-color: #021429;
20
20
  // 次要
21
21
  @text-color-secondary: #5f6085;
22
+ // 中性色/重要-文标题2
23
+ @tooltip-bg: #242541;
24
+ // 错误颜色
25
+ @error-color: #fb5547;
26
+
27
+ // text-btn hover背景色
28
+ @btn-text-hover-bg: #cacdd4;
@@ -1,5 +1,8 @@
1
1
  declare const _default: {
2
2
  'primary-color': string;
3
3
  'border-color-base': string;
4
+ 'primary-1': string;
5
+ 'text-color': string;
6
+ 'text-color-secondary': string;
4
7
  };
5
8
  export default _default;
@@ -1,4 +1,7 @@
1
1
  export default {
2
2
  'primary-color': '#165dff',
3
- 'border-color-base': '#ECEDF0'
3
+ 'border-color-base': '#ECEDF0',
4
+ 'primary-1': '#E8EFFF',
5
+ 'text-color': '#021429',
6
+ 'text-color-secondary': '#5f6085'
4
7
  };
@@ -17,9 +17,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  import React, { useContext, useEffect, useState } from 'react';
18
18
  import { classPrefix } from '..';
19
19
  import { PropCategory } from '../../attributeSelector/types';
20
+ import Apis from '../../constants/apis';
20
21
  import BizGlobalDataContext from '../../context';
21
22
  import BizSelect from '../../select';
22
- import { ajax } from '../../utils';
23
+ import request from '../../utils/ajax';
23
24
  import { OperateTypes } from '../types';
24
25
 
25
26
  var StringList = function StringList(props) {
@@ -99,8 +100,8 @@ var StringList = function StringList(props) {
99
100
  };
100
101
 
101
102
  formData = transformRequest(requestData);
102
- ajax({
103
- url: '/data/queryEsData.jsp',
103
+ request(Apis.esQuery, {
104
+ method: 'post',
104
105
  data: formData,
105
106
  headers: {
106
107
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -51,7 +51,7 @@ export default (function () {
51
51
  enableDelete: true,
52
52
  disableItemList: [{
53
53
  propCategory: 'eventProp',
54
- id: 30183424
54
+ id: 30183426
55
55
  }, {
56
56
  name: 'is_anonymous',
57
57
  propCategory: 'userProp'
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import React, { useContext, useEffect, useState } from 'react';
19
+ import React, { useContext, useEffect, useRef, useState } from 'react';
20
20
  import './styles/index.less';
21
21
  import { Dropdown, Tooltip } from 'antd';
22
22
  import AttrListPanel from './listPanel';
@@ -49,7 +49,15 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
49
49
  userPropList = _useContext.userPropList,
50
50
  eventEnvList = _useContext.eventEnvList;
51
51
 
52
+ var boxRef = useRef(null);
53
+
54
+ var _useState7 = useState(200),
55
+ _useState8 = _slicedToArray(_useState7, 2),
56
+ width = _useState8[0],
57
+ setWidth = _useState8[1];
58
+
52
59
  useEffect(function () {
60
+ setWidth(boxRef.current.width || 284);
53
61
  if (!props.defaultValue) return;
54
62
  setCurrentAttr(getValue(props.defaultValue));
55
63
  }, []);
@@ -108,7 +116,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
108
116
  })),
109
117
  trigger: ['click'],
110
118
  overlayStyle: {
111
- minWidth: 0
119
+ minWidth: 284,
120
+ width: width
112
121
  },
113
122
  visible: visible,
114
123
  onVisibleChange: onVisibleChange
@@ -117,6 +126,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
117
126
  width: '100%'
118
127
  }
119
128
  }, /*#__PURE__*/React.createElement(SelectHandle, {
129
+ ref: boxRef,
120
130
  theme: "secondary",
121
131
  border: false,
122
132
  label: currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.label,
@@ -12,15 +12,16 @@
12
12
  display: none;
13
13
  flex: none;
14
14
  width: @icon-width;
15
+ color: @text-color-secondary;
15
16
  line-height: 2em;
16
17
  text-align: center;
17
18
  border-radius: @border-radius-small;
19
+
18
20
  &:hover {
19
21
  .__error-hover();
20
22
  }
21
23
  }
22
24
  &-drowdown {
23
- width: 284px;
24
25
  .__select-panel();
25
26
  &.nodata {
26
27
  .__select-nodata();
@@ -1,10 +1,42 @@
1
- import React from 'react';
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, { useRef, useState } from 'react';
2
14
  import { BizChart } from '@zgfe/business-lib';
3
15
  import chartData from './data/data';
16
+ import { Button, Image } from 'antd';
4
17
  export default (function () {
5
- return /*#__PURE__*/React.createElement(BizChart, {
18
+ var chartRef = useRef();
19
+
20
+ var _useState = useState(),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ chartImg = _useState2[0],
23
+ setChartImg = _useState2[1];
24
+
25
+ var onClick = function onClick() {
26
+ var url = chartRef.current.instance.getDataURL();
27
+ setChartImg(url);
28
+ };
29
+
30
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizChart, {
6
31
  data: chartData,
7
32
  type: "line",
8
- legendPosition: "bottom"
9
- });
33
+ legendPosition: "bottom",
34
+ ref: chartRef
35
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
36
+ onClick: onClick
37
+ }, "\u83B7\u53D6\u56FE\u8868\u56FE\u7247"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Image, {
38
+ src: chartImg,
39
+ width: "100%",
40
+ height: 300
41
+ }));
10
42
  });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './util/data/china.js';
3
3
  import { ChartTypes } from './types';
4
- declare const BizChart: React.FC<ChartTypes.Props>;
4
+ declare const BizChart: React.ForwardRefExoticComponent<ChartTypes.Props & React.RefAttributes<any>>;
5
5
  export default BizChart;
package/es/chart/index.js CHANGED
@@ -16,15 +16,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import React, { useEffect, useState } from 'react';
19
+ import React, { useEffect, useImperativeHandle, useState } from 'react';
20
20
  import ReactEChartsCore from 'echarts-for-react/lib/core';
21
21
  import * as echarts from 'echarts';
22
22
  import { getChartOption, getPieOption, getMapOption } from './util/chartOptionConfig';
23
23
  import { provinceSeries, citySeries, maxMinValue } from './util/mapUtil';
24
24
  import { formatPieData, formatChartData } from './util/formatData';
25
25
  import './util/data/china.js';
26
-
27
- var BizChart = function BizChart(props) {
26
+ var BizChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
27
  var type = props.type,
29
28
  data = props.data,
30
29
  showList = props.showList,
@@ -50,6 +49,11 @@ var BizChart = function BizChart(props) {
50
49
  chartOption = _useState2[0],
51
50
  setChartOption = _useState2[1];
52
51
 
52
+ var _useState3 = useState(),
53
+ _useState4 = _slicedToArray(_useState3, 2),
54
+ instance = _useState4[0],
55
+ setInstance = _useState4[1];
56
+
53
57
  useEffect(function () {
54
58
  if (option) {
55
59
  setChartOption(function () {
@@ -82,7 +86,15 @@ var BizChart = function BizChart(props) {
82
86
  return _objectSpread({}, eOption);
83
87
  });
84
88
  }, [data, showAll, showList, reverseXAxis]);
89
+ useImperativeHandle(ref, function () {
90
+ return {
91
+ instance: instance
92
+ };
93
+ });
85
94
  return /*#__PURE__*/React.createElement(ReactEChartsCore, {
95
+ ref: function ref(e) {
96
+ setInstance(e === null || e === void 0 ? void 0 : e.getEchartsInstance());
97
+ },
86
98
  echarts: echarts,
87
99
  option: chartOption,
88
100
  notMerge: true,
@@ -92,8 +104,7 @@ var BizChart = function BizChart(props) {
92
104
  width: '100%'
93
105
  }
94
106
  });
95
- };
96
-
107
+ });
97
108
  BizChart.defaultProps = {
98
109
  showAll: false,
99
110
  reverseXAxis: false,
package/es/config.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { RequestOptionsInit } from 'umi-request';
2
+ import { ApiResult } from './utils/ajax';
3
+ export interface RequestConfig {
4
+ optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
5
+ url: string;
6
+ options?: RequestOptionsInit;
7
+ };
8
+ responseWrapper?: (url: string, apiResult: ApiResult<any>) => ApiResult<any>;
9
+ }
10
+ export interface GlobalConfig {
11
+ request?: RequestConfig;
12
+ }
13
+ export declare let globalConfig: GlobalConfig;
14
+ declare function setGlobalConfig(config: GlobalConfig): void;
15
+ export default setGlobalConfig;
package/es/config.js ADDED
@@ -0,0 +1,8 @@
1
+ import _ from 'lodash';
2
+ export var globalConfig = {};
3
+
4
+ function setGlobalConfig(config) {
5
+ globalConfig = _.assignIn(config, globalConfig);
6
+ }
7
+
8
+ export default setGlobalConfig;
@@ -0,0 +1,8 @@
1
+ declare const Apis: {
2
+ querySceneGroup: string;
3
+ addScene: string;
4
+ esQuery: string;
5
+ addPanel: string;
6
+ queryPanelGroup: string;
7
+ };
8
+ export default Apis;
@@ -0,0 +1,8 @@
1
+ var Apis = {
2
+ querySceneGroup: '/scene/queryScenesOfGroup.jsp',
3
+ addScene: '/scene/addScene.jsp',
4
+ esQuery: '/data/queryEsData.jsp',
5
+ addPanel: '/apppanel/addPanelElement.jsp',
6
+ queryPanelGroup: '/apppanel/panels.jsp'
7
+ };
8
+ export default Apis;
@@ -1,4 +1,5 @@
1
1
  @import '../../assets/styles/inner.less';
2
+
2
3
  .biz-date-picker {
3
4
  display: flex;
4
5
 
@@ -10,15 +11,18 @@
10
11
  display: flex;
11
12
  margin: 0 16px;
12
13
  }
14
+
13
15
  .biz-select-handle {
14
16
  padding: 0;
15
17
  }
18
+
16
19
  &-item {
17
20
  display: flex;
18
21
  align-items: center;
19
22
  justify-content: center;
20
23
  width: 58px;
21
24
  height: @height-base;
25
+ color: @text-color-secondary;
22
26
  border: 1px solid @border-color-base;
23
27
  cursor: pointer;
24
28
 
@@ -1,31 +1,2 @@
1
- export declare const chartTypes: ({
2
- label: string;
3
- value: string;
4
- icon: string;
5
- disabled?: undefined;
6
- children?: undefined;
7
- } | {
8
- label: string;
9
- value: string;
10
- icon: string;
11
- disabled: boolean;
12
- children?: undefined;
13
- } | {
14
- label: string;
15
- value: string;
16
- icon: string;
17
- children: ({
18
- label: string;
19
- value: string;
20
- icon: string;
21
- disabled?: undefined;
22
- } | {
23
- label: string;
24
- value: string;
25
- icon: string;
26
- disabled: boolean;
27
- })[];
28
- disabled?: undefined;
29
- })[];
30
1
  declare const _default: () => JSX.Element;
31
2
  export default _default;
@@ -1,9 +1,3 @@
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
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
2
 
9
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."); }
@@ -19,143 +13,25 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
13
  import React, { useState } from 'react';
20
14
  import { BizDialog } from '@zgfe/business-lib';
21
15
  import { Button } from 'antd';
22
- var options = [{
23
- id: 11,
24
- name: '分类一'
25
- }, {
26
- id: 22,
27
- name: '分类二'
28
- }, {
29
- id: 33,
30
- name: '分分类三一'
31
- }];
32
- export var chartTypes = [{
33
- label: '趋势图',
34
- value: 'line',
35
- icon: 'qushitu1'
36
- }, {
37
- label: '汇总图',
38
- value: 'bar',
39
- icon: 'huizongtu'
40
- }, {
41
- label: '地图',
42
- value: 'map',
43
- icon: 'ditu',
44
- disabled: true
45
- }, {
46
- label: '表格',
47
- value: 'table',
48
- icon: 'biaoge',
49
- children: [{
50
- label: '趋势图',
51
- value: 'line',
52
- icon: 'qushitu1'
53
- }, {
54
- label: '汇总图',
55
- value: 'bar',
56
- icon: 'huizongtu',
57
- disabled: true
58
- }]
59
- }, {
60
- label: '分数',
61
- value: 'fraction',
62
- icon: 'fenshu'
63
- }];
64
- var fields = [{
65
- label: '分类',
66
- name: 'class',
67
- extendName: 'range',
68
- type: 'selectToInput',
69
- options: options,
70
- children: ['range'],
71
- fieldNames: {
72
- label: 'name',
73
- value: 'id'
74
- },
75
- rules: [{
76
- required: true,
77
- message: '请选择分类'
78
- }],
79
- onChange: function onChange(val) {
80
- console.log('value>>>', val);
81
- }
82
- }, {
83
- label: '名称',
84
- name: 'name',
85
- type: 'input',
86
- rules: [{
87
- required: true,
88
- message: '请输入名称'
89
- }]
90
- }, {
91
- label: '图表',
92
- name: 'chart',
93
- type: 'tab',
94
- options: chartTypes,
95
- rules: [{
96
- required: true,
97
- message: '请选择图表'
98
- }]
99
- }, {
100
- label: '显示',
101
- name: 'show',
102
- type: 'radio',
103
- direction: 'vertical',
104
- dependenceFields: {
105
- chart: 'line'
106
- },
107
- options: [{
108
- label: '动态显示数据最多的10个分组',
109
- value: 'dynamic'
110
- }, {
111
- label: '固定显示当前选择的分组',
112
- value: 'fix'
113
- }],
114
- rules: [{
115
- required: true,
116
- message: '请选择'
117
- }]
118
- }];
119
- var formData = {
120
- class: {
121
- id: 11,
122
- name: '分类一'
123
- },
124
- range: 'public',
125
- show: 'dynamic',
126
- chart: 'line'
127
- };
128
16
  export default (function () {
129
17
  var _useState = useState(false),
130
18
  _useState2 = _slicedToArray(_useState, 2),
131
19
  visible = _useState2[0],
132
20
  setVisible = _useState2[1];
133
21
 
134
- var _useState3 = useState(),
135
- _useState4 = _slicedToArray(_useState3, 2),
136
- dialogData = _useState4[0],
137
- setDialogData = _useState4[1];
138
-
139
- var handleSubmit = function handleSubmit(data) {
140
- setDialogData(function () {
141
- return _objectSpread({}, data);
142
- });
143
- setVisible(false);
144
- };
145
-
146
22
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
147
23
  type: "primary",
148
24
  onClick: function onClick() {
149
25
  setVisible(true);
150
26
  }
151
- }, "\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, {
152
- title: "\u5411\u770B\u677F\u6DFB\u52A0\u6307\u6807",
27
+ }, "\u6253\u5F00\u5F39\u7A97"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizDialog, {
28
+ title: "\u6807\u9898",
153
29
  visible: visible,
154
- onOk: handleSubmit,
155
- fields: fields,
156
- initialValues: formData,
30
+ onOk: function onOk() {
31
+ setVisible(false);
32
+ },
157
33
  onCancel: function onCancel() {
158
34
  setVisible(false);
159
35
  }
160
- }));
36
+ }, "fdfdfdsa"));
161
37
  });
@@ -1,7 +1,6 @@
1
- import { FormItemProps, ModalProps } from 'antd';
2
1
  import React from 'react';
3
2
  import { DialogTypes } from './types';
4
3
  import './styles/index.less';
5
4
  export declare const classPrefix = "biz-dialog";
6
- declare const BizDialog: React.FC<ModalProps & DialogTypes.Props & FormItemProps>;
5
+ declare const BizDialog: React.FC<DialogTypes.Props>;
7
6
  export default BizDialog;