@zgfe/modules-event 0.0.2-event.11 → 0.0.2-event.13
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.
|
@@ -13,6 +13,7 @@ import { BizAddToPanel, BizAddToScene, BizGlobalDataContext } from '@zgfe/busine
|
|
|
13
13
|
import './styles/index.less';
|
|
14
14
|
import { EventContext } from '../../types';
|
|
15
15
|
import { chartTypes, platformOption } from '../../constants/fields';
|
|
16
|
+
import { getWarningId } from '../../utils/formData';
|
|
16
17
|
var classPrefix = 'modules-event-topbar';
|
|
17
18
|
var TopBar = function TopBar(props) {
|
|
18
19
|
var _useContext = useContext(EventContext),
|
|
@@ -49,19 +50,7 @@ var TopBar = function TopBar(props) {
|
|
|
49
50
|
warningId = _useState10[0],
|
|
50
51
|
setWarningId = _useState10[1];
|
|
51
52
|
useEffect(function () {
|
|
52
|
-
|
|
53
|
-
if (searchData === null || searchData === void 0 ? void 0 : searchData.id) {
|
|
54
|
-
setWarningId(searchData === null || searchData === void 0 ? void 0 : searchData.id);
|
|
55
|
-
} else {
|
|
56
|
-
var _eventGroupList$, _eventGroupList$$even;
|
|
57
|
-
if (eventGroupList && ((_eventGroupList$ = eventGroupList[0]) === null || _eventGroupList$ === void 0 ? void 0 : (_eventGroupList$$even = _eventGroupList$.eventList[0]) === null || _eventGroupList$$even === void 0 ? void 0 : _eventGroupList$$even.id)) {
|
|
58
|
-
var _eventGroupList$2, _eventGroupList$2$eve;
|
|
59
|
-
setWarningId((_eventGroupList$2 = eventGroupList[0]) === null || _eventGroupList$2 === void 0 ? void 0 : (_eventGroupList$2$eve = _eventGroupList$2.eventList[0]) === null || _eventGroupList$2$eve === void 0 ? void 0 : _eventGroupList$2$eve.id);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
setWarningId(-1);
|
|
64
|
-
}
|
|
53
|
+
setWarningId(getWarningId(searchData, eventData, eventGroupList));
|
|
65
54
|
}, [searchData, eventData, eventGroupList]);
|
|
66
55
|
useEffect(function () {
|
|
67
56
|
if (searchData === null || searchData === void 0 ? void 0 : searchData.id) {
|
|
@@ -8,7 +8,6 @@ import React, { useState } from 'react';
|
|
|
8
8
|
import { Form, Button } from 'antd';
|
|
9
9
|
import { BizUserGroupHeader } from '@zgfe/business-lib';
|
|
10
10
|
import EventFilter from '../../components/eventFilter';
|
|
11
|
-
import util from '../../utils/util';
|
|
12
11
|
import './styles/index.less';
|
|
13
12
|
var classPrefix = 'top-panel';
|
|
14
13
|
var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -33,20 +32,7 @@ var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
if (allData.userGroup) {
|
|
36
|
-
_data.userGroup =
|
|
37
|
-
allData.userGroup.map(function (item) {
|
|
38
|
-
if (util.isArray(item)) {
|
|
39
|
-
var _arr = [];
|
|
40
|
-
item.map(function (_item) {
|
|
41
|
-
var _item$;
|
|
42
|
-
var _name = "".concat(_item[1].id, ":").concat((_item$ = _item[2]) === null || _item$ === void 0 ? void 0 : _item$.layerLabelId);
|
|
43
|
-
_arr.push(_name);
|
|
44
|
-
});
|
|
45
|
-
_data.userGroup && _data.userGroup.push(_arr);
|
|
46
|
-
} else {
|
|
47
|
-
_data.userGroup && _data.userGroup.push(item.id);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
35
|
+
_data.userGroup = allData.userGroup;
|
|
50
36
|
if (_data.userGroup.length <= 0) _data.userGroup = [0];
|
|
51
37
|
}
|
|
52
38
|
if (data.filterConditions) {
|
|
@@ -62,9 +48,7 @@ var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
62
48
|
var resetting = function resetting() {
|
|
63
49
|
form.resetFields();
|
|
64
50
|
form.setFieldsValue({
|
|
65
|
-
userGroup: [
|
|
66
|
-
id: 0
|
|
67
|
-
}],
|
|
51
|
+
userGroup: [0],
|
|
68
52
|
filterConditions: null
|
|
69
53
|
});
|
|
70
54
|
props.onChange({
|
|
@@ -81,13 +65,7 @@ var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
65
|
colon: false,
|
|
82
66
|
layout: "vertical",
|
|
83
67
|
initialValues: {
|
|
84
|
-
userGroup: userGroup ? userGroup
|
|
85
|
-
return {
|
|
86
|
-
id: item
|
|
87
|
-
};
|
|
88
|
-
}) : [{
|
|
89
|
-
id: 0
|
|
90
|
-
}],
|
|
68
|
+
userGroup: userGroup ? userGroup : [0],
|
|
91
69
|
filterConditions: {
|
|
92
70
|
id: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.id,
|
|
93
71
|
name: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.name,
|
package/es/utils/formData.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function getColumns(eventGroupList: EventGroup[] | undefined, use
|
|
|
8
8
|
export declare function getEventAliasName(name: string): string;
|
|
9
9
|
export declare function getUserGroupsCompareData(data: ResponseDataProps): ResponseDataProps;
|
|
10
10
|
export declare function marketEventGroupList(eventGroupList: EventGroup[] | undefined): string[];
|
|
11
|
+
export declare function getWarningId(searchData: SearchValue, eventData: ResponseDataProps, eventGroupList: EventGroup[] | undefined): number;
|
|
11
12
|
export declare function getAttrLabel(attrData: AttrConditionTypes.ItemValue, eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined): string | undefined;
|
|
12
13
|
export declare function formTableData(originalData: ResponseDataProps, userGroups: number[], attrNum: number, showList?: string[]): EventProps.ColumnsDataType[];
|
|
13
14
|
export declare function getDefaultShow(source: ResponseDataProps): string[];
|
package/es/utils/formData.js
CHANGED
|
@@ -202,6 +202,26 @@ export function marketEventGroupList(eventGroupList) {
|
|
|
202
202
|
console.log(666, _marketName);
|
|
203
203
|
return _marketName;
|
|
204
204
|
}
|
|
205
|
+
export function getWarningId(searchData, eventData, eventGroupList) {
|
|
206
|
+
var id = -1;
|
|
207
|
+
if (eventData && eventData.series.length > 0) {
|
|
208
|
+
if (searchData === null || searchData === void 0 ? void 0 : searchData.id) {
|
|
209
|
+
id = searchData === null || searchData === void 0 ? void 0 : searchData.id;
|
|
210
|
+
} else {
|
|
211
|
+
if (eventGroupList && eventGroupList.length > 0 && eventData) {
|
|
212
|
+
eventGroupList.map(function (item) {
|
|
213
|
+
item.eventList.map(function (_item) {
|
|
214
|
+
var _name = eventData.series[0].names[searchData.userGroup.length > 1 ? 1 : 0];
|
|
215
|
+
if (_item.name === _name || _item.alias === _name) {
|
|
216
|
+
id = _item.id;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return id;
|
|
224
|
+
}
|
|
205
225
|
export function getAttrLabel(attrData, eventGroupList, userPropList, eventEnvList) {
|
|
206
226
|
if (!attrData) return;
|
|
207
227
|
var type = attrData.propCategory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-event",
|
|
3
|
-
"version": "0.0.2-event.
|
|
3
|
+
"version": "0.0.2-event.13",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/lodash": "^4.14.191",
|
|
37
37
|
"@umijs/fabric": "^2.8.1",
|
|
38
38
|
"@umijs/test": "^3.0.5",
|
|
39
|
-
"@zgfe/business-lib": "1.1.81-
|
|
39
|
+
"@zgfe/business-lib": "1.1.81-page.9",
|
|
40
40
|
"antd": "^4.22.6",
|
|
41
41
|
"dumi": "^1.1.0",
|
|
42
42
|
"echarts": "^5.3.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react": "^16.12.0 || ^17.0.0",
|
|
50
50
|
"yorkie": "^2.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "29f7fb17b85c32080fc2ccf71d9db4275b6c60f5",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"react-copy-to-clipboard": "^5.1.0",
|
|
55
55
|
"react-highlight": "^0.15.0"
|