@zgfe/modules-interval 1.0.3-alpha.21 → 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";
|
|
@@ -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, 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,17 +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
|
-
relevancyChecked: relevancy,
|
|
307
240
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-start"),
|
|
308
|
-
analysisType: analysisType
|
|
309
|
-
|
|
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, {
|
|
310
251
|
className: "associated"
|
|
311
|
-
}, /*#__PURE__*/React.createElement(
|
|
252
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
253
|
+
align: "baseline"
|
|
254
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
312
255
|
className: "associated-link"
|
|
313
256
|
}, /*#__PURE__*/React.createElement("i", {
|
|
314
257
|
style: {
|
|
@@ -319,61 +262,90 @@ var TopPanel = function TopPanel(props) {
|
|
|
319
262
|
className: "associated-label"
|
|
320
263
|
}, "\u5C5E\u60271"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
321
264
|
name: "associatedPreAttr",
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
+
}]
|
|
326
273
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
327
274
|
enableEventProp: true,
|
|
328
275
|
enableUserProp: false,
|
|
329
276
|
enableEnvProp: false,
|
|
330
|
-
eventIdList: [
|
|
331
|
-
value: bizAttributeSelectorValue,
|
|
277
|
+
eventIdList: [startEvent === null || startEvent === void 0 ? void 0 : startEvent.id],
|
|
332
278
|
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"),
|
|
279
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-pre"),
|
|
335
280
|
onDelete: function onDelete() {
|
|
336
|
-
|
|
281
|
+
var _formRef$current;
|
|
282
|
+
(_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldValue('associatedPreAttr', undefined);
|
|
337
283
|
}
|
|
338
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
284
|
+
}))), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
339
285
|
className: "associated-label"
|
|
340
286
|
}, "\u5C5E\u60272"), /*#__PURE__*/React.createElement(Form.Item, {
|
|
341
287
|
name: "associatedNextAttr",
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
+
}]
|
|
345
296
|
}, /*#__PURE__*/React.createElement(BizAttributeSelector, {
|
|
346
297
|
enableEventProp: true,
|
|
347
298
|
enableUserProp: false,
|
|
348
299
|
enableEnvProp: false,
|
|
349
|
-
eventIdList: [
|
|
350
|
-
value: bizAttributeSelectorValue,
|
|
300
|
+
eventIdList: [endEvent === null || endEvent === void 0 ? void 0 : endEvent.id],
|
|
351
301
|
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"),
|
|
302
|
+
key: "".concat(startEvent === null || startEvent === void 0 ? void 0 : startEvent.id, "-").concat(endEvent === null || endEvent === void 0 ? void 0 : endEvent.id, "-next"),
|
|
354
303
|
onDelete: function onDelete() {
|
|
355
|
-
|
|
304
|
+
var _formRef$current2;
|
|
305
|
+
(_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.setFieldValue('associatedNextAttr', undefined);
|
|
356
306
|
}
|
|
357
|
-
})), /*#__PURE__*/React.createElement("i", {
|
|
307
|
+
}))), /*#__PURE__*/React.createElement("i", {
|
|
358
308
|
style: {
|
|
359
309
|
lineHeight: '32px',
|
|
360
310
|
marginLeft: '28px',
|
|
361
311
|
cursor: 'pointer'
|
|
362
312
|
},
|
|
363
313
|
onClick: function onClick() {
|
|
364
|
-
|
|
365
|
-
|
|
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);
|
|
366
317
|
setRelevancy(false);
|
|
367
|
-
setRelevancyFl(true);
|
|
368
318
|
},
|
|
369
319
|
className: "bsicon qingchu"
|
|
370
|
-
}))
|
|
320
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
371
321
|
label: "\u7ED3\u675F\u4E8B\u4EF6",
|
|
372
|
-
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
|
+
}]
|
|
373
342
|
}, /*#__PURE__*/React.createElement(EventFilter, {
|
|
374
343
|
subject: currentSubject,
|
|
375
344
|
analysisType: analysisType,
|
|
376
|
-
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
|
+
}
|
|
377
349
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
378
350
|
label: "\u6309\u5C5E\u6027\u7EC6\u5206",
|
|
379
351
|
name: "dimension",
|
|
@@ -383,12 +355,11 @@ var TopPanel = function TopPanel(props) {
|
|
|
383
355
|
enableUserProp: analysisType === 'user',
|
|
384
356
|
enableEnvProp: true,
|
|
385
357
|
key: "".concat(currentSubject === null || currentSubject === void 0 ? void 0 : currentSubject.subjectName, "-dimension"),
|
|
386
|
-
eventIdList:
|
|
387
|
-
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],
|
|
388
359
|
enableDelete: true,
|
|
389
|
-
onChange: onChangeAttr,
|
|
390
360
|
onDelete: function onDelete() {
|
|
391
|
-
|
|
361
|
+
var _formRef$current5;
|
|
362
|
+
(_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : _formRef$current5.setFieldValue('dimension', undefined);
|
|
392
363
|
}
|
|
393
364
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
394
365
|
label: "\u5206\u6790\u6A21\u578B",
|
|
@@ -404,10 +375,10 @@ var TopPanel = function TopPanel(props) {
|
|
|
404
375
|
onClick: resetting
|
|
405
376
|
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
|
|
406
377
|
loading: loading || subjectLoading,
|
|
407
|
-
disabled: searchDisabled,
|
|
408
378
|
type: "primary",
|
|
409
379
|
onClick: function onClick() {
|
|
410
|
-
|
|
380
|
+
var _formRef$current6;
|
|
381
|
+
(_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : _formRef$current6.submit();
|
|
411
382
|
}
|
|
412
383
|
}, "\u67E5\u8BE2"))));
|
|
413
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
|
}
|