@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.
- package/README.md +4 -2
- package/{dist/esm → es}/components/common/index.js +1 -5
- package/es/components/index.d.ts +5 -0
- package/es/components/index.js +5 -0
- package/es/components/option/index.js +141 -0
- package/{dist/esm → es}/components/option/styles/index.less +1 -1
- package/es/components/option/types.d.ts +5 -0
- package/{dist/esm/components/searchPanel → es/components/searchTime}/index.d.ts +2 -2
- package/es/components/searchTime/index.js +49 -0
- package/es/components/searchTime/styles/index.less +19 -0
- package/{dist/esm/components/searchPanel → es/components/searchTime}/types.d.ts +0 -2
- package/es/components/tableList/index.d.ts +8 -0
- package/es/components/tableList/index.js +32 -0
- package/es/components/tableList/styles/index.less +18 -0
- package/{dist/esm → es}/components/title/index.js +31 -27
- package/{dist/esm → es}/components/title/searchTitle.js +3 -3
- package/{dist/esm → es}/components/title/styles/index.less +22 -10
- package/es/constants/apis.d.ts +6 -0
- package/es/constants/apis.js +6 -0
- package/es/constants/fields.d.ts +11 -0
- package/es/constants/fields.js +45 -0
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.js +4 -0
- package/{dist/esm → es}/constants/initData.js +0 -6
- package/es/images/empty.png +0 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +2 -0
- package/es/modules/content/index.d.ts +5 -0
- package/es/modules/content/index.js +134 -0
- package/es/modules/content/styles/index.less +7 -0
- package/es/modules/content/types.d.ts +8 -0
- package/es/modules/content/utils.d.ts +2 -0
- package/es/modules/content/utils.js +29 -0
- package/{dist/esm → es}/modules/home/demo/create.d.ts +0 -1
- package/es/modules/home/demo/create.js +23 -0
- package/{dist/esm → es}/modules/home/demo/edit.d.ts +0 -1
- package/es/modules/home/demo/edit.js +129 -0
- package/{dist/esm → es}/modules/home/demo/index.d.ts +0 -1
- package/es/modules/home/demo/index.js +19 -0
- package/{dist/esm → es}/modules/home/demo/scene.d.ts +0 -1
- package/es/modules/home/demo/scene.js +44 -0
- package/{dist/esm → es}/modules/home/index.d.ts +2 -2
- package/{dist/esm → es}/modules/home/index.js +35 -73
- package/es/modules/home/styles/index.less +68 -0
- package/{dist/esm → es}/modules/home/types.d.ts +1 -4
- package/es/modules/searchPanel/components/attributableEvents.d.ts +4 -0
- package/es/modules/searchPanel/components/attributableEvents.js +290 -0
- package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.d.ts +3 -1
- package/{dist/esm/modules/leftPanel → es/modules/searchPanel}/components/globalAttribute.js +19 -19
- package/es/modules/searchPanel/components/index.d.ts +4 -0
- package/es/modules/searchPanel/components/index.js +21 -0
- package/es/modules/searchPanel/components/targetEvent.d.ts +4 -0
- package/es/modules/searchPanel/components/targetEvent.js +159 -0
- package/es/modules/searchPanel/index.d.ts +6 -0
- package/es/modules/searchPanel/index.js +398 -0
- package/es/modules/searchPanel/styles/index.less +226 -0
- package/es/modules/searchPanel/types.d.ts +49 -0
- package/es/modules/searchPanel/utils.d.ts +8 -0
- package/es/modules/searchPanel/utils.js +81 -0
- package/{dist/esm → es}/style/index.less +2 -2
- package/{dist/esm → es}/style/theme.js +0 -2
- package/es/types.d.ts +52 -0
- package/es/types.js +2 -0
- package/{dist/esm → es}/utils/ajaxConfig.js +0 -7
- package/es/utils/request.d.ts +3 -0
- package/es/utils/request.js +5 -0
- package/{dist/esm → es}/utils/util.js +4 -42
- package/package.json +21 -21
- package/dist/esm/components/index.d.ts +0 -6
- package/dist/esm/components/index.js +0 -6
- package/dist/esm/components/option/index.js +0 -222
- package/dist/esm/components/option/types.d.ts +0 -9
- package/dist/esm/components/renderContent/index.d.ts +0 -5
- package/dist/esm/components/renderContent/index.js +0 -92
- package/dist/esm/components/renderContent/styles/index.less +0 -21
- package/dist/esm/components/renderContent/types.d.ts +0 -15
- package/dist/esm/components/searchPanel/index.js +0 -124
- package/dist/esm/components/searchPanel/styles/index.less +0 -44
- package/dist/esm/components/showList/index.d.ts +0 -10
- package/dist/esm/components/showList/index.js +0 -92
- package/dist/esm/components/showList/listPanel.d.ts +0 -9
- package/dist/esm/components/showList/listPanel.js +0 -118
- package/dist/esm/components/showList/styles/index.less +0 -75
- package/dist/esm/components/showList/types.d.ts +0 -9
- package/dist/esm/components/table/index.d.ts +0 -5
- package/dist/esm/components/table/index.js +0 -194
- package/dist/esm/components/table/styles/index.less +0 -12
- package/dist/esm/components/table/types.d.ts +0 -11
- package/dist/esm/constants/apis.d.ts +0 -9
- package/dist/esm/constants/apis.js +0 -9
- package/dist/esm/constants/chart.d.ts +0 -2
- package/dist/esm/constants/chart.js +0 -24
- package/dist/esm/constants/color.d.ts +0 -1
- package/dist/esm/constants/color.js +0 -1
- package/dist/esm/constants/fields.d.ts +0 -218
- package/dist/esm/constants/fields.js +0 -242
- package/dist/esm/constants/index.d.ts +0 -6
- package/dist/esm/constants/index.js +0 -6
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/modules/content/index.d.ts +0 -5
- package/dist/esm/modules/content/index.js +0 -218
- package/dist/esm/modules/content/styles/index.less +0 -7
- package/dist/esm/modules/content/types.d.ts +0 -8
- package/dist/esm/modules/content/types.js +0 -2
- package/dist/esm/modules/content/utiles.d.ts +0 -12
- package/dist/esm/modules/content/utiles.js +0 -231
- package/dist/esm/modules/home/demo/create.js +0 -54
- package/dist/esm/modules/home/demo/edit.js +0 -80
- package/dist/esm/modules/home/demo/index.js +0 -52
- package/dist/esm/modules/home/demo/scene.js +0 -74
- package/dist/esm/modules/home/styles/index.less +0 -37
- package/dist/esm/modules/home/types.js +0 -2
- package/dist/esm/modules/leftPanel/components/panel.d.ts +0 -4
- package/dist/esm/modules/leftPanel/components/panel.js +0 -92
- package/dist/esm/modules/leftPanel/demo/index.d.ts +0 -3
- package/dist/esm/modules/leftPanel/demo/index.js +0 -28
- package/dist/esm/modules/leftPanel/index.d.ts +0 -6
- package/dist/esm/modules/leftPanel/index.js +0 -285
- package/dist/esm/modules/leftPanel/styles/index.less +0 -55
- package/dist/esm/modules/leftPanel/types.d.ts +0 -27
- package/dist/esm/modules/leftPanel/types.js +0 -2
- package/dist/esm/modules/leftPanel/utils.d.ts +0 -5
- package/dist/esm/modules/leftPanel/utils.js +0 -262
- package/dist/esm/types.d.ts +0 -46
- package/dist/esm/types.js +0 -2
- package/dist/esm/utils/base64.d.ts +0 -23
- package/dist/esm/utils/base64.js +0 -132
- package/dist/esm/utils/formData.d.ts +0 -18
- package/dist/esm/utils/formData.js +0 -485
- package/dist/esm/utils/transfer.d.ts +0 -65
- package/dist/esm/utils/transfer.js +0 -206
- /package/{dist/esm → es}/components/common/index.d.ts +0 -0
- /package/{dist/esm → es}/components/common/styles/index.less +0 -0
- /package/{dist/esm → es}/components/option/index.d.ts +0 -0
- /package/{dist/esm → es}/components/option/types.js +0 -0
- /package/{dist/esm/components/renderContent → es/components/searchTime}/types.js +0 -0
- /package/{dist/esm → es}/components/title/index.d.ts +0 -0
- /package/{dist/esm → es}/components/title/searchTitle.d.ts +0 -0
- /package/{dist/esm → es}/components/title/styles/search.less +0 -0
- /package/{dist/esm → es}/components/title/types.d.ts +0 -0
- /package/{dist/esm/components/searchPanel → es/components/title}/types.js +0 -0
- /package/{dist/esm → es}/constants/initData.d.ts +0 -0
- /package/{dist/esm/components/showList → es/modules/content}/types.js +0 -0
- /package/{dist/esm → es}/modules/home/demo/styles/index.less +0 -0
- /package/{dist/esm/components/table → es/modules/home}/types.js +0 -0
- /package/{dist/esm/components/title → es/modules/searchPanel}/types.js +0 -0
- /package/{dist/esm → es}/style/image/noData.png +0 -0
- /package/{dist/esm → es}/style/image/ring.svg +0 -0
- /package/{dist/esm → es}/style/theme.d.ts +0 -0
- /package/{dist/esm → es}/utils/ajaxConfig.d.ts +0 -0
- /package/{dist/esm → es}/utils/util.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import './styles/index.less';
|
|
3
3
|
var classPrefix = 'mi-common';
|
|
4
|
-
|
|
5
|
-
// 加载按钮
|
|
6
4
|
export var MiSpin = function MiSpin() {
|
|
7
5
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
6
|
className: "".concat(classPrefix, "-loading-icon")
|
|
9
7
|
});
|
|
10
8
|
};
|
|
11
|
-
|
|
12
|
-
// 无数据状态
|
|
13
9
|
export var MiNone = function MiNone(props) {
|
|
14
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
15
11
|
className: "".concat(classPrefix, "-none-container")
|
|
@@ -0,0 +1,141 @@
|
|
|
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, IconFont, BizAddToScene, BizAddToPanel } from '@zgfe/business-lib';
|
|
11
|
+
import { Button } from 'antd';
|
|
12
|
+
import React, { useContext, useImperativeHandle, useState } from 'react';
|
|
13
|
+
import { chartTypes } from '../../constants';
|
|
14
|
+
import './styles/index.less';
|
|
15
|
+
import { AttributableContext } from '../../types';
|
|
16
|
+
var classPrefix = 'option-group';
|
|
17
|
+
var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
|
+
var searchData = props.searchData,
|
|
19
|
+
_onGetSearchData = props.onGetSearchData;
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
showPanelDialog = _useState2[0],
|
|
23
|
+
setShowPanelDialog = _useState2[1];
|
|
24
|
+
var _useState3 = useState(false),
|
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
+
showSceneDialog = _useState4[0],
|
|
27
|
+
setShowSceneDialog = _useState4[1];
|
|
28
|
+
var _useState5 = useState(),
|
|
29
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
30
|
+
panelValue = _useState6[0],
|
|
31
|
+
setPanelValue = _useState6[1];
|
|
32
|
+
var _useState7 = useState(),
|
|
33
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
34
|
+
panelType = _useState8[0],
|
|
35
|
+
setPanelType = _useState8[1];
|
|
36
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
37
|
+
currentApp = _useContext.currentApp;
|
|
38
|
+
var _useContext2 = useContext(AttributableContext),
|
|
39
|
+
panelId = _useContext2.panelId,
|
|
40
|
+
panelName = _useContext2.panelName,
|
|
41
|
+
elementId = _useContext2.elementId,
|
|
42
|
+
buttonDisable = _useContext2.buttonDisable,
|
|
43
|
+
searching = _useContext2.searching,
|
|
44
|
+
enableAddScene = _useContext2.enableAddScene,
|
|
45
|
+
afterEditTarget = _useContext2.afterEditTarget;
|
|
46
|
+
useImperativeHandle(ref, function () {
|
|
47
|
+
return {
|
|
48
|
+
saveAsPanel: function saveAsPanel() {
|
|
49
|
+
var item = {
|
|
50
|
+
panel: {
|
|
51
|
+
id: panelId
|
|
52
|
+
},
|
|
53
|
+
name: panelName ? panelName + '(1)' : '归因'
|
|
54
|
+
};
|
|
55
|
+
setPanelValue(item);
|
|
56
|
+
setShowPanelDialog(true);
|
|
57
|
+
},
|
|
58
|
+
savePanel: function savePanel() {
|
|
59
|
+
var item = {
|
|
60
|
+
panel: {
|
|
61
|
+
id: panelId
|
|
62
|
+
},
|
|
63
|
+
name: panelName
|
|
64
|
+
};
|
|
65
|
+
setPanelValue(item);
|
|
66
|
+
setShowPanelDialog(true);
|
|
67
|
+
setPanelType('edit');
|
|
68
|
+
},
|
|
69
|
+
onGetSearchData: function onGetSearchData() {
|
|
70
|
+
_onGetSearchData && _onGetSearchData();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
var _onOk = function onOk(type, val) {
|
|
75
|
+
if (type === 'panel') {
|
|
76
|
+
setPanelType(undefined);
|
|
77
|
+
setShowPanelDialog(false);
|
|
78
|
+
} else {
|
|
79
|
+
setShowSceneDialog(false);
|
|
80
|
+
}
|
|
81
|
+
if (afterEditTarget) afterEditTarget(type, val);
|
|
82
|
+
};
|
|
83
|
+
var _onCancel = function onCancel(type) {
|
|
84
|
+
if (type === 'panel') {
|
|
85
|
+
setShowPanelDialog(false);
|
|
86
|
+
setPanelType(undefined);
|
|
87
|
+
} else {
|
|
88
|
+
setShowSceneDialog(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: classPrefix
|
|
93
|
+
}, !panelId && enableAddScene && /*#__PURE__*/React.createElement(Button, {
|
|
94
|
+
disabled: buttonDisable || searching,
|
|
95
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
96
|
+
className: "".concat(classPrefix, "-icon"),
|
|
97
|
+
type: "tianjia2"
|
|
98
|
+
}),
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
_onGetSearchData && _onGetSearchData();
|
|
101
|
+
setShowSceneDialog(true);
|
|
102
|
+
}
|
|
103
|
+
}, "\u6DFB\u52A0\u5230\u5E38\u7528\u573A\u666F"), !panelId && /*#__PURE__*/React.createElement(Button, {
|
|
104
|
+
disabled: buttonDisable || searching,
|
|
105
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
106
|
+
className: "".concat(classPrefix, "-icon"),
|
|
107
|
+
type: "tianjia2"
|
|
108
|
+
}),
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
_onGetSearchData && _onGetSearchData();
|
|
111
|
+
setShowPanelDialog(true);
|
|
112
|
+
}
|
|
113
|
+
}, "\u6DFB\u52A0\u5230\u770B\u677F"), showSceneDialog && /*#__PURE__*/React.createElement(BizAddToScene, {
|
|
114
|
+
params: _objectSpread({
|
|
115
|
+
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
116
|
+
module: 'attribution'
|
|
117
|
+
}, searchData),
|
|
118
|
+
onCancel: function onCancel() {
|
|
119
|
+
return _onCancel('scene');
|
|
120
|
+
},
|
|
121
|
+
onOk: function onOk(data) {
|
|
122
|
+
return _onOk('scene', data);
|
|
123
|
+
}
|
|
124
|
+
}), showPanelDialog && /*#__PURE__*/React.createElement(BizAddToPanel, {
|
|
125
|
+
defaultValue: panelValue,
|
|
126
|
+
params: _objectSpread({
|
|
127
|
+
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
128
|
+
module: 'attribution'
|
|
129
|
+
}, searchData),
|
|
130
|
+
type: panelType,
|
|
131
|
+
styleOptions: chartTypes,
|
|
132
|
+
elementId: elementId,
|
|
133
|
+
onCancel: function onCancel() {
|
|
134
|
+
return _onCancel('panel');
|
|
135
|
+
},
|
|
136
|
+
onOk: function onOk(data) {
|
|
137
|
+
return _onOk('panel', data);
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
});
|
|
141
|
+
export default OptionGroup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/index.less';
|
|
3
3
|
import { SearchPanelProps } from './types';
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const SearchTime: React.FC<SearchPanelProps>;
|
|
5
|
+
export default SearchTime;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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(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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { BizDatePicker } from '@zgfe/business-lib';
|
|
8
|
+
import React, { useContext, useState, useEffect } from 'react';
|
|
9
|
+
import { getInitDate } from '../../constants';
|
|
10
|
+
import { AttributableContext } from '../../types';
|
|
11
|
+
import './styles/index.less';
|
|
12
|
+
import _ from 'lodash';
|
|
13
|
+
var classPrefix = 'attribution-search-panel';
|
|
14
|
+
var SearchTime = function SearchTime(props) {
|
|
15
|
+
var _useContext = useContext(AttributableContext),
|
|
16
|
+
includeToday = _useContext.includeToday;
|
|
17
|
+
var _useState = useState(props.time || getInitDate(includeToday)),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
time = _useState2[0],
|
|
20
|
+
setTime = _useState2[1];
|
|
21
|
+
var _useState3 = useState(0),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
timer = _useState4[0],
|
|
24
|
+
setTimer = _useState4[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
if (props.time === undefined) {
|
|
27
|
+
var _time = props.time || getInitDate(includeToday);
|
|
28
|
+
setTime(_.cloneDeep(_time));
|
|
29
|
+
}
|
|
30
|
+
}, [props.time]);
|
|
31
|
+
var onChangeTime = function onChangeTime(val) {
|
|
32
|
+
setTime(val);
|
|
33
|
+
if (timer) clearTimeout(timer);
|
|
34
|
+
setTimer(setTimeout(function () {
|
|
35
|
+
setTime(val);
|
|
36
|
+
props.onChange({
|
|
37
|
+
time: val
|
|
38
|
+
});
|
|
39
|
+
}, 10));
|
|
40
|
+
};
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: classPrefix
|
|
43
|
+
}, /*#__PURE__*/React.createElement(BizDatePicker, {
|
|
44
|
+
value: time,
|
|
45
|
+
onChange: onChangeTime,
|
|
46
|
+
selectRange: 365
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
export default SearchTime;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/variable.less';
|
|
2
|
+
|
|
3
|
+
.attribution-search-panel {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
.biz-date-picker-wrap {
|
|
8
|
+
> :nth-child(1) {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
&-search-right {
|
|
13
|
+
display: flex;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-select {
|
|
17
|
+
width: 112px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -2,9 +2,7 @@ import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
|
|
|
2
2
|
export interface SearchPanelProps {
|
|
3
3
|
enableSelectChart?: boolean;
|
|
4
4
|
time?: DatePickerTypes.Value;
|
|
5
|
-
chart?: 'line' | 'bar' | 'map';
|
|
6
5
|
onChange: (data: {
|
|
7
6
|
time: any;
|
|
8
|
-
chartType: string;
|
|
9
7
|
}) => void;
|
|
10
8
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { Table } from 'antd';
|
|
3
|
+
import './styles/index.less';
|
|
4
|
+
import { AttributableContext } from '../../types';
|
|
5
|
+
import empty from '../../images/empty.png';
|
|
6
|
+
var TableList = function TableList(props) {
|
|
7
|
+
var classPrefix = 'table-list';
|
|
8
|
+
var tableDataList = props.tableDataList,
|
|
9
|
+
total = props.total;
|
|
10
|
+
var _useContext = useContext(AttributableContext),
|
|
11
|
+
searching = _useContext.searching;
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: classPrefix
|
|
14
|
+
}, !tableDataList.dataSource && !searching && /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "".concat(classPrefix, "-empty-tips")
|
|
16
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
17
|
+
src: empty
|
|
18
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u8BF7\u9009\u62E9\u6761\u4EF6\u8FDB\u884C\u67E5\u8BE2")), (tableDataList.dataSource || searching) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, {
|
|
19
|
+
dataSource: tableDataList.dataSource,
|
|
20
|
+
columns: tableDataList.columns,
|
|
21
|
+
rowKey: "key",
|
|
22
|
+
pagination: {
|
|
23
|
+
showTotal: function showTotal(total) {
|
|
24
|
+
return "\u5171 ".concat(total, " \u6761");
|
|
25
|
+
},
|
|
26
|
+
showQuickJumper: true,
|
|
27
|
+
showSizeChanger: total > 10
|
|
28
|
+
},
|
|
29
|
+
loading: searching
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
export default TableList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.table-list {
|
|
2
|
+
margin-top: 25px;
|
|
3
|
+
.ant-table-wrapper{
|
|
4
|
+
margin-bottom: 40px;
|
|
5
|
+
}
|
|
6
|
+
&-empty-tips {
|
|
7
|
+
margin-top: 112px;
|
|
8
|
+
text-align: center;
|
|
9
|
+
img{
|
|
10
|
+
width: 88px;
|
|
11
|
+
height: 88px;
|
|
12
|
+
}
|
|
13
|
+
p{
|
|
14
|
+
color: #354354;
|
|
15
|
+
line-height: 20px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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
3
|
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { Input, Menu, Dropdown, Button, message } from 'antd';
|
|
8
8
|
import React, { useContext, useRef, useState } from 'react';
|
|
9
9
|
import { ajax, IconFont } from '@zgfe/business-lib';
|
|
10
|
-
import
|
|
11
|
-
import Apis from
|
|
12
|
-
import {
|
|
13
|
-
var classPrefix = '
|
|
10
|
+
import './styles/index.less';
|
|
11
|
+
import Apis from '../../constants/apis';
|
|
12
|
+
import { AttributableContext } from '../../types';
|
|
13
|
+
var classPrefix = 'attribution-title';
|
|
14
14
|
var EditTitle = function EditTitle(props) {
|
|
15
15
|
var title = props.title,
|
|
16
16
|
type = props.type,
|
|
@@ -24,13 +24,14 @@ var EditTitle = function EditTitle(props) {
|
|
|
24
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
25
|
prevTitle = _useState4[0],
|
|
26
26
|
setPrevTitle = _useState4[1];
|
|
27
|
-
var _useContext = useContext(
|
|
27
|
+
var _useContext = useContext(AttributableContext),
|
|
28
28
|
panelId = _useContext.panelId,
|
|
29
29
|
elementId = _useContext.elementId,
|
|
30
30
|
panelName = _useContext.panelName,
|
|
31
31
|
changeLoading = _useContext.changeLoading,
|
|
32
32
|
afterEditTarget = _useContext.afterEditTarget,
|
|
33
|
-
searching = _useContext.searching
|
|
33
|
+
searching = _useContext.searching,
|
|
34
|
+
buttonDisable = _useContext.buttonDisable;
|
|
34
35
|
var inputRef = useRef(null);
|
|
35
36
|
var menu = /*#__PURE__*/React.createElement(Menu, {
|
|
36
37
|
items: [{
|
|
@@ -46,7 +47,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
46
47
|
}
|
|
47
48
|
}, {
|
|
48
49
|
key: '2',
|
|
49
|
-
label: '
|
|
50
|
+
label: '删除归因',
|
|
50
51
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
51
52
|
type: "shanchu"
|
|
52
53
|
}),
|
|
@@ -55,8 +56,6 @@ var EditTitle = function EditTitle(props) {
|
|
|
55
56
|
}
|
|
56
57
|
}]
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
-
// 删除指标
|
|
60
59
|
var onDelete = function onDelete() {
|
|
61
60
|
changeLoading(true);
|
|
62
61
|
ajax(Apis.delPanelElement, {
|
|
@@ -67,7 +66,7 @@ var EditTitle = function EditTitle(props) {
|
|
|
67
66
|
}
|
|
68
67
|
}).then(function (res) {
|
|
69
68
|
changeLoading(false);
|
|
70
|
-
if (res.flag === 101) {
|
|
69
|
+
if ((res === null || res === void 0 ? void 0 : res.flag) === 101) {
|
|
71
70
|
message.success('删除成功');
|
|
72
71
|
callback('delete');
|
|
73
72
|
} else {
|
|
@@ -77,8 +76,6 @@ var EditTitle = function EditTitle(props) {
|
|
|
77
76
|
changeLoading(false);
|
|
78
77
|
});
|
|
79
78
|
};
|
|
80
|
-
|
|
81
|
-
// 更改标题
|
|
82
79
|
var onBlur = function onBlur(e) {
|
|
83
80
|
var value = e.target.value.trim();
|
|
84
81
|
if (value === prevTitle || !value) return;
|
|
@@ -127,17 +124,24 @@ var EditTitle = function EditTitle(props) {
|
|
|
127
124
|
}
|
|
128
125
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
129
126
|
type: "fanhuiicon"
|
|
130
|
-
}), "\u8FD4\u56DE"), /*#__PURE__*/React.createElement(
|
|
127
|
+
}), "\u8FD4\u56DE"), /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: "".concat(classPrefix, "-input-box-container")
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
131
130
|
ref: inputRef,
|
|
132
131
|
className: "".concat(classPrefix, "-input-box-content"),
|
|
132
|
+
status: !curTitle ? 'error' : '',
|
|
133
133
|
value: curTitle,
|
|
134
134
|
onBlur: onBlur,
|
|
135
135
|
onChange: onChange
|
|
136
|
-
})
|
|
136
|
+
}), !curTitle ? /*#__PURE__*/React.createElement("span", {
|
|
137
|
+
className: "".concat(classPrefix, "-error-tip")
|
|
138
|
+
}, "\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A") : null)), type === 'edit' ? /*#__PURE__*/React.createElement("div", {
|
|
137
139
|
className: "".concat(classPrefix, "-option")
|
|
138
140
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
139
141
|
overlayClassName: "".concat(classPrefix, "-dropdown"),
|
|
140
|
-
|
|
142
|
+
dropdownRender: function dropdownRender() {
|
|
143
|
+
return menu;
|
|
144
|
+
},
|
|
141
145
|
trigger: ['click']
|
|
142
146
|
}, /*#__PURE__*/React.createElement("a", {
|
|
143
147
|
className: "".concat(classPrefix, "-pop-btn")
|
|
@@ -145,40 +149,40 @@ var EditTitle = function EditTitle(props) {
|
|
|
145
149
|
className: "biz-pop-icon",
|
|
146
150
|
type: "gengduocaozuo1"
|
|
147
151
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
148
|
-
className: "
|
|
152
|
+
className: "attribution-divider"
|
|
149
153
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
150
|
-
className: "
|
|
154
|
+
className: "attribution-btn",
|
|
151
155
|
type: "text",
|
|
152
156
|
onClick: function onClick() {
|
|
153
157
|
return callback('cancel');
|
|
154
158
|
}
|
|
155
159
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
156
|
-
className: "
|
|
157
|
-
disabled: searching,
|
|
160
|
+
className: "attribution-btn",
|
|
161
|
+
disabled: buttonDisable || searching || !curTitle,
|
|
158
162
|
type: "primary",
|
|
159
163
|
onClick: onSave
|
|
160
164
|
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(Button, {
|
|
161
|
-
className: "
|
|
162
|
-
disabled: searching,
|
|
165
|
+
className: "attribution-btn",
|
|
166
|
+
disabled: buttonDisable || searching,
|
|
163
167
|
type: "primary",
|
|
164
168
|
onClick: onSaveAs
|
|
165
169
|
}, "\u53E6\u5B58\u4E3A")) : /*#__PURE__*/React.createElement("div", {
|
|
166
170
|
className: "".concat(classPrefix, "-title-btn")
|
|
167
171
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
168
|
-
className: "
|
|
172
|
+
className: "attribution-btn",
|
|
169
173
|
type: "text",
|
|
170
174
|
onClick: function onClick() {
|
|
171
175
|
return callback('cancel');
|
|
172
176
|
}
|
|
173
177
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
174
|
-
className: "
|
|
175
|
-
disabled: searching,
|
|
178
|
+
className: "attribution-btn",
|
|
179
|
+
disabled: buttonDisable || searching || !curTitle,
|
|
176
180
|
type: "primary",
|
|
177
181
|
onClick: onSaveAs
|
|
178
182
|
}, "\u4FDD\u5B58")));
|
|
179
183
|
};
|
|
180
184
|
EditTitle.defaultProps = {
|
|
181
|
-
title: '
|
|
185
|
+
title: '归因',
|
|
182
186
|
type: 'edit'
|
|
183
187
|
};
|
|
184
188
|
export default EditTitle;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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
3
|
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useState } from 'react';
|
|
8
8
|
import { SearchOutlined } from '@ant-design/icons';
|
|
9
|
-
import
|
|
9
|
+
import './styles/search.less';
|
|
10
10
|
import { BizSearchInput } from '@zgfe/business-lib';
|
|
11
11
|
var classPrefix = 'search-title';
|
|
12
12
|
var SearchTitle = function SearchTitle(props) {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
2
|
|
|
3
|
-
.
|
|
3
|
+
.attribution-title {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: space-between;
|
|
7
7
|
width: 100%;
|
|
8
|
-
height:
|
|
9
|
-
padding:
|
|
8
|
+
height: 64px;
|
|
9
|
+
padding: 0 24px;
|
|
10
10
|
background: #fff;
|
|
11
|
-
border-bottom: 1px solid @border-color-base;
|
|
12
11
|
|
|
13
12
|
&-option {
|
|
14
13
|
display: flex;
|
|
@@ -17,25 +16,38 @@
|
|
|
17
16
|
&-input-box {
|
|
18
17
|
white-space: nowrap;
|
|
19
18
|
.btn-back {
|
|
20
|
-
margin-right:
|
|
19
|
+
margin-right: 8px;
|
|
20
|
+
color: #5F6085;
|
|
21
|
+
}
|
|
22
|
+
&-container {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
height: 100%;
|
|
21
26
|
}
|
|
22
27
|
&-content {
|
|
23
28
|
height: @height-base;
|
|
24
29
|
color: @text-color;
|
|
25
30
|
font-weight: 600;
|
|
31
|
+
font-size:16px;
|
|
26
32
|
background: @white !important;
|
|
27
33
|
border: 1px solid transparent;
|
|
28
34
|
|
|
29
35
|
&:hover,
|
|
30
36
|
&:focus {
|
|
31
|
-
border-color: @primary-color;
|
|
37
|
+
// border-color: @primary-color;
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
|
-
|
|
41
|
+
&-error-tip {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 100%;
|
|
44
|
+
left: 0;
|
|
45
|
+
color: @error-color;
|
|
46
|
+
line-height: 1.2;
|
|
47
|
+
}
|
|
36
48
|
&-dropdown {
|
|
37
49
|
.ant-dropdown-menu-item:hover span {
|
|
38
|
-
color: @primary-color;
|
|
50
|
+
// color: @primary-color;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
.ant-dropdown-menu-item-icon {
|
|
@@ -59,12 +71,12 @@
|
|
|
59
71
|
}
|
|
60
72
|
}
|
|
61
73
|
|
|
62
|
-
.
|
|
74
|
+
.attribution-btn {
|
|
63
75
|
margin-right: 16px;
|
|
64
76
|
border-radius: @border-radius-small;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
|
-
.
|
|
79
|
+
.attribution-divider {
|
|
68
80
|
width: 1px;
|
|
69
81
|
height: @height-base;
|
|
70
82
|
margin: 0 32px;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SearchPanelTypes } from '../modules/searchPanel/types';
|
|
2
|
+
export declare const chartTypes: {
|
|
3
|
+
label: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const searchFields: SearchPanelTypes.FieldProp[];
|
|
8
|
+
export declare const attributionTypeTooltips: {
|
|
9
|
+
text: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}[];
|