@zgfe/modules-attribution 1.0.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 (107) hide show
  1. package/README.md +33 -0
  2. package/dist/esm/components/common/index.d.ts +6 -0
  3. package/dist/esm/components/common/index.js +21 -0
  4. package/dist/esm/components/common/styles/index.less +27 -0
  5. package/dist/esm/components/index.d.ts +6 -0
  6. package/dist/esm/components/index.js +6 -0
  7. package/dist/esm/components/option/index.d.ts +5 -0
  8. package/dist/esm/components/option/index.js +199 -0
  9. package/dist/esm/components/option/styles/index.less +17 -0
  10. package/dist/esm/components/option/types.d.ts +9 -0
  11. package/dist/esm/components/option/types.js +1 -0
  12. package/dist/esm/components/renderContent/index.d.ts +5 -0
  13. package/dist/esm/components/renderContent/index.js +92 -0
  14. package/dist/esm/components/renderContent/styles/index.less +21 -0
  15. package/dist/esm/components/renderContent/types.d.ts +15 -0
  16. package/dist/esm/components/renderContent/types.js +1 -0
  17. package/dist/esm/components/searchPanel/index.d.ts +5 -0
  18. package/dist/esm/components/searchPanel/index.js +122 -0
  19. package/dist/esm/components/searchPanel/styles/index.less +38 -0
  20. package/dist/esm/components/searchPanel/types.d.ts +10 -0
  21. package/dist/esm/components/searchPanel/types.js +1 -0
  22. package/dist/esm/components/showList/index.d.ts +10 -0
  23. package/dist/esm/components/showList/index.js +92 -0
  24. package/dist/esm/components/showList/listPanel.d.ts +9 -0
  25. package/dist/esm/components/showList/listPanel.js +118 -0
  26. package/dist/esm/components/showList/styles/index.less +75 -0
  27. package/dist/esm/components/showList/types.d.ts +9 -0
  28. package/dist/esm/components/showList/types.js +1 -0
  29. package/dist/esm/components/table/index.d.ts +5 -0
  30. package/dist/esm/components/table/index.js +194 -0
  31. package/dist/esm/components/table/styles/index.less +12 -0
  32. package/dist/esm/components/table/types.d.ts +11 -0
  33. package/dist/esm/components/table/types.js +1 -0
  34. package/dist/esm/components/title/index.d.ts +5 -0
  35. package/dist/esm/components/title/index.js +184 -0
  36. package/dist/esm/components/title/searchTitle.d.ts +7 -0
  37. package/dist/esm/components/title/searchTitle.js +47 -0
  38. package/dist/esm/components/title/styles/index.less +72 -0
  39. package/dist/esm/components/title/styles/search.less +27 -0
  40. package/dist/esm/components/title/types.d.ts +7 -0
  41. package/dist/esm/components/title/types.js +1 -0
  42. package/dist/esm/constants/apis.d.ts +9 -0
  43. package/dist/esm/constants/apis.js +9 -0
  44. package/dist/esm/constants/chart.d.ts +2 -0
  45. package/dist/esm/constants/chart.js +24 -0
  46. package/dist/esm/constants/color.d.ts +1 -0
  47. package/dist/esm/constants/color.js +1 -0
  48. package/dist/esm/constants/fields.d.ts +218 -0
  49. package/dist/esm/constants/fields.js +242 -0
  50. package/dist/esm/constants/index.d.ts +6 -0
  51. package/dist/esm/constants/index.js +6 -0
  52. package/dist/esm/constants/initData.d.ts +17 -0
  53. package/dist/esm/constants/initData.js +30 -0
  54. package/dist/esm/index.d.ts +2 -0
  55. package/dist/esm/index.js +2 -0
  56. package/dist/esm/modules/content/index.d.ts +5 -0
  57. package/dist/esm/modules/content/index.js +218 -0
  58. package/dist/esm/modules/content/styles/index.less +7 -0
  59. package/dist/esm/modules/content/types.d.ts +8 -0
  60. package/dist/esm/modules/content/types.js +2 -0
  61. package/dist/esm/modules/content/utiles.d.ts +12 -0
  62. package/dist/esm/modules/content/utiles.js +231 -0
  63. package/dist/esm/modules/home/demo/create.d.ts +3 -0
  64. package/dist/esm/modules/home/demo/create.js +54 -0
  65. package/dist/esm/modules/home/demo/edit.d.ts +3 -0
  66. package/dist/esm/modules/home/demo/edit.js +80 -0
  67. package/dist/esm/modules/home/demo/index.d.ts +4 -0
  68. package/dist/esm/modules/home/demo/index.js +52 -0
  69. package/dist/esm/modules/home/demo/scene.d.ts +3 -0
  70. package/dist/esm/modules/home/demo/scene.js +74 -0
  71. package/dist/esm/modules/home/demo/styles/index.less +33 -0
  72. package/dist/esm/modules/home/index.d.ts +5 -0
  73. package/dist/esm/modules/home/index.js +172 -0
  74. package/dist/esm/modules/home/styles/index.less +37 -0
  75. package/dist/esm/modules/home/types.d.ts +19 -0
  76. package/dist/esm/modules/home/types.js +2 -0
  77. package/dist/esm/modules/leftPanel/components/globalAttribute.d.ts +8 -0
  78. package/dist/esm/modules/leftPanel/components/globalAttribute.js +64 -0
  79. package/dist/esm/modules/leftPanel/components/panel.d.ts +4 -0
  80. package/dist/esm/modules/leftPanel/components/panel.js +87 -0
  81. package/dist/esm/modules/leftPanel/demo/index.d.ts +3 -0
  82. package/dist/esm/modules/leftPanel/demo/index.js +28 -0
  83. package/dist/esm/modules/leftPanel/index.d.ts +6 -0
  84. package/dist/esm/modules/leftPanel/index.js +285 -0
  85. package/dist/esm/modules/leftPanel/styles/index.less +55 -0
  86. package/dist/esm/modules/leftPanel/types.d.ts +27 -0
  87. package/dist/esm/modules/leftPanel/types.js +2 -0
  88. package/dist/esm/modules/leftPanel/utils.d.ts +5 -0
  89. package/dist/esm/modules/leftPanel/utils.js +262 -0
  90. package/dist/esm/style/image/noData.png +0 -0
  91. package/dist/esm/style/image/ring.svg +9 -0
  92. package/dist/esm/style/index.less +47 -0
  93. package/dist/esm/style/theme.d.ts +15 -0
  94. package/dist/esm/style/theme.js +16 -0
  95. package/dist/esm/types.d.ts +46 -0
  96. package/dist/esm/types.js +2 -0
  97. package/dist/esm/utils/ajaxConfig.d.ts +8 -0
  98. package/dist/esm/utils/ajaxConfig.js +47 -0
  99. package/dist/esm/utils/base64.d.ts +23 -0
  100. package/dist/esm/utils/base64.js +132 -0
  101. package/dist/esm/utils/formData.d.ts +18 -0
  102. package/dist/esm/utils/formData.js +485 -0
  103. package/dist/esm/utils/transfer.d.ts +65 -0
  104. package/dist/esm/utils/transfer.js +206 -0
  105. package/dist/esm/utils/util.d.ts +32 -0
  106. package/dist/esm/utils/util.js +177 -0
  107. package/package.json +54 -0
@@ -0,0 +1,47 @@
1
+ @import '~@zgfe/business-lib/es/assets/styles/variable.less';
2
+ .insight {
3
+ &-table-td {
4
+ padding: 0 !important;
5
+
6
+ &-show {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ min-width: 60px;
11
+ height: 48px;
12
+ cursor: pointer;
13
+ span {
14
+ width: 10px;
15
+ height: 10px;
16
+ border-radius: 50%;
17
+ cursor: pointer;
18
+ }
19
+ }
20
+
21
+ &-name {
22
+ display: flex;
23
+ align-items: center;
24
+ .bsicon {
25
+ margin-right: 4px;
26
+ color: #fd9f41;
27
+ }
28
+
29
+ &-content {
30
+ display: inline-block;
31
+ max-width: 300px;
32
+ overflow: hidden;
33
+ white-space: nowrap;
34
+ text-overflow: ellipsis;
35
+ cursor: pointer;
36
+ }
37
+ }
38
+
39
+ &-link {
40
+ cursor: pointer;
41
+ &:hover {
42
+ color: @primary-color;
43
+ text-decoration: underline;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,15 @@
1
+ declare const _default: {
2
+ 'primary-color': string;
3
+ 'border-color-base': string;
4
+ 'background-color-base': string;
5
+ 'text-color': string;
6
+ 'text-color-secondary': string;
7
+ 'tooltip-bg': string;
8
+ 'error-color': string;
9
+ 'shadow-color': string;
10
+ 'box-shadow-base': string;
11
+ 'btn-text-hover-bg': string;
12
+ 'warning-color': string;
13
+ 'border-color-split': string;
14
+ };
15
+ export default _default;
@@ -0,0 +1,16 @@
1
+ export default {
2
+ 'primary-color': '#165dff',
3
+ 'border-color-base': '#ECEDF0',
4
+ 'background-color-base': '#fafafb',
5
+ 'text-color': '#021429',
6
+ // 正文
7
+ 'text-color-secondary': '#5f6085',
8
+ // 次要
9
+ 'tooltip-bg': '#242541',
10
+ 'error-color': '#fb5547',
11
+ 'shadow-color': 'rgba(0, 0, 0, 0.1)',
12
+ 'box-shadow-base': '0px 4px 10px rgba(0, 0, 0, 0.1)',
13
+ 'btn-text-hover-bg': '#cacdd4',
14
+ 'warning-color': '#FD9F41',
15
+ 'border-color-split': '#E8EFFF'
16
+ };
@@ -0,0 +1,46 @@
1
+ import { TargetConditionTypes, AttrConditionTypes, BizSelectTypes, AttributeSelect } from '@zgfe/business-lib';
2
+ import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
3
+ import { ReactNode } from 'react';
4
+ export interface SearchValue {
5
+ userGroup?: number[];
6
+ event?: Array<TargetConditionTypes.Value>;
7
+ process?: Array<TargetConditionTypes.Value>;
8
+ targets?: Array<TargetConditionTypes.Value>;
9
+ globalFilters?: AttrConditionTypes.GroupValue;
10
+ globalDimensions?: Array<AttrConditionTypes.ItemValue>;
11
+ chartType?: 'line' | 'bar' | 'map';
12
+ time?: DatePickerTypes.Value;
13
+ }
14
+ export interface SearchData {
15
+ userGroup?: Array<BizSelectTypes.Option>;
16
+ targets: Array<TargetConditionTypes.Value>;
17
+ globalFilters?: AttrConditionTypes.GroupValue;
18
+ globalDimensions?: Array<AttributeSelect.Value>;
19
+ chartType?: 'line' | 'bar' | 'map';
20
+ time?: DatePickerTypes.Value;
21
+ }
22
+ export interface ChartItemProp {
23
+ label?: string;
24
+ value: 'line' | 'bar' | 'map';
25
+ icon?: ReactNode;
26
+ disabled?: boolean;
27
+ }
28
+ export interface ResponseDataProps {
29
+ x_axis?: string[];
30
+ series: SeriesProps[];
31
+ tongbi?: number[];
32
+ huanbi?: number[];
33
+ total?: number[];
34
+ yesterDay?: string[];
35
+ }
36
+ export interface SeriesProps {
37
+ names?: string[];
38
+ values: number[];
39
+ index?: string;
40
+ duration?: TableChildrenProps[];
41
+ }
42
+ export interface TableChildrenProps {
43
+ name: string;
44
+ values: number[];
45
+ }
46
+ export declare const AttributionContext: import("react").Context<any>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export var AttributionContext = /*#__PURE__*/createContext(null);
@@ -0,0 +1,8 @@
1
+ export declare const requestConfig: {
2
+ request: {
3
+ optionsWrapper(url: string, options?: any): {
4
+ url: string;
5
+ options: any;
6
+ };
7
+ };
8
+ };
@@ -0,0 +1,47 @@
1
+ import _ from 'lodash';
2
+
3
+ /**
4
+ * 接口option封装
5
+ * @param url url
6
+ * @param options 操作
7
+ * @returns
8
+ */
9
+ function setOptionWapper(url, options) {
10
+ var reqOption = _.cloneDeep(options);
11
+ if (/^\/v1|\.jsp$/.test(url)) {
12
+ if (reqOption.headers && reqOption.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
13
+ return reqOption;
14
+ }
15
+ reqOption.headers = {
16
+ 'Content-Type': 'application/x-www-form-urlencoded'
17
+ };
18
+ var transformRequest = function transformRequest(param) {
19
+ var arr = [];
20
+ for (var key in param) {
21
+ arr.push("".concat(key, "=").concat(encodeURIComponent(param[key])));
22
+ }
23
+ return arr.join('&');
24
+ };
25
+ reqOption.data = transformRequest(options.data);
26
+ }
27
+ return reqOption;
28
+ }
29
+ export var requestConfig = {
30
+ request: {
31
+ optionsWrapper: function optionsWrapper(url, options) {
32
+ var newUrl = url;
33
+ var reqOption = options;
34
+ var ajaxUrlReg = '/analysis/api/common/proxy';
35
+ if (/^\/v1|\.jsp$/.test(url)) {
36
+ if (ajaxUrlReg && !url.includes(ajaxUrlReg)) {
37
+ newUrl = ajaxUrlReg + url;
38
+ reqOption = setOptionWapper(url, options);
39
+ }
40
+ }
41
+ return {
42
+ url: newUrl,
43
+ options: reqOption
44
+ };
45
+ }
46
+ }
47
+ };
@@ -0,0 +1,23 @@
1
+ declare const _default: {
2
+ _keyStr: string;
3
+ _utf8_encode: (string: string) => string;
4
+ _utf8_decode: (utftext: string) => string;
5
+ encode: (input: string, type?: any) => string;
6
+ decode: (input: string) => string;
7
+ _$: string[];
8
+ pw: string;
9
+ gString: (O6b8: {
10
+ [x: string]: (arg0: number) => {
11
+ (): any;
12
+ new (): any;
13
+ [x: string]: () => any;
14
+ };
15
+ }[], O492: {
16
+ [x: string]: (arg0: number) => {
17
+ (): any;
18
+ new (): any;
19
+ [x: string]: () => any;
20
+ };
21
+ }[]) => string;
22
+ };
23
+ export default _default;
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Created by yqdong on 16/3/15.
3
+ * qq: 1013501639
4
+ * @author yqdong
5
+ *
6
+ */
7
+ export default {
8
+ _keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
9
+ _utf8_encode: function _utf8_encode(string) {
10
+ string = string.replace(/\r\n/g, '\n');
11
+ var utftext = '';
12
+ for (var n = 0; n < string.length; n++) {
13
+ var c = string.charCodeAt(n);
14
+ if (c < 128) {
15
+ utftext += String.fromCharCode(c);
16
+ } else if (c > 127 && c < 2048) {
17
+ utftext += String.fromCharCode(c >> 6 | 192); // jshint ignore:line
18
+ utftext += String.fromCharCode(c & 63 | 128); // jshint ignore:line
19
+ } else {
20
+ utftext += String.fromCharCode(c >> 12 | 224); // jshint ignore:line
21
+ utftext += String.fromCharCode(c >> 6 & 63 | 128); // jshint ignore:line
22
+ utftext += String.fromCharCode(c & 63 | 128); // jshint ignore:line
23
+ }
24
+ }
25
+
26
+ return utftext;
27
+ },
28
+ _utf8_decode: function _utf8_decode(utftext) {
29
+ var string = '';
30
+ var i = 0,
31
+ c = 0,
32
+ c2 = 0,
33
+ c3 = 0;
34
+ while (i < utftext.length) {
35
+ c = utftext.charCodeAt(i);
36
+ if (c < 128) {
37
+ string += String.fromCharCode(c);
38
+ i++;
39
+ } else if (c > 191 && c < 224) {
40
+ c2 = utftext.charCodeAt(i + 1);
41
+ string += String.fromCharCode((c & 31) << 6 | c2 & 63); // jshint ignore:line
42
+ i += 2;
43
+ } else {
44
+ c2 = utftext.charCodeAt(i + 1);
45
+ c3 = utftext.charCodeAt(i + 2);
46
+ string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63); // jshint ignore:line
47
+ i += 3;
48
+ }
49
+ }
50
+ return string;
51
+ },
52
+ encode: function encode(input, type) {
53
+ var output = '';
54
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
55
+ var i = 0;
56
+ input = this._utf8_encode(input);
57
+ while (i < input.length) {
58
+ chr1 = input.charCodeAt(i++);
59
+ chr2 = input.charCodeAt(i++);
60
+ chr3 = input.charCodeAt(i++);
61
+ enc1 = chr1 >> 2; // jshint ignore:line
62
+ enc2 = (chr1 & 3) << 4 | chr2 >> 4; // jshint ignore:line
63
+ enc3 = (chr2 & 15) << 2 | chr3 >> 6; // jshint ignore:line
64
+ enc4 = chr3 & 63; // jshint ignore:line
65
+ if (isNaN(chr2)) {
66
+ enc3 = enc4 = 64;
67
+ } else if (isNaN(chr3)) {
68
+ enc4 = 64;
69
+ }
70
+ output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
71
+ }
72
+ if (type) {
73
+ return output.replace(/[\+]?[\/]?[\=]?/g, '');
74
+ } else {
75
+ return output.replace(/\+/g, '-');
76
+ }
77
+ },
78
+ decode: function decode(input) {
79
+ input = input.replace(/\-/g, '+');
80
+ var output = '';
81
+ var chr1, chr2, chr3;
82
+ var enc1, enc2, enc3, enc4;
83
+ var i = 0;
84
+ while (i < input.length) {
85
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
86
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
87
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
88
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
89
+ chr1 = enc1 << 2 | enc2 >> 4; // jshint ignore:line
90
+ chr2 = (enc2 & 15) << 4 | enc3 >> 2; // jshint ignore:line
91
+ chr3 = (enc3 & 3) << 6 | enc4; // jshint ignore:line
92
+ output = output + String.fromCharCode(chr1);
93
+ if (enc3 != 64) {
94
+ output = output + String.fromCharCode(chr2);
95
+ }
96
+ if (enc4 != 64) {
97
+ output = output + String.fromCharCode(chr3);
98
+ }
99
+ }
100
+ output = this._utf8_decode(output);
101
+ return output;
102
+ },
103
+ _$: [''],
104
+ pw: '0&Gqs0a5',
105
+ gString: function gString(O6b8, O492) {
106
+ var dfc4 = Array(0x100);
107
+ var O26e = Array(0x100);
108
+ var O999 = O492['\x6c\x65\x6e\x67\x74\x68'];
109
+ var O453 = O6b8['\x6c\x65\x6e\x67\x74\x68'];
110
+ for (var O98c = 0x0; O98c < 0x100; O98c++) {
111
+ dfc4[O98c] = O492[O98c % O999]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']();
112
+ O26e[O98c] = O98c;
113
+ }
114
+ for (var O8cf = O98c = 0x0; O98c < 0x100; O98c++) {
115
+ O8cf = (O8cf + O26e[O98c] + dfc4[O98c]) % 0x100;
116
+ var O23f = O26e[O98c];
117
+ O26e[O98c] = O26e[O8cf];
118
+ O26e[O8cf] = O23f;
119
+ }
120
+ var ac35 = this._$[0];
121
+ for (var O577 = O8cf = O98c = 0x0; O98c < O453; O98c++) {
122
+ O577 = (O577 + 0x1) % 0x100;
123
+ O8cf = (O8cf + O26e[O577]) % 0x100;
124
+ var tmp = O26e[O577];
125
+ O26e[O577] = O26e[O8cf];
126
+ O26e[O8cf] = tmp;
127
+ var O3d6 = O26e[(O26e[O577] + O26e[O8cf]) % 0x100];
128
+ ac35 += String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](O6b8[O98c]['\x63\x68\x61\x72\x41\x74'](0x0)['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74']() ^ O3d6);
129
+ }
130
+ return ac35;
131
+ }
132
+ };
@@ -0,0 +1,18 @@
1
+ import { AttrConditionTypes } from '@zgfe/business-lib';
2
+ import type { ColumnsType } from 'antd/es/table';
3
+ import { EventGroup, UserProp, EnvProp } from '@zgfe/business-lib/es/attributeSelector/types';
4
+ import { ResponseDataProps, SearchValue } from '../types';
5
+ import '../style/index.less';
6
+ export declare function getColumns(columnData: string[], userGroup: number[], searchData: SearchValue, eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, showList: string[], onShowCallback: Function, onTagCallback: Function, onFilter: Function, onClickToDetailCallback: Function): ColumnsType<any>;
7
+ export declare function getAttrLabel(attrData: AttrConditionTypes.ItemValue, eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined): string | undefined;
8
+ export declare function formTableData(originalData: ResponseDataProps, userGroups: number[], attrNum: number, eventGroupList: any[], showList?: string[]): any;
9
+ export declare function mergeRow(source: any[], fieldLen?: number): any;
10
+ export declare function getDefaultShow(source: ResponseDataProps): string[];
11
+ export declare function getShowColor(source: ResponseDataProps, showList: string[]): string[];
12
+ export declare function fetchDrillData(current: any, timeData: string, searchData: SearchValue, userGroupList: any[], eventGroupList: EventGroup[]): {
13
+ userGroup: any[];
14
+ targets: {};
15
+ globalFilters: any;
16
+ time: any;
17
+ duration: any;
18
+ };