@zgfe/modules-interval 1.0.11-zhongbang.6 → 1.0.23-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 +2 -0
- package/dist/esm/components/eventFilter/index.js +5 -3
- package/dist/esm/components/renderContent/index.js +6 -5
- package/dist/esm/components/searchPanel/index.js +19 -9
- package/dist/esm/components/searchPanel/styles/index.less +9 -2
- package/dist/esm/components/searchPanel/types.d.ts +1 -0
- package/dist/esm/components/table/index.js +1 -1
- package/dist/esm/components/topBar/index.js +8 -12
- package/dist/esm/components/topBar/styles/index.less +0 -34
- package/dist/esm/modules/chart/index.js +23 -4
- package/dist/esm/modules/content/index.js +43 -19
- package/dist/esm/modules/content/styles/index.less +18 -0
- package/dist/esm/modules/content/utils.js +1 -1
- package/dist/esm/modules/home/demo/create.js +1 -1
- package/dist/esm/modules/home/demo/edit.js +1 -1
- package/dist/esm/modules/home/demo/index.js +2 -1
- package/dist/esm/modules/home/index.js +52 -33
- package/dist/esm/modules/home/styles/index.less +3 -0
- package/dist/esm/modules/topPanel/index.js +88 -23
- package/dist/esm/modules/topPanel/styles/index.less +6 -0
- package/dist/esm/utils/formData.d.ts +2 -2
- package/dist/esm/utils/formData.js +4 -3
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -11,12 +11,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { Tooltip, message } from 'antd';
|
|
14
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
15
|
-
import { BizEventSelector, IconFont, BizAttrConditionGroup } from '@zgfe/business-lib';
|
|
14
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
15
|
+
import { BizEventSelector, IconFont, BizAttrConditionGroup, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
17
|
import _ from 'lodash';
|
|
18
18
|
var classPrefix = 'interval-box';
|
|
19
19
|
var EventFilter = function EventFilter(props) {
|
|
20
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
21
|
+
eventIdMap = _useContext.eventIdMap;
|
|
20
22
|
// 筛选条件个数
|
|
21
23
|
var _useState = useState(0),
|
|
22
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -174,7 +176,7 @@ var EventFilter = function EventFilter(props) {
|
|
|
174
176
|
onClick: function onClick() {
|
|
175
177
|
return onAdd();
|
|
176
178
|
}
|
|
177
|
-
})))), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
})))), event && event.id && eventIdMap && eventIdMap[event.id] && (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
178
180
|
className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
|
|
179
181
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
180
182
|
ref: conditionRef,
|
|
@@ -5,17 +5,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { Spin } from 'antd';
|
|
8
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
9
9
|
import { MiNone, MiSpin } from '..';
|
|
10
|
+
import { IntervalContext } from "../../types";
|
|
10
11
|
import "./styles/index.less";
|
|
11
12
|
import IntervalEventChart from "../../modules/chart";
|
|
12
13
|
var classPrefix = 'render-content-interval';
|
|
13
14
|
var ContentPanel = function ContentPanel(props) {
|
|
14
|
-
var _eventData$appData, _eventData$appData$se;
|
|
15
15
|
var loading = props.loading,
|
|
16
16
|
eventData = props.eventData,
|
|
17
17
|
searchData = props.searchData;
|
|
18
|
-
|
|
18
|
+
var _useContext = useContext(IntervalContext),
|
|
19
|
+
refreshLoading = _useContext.refreshLoading;
|
|
19
20
|
// 显示内容
|
|
20
21
|
var _useState = useState(props.showList || []),
|
|
21
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -30,7 +31,7 @@ var ContentPanel = function ContentPanel(props) {
|
|
|
30
31
|
setShowList(names);
|
|
31
32
|
if (props.onChangeShow) props.onChangeShow(names);
|
|
32
33
|
};
|
|
33
|
-
if (loading) {
|
|
34
|
+
if (loading || refreshLoading) {
|
|
34
35
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
35
36
|
className: "".concat(classPrefix, "-spin-container"),
|
|
36
37
|
tip: "\u67E5\u8BE2\u4E2D...",
|
|
@@ -41,7 +42,7 @@ var ContentPanel = function ContentPanel(props) {
|
|
|
41
42
|
className: classPrefix
|
|
42
43
|
}, /*#__PURE__*/React.createElement("div", {
|
|
43
44
|
className: "".concat(classPrefix, "-chart-container")
|
|
44
|
-
},
|
|
45
|
+
}, searchData ? /*#__PURE__*/React.createElement(IntervalEventChart, {
|
|
45
46
|
type: "boxplot",
|
|
46
47
|
dataSource: eventData,
|
|
47
48
|
params: searchData,
|
|
@@ -10,16 +10,20 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import {
|
|
13
|
+
import { BizSelect, IconFont, BizDatePickerV2 } from '@zgfe/business-lib';
|
|
14
|
+
import { DatePickerTypes } from '@zgfe/business-lib/es/datePickerV2/types';
|
|
14
15
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
16
|
import { chartTypeOptions, getInitDate } from "../../constants";
|
|
16
17
|
import { IntervalContext } from "../../types";
|
|
18
|
+
import { Button } from 'antd';
|
|
17
19
|
import "./styles/index.less";
|
|
18
20
|
import { extractNames } from "../../utils/formData";
|
|
19
21
|
var classPrefix = 'search-panel-interval';
|
|
20
22
|
var SearchPanel = function SearchPanel(props) {
|
|
21
23
|
var _useContext = useContext(IntervalContext),
|
|
22
|
-
includeToday = _useContext.includeToday
|
|
24
|
+
includeToday = _useContext.includeToday,
|
|
25
|
+
searchData = _useContext.searchData,
|
|
26
|
+
refreshLoading = _useContext.refreshLoading;
|
|
23
27
|
// 当前时间段
|
|
24
28
|
var _useState = useState(props.time || getInitDate(includeToday)),
|
|
25
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -100,12 +104,8 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
100
104
|
};
|
|
101
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
102
106
|
className: classPrefix
|
|
103
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
|
|
105
|
-
display: 'flex'
|
|
106
|
-
}
|
|
107
|
-
}, /*#__PURE__*/React.createElement(BizDatePicker, {
|
|
108
|
-
dateTypeList: ['day', 'week', 'month', 'custom'],
|
|
107
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDatePickerV2, {
|
|
108
|
+
dateTypeList: [DatePickerTypes.Unit.day, DatePickerTypes.Unit.week, DatePickerTypes.Unit.month, DatePickerTypes.Unit.custom],
|
|
109
109
|
value: time,
|
|
110
110
|
includeToday: true,
|
|
111
111
|
onChange: onChangeTime
|
|
@@ -121,6 +121,16 @@ var SearchPanel = function SearchPanel(props) {
|
|
|
121
121
|
value: displaySetupSliceList.length > 0 ? displaySetupSliceList : displaySetupList.slice(0, 4),
|
|
122
122
|
labelField: "label",
|
|
123
123
|
keyField: "value"
|
|
124
|
-
}))
|
|
124
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
125
|
+
className: "".concat(classPrefix, "-refresh"),
|
|
126
|
+
disabled: !(searchData !== null && searchData !== void 0 && searchData.start && searchData !== null && searchData !== void 0 && searchData.end),
|
|
127
|
+
loading: refreshLoading,
|
|
128
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
129
|
+
type: "zhongxinjiazai"
|
|
130
|
+
}),
|
|
131
|
+
onClick: function onClick() {
|
|
132
|
+
return props.refreshHandle && props.refreshHandle();
|
|
133
|
+
}
|
|
134
|
+
}, "\u5237\u65B0"));
|
|
125
135
|
};
|
|
126
136
|
export default SearchPanel;
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
justify-content: space-between;
|
|
5
5
|
height: 32px;
|
|
6
6
|
margin-bottom: 24px;
|
|
7
|
+
&-refresh {
|
|
8
|
+
display: flex !important;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
}
|
|
11
|
+
> :nth-child(1) {
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: 16px;
|
|
14
|
+
}
|
|
7
15
|
|
|
8
16
|
.biz-date-picker-wrap-list {
|
|
9
17
|
font-size: 14px;
|
|
@@ -11,12 +19,11 @@
|
|
|
11
19
|
|
|
12
20
|
&-search-right {
|
|
13
21
|
display: flex;
|
|
22
|
+
gap: 16px;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
&-select {
|
|
17
26
|
width: 208px;
|
|
18
|
-
margin-left: 16px;
|
|
19
|
-
|
|
20
27
|
.biz-select-handle-input-multiple {
|
|
21
28
|
.ant-tag:not(:nth-child(-n + 3)) {
|
|
22
29
|
display: none;
|
|
@@ -71,7 +71,7 @@ var EventTable = function EventTable(props) {
|
|
|
71
71
|
var _dataSource$appData;
|
|
72
72
|
var _searchData$userGroup = searchData.userGroup,
|
|
73
73
|
userGroup = _searchData$userGroup === void 0 ? [0] : _searchData$userGroup;
|
|
74
|
-
var _getColumns = getColumns(eventGroupList, userPropList, eventEnvList, (dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData = dataSource.appData) === null || _dataSource$appData === void 0 ? void 0 : _dataSource$appData.x_axis) || [], dataSource, userGroup, searchData, showList, onUserDrill);
|
|
74
|
+
var _getColumns = getColumns(eventGroupList, userPropList, eventEnvList, (dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData = dataSource.appData) === null || _dataSource$appData === void 0 ? void 0 : _dataSource$appData.x_axis) || [], dataSource, userGroup, searchData, showList, onUserDrill, currentApp);
|
|
75
75
|
return _getColumns;
|
|
76
76
|
}, [dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData2 = dataSource.appData) === null || _dataSource$appData2 === void 0 ? void 0 : _dataSource$appData2.x_axis, showList, sortTable, panelName]);
|
|
77
77
|
|
|
@@ -12,10 +12,10 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { Button } from 'antd';
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
|
-
import { BizAddToPanel, BizAddToScene, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
15
|
+
import { BizAddToPanel, BizAddToScene, BizGlobalDataContext, BizPlatformSelector } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
17
|
import { IntervalContext } from "../../types";
|
|
18
|
-
import { chartTypes
|
|
18
|
+
import { chartTypes } from "../../constants/fields";
|
|
19
19
|
import { appVersionType } from '@zgfe/business-lib/es/context';
|
|
20
20
|
var classPrefix = 'modules-interval-topbar';
|
|
21
21
|
var TopBar = function TopBar(props) {
|
|
@@ -65,7 +65,6 @@ var TopBar = function TopBar(props) {
|
|
|
65
65
|
}, [props.eventData]);
|
|
66
66
|
// 保存
|
|
67
67
|
var _onOk = function onOk(type, val) {
|
|
68
|
-
// console.log('onOk', type, val);
|
|
69
68
|
closeHandle(type);
|
|
70
69
|
if (afterEditTarget) afterEditTarget(type, val);
|
|
71
70
|
};
|
|
@@ -129,15 +128,12 @@ var TopBar = function TopBar(props) {
|
|
|
129
128
|
}
|
|
130
129
|
}, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66") : null, /*#__PURE__*/React.createElement("div", {
|
|
131
130
|
className: "".concat(classPrefix, "-platform")
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
platformChange(item.key);
|
|
139
|
-
}
|
|
140
|
-
}, item.value);
|
|
131
|
+
}, /*#__PURE__*/React.createElement(BizPlatformSelector, {
|
|
132
|
+
value: selectPlatform,
|
|
133
|
+
onChange: function onChange(val) {
|
|
134
|
+
setselectPlatform(val.key);
|
|
135
|
+
platformChange(val.key);
|
|
136
|
+
}
|
|
141
137
|
})));
|
|
142
138
|
};
|
|
143
139
|
export default TopBar;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: flex-end;
|
|
6
6
|
margin: 8px 0;
|
|
7
|
-
padding-right: 24px;
|
|
8
7
|
&-panel {
|
|
9
8
|
margin-right: 16px;
|
|
10
9
|
}
|
|
@@ -14,37 +13,4 @@
|
|
|
14
13
|
&-earlywarning {
|
|
15
14
|
margin-right: 16px;
|
|
16
15
|
}
|
|
17
|
-
&-platform {
|
|
18
|
-
display: flex;
|
|
19
|
-
height: 32px;
|
|
20
|
-
line-height: 32px;
|
|
21
|
-
> div {
|
|
22
|
-
position: relative;
|
|
23
|
-
padding: 0 16px;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
background: #fff;
|
|
26
|
-
border: 1px solid #ecedf0;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
}
|
|
29
|
-
> div:hover,
|
|
30
|
-
.active {
|
|
31
|
-
z-index: 1;
|
|
32
|
-
color: #165dff;
|
|
33
|
-
background: #e8efff;
|
|
34
|
-
border: 1px solid #165dff;
|
|
35
|
-
}
|
|
36
|
-
> :nth-child(1) {
|
|
37
|
-
border-radius: 4px 0 0 4px;
|
|
38
|
-
}
|
|
39
|
-
> :nth-child(2) {
|
|
40
|
-
margin-left: -1px;
|
|
41
|
-
}
|
|
42
|
-
> :nth-child(3) {
|
|
43
|
-
margin-left: -1px;
|
|
44
|
-
}
|
|
45
|
-
> :nth-child(4) {
|
|
46
|
-
margin-left: -1px;
|
|
47
|
-
border-radius: 0 4px 4px 0;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
16
|
}
|
|
@@ -11,7 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useContext, useEffect, useState } from 'react';
|
|
14
|
-
import { BizGlobalDataContext, BizLoading, ajax } from '@zgfe/business-lib';
|
|
14
|
+
import { BizEmpty, BizGlobalDataContext, BizLoading, ajax } from '@zgfe/business-lib';
|
|
15
15
|
import { EventTable, MiNone } from "../../components";
|
|
16
16
|
import { extractNames, getDefaultShow } from "../../utils/formData";
|
|
17
17
|
import { Apis } from "../../constants";
|
|
@@ -41,7 +41,7 @@ var IntervalEventChart = function IntervalEventChart(props) {
|
|
|
41
41
|
setLoading = _useState8[1];
|
|
42
42
|
useEffect(function () {
|
|
43
43
|
// 没有dataSource时(看板列表访问),请求查询
|
|
44
|
-
if (!props.dataSource
|
|
44
|
+
if (!props.dataSource) {
|
|
45
45
|
fetchResult();
|
|
46
46
|
}
|
|
47
47
|
}, []);
|
|
@@ -64,9 +64,9 @@ var IntervalEventChart = function IntervalEventChart(props) {
|
|
|
64
64
|
setLoading(true);
|
|
65
65
|
ajax(Apis.dataList, {
|
|
66
66
|
method: 'post',
|
|
67
|
-
data: _objectSpread({
|
|
67
|
+
data: _objectSpread(_objectSpread({
|
|
68
68
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
69
|
-
}, obj)
|
|
69
|
+
}, params), obj)
|
|
70
70
|
}).then(function (res) {
|
|
71
71
|
if (!res) {
|
|
72
72
|
return;
|
|
@@ -88,6 +88,25 @@ var IntervalEventChart = function IntervalEventChart(props) {
|
|
|
88
88
|
className: "mi-common-interval-content"
|
|
89
89
|
}, /*#__PURE__*/React.createElement("div", null));
|
|
90
90
|
}
|
|
91
|
+
if (dataSource !== null && dataSource !== void 0 && dataSource.appData.delEvent) {
|
|
92
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
style: {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
minHeight: 345,
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
alignItems: 'center'
|
|
98
|
+
}
|
|
99
|
+
}, /*#__PURE__*/React.createElement(BizEmpty, {
|
|
100
|
+
imageStyle: {
|
|
101
|
+
height: 58
|
|
102
|
+
},
|
|
103
|
+
description: /*#__PURE__*/React.createElement("span", {
|
|
104
|
+
style: {
|
|
105
|
+
color: '#9AA1A9'
|
|
106
|
+
}
|
|
107
|
+
}, "\u4E8B\u4EF6\u5DF2\u88AB\u5220\u9664\u65E0\u6CD5\u67E5\u770B\uFF0C\u8BF7\u91CD\u65B0\u8BBE\u7F6E")
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
91
110
|
if (!dataSource || !(dataSource !== null && dataSource !== void 0 && (_dataSource$appData2 = dataSource.appData) !== null && _dataSource$appData2 !== void 0 && _dataSource$appData2.series.length)) {
|
|
92
111
|
return /*#__PURE__*/React.createElement(MiNone, {
|
|
93
112
|
label: !dataSource ? '请选择条件进行查询' : '暂无数据'
|
|
@@ -23,6 +23,8 @@ import TopPanel from "../topPanel";
|
|
|
23
23
|
import { message } from 'antd';
|
|
24
24
|
var CancelToken = Request.CancelToken;
|
|
25
25
|
var cancel;
|
|
26
|
+
var refresh = false;
|
|
27
|
+
var timer = 0;
|
|
26
28
|
var classPrefix = 'interval-content';
|
|
27
29
|
var EventContent = function EventContent(props) {
|
|
28
30
|
// 最后的查询数据(防止图表在还没查询时就改变了类型)
|
|
@@ -31,7 +33,8 @@ var EventContent = function EventContent(props) {
|
|
|
31
33
|
finalSearchData = _useState2[0],
|
|
32
34
|
setFinalSearchData = _useState2[1];
|
|
33
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
34
|
-
currentApp = _useContext.currentApp
|
|
36
|
+
currentApp = _useContext.currentApp,
|
|
37
|
+
route = _useContext.route;
|
|
35
38
|
// 查询的结果数据
|
|
36
39
|
var _useState3 = useState(),
|
|
37
40
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -64,13 +67,11 @@ var EventContent = function EventContent(props) {
|
|
|
64
67
|
setSearchData = _useContext2.setSearchData,
|
|
65
68
|
eventGroupList = _useContext2.eventGroupList,
|
|
66
69
|
eventEnvList = _useContext2.eventEnvList,
|
|
67
|
-
userPropList = _useContext2.userPropList
|
|
70
|
+
userPropList = _useContext2.userPropList,
|
|
71
|
+
setRefreshLoading = _useContext2.setRefreshLoading,
|
|
72
|
+
panelId = _useContext2.panelId;
|
|
68
73
|
var _useContext3 = useContext(BizTargetFromPanelContext),
|
|
69
74
|
handleSearch = _useContext3.handleSearch;
|
|
70
|
-
var _useState15 = useState(),
|
|
71
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
72
|
-
searchTimer = _useState16[0],
|
|
73
|
-
setSearchTimer = _useState16[1];
|
|
74
75
|
var collapseRef = useRef();
|
|
75
76
|
// 初始化
|
|
76
77
|
useEffect(function () {
|
|
@@ -90,14 +91,19 @@ var EventContent = function EventContent(props) {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
if (!searchData || !searchData.analysisModel) return;
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if (timer) clearTimeout(timer);
|
|
95
|
+
var flag = true;
|
|
96
|
+
timer = setTimeout(function () {
|
|
97
|
+
if (flag) {
|
|
98
|
+
fetchRequest();
|
|
99
|
+
}
|
|
100
|
+
}, 500);
|
|
97
101
|
return function () {
|
|
98
|
-
|
|
102
|
+
// 清理异步任务
|
|
103
|
+
if (timer) clearTimeout(timer);
|
|
104
|
+
flag = false;
|
|
99
105
|
};
|
|
100
|
-
}, [searchData
|
|
106
|
+
}, [searchData]);
|
|
101
107
|
useEffect(function () {
|
|
102
108
|
handleSearch && handleSearch(loading);
|
|
103
109
|
}, [loading]);
|
|
@@ -110,7 +116,7 @@ var EventContent = function EventContent(props) {
|
|
|
110
116
|
return;
|
|
111
117
|
}
|
|
112
118
|
setEventData(undefined);
|
|
113
|
-
setLoading(true);
|
|
119
|
+
if (!refresh) setLoading(true);
|
|
114
120
|
if (searchData !== null && searchData !== void 0 && (_searchData$associate = searchData.associatedNextAttr) !== null && _searchData$associate !== void 0 && _searchData$associate.type && (searchData === null || searchData === void 0 ? void 0 : (_searchData$associate2 = searchData.associatedPreAttr) === null || _searchData$associate2 === void 0 ? void 0 : _searchData$associate2.type) !== (searchData === null || searchData === void 0 ? void 0 : (_searchData$associate3 = searchData.associatedNextAttr) === null || _searchData$associate3 === void 0 ? void 0 : _searchData$associate3.type)) {
|
|
115
121
|
setLoading(false);
|
|
116
122
|
return message.error('您查询的属性不一致,暂不支持查询');
|
|
@@ -119,13 +125,16 @@ var EventContent = function EventContent(props) {
|
|
|
119
125
|
props.onChange && props.onChange(searchData);
|
|
120
126
|
ajax(Apis.dataList, {
|
|
121
127
|
method: 'post',
|
|
122
|
-
data: _objectSpread({
|
|
128
|
+
data: _objectSpread(_objectSpread({
|
|
123
129
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
124
|
-
}, params),
|
|
130
|
+
}, params), {}, {
|
|
131
|
+
refresh: refresh
|
|
132
|
+
}),
|
|
125
133
|
cancelToken: new CancelToken(function executor(c) {
|
|
126
134
|
cancel = c;
|
|
127
135
|
})
|
|
128
136
|
}).then(function (res) {
|
|
137
|
+
setRefreshLoading(false);
|
|
129
138
|
if (!res) {
|
|
130
139
|
setLoading(false);
|
|
131
140
|
return;
|
|
@@ -141,6 +150,18 @@ var EventContent = function EventContent(props) {
|
|
|
141
150
|
});
|
|
142
151
|
};
|
|
143
152
|
|
|
153
|
+
// 立即刷新
|
|
154
|
+
var refreshHandle = function refreshHandle() {
|
|
155
|
+
refresh = true;
|
|
156
|
+
setRefreshLoading(true);
|
|
157
|
+
if (timer) clearTimeout(timer);
|
|
158
|
+
timer = setTimeout(function () {
|
|
159
|
+
fetchRequest();
|
|
160
|
+
refresh = false;
|
|
161
|
+
clearTimeout(timer);
|
|
162
|
+
}, 500);
|
|
163
|
+
};
|
|
164
|
+
|
|
144
165
|
// 改变时间和图表类型
|
|
145
166
|
var onChangeContent = function onChangeContent(data) {
|
|
146
167
|
setSearchData(function (value) {
|
|
@@ -168,19 +189,21 @@ var EventContent = function EventContent(props) {
|
|
|
168
189
|
setSearchData(function (_searchData) {
|
|
169
190
|
return _objectSpread(_objectSpread({}, data), {}, {
|
|
170
191
|
time: _searchData.time,
|
|
171
|
-
platform: _searchData.platform,
|
|
192
|
+
platform: _searchData.platform || 0,
|
|
172
193
|
userGroup: data.analysisSubject ? undefined : data.userGroup,
|
|
173
194
|
analysisSubject: data.analysisSubject ? data.analysisSubject : undefined
|
|
174
195
|
});
|
|
175
196
|
});
|
|
176
197
|
};
|
|
177
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
198
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
className: "".concat(classPrefix, "-header")
|
|
200
|
+
}, /*#__PURE__*/React.createElement("span", null, !panelId && route && route.query && route.query.title ? route.query.title : '间隔分析'), /*#__PURE__*/React.createElement(TopBar, {
|
|
178
201
|
searchData: searchData,
|
|
179
202
|
loading: loading,
|
|
180
203
|
eventData: eventData,
|
|
181
204
|
platformChange: platformChange,
|
|
182
205
|
onJumpWarning: props.onJumpWarning
|
|
183
|
-
}), /*#__PURE__*/React.createElement(BizLayout, {
|
|
206
|
+
})), /*#__PURE__*/React.createElement(BizLayout, {
|
|
184
207
|
showTitle: false,
|
|
185
208
|
hasCollapse: true,
|
|
186
209
|
className: "interval-layout",
|
|
@@ -203,7 +226,8 @@ var EventContent = function EventContent(props) {
|
|
|
203
226
|
eventId: eventId,
|
|
204
227
|
eventData: eventData,
|
|
205
228
|
enableSelectChart: enableSelectChart,
|
|
206
|
-
onChange: onChangeContent
|
|
229
|
+
onChange: onChangeContent,
|
|
230
|
+
refreshHandle: refreshHandle
|
|
207
231
|
}), /*#__PURE__*/React.createElement(ContentPanel, {
|
|
208
232
|
loading: loading,
|
|
209
233
|
isCity: isCity,
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
1
2
|
.interval-content {
|
|
3
|
+
&-header {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
padding: 0 16px;
|
|
8
|
+
background: #fafafb;
|
|
9
|
+
> span {
|
|
10
|
+
color: var(--io-N-, #021429);
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
font-family: 'PingFang SC';
|
|
14
|
+
font-style: normal;
|
|
15
|
+
line-height: 20px; /* 125% */
|
|
16
|
+
letter-spacing: 0.016px;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
2
20
|
&-options {
|
|
3
21
|
display: flex;
|
|
4
22
|
justify-content: flex-end;
|
|
@@ -84,7 +84,7 @@ export function searchDataParams(params) {
|
|
|
84
84
|
return {
|
|
85
85
|
time: _objectSpread({}, params === null || params === void 0 ? void 0 : params.time),
|
|
86
86
|
platform: (params === null || params === void 0 ? void 0 : params.platform) || 0,
|
|
87
|
-
userGroup: params.userGroup,
|
|
87
|
+
userGroup: params === null || params === void 0 ? void 0 : params.userGroup,
|
|
88
88
|
start: searchCondition(params === null || params === void 0 ? void 0 : params.start),
|
|
89
89
|
end: searchCondition(params === null || params === void 0 ? void 0 : params.end),
|
|
90
90
|
dimension: params !== null && params !== void 0 && (_params$dimension = params.dimension) !== null && _params$dimension !== void 0 && _params$dimension.propCategory ? {
|
|
@@ -35,7 +35,7 @@ export default (function () {
|
|
|
35
35
|
};
|
|
36
36
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
37
37
|
needMeta: true,
|
|
38
|
-
defaultApp:
|
|
38
|
+
defaultApp: 461
|
|
39
39
|
}, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
40
40
|
onClick: function onClick() {
|
|
41
41
|
return setIsDetail(false);
|
|
@@ -32,7 +32,8 @@ export default (function () {
|
|
|
32
32
|
console.log('onUserDrill:111', data, searchData);
|
|
33
33
|
};
|
|
34
34
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
35
|
-
needMeta: true
|
|
35
|
+
needMeta: true,
|
|
36
|
+
defaultApp: 3
|
|
36
37
|
}, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
37
38
|
onClick: function onClick() {
|
|
38
39
|
return setIsDetail(false);
|
|
@@ -12,12 +12,12 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useContext, useEffect, useState } from 'react';
|
|
14
14
|
import { Spin } from 'antd';
|
|
15
|
-
import { BizGlobalDataContext, BizTargetFromPanel } from '@zgfe/business-lib';
|
|
15
|
+
import { BizGlobalDataContext, BizTargetFromPanel, ajax } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
17
|
import { IntervalContext } from "../../types";
|
|
18
18
|
import { getInitDate } from "../../constants/initData";
|
|
19
19
|
import EventContent from "../content";
|
|
20
|
-
import { chartTypes } from "../../constants";
|
|
20
|
+
import { Apis, chartTypes } from "../../constants";
|
|
21
21
|
var classPrefix = 'interval-module-container';
|
|
22
22
|
var ModuleInterval = function ModuleInterval(props) {
|
|
23
23
|
// 属性
|
|
@@ -26,7 +26,8 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
26
26
|
eventGroupList = _useContext.eventGroupList,
|
|
27
27
|
eventEnvList = _useContext.eventEnvList,
|
|
28
28
|
userPropList = _useContext.userPropList,
|
|
29
|
-
userGroupList = _useContext.userGroupList
|
|
29
|
+
userGroupList = _useContext.userGroupList,
|
|
30
|
+
useBizStoreLoading = _useContext.useBizStoreLoading;
|
|
30
31
|
var _useState = useState(),
|
|
31
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
33
|
searchData = _useState2[0],
|
|
@@ -36,40 +37,57 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
36
37
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
38
|
loading = _useState4[0],
|
|
38
39
|
setLoading = _useState4[1];
|
|
39
|
-
//
|
|
40
|
-
var _useState5 = useState(),
|
|
40
|
+
// 刷新loading
|
|
41
|
+
var _useState5 = useState(false),
|
|
41
42
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
refreshLoading = _useState6[0],
|
|
44
|
+
setRefreshLoading = _useState6[1];
|
|
45
|
+
// 指标标题
|
|
44
46
|
var _useState7 = useState(),
|
|
45
47
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
title = _useState8[0],
|
|
49
|
+
setTitle = _useState8[1];
|
|
48
50
|
var _useState9 = useState(),
|
|
49
51
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
panelId = _useState10[0],
|
|
53
|
+
setPanelId = _useState10[1];
|
|
52
54
|
var _useState11 = useState(),
|
|
53
55
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _useState13 = useState(
|
|
57
|
-
_useState14 = _slicedToArray(_useState13,
|
|
58
|
-
|
|
56
|
+
elementId = _useState12[0],
|
|
57
|
+
setElementId = _useState12[1];
|
|
58
|
+
var _useState13 = useState(),
|
|
59
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
60
|
+
showList = _useState14[0],
|
|
61
|
+
setShowList = _useState14[1];
|
|
62
|
+
var _useState15 = useState(false),
|
|
63
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
64
|
+
subjectEnable = _useState16[0],
|
|
65
|
+
setSubjectEnable = _useState16[1];
|
|
59
66
|
// 初始化
|
|
60
67
|
useEffect(function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
setLoading(true);
|
|
69
|
+
ajax(Apis.querySubjectDisplay, {
|
|
70
|
+
method: 'post',
|
|
71
|
+
data: {
|
|
72
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
73
|
+
}
|
|
74
|
+
}).then(function (res) {
|
|
75
|
+
if (!res) return;
|
|
76
|
+
setSubjectEnable(res.data);
|
|
77
|
+
// 设置初始值
|
|
78
|
+
if (!props.defaultValue) {
|
|
79
|
+
initSearch();
|
|
80
|
+
} else {
|
|
81
|
+
setShowList(props.defaultValue.chosen_data);
|
|
82
|
+
setPanelId(props.defaultValue.panelId);
|
|
83
|
+
setElementId(props.defaultValue.id);
|
|
84
|
+
setTitle(props.defaultValue.name);
|
|
85
|
+
setSearchData(props.defaultValue.data);
|
|
86
|
+
}
|
|
87
|
+
setTimeout(function () {
|
|
88
|
+
setLoading(false);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
73
91
|
}, []);
|
|
74
92
|
|
|
75
93
|
// 查询条件初始化
|
|
@@ -77,13 +95,14 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
77
95
|
setSearchData({
|
|
78
96
|
userGroup: (userGroupList === null || userGroupList === void 0 ? void 0 : userGroupList.length) > 0 ? [userGroupList[0].id] : [0],
|
|
79
97
|
time: getInitDate(props.includeToday),
|
|
80
|
-
chartType: 'boxplot'
|
|
98
|
+
chartType: 'boxplot',
|
|
99
|
+
platform: 0
|
|
81
100
|
});
|
|
82
101
|
};
|
|
83
102
|
useEffect(function () {
|
|
84
103
|
if (props.onChange) props.onChange(searchData);
|
|
85
104
|
}, [searchData]);
|
|
86
|
-
if (loading) {
|
|
105
|
+
if (loading || useBizStoreLoading) {
|
|
87
106
|
return /*#__PURE__*/React.createElement("div", {
|
|
88
107
|
className: classPrefix
|
|
89
108
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
@@ -108,10 +127,10 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
108
127
|
styleOptions: chartTypes,
|
|
109
128
|
afterEditTarget: props.afterEditTarget,
|
|
110
129
|
children: ""
|
|
111
|
-
}),
|
|
112
|
-
className: "".concat(classPrefix, "-header-title")
|
|
113
|
-
}, "\u95F4\u9694\u5206\u6790"), /*#__PURE__*/React.createElement(IntervalContext.Provider, {
|
|
130
|
+
}), /*#__PURE__*/React.createElement(IntervalContext.Provider, {
|
|
114
131
|
value: {
|
|
132
|
+
refreshLoading: refreshLoading,
|
|
133
|
+
setRefreshLoading: setRefreshLoading,
|
|
115
134
|
panelId: panelId,
|
|
116
135
|
elementId: elementId,
|
|
117
136
|
eventGroupList: eventGroupList,
|
|
@@ -10,9 +10,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { useContext, useState } from 'react';
|
|
14
|
-
import { Form, Button, Radio, Space, Switch } from 'antd';
|
|
15
|
-
import { BizAttributeSelector, BizSelect, BizUserGroupHeader } from '@zgfe/business-lib';
|
|
13
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
14
|
+
import { Form, Button, Radio, Space, Switch, Tooltip } from 'antd';
|
|
15
|
+
import { BizAttributeSelector, BizGlobalDataContext, BizSelect, BizUserGroupHeader, IconFont, useSubject } from '@zgfe/business-lib';
|
|
16
16
|
import EventFilter from "../../components/eventFilter";
|
|
17
17
|
import "./styles/index.less";
|
|
18
18
|
import { AnalysisMode } from "./types";
|
|
@@ -24,6 +24,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
24
24
|
loading = props.loading,
|
|
25
25
|
collapseRef = props.collapseRef,
|
|
26
26
|
finalSearchData = props.finalSearchData;
|
|
27
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
28
|
+
currentApp = _useContext.currentApp;
|
|
27
29
|
var _Form$useForm = Form.useForm(),
|
|
28
30
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
29
31
|
form = _Form$useForm2[0];
|
|
@@ -40,8 +42,11 @@ var TopPanel = function TopPanel(props) {
|
|
|
40
42
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
43
|
relevancy = _useState6[0],
|
|
42
44
|
setRelevancy = _useState6[1];
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
+
var _useSubject = useSubject(),
|
|
46
|
+
subjectList = _useSubject.subjectList,
|
|
47
|
+
subjectLoading = _useSubject.loading;
|
|
48
|
+
var _useContext2 = useContext(IntervalContext),
|
|
49
|
+
subjectEnable = _useContext2.subjectEnable;
|
|
45
50
|
var _ref = defaultValue || {},
|
|
46
51
|
userGroup = _ref.userGroup;
|
|
47
52
|
var _useState7 = useState('user'),
|
|
@@ -52,6 +57,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
52
57
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
53
58
|
currentSubject = _useState10[0],
|
|
54
59
|
setCurrentSubject = _useState10[1];
|
|
60
|
+
var _useState11 = useState(false),
|
|
61
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
62
|
+
inited = _useState12[0],
|
|
63
|
+
setInited = _useState12[1];
|
|
55
64
|
var formRef = React.useRef(null);
|
|
56
65
|
function onSearch(values) {
|
|
57
66
|
if (props.onChange) {
|
|
@@ -90,6 +99,27 @@ var TopPanel = function TopPanel(props) {
|
|
|
90
99
|
associatedNextAttr: undefined
|
|
91
100
|
}, true);
|
|
92
101
|
};
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
if (subjectLoading) return;
|
|
104
|
+
if (!defaultValue) {
|
|
105
|
+
setInited(true);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
setInited(false);
|
|
109
|
+
if (defaultValue.analysisSubject) {
|
|
110
|
+
setAnalysisType('eventProp');
|
|
111
|
+
} else {
|
|
112
|
+
setAnalysisType('user');
|
|
113
|
+
}
|
|
114
|
+
if (defaultValue.analysisSubject) {
|
|
115
|
+
setCurrentSubject(subjectList.find(function (item) {
|
|
116
|
+
var _defaultValue$analysi;
|
|
117
|
+
return item.id === (defaultValue === null || defaultValue === void 0 ? void 0 : (_defaultValue$analysi = defaultValue.analysisSubject) === null || _defaultValue$analysi === void 0 ? void 0 : _defaultValue$analysi.subjectId);
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
setInited(true);
|
|
121
|
+
}, [subjectLoading]);
|
|
122
|
+
if (!inited) return null;
|
|
93
123
|
return /*#__PURE__*/React.createElement(Form, {
|
|
94
124
|
form: form,
|
|
95
125
|
ref: formRef,
|
|
@@ -127,11 +157,21 @@ var TopPanel = function TopPanel(props) {
|
|
|
127
157
|
scrollToFirstError: true,
|
|
128
158
|
onFinish: onSearch
|
|
129
159
|
}, subjectEnable && /*#__PURE__*/React.createElement(Form.Item, {
|
|
130
|
-
label: "
|
|
160
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "".concat(classPrefix, "-label-hasIcon")
|
|
162
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u7EDF\u8BA1\u53E3\u5F84"), "\xA0\xA0", /*#__PURE__*/React.createElement(Tooltip, {
|
|
163
|
+
title: "\u5E2E\u52A9",
|
|
164
|
+
placement: "top"
|
|
165
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
166
|
+
type: "bangzhu",
|
|
167
|
+
onClick: function onClick() {
|
|
168
|
+
return window.open('https://docs.zhugeio.com/datamanager/Statistical_caliber.html', '_blank');
|
|
169
|
+
}
|
|
170
|
+
}))),
|
|
131
171
|
className: "panel-form-interval-item"
|
|
132
172
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
133
173
|
options: [{
|
|
134
|
-
label: '用户',
|
|
174
|
+
label: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) != 'user' ? '主体' : '用户',
|
|
135
175
|
value: 'user'
|
|
136
176
|
}, {
|
|
137
177
|
label: '事件属性',
|
|
@@ -145,6 +185,31 @@ var TopPanel = function TopPanel(props) {
|
|
|
145
185
|
setAnalysisType(val.value);
|
|
146
186
|
resetting();
|
|
147
187
|
}
|
|
188
|
+
})), analysisType === 'eventProp' && /*#__PURE__*/React.createElement(Form.Item, {
|
|
189
|
+
label: "\u53E3\u5F84\u540D\u79F0",
|
|
190
|
+
name: "analysisSubject",
|
|
191
|
+
className: "panel-form-interval-item",
|
|
192
|
+
rules: [{
|
|
193
|
+
validator: function validator(rule, value) {
|
|
194
|
+
if (!value) {
|
|
195
|
+
return Promise.reject('请选择口径名称');
|
|
196
|
+
}
|
|
197
|
+
return Promise.resolve();
|
|
198
|
+
}
|
|
199
|
+
}]
|
|
200
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
201
|
+
options: subjectList,
|
|
202
|
+
aliasField: "subjectAlias",
|
|
203
|
+
labelField: "subjectName",
|
|
204
|
+
keyField: "id",
|
|
205
|
+
onChange: function onChange(val) {
|
|
206
|
+
var _formRef$current, _formRef$current2, _formRef$current3;
|
|
207
|
+
setCurrentSubject(val);
|
|
208
|
+
setRelevancy(false);
|
|
209
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('start', undefined);
|
|
210
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('end', undefined);
|
|
211
|
+
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldValue('dimension', undefined);
|
|
212
|
+
}
|
|
148
213
|
})), analysisType === 'user' && /*#__PURE__*/React.createElement(Form.Item, {
|
|
149
214
|
label: "",
|
|
150
215
|
name: "userGroup",
|
|
@@ -195,9 +260,9 @@ var TopPanel = function TopPanel(props) {
|
|
|
195
260
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
196
261
|
analysisType: analysisType,
|
|
197
262
|
onChange: function onChange(evt) {
|
|
198
|
-
var _formRef$
|
|
263
|
+
var _formRef$current4;
|
|
199
264
|
setStartEvent(evt);
|
|
200
|
-
(_formRef$
|
|
265
|
+
(_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.setFieldValue('dimension', undefined);
|
|
201
266
|
}
|
|
202
267
|
})), /*#__PURE__*/React.createElement(Space, {
|
|
203
268
|
align: "baseline",
|
|
@@ -242,8 +307,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
242
307
|
enableDelete: true,
|
|
243
308
|
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-pre"),
|
|
244
309
|
onDelete: function onDelete() {
|
|
245
|
-
var _formRef$
|
|
246
|
-
(_formRef$
|
|
310
|
+
var _formRef$current5;
|
|
311
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('associatedPreAttr', undefined);
|
|
247
312
|
}
|
|
248
313
|
}))), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
249
314
|
className: "associated-label"
|
|
@@ -265,8 +330,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
265
330
|
enableDelete: true,
|
|
266
331
|
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-next"),
|
|
267
332
|
onDelete: function onDelete() {
|
|
268
|
-
var _formRef$
|
|
269
|
-
(_formRef$
|
|
333
|
+
var _formRef$current6;
|
|
334
|
+
(_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.setFieldValue('associatedNextAttr', undefined);
|
|
270
335
|
}
|
|
271
336
|
}))), /*#__PURE__*/React.createElement("i", {
|
|
272
337
|
style: {
|
|
@@ -275,9 +340,9 @@ var TopPanel = function TopPanel(props) {
|
|
|
275
340
|
cursor: 'pointer'
|
|
276
341
|
},
|
|
277
342
|
onClick: function onClick() {
|
|
278
|
-
var _formRef$
|
|
279
|
-
(_formRef$
|
|
280
|
-
(_formRef$
|
|
343
|
+
var _formRef$current7, _formRef$current8;
|
|
344
|
+
(_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : _formRef$current7.setFieldValue('associatedPreAttr', undefined);
|
|
345
|
+
(_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : _formRef$current8.setFieldValue('associatedNextAttr', undefined);
|
|
281
346
|
setRelevancy(false);
|
|
282
347
|
},
|
|
283
348
|
className: "bsicon qingchu"
|
|
@@ -310,9 +375,9 @@ var TopPanel = function TopPanel(props) {
|
|
|
310
375
|
analysisType: analysisType,
|
|
311
376
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
312
377
|
onChange: function onChange(val) {
|
|
313
|
-
var _formRef$
|
|
378
|
+
var _formRef$current9;
|
|
314
379
|
setEndEvent(val);
|
|
315
|
-
(_formRef$
|
|
380
|
+
(_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : _formRef$current9.setFieldValue('dimension', undefined);
|
|
316
381
|
}
|
|
317
382
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
318
383
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
@@ -327,8 +392,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
327
392
|
showCommonProp: true,
|
|
328
393
|
enableDelete: true,
|
|
329
394
|
onDelete: function onDelete() {
|
|
330
|
-
var _formRef$
|
|
331
|
-
(_formRef$
|
|
395
|
+
var _formRef$current10;
|
|
396
|
+
(_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : _formRef$current10.setFieldValue('dimension', undefined);
|
|
332
397
|
}
|
|
333
398
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
334
399
|
label: "\u5206\u6790\u6A21\u578B",
|
|
@@ -343,11 +408,11 @@ var TopPanel = function TopPanel(props) {
|
|
|
343
408
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
344
409
|
onClick: resetting
|
|
345
410
|
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
|
|
346
|
-
loading: loading,
|
|
411
|
+
loading: loading || subjectLoading,
|
|
347
412
|
type: "primary",
|
|
348
413
|
onClick: function onClick() {
|
|
349
|
-
var _formRef$
|
|
350
|
-
(_formRef$
|
|
414
|
+
var _formRef$current11;
|
|
415
|
+
(_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : _formRef$current11.submit();
|
|
351
416
|
}
|
|
352
417
|
}, "\u67E5\u8BE2"))));
|
|
353
418
|
};
|
|
@@ -9,7 +9,7 @@ import { DisplaySetup } from '../components/searchPanel/types';
|
|
|
9
9
|
* @param columnData xAxis
|
|
10
10
|
* @returns column fields
|
|
11
11
|
*/
|
|
12
|
-
export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], dataSource: ResponseDataProps, userGroup: number[], searchData: SearchValue, showList: string[], onUserDrill: IntervalProps.Props['onUserDrill']): ColumnsType<IntervalProps.ColumnsDataType>;
|
|
12
|
+
export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], dataSource: ResponseDataProps, userGroup: number[], searchData: SearchValue, showList: string[], onUserDrill: IntervalProps.Props['onUserDrill'], currentApp?: any): ColumnsType<IntervalProps.ColumnsDataType>;
|
|
13
13
|
/**
|
|
14
14
|
* 获取属性的label
|
|
15
15
|
* @param attrData 当前属性
|
|
@@ -48,7 +48,7 @@ export declare function formTableData(originalData: ChartData): {
|
|
|
48
48
|
min: number;
|
|
49
49
|
perValue: number;
|
|
50
50
|
total: number;
|
|
51
|
-
peopleNum:
|
|
51
|
+
peopleNum: string;
|
|
52
52
|
children: {
|
|
53
53
|
key: string;
|
|
54
54
|
time: string;
|
|
@@ -32,7 +32,7 @@ function convertToHMS(seconds) {
|
|
|
32
32
|
* @param columnData xAxis
|
|
33
33
|
* @returns column fields
|
|
34
34
|
*/
|
|
35
|
-
export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, dataSource, userGroup, searchData, showList, onUserDrill
|
|
35
|
+
export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, dataSource, userGroup, searchData, showList, onUserDrill, currentApp
|
|
36
36
|
// onClickToDetailCallback: Function,
|
|
37
37
|
) {
|
|
38
38
|
var _dataSource$appData, _dataSource$appData$s, _searchData$dimension;
|
|
@@ -154,7 +154,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
154
154
|
return /*#__PURE__*/React.createElement("span", null, " ", convertToHMS(text));
|
|
155
155
|
}
|
|
156
156
|
}, {
|
|
157
|
-
title: searchData.analysisSubject ? "".concat(searchData.analysisSubject.subjectAlias || searchData.analysisSubject.subjectName, "\u6570") : '
|
|
157
|
+
title: searchData.analysisSubject ? "".concat(searchData.analysisSubject.subjectAlias || searchData.analysisSubject.subjectName, "\u6570") : "".concat(currentApp.type != 'user' ? currentApp.unit : '人', "\u6570"),
|
|
158
158
|
width: 148,
|
|
159
159
|
ellipsis: true,
|
|
160
160
|
align: 'right',
|
|
@@ -166,6 +166,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
166
166
|
key: 'peopleNum',
|
|
167
167
|
className: "".concat(classPrefix, "-table-td"),
|
|
168
168
|
render: function render(text, record) {
|
|
169
|
+
if (text == '-') return text;
|
|
169
170
|
return /*#__PURE__*/React.createElement("span", {
|
|
170
171
|
className: "interval-drill",
|
|
171
172
|
onClick: function onClick() {
|
|
@@ -242,7 +243,7 @@ function createNewArray(data) {
|
|
|
242
243
|
min: item.total[4] || 0,
|
|
243
244
|
perValue: item.total[5] || 0,
|
|
244
245
|
total: item.total[6] || 0,
|
|
245
|
-
peopleNum:
|
|
246
|
+
peopleNum: '-',
|
|
246
247
|
children: getChildrenData(data, i)
|
|
247
248
|
};
|
|
248
249
|
});
|
package/package.json
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-interval",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23-zhongyuan.0",
|
|
4
|
+
"module": "dist/esm/index.js",
|
|
5
|
+
"typings": "dist/esm/index.d.ts",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
4
13
|
"scripts": {
|
|
5
|
-
"start": "dumi dev",
|
|
6
|
-
"docs:build": "dumi build",
|
|
7
|
-
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
14
|
"build": "father build",
|
|
9
15
|
"deploy": "npm run docs:build && npm run docs:deploy",
|
|
16
|
+
"docs:build": "dumi build",
|
|
17
|
+
"docs:deploy": "gh-pages -d docs-dist",
|
|
18
|
+
"prepublishOnly": "npm run build",
|
|
10
19
|
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
11
|
-
"test": "umi-test",
|
|
12
20
|
"pub": "lerna publish",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"module": "dist/esm/index.js",
|
|
23
|
-
"typings": "dist/esm/index.d.ts",
|
|
24
|
-
"gitHooks": {
|
|
25
|
-
"pre-commit": "lint-staged"
|
|
21
|
+
"start": "dumi dev",
|
|
22
|
+
"test": "umi-test",
|
|
23
|
+
"test:coverage": "umi-test --coverage"
|
|
26
24
|
},
|
|
27
25
|
"lint-staged": {
|
|
28
26
|
"*.{js,jsx,less,md,json}": [
|
|
@@ -47,20 +45,22 @@
|
|
|
47
45
|
"@types/uuid": "^9.0.2",
|
|
48
46
|
"@umijs/fabric": "^2.8.1",
|
|
49
47
|
"@umijs/test": "^3.0.5",
|
|
50
|
-
"@zgfe/business-lib": "1.2.
|
|
51
|
-
"@zgfe/modules-demo-manage": "^1.0.1",
|
|
48
|
+
"@zgfe/business-lib": "1.2.70-hxd.1",
|
|
52
49
|
"antd": "^4.22.6",
|
|
53
50
|
"dumi": "^1.1.0",
|
|
54
51
|
"echarts": "^5.3.2",
|
|
55
52
|
"echarts-for-react": "^3.0.2",
|
|
56
53
|
"father-build": "^1.17.2",
|
|
57
54
|
"gh-pages": "^3.0.0",
|
|
58
|
-
"lerna": "5.1.8",
|
|
55
|
+
"lerna": "^5.1.8",
|
|
59
56
|
"lint-staged": "^10.0.7",
|
|
60
57
|
"lodash": "^4.17.21",
|
|
61
58
|
"prettier": "^2.2.1",
|
|
62
59
|
"umi-request": "^1.4.0",
|
|
63
60
|
"yorkie": "^2.0.0"
|
|
64
61
|
},
|
|
65
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "c1029ad4038cc39d49878a4ced941e120ec59982",
|
|
63
|
+
"gitHooks": {
|
|
64
|
+
"pre-commit": "lint-staged"
|
|
65
|
+
}
|
|
66
66
|
}
|