@zgfe/modules-whole 1.0.10-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/README.md +37 -0
- package/es/components/dataUpdateTime/index.d.ts +3 -0
- package/es/components/dataUpdateTime/index.js +53 -0
- package/es/components/eventFilter/index.d.ts +5 -0
- package/es/components/eventFilter/index.js +263 -0
- package/es/components/eventFilter/styles/index.less +36 -0
- package/es/components/eventFilter/types.d.ts +20 -0
- package/es/components/eventFilter/types.js +1 -0
- package/es/components/index.d.ts +4 -0
- package/es/components/index.js +4 -0
- package/es/components/renderContent/index.d.ts +5 -0
- package/es/components/renderContent/index.js +44 -0
- package/es/components/renderContent/styles/index.less +20 -0
- package/es/components/renderContent/types.d.ts +9 -0
- package/es/components/renderContent/types.js +1 -0
- package/es/components/searchPanel/index.d.ts +5 -0
- package/es/components/searchPanel/index.js +164 -0
- package/es/components/searchPanel/styles/index.less +22 -0
- package/es/components/searchPanel/types.d.ts +23 -0
- package/es/components/searchPanel/types.js +1 -0
- package/es/components/table/index.d.ts +5 -0
- package/es/components/table/index.js +130 -0
- package/es/components/table/styles/index.less +193 -0
- package/es/components/table/types.d.ts +9 -0
- package/es/components/table/types.js +1 -0
- package/es/components/topBar/index.d.ts +5 -0
- package/es/components/topBar/index.js +163 -0
- package/es/components/topBar/styles/index.less +71 -0
- package/es/components/topBar/types.d.ts +8 -0
- package/es/components/topBar/types.js +1 -0
- package/es/constants/apis.d.ts +8 -0
- package/es/constants/apis.js +8 -0
- package/es/constants/chart.d.ts +2 -0
- package/es/constants/chart.js +31 -0
- package/es/constants/color.d.ts +1 -0
- package/es/constants/color.js +1 -0
- package/es/constants/fields.d.ts +271 -0
- package/es/constants/fields.js +260 -0
- package/es/constants/index.d.ts +6 -0
- package/es/constants/index.js +6 -0
- package/es/constants/initData.d.ts +2 -0
- package/es/constants/initData.js +9 -0
- package/es/constants/json/line.d.ts +20 -0
- package/es/constants/json/line.js +25 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +4 -0
- package/es/modules/chart/demo/data.d.ts +78 -0
- package/es/modules/chart/demo/data.js +489 -0
- package/es/modules/chart/demo/index.d.ts +3 -0
- package/es/modules/chart/demo/index.js +12 -0
- package/es/modules/chart/demo/panel.d.ts +3 -0
- package/es/modules/chart/demo/panel.js +11 -0
- package/es/modules/chart/index.d.ts +4 -0
- package/es/modules/chart/index.js +246 -0
- package/es/modules/chart/types.d.ts +15 -0
- package/es/modules/chart/types.js +1 -0
- package/es/modules/content/index.d.ts +5 -0
- package/es/modules/content/index.js +234 -0
- package/es/modules/content/styles/index.less +7 -0
- package/es/modules/content/types.d.ts +11 -0
- package/es/modules/content/types.js +1 -0
- package/es/modules/content/utils.d.ts +17 -0
- package/es/modules/content/utils.js +107 -0
- package/es/modules/home/demo/create.d.ts +3 -0
- package/es/modules/home/demo/create.js +58 -0
- package/es/modules/home/demo/edit.d.ts +3 -0
- package/es/modules/home/demo/edit.js +86 -0
- package/es/modules/home/demo/index.d.ts +4 -0
- package/es/modules/home/demo/index.js +83 -0
- package/es/modules/home/demo/scene.d.ts +3 -0
- package/es/modules/home/demo/scene.js +89 -0
- package/es/modules/home/demo/styles/index.less +33 -0
- package/es/modules/home/index.d.ts +5 -0
- package/es/modules/home/index.js +218 -0
- package/es/modules/home/styles/index.less +39 -0
- package/es/modules/home/types.d.ts +34 -0
- package/es/modules/home/types.js +1 -0
- package/es/modules/topPanel/index.d.ts +5 -0
- package/es/modules/topPanel/index.js +154 -0
- package/es/modules/topPanel/styles/index.less +41 -0
- package/es/modules/topPanel/types.d.ts +39 -0
- package/es/modules/topPanel/types.js +1 -0
- package/es/style/image/ring.svg +9 -0
- package/es/style/index.less +62 -0
- package/es/style/theme.d.ts +15 -0
- package/es/style/theme.js +14 -0
- package/es/types.d.ts +79 -0
- package/es/types.js +6 -0
- package/es/utils/ajaxConfig.d.ts +8 -0
- package/es/utils/ajaxConfig.js +12 -0
- package/es/utils/base64.d.ts +23 -0
- package/es/utils/base64.js +125 -0
- package/es/utils/formData.d.ts +21 -0
- package/es/utils/formData.js +366 -0
- package/es/utils/util.d.ts +36 -0
- package/es/utils/util.js +167 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# modules-whole
|
|
2
|
+
|
|
3
|
+
整体分析
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
Install dependencies,
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm i
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Start the dev server,
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$ npm start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build documentation,
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
$ npm run docs:build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Run test,
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
$ npm test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Build library via `father-build`,
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
$ npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
udpate
|
|
@@ -0,0 +1,53 @@
|
|
|
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 = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { ajax } from '@zgfe/business-lib';
|
|
8
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
9
|
+
import { Apis } from '../../constants';
|
|
10
|
+
import { WholeContext } from '../../types';
|
|
11
|
+
import { Tooltip } from 'antd';
|
|
12
|
+
import { tipContent } from '../../utils/util';
|
|
13
|
+
import moment from 'moment';
|
|
14
|
+
var classPrefix = 'event-mi-table';
|
|
15
|
+
export default (function () {
|
|
16
|
+
var _useContext = useContext(WholeContext),
|
|
17
|
+
currentApp = _useContext.currentApp,
|
|
18
|
+
searchData = _useContext.searchData;
|
|
19
|
+
var _useState = useState(false),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
realTime = _useState2[0],
|
|
22
|
+
setRealTime = _useState2[1];
|
|
23
|
+
var _useState3 = useState('-'),
|
|
24
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
25
|
+
time = _useState4[0],
|
|
26
|
+
setTime = _useState4[1];
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (['duration_avg', 'duration', 'add'].includes(searchData.module)) {
|
|
29
|
+
setRealTime(false);
|
|
30
|
+
getAppUpdateTime();
|
|
31
|
+
} else {
|
|
32
|
+
setRealTime(true);
|
|
33
|
+
}
|
|
34
|
+
}, [searchData.module]);
|
|
35
|
+
var getAppUpdateTime = function getAppUpdateTime() {
|
|
36
|
+
var formData = new FormData();
|
|
37
|
+
formData.append('appId', currentApp.appId);
|
|
38
|
+
formData.append('platId', searchData.platform);
|
|
39
|
+
ajax(Apis.appUpdateTime, {
|
|
40
|
+
method: 'post',
|
|
41
|
+
data: formData
|
|
42
|
+
}).then(function (res) {
|
|
43
|
+
if (res === null || res === void 0 ? void 0 : res.times) {
|
|
44
|
+
var _res$times;
|
|
45
|
+
setTime(res === null || res === void 0 ? void 0 : (_res$times = res.times) === null || _res$times === void 0 ? void 0 : _res$times.update_time);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
50
|
+
className: "".concat(classPrefix, "-chart-box-tooltip"),
|
|
51
|
+
title: tipContent(realTime)
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u6570\u636E\u66F4\u65B0\u65F6\u95F4\uFF1A", !realTime ? time : moment().format('YYYY-MM-DD HH:mm')));
|
|
53
|
+
});
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
import { Tooltip } from 'antd';
|
|
18
|
+
import React, { useEffect, useRef, useState, useContext } from 'react';
|
|
19
|
+
import { BizAttributeSelector, IconFont, BizAttrConditionGroup, BizGlobalDataContext, BizSelect } from '@zgfe/business-lib';
|
|
20
|
+
import { WholeContext } from '../../types';
|
|
21
|
+
import './styles/index.less';
|
|
22
|
+
import { judgeIsArea } from '../../modules/content/utils';
|
|
23
|
+
import _ from 'lodash';
|
|
24
|
+
import { getBuiltinIndicators } from '../../constants/fields';
|
|
25
|
+
var classPrefix = 'eventfilter-box';
|
|
26
|
+
var EventFilter = function EventFilter(props) {
|
|
27
|
+
var _props$value;
|
|
28
|
+
var countChange = props.countChange;
|
|
29
|
+
var _useContext = useContext(WholeContext),
|
|
30
|
+
searchData = _useContext.searchData,
|
|
31
|
+
disableItemList = _useContext.disableItemList,
|
|
32
|
+
setDisableItemList = _useContext.setDisableItemList,
|
|
33
|
+
setIncludeToday = _useContext.setIncludeToday;
|
|
34
|
+
var _useContext2 = useContext(BizGlobalDataContext),
|
|
35
|
+
currentApp = _useContext2.currentApp,
|
|
36
|
+
userPropList = _useContext2.userPropList,
|
|
37
|
+
eventEnvList = _useContext2.eventEnvList;
|
|
38
|
+
var builtinIndicators = getBuiltinIndicators(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type);
|
|
39
|
+
var _useState = useState(props.value && props.value.filters && props.value.filters.conditions ? props.value.filters.conditions.length : 0),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
count = _useState2[0],
|
|
42
|
+
setCount = _useState2[1];
|
|
43
|
+
var _useState3 = useState(false),
|
|
44
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
+
isAdd = _useState4[0],
|
|
46
|
+
setIsAdd = _useState4[1];
|
|
47
|
+
var conditionRef = useRef(null);
|
|
48
|
+
var _useState5 = useState({
|
|
49
|
+
id: props.value.id,
|
|
50
|
+
name: props.value.name,
|
|
51
|
+
module: props.value.module,
|
|
52
|
+
analysisIndex: props.value.analysisIndex
|
|
53
|
+
}),
|
|
54
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
55
|
+
event = _useState6[0],
|
|
56
|
+
setEvent = _useState6[1];
|
|
57
|
+
var _useState7 = useState(true),
|
|
58
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
59
|
+
showDimension = _useState8[0],
|
|
60
|
+
setShowDimension = _useState8[1];
|
|
61
|
+
var _useState9 = useState(),
|
|
62
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
63
|
+
filter = _useState10[0],
|
|
64
|
+
setFilter = _useState10[1];
|
|
65
|
+
var _useState11 = useState(),
|
|
66
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
67
|
+
bizAttributeSelectorValue = _useState12[0],
|
|
68
|
+
setBizAttributeSelectorValue = _useState12[1];
|
|
69
|
+
var _useState13 = useState(((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.id) ? builtinIndicators.find(function (item) {
|
|
70
|
+
var _props$value2;
|
|
71
|
+
return item.id == ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.id);
|
|
72
|
+
}) : builtinIndicators[0]),
|
|
73
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
74
|
+
currentVal = _useState14[0],
|
|
75
|
+
setCurrentVal = _useState14[1];
|
|
76
|
+
var dealPropsList = function dealPropsList(data) {
|
|
77
|
+
var array = [].concat(_toConsumableArray(eventEnvList), _toConsumableArray(userPropList));
|
|
78
|
+
var obj = array.find(function (item) {
|
|
79
|
+
return item.id == data.id && item.name == data.value;
|
|
80
|
+
});
|
|
81
|
+
setBizAttributeSelectorValue(obj);
|
|
82
|
+
};
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
var _data = props.value;
|
|
85
|
+
if (_data) {
|
|
86
|
+
if (_data && builtinIndicators.filter(function (_, index) {
|
|
87
|
+
return index > 2;
|
|
88
|
+
}).some(function (item) {
|
|
89
|
+
return item.id == _data.id;
|
|
90
|
+
})) {
|
|
91
|
+
setShowDimension(false);
|
|
92
|
+
}
|
|
93
|
+
if (_data.filters) {
|
|
94
|
+
setFilter(_data.filters);
|
|
95
|
+
setCount(_data.filters.conditions.length);
|
|
96
|
+
}
|
|
97
|
+
if (_data.dimension) {
|
|
98
|
+
var _data$dimension;
|
|
99
|
+
if ((_data$dimension = _data.dimension) === null || _data$dimension === void 0 ? void 0 : _data$dimension.name) {
|
|
100
|
+
setBizAttributeSelectorValue(_objectSpread({}, _data.dimension));
|
|
101
|
+
} else {
|
|
102
|
+
dealPropsList(_data.dimension);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, [eventEnvList, userPropList]);
|
|
107
|
+
var onAdd = function onAdd() {
|
|
108
|
+
if ((event === null || event === void 0 ? void 0 : event.id) === -1) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (count >= 5) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setIsAdd(true);
|
|
115
|
+
setTimeout(function () {
|
|
116
|
+
var _conditionRef$current;
|
|
117
|
+
conditionRef === null || conditionRef === void 0 ? void 0 : (_conditionRef$current = conditionRef.current) === null || _conditionRef$current === void 0 ? void 0 : _conditionRef$current.add();
|
|
118
|
+
}, 0);
|
|
119
|
+
};
|
|
120
|
+
var onChangeFilters = function onChangeFilters(data) {
|
|
121
|
+
setFilter(data);
|
|
122
|
+
};
|
|
123
|
+
useEffect(function () {
|
|
124
|
+
countChange(count);
|
|
125
|
+
if (count <= 0) setFilter(undefined);
|
|
126
|
+
}, [count, filter]);
|
|
127
|
+
var onChangeTarget = function onChangeTarget(val) {
|
|
128
|
+
var event = val;
|
|
129
|
+
if (event && builtinIndicators.filter(function (_, index) {
|
|
130
|
+
return index > 2;
|
|
131
|
+
}).some(function (item) {
|
|
132
|
+
return item.id == (event === null || event === void 0 ? void 0 : event.id);
|
|
133
|
+
})) {
|
|
134
|
+
setShowDimension(false);
|
|
135
|
+
setBizAttributeSelectorValue(undefined);
|
|
136
|
+
} else {
|
|
137
|
+
setShowDimension(true);
|
|
138
|
+
}
|
|
139
|
+
if (event) {
|
|
140
|
+
setEvent(event);
|
|
141
|
+
var list = [];
|
|
142
|
+
if ((event === null || event === void 0 ? void 0 : event.module) == 'duration') {
|
|
143
|
+
list = ['line', 'map'];
|
|
144
|
+
} else {
|
|
145
|
+
list = ['pie', 'map'];
|
|
146
|
+
}
|
|
147
|
+
setDisableItemList(list);
|
|
148
|
+
}
|
|
149
|
+
if ([-202, -203, -205].includes(event.id)) {
|
|
150
|
+
setIncludeToday(true);
|
|
151
|
+
} else {
|
|
152
|
+
setIncludeToday(false);
|
|
153
|
+
}
|
|
154
|
+
setCurrentVal(undefined);
|
|
155
|
+
setBizAttributeSelectorValue(undefined);
|
|
156
|
+
setFilter(undefined);
|
|
157
|
+
setIsAdd(false);
|
|
158
|
+
setCount(0);
|
|
159
|
+
};
|
|
160
|
+
var onChangeAttr = function onChangeAttr(attr) {
|
|
161
|
+
var list = _toConsumableArray(disableItemList);
|
|
162
|
+
if (attr === undefined) {
|
|
163
|
+
setBizAttributeSelectorValue(undefined);
|
|
164
|
+
list = ['pie', 'map'];
|
|
165
|
+
setDisableItemList(list);
|
|
166
|
+
} else {
|
|
167
|
+
var _value = attr.name;
|
|
168
|
+
setBizAttributeSelectorValue({
|
|
169
|
+
propCategory: attr.propCategory,
|
|
170
|
+
category: attr.category,
|
|
171
|
+
value: _value,
|
|
172
|
+
id: attr.id,
|
|
173
|
+
label: attr === null || attr === void 0 ? void 0 : attr.label,
|
|
174
|
+
name: attr.name
|
|
175
|
+
});
|
|
176
|
+
if (list.some(function (item) {
|
|
177
|
+
return item == 'pie';
|
|
178
|
+
})) {
|
|
179
|
+
list = list.filter(function (item) {
|
|
180
|
+
return item != 'pie';
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (['current_city', 'current_area'].includes(_value)) {
|
|
184
|
+
list = list.filter(function (item) {
|
|
185
|
+
return item != 'map';
|
|
186
|
+
});
|
|
187
|
+
} else {
|
|
188
|
+
if (!list.some(function (item) {
|
|
189
|
+
return item == 'map';
|
|
190
|
+
})) {
|
|
191
|
+
list = [].concat(_toConsumableArray(list), ['map']);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
setDisableItemList(list);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
useEffect(function () {
|
|
198
|
+
var _event = {
|
|
199
|
+
name: event === null || event === void 0 ? void 0 : event.name,
|
|
200
|
+
id: event === null || event === void 0 ? void 0 : event.id,
|
|
201
|
+
module: event === null || event === void 0 ? void 0 : event.module,
|
|
202
|
+
analysisIndex: event === null || event === void 0 ? void 0 : event.analysisIndex
|
|
203
|
+
};
|
|
204
|
+
if (filter) {
|
|
205
|
+
_event.filters = filter;
|
|
206
|
+
}
|
|
207
|
+
if (bizAttributeSelectorValue) {
|
|
208
|
+
var _dimension = _.cloneDeep(bizAttributeSelectorValue);
|
|
209
|
+
if (!judgeIsArea(_dimension.value)) {
|
|
210
|
+
if (searchData.chartType === 'map') _event.chartType = 'line';
|
|
211
|
+
}
|
|
212
|
+
delete _dimension.key;
|
|
213
|
+
_event.dimension = _dimension;
|
|
214
|
+
}
|
|
215
|
+
props.onChange && props.onChange(_event);
|
|
216
|
+
}, [bizAttributeSelectorValue, filter, event, currentVal]);
|
|
217
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
className: classPrefix
|
|
219
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
className: "".concat(classPrefix, "-multiple")
|
|
221
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
222
|
+
className: "".concat(classPrefix, "-select"),
|
|
223
|
+
options: builtinIndicators,
|
|
224
|
+
keyField: "id",
|
|
225
|
+
labelField: "name",
|
|
226
|
+
defaultValue: currentVal,
|
|
227
|
+
onChange: onChangeTarget
|
|
228
|
+
}), showDimension && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
229
|
+
enableEventProp: false,
|
|
230
|
+
enableUserProp: true,
|
|
231
|
+
enableEnvProp: true,
|
|
232
|
+
eventIdList: [event === null || event === void 0 ? void 0 : event.id],
|
|
233
|
+
value: bizAttributeSelectorValue,
|
|
234
|
+
enableDelete: true,
|
|
235
|
+
onChange: onChangeAttr,
|
|
236
|
+
onDelete: function onDelete() {
|
|
237
|
+
onChangeAttr(undefined);
|
|
238
|
+
},
|
|
239
|
+
placeholder: "\u8BF7\u9009\u62E9\u7EC6\u5206\u5C5E\u6027"
|
|
240
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
241
|
+
placement: "top",
|
|
242
|
+
title: '添加属性筛选'
|
|
243
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
244
|
+
className: "".concat(count >= 5 || (event === null || event === void 0 ? void 0 : event.id) === -1 ? 'disable' : ''),
|
|
245
|
+
type: "shaixuan",
|
|
246
|
+
onClick: function onClick() {
|
|
247
|
+
return onAdd();
|
|
248
|
+
}
|
|
249
|
+
})))), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
250
|
+
className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
|
|
251
|
+
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
252
|
+
ref: conditionRef,
|
|
253
|
+
value: filter,
|
|
254
|
+
onlyAnd: true,
|
|
255
|
+
enableEventProp: false,
|
|
256
|
+
enableDelete: true,
|
|
257
|
+
enableUserProp: true,
|
|
258
|
+
eventIdList: event ? [event.id] : [],
|
|
259
|
+
onChange: onChangeFilters,
|
|
260
|
+
onConditionsCount: setCount
|
|
261
|
+
})));
|
|
262
|
+
};
|
|
263
|
+
export default EventFilter;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.eventfilter-box {
|
|
2
|
+
.attr-box-show {
|
|
3
|
+
margin-top: 4px;
|
|
4
|
+
}
|
|
5
|
+
> div:nth-child(1) {
|
|
6
|
+
display: flex;
|
|
7
|
+
padding: 4px 0 4px 24px;
|
|
8
|
+
&:hover {
|
|
9
|
+
background: #e8efff;
|
|
10
|
+
}
|
|
11
|
+
.biz-event-select,
|
|
12
|
+
.biz-attr-select {
|
|
13
|
+
min-width: 208px;
|
|
14
|
+
}
|
|
15
|
+
.shaixuan {
|
|
16
|
+
margin-top: 2px;
|
|
17
|
+
color: #9aa1a9;
|
|
18
|
+
font-size: 20px !important;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
.shaixuan:hover {
|
|
22
|
+
color: #165dff;
|
|
23
|
+
}
|
|
24
|
+
.disable {
|
|
25
|
+
color: #ccd0d4 !important;
|
|
26
|
+
cursor: not-allowed !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
&-multiple {
|
|
30
|
+
gap: 14px;
|
|
31
|
+
.biz-select-handle-input {
|
|
32
|
+
width: auto !important;
|
|
33
|
+
min-width: 208px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { eventProps } from '../../types';
|
|
2
|
+
export interface ConditionsnProps {
|
|
3
|
+
attrId: number | undefined;
|
|
4
|
+
propCategory: string | undefined;
|
|
5
|
+
type: string | undefined;
|
|
6
|
+
id?: number | undefined;
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
category?: string | undefined;
|
|
9
|
+
attrName?: string | undefined;
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
dimensionSub?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface EventFilterProps {
|
|
14
|
+
value?: eventProps | number;
|
|
15
|
+
onChange?: (event: eventProps | number[]) => {};
|
|
16
|
+
countChange: (count: number) => void;
|
|
17
|
+
setIsCity?: Function;
|
|
18
|
+
setEnableSelectChart?: Function;
|
|
19
|
+
analysisType?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Empty } from 'antd';
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { BizLoading } from '@zgfe/business-lib';
|
|
4
|
+
import { WholeContext } from '../../types';
|
|
5
|
+
import './styles/index.less';
|
|
6
|
+
import WholeChart from '../../modules/chart';
|
|
7
|
+
var classPrefix = 'render-content';
|
|
8
|
+
var ContentPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
|
+
var wholeData = props.wholeData,
|
|
10
|
+
searchData = props.searchData;
|
|
11
|
+
var _useContext = useContext(WholeContext),
|
|
12
|
+
loading = _useContext.loading,
|
|
13
|
+
showList = _useContext.showList,
|
|
14
|
+
setShowList = _useContext.setShowList,
|
|
15
|
+
refreshLoading = _useContext.refreshLoading;
|
|
16
|
+
var onChangeShow = function onChangeShow(names) {
|
|
17
|
+
setShowList(names);
|
|
18
|
+
};
|
|
19
|
+
if (loading || refreshLoading) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(BizLoading, {
|
|
21
|
+
className: "".concat(classPrefix, "-loading")
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classPrefix
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(classPrefix, "-chart-container")
|
|
28
|
+
}, wholeData ? /*#__PURE__*/React.createElement(WholeChart, {
|
|
29
|
+
ref: ref,
|
|
30
|
+
dataSource: wholeData,
|
|
31
|
+
params: searchData,
|
|
32
|
+
showList: showList
|
|
33
|
+
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
34
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
35
|
+
description: "\u6682\u65E0\u6570\u636E"
|
|
36
|
+
})), wholeData && wholeData.series.length > 0 ? /*#__PURE__*/React.createElement(WholeChart, {
|
|
37
|
+
type: "grid",
|
|
38
|
+
dataSource: wholeData,
|
|
39
|
+
params: searchData,
|
|
40
|
+
showList: showList,
|
|
41
|
+
onChangeShow: onChangeShow
|
|
42
|
+
}) : null);
|
|
43
|
+
});
|
|
44
|
+
export default ContentPanel;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/variable.less';
|
|
2
|
+
|
|
3
|
+
.render-content {
|
|
4
|
+
&-chart-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
height: 392px;
|
|
9
|
+
padding: @padding-lg;
|
|
10
|
+
border: 1px solid @border-color-base;
|
|
11
|
+
border-radius: @border-radius-normal;
|
|
12
|
+
.echarts-for-react {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 330px !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
&-loading {
|
|
18
|
+
min-height: 300px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SearchValue, ResponseDataProps } from '../../types';
|
|
2
|
+
export interface RenderContentProps {
|
|
3
|
+
wholeData?: ResponseDataProps;
|
|
4
|
+
searchData?: SearchValue;
|
|
5
|
+
showList: string[];
|
|
6
|
+
isCity?: boolean;
|
|
7
|
+
afterEditTarget?: (type: string, value?: any) => void;
|
|
8
|
+
onChangeShow?: (data: string[]) => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|