@zgfe/modules-interval 1.0.3-alpha.8 → 1.0.3-alpha.9
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 +12 -3
- package/dist/esm/constants/apis.js +2 -1
- package/dist/esm/modules/content/index.js +1 -0
- package/dist/esm/modules/home/demo/index.js +0 -1
- package/dist/esm/modules/home/index.js +40 -38
- package/dist/esm/modules/topPanel/index.js +10 -5
- 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() {
|
|
@@ -39,7 +39,6 @@ export default (function () {
|
|
|
39
39
|
return setIsDetail(false);
|
|
40
40
|
}
|
|
41
41
|
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
|
|
42
|
-
defaultValue: searchParams,
|
|
43
42
|
afterEditTarget: afterEditTarget,
|
|
44
43
|
onUserDrill: onUserDrill,
|
|
45
44
|
onJumpWarning: function onJumpWarning() {}
|
|
@@ -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
|
// 属性
|
|
@@ -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
|
|
@@ -121,10 +122,11 @@ 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
131
|
onUserDrill: props.onUserDrill,
|
|
130
132
|
onJumpWarning: props.onJumpWarning
|
|
@@ -10,12 +10,13 @@ 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
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;
|
|
@@ -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(),
|
|
@@ -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'
|
|
@@ -251,7 +254,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
251
254
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
252
255
|
subject: currentSubject,
|
|
253
256
|
relevancyFl: relevancyFl,
|
|
254
|
-
relevancy: true
|
|
257
|
+
relevancy: true,
|
|
258
|
+
key: "begin"
|
|
255
259
|
})), relevancy ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
256
260
|
className: "associated"
|
|
257
261
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -315,7 +319,8 @@ var TopPanel = function TopPanel(props) {
|
|
|
315
319
|
label: "\u7ED3\u675F\u4E8B\u4EF6",
|
|
316
320
|
name: "end"
|
|
317
321
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
318
|
-
subject: currentSubject
|
|
322
|
+
subject: currentSubject,
|
|
323
|
+
key: "end"
|
|
319
324
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
320
325
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
321
326
|
name: "dimension",
|
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.9",
|
|
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": "325209c1f59d1221625901e25e3755aaba5465c9"
|
|
66
66
|
}
|