@zgfe/modules-interval 1.0.3-alpha.21 → 1.0.3-alpha.23
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";
|
|
@@ -82,9 +82,6 @@ var EventFilter = function EventFilter(props) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}, []);
|
|
85
|
-
useEffect(function () {
|
|
86
|
-
setRelevancy(props.relevancyChecked || false);
|
|
87
|
-
}, [props.relevancyChecked]);
|
|
88
85
|
|
|
89
86
|
// 添加筛选
|
|
90
87
|
var onAdd = function onAdd() {
|
|
@@ -140,9 +137,6 @@ var EventFilter = function EventFilter(props) {
|
|
|
140
137
|
delete _dimension.key;
|
|
141
138
|
_event.dimension = _dimension;
|
|
142
139
|
}
|
|
143
|
-
if (props.relevancy && relevancy !== undefined) {
|
|
144
|
-
_event.relevancy = relevancy;
|
|
145
|
-
}
|
|
146
140
|
props.onChange && props.onChange(_event);
|
|
147
141
|
}, [bizAttributeSelectorValue, filter, event, relevancy]);
|
|
148
142
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -180,22 +174,7 @@ var EventFilter = function EventFilter(props) {
|
|
|
180
174
|
onClick: function onClick() {
|
|
181
175
|
return onAdd();
|
|
182
176
|
}
|
|
183
|
-
}))),
|
|
184
|
-
placement: "top",
|
|
185
|
-
title: props.relevancyFl ? '请选择开始和结束事件' : ''
|
|
186
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
187
|
-
size: "default",
|
|
188
|
-
style: {
|
|
189
|
-
marginLeft: 24
|
|
190
|
-
},
|
|
191
|
-
checked: relevancy && !props.relevancyFl,
|
|
192
|
-
disabled: props.relevancyFl,
|
|
193
|
-
onChange: function onChange(checked) {
|
|
194
|
-
return setRelevancy(checked);
|
|
195
|
-
}
|
|
196
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
197
|
-
className: "switch-title"
|
|
198
|
-
}, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027")) : ''), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
})))), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
|
|
199
178
|
className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
|
|
200
179
|
}, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
|
|
201
180
|
ref: conditionRef,
|
|
@@ -47,10 +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
|
-
relevancyChecked?: boolean;
|
|
53
50
|
subject?: SubjectTypes.Subject;
|
|
54
51
|
analysisType?: 'user' | 'eventProp';
|
|
55
|
-
onChange?: (event: eventProps) =>
|
|
52
|
+
onChange?: (event: eventProps) => void;
|
|
56
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 } 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];
|
|
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);
|
|
104
73
|
}
|
|
105
|
-
|
|
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);
|
|
133
|
-
}
|
|
134
|
-
}, [currentParams]);
|
|
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,17 +206,56 @@ 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
|
+
position: 'relative'
|
|
212
|
+
}
|
|
213
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
214
|
+
name: "start",
|
|
215
|
+
style: {
|
|
216
|
+
marginBottom: 0
|
|
217
|
+
},
|
|
218
|
+
rules: [{
|
|
219
|
+
validator: function validator(rule, value) {
|
|
220
|
+
var _value$filters, _value$filters$condit;
|
|
221
|
+
if (!value || !value.id) {
|
|
222
|
+
return Promise.reject('请选择开始事件');
|
|
223
|
+
}
|
|
224
|
+
var conditionValIsNull = false;
|
|
225
|
+
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) {
|
|
226
|
+
var _item$values;
|
|
227
|
+
if (!/null/.test(item.operator || '') && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
|
|
228
|
+
conditionValIsNull = true;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
if (conditionValIsNull) {
|
|
232
|
+
return Promise.reject('请填写完整的条件');
|
|
233
|
+
}
|
|
234
|
+
return Promise.resolve();
|
|
235
|
+
}
|
|
236
|
+
}]
|
|
302
237
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
303
238
|
subject: currentSubject,
|
|
304
|
-
relevancyFl: relevancyFl,
|
|
305
|
-
relevancy: true,
|
|
306
|
-
relevancyChecked: relevancy,
|
|
307
239
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
308
|
-
analysisType: analysisType
|
|
309
|
-
|
|
240
|
+
analysisType: analysisType,
|
|
241
|
+
onChange: setStartEvent
|
|
242
|
+
})), /*#__PURE__*/React.createElement(Space, {
|
|
243
|
+
align: "baseline",
|
|
244
|
+
style: {
|
|
245
|
+
position: 'absolute',
|
|
246
|
+
top: '9px',
|
|
247
|
+
left: '295px'
|
|
248
|
+
}
|
|
249
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
250
|
+
checked: relevancy,
|
|
251
|
+
onChange: setRelevancy
|
|
252
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
253
|
+
className: "switch-title"
|
|
254
|
+
}, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027"))), relevancy && /*#__PURE__*/React.createElement(Form.Item, {
|
|
310
255
|
className: "associated"
|
|
311
|
-
}, /*#__PURE__*/React.createElement(
|
|
256
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
257
|
+
align: "baseline"
|
|
258
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
312
259
|
className: "associated-link"
|
|
313
260
|
}, /*#__PURE__*/React.createElement("i", {
|
|
314
261
|
style: {
|
|
@@ -319,61 +266,90 @@ var TopPanel = function TopPanel(props) {
|
|
|
319
266
|
className: "associated-label"
|
|
320
267
|
}, "\u5C5E\u60271"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
321
268
|
name: "associatedPreAttr",
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
269
|
+
rules: [{
|
|
270
|
+
validator: function validator(rule, value) {
|
|
271
|
+
if (!value || !value.dimensionSub) {
|
|
272
|
+
return Promise.reject('请选择属性1');
|
|
273
|
+
}
|
|
274
|
+
return Promise.resolve();
|
|
275
|
+
}
|
|
276
|
+
}]
|
|
326
277
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
327
278
|
enableEventProp: true,
|
|
328
279
|
enableUserProp: false,
|
|
329
280
|
enableEnvProp: false,
|
|
330
|
-
eventIdList: [
|
|
331
|
-
value: bizAttributeSelectorValue,
|
|
281
|
+
eventIdList: [startEvent === null || startEvent === void 0 ? void 0 : startEvent.id],
|
|
332
282
|
enableDelete: true,
|
|
333
|
-
|
|
334
|
-
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"),
|
|
283
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-pre"),
|
|
335
284
|
onDelete: function onDelete() {
|
|
336
|
-
|
|
285
|
+
var _formRef$current;
|
|
286
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('associatedPreAttr', undefined);
|
|
337
287
|
}
|
|
338
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
288
|
+
}))), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
339
289
|
className: "associated-label"
|
|
340
290
|
}, "\u5C5E\u60272"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
341
291
|
name: "associatedNextAttr",
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
292
|
+
rules: [{
|
|
293
|
+
validator: function validator(rule, value) {
|
|
294
|
+
if (!value || !value.dimensionSub) {
|
|
295
|
+
return Promise.reject('请选择属性2');
|
|
296
|
+
}
|
|
297
|
+
return Promise.resolve();
|
|
298
|
+
}
|
|
299
|
+
}]
|
|
345
300
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
346
301
|
enableEventProp: true,
|
|
347
302
|
enableUserProp: false,
|
|
348
303
|
enableEnvProp: false,
|
|
349
|
-
eventIdList: [
|
|
350
|
-
value: bizAttributeSelectorValue,
|
|
304
|
+
eventIdList: [endEvent === null || endEvent === void 0 ? void 0 : endEvent.id],
|
|
351
305
|
enableDelete: true,
|
|
352
|
-
|
|
353
|
-
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"),
|
|
306
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-next"),
|
|
354
307
|
onDelete: function onDelete() {
|
|
355
|
-
|
|
308
|
+
var _formRef$current2;
|
|
309
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('associatedNextAttr', undefined);
|
|
356
310
|
}
|
|
357
|
-
})), /*#__PURE__*/React.createElement("i", {
|
|
311
|
+
}))), /*#__PURE__*/React.createElement("i", {
|
|
358
312
|
style: {
|
|
359
313
|
lineHeight: '32px',
|
|
360
314
|
marginLeft: '28px',
|
|
361
315
|
cursor: 'pointer'
|
|
362
316
|
},
|
|
363
317
|
onClick: function onClick() {
|
|
364
|
-
|
|
365
|
-
|
|
318
|
+
var _formRef$current3, _formRef$current4;
|
|
319
|
+
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldValue('associatedPreAttr', undefined);
|
|
320
|
+
(_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.setFieldValue('associatedNextAttr', undefined);
|
|
366
321
|
setRelevancy(false);
|
|
367
|
-
setRelevancyFl(true);
|
|
368
322
|
},
|
|
369
323
|
className: "bsicon qingchu"
|
|
370
|
-
}))
|
|
324
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
371
325
|
label: "\u7ED3\u675F\u4E8B\u4EF6",
|
|
372
|
-
name: "end"
|
|
326
|
+
name: "end",
|
|
327
|
+
rules: [{
|
|
328
|
+
validator: function validator(rule, value) {
|
|
329
|
+
var _value$filters2, _value$filters2$condi;
|
|
330
|
+
if (!value || !value.id) {
|
|
331
|
+
return Promise.reject('请选择结束事件');
|
|
332
|
+
}
|
|
333
|
+
var conditionValIsNull = false;
|
|
334
|
+
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) {
|
|
335
|
+
var _item$values2;
|
|
336
|
+
if (!/null/.test(item.operator || '') && !((_item$values2 = item.values) !== null && _item$values2 !== void 0 && _item$values2.length)) {
|
|
337
|
+
conditionValIsNull = true;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
if (conditionValIsNull) {
|
|
341
|
+
return Promise.reject('请填写完整的条件');
|
|
342
|
+
}
|
|
343
|
+
return Promise.resolve();
|
|
344
|
+
}
|
|
345
|
+
}]
|
|
373
346
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
374
347
|
subject: currentSubject,
|
|
375
348
|
analysisType: analysisType,
|
|
376
|
-
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start")
|
|
349
|
+
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
350
|
+
onChange: function onChange(val) {
|
|
351
|
+
setEndEvent(val);
|
|
352
|
+
}
|
|
377
353
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
378
354
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
379
355
|
name: "dimension",
|
|
@@ -383,12 +359,11 @@ var TopPanel = function TopPanel(props) {
|
|
|
383
359
|
enableUserProp: analysisType === 'user',
|
|
384
360
|
enableEnvProp: true,
|
|
385
361
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-dimension"),
|
|
386
|
-
eventIdList:
|
|
387
|
-
value: bizAttributeSelectorValue,
|
|
362
|
+
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],
|
|
388
363
|
enableDelete: true,
|
|
389
|
-
onChange: onChangeAttr,
|
|
390
364
|
onDelete: function onDelete() {
|
|
391
|
-
|
|
365
|
+
var _formRef$current5;
|
|
366
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('dimension', undefined);
|
|
392
367
|
}
|
|
393
368
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
394
369
|
label: "\u5206\u6790\u6A21\u578B",
|
|
@@ -404,10 +379,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
404
379
|
onClick: resetting
|
|
405
380
|
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
|
|
406
381
|
loading: loading || subjectLoading,
|
|
407
|
-
disabled: searchDisabled,
|
|
408
382
|
type: "primary",
|
|
409
383
|
onClick: function onClick() {
|
|
410
|
-
|
|
384
|
+
var _formRef$current6;
|
|
385
|
+
(_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.submit();
|
|
411
386
|
}
|
|
412
387
|
}, "\u67E5\u8BE2"))));
|
|
413
388
|
};
|
|
@@ -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.23",
|
|
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": "dfb9bfb4e6f4672dc2f8633b785d87fb05eafd40"
|
|
66
66
|
}
|