@zgfe/business-lib 1.0.9 → 1.0.12

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 (79) 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} +12 -7
  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} +64 -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 +268 -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 +57 -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 +195 -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 +1 -0
  29. package/es/analysisLayout/index.js +1 -1
  30. package/es/analysisLayout/index.less +3 -2
  31. package/es/assets/iconfont/demo_index.html +49 -3
  32. package/es/assets/iconfont/iconfont.css +11 -3
  33. package/es/assets/iconfont/iconfont.js +1 -1
  34. package/es/assets/iconfont/iconfont.json +14 -0
  35. package/es/assets/iconfont/iconfont.ttf +0 -0
  36. package/es/assets/iconfont/iconfont.woff +0 -0
  37. package/es/assets/iconfont/iconfont.woff2 +0 -0
  38. package/es/assets/styles/chunks.less +17 -1
  39. package/es/assets/styles/resetAntd.less +61 -20
  40. package/es/assets/styles/variable.less +8 -1
  41. package/es/assets/theme.d.ts +3 -0
  42. package/es/assets/theme.js +4 -1
  43. package/es/attrConditions/components/stringList.js +4 -3
  44. package/es/attributeSelector/styles/index.less +2 -0
  45. package/es/config.d.ts +15 -0
  46. package/es/config.js +8 -0
  47. package/es/constants/apis.d.ts +9 -0
  48. package/es/constants/apis.js +9 -0
  49. package/es/datePicker/styles/index.less +4 -0
  50. package/es/dialog/demo/index.d.ts +0 -29
  51. package/es/dialog/demo/index.js +6 -130
  52. package/es/dialog/index.d.ts +1 -2
  53. package/es/dialog/index.js +15 -183
  54. package/es/dialog/types.d.ts +2 -74
  55. package/es/eventSelector/listPanel.js +8 -0
  56. package/es/eventSelector/styles/index.less +11 -5
  57. package/es/index.d.ts +4 -1
  58. package/es/index.js +4 -1
  59. package/es/select/index.js +1 -0
  60. package/es/select/overlay.js +3 -1
  61. package/es/select/styles/handle.less +2 -0
  62. package/es/select/styles/index.less +0 -3
  63. package/es/select/types.d.ts +1 -0
  64. package/es/targetSelector/styles/index.less +3 -1
  65. package/es/utils/ajax.d.ts +33 -7
  66. package/es/utils/ajax.js +212 -111
  67. package/package.json +4 -3
  68. package/es/dialog/components/itemNode.d.ts +0 -10
  69. package/es/dialog/components/itemNode.js +0 -109
  70. package/es/dialog/components/list.d.ts +0 -5
  71. package/es/dialog/components/selectToInput.d.ts +0 -6
  72. package/es/dialog/components/selectToInput.js +0 -175
  73. package/es/dialog/components/styles/handle.less +0 -39
  74. package/es/dialog/components/styles/list.less +0 -60
  75. package/es/dialog/components/tab.d.ts +0 -5
  76. package/es/dialog/data/data.d.ts +0 -20
  77. package/es/dialog/data/data.js +0 -73
  78. package/es/dialog/demo/index2.js +0 -109
  79. package/es/dialog/demo/index3.js +0 -61
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import '../styles/addPanel.less';
3
+ declare const AddPanel: React.FC<{
4
+ onChange?: (val: any) => void;
5
+ onBack?: () => void;
6
+ }>;
7
+ export default AddPanel;
@@ -0,0 +1,101 @@
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 { Input, Tooltip, Radio, Space } from 'antd';
14
+ import React, { useState } from 'react';
15
+ import IconFont from '../../icon/iconFont';
16
+ import '../styles/addPanel.less';
17
+ var inputOptions = [{
18
+ label: '公开',
19
+ value: 1
20
+ }, {
21
+ label: '指定人员明显',
22
+ value: 2,
23
+ title: '通过看板的共享功能指定可见成员'
24
+ }, {
25
+ label: '仅自己可见',
26
+ value: 3
27
+ }];
28
+
29
+ var AddPanel = function AddPanel(props) {
30
+ var classPrefix = 'biz-addpanel';
31
+
32
+ var _useState = useState(3),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ radioData = _useState2[0],
35
+ setRadioData = _useState2[1];
36
+
37
+ var _useState3 = useState(''),
38
+ _useState4 = _slicedToArray(_useState3, 2),
39
+ inputData = _useState4[0],
40
+ setInputData = _useState4[1];
41
+
42
+ var onChangeRadio = function onChangeRadio(e) {
43
+ var value = e.target.value;
44
+ setRadioData(value);
45
+ if (props.onChange) props.onChange({
46
+ id: 0,
47
+ name: inputData,
48
+ open_type: value
49
+ });
50
+ };
51
+
52
+ var onInput = function onInput(e) {
53
+ e.persist();
54
+ var value = e.target.value;
55
+ setInputData(value);
56
+ if (props.onChange) props.onChange({
57
+ id: 0,
58
+ name: value,
59
+ open_type: radioData
60
+ });
61
+ };
62
+
63
+ return /*#__PURE__*/React.createElement("div", {
64
+ className: classPrefix
65
+ }, /*#__PURE__*/React.createElement("div", {
66
+ className: "".concat(classPrefix, "-input-row")
67
+ }, /*#__PURE__*/React.createElement(Input, {
68
+ className: "".concat(classPrefix, "-input"),
69
+ placeholder: "\u8F93\u5165\u770B\u677F\u540D\u79F0",
70
+ autoFocus: true,
71
+ allowClear: {
72
+ clearIcon: /*#__PURE__*/React.createElement(IconFont, {
73
+ type: 'qingchu'
74
+ })
75
+ },
76
+ onInput: onInput,
77
+ onBlur: onInput
78
+ }), /*#__PURE__*/React.createElement(Tooltip, {
79
+ title: "\u8FD4\u56DE\u9009\u62E9\u770B\u677F\u5217\u8868"
80
+ }, /*#__PURE__*/React.createElement(IconFont, {
81
+ className: "".concat(classPrefix, "-switch"),
82
+ type: "shurukuang_fanhui",
83
+ onClick: props.onBack
84
+ }))), /*#__PURE__*/React.createElement("div", {
85
+ className: "".concat(classPrefix, "-radio")
86
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
87
+ value: radioData,
88
+ onChange: onChangeRadio
89
+ }, /*#__PURE__*/React.createElement(Space, {
90
+ direction: "horizontal"
91
+ }, inputOptions.map(function (item) {
92
+ return /*#__PURE__*/React.createElement(Radio, {
93
+ key: item.value,
94
+ value: item.value
95
+ }, item.title ? /*#__PURE__*/React.createElement(Tooltip, {
96
+ title: item.title
97
+ }, item.label) : item.label);
98
+ })))));
99
+ };
100
+
101
+ export default AddPanel;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const RadioGroup: React.FC<{
3
+ value?: string;
4
+ options?: any[];
5
+ onChange?: (value: any) => void;
6
+ }>;
7
+ export default RadioGroup;
@@ -0,0 +1,29 @@
1
+ import { Radio, Space } from 'antd';
2
+ import React from 'react';
3
+
4
+ var RadioGroup = function RadioGroup(props) {
5
+ var options = props.options,
6
+ onChange = props.onChange;
7
+ return /*#__PURE__*/React.createElement(Radio.Group, {
8
+ onChange: onChange,
9
+ defaultValue: props.value
10
+ }, /*#__PURE__*/React.createElement(Space, {
11
+ direction: "vertical"
12
+ }, options && options.map(function (item) {
13
+ return /*#__PURE__*/React.createElement(Radio, {
14
+ key: item.value,
15
+ value: item.value
16
+ }, item.label);
17
+ })));
18
+ };
19
+
20
+ RadioGroup.defaultProps = {
21
+ options: [{
22
+ label: '动态显示数据最多的10个分组',
23
+ value: 'dynamic'
24
+ }, {
25
+ label: '固定显示当前选择的分组',
26
+ value: 'fix'
27
+ }]
28
+ };
29
+ export default RadioGroup;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import AddToPanel from '../types';
3
+ import '../styles/style.less';
4
+ declare const StyleList: React.FC<AddToPanel.StyleProps>;
5
+ export default StyleList;
@@ -12,10 +12,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import { Dropdown, Radio, Space } from 'antd';
14
14
  import React, { useState } from 'react';
15
+ import '../styles/style.less';
15
16
  import IconFont from '../../icon/iconFont';
16
- import './styles/tab.less';
17
17
 
18
- var BizTab = function BizTab(props) {
18
+ var StyleList = function StyleList(props) {
19
19
  var _props$value;
20
20
 
21
21
  var _useState = useState((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.split(',')),
@@ -23,7 +23,7 @@ var BizTab = function BizTab(props) {
23
23
  tab = _useState2[0],
24
24
  setTab = _useState2[1];
25
25
 
26
- var classPrefix = 'biz-tab';
26
+ var classPrefix = 'biz-style';
27
27
 
28
28
  var ChildList = function ChildList(data) {
29
29
  var _data$children;
@@ -49,19 +49,21 @@ var BizTab = function BizTab(props) {
49
49
 
50
50
  var onChange = function onChange(data, child) {
51
51
  setTab([data.value, child.value]);
52
- props.onChange && props.onChange("".concat(data.value, ",").concat(child.value));
52
+ props.onChange && props.onChange("".concat(child.value, ",").concat(data.value));
53
53
  };
54
54
 
55
55
  var _onClick = function onClick(data) {
56
56
  if (data.disabled || tab && tab[0] === data.value) return;
57
57
  var item = [data.value];
58
+ var chart = data.value;
58
59
 
59
60
  if (data.children) {
60
61
  item.push(data.children[0].value);
62
+ chart = "".concat(data.children[0].value, ",").concat(data.value);
61
63
  }
62
64
 
63
65
  setTab(item);
64
- props.onChange && props.onChange(item.join(','));
66
+ props.onChange && props.onChange(chart);
65
67
  };
66
68
 
67
69
  return /*#__PURE__*/React.createElement("div", {
@@ -75,7 +77,7 @@ var BizTab = function BizTab(props) {
75
77
  return ChildList(item);
76
78
  }
77
79
  }, /*#__PURE__*/React.createElement("div", {
78
- className: "".concat(classPrefix, "-item ").concat(item.disabled ? 'disabled' : '', " ").concat(tab && tab[0] === item.value ? 'active' : ''),
80
+ className: "".concat(classPrefix, "-item").concat(item.disabled ? ' disabled' : '', " ").concat(tab && tab[0] === item.value ? 'active' : ''),
79
81
  onClick: function onClick() {
80
82
  return _onClick(item);
81
83
  }
@@ -86,4 +88,7 @@ var BizTab = function BizTab(props) {
86
88
  }));
87
89
  };
88
90
 
89
- export default BizTab;
91
+ StyleList.defaultProps = {
92
+ options: []
93
+ };
94
+ export default StyleList;
@@ -10,51 +10,71 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- import React, { useEffect, useState } from 'react';
14
- import IconFont from '../../icon/iconFont';
15
- import { typeMenus } from '../data/data';
16
- import './styles/list.less';
17
-
18
- var BizList = function BizList(props) {
19
- var options = props.options,
20
- value = props.value,
21
- onChange = props.onChange;
22
-
23
- var _useState = useState(value || options && options[0].id),
13
+ import React, { useState } from 'react';
14
+ import { BizAddToPanel } from '@zgfe/business-lib';
15
+ import { Button } from 'antd';
16
+ var chartTypes = [{
17
+ label: '趋势图',
18
+ value: 'line',
19
+ icon: 'qushitu1'
20
+ }, {
21
+ label: '汇总图',
22
+ value: 'bar',
23
+ icon: 'huizongtu'
24
+ }, {
25
+ label: '地图',
26
+ value: 'map',
27
+ icon: 'ditu',
28
+ disabled: true
29
+ }, {
30
+ label: '表格',
31
+ value: 'table',
32
+ icon: 'biaoge',
33
+ children: [{
34
+ label: '趋势图',
35
+ value: 'line',
36
+ icon: 'qushitu1'
37
+ }, {
38
+ label: '汇总图',
39
+ value: 'bar',
40
+ icon: 'huizongtu'
41
+ }]
42
+ }, {
43
+ label: '分数',
44
+ value: 'fraction',
45
+ icon: 'fenshu'
46
+ }];
47
+ var defaultValue = {
48
+ panel: {
49
+ id: 52397,
50
+ name: '默认看板',
51
+ open_type: 1
52
+ },
53
+ name: '嗯嗯',
54
+ chartType: 'line',
55
+ showList: 'dynamic'
56
+ };
57
+ export default (function () {
58
+ var _useState = useState(false),
24
59
  _useState2 = _slicedToArray(_useState, 2),
25
- selectList = _useState2[0],
26
- setSelectList = _useState2[1];
60
+ showDialog = _useState2[0],
61
+ setShowDialog = _useState2[1];
27
62
 
28
- var classPrefix = 'biz-list';
29
- useEffect(function () {
30
- if (!value && options) {
31
- onChange && onChange(options[0].id);
63
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
64
+ onClick: function onClick() {
65
+ setShowDialog(true);
66
+ }
67
+ }, "\u6DFB\u52A0\u5230\u770B\u677F"), showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
68
+ defaultValue: defaultValue,
69
+ type: "edit",
70
+ params: {},
71
+ elementId: 1,
72
+ styleOptions: chartTypes,
73
+ onCancel: function onCancel() {
74
+ setShowDialog(false);
75
+ },
76
+ onOk: function onOk() {
77
+ setShowDialog(false);
32
78
  }
33
- }, []);
34
- return /*#__PURE__*/React.createElement("div", {
35
- className: classPrefix
36
- }, options && options.map(function (item) {
37
- return /*#__PURE__*/React.createElement("div", {
38
- key: item.id,
39
- className: "".concat(classPrefix, "-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: "".concat(classPrefix, "-title")
48
- }, item.icon && /*#__PURE__*/React.createElement(IconFont, {
49
- className: "".concat(classPrefix, "-icon"),
50
- type: item.icon
51
- }), item.title), /*#__PURE__*/React.createElement("div", {
52
- className: "".concat(classPrefix, "-content")
53
- }, item.content));
54
79
  }));
55
- };
56
-
57
- BizList.defaultProps = {
58
- options: typeMenus
59
- };
60
- export default BizList;
80
+ });
@@ -0,0 +1,78 @@
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 { BizAddToPanel } from '@zgfe/business-lib';
15
+ import { Button } from 'antd';
16
+ var chartTypes = [{
17
+ label: '趋势图',
18
+ value: 'line',
19
+ icon: 'qushitu1'
20
+ }, {
21
+ label: '汇总图',
22
+ value: 'bar',
23
+ icon: 'huizongtu'
24
+ }, {
25
+ label: '地图',
26
+ value: 'map',
27
+ icon: 'ditu',
28
+ disabled: true
29
+ }, {
30
+ label: '表格',
31
+ value: 'table',
32
+ icon: 'biaoge',
33
+ children: [{
34
+ label: '趋势图',
35
+ value: 'line',
36
+ icon: 'qushitu1'
37
+ }, {
38
+ label: '汇总图',
39
+ value: 'bar',
40
+ icon: 'huizongtu'
41
+ }]
42
+ }, {
43
+ label: '分数',
44
+ value: 'fraction',
45
+ icon: 'fenshu'
46
+ }];
47
+ var defaultValue = {
48
+ panel: {
49
+ id: 52397,
50
+ name: '默认看板',
51
+ open_type: 1
52
+ },
53
+ name: '嗯嗯',
54
+ chartType: 'line',
55
+ showList: 'dynamic'
56
+ };
57
+ export default (function () {
58
+ var _useState = useState(false),
59
+ _useState2 = _slicedToArray(_useState, 2),
60
+ showDialog = _useState2[0],
61
+ setShowDialog = _useState2[1];
62
+
63
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
64
+ onClick: function onClick() {
65
+ setShowDialog(true);
66
+ }
67
+ }, "\u6DFB\u52A0\u5230\u770B\u677F"), showDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
68
+ defaultValue: defaultValue,
69
+ params: {},
70
+ styleOptions: chartTypes,
71
+ onCancel: function onCancel() {
72
+ setShowDialog(false);
73
+ },
74
+ onOk: function onOk() {
75
+ setShowDialog(false);
76
+ }
77
+ }));
78
+ });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import AddToPanel from './types';
3
+ import './styles/index.less';
4
+ export declare const classPrefix = "biz-addtopanel";
5
+ declare const BizAddToPanel: React.FC<AddToPanel.Props>;
6
+ export default BizAddToPanel;