@zgfe/modules-event 0.0.2-event.11 → 0.0.2-event.14

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.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import './styles/index.less';
3
+ import emptyImg from '../../style/image/empty.png';
3
4
  var classPrefix = 'mi-common';
4
5
  export var MiSpin = function MiSpin() {
5
6
  return /*#__PURE__*/React.createElement("div", {
@@ -9,8 +10,8 @@ export var MiSpin = function MiSpin() {
9
10
  export var MiNone = function MiNone(props) {
10
11
  return /*#__PURE__*/React.createElement("div", {
11
12
  className: "".concat(classPrefix, "-none-container")
12
- }, /*#__PURE__*/React.createElement("div", {
13
- className: "".concat(classPrefix, "-none")
13
+ }, /*#__PURE__*/React.createElement("img", {
14
+ src: emptyImg
14
15
  }), /*#__PURE__*/React.createElement("span", {
15
16
  className: "".concat(classPrefix, "-none-text")
16
17
  }, " ", props.label));
@@ -10,18 +10,17 @@
10
10
  background-size: contain;
11
11
  }
12
12
 
13
- &-none-text {
14
- color: @text-color;
15
- font-size: 16px;
16
- }
17
-
18
13
  &-none {
19
- width: 348px;
20
- height: 132px;
21
- background: url('../../../style/image/noData.png') no-repeat;
14
+ width: 50px !important;
15
+ height: auto;
16
+ margin-top: 30px;
17
+ margin-bottom: 10px;
22
18
  }
23
19
 
24
20
  &-none-container {
21
+ display: flex;
22
+ flex-direction: column;
23
+ color: rgba(0, 0, 0, 0.25);
25
24
  text-align: center;
26
25
  }
27
26
  }
@@ -44,6 +44,9 @@ var EventFilter = function EventFilter(props) {
44
44
  _useState12 = _slicedToArray(_useState11, 2),
45
45
  bizAttributeSelectorValue = _useState12[0],
46
46
  setBizAttributeSelectorValue = _useState12[1];
47
+ useEffect(function () {
48
+ console.log('bizAttributeSelectorValue', bizAttributeSelectorValue);
49
+ }, [bizAttributeSelectorValue]);
47
50
  useEffect(function () {
48
51
  if (props.value) {
49
52
  var _data = props.value;
@@ -59,7 +62,7 @@ var EventFilter = function EventFilter(props) {
59
62
  }
60
63
  if (_data.dimension) {
61
64
  setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, _data.dimension), {}, {
62
- key: _data.dimension.propCategory === 'eventProp' ? _data.dimension.value : _data.dimension.propCategory + '-' + _data.dimension.value
65
+ key: _data.dimension.propCategory + '-' + _data.dimension.value
63
66
  }));
64
67
  }
65
68
  }
@@ -105,6 +108,7 @@ var EventFilter = function EventFilter(props) {
105
108
  setCount(0);
106
109
  };
107
110
  var onChangeAttr = function onChangeAttr(attr) {
111
+ console.log('细分属性', attr);
108
112
  if (attr === undefined) {
109
113
  setBizAttributeSelectorValue(undefined);
110
114
  } else {
@@ -113,7 +117,7 @@ var EventFilter = function EventFilter(props) {
113
117
  propCategory: attr.propCategory,
114
118
  category: attr.category,
115
119
  value: _value,
116
- key: attr.propCategory === 'eventProp' ? attr.id : attr.propCategory + '-' + _value
120
+ key: attr.propCategory + '-' + _value
117
121
  });
118
122
  }
119
123
  };
@@ -44,7 +44,7 @@ var ContentPanel = function ContentPanel(props) {
44
44
  showList: showList
45
45
  }) : /*#__PURE__*/React.createElement(MiNone, {
46
46
  label: "\u6682\u65E0\u6570\u636E"
47
- })), eventData && eventData.xAxis.length ? /*#__PURE__*/React.createElement(EventChart, {
47
+ })), eventData && eventData.series.length > 0 ? /*#__PURE__*/React.createElement(EventChart, {
48
48
  type: "grid",
49
49
  dataSource: eventData,
50
50
  params: searchData,
@@ -19,7 +19,7 @@ import { formTableData, getColumns } from '../../utils/formData';
19
19
  import './styles/index.less';
20
20
  import { getValue } from '../../modules/content/utils';
21
21
  import { EventContext } from '../../types';
22
- import emptyImg from './images/empty.png';
22
+ import emptyImg from '../../style/image/empty.png';
23
23
  var classPrefix = 'mi-table';
24
24
  var EventTable = function EventTable(props) {
25
25
  var dataSource = props.dataSource,
@@ -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
- if (eventData && eventData.series.length > 0) {
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) {
@@ -18,7 +18,7 @@ import _ from 'lodash';
18
18
  import moment from 'moment';
19
19
  import { Apis, chartColors } from '../../constants';
20
20
  import { Spin } from 'antd';
21
- import emptyImg from '../../components/table/images/empty.png';
21
+ import emptyImg from '../../style/image/empty.png';
22
22
  var classPrefix = 'mi-table';
23
23
  var EventChart = function EventChart(props) {
24
24
  var params = props.params;
@@ -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,19 +32,8 @@ 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
- }
35
+ _data.userGroup = allData.userGroup.filter(function (item) {
36
+ return item !== undefined;
49
37
  });
50
38
  if (_data.userGroup.length <= 0) _data.userGroup = [0];
51
39
  }
@@ -62,9 +50,7 @@ var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
62
50
  var resetting = function resetting() {
63
51
  form.resetFields();
64
52
  form.setFieldsValue({
65
- userGroup: [{
66
- id: 0
67
- }],
53
+ userGroup: [0],
68
54
  filterConditions: null
69
55
  });
70
56
  props.onChange({
@@ -81,13 +67,7 @@ var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
81
67
  colon: false,
82
68
  layout: "vertical",
83
69
  initialValues: {
84
- userGroup: userGroup ? userGroup.map(function (item) {
85
- return {
86
- id: item
87
- };
88
- }) : [{
89
- id: 0
90
- }],
70
+ userGroup: userGroup ? userGroup : [0],
91
71
  filterConditions: {
92
72
  id: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.id,
93
73
  name: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.name,
@@ -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[];
@@ -140,7 +140,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
140
140
  return a["field".concat(i)] - b["field".concat(i)];
141
141
  },
142
142
  render: function render(text, record) {
143
- var click = text > 0 && searchData.analysisIndex === 'number' ? true : false;
143
+ var click = text > 0 && (searchData.analysisIndex === 'number' ? true : false);
144
144
  return /*#__PURE__*/React.createElement("div", {
145
145
  className: "".concat(classPrefix, "-table-td-link ").concat(click ? '' : 'not-to-detail'),
146
146
  onClick: function onClick() {
@@ -182,12 +182,10 @@ export function getUserGroupsCompareData(data) {
182
182
  if (item.names[1] === _item.names[1] && index !== _index) {
183
183
  _series.push(_item);
184
184
  delete _data.series[_index];
185
- console.log(3333, _data.series);
186
185
  }
187
186
  });
188
187
  delete _data.series[index];
189
188
  });
190
- console.log('_tempData', _series);
191
189
  _data.series = _series;
192
190
  return _data;
193
191
  }
@@ -202,6 +200,26 @@ export function marketEventGroupList(eventGroupList) {
202
200
  console.log(666, _marketName);
203
201
  return _marketName;
204
202
  }
203
+ export function getWarningId(searchData, eventData, eventGroupList) {
204
+ var id = -1;
205
+ if (eventData && eventData.series.length > 0) {
206
+ if (searchData === null || searchData === void 0 ? void 0 : searchData.id) {
207
+ id = searchData === null || searchData === void 0 ? void 0 : searchData.id;
208
+ } else {
209
+ if (eventGroupList && eventGroupList.length > 0 && eventData) {
210
+ eventGroupList.map(function (item) {
211
+ item.eventList.map(function (_item) {
212
+ var _name = eventData.series[0].names[searchData.userGroup.length > 1 ? 1 : 0];
213
+ if (_item.name === _name || _item.alias === _name) {
214
+ id = _item.id;
215
+ }
216
+ });
217
+ });
218
+ }
219
+ }
220
+ }
221
+ return id;
222
+ }
205
223
  export function getAttrLabel(attrData, eventGroupList, userPropList, eventEnvList) {
206
224
  if (!attrData) return;
207
225
  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.11",
3
+ "version": "0.0.2-event.14",
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-panel1.0.0",
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": "ce44449e1fb45e5415e75ebd8d04c69b813cc1c0",
52
+ "gitHead": "1aca522da45c7948d151b48080319e719481738d",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"