@zgfe/modules-attribution 1.1.6 → 1.1.13-zhongyuan.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.
- package/es/components/option/index.js +26 -19
- package/es/components/option/styles/index.less +9 -4
- package/es/components/option/types.d.ts +1 -0
- package/es/components/searchTime/index.js +12 -8
- package/es/components/searchTime/styles/index.less +0 -1
- package/es/components/title/index.js +27 -25
- package/es/components/title/searchTitle.js +8 -8
- package/es/components/title/styles/index.less +2 -2
- package/es/modules/chart/demo/index.d.ts +2 -1
- package/es/modules/chart/index.js +42 -16
- package/es/modules/chart/types.d.ts +2 -0
- package/es/modules/content/index.js +65 -15
- package/es/modules/content/styles/index.less +32 -0
- package/es/modules/content/types.d.ts +1 -0
- package/es/modules/content/utils.js +7 -3
- package/es/modules/home/demo/create.d.ts +2 -1
- package/es/modules/home/demo/create.js +1 -1
- package/es/modules/home/demo/edit.d.ts +2 -1
- package/es/modules/home/demo/edit.js +90 -89
- package/es/modules/home/demo/index.d.ts +2 -1
- package/es/modules/home/demo/index.js +5 -1
- package/es/modules/home/demo/scene.d.ts +2 -1
- package/es/modules/home/demo/scene.js +1 -0
- package/es/modules/home/index.js +53 -36
- package/es/modules/home/styles/index.less +1 -1
- package/es/modules/searchPanel/components/attributableEvents.js +15 -14
- package/es/modules/searchPanel/components/globalAttribute.js +16 -14
- package/es/modules/searchPanel/components/index.js +19 -9
- package/es/modules/searchPanel/components/targetEvent.js +11 -9
- package/es/modules/searchPanel/index.js +24 -14
- package/es/modules/searchPanel/styles/index.less +8 -8
- package/es/types.d.ts +5 -0
- package/package.json +3 -3
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
function
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
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(
|
|
7
|
-
function _arrayLikeToArray(
|
|
8
|
-
function _iterableToArrayLimit(
|
|
9
|
-
function _arrayWithHoles(
|
|
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 { BizGlobalDataContext, IconFont, BizAddToScene, BizAddToPanel } from '@zgfe/business-lib';
|
|
11
14
|
import { Button } from 'antd';
|
|
12
15
|
import React, { useContext, useImperativeHandle, useState } from 'react';
|
|
13
16
|
import { chartTypes } from '../../constants';
|
|
14
17
|
import './styles/index.less';
|
|
15
18
|
import { AttributableContext } from '../../types';
|
|
16
|
-
var classPrefix = 'option-group';
|
|
19
|
+
var classPrefix = 'attr-option-group';
|
|
17
20
|
var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
21
|
var searchData = props.searchData,
|
|
19
22
|
_onGetSearchData = props.onGetSearchData;
|
|
@@ -34,9 +37,9 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34
37
|
panelType = _useState8[0],
|
|
35
38
|
setPanelType = _useState8[1];
|
|
36
39
|
var _useContext = useContext(BizGlobalDataContext),
|
|
37
|
-
currentApp = _useContext.currentApp,
|
|
38
40
|
authority = _useContext.authority;
|
|
39
41
|
var _useContext2 = useContext(AttributableContext),
|
|
42
|
+
currentApp = _useContext2.currentApp,
|
|
40
43
|
panelId = _useContext2.panelId,
|
|
41
44
|
panelName = _useContext2.panelName,
|
|
42
45
|
elementId = _useContext2.elementId,
|
|
@@ -90,7 +93,7 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
90
93
|
};
|
|
91
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
95
|
className: classPrefix
|
|
93
|
-
}, !panelId && /*#__PURE__*/React.createElement(Button, {
|
|
96
|
+
}, !panelId && (/*#__PURE__*/React.createElement(Button, {
|
|
94
97
|
disabled: buttonDisable || searching || !authority[100061],
|
|
95
98
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
96
99
|
className: "".concat(classPrefix, "-icon"),
|
|
@@ -100,7 +103,7 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
100
103
|
_onGetSearchData && _onGetSearchData();
|
|
101
104
|
setShowSceneDialog(true);
|
|
102
105
|
}
|
|
103
|
-
}, "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F"), !panelId && /*#__PURE__*/React.createElement(Button, {
|
|
106
|
+
}, "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F")), !panelId && (/*#__PURE__*/React.createElement(Button, {
|
|
104
107
|
disabled: buttonDisable || searching || !authority[100062],
|
|
105
108
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
106
109
|
className: "".concat(classPrefix, "-icon"),
|
|
@@ -110,23 +113,27 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
110
113
|
_onGetSearchData && _onGetSearchData();
|
|
111
114
|
setShowPanelDialog(true);
|
|
112
115
|
}
|
|
113
|
-
}, "\u6DFB\u52A0\u5230\u770B\u677F"), showSceneDialog && /*#__PURE__*/React.createElement(BizAddToScene, {
|
|
114
|
-
params: _objectSpread({
|
|
116
|
+
}, "\u6DFB\u52A0\u5230\u770B\u677F")), showSceneDialog && (/*#__PURE__*/React.createElement(BizAddToScene, {
|
|
117
|
+
params: _objectSpread(_objectSpread({
|
|
115
118
|
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
116
119
|
module: 'attribution'
|
|
117
|
-
}, searchData),
|
|
120
|
+
}, searchData), {}, {
|
|
121
|
+
refresh: false
|
|
122
|
+
}),
|
|
118
123
|
onCancel: function onCancel() {
|
|
119
124
|
return _onCancel('scene');
|
|
120
125
|
},
|
|
121
126
|
onOk: function onOk(data) {
|
|
122
127
|
return _onOk('scene', data);
|
|
123
128
|
}
|
|
124
|
-
}), showPanelDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
129
|
+
})), showPanelDialog && (/*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
125
130
|
defaultValue: panelValue,
|
|
126
|
-
params: _objectSpread({
|
|
131
|
+
params: _objectSpread(_objectSpread({
|
|
127
132
|
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
128
133
|
module: 'attribution'
|
|
129
|
-
}, searchData),
|
|
134
|
+
}, searchData), {}, {
|
|
135
|
+
refresh: false
|
|
136
|
+
}),
|
|
130
137
|
type: panelType,
|
|
131
138
|
styleOptions: chartTypes,
|
|
132
139
|
elementId: elementId,
|
|
@@ -136,6 +143,6 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
136
143
|
onOk: function onOk(data) {
|
|
137
144
|
return _onOk('panel', data);
|
|
138
145
|
}
|
|
139
|
-
}));
|
|
146
|
+
})));
|
|
140
147
|
});
|
|
141
148
|
export default OptionGroup;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
@import '~@zgfe/business-lib/es/assets/styles/variable.less';
|
|
2
2
|
|
|
3
|
-
.option-group {
|
|
3
|
+
.attr-option-group {
|
|
4
4
|
display: flex;
|
|
5
|
+
&-refresh {
|
|
6
|
+
display: flex !important;
|
|
7
|
+
gap: 4px;
|
|
8
|
+
}
|
|
5
9
|
&-icon.bsicon {
|
|
6
10
|
margin-right: @margin-xss;
|
|
7
11
|
font-size: 18px;
|
|
@@ -9,9 +13,10 @@
|
|
|
9
13
|
.ant-btn {
|
|
10
14
|
display: flex;
|
|
11
15
|
align-items: center;
|
|
16
|
+
margin-right: 16px;
|
|
12
17
|
padding: 0 12px;
|
|
13
|
-
&:not(:first-child) {
|
|
14
|
-
|
|
15
|
-
}
|
|
18
|
+
// &:not(:first-child) {
|
|
19
|
+
// margin-left: 16px;
|
|
20
|
+
// }
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
function _slicedToArray(
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
2
|
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."); }
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _arrayLikeToArray(
|
|
5
|
-
function _iterableToArrayLimit(
|
|
6
|
-
function _arrayWithHoles(
|
|
7
|
-
import {
|
|
3
|
+
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; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { BizDatePickerV2 } from '@zgfe/business-lib';
|
|
8
|
+
import { DatePickerTypes } from '@zgfe/business-lib/es/datePickerV2/types';
|
|
8
9
|
import React, { useContext, useState, useEffect } from 'react';
|
|
9
10
|
import { getInitDate } from '../../constants';
|
|
10
11
|
import { AttributableContext } from '../../types';
|
|
@@ -40,9 +41,12 @@ var SearchTime = function SearchTime(props) {
|
|
|
40
41
|
};
|
|
41
42
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
43
|
className: classPrefix
|
|
43
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
+
}, /*#__PURE__*/React.createElement(BizDatePickerV2, {
|
|
44
45
|
value: time,
|
|
45
|
-
onChange: onChangeTime
|
|
46
|
+
onChange: onChangeTime,
|
|
47
|
+
dateTypeList: [DatePickerTypes.Unit.day],
|
|
48
|
+
selectRange: 365,
|
|
49
|
+
selectRangeUnit: "days"
|
|
46
50
|
}));
|
|
47
51
|
};
|
|
48
52
|
export default SearchTime;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["title", "type", "onSave", "onSaveAs"];
|
|
2
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
3
|
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."); }
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _arrayLikeToArray(
|
|
5
|
-
function _iterableToArrayLimit(
|
|
6
|
-
function _arrayWithHoles(
|
|
4
|
+
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; } }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
7
10
|
import { Input, Menu, Dropdown, Button, message } from 'antd';
|
|
8
11
|
import React, { useContext, useRef, useState } from 'react';
|
|
9
12
|
import { ajax, IconFont } from '@zgfe/business-lib';
|
|
@@ -11,19 +14,14 @@ import './styles/index.less';
|
|
|
11
14
|
import Apis from '../../constants/apis';
|
|
12
15
|
import { AttributableContext } from '../../types';
|
|
13
16
|
var classPrefix = 'attribution-title';
|
|
14
|
-
var EditTitle = function EditTitle(
|
|
15
|
-
var title =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setCurTitle = _useState2[1];
|
|
23
|
-
var _useState3 = useState(title),
|
|
24
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
|
-
prevTitle = _useState4[0],
|
|
26
|
-
setPrevTitle = _useState4[1];
|
|
17
|
+
var EditTitle = function EditTitle(_ref) {
|
|
18
|
+
var _ref$title = _ref.title,
|
|
19
|
+
title = _ref$title === void 0 ? '归因' : _ref$title,
|
|
20
|
+
_ref$type = _ref.type,
|
|
21
|
+
type = _ref$type === void 0 ? 'edit' : _ref$type,
|
|
22
|
+
onSave = _ref.onSave,
|
|
23
|
+
onSaveAs = _ref.onSaveAs,
|
|
24
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
25
|
var _useContext = useContext(AttributableContext),
|
|
28
26
|
panelId = _useContext.panelId,
|
|
29
27
|
elementId = _useContext.elementId,
|
|
@@ -34,6 +32,14 @@ var EditTitle = function EditTitle(props) {
|
|
|
34
32
|
buttonDisable = _useContext.buttonDisable,
|
|
35
33
|
panelDisabled = _useContext.panelDisabled;
|
|
36
34
|
var inputRef = useRef(null);
|
|
35
|
+
var _useState = useState(title),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
curTitle = _useState2[0],
|
|
38
|
+
setCurTitle = _useState2[1];
|
|
39
|
+
var _useState3 = useState(title),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
prevTitle = _useState4[0],
|
|
42
|
+
setPrevTitle = _useState4[1];
|
|
37
43
|
var menu = /*#__PURE__*/React.createElement(Menu, {
|
|
38
44
|
items: [{
|
|
39
45
|
key: '1',
|
|
@@ -136,7 +142,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
136
142
|
onChange: onChange
|
|
137
143
|
}), !curTitle ? /*#__PURE__*/React.createElement("span", {
|
|
138
144
|
className: "".concat(classPrefix, "-error-tip")
|
|
139
|
-
}, "\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A") : null)), type === 'edit' ? /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
}, "\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A") : null)), type === 'edit' ? (/*#__PURE__*/React.createElement("div", {
|
|
140
146
|
className: "".concat(classPrefix, "-option")
|
|
141
147
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
142
148
|
overlayClassName: "".concat(classPrefix, "-dropdown"),
|
|
@@ -167,7 +173,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
167
173
|
disabled: panelDisabled || buttonDisable || searching,
|
|
168
174
|
type: "primary",
|
|
169
175
|
onClick: onSaveAs
|
|
170
|
-
}, "\u53E6\u5B58\u4E3A")) : /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
}, "\u53E6\u5B58\u4E3A"))) : (/*#__PURE__*/React.createElement("div", {
|
|
171
177
|
className: "".concat(classPrefix, "-title-btn")
|
|
172
178
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
173
179
|
className: "attribution-btn",
|
|
@@ -180,10 +186,6 @@ var EditTitle = function EditTitle(props) {
|
|
|
180
186
|
disabled: panelDisabled || buttonDisable || searching || !curTitle,
|
|
181
187
|
type: "primary",
|
|
182
188
|
onClick: onSaveAs
|
|
183
|
-
}, "\u4FDD\u5B58")));
|
|
184
|
-
};
|
|
185
|
-
EditTitle.defaultProps = {
|
|
186
|
-
title: '归因',
|
|
187
|
-
type: 'edit'
|
|
189
|
+
}, "\u4FDD\u5B58"))));
|
|
188
190
|
};
|
|
189
191
|
export default EditTitle;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _slicedToArray(
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
2
|
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."); }
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _arrayLikeToArray(
|
|
5
|
-
function _iterableToArrayLimit(
|
|
6
|
-
function _arrayWithHoles(
|
|
3
|
+
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; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
import { SearchOutlined } from '@ant-design/icons';
|
|
9
9
|
import './styles/search.less';
|
|
@@ -33,15 +33,15 @@ var SearchTitle = function SearchTitle(props) {
|
|
|
33
33
|
className: classPrefix
|
|
34
34
|
}, /*#__PURE__*/React.createElement("span", {
|
|
35
35
|
className: "".concat(classPrefix, "-title")
|
|
36
|
-
}, props.title), isSearch ? /*#__PURE__*/React.createElement(BizSearchInput, {
|
|
36
|
+
}, props.title), isSearch ? (/*#__PURE__*/React.createElement(BizSearchInput, {
|
|
37
37
|
className: "".concat(classPrefix, "-input"),
|
|
38
38
|
onChange: onSearch,
|
|
39
39
|
onBlur: onBlur
|
|
40
|
-
}) : /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
40
|
+
})) : (/*#__PURE__*/React.createElement(SearchOutlined, {
|
|
41
41
|
className: "".concat(classPrefix, "-icon"),
|
|
42
42
|
onClick: function onClick() {
|
|
43
43
|
return setIsSearch(true);
|
|
44
44
|
}
|
|
45
|
-
}));
|
|
45
|
+
})));
|
|
46
46
|
};
|
|
47
47
|
export default SearchTitle;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
.btn-back {
|
|
19
19
|
margin-right: 8px;
|
|
20
|
-
color: #
|
|
20
|
+
color: #5f6085;
|
|
21
21
|
}
|
|
22
22
|
&-container {
|
|
23
23
|
position: relative;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
height: @height-base;
|
|
29
29
|
color: @text-color;
|
|
30
30
|
font-weight: 600;
|
|
31
|
-
font-size:16px;
|
|
31
|
+
font-size: 16px;
|
|
32
32
|
background: @white !important;
|
|
33
33
|
border: 1px solid transparent;
|
|
34
34
|
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
function
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
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(
|
|
7
|
-
function _arrayLikeToArray(
|
|
8
|
-
function _iterableToArrayLimit(
|
|
9
|
-
function _arrayWithHoles(
|
|
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$
|
|
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;
|