@zgfe/modules-attribution 1.0.5 → 1.1.0

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 (152) hide show
  1. package/README.md +4 -2
  2. package/{dist/esm → es}/components/common/index.js +1 -5
  3. package/es/components/index.d.ts +5 -0
  4. package/es/components/index.js +5 -0
  5. package/es/components/option/index.js +141 -0
  6. package/{dist/esm → es}/components/option/styles/index.less +1 -1
  7. package/es/components/option/types.d.ts +5 -0
  8. package/{dist/esm/components/searchPanel → es/components/searchTime}/index.d.ts +2 -2
  9. package/es/components/searchTime/index.js +49 -0
  10. package/es/components/searchTime/styles/index.less +19 -0
  11. package/{dist/esm/components/searchPanel → es/components/searchTime}/types.d.ts +0 -2
  12. package/es/components/tableList/index.d.ts +8 -0
  13. package/es/components/tableList/index.js +32 -0
  14. package/es/components/tableList/styles/index.less +18 -0
  15. package/{dist/esm → es}/components/title/index.js +31 -27
  16. package/{dist/esm → es}/components/title/searchTitle.js +3 -3
  17. package/{dist/esm → es}/components/title/styles/index.less +22 -10
  18. package/es/constants/apis.d.ts +6 -0
  19. package/es/constants/apis.js +6 -0
  20. package/es/constants/fields.d.ts +11 -0
  21. package/es/constants/fields.js +45 -0
  22. package/es/constants/index.d.ts +4 -0
  23. package/es/constants/index.js +4 -0
  24. package/{dist/esm → es}/constants/initData.js +0 -6
  25. package/es/images/empty.png +0 -0
  26. package/es/index.d.ts +3 -0
  27. package/es/index.js +2 -0
  28. package/es/modules/content/index.d.ts +5 -0
  29. package/es/modules/content/index.js +134 -0
  30. package/es/modules/content/styles/index.less +7 -0
  31. package/es/modules/content/types.d.ts +8 -0
  32. package/es/modules/content/utils.d.ts +2 -0
  33. package/es/modules/content/utils.js +29 -0
  34. package/{dist/esm → es}/modules/home/demo/create.d.ts +0 -1
  35. package/es/modules/home/demo/create.js +23 -0
  36. package/{dist/esm → es}/modules/home/demo/edit.d.ts +0 -1
  37. package/es/modules/home/demo/edit.js +129 -0
  38. package/{dist/esm → es}/modules/home/demo/index.d.ts +0 -1
  39. package/es/modules/home/demo/index.js +19 -0
  40. package/{dist/esm → es}/modules/home/demo/scene.d.ts +0 -1
  41. package/es/modules/home/demo/scene.js +44 -0
  42. package/{dist/esm → es}/modules/home/index.d.ts +2 -2
  43. package/{dist/esm → es}/modules/home/index.js +35 -73
  44. package/es/modules/home/styles/index.less +68 -0
  45. package/{dist/esm → es}/modules/home/types.d.ts +1 -4
  46. package/es/modules/searchPanel/components/attributableEvents.d.ts +4 -0
  47. package/es/modules/searchPanel/components/attributableEvents.js +290 -0
  48. package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.d.ts +3 -1
  49. package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.js +19 -19
  50. package/es/modules/searchPanel/components/index.d.ts +4 -0
  51. package/es/modules/searchPanel/components/index.js +21 -0
  52. package/es/modules/searchPanel/components/targetEvent.d.ts +4 -0
  53. package/es/modules/searchPanel/components/targetEvent.js +159 -0
  54. package/es/modules/searchPanel/index.d.ts +6 -0
  55. package/es/modules/searchPanel/index.js +398 -0
  56. package/es/modules/searchPanel/styles/index.less +226 -0
  57. package/es/modules/searchPanel/types.d.ts +49 -0
  58. package/es/modules/searchPanel/utils.d.ts +8 -0
  59. package/es/modules/searchPanel/utils.js +81 -0
  60. package/{dist/esm → es}/style/index.less +2 -2
  61. package/{dist/esm → es}/style/theme.js +0 -2
  62. package/es/types.d.ts +52 -0
  63. package/es/types.js +2 -0
  64. package/{dist/esm → es}/utils/ajaxConfig.js +0 -7
  65. package/es/utils/request.d.ts +3 -0
  66. package/es/utils/request.js +5 -0
  67. package/{dist/esm → es}/utils/util.js +4 -42
  68. package/package.json +21 -21
  69. package/dist/esm/components/index.d.ts +0 -6
  70. package/dist/esm/components/index.js +0 -6
  71. package/dist/esm/components/option/index.js +0 -222
  72. package/dist/esm/components/option/types.d.ts +0 -9
  73. package/dist/esm/components/renderContent/index.d.ts +0 -5
  74. package/dist/esm/components/renderContent/index.js +0 -92
  75. package/dist/esm/components/renderContent/styles/index.less +0 -21
  76. package/dist/esm/components/renderContent/types.d.ts +0 -15
  77. package/dist/esm/components/searchPanel/index.js +0 -124
  78. package/dist/esm/components/searchPanel/styles/index.less +0 -44
  79. package/dist/esm/components/showList/index.d.ts +0 -10
  80. package/dist/esm/components/showList/index.js +0 -92
  81. package/dist/esm/components/showList/listPanel.d.ts +0 -9
  82. package/dist/esm/components/showList/listPanel.js +0 -118
  83. package/dist/esm/components/showList/styles/index.less +0 -75
  84. package/dist/esm/components/showList/types.d.ts +0 -9
  85. package/dist/esm/components/table/index.d.ts +0 -5
  86. package/dist/esm/components/table/index.js +0 -194
  87. package/dist/esm/components/table/styles/index.less +0 -12
  88. package/dist/esm/components/table/types.d.ts +0 -11
  89. package/dist/esm/constants/apis.d.ts +0 -9
  90. package/dist/esm/constants/apis.js +0 -9
  91. package/dist/esm/constants/chart.d.ts +0 -2
  92. package/dist/esm/constants/chart.js +0 -24
  93. package/dist/esm/constants/color.d.ts +0 -1
  94. package/dist/esm/constants/color.js +0 -1
  95. package/dist/esm/constants/fields.d.ts +0 -218
  96. package/dist/esm/constants/fields.js +0 -242
  97. package/dist/esm/constants/index.d.ts +0 -6
  98. package/dist/esm/constants/index.js +0 -6
  99. package/dist/esm/index.d.ts +0 -2
  100. package/dist/esm/index.js +0 -2
  101. package/dist/esm/modules/content/index.d.ts +0 -5
  102. package/dist/esm/modules/content/index.js +0 -218
  103. package/dist/esm/modules/content/styles/index.less +0 -7
  104. package/dist/esm/modules/content/types.d.ts +0 -8
  105. package/dist/esm/modules/content/types.js +0 -2
  106. package/dist/esm/modules/content/utiles.d.ts +0 -12
  107. package/dist/esm/modules/content/utiles.js +0 -231
  108. package/dist/esm/modules/home/demo/create.js +0 -54
  109. package/dist/esm/modules/home/demo/edit.js +0 -80
  110. package/dist/esm/modules/home/demo/index.js +0 -52
  111. package/dist/esm/modules/home/demo/scene.js +0 -74
  112. package/dist/esm/modules/home/styles/index.less +0 -37
  113. package/dist/esm/modules/home/types.js +0 -2
  114. package/dist/esm/modules/leftPanel/components/panel.d.ts +0 -4
  115. package/dist/esm/modules/leftPanel/components/panel.js +0 -92
  116. package/dist/esm/modules/leftPanel/demo/index.d.ts +0 -3
  117. package/dist/esm/modules/leftPanel/demo/index.js +0 -28
  118. package/dist/esm/modules/leftPanel/index.d.ts +0 -6
  119. package/dist/esm/modules/leftPanel/index.js +0 -285
  120. package/dist/esm/modules/leftPanel/styles/index.less +0 -55
  121. package/dist/esm/modules/leftPanel/types.d.ts +0 -27
  122. package/dist/esm/modules/leftPanel/types.js +0 -2
  123. package/dist/esm/modules/leftPanel/utils.d.ts +0 -5
  124. package/dist/esm/modules/leftPanel/utils.js +0 -262
  125. package/dist/esm/types.d.ts +0 -46
  126. package/dist/esm/types.js +0 -2
  127. package/dist/esm/utils/base64.d.ts +0 -23
  128. package/dist/esm/utils/base64.js +0 -132
  129. package/dist/esm/utils/formData.d.ts +0 -18
  130. package/dist/esm/utils/formData.js +0 -485
  131. package/dist/esm/utils/transfer.d.ts +0 -65
  132. package/dist/esm/utils/transfer.js +0 -206
  133. /package/{dist/esm → es}/components/common/index.d.ts +0 -0
  134. /package/{dist/esm → es}/components/common/styles/index.less +0 -0
  135. /package/{dist/esm → es}/components/option/index.d.ts +0 -0
  136. /package/{dist/esm → es}/components/option/types.js +0 -0
  137. /package/{dist/esm/components/renderContent → es/components/searchTime}/types.js +0 -0
  138. /package/{dist/esm → es}/components/title/index.d.ts +0 -0
  139. /package/{dist/esm → es}/components/title/searchTitle.d.ts +0 -0
  140. /package/{dist/esm → es}/components/title/styles/search.less +0 -0
  141. /package/{dist/esm → es}/components/title/types.d.ts +0 -0
  142. /package/{dist/esm/components/searchPanel → es/components/title}/types.js +0 -0
  143. /package/{dist/esm → es}/constants/initData.d.ts +0 -0
  144. /package/{dist/esm/components/showList → es/modules/content}/types.js +0 -0
  145. /package/{dist/esm → es}/modules/home/demo/styles/index.less +0 -0
  146. /package/{dist/esm/components/table → es/modules/home}/types.js +0 -0
  147. /package/{dist/esm/components/title → es/modules/searchPanel}/types.js +0 -0
  148. /package/{dist/esm → es}/style/image/noData.png +0 -0
  149. /package/{dist/esm → es}/style/image/ring.svg +0 -0
  150. /package/{dist/esm → es}/style/theme.d.ts +0 -0
  151. /package/{dist/esm → es}/utils/ajaxConfig.d.ts +0 -0
  152. /package/{dist/esm → es}/utils/util.d.ts +0 -0
@@ -0,0 +1,226 @@
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+
3
+ .form-box {
4
+ .xiangxia {
5
+ font-size: 14px !important;
6
+ }
7
+ &-form-item {
8
+ margin-bottom: 16px;
9
+ .attr-box-show {
10
+ margin: 12px 0px;
11
+ }
12
+ }
13
+
14
+ &-bottom-form-title {
15
+ font-size: 14px;
16
+ margin-bottom: 16px;
17
+ color: #021429;
18
+ font-weight: 500;
19
+ }
20
+ &-bottom-form {
21
+ display: flex;
22
+ min-width: 860px;
23
+ height: 32px;
24
+ margin-bottom: 14px;
25
+ .p {
26
+ margin: 0;
27
+ margin-right: 12px;
28
+ padding: 0;
29
+ color: #5f6085;
30
+ line-height: 32px;
31
+ .tishiicon {
32
+ margin-left: 8px;
33
+ color: #9aa1a9;
34
+ }
35
+ }
36
+ .attribution-type {
37
+ margin-right: 24px;
38
+ }
39
+ .windowCnt {
40
+ margin: 0 16px;
41
+ }
42
+ }
43
+
44
+ #attribution-type{
45
+ position: relative;
46
+ .ant-select-dropdown{
47
+ z-index: 998;
48
+ }
49
+ .attribution-type-tooltip {
50
+ z-index: 999;
51
+ right: 0px!important;
52
+ // left: 200px!important;
53
+ &-distance{
54
+ // left: 170px!important;
55
+ }
56
+ }
57
+ }
58
+
59
+ &-otherEvent {
60
+ color: #021429;
61
+ font-size: 14px;
62
+ margin-bottom: 34px;
63
+ .tishiicon {
64
+ margin-left: 1px;
65
+ color: #9aa1a9;
66
+ }
67
+ }
68
+ &-search-button-box {
69
+ text-align: right;
70
+ .ant-btn {
71
+ border: none;
72
+ }
73
+ > :nth-child(1) {
74
+ margin-right: 16px;
75
+ background: #29bd52;
76
+ }
77
+ .disable,
78
+ .disable:hover {
79
+ color: #ffffff;
80
+ background: #d0dfff;
81
+ }
82
+ }
83
+ &-title.ant-form-item {
84
+ margin-bottom: 12px;
85
+ color: #5f6085;
86
+ font-size: 14px;
87
+ line-height: 20px;
88
+ .bsicon {
89
+ margin-left: 9px;
90
+ color: #9aa1a9;
91
+ }
92
+ .ant-form-item-control-input {
93
+ min-height: 20px;
94
+ .ant-form-item-control-input-content {
95
+ height: 20px;
96
+ }
97
+ }
98
+ }
99
+
100
+ &-item.ant-form-item {
101
+ margin-bottom: 0px;
102
+ }
103
+
104
+ &-add {
105
+ width: fit-content;
106
+ height: 20px;
107
+ color: #165dff;
108
+ font-size: 14px;
109
+ line-height: 20px;
110
+ border-radius: @border-radius-small;
111
+ cursor: pointer;
112
+ span {
113
+ margin-right: 4px;
114
+ }
115
+
116
+ // &:not(.disabled):hover {
117
+ // .__default-hover();
118
+ // }
119
+
120
+ &.disabled {
121
+ color: @disabled-color;
122
+ cursor: not-allowed;
123
+ }
124
+ }
125
+
126
+ .global-attr {
127
+ margin-bottom: 0 !important;
128
+ }
129
+
130
+ .biz-condition-item-input {
131
+ border-color: transparent;
132
+ }
133
+
134
+ .ant-input-affix-wrapper > input.ant-input {
135
+ height: 100%;
136
+ }
137
+ .attributable-events-box {
138
+ .select-and-attr {
139
+ display: flex;
140
+ margin-bottom: 12px;
141
+ .ant-dropdown-trigger {
142
+ width: 208px;
143
+ margin-right: 16px;
144
+ }
145
+ .biz-select-handle-input {
146
+ background: #fafafb;
147
+ }
148
+ .biz-attr-select {
149
+ width: 208px;
150
+ margin-right: 16px;
151
+ .biz-attr-select-handle {
152
+ position: relative;
153
+ padding: 0;
154
+ border: none;
155
+ .qingchu {
156
+ position: absolute;
157
+ top: 5px;
158
+ right: 40px;
159
+ }
160
+ }
161
+ }
162
+ .button-box {
163
+ .qingchu,
164
+ .tianjia2,
165
+ .shaixuan {
166
+ margin-top: 2px;
167
+ margin-right: 16px;
168
+ // color: #CCD0D4;
169
+ color: #9aa1a9;
170
+ font-size: 20px !important;
171
+ cursor: pointer;
172
+ }
173
+ .tianjia2:hover,
174
+ .shaixuan:hover {
175
+ color: #165dff;
176
+ }
177
+ .qingchu:hover {
178
+ color: #e96150;
179
+ }
180
+ .disable {
181
+ color: #ccd0d4 !important;
182
+ cursor: not-allowed !important;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ .target-events-box {
188
+ .selector-content {
189
+ display: flex;
190
+ .ant-dropdown-trigger {
191
+ width: 208px;
192
+ margin-right: 16px;
193
+ }
194
+ .biz-select-handle-input {
195
+ background: #fafafb;
196
+ }
197
+ .ant-select-selection-placeholder::after {
198
+ content: '\e76d' !important;
199
+ }
200
+ }
201
+ .shaixuan {
202
+ margin: 2px 0 0 16px;
203
+ color: #9aa1a9;
204
+ font-size: 20px !important;
205
+ cursor: pointer;
206
+ }
207
+ .shaixuan:hover {
208
+ color: #165dff;
209
+ }
210
+ .shaixuan.disable {
211
+ color: #ccd0d4;
212
+ cursor: not-allowed;
213
+ }
214
+ }
215
+
216
+ .verify-error {
217
+ .biz-select-handle-input {
218
+ background-color: #fff;
219
+ border: 1px solid #fb5547 !important;
220
+ }
221
+ }
222
+ .error-tips {
223
+ margin-top: -14px;
224
+ color: #fb5547;
225
+ }
226
+ }
@@ -0,0 +1,49 @@
1
+ import { SearchValueProps, FiltersProps } from '../../types';
2
+ export declare namespace SearchPanelTypes {
3
+ interface Props {
4
+ defaultValue?: SearchValueProps;
5
+ onChange: (values: SearchValueProps, isFetchRequest: boolean) => void;
6
+ resetTime?: Function;
7
+ }
8
+ interface FieldProp {
9
+ key: string;
10
+ type: string;
11
+ name: string;
12
+ label: string;
13
+ max: number;
14
+ addLabel: string;
15
+ tips?: string;
16
+ required?: boolean;
17
+ }
18
+ interface PanelProp {
19
+ type: string;
20
+ value?: FiltersProps;
21
+ fieldsLength?: number;
22
+ eventIdList?: number[];
23
+ onChange?: (data: FiltersProps | undefined) => void;
24
+ onDelete: () => void;
25
+ formData: SearchValueProps;
26
+ setAttrTargetCount: Function;
27
+ setAttrSourceCount: Function;
28
+ attrSourceCount: {
29
+ [x: number]: number;
30
+ };
31
+ setMincePropCount: Function;
32
+ mincePropCount: {
33
+ [x: number]: number;
34
+ };
35
+ }
36
+ interface bizAttributeSelectorValueProp {
37
+ id?: number;
38
+ propCategory?: string;
39
+ name?: string;
40
+ category?: string;
41
+ }
42
+ interface targetDataProp {
43
+ event?: {
44
+ id: number;
45
+ name: string;
46
+ alias?: string;
47
+ };
48
+ }
49
+ }
@@ -0,0 +1,8 @@
1
+ import { SearchValueProps } from '../../types';
2
+ import { EventSelectTypes } from '@zgfe/business-lib/es/eventSelector/types';
3
+ export declare function targetChangeCallback(data: SearchValueProps, eList: number[], eventGroupList: EventSelectTypes.Value[]): SearchValueProps;
4
+ export declare function operableOrNotHandle(data: SearchValueProps, attrSourceCount: {
5
+ [x: number]: number;
6
+ }, attrTargetCount: number, mincePropCount: {
7
+ [x: number]: number;
8
+ }, attrGlobalCount: number): boolean;
@@ -0,0 +1,81 @@
1
+ export function targetChangeCallback(data, eList, eventGroupList) {
2
+ if (eList.length <= 0) {
3
+ data.globalFilters = undefined;
4
+ } else {
5
+ if (data.globalFilters && data.globalFilters.conditions) {
6
+ var flag = true;
7
+ data.globalFilters.conditions.forEach(function (condition) {
8
+ if (condition) {
9
+ if (condition.propCategory === 'eventProp' && condition.attrId) {
10
+ var hasExit = judgeAttrInEvents(eList, condition.attrId, eventGroupList);
11
+ if (!hasExit) {
12
+ flag = false;
13
+ }
14
+ }
15
+ }
16
+ });
17
+ if (!flag) {
18
+ data.globalFilters = undefined;
19
+ }
20
+ }
21
+ }
22
+ return data;
23
+ }
24
+ var judgeAttrInEvents = function judgeAttrInEvents(elds, attrId, eventGroupList) {
25
+ var flag = false;
26
+ if (!eventGroupList) return false;
27
+ eventGroupList.forEach(function (group) {
28
+ group.eventList.forEach(function (event) {
29
+ if (elds.includes(event.id)) {
30
+ event.attrList.forEach(function (attr) {
31
+ if (attr.id === attrId) {
32
+ flag = true;
33
+ return;
34
+ }
35
+ });
36
+ }
37
+ });
38
+ });
39
+ return flag;
40
+ };
41
+ export function operableOrNotHandle(data, attrSourceCount, attrTargetCount, mincePropCount, attrGlobalCount) {
42
+ var flagList = [];
43
+ if (data.attributionType === undefined) return true;
44
+ subsetHandle(flagList, data, 'sourceFilters', attrSourceCount, mincePropCount);
45
+ subsetHandle(flagList, data, 'targetFilters', attrTargetCount);
46
+ if (attrGlobalCount && data.globalFilters === undefined) return true;
47
+ data.globalFilters && conditionsHandle('globalFilters', data.globalFilters, attrGlobalCount, 0, flagList);
48
+ return flagList.indexOf(true) !== -1;
49
+ }
50
+ var subsetHandle = function subsetHandle(flagList, data, type, count, mincePropCount) {
51
+ data[type].map(function (item) {
52
+ item === undefined ? flagList.push(true) : null;
53
+ if (item !== undefined) {
54
+ (item === null || item === void 0 ? void 0 : item.eventId) === -100 ? flagList.push(true) : null;
55
+ if (type === 'targetFilters') {
56
+ item.filters === undefined && count != 0 ? flagList.push(true) : null;
57
+ } else {
58
+ item.filters === undefined && Object.keys(count).length > 0 && count[item.eventId] !== undefined ? flagList.push(true) : null;
59
+ if (mincePropCount != undefined) {
60
+ item.attributionSubdivision === undefined && Object.keys(mincePropCount).length > 0 && mincePropCount[item.eventId] !== undefined ? flagList.push(true) : null;
61
+ }
62
+ }
63
+ (item === null || item === void 0 ? void 0 : item.filters) && conditionsHandle(type, item.filters, count, item.eventId, flagList);
64
+ }
65
+ });
66
+ };
67
+ var conditionsHandle = function conditionsHandle(type, data, count, eventId, flagList) {
68
+ if (data.conditions.length > 0) {
69
+ data.conditions.map(function (_item) {
70
+ if (_item.operator !== 'is null' && _item.operator !== 'is not null') {
71
+ var _item$values;
72
+ _item.values && (((_item$values = _item.values) === null || _item$values === void 0 ? void 0 : _item$values.length) <= 0 || _item.values[0] === '') ? flagList.push(true) : null;
73
+ }
74
+ });
75
+ }
76
+ if (type === 'targetFilters' || type === 'globalFilters') {
77
+ data.conditions.length != count ? flagList.push(true) : null;
78
+ } else {
79
+ count[eventId] && data.conditions.length != count[eventId] ? flagList.push(true) : null;
80
+ }
81
+ };
@@ -1,5 +1,5 @@
1
1
  @import '~@zgfe/business-lib/es/assets/styles/variable.less';
2
- .insight {
2
+ .attribution {
3
3
  &-table-td {
4
4
  padding: 0 !important;
5
5
 
@@ -39,7 +39,7 @@
39
39
  &-link {
40
40
  cursor: pointer;
41
41
  &:hover {
42
- color: @primary-color;
42
+ // color: @primary-color;
43
43
  text-decoration: underline;
44
44
  }
45
45
  }
@@ -3,9 +3,7 @@ export default {
3
3
  'border-color-base': '#ECEDF0',
4
4
  'background-color-base': '#fafafb',
5
5
  'text-color': '#021429',
6
- // 正文
7
6
  'text-color-secondary': '#5f6085',
8
- // 次要
9
7
  'tooltip-bg': '#242541',
10
8
  'error-color': '#fb5547',
11
9
  'shadow-color': 'rgba(0, 0, 0, 0.1)',
package/es/types.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ /// <reference types="react" />
2
+ import { AttrConditionTypes } from '@zgfe/business-lib';
3
+ import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
4
+ export interface SearchValueProps {
5
+ targetFilters: Array<FiltersProps>;
6
+ sourceFilters: Array<FiltersProps>;
7
+ globalFilters?: AttrConditionTypes.GroupValue;
8
+ globalDimensions?: Array<AttrConditionTypes.ItemValue>;
9
+ time?: DatePickerTypes.Value;
10
+ otherEvent?: boolean;
11
+ windowCnt?: number;
12
+ windowType?: 'hour' | 'day';
13
+ attributionType?: number;
14
+ }
15
+ export interface FiltersProps {
16
+ eventId: number;
17
+ eventName: string;
18
+ filters?: AttrConditionTypes.GroupValue | undefined;
19
+ attributionSubdivision?: AttributionSubdivisionProps | undefined;
20
+ }
21
+ export interface AttributionSubdivisionProps {
22
+ relation: string;
23
+ conditions: ConditionsnProps;
24
+ }
25
+ export interface ConditionsnProps {
26
+ attrId: number | undefined;
27
+ propCategory: string | undefined;
28
+ type: string | undefined;
29
+ id?: number | undefined;
30
+ name?: string | undefined;
31
+ category?: string | undefined;
32
+ attrName?: string | undefined;
33
+ }
34
+ export interface TableDataHandleProps {
35
+ xAxis: string[];
36
+ series: {
37
+ values: string[];
38
+ }[];
39
+ }
40
+ export interface TableDataProps {
41
+ columns?: ColumnsProps[];
42
+ dataSource?: DataSourceProps[];
43
+ }
44
+ export interface DataSourceProps {
45
+ [x: string]: string;
46
+ }
47
+ export interface ColumnsProps {
48
+ key: string;
49
+ title: string;
50
+ dataIndex: string;
51
+ }
52
+ export declare const AttributableContext: import("react").Context<any>;
package/es/types.js ADDED
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export var AttributableContext = /*#__PURE__*/createContext(null);
@@ -1,11 +1,4 @@
1
1
  import _ from 'lodash';
2
-
3
- /**
4
- * 接口option封装
5
- * @param url url
6
- * @param options 操作
7
- * @returns
8
- */
9
2
  function setOptionWapper(url, options) {
10
3
  var reqOption = _.cloneDeep(options);
11
4
  if (/^\/v1|\.jsp$/.test(url)) {
@@ -0,0 +1,3 @@
1
+ import { ajaxConfig } from '@zgfe/business-lib/es/utils/type';
2
+ declare function request<T>(url: string, options: ajaxConfig<T>): Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<T> | null>;
3
+ export default request;
@@ -0,0 +1,5 @@
1
+ import { ajax } from '@zgfe/business-lib';
2
+ function request(url, options) {
3
+ return ajax(url, options);
4
+ }
5
+ export default request;
@@ -29,12 +29,6 @@ var util = {
29
29
  equal: function equal(a, b) {
30
30
  return JSON.stringify(a) === JSON.stringify(b);
31
31
  },
32
- /**
33
- * 获取指定范围的随机数
34
- * @param min
35
- * @param max
36
- * @returns {*}
37
- */
38
32
  random: function random(min, max) {
39
33
  return Math.round(Math.random() * (max - min)) + min;
40
34
  },
@@ -68,43 +62,20 @@ var util = {
68
62
  }
69
63
  return option;
70
64
  },
71
- /**
72
- * 将数字转为千分位分割格式
73
- * @param num
74
- * @returns {string}
75
- */
76
65
  toThousands: function toThousands(num) {
77
- var source = String(num).split('.'); // 按小数点分成2部分
78
- source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)', 'ig'), '$1,'); // 只将整数部分进行都好分割
79
- return source.join('.'); // 再将小数部分合并进来
80
- },
81
- /**
82
- * 为单数前补0
83
- * @param num
84
- * @returns {string}
85
- */
66
+ var source = String(num).split('.');
67
+ source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)', 'ig'), '$1,');
68
+ return source.join('.');
69
+ },
86
70
  toDoubleNumber: function toDoubleNumber(num) {
87
- // num += ''
88
71
  var num2 = num.toString();
89
72
  return num > 9 ? num2 : '0' + num2;
90
73
  },
91
- /**
92
- * 日期格式化
93
- * @param date
94
- * @param formatter
95
- * @returns {string}
96
- */
97
74
  dateFormat: function dateFormat() {
98
75
  var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
99
76
  var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
100
77
  return formatter.replace('yyyy', date.getFullYear()).replace('mm', this.toDoubleNumber(date.getMonth() + 1)).replace('dd', this.toDoubleNumber(date.getDate()));
101
78
  },
102
- /**
103
- * 日期格式化
104
- * @param date
105
- * @param formatter
106
- * @returns {string}
107
- */
108
79
  timeFormat: function timeFormat() {
109
80
  var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
110
81
  var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm:ss';
@@ -112,7 +83,6 @@ var util = {
112
83
  if (this.isDate(date)) {
113
84
  return formatter.replace('hh', this.toDoubleNumber(date.getHours())).replace('mm', this.toDoubleNumber(date.getMinutes())).replace('ss', this.toDoubleNumber(date.getSeconds()));
114
85
  } else if (this.isNumber(date)) {
115
- // formatter 格式化规则 如:{s:'秒', h:'小时', m: '分钟'}
116
86
  var s = parseInt(date / 1000 + '');
117
87
  var m = parseInt(s / 60 + '');
118
88
  var h = parseInt(m / 60 + '');
@@ -128,12 +98,6 @@ var util = {
128
98
  return formatter.replace('hh', this.toDoubleNumber(h)).replace('mm', this.toDoubleNumber(m)).replace('ss', this.toDoubleNumber(s));
129
99
  }
130
100
  },
131
- /**
132
- * 从中间拆分字符串,长度超出的话,解析为xxx...xxx
133
- * @param str
134
- * @param config
135
- * @returns {string}
136
- */
137
101
  strMiddleSplit: function strMiddleSplit(str) {
138
102
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
139
103
  maxLength: 20,
@@ -143,9 +107,7 @@ var util = {
143
107
  };
144
108
  str += '';
145
109
  var reg = {
146
- // eslint-disable-next-line
147
110
  fullCharReg: /[^\x00-\xff]/,
148
- // eslint-disable-next-line
149
111
  fullCharsReg: /[^\x00-\xff]/g,
150
112
  anyChars: /[\S\s]{1}/g
151
113
  };
package/package.json CHANGED
@@ -1,25 +1,22 @@
1
1
  {
2
2
  "name": "@zgfe/modules-attribution",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
+ "module": "es/index.js",
5
+ "typings": "es/index.d.ts",
6
+ "files": [
7
+ "es"
8
+ ],
4
9
  "scripts": {
5
- "start": "dumi dev",
10
+ "build": "father-build",
11
+ "deploy": "npm run docs:build && npm run docs:deploy",
6
12
  "docs:build": "dumi build",
7
13
  "docs:deploy": "gh-pages -d docs-dist",
8
- "build": "father build",
9
- "deploy": "npm run docs:build && npm run docs:deploy",
14
+ "prepublishOnly": "npm run build",
10
15
  "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
16
+ "pub": "lerna publish",
17
+ "start": "dumi dev",
11
18
  "test": "umi-test",
12
- "test:coverage": "umi-test --coverage",
13
- "prepublishOnly": "npm run build",
14
- "pub": "lerna publish"
15
- },
16
- "files": [
17
- "dist"
18
- ],
19
- "module": "dist/esm/index.js",
20
- "typings": "dist/esm/index.d.ts",
21
- "gitHooks": {
22
- "pre-commit": "lint-staged"
19
+ "test:coverage": "umi-test --coverage"
23
20
  },
24
21
  "lint-staged": {
25
22
  "*.{js,jsx,less,md,json}": [
@@ -30,25 +27,28 @@
30
27
  ]
31
28
  },
32
29
  "dependencies": {
33
- "react": "^18.0.0"
30
+ "caniuse-lite": "^1.0.30001491",
31
+ "nanoid": "^4.0.2"
34
32
  },
35
33
  "devDependencies": {
36
34
  "@testing-library/jest-dom": "^5.15.1",
37
- "@testing-library/react": "^13.0.0",
35
+ "@testing-library/react": "^12.1.2",
38
36
  "@types/jest": "^27.0.3",
37
+ "@types/lodash": "^4.14.191",
39
38
  "@umijs/fabric": "^2.8.1",
40
39
  "@umijs/test": "^3.0.5",
41
- "@zgfe/business-lib": "1.1.30-insight.0",
42
- "antd": "4.21.4",
40
+ "@zgfe/business-lib": "1.1.41-attribution.19",
41
+ "antd": "^4.22.6",
43
42
  "dumi": "^1.1.0",
44
43
  "echarts": "^5.3.2",
45
44
  "echarts-for-react": "^3.0.2",
46
- "father": "^4.0.0-rc.2",
45
+ "father-build": "^1.17.2",
47
46
  "gh-pages": "^3.0.0",
48
47
  "lerna": "^4.0.0",
49
48
  "lint-staged": "^10.0.7",
50
49
  "prettier": "^2.2.1",
50
+ "react": "^16.12.0 || ^17.0.0",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "207fd739d93b448e6b125a18105c840511bbd7d1"
53
+ "gitHead": "c39f3d7a6efe23957437bc6bc78b8b7a6d75fdd1"
54
54
  }
@@ -1,6 +0,0 @@
1
- import OptionGroup from './option';
2
- import ContentPanel from './renderContent';
3
- import SearchPanel from './searchPanel';
4
- import InsightTable from './table';
5
- import { MiNone, MiSpin } from './common';
6
- export { OptionGroup, ContentPanel, SearchPanel, InsightTable, MiNone, MiSpin };
@@ -1,6 +0,0 @@
1
- import OptionGroup from "./option";
2
- import ContentPanel from "./renderContent";
3
- import SearchPanel from "./searchPanel";
4
- import InsightTable from "./table";
5
- import { MiNone, MiSpin } from "./common";
6
- export { OptionGroup, ContentPanel, SearchPanel, InsightTable, MiNone, MiSpin };