@zgfe/modules-event 0.0.2-alpha.6 → 0.0.2-alpha.9

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,3 +1,6 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1
4
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
6
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -8,6 +11,7 @@ import { Tooltip } from 'antd';
8
11
  import React, { useEffect, useRef, useState } from 'react';
9
12
  import { BizEventSelector, BizAttributeSelector, IconFont, BizAttrConditionGroup } from '@zgfe/business-lib';
10
13
  import './styles/index.less';
14
+ import _ from 'lodash';
11
15
  var classPrefix = 'eventfilter-box';
12
16
  var EventFilter = function EventFilter(props) {
13
17
  var _useState = useState(0),
@@ -40,13 +44,15 @@ var EventFilter = function EventFilter(props) {
40
44
  setBizAttributeSelectorValue = _useState12[1];
41
45
  useEffect(function () {
42
46
  if (props.value) {
43
- var _data = props.value[0];
47
+ var _data = props.value;
44
48
  setEvent({
45
49
  id: _data.id,
46
50
  name: _data.name
47
51
  });
48
52
  setFilter(_data.filters);
49
- setBizAttributeSelectorValue(_data.eventAttr);
53
+ setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, _data.dimension), {}, {
54
+ key: _data.dimension.propCategory === 'eventProp' ? _data.dimension.value : _data.dimension.propCategory + '-' + _data.dimension.value
55
+ }));
50
56
  setEventOverview(false);
51
57
  }
52
58
  }, []);
@@ -85,16 +91,16 @@ var EventFilter = function EventFilter(props) {
85
91
  setCount(0);
86
92
  };
87
93
  var onChangeAttr = function onChangeAttr(attr) {
94
+ console.log('细分属性', attr);
88
95
  if (attr === undefined) {
89
96
  setBizAttributeSelectorValue(undefined);
90
97
  } else {
98
+ var _value = attr.propCategory === 'eventProp' ? attr.id : attr.name;
91
99
  setBizAttributeSelectorValue({
92
- id: attr.id,
93
100
  propCategory: attr.propCategory,
94
- name: attr.name,
95
101
  category: attr.category,
96
- label: attr.label,
97
- dimensionSub: attr.dimensionSub
102
+ value: _value,
103
+ key: attr.propCategory === 'eventProp' ? attr.id : attr.propCategory + '-' + _value
98
104
  });
99
105
  }
100
106
  };
@@ -107,10 +113,15 @@ var EventFilter = function EventFilter(props) {
107
113
  _event.filters = filter;
108
114
  }
109
115
  if (bizAttributeSelectorValue) {
110
- _event.eventAttr = bizAttributeSelectorValue;
116
+ var _dimension = _.cloneDeep(bizAttributeSelectorValue);
117
+ delete _dimension.key;
118
+ _event.dimension = _dimension;
111
119
  }
112
120
  props.onChange && props.onChange(_event);
113
121
  }, [bizAttributeSelectorValue, filter, event]);
122
+ useEffect(function () {
123
+ console.log(666, bizAttributeSelectorValue);
124
+ }, [bizAttributeSelectorValue]);
114
125
  return /*#__PURE__*/React.createElement("div", {
115
126
  className: classPrefix
116
127
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizEventSelector, {
@@ -9,6 +9,7 @@
9
9
  }
10
10
  .shaixuan {
11
11
  margin-top: 2px;
12
+ margin-left: 20px;
12
13
  color: #9aa1a9;
13
14
  font-size: 20px !important;
14
15
  cursor: pointer;
@@ -17,6 +17,7 @@ import { Apis } from '../../constants';
17
17
  import { Modal, message } from 'antd';
18
18
  import { formTableData, getColumns } from '../../utils/formData';
19
19
  import './styles/index.less';
20
+ import { getValue } from '../../modules/content/utils';
20
21
  import { EventContext } from '../../types';
21
22
  var classPrefix = 'mi-table';
22
23
  var EventTable = function EventTable(props) {
@@ -53,7 +54,7 @@ var EventTable = function EventTable(props) {
53
54
  sqlText = _useState10[0],
54
55
  setSqlText = _useState10[1];
55
56
  useEffect(function () {
56
- var gLen = (searchData === null || searchData === void 0 ? void 0 : searchData.filterConditions) && (searchData === null || searchData === void 0 ? void 0 : searchData.filterConditions[0].eventAttr) ? 1 : 0;
57
+ var gLen = (searchData === null || searchData === void 0 ? void 0 : searchData.dimension) ? 1 : 0;
57
58
  var sortData = formTableData(dataSource, searchData.userGroup || [0], gLen, eventGroupList);
58
59
  setSearchTable(sortData);
59
60
  setSortTable(sortData);
@@ -66,39 +67,24 @@ var EventTable = function EventTable(props) {
66
67
  props.changeShowByName(nameGroup);
67
68
  };
68
69
  var onClickToDetail = function onClickToDetail(item, time, count) {
69
- var _searchData$time;
70
- var group_value = '';
71
- if (searchData.filterConditions && searchData.filterConditions[0].eventAttr) {
72
- group_value = item.eventAttr;
73
- } else {
74
- eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
75
- group.eventList.forEach(function (event) {
76
- if (event.name === item.name) {
77
- group_value = event.id.toString();
78
- }
79
- });
80
- });
81
- }
82
- var group_by = [['bar', 'map', 'pie'].includes(searchData.chartType) ? 'total' : (_searchData$time = searchData.time) === null || _searchData$time === void 0 ? void 0 : _searchData$time.unit];
83
- if (searchData.filterConditions && searchData.filterConditions[0].eventAttr) {
84
- var _searchData$filterCon;
85
- group_by.push((_searchData$filterCon = searchData.filterConditions[0].eventAttr) === null || _searchData$filterCon === void 0 ? void 0 : _searchData$filterCon.dimensionSub);
86
- } else {
87
- group_by.push('');
70
+ var _searchData$filters;
71
+ var group_value = {};
72
+ if (searchData.dimension) {
73
+ group_value = {
74
+ group_value: item.dimension
75
+ };
88
76
  }
89
77
  onUserDrill && onUserDrill({
90
78
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
91
79
  platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0,
92
80
  count: count,
93
- params: _objectSpread(_objectSpread({
94
- appid: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
95
- plat: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0,
96
- user_type: 0,
97
- isTotal: false,
98
- group_value: group_value,
99
- group_by: group_by.join(','),
100
- module: 'event'
101
- }, searchData), {}, {
81
+ module: 'event',
82
+ params: _objectSpread(_objectSpread({}, group_value), {}, {
83
+ id: searchData.id,
84
+ userGroup: searchData.userGroup,
85
+ chartType: searchData.chartType,
86
+ conditions: (_searchData$filters = searchData.filters) === null || _searchData$filters === void 0 ? void 0 : _searchData$filters.conditions,
87
+ dimension: searchData.dimension,
102
88
  time: _objectSpread(_objectSpread({}, searchData.time), {}, {
103
89
  begin: time[0],
104
90
  end: time.length > 1 ? time[1] : time[0]
@@ -127,7 +113,7 @@ var EventTable = function EventTable(props) {
127
113
  data: _objectSpread({
128
114
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
129
115
  platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0,
130
- service: !searchData.filterConditions ? 'event/overview_sql' : 'event_sql'
116
+ service: !searchData.dimension ? 'event/overview_sql' : 'event_sql'
131
117
  }, searchData)
132
118
  }).then(function (res) {
133
119
  setSqlText(res.data.sql);
@@ -139,10 +125,10 @@ var EventTable = function EventTable(props) {
139
125
  if (searchData.userGroup && searchData.userGroup.length > 1) {
140
126
  seriesNames.push(base64.encode('用户群'));
141
127
  }
142
- if (searchData.filterConditions && searchData.filterConditions[0].eventAttr) {
143
- seriesNames.push(base64.encode(searchData.filterConditions[0].eventAttr.label));
128
+ if (searchData.dimension) {
129
+ seriesNames.push(base64.encode(getValue(searchData.dimension).label));
144
130
  }
145
- if (searchData.filterConditions && !searchData.filterConditions[0].eventAttr || !searchData.filterConditions) {
131
+ if (searchData.id && !searchData.dimension || !searchData.id) {
146
132
  seriesNames.push(base64.encode('事件'));
147
133
  }
148
134
  var params = _objectSpread(_objectSpread({
@@ -31,10 +31,14 @@ var TopBar = function TopBar(props) {
31
31
  currentApp = _useContext2.currentApp;
32
32
  var searchData = props.searchData,
33
33
  platformChange = props.platformChange;
34
- var _useState5 = useState(),
34
+ var _useState5 = useState(searchData.platform === undefined ? 0 : searchData.platform),
35
35
  _useState6 = _slicedToArray(_useState5, 2),
36
- panelType = _useState6[0],
37
- setPanelType = _useState6[1];
36
+ selectPlatform = _useState6[0],
37
+ setselectPlatform = _useState6[1];
38
+ var _useState7 = useState(),
39
+ _useState8 = _slicedToArray(_useState7, 2),
40
+ panelType = _useState8[0],
41
+ setPanelType = _useState8[1];
38
42
  var closeHandle = function closeHandle(type) {
39
43
  if (type === 'panel') {
40
44
  setPanelType(undefined);
@@ -95,9 +99,11 @@ var TopBar = function TopBar(props) {
95
99
  className: "".concat(classPrefix, "-platform")
96
100
  }, platformOption.map(function (item) {
97
101
  return /*#__PURE__*/React.createElement("div", {
102
+ className: "".concat(selectPlatform === item.key ? 'active' : ''),
98
103
  key: item.key,
99
104
  onClick: function onClick() {
100
- return platformChange(item.key);
105
+ setselectPlatform(item.key);
106
+ platformChange(item.key);
101
107
  }
102
108
  }, item.value);
103
109
  })));
@@ -25,7 +25,8 @@
25
25
  border: 1px solid #ecedf0;
26
26
  cursor: pointer;
27
27
  }
28
- > div:hover {
28
+ > div:hover,
29
+ .active {
29
30
  z-index: 1;
30
31
  color: #165dff;
31
32
  background: #e8efff;
@@ -11,6 +11,7 @@ import React, { useContext, useEffect, useMemo, useState } from 'react';
11
11
  import { BizChart, BizGlobalDataContext, ajax } from '@zgfe/business-lib';
12
12
  import { EventTable, MiNone } from '../../components';
13
13
  import { judgeIsCity } from '../content/utils';
14
+ import { getValue } from '../../modules/content/utils';
14
15
  import { getDefaultShow, getShowColor } from '../../utils/formData';
15
16
  import _ from 'lodash';
16
17
  import { Apis, chartColors } from '../../constants';
@@ -70,10 +71,10 @@ var EventChart = /*#__PURE__*/React.forwardRef(function (props, ref) {
70
71
  var chartData = ((_params$chartType = params.chartType) === null || _params$chartType === void 0 ? void 0 : _params$chartType.split(',')) || ['line'];
71
72
  var type = (chartData === null || chartData === void 0 ? void 0 : chartData.length) > 1 ? chartData[chartData.length - 1] : chartData[0];
72
73
  setChartType(props.type || type);
73
- if (params.filterConditions && params.filterConditions[0]) {
74
- var dimensions = params.filterConditions[0].eventAttr;
75
- if (type === 'map' && dimensions && dimensions.name) {
76
- setIsCity(judgeIsCity(dimensions.name));
74
+ if (params.id) {
75
+ var dimensions = params.dimension;
76
+ if (type === 'map' && dimensions) {
77
+ setIsCity(judgeIsCity(getValue(dimensions).name));
77
78
  }
78
79
  }
79
80
  }, [params, props.type]);
@@ -25,6 +25,7 @@ var CancelToken = Request.CancelToken;
25
25
  var cancel;
26
26
  var classPrefix = 'event-content';
27
27
  var EventContent = function EventContent(props) {
28
+ console.log('EventContent', props);
28
29
  var _Form$useForm = Form.useForm(),
29
30
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
30
31
  form = _Form$useForm2[0];
@@ -52,6 +53,10 @@ var EventContent = function EventContent(props) {
52
53
  _useState12 = _slicedToArray(_useState11, 2),
53
54
  isCity = _useState12[0],
54
55
  setIsCity = _useState12[1];
56
+ var _useState13 = useState(-1),
57
+ _useState14 = _slicedToArray(_useState13, 2),
58
+ eventId = _useState14[0],
59
+ setEventId = _useState14[1];
55
60
  var _useContext = useContext(BizGlobalDataContext),
56
61
  currentApp = _useContext.currentApp;
57
62
  var _useContext2 = useContext(EventContext),
@@ -62,13 +67,41 @@ var EventContent = function EventContent(props) {
62
67
  var chartRef = useRef();
63
68
  var collapseRef = useRef();
64
69
  useEffect(function () {
65
- if (props.value && props.value.filterConditions && props.value.filterConditions[0].id !== -1) {
66
- setEventId(props.value.filterConditions[0].id);
70
+ form.resetFields();
71
+ if (props.defaultValue) {
72
+ setEventId(props.defaultValue.id);
73
+ var _props$defaultValue = props.defaultValue,
74
+ id = _props$defaultValue.id,
75
+ name = _props$defaultValue.name,
76
+ dimension = _props$defaultValue.dimension,
77
+ filters = _props$defaultValue.filters,
78
+ userGroup = _props$defaultValue.userGroup;
79
+ form.setFieldsValue({
80
+ userGroup: userGroup ? userGroup.map(function (item) {
81
+ return {
82
+ id: item
83
+ };
84
+ }) : [{
85
+ id: 0
86
+ }],
87
+ filterConditions: {
88
+ id: id,
89
+ name: name,
90
+ dimension: dimension,
91
+ filters: filters
92
+ }
93
+ });
94
+ } else {
95
+ form.setFieldsValue({
96
+ userGroup: [{
97
+ id: 0
98
+ }]
99
+ });
67
100
  }
68
- }, []);
101
+ }, [props.defaultValue]);
69
102
  useEffect(function () {
70
- if (searchData && searchData.filterConditions && searchData.filterConditions[0].eventAttr) {
71
- var _attrName = searchData.filterConditions[0].eventAttr.name;
103
+ if (searchData && searchData.filterConditions && searchData.filterConditions[0].dimension) {
104
+ var _attrName = searchData.filterConditions[0].dimension.name;
72
105
  setEnableSelectChart(judgeIsArea(_attrName));
73
106
  setIsCity(judgeIsCity(_attrName));
74
107
  }
@@ -129,20 +162,14 @@ var EventContent = function EventContent(props) {
129
162
  var onChangeShow = function onChangeShow(data) {
130
163
  setShowList(data);
131
164
  };
132
- var _useState13 = useState(-1),
133
- _useState14 = _slicedToArray(_useState13, 2),
134
- eventId = _useState14[0],
135
- setEventId = _useState14[1];
136
165
  var onValuesChange = function onValuesChange(data) {
137
- console.log('onValuesChange', data);
138
166
  var _data = {};
139
167
  if (data.filterConditions) {
140
168
  if (data.filterConditions.id !== -100) {
141
- _data.filterConditions = [data.filterConditions];
142
- } else {
143
- _data.filterConditions = undefined;
169
+ _data = data.filterConditions;
170
+ setEventId(data.filterConditions.id);
144
171
  }
145
- if (finalSearchData && finalSearchData.filterConditions && data.filterConditions.id === finalSearchData.filterConditions[0].id) {
172
+ if (finalSearchData && finalSearchData.id && data.filterConditions.id === finalSearchData.id) {
146
173
  ajaxFlag = false;
147
174
  }
148
175
  } else if (data.userGroup) {
@@ -157,14 +184,13 @@ var EventContent = function EventContent(props) {
157
184
  setSearchData(function (_searchData) {
158
185
  return _objectSpread(_objectSpread({}, _searchData), _data);
159
186
  });
160
- if (data.event && data.event.id !== -1) {
161
- setEventId(data.event.id);
162
- }
163
187
  };
164
188
  var platformChange = function platformChange(data) {
165
189
  ajaxFlag = true;
166
190
  setSearchData(function (_searchData) {
167
- return _objectSpread(_objectSpread({}, _searchData), data);
191
+ return _objectSpread(_objectSpread({}, _searchData), {}, {
192
+ platform: data
193
+ });
168
194
  });
169
195
  };
170
196
  var resetting = function resetting() {
@@ -183,16 +209,6 @@ var EventContent = function EventContent(props) {
183
209
  colon: false,
184
210
  layout: "vertical",
185
211
  scrollToFirstError: true,
186
- initialValues: {
187
- userGroup: searchData && searchData.userGroup ? searchData.userGroup.map(function (item) {
188
- return {
189
- id: item
190
- };
191
- }) : [{
192
- id: 0
193
- }],
194
- filterConditions: searchData === null || searchData === void 0 ? void 0 : searchData.filterConditions
195
- },
196
212
  onValuesChange: onValuesChange
197
213
  }, /*#__PURE__*/React.createElement(Form.Item, {
198
214
  label: "",
@@ -1,6 +1,7 @@
1
1
  import { SearchValue } from '../../types';
2
2
  export declare namespace EventContentProps {
3
3
  interface Props {
4
+ defaultValue?: SearchValue;
4
5
  value: SearchValue;
5
6
  show?: string[];
6
7
  onSearching?: (flag: boolean) => void;
@@ -1,2 +1,5 @@
1
+ import { AttributeSelect } from '@zgfe/business-lib';
2
+ import { bizAttributeSelectorValueProp } from '../../types';
1
3
  export declare const judgeIsCity: (name: string | undefined) => boolean;
2
4
  export declare const judgeIsArea: (name: string | undefined) => boolean;
5
+ export declare const getValue: (param: bizAttributeSelectorValueProp) => AttributeSelect.Value | undefined;
@@ -1,3 +1,5 @@
1
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
2
+ import { useContext } from 'react';
1
3
  export var judgeIsCity = function judgeIsCity(name) {
2
4
  var areaData = ['current_city', 'city'];
3
5
  return name && areaData.indexOf(name) !== -1 ? true : false;
@@ -5,4 +7,30 @@ export var judgeIsCity = function judgeIsCity(name) {
5
7
  export var judgeIsArea = function judgeIsArea(name) {
6
8
  var areaData = ['current_area', 'current_city', 'area', 'city'];
7
9
  return name && areaData.indexOf(name) !== -1 ? true : false;
10
+ };
11
+ export var getValue = function getValue(param) {
12
+ var _useContext = useContext(BizGlobalDataContext),
13
+ eventGroupList = _useContext.eventGroupList,
14
+ eventEnvList = _useContext.eventEnvList,
15
+ userPropList = _useContext.userPropList;
16
+ var res = undefined;
17
+ var key = param.propCategory === 'eventProp' ? param.value : param.propCategory + '-' + param.value;
18
+ if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
19
+ eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
20
+ if (attr.key === key) res = attr;
21
+ });
22
+ } else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'eventProp') {
23
+ eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
24
+ group.eventList.forEach(function (event) {
25
+ event.attrList.forEach(function (attr) {
26
+ if (attr.key === key) res = attr;
27
+ });
28
+ });
29
+ });
30
+ } else if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'userProp') {
31
+ userPropList === null || userPropList === void 0 ? void 0 : userPropList.forEach(function (attr) {
32
+ if (attr.key === key) res = attr;
33
+ });
34
+ }
35
+ return res;
8
36
  };
@@ -10,54 +10,43 @@ import { ModuleEvent } from '../../../index';
10
10
  import { requestConfig } from '../../../utils/ajaxConfig';
11
11
  import { Button } from 'antd';
12
12
  var defaultValue = {
13
- id: 243217,
14
- name: '事件分析1',
13
+ id: 7565,
14
+ name: '测试6666',
15
15
  type: 0,
16
16
  enlarged: 0,
17
17
  panelId: 400900,
18
18
  panelType: 'edit',
19
19
  data: {
20
- appId: 204,
21
20
  chartType: 'line',
22
- platform: 0,
23
- userGroup: [959, 962],
24
- analysisIndex: 'number',
25
- userAttr: '',
21
+ analysisIndex: 'per',
22
+ id: 7565,
23
+ name: '测试6666',
24
+ appId: 266,
25
+ platform: 1,
26
+ userGroup: [933, 935],
26
27
  time: {
27
28
  unit: 'day',
28
- relative: [7, 0],
29
- begin: '2023-08-03',
30
- end: '2023-08-10'
29
+ relative: [14, 0],
30
+ begin: '2023-08-04',
31
+ end: '2023-08-18'
31
32
  },
32
- filterConditions: [{
33
- type: 'event',
34
- alias: '崩溃',
35
- id: 6606,
36
- name: '崩溃',
37
- eventGroupId: -1,
38
- marked: false,
39
- filters: {
40
- relation: 'and',
41
- conditions: [{
42
- attrId: 142787,
43
- propCategory: 'eventProp',
44
- type: 1,
45
- operator: 'equal',
46
- values: ['com.zhuge.demo:main'],
47
- dimensionSub: 'event_attr',
48
- label: '异常进程名称',
49
- attrName: '异常进程名称'
50
- }]
51
- },
52
- eventAttr: {
53
- id: 142787,
33
+ dimension: {
34
+ propCategory: 'eventProp',
35
+ value: 151045
36
+ },
37
+ filters: {
38
+ relation: 'and',
39
+ conditions: [{
40
+ attrId: 151045,
54
41
  propCategory: 'eventProp',
55
- type: 2,
42
+ type: 1,
43
+ operator: 'equal',
44
+ values: ['55'],
56
45
  dimensionSub: 'event_attr',
57
- label: '异常进程名称',
58
- name: '异常进程名称'
59
- }
60
- }]
46
+ label: '应用名称',
47
+ attrName: '应用名称'
48
+ }]
49
+ }
61
50
  }
62
51
  };
63
52
  export default (function () {
@@ -87,7 +76,7 @@ export default (function () {
87
76
  };
88
77
  return /*#__PURE__*/React.createElement(DemoWrapper, {
89
78
  needMeta: true,
90
- defaultApp: 204
79
+ defaultApp: 266
91
80
  }, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
92
81
  onClick: function onClick() {
93
82
  return setIsDetail(false);
@@ -111,6 +111,7 @@ var ModuleEvent = function ModuleEvent(props) {
111
111
  onUserDrill: props.onUserDrill
112
112
  }
113
113
  }, /*#__PURE__*/React.createElement(EventContent, {
114
+ defaultValue: props.defaultValue ? props.defaultValue.data : null,
114
115
  value: searchData,
115
116
  show: showList,
116
117
  onChange: setSearchData,
package/es/types.d.ts CHANGED
@@ -2,26 +2,27 @@ import { TargetConditionTypes, AttrConditionTypes, BizSelectTypes, AttributeSele
2
2
  import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
3
3
  import { ReactNode } from 'react';
4
4
  export interface bizAttributeSelectorValueProp {
5
- id?: number;
6
5
  propCategory?: string;
7
- name?: string;
8
6
  category?: string;
9
- label?: string;
10
- dimensionSub?: string;
7
+ value?: number | string;
8
+ key?: number | string;
11
9
  }
12
10
  export interface eventProps {
13
11
  id?: number;
14
12
  name?: string;
15
13
  filters?: AttrConditionTypes.GroupValue;
16
- eventAttr?: bizAttributeSelectorValueProp;
14
+ dimension?: bizAttributeSelectorValueProp;
17
15
  }
18
16
  export interface SearchValue {
17
+ id?: number;
18
+ name?: string;
19
19
  chartType?: EventChartTypes;
20
20
  userGroup?: number[];
21
21
  analysisIndex?: string;
22
22
  analysisAttr?: string;
23
23
  time?: DatePickerTypes.Value;
24
- filterConditions?: eventProps[];
24
+ dimension?: bizAttributeSelectorValueProp;
25
+ filters?: AttrConditionTypes.GroupValue;
25
26
  }
26
27
  export interface SearchData {
27
28
  userGroup?: Array<BizSelectTypes.Option>;
@@ -4,6 +4,7 @@ import { chartColors } from '../constants/color';
4
4
  import { PropCategory } from '@zgfe/business-lib/es/attributeSelector/types';
5
5
  import { Tooltip } from 'antd';
6
6
  import '../style/index.less';
7
+ import { getValue } from '../modules/content/utils';
7
8
  var classPrefix = 'event-form-data';
8
9
  export function getColumns(columnData, userGroup, searchData, showList, onShowCallback, onClickToDetailCallback) {
9
10
  var data = [{
@@ -44,13 +45,12 @@ export function getColumns(columnData, userGroup, searchData, showList, onShowCa
44
45
  }
45
46
  });
46
47
  }
47
- if (searchData.filterConditions && searchData.filterConditions[0].eventAttr) {
48
- var eventAttr = searchData.filterConditions[0].eventAttr;
48
+ if (searchData.dimension) {
49
49
  data.push({
50
- title: eventAttr.label,
50
+ title: getValue(searchData.dimension).label,
51
51
  width: 150,
52
- dataIndex: 'eventAttr',
53
- key: 'eventAttr',
52
+ dataIndex: 'dimension',
53
+ key: 'dimension',
54
54
  ellipsis: true,
55
55
  render: function render(val) {
56
56
  return /*#__PURE__*/React.createElement(Tooltip, {
@@ -64,7 +64,7 @@ export function getColumns(columnData, userGroup, searchData, showList, onShowCa
64
64
  }
65
65
  });
66
66
  }
67
- if (searchData.filterConditions && !searchData.filterConditions[0].eventAttr || !searchData.filterConditions) {
67
+ if (searchData.id && !searchData.dimension || !searchData.id) {
68
68
  data.push({
69
69
  title: '事件',
70
70
  width: 150,
@@ -184,7 +184,7 @@ export function formTableData(originalData, userGroups, attrNum, eventGroupList,
184
184
  };
185
185
  data.marked = markList[names[len - 1]];
186
186
  if (attrNum) {
187
- data["eventAttr"] = haveUserGroup ? names[1] : names[0];
187
+ data["dimension"] = haveUserGroup ? names[1] : names[0];
188
188
  } else {
189
189
  data["eventName"] = names[0];
190
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-event",
3
- "version": "0.0.2-alpha.6",
3
+ "version": "0.0.2-alpha.9",
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.72-event.3",
39
+ "@zgfe/business-lib": "1.1.76-event.0",
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": "b1979977e10ced3e784c2ab74c182ffb1116db19",
52
+ "gitHead": "b06071e8686d8bf5d8677633a58f4d8239151ba3",
53
53
  "dependencies": {
54
54
  "react-copy-to-clipboard": "^5.1.0",
55
55
  "react-highlight": "^0.15.0"