@zgfe/modules-attribution 1.0.5 → 1.1.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 (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,45 @@
1
+ export var chartTypes = [{
2
+ label: '表格',
3
+ icon: 'biaoge',
4
+ value: 'grid'
5
+ }];
6
+ export var searchFields = [{
7
+ key: 'mi-targetFilters',
8
+ type: 'targetFilters',
9
+ name: 'targetFilters',
10
+ label: '目标事件',
11
+ max: 1,
12
+ addLabel: '',
13
+ tips: '目标事件通常为购买、付费、支付等事件',
14
+ required: true
15
+ }, {
16
+ key: 'mi-sourceFilters',
17
+ type: 'sourceFilters',
18
+ name: 'sourceFilters',
19
+ label: '待归因事件',
20
+ max: 10,
21
+ addLabel: '待归因事件',
22
+ tips: '参与归因计算的事件,通常为广告、运营位的点击事件',
23
+ required: true
24
+ }, {
25
+ key: 'mi-globalFilters',
26
+ type: 'globalFilters',
27
+ name: 'globalFilters',
28
+ label: '全局属性',
29
+ max: 5,
30
+ addLabel: '添加属性',
31
+ required: false
32
+ }];
33
+ export var attributionTypeTooltips = [{
34
+ text: '首次触点归因',
35
+ title: '完成目标事件的「待归因事件」中,第一个「待归因事件」贡献为100%'
36
+ }, {
37
+ text: '末次触点归因',
38
+ title: '完成目标事件的「待归因事件」中,最后一个「待归因事件」贡献为100%'
39
+ }, {
40
+ text: '线性归因',
41
+ title: '完成目标事件的「待归因事件」中,所有「待归因事件」平均分配贡献'
42
+ }, {
43
+ text: '位置归因',
44
+ title: '完成目标事件的「待归因事件」中,首位和末位「待归因事件」各获40%贡献,其余「待归因事件」平分20%贡献'
45
+ }];
@@ -0,0 +1,4 @@
1
+ import Apis from './apis';
2
+ import { chartTypes, searchFields } from './fields';
3
+ import { initTarget, initEvent, getInitDate } from './initData';
4
+ export { Apis, chartTypes, searchFields, initTarget, initEvent, getInitDate, };
@@ -0,0 +1,4 @@
1
+ import Apis from './apis';
2
+ import { chartTypes, searchFields } from './fields';
3
+ import { initTarget, initEvent, getInitDate } from './initData';
4
+ export { Apis, chartTypes, searchFields, initTarget, initEvent, getInitDate };
@@ -1,6 +1,4 @@
1
1
  import moment from 'moment';
2
-
3
- // 指标默认是 所有分组/事件概览
4
2
  export var initTarget = [{
5
3
  type: 'event',
6
4
  alias: '事件概览',
@@ -11,15 +9,11 @@ export var initTarget = [{
11
9
  analysisIndex: 'number'
12
10
  }
13
11
  }];
14
-
15
- // 默认事件
16
12
  export var initEvent = {
17
13
  id: -100,
18
14
  name: '事件概览',
19
15
  attrList: []
20
16
  };
21
-
22
- // 默认日期
23
17
  export function getInitDate(includeToday) {
24
18
  return {
25
19
  unit: 'day',
Binary file
package/es/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import AttributionHome from './modules/home';
3
+ export { AttributionHome };
package/es/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import AttributionHome from './modules/home';
2
+ export { AttributionHome };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { attributionContentProps } from './types';
3
+ import './styles/index.less';
4
+ declare const AttributionContent: React.ForwardRefExoticComponent<attributionContentProps.Props & React.RefAttributes<any>>;
5
+ export default AttributionContent;
@@ -0,0 +1,134 @@
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
+ 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; }
3
+ 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; }
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ 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."); }
6
+ 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); }
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
+ 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; }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
11
+ import request from '../../utils/request';
12
+ import React, { useContext, useEffect, useState, useRef } from 'react';
13
+ import SearchPanel from '../searchPanel';
14
+ import './styles/index.less';
15
+ import { Apis } from '../../constants';
16
+ import { handleTableData } from './utils';
17
+ import { TableList, OptionGroup, SearchTime } from '../../components';
18
+ var classPrefix = 'attribution-content';
19
+ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
+ var _useState = useState(props.value),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ searchData = _useState2[0],
23
+ setSearchData = _useState2[1];
24
+ var _useState3 = useState(false),
25
+ _useState4 = _slicedToArray(_useState3, 2),
26
+ loading = _useState4[0],
27
+ setLoading = _useState4[1];
28
+ var _useContext = useContext(BizGlobalDataContext),
29
+ currentApp = _useContext.currentApp;
30
+ var _useState5 = useState(true),
31
+ _useState6 = _slicedToArray(_useState5, 2),
32
+ isFetchRequest = _useState6[0],
33
+ setIsFetchRequest = _useState6[1];
34
+ var _useState7 = useState(null),
35
+ _useState8 = _slicedToArray(_useState7, 2),
36
+ time = _useState8[0],
37
+ setTime = _useState8[1];
38
+ useEffect(function () {
39
+ if (searchData.sourceFilters && searchData.sourceFilters[0].eventId === -100) return;
40
+ fetchRequest();
41
+ }, [searchData]);
42
+ useEffect(function () {
43
+ props.onSearching && props.onSearching(loading);
44
+ }, [loading]);
45
+ var _useState9 = useState(100),
46
+ _useState10 = _slicedToArray(_useState9, 2),
47
+ total = _useState10[0],
48
+ setTotal = _useState10[1];
49
+ var fetchRequest = function fetchRequest() {
50
+ if (!isFetchRequest) {
51
+ return;
52
+ }
53
+ setIsFetchRequest(false);
54
+ setLoading(true);
55
+ var _searchData = _objectSpread(_objectSpread({}, searchData), {}, {
56
+ targetFilters: searchData.targetFilters[0]
57
+ });
58
+ request(Apis.getAnalyseData, {
59
+ method: 'post',
60
+ data: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, currentApp), _searchData), time), {}, {
61
+ searchType: 0
62
+ })
63
+ }).then(function (res) {
64
+ if (res === null || res === void 0 ? void 0 : res.data) {
65
+ var _data = handleTableData(res === null || res === void 0 ? void 0 : res.data);
66
+ setTableDataList(_data);
67
+ setTotal(res.data.total);
68
+ }
69
+ setTimeout(function () {
70
+ setLoading(false);
71
+ }, 20);
72
+ }).catch(function () {
73
+ setLoading(false);
74
+ });
75
+ };
76
+ var onChangeSearch = function onChangeSearch(allData, isFetchRequest) {
77
+ setIsFetchRequest(isFetchRequest);
78
+ setSearchData(function (data) {
79
+ return _objectSpread(_objectSpread({}, allData), {}, {
80
+ time: data === null || data === void 0 ? void 0 : data.time
81
+ });
82
+ });
83
+ };
84
+ var onChangeContent = function onChangeContent(data) {
85
+ setTime(data);
86
+ setSearchData(function (value) {
87
+ return _objectSpread(_objectSpread({}, value), data);
88
+ });
89
+ };
90
+ var _useState11 = useState({}),
91
+ _useState12 = _slicedToArray(_useState11, 2),
92
+ tableDataList = _useState12[0],
93
+ setTableDataList = _useState12[1];
94
+ var SearchPanelRef = useRef(null);
95
+ var onGetSearchData = function onGetSearchData() {
96
+ if (SearchPanelRef) {
97
+ SearchPanelRef.current.onGetSearchData();
98
+ }
99
+ };
100
+ var resetTime = function resetTime() {
101
+ setSearchData(function (value) {
102
+ return _objectSpread(_objectSpread({}, value), {}, {
103
+ time: undefined
104
+ });
105
+ });
106
+ };
107
+ return /*#__PURE__*/React.createElement("div", {
108
+ className: classPrefix
109
+ }, /*#__PURE__*/React.createElement("div", {
110
+ className: "".concat(classPrefix, "-top-content")
111
+ }, /*#__PURE__*/React.createElement("div", {
112
+ className: "".concat(classPrefix, "-top-content-box")
113
+ }, /*#__PURE__*/React.createElement(SearchPanel, {
114
+ ref: SearchPanelRef,
115
+ defaultValue: searchData,
116
+ onChange: onChangeSearch,
117
+ resetTime: resetTime
118
+ }))), /*#__PURE__*/React.createElement("div", {
119
+ className: "".concat(classPrefix, "-bottom-content-box")
120
+ }, /*#__PURE__*/React.createElement("div", {
121
+ className: "".concat(classPrefix, "-bottom-content-box-times")
122
+ }, /*#__PURE__*/React.createElement(SearchTime, {
123
+ time: searchData === null || searchData === void 0 ? void 0 : searchData.time,
124
+ onChange: onChangeContent
125
+ }), searchData && /*#__PURE__*/React.createElement(OptionGroup, {
126
+ ref: ref,
127
+ searchData: searchData,
128
+ onGetSearchData: onGetSearchData
129
+ })), /*#__PURE__*/React.createElement(TableList, {
130
+ total: total,
131
+ tableDataList: tableDataList
132
+ })));
133
+ });
134
+ export default AttributionContent;
@@ -0,0 +1,7 @@
1
+ // .attribution-content {
2
+ // &-options {
3
+ // display: flex;
4
+ // justify-content: flex-end;
5
+ // // margin-bottom: 16px;
6
+ // }
7
+ // }
@@ -0,0 +1,8 @@
1
+ import { SearchValueProps } from '../../types';
2
+ export declare namespace attributionContentProps {
3
+ interface Props {
4
+ value: SearchValueProps;
5
+ show?: string[];
6
+ onSearching?: (flag: boolean) => void;
7
+ }
8
+ }
@@ -0,0 +1,2 @@
1
+ import { TableDataHandleProps, TableDataProps } from '../../types';
2
+ export declare const handleTableData: (data: TableDataHandleProps) => TableDataProps;
@@ -0,0 +1,29 @@
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
+ 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; }
3
+ 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; }
4
+ import { nanoid } from 'nanoid';
5
+ export var handleTableData = function handleTableData(data) {
6
+ var tableData = {};
7
+ var dataSource = [],
8
+ columns = [];
9
+ var _columns = data.xAxis;
10
+ data.series.map(function (item) {
11
+ var _json = {};
12
+ item.values.map(function (_item, _index) {
13
+ _json[_columns[_index]] = _item;
14
+ });
15
+ dataSource.push(_objectSpread({
16
+ key: nanoid()
17
+ }, _json));
18
+ });
19
+ _columns.map(function (item) {
20
+ columns.push({
21
+ title: item,
22
+ dataIndex: item,
23
+ key: item
24
+ });
25
+ });
26
+ tableData.dataSource = dataSource;
27
+ tableData.columns = columns;
28
+ return tableData;
29
+ };
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: () => JSX.Element;
3
2
  export default _default;
@@ -0,0 +1,23 @@
1
+ import React, { useEffect } from 'react';
2
+ import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
3
+ import { AttributionHome } from '@zgfe/modules-attribution';
4
+ import { requestConfig } from '../../../utils/ajaxConfig';
5
+ var defaultValue = {
6
+ panelId: 438,
7
+ panelType: 'add'
8
+ };
9
+ export default (function () {
10
+ useEffect(function () {
11
+ setGlobalConfig(requestConfig);
12
+ }, []);
13
+ var afterEditTarget = function afterEditTarget(type, data) {
14
+ console.log("".concat(type, "\u56DE\u8C03"), data);
15
+ };
16
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
17
+ needMeta: true,
18
+ defaultApp: 328
19
+ }, /*#__PURE__*/React.createElement(AttributionHome, {
20
+ defaultValue: defaultValue,
21
+ afterEditTarget: afterEditTarget
22
+ }));
23
+ });
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: () => JSX.Element;
3
2
  export default _default;
@@ -0,0 +1,129 @@
1
+ import React, { useEffect } from 'react';
2
+ import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
3
+ import { AttributionHome } from '@zgfe/modules-attribution';
4
+ import { requestConfig } from '../../../utils/ajaxConfig';
5
+ var defaultValue = {
6
+ data: {
7
+ "app_id": 331,
8
+ "module": "attribution",
9
+ "targetFilters": [{
10
+ "eventId": 4024,
11
+ "eventName": "收入",
12
+ "filters": {
13
+ "relation": "and",
14
+ "conditions": [{
15
+ "attrId": 31331,
16
+ "propCategory": "eventProp",
17
+ "type": 2,
18
+ "operator": "gt",
19
+ "values": ["88"],
20
+ "dimensionSub": "event_attr",
21
+ "label": "price",
22
+ "attrName": "price"
23
+ }, {
24
+ "attrId": 31328,
25
+ "propCategory": "eventProp",
26
+ "type": 2,
27
+ "operator": "gt",
28
+ "values": ["99"],
29
+ "dimensionSub": "event_attr",
30
+ "label": "total",
31
+ "attrName": "total"
32
+ }]
33
+ }
34
+ }],
35
+ "sourceFilters": [{
36
+ "eventId": 4023,
37
+ "eventName": "查看商品",
38
+ "filters": {
39
+ "relation": "and",
40
+ "conditions": [{
41
+ "attrId": 31321,
42
+ "propCategory": "eventProp",
43
+ "type": 2,
44
+ "operator": "gt",
45
+ "values": ["77"],
46
+ "dimensionSub": "event_attr",
47
+ "label": "商品价格",
48
+ "attrName": "商品价格"
49
+ }, {
50
+ "attrId": 31332,
51
+ "propCategory": "eventProp",
52
+ "type": 1,
53
+ "operator": "equal",
54
+ "values": ["移动电话"],
55
+ "dimensionSub": "event_attr",
56
+ "label": "商品类型",
57
+ "attrName": "商品类型"
58
+ }]
59
+ },
60
+ "attributionSubdivision": {
61
+ "relation": "and",
62
+ "conditions": {
63
+ "propCategory": "eventProp",
64
+ "type": 1,
65
+ "attrId": 31332
66
+ }
67
+ }
68
+ }, {
69
+ "eventId": 4026,
70
+ "eventName": "加购商品",
71
+ "filters": {
72
+ "relation": "and",
73
+ "conditions": [{
74
+ "attrId": 31334,
75
+ "propCategory": "eventProp",
76
+ "type": 2,
77
+ "operator": "gt",
78
+ "values": ["66"],
79
+ "dimensionSub": "event_attr",
80
+ "label": "商品价格",
81
+ "attrName": "商品价格"
82
+ }, {
83
+ "attrId": 31336,
84
+ "propCategory": "eventProp",
85
+ "type": 1,
86
+ "operator": "equal",
87
+ "values": ["移动电话"],
88
+ "dimensionSub": "event_attr",
89
+ "label": "商品类型",
90
+ "attrName": "商品类型"
91
+ }]
92
+ },
93
+ "attributionSubdivision": {
94
+ "relation": "and",
95
+ "conditions": {
96
+ "propCategory": "eventProp",
97
+ "type": 1,
98
+ "attrId": 31329
99
+ }
100
+ }
101
+ }],
102
+ "attributionType": 3,
103
+ "otherEvent": true,
104
+ "windowCnt": 2,
105
+ "windowType": "hour",
106
+ "time": {
107
+ "unit": "day",
108
+ "relative": [14, 0],
109
+ "begin": "2023-05-29",
110
+ "end": "2023-06-12"
111
+ },
112
+ "chartType": "grid"
113
+ }
114
+ };
115
+ export default (function () {
116
+ useEffect(function () {
117
+ setGlobalConfig(requestConfig);
118
+ }, []);
119
+ var afterEditTarget = function afterEditTarget(type, data) {
120
+ console.log("".concat(type, "\u56DE\u8C03"), data);
121
+ };
122
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
123
+ needMeta: true,
124
+ defaultApp: 331
125
+ }, /*#__PURE__*/React.createElement(AttributionHome, {
126
+ defaultValue: defaultValue,
127
+ afterEditTarget: afterEditTarget
128
+ }));
129
+ });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './styles/index.less';
3
2
  declare const _default: () => JSX.Element;
4
3
  export default _default;
@@ -0,0 +1,19 @@
1
+ import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
2
+ import React, { useEffect } from 'react';
3
+ import { AttributionHome } from '@zgfe/modules-attribution';
4
+ import './styles/index.less';
5
+ import { requestConfig } from '../../../utils/ajaxConfig';
6
+ export default (function () {
7
+ useEffect(function () {
8
+ setGlobalConfig(requestConfig);
9
+ }, []);
10
+ var afterEditTarget = function afterEditTarget(type, data) {
11
+ console.log("".concat(type, "\u56DE\u8C03"), data);
12
+ };
13
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
14
+ needMeta: true,
15
+ defaultApp: 328
16
+ }, /*#__PURE__*/React.createElement(AttributionHome, {
17
+ afterEditTarget: afterEditTarget
18
+ }));
19
+ });
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: () => JSX.Element;
3
2
  export default _default;
@@ -0,0 +1,44 @@
1
+ import React, { useEffect } from 'react';
2
+ import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
3
+ import { AttributionHome } from '@zgfe/modules-attribution';
4
+ import { requestConfig } from '../../../utils/ajaxConfig';
5
+ var defaultValue = {
6
+ source: 'SCENE',
7
+ data: {
8
+ app_id: 177,
9
+ targets: [{
10
+ type: 'event',
11
+ alias: '事件概览',
12
+ eventId: -100,
13
+ eventName: '事件概览',
14
+ eventGroupId: 0,
15
+ analysisDimension: {
16
+ analysisIndex: 'number'
17
+ }
18
+ }],
19
+ userGroup: [0],
20
+ time: {
21
+ unit: 'month',
22
+ relative: [3, 1],
23
+ begin: '2022-09-27',
24
+ end: '2022-12-27'
25
+ },
26
+ chartType: 'line'
27
+ },
28
+ chosen_data: []
29
+ };
30
+ export default (function () {
31
+ useEffect(function () {
32
+ setGlobalConfig(requestConfig);
33
+ }, []);
34
+ var afterEditTarget = function afterEditTarget(type, data) {
35
+ console.log("".concat(type, "\u56DE\u8C03"), data);
36
+ };
37
+ return /*#__PURE__*/React.createElement(DemoWrapper, {
38
+ needMeta: true,
39
+ defaultApp: 21
40
+ }, /*#__PURE__*/React.createElement(AttributionHome, {
41
+ defaultValue: defaultValue,
42
+ afterEditTarget: afterEditTarget
43
+ }));
44
+ });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './styles/index.less';
3
3
  import { AttributionProps } from './types';
4
- declare const ModuleAttribution: React.FC<AttributionProps.Props>;
5
- export default ModuleAttribution;
4
+ declare const AttributionHome: React.FC<AttributionProps.Props>;
5
+ export default AttributionHome;