@zgfe/modules-interval 1.0.3-alpha.10 → 1.0.3-alpha.12
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/modules/home/demo/index.js +39 -0
- package/dist/esm/modules/home/index.js +12 -3
- package/dist/esm/modules/home/styles/index.less +6 -0
- package/dist/esm/modules/home/types.d.ts +2 -0
- package/dist/esm/modules/topPanel/index.js +23 -4
- package/dist/esm/utils/formData.js +4 -0
- package/package.json +2 -2
|
@@ -41,6 +41,45 @@ export default (function () {
|
|
|
41
41
|
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
|
|
42
42
|
afterEditTarget: afterEditTarget,
|
|
43
43
|
onUserDrill: onUserDrill,
|
|
44
|
+
defaultValue: {
|
|
45
|
+
data: {
|
|
46
|
+
time: {
|
|
47
|
+
begin: '2023-08-01',
|
|
48
|
+
end: '2023-10-18',
|
|
49
|
+
unit: 'day'
|
|
50
|
+
},
|
|
51
|
+
chartType: 'line',
|
|
52
|
+
start: {
|
|
53
|
+
id: 7612,
|
|
54
|
+
name: '间隔事件-01',
|
|
55
|
+
relevancy: false
|
|
56
|
+
},
|
|
57
|
+
end: {
|
|
58
|
+
id: 7614,
|
|
59
|
+
name: '间隔事件-02'
|
|
60
|
+
},
|
|
61
|
+
dimension: {
|
|
62
|
+
alias: '',
|
|
63
|
+
eventId: 7612,
|
|
64
|
+
id: 151567,
|
|
65
|
+
isHidden: 0,
|
|
66
|
+
key: 'eventProp-151567',
|
|
67
|
+
label: '商品数量',
|
|
68
|
+
propCategory: 'eventProp',
|
|
69
|
+
type: 2,
|
|
70
|
+
realTime: true,
|
|
71
|
+
dimensionSub: 'event_attr'
|
|
72
|
+
},
|
|
73
|
+
analysisSubject: {
|
|
74
|
+
subjectId: 31,
|
|
75
|
+
subjectName: '商品数量',
|
|
76
|
+
subjectAlias: '查克拉',
|
|
77
|
+
unit: '个'
|
|
78
|
+
},
|
|
79
|
+
analysisModel: 'commonInterval',
|
|
80
|
+
analysisIndex: 'number'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
44
83
|
onJumpWarning: function onJumpWarning() {}
|
|
45
84
|
}));
|
|
46
85
|
});
|
|
@@ -92,9 +92,18 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
92
92
|
chartType: 'line'
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
useEffect(function () {
|
|
96
|
+
if (props.onChange) props.onChange(searchData);
|
|
97
|
+
}, [searchData]);
|
|
98
|
+
if (loading) {
|
|
99
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: classPrefix
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
102
|
+
className: "".concat(classPrefix, "-loading")
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: classPrefix
|
|
98
107
|
}, /*#__PURE__*/React.createElement(BizTargetFromPanel, {
|
|
99
108
|
value: panelId ? {
|
|
100
109
|
panelId: panelId,
|
|
@@ -24,6 +24,7 @@ export declare namespace IntervalProps {
|
|
|
24
24
|
*/
|
|
25
25
|
onUserDrill: (data: IntervalDrillParams, isSubject: boolean) => void;
|
|
26
26
|
onJumpWarning: (data: Record<string, any>, searchData: SearchValue) => void;
|
|
27
|
+
onChange?: (data: SearchValue) => void;
|
|
27
28
|
}
|
|
28
29
|
interface Value {
|
|
29
30
|
/**
|
|
@@ -70,6 +71,7 @@ export declare namespace IntervalProps {
|
|
|
70
71
|
perValue?: number;
|
|
71
72
|
peopleNum?: number;
|
|
72
73
|
names?: string[];
|
|
74
|
+
total?: number;
|
|
73
75
|
children?: ColumnsDataType[];
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -10,7 +10,7 @@ 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';
|
|
13
|
+
import React, { useContext, useEffect, 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";
|
|
@@ -19,7 +19,7 @@ import { AnalysisMode } from "./types";
|
|
|
19
19
|
import { IntervalContext } from "../../types";
|
|
20
20
|
var classPrefix = 'top-panel-interval';
|
|
21
21
|
var TopPanel = function TopPanel(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
|
+
var _props$defaultValue, _props$defaultValue2, _props$defaultValue3, _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;
|
|
23
23
|
var defaultValue = props.defaultValue,
|
|
24
24
|
loading = props.loading,
|
|
25
25
|
collapseRef = props.collapseRef,
|
|
@@ -65,6 +65,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
65
65
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
66
66
|
currentSubject = _useState14[0],
|
|
67
67
|
setCurrentSubject = _useState14[1];
|
|
68
|
+
var _useState15 = useState(false),
|
|
69
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
70
|
+
inited = _useState16[0],
|
|
71
|
+
setInited = _useState16[1];
|
|
68
72
|
// 用户组和事件变更
|
|
69
73
|
var onValuesChange = function onValuesChange(data, allData) {
|
|
70
74
|
var _data = {};
|
|
@@ -166,6 +170,20 @@ var TopPanel = function TopPanel(props) {
|
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
172
|
};
|
|
173
|
+
useEffect(function () {
|
|
174
|
+
if (!defaultValue) {
|
|
175
|
+
setInited(true);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
setInited(false);
|
|
179
|
+
if (defaultValue.analysisSubject) {
|
|
180
|
+
setAnalysisType('eventProp');
|
|
181
|
+
} else {
|
|
182
|
+
setAnalysisType('user');
|
|
183
|
+
}
|
|
184
|
+
setInited(true);
|
|
185
|
+
}, []);
|
|
186
|
+
if (!inited) return null;
|
|
169
187
|
return /*#__PURE__*/React.createElement(Form, {
|
|
170
188
|
form: form,
|
|
171
189
|
component: "div",
|
|
@@ -174,6 +192,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
174
192
|
layout: "vertical",
|
|
175
193
|
initialValues: {
|
|
176
194
|
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],
|
|
195
|
+
analysisSubject: props === null || props === void 0 ? void 0 : (_props$defaultValue3 = props.defaultValue) === null || _props$defaultValue3 === void 0 ? void 0 : _props$defaultValue3.analysisSubject,
|
|
177
196
|
start: _objectSpread(_objectSpread({}, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.start), {}, {
|
|
178
197
|
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
|
|
179
198
|
}),
|
|
@@ -200,10 +219,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
200
219
|
},
|
|
201
220
|
scrollToFirstError: true,
|
|
202
221
|
onValuesChange: onValuesChange
|
|
203
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
222
|
+
}, subjectEnable && /*#__PURE__*/React.createElement(Form.Item, {
|
|
204
223
|
label: "\u5206\u6790\u4E3B\u4F53",
|
|
205
224
|
className: "panel-form-interval-item"
|
|
206
|
-
},
|
|
225
|
+
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
207
226
|
options: [{
|
|
208
227
|
label: '用户',
|
|
209
228
|
value: 'user'
|
|
@@ -145,6 +145,10 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
145
145
|
align: 'right',
|
|
146
146
|
dataIndex: 'total',
|
|
147
147
|
key: 'total',
|
|
148
|
+
sorter: function sorter(a, b) {
|
|
149
|
+
var _a$total, _b$total;
|
|
150
|
+
return ((_a$total = a === null || a === void 0 ? void 0 : a.total) !== null && _a$total !== void 0 ? _a$total : 0) - ((_b$total = b === null || b === void 0 ? void 0 : b.total) !== null && _b$total !== void 0 ? _b$total : 0);
|
|
151
|
+
},
|
|
148
152
|
render: function render(text, record) {
|
|
149
153
|
return /*#__PURE__*/React.createElement("span", null, " ", convertToHMS(text));
|
|
150
154
|
}
|
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.12",
|
|
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": "30f360d146a9d4d545b52a990a34347dae974c29"
|
|
66
66
|
}
|