@zgfe/modules-interval 1.0.3-alpha.1 → 1.0.3-alpha.10
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/dist/esm/components/eventFilter/index.js +13 -4
- package/dist/esm/components/searchPanel/index.js +2 -2
- package/dist/esm/components/table/index.js +2 -2
- package/dist/esm/components/topBar/index.js +3 -3
- package/dist/esm/components/topBar/types.d.ts +3 -2
- package/dist/esm/constants/apis.js +2 -1
- package/dist/esm/modules/content/index.js +4 -4
- package/dist/esm/modules/content/types.d.ts +4 -3
- package/dist/esm/modules/home/demo/index.js +6 -13
- package/dist/esm/modules/home/index.d.ts +2 -2
- package/dist/esm/modules/home/index.js +45 -42
- package/dist/esm/modules/home/types.d.ts +5 -4
- package/dist/esm/modules/home/types.js +2 -2
- package/dist/esm/modules/topPanel/index.js +17 -8
- package/dist/esm/modules/topPanel/types.d.ts +0 -1
- package/dist/esm/types.d.ts +15 -15
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/formData.d.ts +4 -2
- package/dist/esm/utils/formData.js +14 -4
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { Switch, Tooltip, message } from 'antd';
|
|
14
14
|
import React, { useEffect, useRef, useState } from 'react';
|
|
15
|
-
import { BizEventSelector, IconFont, BizAttrConditionGroup } from '@zgfe/business-lib';
|
|
15
|
+
import { BizEventSelector, IconFont, BizAttrConditionGroup, useChanged } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
17
|
import _ from 'lodash';
|
|
18
18
|
var classPrefix = 'interval-box';
|
|
@@ -59,7 +59,7 @@ var EventFilter = function EventFilter(props) {
|
|
|
59
59
|
setBizAttributeSelectorValue = _useState14[1];
|
|
60
60
|
|
|
61
61
|
// 初始化
|
|
62
|
-
|
|
62
|
+
useChanged(function () {
|
|
63
63
|
if (props.value) {
|
|
64
64
|
var _data = props.value;
|
|
65
65
|
if (_data && _data.id) {
|
|
@@ -80,8 +80,17 @@ var EventFilter = function EventFilter(props) {
|
|
|
80
80
|
key: _data.dimension.propCategory === 'eventProp' ? _data.dimension.value : _data.dimension.propCategory + '-' + _data.dimension.value
|
|
81
81
|
}));
|
|
82
82
|
}
|
|
83
|
+
} else {
|
|
84
|
+
setEvent({
|
|
85
|
+
id: null,
|
|
86
|
+
name: ''
|
|
87
|
+
});
|
|
88
|
+
setEventOverview(false);
|
|
89
|
+
setFilter(undefined);
|
|
90
|
+
setBizAttributeSelectorValue(undefined);
|
|
91
|
+
setRelevancy(false);
|
|
83
92
|
}
|
|
84
|
-
},
|
|
93
|
+
}, props.value);
|
|
85
94
|
|
|
86
95
|
// 添加筛选
|
|
87
96
|
var onAdd = function onAdd() {
|
|
@@ -197,8 +206,8 @@ var EventFilter = function EventFilter(props) {
|
|
|
197
206
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
198
207
|
ref: conditionRef,
|
|
199
208
|
value: filter,
|
|
200
|
-
onlyAnd: true,
|
|
201
209
|
enableEventProp: true,
|
|
210
|
+
enableUserProp: props.subject ? false : true,
|
|
202
211
|
enableDelete: true,
|
|
203
212
|
eventIdList: [event.id],
|
|
204
213
|
onChange: onChangeFilters,
|
|
@@ -13,12 +13,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { BizDatePicker, BizSelect } from '@zgfe/business-lib';
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { chartTypeOptions, getInitDate } from "../../constants";
|
|
16
|
-
import {
|
|
16
|
+
import { IntervalContext } from "../../types";
|
|
17
17
|
import "./styles/index.less";
|
|
18
18
|
import { extractNames } from "../../utils/formData";
|
|
19
19
|
var classPrefix = 'search-panel-interval';
|
|
20
20
|
var SearchPanel = function SearchPanel(props) {
|
|
21
|
-
var _useContext = useContext(
|
|
21
|
+
var _useContext = useContext(IntervalContext),
|
|
22
22
|
includeToday = _useContext.includeToday;
|
|
23
23
|
// 当前时间段
|
|
24
24
|
var _useState = useState(props.time || getInitDate(includeToday)),
|
|
@@ -17,7 +17,7 @@ import { message } from 'antd';
|
|
|
17
17
|
import { formTableData, getColumns } from "../../utils/formData";
|
|
18
18
|
import "./styles/index.less";
|
|
19
19
|
import { searchDataParams } from "../../modules/content/utils";
|
|
20
|
-
import {
|
|
20
|
+
import { IntervalContext } from "../../types";
|
|
21
21
|
var classPrefix = 'mi-interval-table';
|
|
22
22
|
var EventTable = function EventTable(props) {
|
|
23
23
|
var _dataSource$appData2;
|
|
@@ -35,7 +35,7 @@ var EventTable = function EventTable(props) {
|
|
|
35
35
|
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
|
|
36
36
|
eventEnvList = _useContext.eventEnvList,
|
|
37
37
|
userPropList = _useContext.userPropList;
|
|
38
|
-
var _useContext2 = useContext(
|
|
38
|
+
var _useContext2 = useContext(IntervalContext),
|
|
39
39
|
panelName = _useContext2.panelName,
|
|
40
40
|
onUserDrill = _useContext2.onUserDrill;
|
|
41
41
|
|
|
@@ -14,12 +14,12 @@ import { Button } from 'antd';
|
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { BizAddToPanel, BizAddToScene, BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
|
-
import {
|
|
17
|
+
import { IntervalContext } from "../../types";
|
|
18
18
|
import { chartTypes, platformOption } 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) {
|
|
22
|
-
var _useContext = useContext(
|
|
22
|
+
var _useContext = useContext(IntervalContext),
|
|
23
23
|
panelId = _useContext.panelId,
|
|
24
24
|
afterEditTarget = _useContext.afterEditTarget,
|
|
25
25
|
enableAddScene = _useContext.enableAddScene;
|
|
@@ -118,7 +118,7 @@ var TopBar = function TopBar(props) {
|
|
|
118
118
|
type: "primary",
|
|
119
119
|
disabled: showLoading,
|
|
120
120
|
onClick: function onClick() {
|
|
121
|
-
props.
|
|
121
|
+
props.onJumpWarning({
|
|
122
122
|
appId: Number(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId),
|
|
123
123
|
module: 'interval',
|
|
124
124
|
platform: 0,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntervalProps } from '../../modules/home/types';
|
|
2
|
+
import { ResponseDataProps, SearchValue } from '../../types';
|
|
2
3
|
export interface TopBarProps {
|
|
3
4
|
/**
|
|
4
5
|
* @description 标题
|
|
@@ -6,6 +7,6 @@ export interface TopBarProps {
|
|
|
6
7
|
searchData?: SearchValue;
|
|
7
8
|
loading?: boolean;
|
|
8
9
|
eventData?: ResponseDataProps;
|
|
9
|
-
|
|
10
|
+
onJumpWarning: IntervalProps.Props['onJumpWarning'];
|
|
10
11
|
platformChange: (data: number) => void;
|
|
11
12
|
}
|
|
@@ -14,7 +14,7 @@ import { ajax, BizGlobalDataContext, BizLayout, BizTargetFromPanelContext } from
|
|
|
14
14
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
15
15
|
import Request from 'umi-request';
|
|
16
16
|
import TopBar from "../../components/topBar";
|
|
17
|
-
import {
|
|
17
|
+
import { IntervalContext } from "../../types";
|
|
18
18
|
import "./styles/index.less";
|
|
19
19
|
import { Apis } from "../../constants";
|
|
20
20
|
import { judgeIsCity, judgeIsArea, getValue, searchDataParams } from "./utils";
|
|
@@ -64,7 +64,7 @@ var EventContent = function EventContent(props) {
|
|
|
64
64
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
65
65
|
eventId = _useState16[0],
|
|
66
66
|
setEventId = _useState16[1];
|
|
67
|
-
var _useContext2 = useContext(
|
|
67
|
+
var _useContext2 = useContext(IntervalContext),
|
|
68
68
|
searchData = _useContext2.searchData,
|
|
69
69
|
setSearchData = _useContext2.setSearchData,
|
|
70
70
|
eventGroupList = _useContext2.eventGroupList,
|
|
@@ -88,6 +88,7 @@ var EventContent = function EventContent(props) {
|
|
|
88
88
|
setIsCity(judgeIsCity(_attrName));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
if (!searchData || !searchData.analysisModel) return;
|
|
91
92
|
if (timer) clearTimeout(timer);
|
|
92
93
|
var flag = true;
|
|
93
94
|
timer = setTimeout(function () {
|
|
@@ -195,7 +196,7 @@ var EventContent = function EventContent(props) {
|
|
|
195
196
|
loading: loading,
|
|
196
197
|
eventData: eventData,
|
|
197
198
|
platformChange: platformChange,
|
|
198
|
-
|
|
199
|
+
onJumpWarning: props.onJumpWarning
|
|
199
200
|
}), /*#__PURE__*/React.createElement(BizLayout, {
|
|
200
201
|
showTitle: false,
|
|
201
202
|
hasCollapse: true,
|
|
@@ -205,7 +206,6 @@ var EventContent = function EventContent(props) {
|
|
|
205
206
|
collapseRef: collapseRef,
|
|
206
207
|
onChange: onChangeSearch,
|
|
207
208
|
defaultValue: searchData,
|
|
208
|
-
urlParam: props.urlParam,
|
|
209
209
|
ajaxFlag: ajaxFlag,
|
|
210
210
|
loading: loading,
|
|
211
211
|
finalSearchData: finalSearchData,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SearchValue
|
|
1
|
+
import { SearchValue } from '../../types';
|
|
2
|
+
import { IntervalProps } from '../home/types';
|
|
2
3
|
export declare namespace EventContentProps {
|
|
3
4
|
interface Props {
|
|
4
5
|
/**
|
|
@@ -9,7 +10,6 @@ export declare namespace EventContentProps {
|
|
|
9
10
|
* 默认值
|
|
10
11
|
*/
|
|
11
12
|
value: SearchValue;
|
|
12
|
-
urlParam?: SearchValue;
|
|
13
13
|
/**
|
|
14
14
|
* 展示列表
|
|
15
15
|
*/
|
|
@@ -18,7 +18,8 @@ export declare namespace EventContentProps {
|
|
|
18
18
|
* 是否查询中
|
|
19
19
|
*/
|
|
20
20
|
onSearching?: (flag: boolean) => void;
|
|
21
|
-
onUserDrill:
|
|
21
|
+
onUserDrill: IntervalProps.Props['onUserDrill'];
|
|
22
|
+
onJumpWarning: IntervalProps.Props['onJumpWarning'];
|
|
22
23
|
/**
|
|
23
24
|
* 查询条件回调
|
|
24
25
|
*/
|
|
@@ -17,17 +17,11 @@ export default (function () {
|
|
|
17
17
|
isDetail = _useState2[0],
|
|
18
18
|
setIsDetail = _useState2[1];
|
|
19
19
|
var _useState3 = useState(),
|
|
20
|
-
_useState4 = _slicedToArray(_useState3,
|
|
21
|
-
detailParams = _useState4[0]
|
|
22
|
-
setDetailParams = _useState4[1];
|
|
20
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
21
|
+
detailParams = _useState4[0];
|
|
23
22
|
var _useState5 = useState(),
|
|
24
|
-
_useState6 = _slicedToArray(_useState5,
|
|
25
|
-
searchParams = _useState6[0]
|
|
26
|
-
setSearchParams = _useState6[1];
|
|
27
|
-
var _useState7 = useState(),
|
|
28
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
29
|
-
urlParam = _useState8[0],
|
|
30
|
-
setUrlParam = _useState8[1];
|
|
23
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
24
|
+
searchParams = _useState6[0];
|
|
31
25
|
useEffect(function () {
|
|
32
26
|
setGlobalConfig(requestConfig);
|
|
33
27
|
}, []);
|
|
@@ -45,9 +39,8 @@ export default (function () {
|
|
|
45
39
|
return setIsDetail(false);
|
|
46
40
|
}
|
|
47
41
|
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
|
|
48
|
-
defaultValue: searchParams,
|
|
49
|
-
urlParam: urlParam,
|
|
50
42
|
afterEditTarget: afterEditTarget,
|
|
51
|
-
onUserDrill: onUserDrill
|
|
43
|
+
onUserDrill: onUserDrill,
|
|
44
|
+
onJumpWarning: function onJumpWarning() {}
|
|
52
45
|
}));
|
|
53
46
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/index.less';
|
|
3
|
-
import {
|
|
4
|
-
declare const ModuleInterval: React.FC<
|
|
3
|
+
import { IntervalProps } from './types';
|
|
4
|
+
declare const ModuleInterval: React.FC<IntervalProps.Props>;
|
|
5
5
|
export default ModuleInterval;
|
|
@@ -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
|
-
import {
|
|
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
|
// 属性
|
|
@@ -36,43 +36,52 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
36
36
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
37
|
loading = _useState4[0],
|
|
38
38
|
setLoading = _useState4[1];
|
|
39
|
-
var _useState5 = useState(true),
|
|
40
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
|
-
pageLoading = _useState6[0],
|
|
42
|
-
setPageLoading = _useState6[1];
|
|
43
39
|
// 指标标题
|
|
40
|
+
var _useState5 = useState(),
|
|
41
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
+
title = _useState6[0],
|
|
43
|
+
setTitle = _useState6[1];
|
|
44
44
|
var _useState7 = useState(),
|
|
45
45
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
panelId = _useState8[0],
|
|
47
|
+
setPanelId = _useState8[1];
|
|
48
48
|
var _useState9 = useState(),
|
|
49
49
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
elementId = _useState10[0],
|
|
51
|
+
setElementId = _useState10[1];
|
|
52
52
|
var _useState11 = useState(),
|
|
53
53
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _useState13 = useState(),
|
|
54
|
+
showList = _useState12[0],
|
|
55
|
+
setShowList = _useState12[1];
|
|
56
|
+
var _useState13 = useState(false),
|
|
57
57
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
subjectEnable = _useState14[0],
|
|
59
|
+
setSubjectEnable = _useState14[1];
|
|
60
60
|
// 初始化
|
|
61
61
|
useEffect(function () {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
setLoading(true);
|
|
63
|
+
ajax(Apis.querySubjectDisplay, {
|
|
64
|
+
method: 'post',
|
|
65
|
+
data: {
|
|
66
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
67
|
+
}
|
|
68
|
+
}).then(function (res) {
|
|
69
|
+
if (!res) return;
|
|
70
|
+
setSubjectEnable(res.data);
|
|
71
|
+
// 设置初始值
|
|
72
|
+
if (!props.defaultValue) {
|
|
73
|
+
initSearch();
|
|
74
|
+
} else {
|
|
75
|
+
setShowList(props.defaultValue.chosen_data);
|
|
76
|
+
setPanelId(props.defaultValue.panelId);
|
|
77
|
+
setElementId(props.defaultValue.id);
|
|
78
|
+
setTitle(props.defaultValue.name);
|
|
79
|
+
setSearchData(props.defaultValue.data);
|
|
80
|
+
}
|
|
81
|
+
setTimeout(function () {
|
|
82
|
+
setLoading(false);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
76
85
|
}, []);
|
|
77
86
|
|
|
78
87
|
// 查询条件初始化
|
|
@@ -83,14 +92,6 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
83
92
|
chartType: 'line'
|
|
84
93
|
});
|
|
85
94
|
};
|
|
86
|
-
|
|
87
|
-
// 改变loading
|
|
88
|
-
var changeLoading = function changeLoading(flag) {
|
|
89
|
-
setLoading(flag);
|
|
90
|
-
};
|
|
91
|
-
if (pageLoading) {
|
|
92
|
-
return /*#__PURE__*/React.createElement(Spin, null);
|
|
93
|
-
}
|
|
94
95
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
95
96
|
spinning: loading,
|
|
96
97
|
wrapperClassName: classPrefix
|
|
@@ -112,7 +113,7 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
112
113
|
children: ""
|
|
113
114
|
}), !panelId && /*#__PURE__*/React.createElement("div", {
|
|
114
115
|
className: "".concat(classPrefix, "-header-title")
|
|
115
|
-
}, "\u95F4\u9694\u5206\u6790"), /*#__PURE__*/React.createElement(
|
|
116
|
+
}, "\u95F4\u9694\u5206\u6790"), /*#__PURE__*/React.createElement(IntervalContext.Provider, {
|
|
116
117
|
value: {
|
|
117
118
|
panelId: panelId,
|
|
118
119
|
elementId: elementId,
|
|
@@ -121,19 +122,21 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
121
122
|
userPropList: userPropList,
|
|
122
123
|
searchData: searchData,
|
|
123
124
|
setSearchData: setSearchData,
|
|
125
|
+
subjectEnable: subjectEnable,
|
|
124
126
|
panelName: title,
|
|
125
127
|
includeToday: props.includeToday,
|
|
126
128
|
enableAddScene: props.defaultValue && props.defaultValue.enableAddScene === false ? false : true,
|
|
127
|
-
changeLoading:
|
|
129
|
+
changeLoading: setLoading,
|
|
128
130
|
afterEditTarget: props.afterEditTarget,
|
|
129
|
-
onUserDrill: props.onUserDrill
|
|
131
|
+
onUserDrill: props.onUserDrill,
|
|
132
|
+
onJumpWarning: props.onJumpWarning
|
|
130
133
|
}
|
|
131
134
|
}, /*#__PURE__*/React.createElement(EventContent, {
|
|
132
135
|
defaultValue: props.defaultValue ? props.defaultValue.data : undefined,
|
|
133
136
|
value: searchData,
|
|
134
137
|
show: showList,
|
|
135
|
-
urlParam: props.urlParam,
|
|
136
138
|
onUserDrill: props.onUserDrill,
|
|
139
|
+
onJumpWarning: props.onJumpWarning,
|
|
137
140
|
onChange: setSearchData,
|
|
138
141
|
initSearch: initSearch
|
|
139
142
|
})));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SearchValue,
|
|
3
|
-
export declare namespace
|
|
2
|
+
import { SearchValue, IntervalDrillParams } from '../../types';
|
|
3
|
+
export declare namespace IntervalProps {
|
|
4
4
|
interface Props {
|
|
5
5
|
/**
|
|
6
6
|
* @description 默认查询值
|
|
7
7
|
*/
|
|
8
8
|
defaultValue?: Value;
|
|
9
|
-
urlParam?: SearchValue;
|
|
10
9
|
/**
|
|
11
10
|
* @description 看板是否可禁用, true禁用
|
|
12
11
|
*/
|
|
@@ -23,7 +22,8 @@ export declare namespace EventProps {
|
|
|
23
22
|
/**
|
|
24
23
|
* 用户钻取
|
|
25
24
|
*/
|
|
26
|
-
onUserDrill: (data:
|
|
25
|
+
onUserDrill: (data: IntervalDrillParams, isSubject: boolean) => void;
|
|
26
|
+
onJumpWarning: (data: Record<string, any>, searchData: SearchValue) => void;
|
|
27
27
|
}
|
|
28
28
|
interface Value {
|
|
29
29
|
/**
|
|
@@ -69,6 +69,7 @@ export declare namespace EventProps {
|
|
|
69
69
|
min?: number;
|
|
70
70
|
perValue?: number;
|
|
71
71
|
peopleNum?: number;
|
|
72
|
+
names?: string[];
|
|
72
73
|
children?: ColumnsDataType[];
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
1
|
+
export var IntervalProps;
|
|
2
|
+
(function (_IntervalProps) {})(IntervalProps || (IntervalProps = {}));
|
|
@@ -10,15 +10,16 @@ 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, { useState } from 'react';
|
|
13
|
+
import React, { useContext, useState } from 'react';
|
|
14
14
|
import { Form, Button, Radio } from 'antd';
|
|
15
15
|
import { BizAttributeSelector, BizSelect, BizUserGroupHeader, useSubject } from '@zgfe/business-lib';
|
|
16
16
|
import EventFilter from "../../components/eventFilter";
|
|
17
17
|
import "./styles/index.less";
|
|
18
18
|
import { AnalysisMode } from "./types";
|
|
19
|
+
import { IntervalContext } from "../../types";
|
|
19
20
|
var classPrefix = 'top-panel-interval';
|
|
20
21
|
var TopPanel = function TopPanel(props) {
|
|
21
|
-
var _props$
|
|
22
|
+
var _props$defaultValue, _props$defaultValue2, _defaultValue$associa, _defaultValue$associa2, _finalSearchData$asso, _finalSearchData$asso2, _defaultValue$associa3, _finalSearchData$asso3, _defaultValue$associa4, _finalSearchData$asso4, _defaultValue$associa5, _finalSearchData$asso5, _defaultValue$associa6, _finalSearchData$asso6, _defaultValue$associa7, _finalSearchData$asso7, _defaultValue$associa8, _finalSearchData$asso8, _defaultValue$associa9, _finalSearchData$asso9, _defaultValue$associa10, _finalSearchData$asso10, _defaultValue$dimensi, _finalSearchData$dime, _defaultValue$dimensi2, _finalSearchData$dime2, _defaultValue$dimensi3, _finalSearchData$dime3, _defaultValue$dimensi4, _finalSearchData$dime4;
|
|
22
23
|
var defaultValue = props.defaultValue,
|
|
23
24
|
loading = props.loading,
|
|
24
25
|
collapseRef = props.collapseRef,
|
|
@@ -47,7 +48,9 @@ var TopPanel = function TopPanel(props) {
|
|
|
47
48
|
var _useSubject = useSubject(),
|
|
48
49
|
subjectList = _useSubject.subjectList,
|
|
49
50
|
subjectLoading = _useSubject.loading;
|
|
50
|
-
var
|
|
51
|
+
var _useContext = useContext(IntervalContext),
|
|
52
|
+
subjectEnable = _useContext.subjectEnable;
|
|
53
|
+
var _ref = defaultValue || {},
|
|
51
54
|
userGroup = _ref.userGroup;
|
|
52
55
|
// 细分属性初始值
|
|
53
56
|
var _useState9 = useState(),
|
|
@@ -170,7 +173,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
170
173
|
className: "panel-form-interval",
|
|
171
174
|
layout: "vertical",
|
|
172
175
|
initialValues: {
|
|
173
|
-
userGroup: props !== null && props !== void 0 && (_props$
|
|
176
|
+
userGroup: props !== null && props !== void 0 && (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 && _props$defaultValue.userGroup ? props === null || props === void 0 ? void 0 : (_props$defaultValue2 = props.defaultValue) === null || _props$defaultValue2 === void 0 ? void 0 : _props$defaultValue2.userGroup : userGroup ? userGroup : [0],
|
|
174
177
|
start: _objectSpread(_objectSpread({}, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.start), {}, {
|
|
175
178
|
relevancy: defaultValue !== null && defaultValue !== void 0 && (_defaultValue$associa = defaultValue.associated_next_attr) !== null && _defaultValue$associa !== void 0 && _defaultValue$associa.event_id && defaultValue !== null && defaultValue !== void 0 && (_defaultValue$associa2 = defaultValue.associated_pre_attr) !== null && _defaultValue$associa2 !== void 0 && _defaultValue$associa2.event_id || finalSearchData !== null && finalSearchData !== void 0 && (_finalSearchData$asso = finalSearchData.associatedNextAttr) !== null && _finalSearchData$asso !== void 0 && _finalSearchData$asso.eventId && finalSearchData !== null && finalSearchData !== void 0 && (_finalSearchData$asso2 = finalSearchData.associatedPreAttr) !== null && _finalSearchData$asso2 !== void 0 && _finalSearchData$asso2.eventId ? true : false
|
|
176
179
|
}),
|
|
@@ -200,7 +203,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
200
203
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
201
204
|
label: "\u5206\u6790\u4E3B\u4F53",
|
|
202
205
|
className: "panel-form-interval-item"
|
|
203
|
-
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
206
|
+
}, subjectEnable && /*#__PURE__*/React.createElement(BizSelect, {
|
|
204
207
|
options: [{
|
|
205
208
|
label: '用户',
|
|
206
209
|
value: 'user'
|
|
@@ -227,6 +230,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
227
230
|
keyField: "id",
|
|
228
231
|
onChange: function onChange(val) {
|
|
229
232
|
setCurrentSubject(val);
|
|
233
|
+
form.setFieldsValue({
|
|
234
|
+
start: undefined,
|
|
235
|
+
end: undefined
|
|
236
|
+
});
|
|
230
237
|
}
|
|
231
238
|
})), analysisType === 'user' && /*#__PURE__*/React.createElement(Form.Item, {
|
|
232
239
|
label: "",
|
|
@@ -247,7 +254,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
247
254
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
248
255
|
subject: currentSubject,
|
|
249
256
|
relevancyFl: relevancyFl,
|
|
250
|
-
relevancy: true
|
|
257
|
+
relevancy: true,
|
|
258
|
+
key: "begin"
|
|
251
259
|
})), relevancy ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
252
260
|
className: "associated"
|
|
253
261
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -311,14 +319,15 @@ var TopPanel = function TopPanel(props) {
|
|
|
311
319
|
label: "\u7ED3\u675F\u4E8B\u4EF6",
|
|
312
320
|
name: "end"
|
|
313
321
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
314
|
-
subject: currentSubject
|
|
322
|
+
subject: currentSubject,
|
|
323
|
+
key: "end"
|
|
315
324
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
316
325
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
317
326
|
name: "dimension",
|
|
318
327
|
className: "dimension-interval"
|
|
319
328
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
320
329
|
enableEventProp: true,
|
|
321
|
-
enableUserProp:
|
|
330
|
+
enableUserProp: analysisType === 'user',
|
|
322
331
|
enableEnvProp: true,
|
|
323
332
|
eventIdList: startId === endId ? [startId] : [startId, endId],
|
|
324
333
|
value: bizAttributeSelectorValue,
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -131,20 +131,6 @@ export interface SearchValue {
|
|
|
131
131
|
unit: string;
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
export interface UserDrillParamsProp {
|
|
135
|
-
/**
|
|
136
|
-
* @description 用户数量
|
|
137
|
-
*/
|
|
138
|
-
count: number;
|
|
139
|
-
/**
|
|
140
|
-
* @description 查询接口
|
|
141
|
-
*/
|
|
142
|
-
url: string;
|
|
143
|
-
/**
|
|
144
|
-
* @description 查询对象
|
|
145
|
-
*/
|
|
146
|
-
params?: Record<string, any>;
|
|
147
|
-
}
|
|
148
134
|
export type EventChartTypes = 'line' | 'bar' | 'pie' | 'map' | 'boxplot';
|
|
149
135
|
/**
|
|
150
136
|
* 图表选择类型
|
|
@@ -187,4 +173,18 @@ export interface TableChildrenProps {
|
|
|
187
173
|
name: string;
|
|
188
174
|
values: number[];
|
|
189
175
|
}
|
|
190
|
-
export declare const
|
|
176
|
+
export declare const IntervalContext: import("react").Context<any>;
|
|
177
|
+
export interface IntervalDrillParams {
|
|
178
|
+
/**
|
|
179
|
+
* @description 用户数量
|
|
180
|
+
*/
|
|
181
|
+
count: number;
|
|
182
|
+
/**
|
|
183
|
+
* @description 查询接口
|
|
184
|
+
*/
|
|
185
|
+
url: string;
|
|
186
|
+
/**
|
|
187
|
+
* @description 查询对象
|
|
188
|
+
*/
|
|
189
|
+
params?: Record<string, any>;
|
|
190
|
+
}
|
package/dist/esm/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColumnsType } from 'antd/es/table';
|
|
2
2
|
import { EventGroup, UserProp, EnvProp } from '@zgfe/business-lib/es/attributeSelector/types';
|
|
3
3
|
import { ResponseDataProps, SearchValue, SeriesProps } from '../types';
|
|
4
|
-
import {
|
|
4
|
+
import { IntervalProps } from '../modules/home/types';
|
|
5
5
|
import '../style/index.less';
|
|
6
6
|
import { DisplaySetup } from '../components/searchPanel/types';
|
|
7
7
|
/**
|
|
@@ -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:
|
|
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>;
|
|
13
13
|
/**
|
|
14
14
|
* 获取属性的label
|
|
15
15
|
* @param attrData 当前属性
|
|
@@ -37,6 +37,7 @@ export declare function formTableData(originalData: ChartData): {
|
|
|
37
37
|
perValue: number;
|
|
38
38
|
total: number;
|
|
39
39
|
peopleNum: number;
|
|
40
|
+
names: string[];
|
|
40
41
|
}[] | {
|
|
41
42
|
key: number;
|
|
42
43
|
time: string;
|
|
@@ -59,6 +60,7 @@ export declare function formTableData(originalData: ChartData): {
|
|
|
59
60
|
perValue: number;
|
|
60
61
|
total: number;
|
|
61
62
|
peopleNum: number;
|
|
63
|
+
names: string[];
|
|
62
64
|
}[];
|
|
63
65
|
}[] | undefined;
|
|
64
66
|
type ChartData = {
|
|
@@ -16,6 +16,7 @@ import { chartColors } from "../constants/color";
|
|
|
16
16
|
import "../style/index.less";
|
|
17
17
|
import { IconFont } from '@zgfe/business-lib';
|
|
18
18
|
import { Apis } from "../constants";
|
|
19
|
+
import { searchDataParams } from "../modules/content/utils";
|
|
19
20
|
var classPrefix = 'interval-form-data';
|
|
20
21
|
function convertToHMS(seconds) {
|
|
21
22
|
var hours = Math.floor(seconds / 3600);
|
|
@@ -164,22 +165,30 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
164
165
|
className: "interval-drill",
|
|
165
166
|
onClick: function onClick() {
|
|
166
167
|
var params;
|
|
168
|
+
var searchParam = searchDataParams(searchData);
|
|
167
169
|
// 主体下钻
|
|
168
170
|
if (searchData.analysisSubject) {
|
|
169
171
|
params = {
|
|
170
172
|
url: Apis.subjectDrill,
|
|
171
173
|
count: Number(text),
|
|
172
|
-
params: _objectSpread({},
|
|
174
|
+
params: _objectSpread({}, searchParam)
|
|
173
175
|
};
|
|
174
176
|
} else {
|
|
175
177
|
// 用户下钻
|
|
176
178
|
params = {
|
|
177
179
|
url: Apis.userDrill,
|
|
178
180
|
count: Number(text),
|
|
179
|
-
params: _objectSpread({},
|
|
181
|
+
params: _objectSpread({}, searchParam)
|
|
180
182
|
};
|
|
181
183
|
}
|
|
182
|
-
|
|
184
|
+
if (searchParam.dimension) {
|
|
185
|
+
params.params.groupValue = /\d{4}-\d{2}-\d{2}/.test(record.time || '') ? record.names ? record.names[0] : undefined : record.time;
|
|
186
|
+
}
|
|
187
|
+
if (/\d{4}-\d{2}-\d{2}/.test(record.time || '')) {
|
|
188
|
+
params.params.time.begin = record.time.split('|')[0];
|
|
189
|
+
params.params.time.end = record.time.split('|')[1] || record.time.split('|')[0];
|
|
190
|
+
}
|
|
191
|
+
onUserDrill === null || onUserDrill === void 0 ? void 0 : onUserDrill(params, searchData.analysisSubject ? true : false);
|
|
183
192
|
}
|
|
184
193
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
185
194
|
type: "a-yanjingkai"
|
|
@@ -282,7 +291,8 @@ function getChildrenData(data, index) {
|
|
|
282
291
|
min: values[i][4] || 0,
|
|
283
292
|
perValue: values[i][5] || 0,
|
|
284
293
|
total: values[i][6] || 0,
|
|
285
|
-
peopleNum: values[i][7] || 0
|
|
294
|
+
peopleNum: values[i][7] || 0,
|
|
295
|
+
names: firstSeries.names
|
|
286
296
|
};
|
|
287
297
|
});
|
|
288
298
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-interval",
|
|
3
|
-
"version": "1.0.3-alpha.
|
|
3
|
+
"version": "1.0.3-alpha.10",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"umi-request": "^1.4.0",
|
|
63
63
|
"yorkie": "^2.0.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ba968441f35ef1af38f430b93de7e4f344efefa2"
|
|
66
66
|
}
|