@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,172 @@
1
+ @import '../commonStyle/select.less';
2
+ @import '../commonStyle/icon.less';
3
+
4
+ .biz-select-menu {
5
+ position: absolute;
6
+ top: 0;
7
+ left: 0;
8
+ width: 100%;
9
+ background-color: #ccc;
10
+ // height: 50px;
11
+ }
12
+
13
+ .biz-archon {
14
+ width: 100%;
15
+ margin: 0;
16
+ padding: 0;
17
+
18
+ .ant-anchor {
19
+ display: flex;
20
+ }
21
+
22
+ .ant-anchor-ink::before {
23
+ width: 0;
24
+ }
25
+
26
+ .ant-anchor-link {
27
+ padding: 0;
28
+
29
+ &:not(:last-child) {
30
+ margin-right: 8px;
31
+ }
32
+ }
33
+
34
+ .ant-anchor-link-active > .ant-anchor-link-title {
35
+ color: @fontColor;
36
+ }
37
+
38
+ &.biz-archon-first {
39
+ margin-bottom: 12px;
40
+ border-bottom: 1px solid #ecedf0;
41
+
42
+ .ant-anchor-link {
43
+ position: relative;
44
+ height: 17px;
45
+ margin: 4px 8px;
46
+ line-height: 17px;
47
+ transition: all 0.3s;
48
+ }
49
+
50
+ .ant-anchor-link-active {
51
+ a {
52
+ color: @themeColor;
53
+ }
54
+
55
+ &::after {
56
+ position: absolute;
57
+ bottom: -4px;
58
+ left: 50%;
59
+ width: 16px;
60
+ height: 1px;
61
+ background-color: @themeColor;
62
+ transform: translateX(-50%);
63
+ content: '';
64
+ }
65
+ }
66
+ }
67
+
68
+ &.biz-archon-second {
69
+ box-sizing: border-box;
70
+ margin: 0 4px 12px 0;
71
+
72
+ .ant-anchor-link {
73
+ box-sizing: border-box;
74
+ margin: 0px 8px;
75
+ padding: 4px 5px;
76
+ color: @fontColor;
77
+ font-size: 12px;
78
+ background: #ffffff;
79
+ border: @boxBorder;
80
+ border-radius: @boxRadius;
81
+
82
+ &.ant-anchor-link-active,
83
+ &:hover {
84
+ color: @hoverColor;
85
+ background-color: @hoverBgColor;
86
+ border-color: @hoverColor;
87
+
88
+ a {
89
+ color: @hoverColor;
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ a {
96
+ color: @titleColor;
97
+
98
+ &:hover {
99
+ color: @themeColor;
100
+ }
101
+ }
102
+ }
103
+
104
+ .biz-dropdown-container {
105
+ position: absolute;
106
+ top: 42px;
107
+ left: -4px;
108
+ z-index: 9999;
109
+ min-width: 322px;
110
+ height: @dropdownHeight;
111
+ padding: @dropdownPadding;
112
+ overflow: hidden;
113
+ background: #ffffff;
114
+ border-radius: @specialRadius;
115
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
116
+ transition: all 0.3s;
117
+
118
+ .biz-select-list-container {
119
+ box-sizing: border-box;
120
+ height: calc(100% - 120px);
121
+ padding: 4px;
122
+ overflow-y: auto;
123
+ }
124
+
125
+ .biz-drop-option {
126
+ display: flex;
127
+ align-items: center;
128
+ width: 100%;
129
+ }
130
+
131
+ .biz-drop-menu {
132
+ position: relative;
133
+ box-sizing: border-box;
134
+ height: 32px;
135
+ padding-left: 8px;
136
+ color: @titleColor;
137
+
138
+ &::before {
139
+ position: absolute;
140
+ top: 9px;
141
+ left: 0px;
142
+ width: 3px;
143
+ height: 14px;
144
+ background-color: @themeColor;
145
+ border-radius: 10px;
146
+ content: '';
147
+ }
148
+
149
+ span {
150
+ padding-right: 8px;
151
+ }
152
+
153
+ .biz-menu-split {
154
+ flex: auto;
155
+ height: 1px;
156
+ background: @borderColor;
157
+ }
158
+ }
159
+
160
+ .biz-drop-index {
161
+ height: 40px;
162
+ padding: 11px 8px;
163
+ border-radius: @specialRadius;
164
+ cursor: pointer;
165
+ span {
166
+ }
167
+ .biz-icon-index {
168
+ margin-right: 5px;
169
+ font-size: @iconSize;
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,28 @@
1
+ import { GridComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/types/dist/echarts';
2
+ import { BarSeriesOption, LegendComponentOption, LineSeriesOption, PieSeriesOption, ToolboxComponentOption, XAXisOption, YAXisOption } from 'echarts/types/dist/shared';
3
+ import './index.less';
4
+ export declare const baseConfig: EChartsOption;
5
+ export declare const seriesConfig: {
6
+ symbol: string;
7
+ type: string;
8
+ };
9
+ export declare type EChartsOption = echarts.ComposeOption<TitleComponentOption | ToolboxComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption | LineSeriesOption | BarSeriesOption | PieSeriesOption>;
10
+ export declare const legendConfig: LegendComponentOption;
11
+ export declare const gridConfig: {
12
+ left: number;
13
+ right: string;
14
+ bottom: number;
15
+ top: number;
16
+ containLabel: boolean;
17
+ };
18
+ export declare const xAxisConfig: XAXisOption;
19
+ export declare const yAxisConfig: YAXisOption;
20
+ export declare const tooltipConfig: TooltipComponentOption;
21
+ /**
22
+ * 折现/柱图
23
+ * @param xData x轴数据 []
24
+ * @param seriesData 系列数据 [{name:'系列名称',data:[数据]}]
25
+ * @param chartType 图表类型
26
+ * @param seriesType 系列类型(单选列柱图是单个颜色还是一个柱一个颜色)
27
+ */
28
+ export declare const getChartOption: (chartType: string, xData?: string[] | undefined, seriesData?: object[], sameColor?: boolean, legendPosition?: 'top' | 'bottom' | 'middle', legendOrient?: 'horizontal' | 'vertical') => EChartsOption;
@@ -0,0 +1,256 @@
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
+ import util from '../utils/util';
8
+ import { chartColors } from './color';
9
+ import './index.less';
10
+ export var baseConfig = {
11
+ color: chartColors,
12
+ textStyle: {
13
+ color: '#5F6085'
14
+ },
15
+ toolbox: {
16
+ show: false
17
+ }
18
+ };
19
+ export var seriesConfig = {
20
+ symbol: 'circle',
21
+ // symbolSize: 6,
22
+ type: 'line' // emphasis: {},
23
+
24
+ };
25
+ export var legendConfig = {
26
+ type: 'scroll',
27
+ height: 17,
28
+ padding: 0,
29
+ itemHeight: 10,
30
+ itemWidth: 10,
31
+ lineStyle: {
32
+ opacity: 0
33
+ },
34
+ textStyle: {
35
+ color: '#5F6085',
36
+ lineHeight: 17
37
+ },
38
+ pageIconSize: 10,
39
+ pageTextStyle: {
40
+ color: '#5F6085'
41
+ }
42
+ };
43
+ export var gridConfig = {
44
+ left: 0,
45
+ right: '3%',
46
+ bottom: 0,
47
+ top: 24,
48
+ containLabel: true
49
+ };
50
+ export var xAxisConfig = {
51
+ axisLine: {
52
+ lineStyle: {
53
+ color: '#ECEDF0',
54
+ width: 1
55
+ }
56
+ },
57
+ axisTick: {
58
+ lineStyle: {
59
+ color: '#ECEDF0'
60
+ }
61
+ },
62
+ nameTextStyle: {
63
+ lineHeight: 30
64
+ },
65
+ boundaryGap: false,
66
+ axisLabel: {
67
+ formatter: function formatter(value) {
68
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
69
+ // 处理日期
70
+ return value.replace(/\d{4}-/, '');
71
+ } else if (/^\d{4}-\d{2}-\d{2}\|\d{4}-\d{2}-\d{2}$/.test(value)) {
72
+ // 周、月日期
73
+ var dates = value.match(/\d{4}-\d{2}-\d{2}/g);
74
+ return dates ? dates[0].replace(/\d{4}-/, '') + '~' + dates[1].replace(/\d{4}-/, '') : value;
75
+ } else {
76
+ value = util.strMiddleSplit(value);
77
+
78
+ if (/:/.test(value)) {
79
+ return value.replace(/\d{4}-\d{2}-\d{2}\s/, '');
80
+ } else if (/,/.test(value)) {
81
+ return value.replace(/,/g, '-');
82
+ } else {
83
+ return value;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ };
89
+ export var yAxisConfig = {
90
+ type: 'value',
91
+ splitLine: {
92
+ lineStyle: {
93
+ type: 'dashed'
94
+ }
95
+ },
96
+ axisLabel: {
97
+ formatter: function formatter(value) {
98
+ if (parseFloat(String(value)) >= 1000) {
99
+ return util.toThousands(parseFloat((value / 1000).toFixed(1))) + 'k';
100
+ } else {
101
+ return String(value);
102
+ }
103
+ }
104
+ }
105
+ };
106
+ export var tooltipConfig = {
107
+ trigger: 'axis',
108
+ confine: false,
109
+ backgroundColor: 'rgba(250, 251, 253, 0.8)',
110
+ borderColor: 'transparent',
111
+ padding: 8,
112
+ extraCssText: '0px 4px 10px rgba(0, 0, 0, 0.1)',
113
+ className: 'biz-chart-tooltip',
114
+ appendToBody: true,
115
+ axisPointer: {
116
+ type: 'shadow',
117
+ z: 0,
118
+ shadowStyle: {
119
+ color: '#f6f6f6'
120
+ }
121
+ },
122
+ formatter: function formatter(echartParams) {
123
+ var xDate = echartParams[0].name;
124
+ var xLabel = xDate;
125
+
126
+ if (/^\d{4}-\d{2}-\d{2}$/.test(xLabel)) {
127
+ // 处理日期
128
+ xLabel = xLabel.replace(/\d{4}-/, '');
129
+ }
130
+
131
+ var htmlArray = [];
132
+
133
+ if (echartParams.length > 1) {
134
+ htmlArray.push("<span class=\"biz-chart-tooltip-title\">".concat(xLabel, "</span>"));
135
+ }
136
+
137
+ echartParams.forEach(function (item) {
138
+ var lineLabel = item.value;
139
+
140
+ if (item.seriesName.indexOf('CTR') > -1) {
141
+ lineLabel += '%';
142
+ } else {
143
+ lineLabel = util.toThousands(lineLabel);
144
+ }
145
+
146
+ htmlArray.push("<div class=\"biz-chart-tooltip-item\"><span class=\"biz-chart-tooltip-content\">".concat(item.marker).concat(echartParams.length > 1 ? item.seriesName : item.name, ":</span> <span class=\"biz-chart-tooltip-value\">").concat(lineLabel, "</span></div>"));
147
+ });
148
+ return htmlArray.join('');
149
+ }
150
+ };
151
+ /**
152
+ * 折现/柱图
153
+ * @param xData x轴数据 []
154
+ * @param seriesData 系列数据 [{name:'系列名称',data:[数据]}]
155
+ * @param chartType 图表类型
156
+ * @param seriesType 系列类型(单选列柱图是单个颜色还是一个柱一个颜色)
157
+ */
158
+
159
+ export var getChartOption = function getChartOption(chartType, xData) {
160
+ var seriesData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
161
+ var sameColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
162
+ var legendPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'top';
163
+ var legendOrient = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'horizontal';
164
+
165
+ var xAxis = JSON.parse(JSON.stringify(xAxisConfig)),
166
+ yAxis = _objectSpread({}, yAxisConfig),
167
+ tooltip = JSON.parse(JSON.stringify(tooltipConfig)),
168
+ legend = _objectSpread({}, legendConfig),
169
+ grid = _objectSpread({}, gridConfig),
170
+ base = _objectSpread({}, baseConfig);
171
+
172
+ legend.top = legendPosition;
173
+ legend.orient = legendOrient;
174
+
175
+ if (legendOrient === 'vertical') {
176
+ legend.left = 'left';
177
+ legend.height = 'auto';
178
+ legend.width = 50;
179
+ grid.left = 80;
180
+ }
181
+
182
+ if (chartType === 'line' || chartType === 'bar') {
183
+ // x轴配置
184
+ if (xData) {
185
+ xAxis.data = xData;
186
+ }
187
+
188
+ xAxis.axisLabel = xAxis.axisLabel || {
189
+ rotate: 0
190
+ };
191
+ xAxis.axisLabel.rotate = chartType === 'bar' ? 45 : 0; // series配置
192
+
193
+ var itemStyle = {
194
+ color: sameColor ? 'auto' : function (param) {
195
+ return chartColors[param.dataIndex % 20];
196
+ }
197
+ }; // if(chartType==='line'){
198
+ // seriesConfig.symbol = './style/circle.svg'
199
+ // seriesConfig.symbolSize = 10
200
+ // }
201
+
202
+ var series = seriesData.map(function (item) {
203
+ return _objectSpread(_objectSpread(_objectSpread({}, item), seriesConfig), {}, {
204
+ itemStyle: itemStyle,
205
+ type: chartType
206
+ });
207
+ });
208
+ console.log(tooltip.axisPointer); // tooltip config
209
+
210
+ tooltip.axisPointer = tooltip.axisPointer || {};
211
+ tooltip.axisPointer.type = chartType === 'bar' ? 'shadow' : 'line';
212
+ console.log(tooltip.axisPointer.type); // grid config
213
+
214
+ if (legendPosition === 'top') {
215
+ grid.top = seriesData.length > 1 ? 45 : 10;
216
+ } else if (legendPosition === 'bottom') {
217
+ grid.bottom = seriesData.length > 1 ? 45 : 0;
218
+ }
219
+
220
+ return _objectSpread(_objectSpread({}, baseConfig), {}, {
221
+ legend: legend,
222
+ xAxis: xAxis,
223
+ yAxis: yAxis,
224
+ tooltip: tooltip,
225
+ grid: grid,
226
+ series: series
227
+ });
228
+ } else if (chartType === 'pie') {
229
+ var _series = seriesData.map(function (item) {
230
+ return _objectSpread(_objectSpread(_objectSpread({}, item), seriesConfig), {}, {
231
+ type: chartType,
232
+ label: {
233
+ show: false
234
+ }
235
+ });
236
+ });
237
+
238
+ tooltip.trigger = 'item';
239
+
240
+ tooltip.formatter = function (params) {
241
+ var name = params.name,
242
+ value = params.value,
243
+ marker = params.marker;
244
+ return "<div class=\"biz-chart-tooltip-item\"><span class=\"biz-chart-tooltip-content\">".concat(marker).concat(name, ":</span> <span class=\"biz-chart-tooltip-value\">").concat(value, "</span></div>");
245
+ };
246
+
247
+ return _objectSpread(_objectSpread({}, baseConfig), {}, {
248
+ legend: legend,
249
+ tooltip: tooltip,
250
+ grid: grid,
251
+ series: _series
252
+ });
253
+ } else {
254
+ return {};
255
+ }
256
+ };
@@ -0,0 +1 @@
1
+ export declare const chartColors: string[];
@@ -0,0 +1 @@
1
+ export var chartColors = ['#165DFF', '#CDDBFD', '#80E1D9', '#CDF3F0', '#65789B', '#CED4DE', '#F8BC3B', '#FCE7B9', '#6F66ED', '#D1CEFD', '#66AFED', '#D3E7F9', '#9661BC', '#DFCFEA', '#FF7557', '#FFD1C7', '#4DB273', '#BBDEC8', '#F08BB4', '#FFE0ED'];
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { BizChart } from 'business-lib';
3
+ import chartData from './data';
4
+ var barData = {
5
+ xData: ['付款成功', '注册', '搜索商品', '查看商品详情', '申请退货'],
6
+ seriesData: [{
7
+ data: [157, 161, 1441, 1414, 710]
8
+ }]
9
+ };
10
+ export default (function () {
11
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizChart, {
12
+ data: chartData,
13
+ type: "bar"
14
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizChart, {
15
+ data: barData,
16
+ type: "bar",
17
+ sameColor: false
18
+ }));
19
+ });
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ xData: string[];
3
+ seriesData: ({
4
+ name: string;
5
+ data: number[];
6
+ } | {
7
+ name: string[];
8
+ data: number[];
9
+ })[];
10
+ };
11
+ export default _default;
@@ -0,0 +1,37 @@
1
+ export default {
2
+ xData: ['2022-03-31', '2022-04-01', '2022-04-02', '2022-04-03', '2022-04-04', '2022-04-05', '2022-04-06', '2022-04-07', '2022-04-08', '2022-04-09', '2022-04-10', '2022-04-11', '2022-04-12', '2022-04-13'],
3
+ seriesData: [{
4
+ name: '付款成功',
5
+ data: [26, 27, 43, 44, 40, 34, 33, 33, 34, 24, 30, 31, 31, 38]
6
+ }, {
7
+ name: '注册-发送手机验证码',
8
+ data: [11, 10, 7, 5, 13, 18, 14, 17, 11, 6, 10, 12, 15, 10]
9
+ }, {
10
+ name: '搜索商品',
11
+ data: [75, 68, 86, 80, 87, 71, 72, 81, 77, 74, 78, 76, 76, 79]
12
+ }, {
13
+ name: 'pv',
14
+ data: [104, 89, 109, 103, 112, 93, 87, 101, 101, 97, 102, 110, 106, 98]
15
+ }, {
16
+ name: '查看商品详情',
17
+ data: [122, 107, 132, 113, 133, 115, 106, 127, 132, 117, 119, 123, 119, 117]
18
+ }, {
19
+ name: 'scroll',
20
+ data: [98, 96, 106, 109, 113, 105, 91, 111, 99, 99, 104, 108, 116, 92]
21
+ }, {
22
+ name: ['click'],
23
+ data: [108, 102, 111, 90, 111, 105, 91, 129, 117, 101, 109, 109, 105, 96]
24
+ }, {
25
+ name: ['申请退货'],
26
+ data: [5, 11, 14, 9, 8, 14, 9, 10, 12, 12, 14, 16, 12, 10]
27
+ }, {
28
+ name: ['wxshare'],
29
+ data: [96, 89, 113, 100, 107, 109, 84, 106, 107, 100, 102, 106, 104, 90]
30
+ }, {
31
+ name: ['wxsopen'],
32
+ data: [92, 89, 118, 108, 128, 107, 103, 124, 107, 100, 115, 104, 99, 99]
33
+ }, {
34
+ name: ['进入购物车'],
35
+ data: [42, 44, 50, 47, 40, 49, 32, 50, 42, 40, 42, 39, 41, 32]
36
+ }]
37
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { BizChart } from 'business-lib';
3
+ import chartData from './data';
4
+ export default (function () {
5
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizChart, {
6
+ data: chartData,
7
+ type: "line"
8
+ }));
9
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { BizChart } from 'business-lib';
3
+ var pieData = {
4
+ seriesData: [{
5
+ data: [{
6
+ name: '付款成功',
7
+ value: 222
8
+ }, {
9
+ name: '注册',
10
+ value: 161
11
+ }, {
12
+ name: '搜索商品',
13
+ value: 1441
14
+ }, {
15
+ name: '查看商品详情',
16
+ value: 1414
17
+ }, {
18
+ name: '付款成申请退货功',
19
+ value: 710
20
+ }]
21
+ }]
22
+ };
23
+ export default (function () {
24
+ return /*#__PURE__*/React.createElement(BizChart, {
25
+ data: pieData,
26
+ type: "pie",
27
+ legendPosition: "bottom",
28
+ legendOrient: "vertical"
29
+ });
30
+ });
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ interface ChartItmProps {
3
+ name?: string;
4
+ data?: Array<string | number | object>;
5
+ }
6
+ interface DataProps {
7
+ xData?: Array<string>;
8
+ seriesData: Array<ChartItmProps>;
9
+ }
10
+ interface BizChartProps {
11
+ /**
12
+ * @description 自定义图表配置
13
+ * @default -
14
+ */
15
+ option?: any;
16
+ /**
17
+ * @description 图形类型
18
+ * @default line
19
+ */
20
+ type?: 'bar' | 'pie' | 'line';
21
+ /**
22
+ * @description 数据(x轴和series数据)
23
+ * @default -
24
+ */
25
+ data?: DataProps;
26
+ /**
27
+ * @description 柱图是同色还是一柱一色(仅对柱图单一系列作用)
28
+ * @default true
29
+ */
30
+ sameColor?: boolean;
31
+ /**
32
+ * @description 提示格式
33
+ * @default -
34
+ */
35
+ tooltipFormatter?: (param: any) => string;
36
+ /**
37
+ * @description x轴标签格式
38
+ * @default -
39
+ */
40
+ xAxisFormatter?: (param: any) => string;
41
+ /**
42
+ * @description y轴标签格式
43
+ * @default -
44
+ */
45
+ yAxisFormatter?: (param: any) => string;
46
+ /**
47
+ * @description value 单位
48
+ * @default -
49
+ */
50
+ valueUnit?: string;
51
+ /**
52
+ * @description 图例位置
53
+ * @default -
54
+ */
55
+ legendPosition: 'top' | 'bottom' | 'middle';
56
+ /**
57
+ * @description 图例布局朝向
58
+ * @default -
59
+ */
60
+ legendOrient: 'horizontal' | 'vertical';
61
+ }
62
+ declare const BizChart: React.FC<BizChartProps>;
63
+ export default BizChart;