@zgfe/modules-attribution 1.1.6 → 1.1.13-zhongyuan.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 (41) hide show
  1. package/README.md +35 -35
  2. package/es/components/common/styles/index.less +27 -27
  3. package/es/components/option/index.js +26 -19
  4. package/es/components/option/styles/index.less +22 -17
  5. package/es/components/option/types.d.ts +1 -0
  6. package/es/components/searchTime/index.js +12 -8
  7. package/es/components/searchTime/styles/index.less +18 -19
  8. package/es/components/tableList/styles/index.less +18 -18
  9. package/es/components/title/index.js +27 -25
  10. package/es/components/title/searchTitle.js +8 -8
  11. package/es/components/title/styles/index.less +84 -84
  12. package/es/components/title/styles/search.less +27 -27
  13. package/es/images/empty.png +0 -0
  14. package/es/modules/chart/demo/index.d.ts +2 -1
  15. package/es/modules/chart/index.js +42 -16
  16. package/es/modules/chart/types.d.ts +2 -0
  17. package/es/modules/content/index.js +65 -15
  18. package/es/modules/content/styles/index.less +39 -7
  19. package/es/modules/content/types.d.ts +1 -0
  20. package/es/modules/content/utils.js +7 -3
  21. package/es/modules/home/demo/create.d.ts +2 -1
  22. package/es/modules/home/demo/create.js +1 -1
  23. package/es/modules/home/demo/edit.d.ts +2 -1
  24. package/es/modules/home/demo/edit.js +90 -89
  25. package/es/modules/home/demo/index.d.ts +2 -1
  26. package/es/modules/home/demo/index.js +5 -1
  27. package/es/modules/home/demo/scene.d.ts +2 -1
  28. package/es/modules/home/demo/scene.js +1 -0
  29. package/es/modules/home/demo/styles/index.less +33 -33
  30. package/es/modules/home/index.js +53 -36
  31. package/es/modules/home/styles/index.less +68 -68
  32. package/es/modules/searchPanel/components/attributableEvents.js +15 -14
  33. package/es/modules/searchPanel/components/globalAttribute.js +16 -14
  34. package/es/modules/searchPanel/components/index.js +19 -9
  35. package/es/modules/searchPanel/components/targetEvent.js +11 -9
  36. package/es/modules/searchPanel/index.js +25 -17
  37. package/es/modules/searchPanel/styles/index.less +226 -226
  38. package/es/style/image/ring.svg +8 -8
  39. package/es/style/index.less +47 -47
  40. package/es/types.d.ts +5 -0
  41. package/package.json +3 -3
@@ -1,84 +1,84 @@
1
- @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
-
3
- .attribution-title {
4
- display: flex;
5
- align-items: center;
6
- justify-content: space-between;
7
- width: 100%;
8
- height: 64px;
9
- padding: 0 24px;
10
- background: #fff;
11
-
12
- &-option {
13
- display: flex;
14
- align-items: center;
15
- }
16
- &-input-box {
17
- white-space: nowrap;
18
- .btn-back {
19
- margin-right: 8px;
20
- color: #5F6085;
21
- }
22
- &-container {
23
- position: relative;
24
- display: inline-block;
25
- height: 100%;
26
- }
27
- &-content {
28
- height: @height-base;
29
- color: @text-color;
30
- font-weight: 600;
31
- font-size:16px;
32
- background: @white !important;
33
- border: 1px solid transparent;
34
-
35
- &:hover,
36
- &:focus {
37
- // border-color: @primary-color;
38
- }
39
- }
40
- }
41
- &-error-tip {
42
- position: absolute;
43
- top: 100%;
44
- left: 0;
45
- color: @error-color;
46
- line-height: 1.2;
47
- }
48
- &-dropdown {
49
- .ant-dropdown-menu-item:hover span {
50
- // color: @primary-color;
51
- }
52
-
53
- .ant-dropdown-menu-item-icon {
54
- font-size: 16px;
55
- }
56
- }
57
- /*更多按钮*/
58
- &-pop-btn {
59
- width: @height-base;
60
- height: @height-base;
61
- color: @text-color-secondary;
62
- font-size: 16px;
63
- line-height: @height-base;
64
- text-align: center;
65
- border-radius: @border-radius-small;
66
- transform: rotate(90deg);
67
-
68
- &:hover {
69
- .__default-hover();
70
- }
71
- }
72
- }
73
-
74
- .attribution-btn {
75
- margin-right: 16px;
76
- border-radius: @border-radius-small;
77
- }
78
-
79
- .attribution-divider {
80
- width: 1px;
81
- height: @height-base;
82
- margin: 0 32px;
83
- background: @border-color-base;
84
- }
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+
3
+ .attribution-title {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: space-between;
7
+ width: 100%;
8
+ height: 64px;
9
+ padding: 0 24px;
10
+ background: #fff;
11
+
12
+ &-option {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+ &-input-box {
17
+ white-space: nowrap;
18
+ .btn-back {
19
+ margin-right: 8px;
20
+ color: #5f6085;
21
+ }
22
+ &-container {
23
+ position: relative;
24
+ display: inline-block;
25
+ height: 100%;
26
+ }
27
+ &-content {
28
+ height: @height-base;
29
+ color: @text-color;
30
+ font-weight: 600;
31
+ font-size: 16px;
32
+ background: @white !important;
33
+ border: 1px solid transparent;
34
+
35
+ &:hover,
36
+ &:focus {
37
+ // border-color: @primary-color;
38
+ }
39
+ }
40
+ }
41
+ &-error-tip {
42
+ position: absolute;
43
+ top: 100%;
44
+ left: 0;
45
+ color: @error-color;
46
+ line-height: 1.2;
47
+ }
48
+ &-dropdown {
49
+ .ant-dropdown-menu-item:hover span {
50
+ // color: @primary-color;
51
+ }
52
+
53
+ .ant-dropdown-menu-item-icon {
54
+ font-size: 16px;
55
+ }
56
+ }
57
+ /*更多按钮*/
58
+ &-pop-btn {
59
+ width: @height-base;
60
+ height: @height-base;
61
+ color: @text-color-secondary;
62
+ font-size: 16px;
63
+ line-height: @height-base;
64
+ text-align: center;
65
+ border-radius: @border-radius-small;
66
+ transform: rotate(90deg);
67
+
68
+ &:hover {
69
+ .__default-hover();
70
+ }
71
+ }
72
+ }
73
+
74
+ .attribution-btn {
75
+ margin-right: 16px;
76
+ border-radius: @border-radius-small;
77
+ }
78
+
79
+ .attribution-divider {
80
+ width: 1px;
81
+ height: @height-base;
82
+ margin: 0 32px;
83
+ background: @border-color-base;
84
+ }
@@ -1,27 +1,27 @@
1
- @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
-
3
- .search-title {
4
- display: flex;
5
- align-items: center;
6
- height: 24px;
7
- transition: all 0.3s;
8
-
9
- &-title {
10
- margin-right: 15px;
11
- }
12
-
13
- &-input {
14
- min-width: 100px;
15
- max-width: 200px;
16
- height: 24px;
17
- background-color: #fff !important;
18
- .ant-input {
19
- background-color: #fff !important;
20
- }
21
- }
22
-
23
- &-icon {
24
- color: #5f6085;
25
- font-size: 12px;
26
- }
27
- }
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+
3
+ .search-title {
4
+ display: flex;
5
+ align-items: center;
6
+ height: 24px;
7
+ transition: all 0.3s;
8
+
9
+ &-title {
10
+ margin-right: 15px;
11
+ }
12
+
13
+ &-input {
14
+ min-width: 100px;
15
+ max-width: 200px;
16
+ height: 24px;
17
+ background-color: #fff !important;
18
+ .ant-input {
19
+ background-color: #fff !important;
20
+ }
21
+ }
22
+
23
+ &-icon {
24
+ color: #5f6085;
25
+ font-size: 12px;
26
+ }
27
+ }
File without changes
@@ -1,2 +1,3 @@
1
- declare const _default: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
2
3
  export default _default;
@@ -1,17 +1,20 @@
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(); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
5
8
  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; }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
10
13
  import React, { useContext, useEffect, useState } from 'react';
14
+ import { BizEmpty, BizGlobalDataContext, BizLoading } from '@zgfe/business-lib';
11
15
  import { Empty } from 'antd';
12
16
  import request from '../../utils/request';
13
17
  import { Apis } from '../../constants';
14
- import { BizGlobalDataContext } from '@zgfe/business-lib';
15
18
  import { TableList } from '../../components';
16
19
  import { handleTableData } from '../content/utils';
17
20
  var AttributeChart = function AttributeChart(props) {
@@ -29,6 +32,8 @@ var AttributeChart = function AttributeChart(props) {
29
32
  setTotal = _useState6[1];
30
33
  var _useContext = useContext(BizGlobalDataContext),
31
34
  currentApp = _useContext.currentApp;
35
+ var refreshLoading = props.refreshLoading,
36
+ setRefreshLoading = props.setRefreshLoading;
32
37
  useEffect(function () {
33
38
  if (!props.params || props.params.sourceFilters[0].eventId === -100) return;
34
39
  fetchRequest();
@@ -37,18 +42,18 @@ var AttributeChart = function AttributeChart(props) {
37
42
  props.onChangeLoading && props.onChangeLoading(loading);
38
43
  }, [loading]);
39
44
  var fetchRequest = function fetchRequest() {
40
- var _props$params;
41
- setLoading(true);
45
+ var _props$params, _props$params2;
46
+ if (!((_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.refresh)) setLoading(true);
42
47
  request(Apis.getAnalyseData, {
43
48
  method: 'post',
44
49
  data: _objectSpread(_objectSpread({
45
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
46
- platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
50
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
47
51
  }, props.params), {}, {
48
52
  searchType: props.searchType,
49
- targetFilters: (_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.targetFilters[0]
53
+ targetFilters: (_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.targetFilters[0]
50
54
  })
51
55
  }).then(function (res) {
56
+ setRefreshLoading && setRefreshLoading(false);
52
57
  if (res === null || res === void 0 ? void 0 : res.data) {
53
58
  var _data = handleTableData(res === null || res === void 0 ? void 0 : res.data);
54
59
  setTableDataList(_data);
@@ -61,6 +66,28 @@ var AttributeChart = function AttributeChart(props) {
61
66
  setLoading(false);
62
67
  });
63
68
  };
69
+ if (loading || refreshLoading) {
70
+ return /*#__PURE__*/React.createElement(BizLoading, null);
71
+ }
72
+ if (tableDataList.delEvent) {
73
+ return /*#__PURE__*/React.createElement("div", {
74
+ style: {
75
+ display: 'flex',
76
+ minHeight: 345,
77
+ justifyContent: 'center',
78
+ alignItems: 'center'
79
+ }
80
+ }, /*#__PURE__*/React.createElement(BizEmpty, {
81
+ imageStyle: {
82
+ height: 58
83
+ },
84
+ description: /*#__PURE__*/React.createElement("span", {
85
+ style: {
86
+ color: '#9AA1A9'
87
+ }
88
+ }, "\u4E8B\u4EF6\u5DF2\u88AB\u5220\u9664\u65E0\u6CD5\u67E5\u770B\uFF0C\u8BF7\u91CD\u65B0\u8BBE\u7F6E")
89
+ }));
90
+ }
64
91
  if (!(tableDataList === null || tableDataList === void 0 ? void 0 : tableDataList.dataSource) || !tableDataList.dataSource.length || !tableDataList.columns.length) {
65
92
  return /*#__PURE__*/React.createElement(Empty, {
66
93
  image: Empty.PRESENTED_IMAGE_SIMPLE,
@@ -69,8 +96,7 @@ var AttributeChart = function AttributeChart(props) {
69
96
  }
70
97
  return /*#__PURE__*/React.createElement(TableList, {
71
98
  total: total,
72
- tableDataList: tableDataList,
73
- loading: loading
99
+ tableDataList: tableDataList
74
100
  });
75
101
  };
76
102
  export default AttributeChart;
@@ -1,6 +1,8 @@
1
1
  import { SearchValueProps } from "../../types";
2
2
  export declare namespace AttributeChartTypes {
3
3
  interface Props {
4
+ refreshLoading?: boolean;
5
+ setRefreshLoading?: Function;
4
6
  params?: SearchValueProps;
5
7
  onChangeLoading?: (isLoading: boolean) => void;
6
8
  searchType?: number;
@@ -1,17 +1,23 @@
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(); }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
5
8
  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 React, { useEffect, useState, useRef } from 'react';
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import React, { useEffect, useState, useRef, useContext } from 'react';
14
+ import { BizPlatformSelector, IconFont } from '@zgfe/business-lib';
11
15
  import SearchPanel from '../searchPanel';
12
16
  import './styles/index.less';
13
17
  import { OptionGroup, SearchTime } from '../../components';
14
18
  import AttributeChart from '../chart';
19
+ import { AttributableContext } from '../../types';
20
+ import { Button } from 'antd';
15
21
  var classPrefix = 'attribution-content';
16
22
  var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
17
23
  var _useState = useState(props.value),
@@ -30,6 +36,15 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
30
36
  _useState8 = _slicedToArray(_useState7, 2),
31
37
  params = _useState8[0],
32
38
  setParams = _useState8[1];
39
+ var _useState9 = useState((searchData === null || searchData === void 0 ? void 0 : searchData.platform) === undefined ? 0 : searchData.platform),
40
+ _useState10 = _slicedToArray(_useState9, 2),
41
+ selectPlatform = _useState10[0],
42
+ setselectPlatform = _useState10[1];
43
+ var _useContext = useContext(AttributableContext),
44
+ refreshLoading = _useContext.refreshLoading,
45
+ setRefreshLoading = _useContext.setRefreshLoading,
46
+ buttonDisable = _useContext.buttonDisable,
47
+ searching = _useContext.searching;
33
48
  useEffect(function () {
34
49
  if (searchData.sourceFilters && searchData.sourceFilters[0].eventId === -100) return;
35
50
  if (!isFetchRequest) return;
@@ -52,6 +67,13 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
52
67
  return _objectSpread(_objectSpread({}, value), data);
53
68
  });
54
69
  };
70
+ var onPlatformChange = function onPlatformChange(platform) {
71
+ setSearchData(function (value) {
72
+ return _objectSpread(_objectSpread({}, value), {}, {
73
+ platform: platform
74
+ });
75
+ });
76
+ };
55
77
  var SearchPanelRef = useRef(null);
56
78
  var onGetSearchData = function onGetSearchData() {
57
79
  if (SearchPanelRef) {
@@ -65,11 +87,31 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
65
87
  });
66
88
  });
67
89
  };
90
+ var refreshHandle = function refreshHandle() {
91
+ SearchPanelRef.current.refresh();
92
+ };
68
93
  return /*#__PURE__*/React.createElement("div", {
69
94
  className: classPrefix
70
95
  }, /*#__PURE__*/React.createElement("div", {
71
96
  className: "".concat(classPrefix, "-top-content")
72
97
  }, /*#__PURE__*/React.createElement("div", {
98
+ className: "".concat(classPrefix, "-top-content-head")
99
+ }, /*#__PURE__*/React.createElement("div", {
100
+ className: "".concat(classPrefix, "-top-content-head-title")
101
+ }, !props.panelId ? '归因' : ''), /*#__PURE__*/React.createElement("div", {
102
+ className: "".concat(classPrefix, "-top-content-head-right")
103
+ }, searchData && (/*#__PURE__*/React.createElement(OptionGroup, {
104
+ refreshHandle: refreshHandle,
105
+ ref: ref,
106
+ searchData: searchData,
107
+ onGetSearchData: onGetSearchData
108
+ })), /*#__PURE__*/React.createElement(BizPlatformSelector, {
109
+ value: selectPlatform,
110
+ onChange: function onChange(val) {
111
+ setselectPlatform(val.key);
112
+ onPlatformChange(val.key);
113
+ }
114
+ }))), /*#__PURE__*/React.createElement("div", {
73
115
  className: "".concat(classPrefix, "-top-content-box")
74
116
  }, /*#__PURE__*/React.createElement(SearchPanel, {
75
117
  ref: SearchPanelRef,
@@ -83,14 +125,22 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
83
125
  }, /*#__PURE__*/React.createElement(SearchTime, {
84
126
  time: searchData === null || searchData === void 0 ? void 0 : searchData.time,
85
127
  onChange: onChangeContent
86
- }), searchData && /*#__PURE__*/React.createElement(OptionGroup, {
87
- ref: ref,
88
- searchData: searchData,
89
- onGetSearchData: onGetSearchData
90
- })), /*#__PURE__*/React.createElement(AttributeChart, {
128
+ }), /*#__PURE__*/React.createElement(Button, {
129
+ className: "".concat(classPrefix, "-refresh"),
130
+ disabled: buttonDisable || searching,
131
+ loading: refreshLoading,
132
+ icon: /*#__PURE__*/React.createElement(IconFont, {
133
+ type: "zhongxinjiazai"
134
+ }),
135
+ onClick: function onClick() {
136
+ return refreshHandle();
137
+ }
138
+ }, "\u5237\u65B0")), /*#__PURE__*/React.createElement(AttributeChart, {
91
139
  params: params,
92
140
  onChangeLoading: setLoading,
93
- searchType: 0
141
+ searchType: 0,
142
+ refreshLoading: refreshLoading,
143
+ setRefreshLoading: setRefreshLoading
94
144
  })));
95
145
  });
96
146
  export default AttributionContent;
@@ -1,7 +1,39 @@
1
- // .attribution-content {
2
- // &-options {
3
- // display: flex;
4
- // justify-content: flex-end;
5
- // // margin-bottom: 16px;
6
- // }
7
- // }
1
+ // .attribution-content {
2
+ // &-options {
3
+ // display: flex;
4
+ // justify-content: flex-end;
5
+ // // margin-bottom: 16px;
6
+ // }
7
+ // }
8
+ .attribution-container-content {
9
+ border-top: none;
10
+ }
11
+ .attribution-content {
12
+ &-top-content {
13
+ padding-top: 0 !important;
14
+ &-head {
15
+ background: #fafafb;
16
+ width: 100%;
17
+ display: flex;
18
+ justify-content: space-between;
19
+ align-items: center;
20
+ padding: 8px 0;
21
+ &-title {
22
+ color: var(--io-N-, #021429);
23
+ font-weight: 500;
24
+ font-size: 16px;
25
+ font-family: 'PingFang SC';
26
+ font-style: normal;
27
+ line-height: 20px; /* 125% */
28
+ letter-spacing: 0.016px;
29
+ }
30
+ &-right {
31
+ display: flex;
32
+ .option-group {
33
+ margin-right: 16px;
34
+ }
35
+ }
36
+ }
37
+ }
38
+
39
+ }
@@ -4,5 +4,6 @@ export declare namespace attributionContentProps {
4
4
  value: SearchValueProps;
5
5
  show?: string[];
6
6
  onSearching?: (flag: boolean) => void;
7
+ panelId?: number;
7
8
  }
8
9
  }
@@ -1,6 +1,9 @@
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; }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
7
  import { nanoid } from 'nanoid';
5
8
  export var handleTableData = function handleTableData(data) {
6
9
  var tableData = {};
@@ -25,5 +28,6 @@ export var handleTableData = function handleTableData(data) {
25
28
  });
26
29
  tableData.dataSource = dataSource;
27
30
  tableData.columns = columns;
31
+ tableData.delEvent = data.delEvent;
28
32
  return tableData;
29
33
  };
@@ -1,2 +1,3 @@
1
- declare const _default: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
2
3
  export default _default;
@@ -15,7 +15,7 @@ export default (function () {
15
15
  };
16
16
  return /*#__PURE__*/React.createElement(DemoWrapper, {
17
17
  needMeta: true,
18
- defaultApp: 328
18
+ defaultApp: 461
19
19
  }, /*#__PURE__*/React.createElement(AttributionHome, {
20
20
  defaultValue: defaultValue,
21
21
  afterEditTarget: afterEditTarget
@@ -1,2 +1,3 @@
1
- declare const _default: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
2
3
  export default _default;