@zgfe/modules-interval 1.0.3-alpha.20 → 1.0.3-alpha.22
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.
|
@@ -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 {
|
|
13
|
+
import { Tooltip, message } from 'antd';
|
|
14
14
|
import React, { useEffect, useRef, useState } from 'react';
|
|
15
15
|
import { BizEventSelector, IconFont, BizAttrConditionGroup } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
@@ -137,9 +137,6 @@ var EventFilter = function EventFilter(props) {
|
|
|
137
137
|
delete _dimension.key;
|
|
138
138
|
_event.dimension = _dimension;
|
|
139
139
|
}
|
|
140
|
-
if (props.relevancy && relevancy !== undefined) {
|
|
141
|
-
_event.relevancy = relevancy;
|
|
142
|
-
}
|
|
143
140
|
props.onChange && props.onChange(_event);
|
|
144
141
|
}, [bizAttributeSelectorValue, filter, event, relevancy]);
|
|
145
142
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -177,22 +174,7 @@ var EventFilter = function EventFilter(props) {
|
|
|
177
174
|
onClick: function onClick() {
|
|
178
175
|
return onAdd();
|
|
179
176
|
}
|
|
180
|
-
}))),
|
|
181
|
-
placement: "top",
|
|
182
|
-
title: props.relevancyFl ? '请选择开始和结束事件' : ''
|
|
183
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
184
|
-
size: "default",
|
|
185
|
-
style: {
|
|
186
|
-
marginLeft: 24
|
|
187
|
-
},
|
|
188
|
-
checked: relevancy && !props.relevancyFl,
|
|
189
|
-
disabled: props.relevancyFl,
|
|
190
|
-
onChange: function onChange(checked) {
|
|
191
|
-
return setRelevancy(checked);
|
|
192
|
-
}
|
|
193
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
194
|
-
className: "switch-title"
|
|
195
|
-
}, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027")) : ''), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
})))), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
196
178
|
className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
|
|
197
179
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
198
180
|
ref: conditionRef,
|
|
@@ -47,9 +47,7 @@ export interface ConditionsnProps {
|
|
|
47
47
|
export interface EventFilterProps {
|
|
48
48
|
id?: string;
|
|
49
49
|
value?: eventProps;
|
|
50
|
-
relevancyFl?: boolean;
|
|
51
|
-
relevancy?: boolean;
|
|
52
50
|
subject?: SubjectTypes.Subject;
|
|
53
51
|
analysisType?: 'user' | 'eventProp';
|
|
54
|
-
onChange?: (event: eventProps) =>
|
|
52
|
+
onChange?: (event: eventProps) => void;
|
|
55
53
|
}
|
|
@@ -167,7 +167,9 @@ var EventContent = function EventContent(props) {
|
|
|
167
167
|
var onChangeSearch = function onChangeSearch(data, flag) {
|
|
168
168
|
data.id ? setEventId(data.id) : setEventId(-1);
|
|
169
169
|
setSearchData(function (_searchData) {
|
|
170
|
-
return _objectSpread(_objectSpread(
|
|
170
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
|
171
|
+
time: _searchData.time,
|
|
172
|
+
platform: _searchData.platform,
|
|
171
173
|
userGroup: data.analysisSubject ? undefined : data.userGroup,
|
|
172
174
|
analysisSubject: data.analysisSubject ? data.analysisSubject : undefined
|
|
173
175
|
});
|
|
@@ -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 { Form, Button, Radio } from 'antd';
|
|
14
|
+
import { Form, Button, Radio, Space, Switch, Tooltip } 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";
|
|
@@ -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, _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
|
|
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,
|
|
@@ -27,23 +27,19 @@ var TopPanel = function TopPanel(props) {
|
|
|
27
27
|
var _Form$useForm = Form.useForm(),
|
|
28
28
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
29
29
|
form = _Form$useForm2[0];
|
|
30
|
-
var _useState = useState(
|
|
30
|
+
var _useState = useState(),
|
|
31
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _useState3 = useState(
|
|
32
|
+
startEvent = _useState2[0],
|
|
33
|
+
setStartEvent = _useState2[1];
|
|
34
|
+
var _useState3 = useState(),
|
|
35
35
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
endEvent = _useState4[0],
|
|
37
|
+
setEndEvent = _useState4[1];
|
|
38
38
|
// 关联属性
|
|
39
39
|
var _useState5 = useState(false),
|
|
40
40
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
41
|
relevancy = _useState6[0],
|
|
42
42
|
setRelevancy = _useState6[1];
|
|
43
|
-
var _useState7 = useState(true),
|
|
44
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
-
relevancyFl = _useState8[0],
|
|
46
|
-
setRelevancyFl = _useState8[1];
|
|
47
43
|
var _useSubject = useSubject(),
|
|
48
44
|
subjectList = _useSubject.subjectList,
|
|
49
45
|
subjectLoading = _useSubject.loading;
|
|
@@ -51,87 +47,31 @@ var TopPanel = function TopPanel(props) {
|
|
|
51
47
|
subjectEnable = _useContext.subjectEnable;
|
|
52
48
|
var _ref = defaultValue || {},
|
|
53
49
|
userGroup = _ref.userGroup;
|
|
54
|
-
|
|
50
|
+
var _useState7 = useState('user'),
|
|
51
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
52
|
+
analysisType = _useState8[0],
|
|
53
|
+
setAnalysisType = _useState8[1];
|
|
55
54
|
var _useState9 = useState(),
|
|
56
55
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var _useState11 = useState(
|
|
56
|
+
currentSubject = _useState10[0],
|
|
57
|
+
setCurrentSubject = _useState10[1];
|
|
58
|
+
var _useState11 = useState(false),
|
|
60
59
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
setCurrentParams = _useState18[1];
|
|
75
|
-
var _useState19 = useState(true),
|
|
76
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
77
|
-
searchDisabled = _useState20[0],
|
|
78
|
-
setSearchDisabled = _useState20[1];
|
|
79
|
-
// 用户组和事件变更
|
|
80
|
-
var onValuesChange = function onValuesChange(data, allData) {
|
|
81
|
-
var _data = {};
|
|
82
|
-
setRelevancyFl(false);
|
|
83
|
-
if (allData.start) {
|
|
84
|
-
if (allData.start.id !== null) {
|
|
85
|
-
var _allData$start;
|
|
86
|
-
_data = allData.start;
|
|
87
|
-
setStartId(allData.start.id);
|
|
88
|
-
setRelevancy(allData === null || allData === void 0 ? void 0 : (_allData$start = allData.start) === null || _allData$start === void 0 ? void 0 : _allData$start.relevancy);
|
|
89
|
-
} else {
|
|
90
|
-
setRelevancyFl(true);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (allData.end) {
|
|
94
|
-
if (allData.end.id !== null) {
|
|
95
|
-
_data = allData.end;
|
|
96
|
-
setEndId(allData.end.id);
|
|
97
|
-
} else {
|
|
98
|
-
setRelevancyFl(true);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (allData.userGroup) {
|
|
102
|
-
_data.userGroup = allData.userGroup;
|
|
103
|
-
if (_data.userGroup.length <= 0) _data.userGroup = [0];
|
|
104
|
-
}
|
|
105
|
-
setCurrentParams(_objectSpread(_objectSpread({}, allData), {}, {
|
|
106
|
-
analysisSubject: allData.analysisSubject ? {
|
|
107
|
-
subjectId: allData.analysisSubject.id,
|
|
108
|
-
subjectName: allData.analysisSubject.subjectName,
|
|
109
|
-
subjectAlias: allData.analysisSubject.subjectAlias,
|
|
110
|
-
unit: allData.analysisSubject.unit
|
|
111
|
-
} : undefined
|
|
112
|
-
}));
|
|
113
|
-
};
|
|
114
|
-
useEffect(function () {
|
|
115
|
-
var _currentParams$start, _currentParams$start$, _currentParams$start$2, _currentParams$end, _currentParams$end$fi, _currentParams$end$fi2;
|
|
116
|
-
var conditionValid = true;
|
|
117
|
-
currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$start = currentParams.start) === null || _currentParams$start === void 0 ? void 0 : (_currentParams$start$ = _currentParams$start.filters) === null || _currentParams$start$ === void 0 ? void 0 : (_currentParams$start$2 = _currentParams$start$.conditions) === null || _currentParams$start$2 === void 0 ? void 0 : _currentParams$start$2.forEach(function (item) {
|
|
118
|
-
var _item$values;
|
|
119
|
-
if (!/null/.test(item.operator || '') && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
|
|
120
|
-
conditionValid = false;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$end = currentParams.end) === null || _currentParams$end === void 0 ? void 0 : (_currentParams$end$fi = _currentParams$end.filters) === null || _currentParams$end$fi === void 0 ? void 0 : (_currentParams$end$fi2 = _currentParams$end$fi.conditions) === null || _currentParams$end$fi2 === void 0 ? void 0 : _currentParams$end$fi2.forEach(function (item) {
|
|
124
|
-
var _item$values2;
|
|
125
|
-
if (!/null/.test(item.operator || '') && !((_item$values2 = item.values) !== null && _item$values2 !== void 0 && _item$values2.length)) {
|
|
126
|
-
conditionValid = false;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
if (loading || !(currentParams !== null && currentParams !== void 0 && currentParams.start) || !(currentParams !== null && currentParams !== void 0 && currentParams.start.id) || !(currentParams !== null && currentParams !== void 0 && currentParams.end) || !(currentParams !== null && currentParams !== void 0 && currentParams.end.id) || !conditionValid || relevancy && !(currentParams !== null && currentParams !== void 0 && currentParams.associatedNextAttr) && !(currentParams !== null && currentParams !== void 0 && currentParams.associatedNextAttr) || analysisType === 'eventProp' && !currentSubject) {
|
|
130
|
-
setSearchDisabled(true);
|
|
131
|
-
} else {
|
|
132
|
-
setSearchDisabled(false);
|
|
60
|
+
inited = _useState12[0],
|
|
61
|
+
setInited = _useState12[1];
|
|
62
|
+
var formRef = React.useRef(null);
|
|
63
|
+
function onSearch(values) {
|
|
64
|
+
if (props.onChange) {
|
|
65
|
+
props.onChange(_objectSpread(_objectSpread({}, values), {}, {
|
|
66
|
+
analysisSubject: values.analysisSubject ? {
|
|
67
|
+
subjectId: values.analysisSubject.id,
|
|
68
|
+
subjectName: values.analysisSubject.subjectName,
|
|
69
|
+
subjectAlias: values.analysisSubject.subjectAlias,
|
|
70
|
+
unit: values.analysisSubject.unit
|
|
71
|
+
} : undefined
|
|
72
|
+
}), true);
|
|
133
73
|
}
|
|
134
|
-
}
|
|
74
|
+
}
|
|
135
75
|
var resetting = function resetting() {
|
|
136
76
|
form.resetFields();
|
|
137
77
|
form.setFieldsValue({
|
|
@@ -157,47 +97,6 @@ var TopPanel = function TopPanel(props) {
|
|
|
157
97
|
associatedNextAttr: undefined
|
|
158
98
|
}, true);
|
|
159
99
|
};
|
|
160
|
-
// 细分属性
|
|
161
|
-
var onChangeAttr = function onChangeAttr(attr, type) {
|
|
162
|
-
if (attr === undefined) {
|
|
163
|
-
// 删除细分属性
|
|
164
|
-
switch (type) {
|
|
165
|
-
case 'associatedPreAttr':
|
|
166
|
-
form.setFieldsValue({
|
|
167
|
-
associatedPreAttr: undefined
|
|
168
|
-
});
|
|
169
|
-
props.onChange({
|
|
170
|
-
associatedPreAttr: undefined
|
|
171
|
-
}, true);
|
|
172
|
-
break;
|
|
173
|
-
case 'associatedNextAttr':
|
|
174
|
-
form.setFieldsValue({
|
|
175
|
-
associatedNextAttr: undefined
|
|
176
|
-
});
|
|
177
|
-
props.onChange({
|
|
178
|
-
associatedNextAttr: undefined
|
|
179
|
-
}, true);
|
|
180
|
-
break;
|
|
181
|
-
case 'dimension':
|
|
182
|
-
form.setFieldsValue({
|
|
183
|
-
dimension: undefined
|
|
184
|
-
});
|
|
185
|
-
props.onChange({
|
|
186
|
-
dimension: undefined
|
|
187
|
-
}, true);
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
setBizAttributeSelectorValue(undefined);
|
|
191
|
-
} else {
|
|
192
|
-
var _value = attr.propCategory === 'eventProp' ? attr.id : attr.name;
|
|
193
|
-
setBizAttributeSelectorValue({
|
|
194
|
-
propCategory: attr.propCategory,
|
|
195
|
-
category: attr.category,
|
|
196
|
-
value: _value,
|
|
197
|
-
key: attr.propCategory === 'eventProp' ? attr.id : attr.propCategory + '-' + _value
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
100
|
useEffect(function () {
|
|
202
101
|
if (!defaultValue) {
|
|
203
102
|
setInited(true);
|
|
@@ -214,6 +113,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
214
113
|
if (!inited) return null;
|
|
215
114
|
return /*#__PURE__*/React.createElement(Form, {
|
|
216
115
|
form: form,
|
|
116
|
+
ref: formRef,
|
|
217
117
|
component: "div",
|
|
218
118
|
colon: false,
|
|
219
119
|
className: "panel-form-interval",
|
|
@@ -246,7 +146,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
246
146
|
analysisModel: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.analysisModel) || AnalysisMode.common
|
|
247
147
|
},
|
|
248
148
|
scrollToFirstError: true,
|
|
249
|
-
|
|
149
|
+
onFinish: onSearch
|
|
250
150
|
}, subjectEnable && /*#__PURE__*/React.createElement(Form.Item, {
|
|
251
151
|
label: "\u5206\u6790\u4E3B\u4F53",
|
|
252
152
|
className: "panel-form-interval-item"
|
|
@@ -269,7 +169,15 @@ var TopPanel = function TopPanel(props) {
|
|
|
269
169
|
})), analysisType === 'eventProp' && /*#__PURE__*/React.createElement(Form.Item, {
|
|
270
170
|
label: "\u4E3B\u4F53\u540D\u79F0",
|
|
271
171
|
name: "analysisSubject",
|
|
272
|
-
className: "panel-form-interval-item"
|
|
172
|
+
className: "panel-form-interval-item",
|
|
173
|
+
rules: [{
|
|
174
|
+
validator: function validator(rule, value) {
|
|
175
|
+
if (!value) {
|
|
176
|
+
return Promise.reject('请选择主体名称');
|
|
177
|
+
}
|
|
178
|
+
return Promise.resolve();
|
|
179
|
+
}
|
|
180
|
+
}]
|
|
273
181
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
274
182
|
options: subjectList,
|
|
275
183
|
aliasField: "subjectAlias",
|
|
@@ -298,16 +206,52 @@ var TopPanel = function TopPanel(props) {
|
|
|
298
206
|
className: "collapseRefs"
|
|
299
207
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
300
208
|
label: "\u5F00\u59CB\u4E8B\u4EF6",
|
|
301
|
-
|
|
209
|
+
style: {
|
|
210
|
+
marginBottom: '8px'
|
|
211
|
+
}
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
213
|
+
align: "baseline"
|
|
214
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
215
|
+
name: "start",
|
|
216
|
+
style: {
|
|
217
|
+
marginBottom: 0
|
|
218
|
+
},
|
|
219
|
+
rules: [{
|
|
220
|
+
validator: function validator(rule, value) {
|
|
221
|
+
var _value$filters, _value$filters$condit;
|
|
222
|
+
if (!value || !value.id) {
|
|
223
|
+
return Promise.reject('请选择开始事件');
|
|
224
|
+
}
|
|
225
|
+
var conditionValIsNull = false;
|
|
226
|
+
value === null || value === void 0 ? void 0 : (_value$filters = value.filters) === null || _value$filters === void 0 ? void 0 : (_value$filters$condit = _value$filters.conditions) === null || _value$filters$condit === void 0 ? void 0 : _value$filters$condit.forEach(function (item) {
|
|
227
|
+
var _item$values;
|
|
228
|
+
if (!/null/.test(item.operator || '') && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
|
|
229
|
+
conditionValIsNull = true;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
if (conditionValIsNull) {
|
|
233
|
+
return Promise.reject('请填写完整的条件');
|
|
234
|
+
}
|
|
235
|
+
return Promise.resolve();
|
|
236
|
+
}
|
|
237
|
+
}]
|
|
302
238
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
303
239
|
subject: currentSubject,
|
|
304
|
-
relevancyFl: relevancyFl,
|
|
305
|
-
relevancy: true,
|
|
306
240
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
307
|
-
analysisType: analysisType
|
|
308
|
-
|
|
241
|
+
analysisType: analysisType,
|
|
242
|
+
onChange: setStartEvent
|
|
243
|
+
})), /*#__PURE__*/React.createElement(Tooltip, null, /*#__PURE__*/React.createElement(Space, {
|
|
244
|
+
align: "baseline"
|
|
245
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
246
|
+
checked: relevancy,
|
|
247
|
+
onChange: setRelevancy
|
|
248
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
249
|
+
className: "switch-title"
|
|
250
|
+
}, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027"))))), relevancy && /*#__PURE__*/React.createElement(Form.Item, {
|
|
309
251
|
className: "associated"
|
|
310
|
-
}, /*#__PURE__*/React.createElement(
|
|
252
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
253
|
+
align: "baseline"
|
|
254
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
311
255
|
className: "associated-link"
|
|
312
256
|
}, /*#__PURE__*/React.createElement("i", {
|
|
313
257
|
style: {
|
|
@@ -318,61 +262,90 @@ var TopPanel = function TopPanel(props) {
|
|
|
318
262
|
className: "associated-label"
|
|
319
263
|
}, "\u5C5E\u60271"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
320
264
|
name: "associatedPreAttr",
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
265
|
+
rules: [{
|
|
266
|
+
validator: function validator(rule, value) {
|
|
267
|
+
if (!value || !value.dimensionSub) {
|
|
268
|
+
return Promise.reject('请选择属性1');
|
|
269
|
+
}
|
|
270
|
+
return Promise.resolve();
|
|
271
|
+
}
|
|
272
|
+
}]
|
|
325
273
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
326
274
|
enableEventProp: true,
|
|
327
275
|
enableUserProp: false,
|
|
328
276
|
enableEnvProp: false,
|
|
329
|
-
eventIdList: [
|
|
330
|
-
value: bizAttributeSelectorValue,
|
|
277
|
+
eventIdList: [startEvent === null || startEvent === void 0 ? void 0 : startEvent.id],
|
|
331
278
|
enableDelete: true,
|
|
332
|
-
|
|
333
|
-
key: "".concat(currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$start2 = currentParams.start) === null || _currentParams$start2 === void 0 ? void 0 : _currentParams$start2.id, "-").concat(currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$end2 = currentParams.end) === null || _currentParams$end2 === void 0 ? void 0 : _currentParams$end2.id, "-pre"),
|
|
279
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-pre"),
|
|
334
280
|
onDelete: function onDelete() {
|
|
335
|
-
|
|
281
|
+
var _formRef$current;
|
|
282
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('associatedPreAttr', undefined);
|
|
336
283
|
}
|
|
337
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
284
|
+
}))), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
338
285
|
className: "associated-label"
|
|
339
286
|
}, "\u5C5E\u60272"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
340
287
|
name: "associatedNextAttr",
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
288
|
+
rules: [{
|
|
289
|
+
validator: function validator(rule, value) {
|
|
290
|
+
if (!value || !value.dimensionSub) {
|
|
291
|
+
return Promise.reject('请选择属性2');
|
|
292
|
+
}
|
|
293
|
+
return Promise.resolve();
|
|
294
|
+
}
|
|
295
|
+
}]
|
|
344
296
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
345
297
|
enableEventProp: true,
|
|
346
298
|
enableUserProp: false,
|
|
347
299
|
enableEnvProp: false,
|
|
348
|
-
eventIdList: [
|
|
349
|
-
value: bizAttributeSelectorValue,
|
|
300
|
+
eventIdList: [endEvent === null || endEvent === void 0 ? void 0 : endEvent.id],
|
|
350
301
|
enableDelete: true,
|
|
351
|
-
|
|
352
|
-
key: "".concat(currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$start3 = currentParams.start) === null || _currentParams$start3 === void 0 ? void 0 : _currentParams$start3.id, "-").concat(currentParams === null || currentParams === void 0 ? void 0 : (_currentParams$end3 = currentParams.end) === null || _currentParams$end3 === void 0 ? void 0 : _currentParams$end3.id, "-next"),
|
|
302
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-next"),
|
|
353
303
|
onDelete: function onDelete() {
|
|
354
|
-
|
|
304
|
+
var _formRef$current2;
|
|
305
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('associatedNextAttr', undefined);
|
|
355
306
|
}
|
|
356
|
-
})), /*#__PURE__*/React.createElement("i", {
|
|
307
|
+
}))), /*#__PURE__*/React.createElement("i", {
|
|
357
308
|
style: {
|
|
358
309
|
lineHeight: '32px',
|
|
359
310
|
marginLeft: '28px',
|
|
360
311
|
cursor: 'pointer'
|
|
361
312
|
},
|
|
362
313
|
onClick: function onClick() {
|
|
363
|
-
|
|
364
|
-
|
|
314
|
+
var _formRef$current3, _formRef$current4;
|
|
315
|
+
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldValue('associatedPreAttr', undefined);
|
|
316
|
+
(_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.setFieldValue('associatedNextAttr', undefined);
|
|
365
317
|
setRelevancy(false);
|
|
366
|
-
setRelevancyFl(true);
|
|
367
318
|
},
|
|
368
319
|
className: "bsicon qingchu"
|
|
369
|
-
}))
|
|
320
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
370
321
|
label: "\u7ED3\u675F\u4E8B\u4EF6",
|
|
371
|
-
name: "end"
|
|
322
|
+
name: "end",
|
|
323
|
+
rules: [{
|
|
324
|
+
validator: function validator(rule, value) {
|
|
325
|
+
var _value$filters2, _value$filters2$condi;
|
|
326
|
+
if (!value || !value.id) {
|
|
327
|
+
return Promise.reject('请选择结束事件');
|
|
328
|
+
}
|
|
329
|
+
var conditionValIsNull = false;
|
|
330
|
+
value === null || value === void 0 ? void 0 : (_value$filters2 = value.filters) === null || _value$filters2 === void 0 ? void 0 : (_value$filters2$condi = _value$filters2.conditions) === null || _value$filters2$condi === void 0 ? void 0 : _value$filters2$condi.forEach(function (item) {
|
|
331
|
+
var _item$values2;
|
|
332
|
+
if (!/null/.test(item.operator || '') && !((_item$values2 = item.values) !== null && _item$values2 !== void 0 && _item$values2.length)) {
|
|
333
|
+
conditionValIsNull = true;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
if (conditionValIsNull) {
|
|
337
|
+
return Promise.reject('请填写完整的条件');
|
|
338
|
+
}
|
|
339
|
+
return Promise.resolve();
|
|
340
|
+
}
|
|
341
|
+
}]
|
|
372
342
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
373
343
|
subject: currentSubject,
|
|
374
344
|
analysisType: analysisType,
|
|
375
|
-
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start")
|
|
345
|
+
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
346
|
+
onChange: function onChange(val) {
|
|
347
|
+
setEndEvent(val);
|
|
348
|
+
}
|
|
376
349
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
377
350
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
378
351
|
name: "dimension",
|
|
@@ -382,12 +355,11 @@ var TopPanel = function TopPanel(props) {
|
|
|
382
355
|
enableUserProp: analysisType === 'user',
|
|
383
356
|
enableEnvProp: true,
|
|
384
357
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-dimension"),
|
|
385
|
-
eventIdList:
|
|
386
|
-
value: bizAttributeSelectorValue,
|
|
358
|
+
eventIdList: (startEvent === null || startEvent === void 0 ? void 0 : startEvent.id) === (endEvent === null || endEvent === void 0 ? void 0 : endEvent.id) ? [startEvent === null || startEvent === void 0 ? void 0 : startEvent.id] : [startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, endEvent === null || endEvent === void 0 ? void 0 : endEvent.id],
|
|
387
359
|
enableDelete: true,
|
|
388
|
-
onChange: onChangeAttr,
|
|
389
360
|
onDelete: function onDelete() {
|
|
390
|
-
|
|
361
|
+
var _formRef$current5;
|
|
362
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('dimension', undefined);
|
|
391
363
|
}
|
|
392
364
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
393
365
|
label: "\u5206\u6790\u6A21\u578B",
|
|
@@ -403,10 +375,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
403
375
|
onClick: resetting
|
|
404
376
|
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
|
|
405
377
|
loading: loading || subjectLoading,
|
|
406
|
-
disabled: searchDisabled,
|
|
407
378
|
type: "primary",
|
|
408
379
|
onClick: function onClick() {
|
|
409
|
-
|
|
380
|
+
var _formRef$current6;
|
|
381
|
+
(_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.submit();
|
|
410
382
|
}
|
|
411
383
|
}, "\u67E5\u8BE2"))));
|
|
412
384
|
};
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.panel-form-interval {
|
|
20
|
+
.ant-form-item-explain-error {
|
|
21
|
+
margin-left: 24px;
|
|
22
|
+
}
|
|
20
23
|
&-item {
|
|
21
24
|
.ant-form-item-label {
|
|
22
25
|
padding-left: 24px !important;
|
|
@@ -203,5 +206,8 @@
|
|
|
203
206
|
line-height: 32px;
|
|
204
207
|
text-align: right;
|
|
205
208
|
}
|
|
209
|
+
.ant-form-item-explain-error {
|
|
210
|
+
margin-left: 0 !important;
|
|
211
|
+
}
|
|
206
212
|
}
|
|
207
213
|
}
|
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.22",
|
|
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": "a2bb7b5a813df9bb5b15e554d989f71df0fac5c0"
|
|
66
66
|
}
|