@zgfe/modules-interval 1.0.0-interval.1 → 1.0.0-interval.10

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.
Files changed (41) hide show
  1. package/dist/esm/components/eventFilter/index.js +5 -5
  2. package/dist/esm/components/eventFilter/styles/index.less +1 -1
  3. package/dist/esm/components/renderContent/index.js +8 -11
  4. package/dist/esm/components/renderContent/styles/index.less +12 -2
  5. package/dist/esm/components/searchPanel/index.js +7 -2
  6. package/dist/esm/components/searchPanel/styles/index.less +0 -1
  7. package/dist/esm/components/table/index.d.ts +0 -1
  8. package/dist/esm/components/table/index.js +13 -87
  9. package/dist/esm/components/table/styles/index.less +1 -1
  10. package/dist/esm/components/topBar/index.js +15 -5
  11. package/dist/esm/components/topBar/styles/index.less +1 -1
  12. package/dist/esm/components/topBar/types.d.ts +3 -1
  13. package/dist/esm/constants/apis.js +1 -1
  14. package/dist/esm/constants/fields.js +4 -4
  15. package/dist/esm/index.d.ts +2 -2
  16. package/dist/esm/index.js +2 -2
  17. package/dist/esm/modules/chart/index.js +4 -3
  18. package/dist/esm/modules/chart/intervalChart.js +4 -2
  19. package/dist/esm/modules/chart/types.d.ts +1 -1
  20. package/dist/esm/modules/content/index.js +33 -77
  21. package/dist/esm/modules/content/styles/index.less +1 -1
  22. package/dist/esm/modules/content/types.d.ts +2 -1
  23. package/dist/esm/modules/content/utils.d.ts +38 -0
  24. package/dist/esm/modules/content/utils.js +57 -1
  25. package/dist/esm/modules/home/demo/create.js +2 -5
  26. package/dist/esm/modules/home/demo/edit.js +2 -5
  27. package/dist/esm/modules/home/demo/index.js +3 -6
  28. package/dist/esm/modules/home/demo/scene.js +2 -5
  29. package/dist/esm/modules/home/index.d.ts +2 -2
  30. package/dist/esm/modules/home/index.js +5 -4
  31. package/dist/esm/modules/home/styles/index.less +1 -1
  32. package/dist/esm/modules/topPanel/index.js +103 -51
  33. package/dist/esm/modules/topPanel/styles/index.less +20 -13
  34. package/dist/esm/modules/topPanel/types.d.ts +3 -1
  35. package/dist/esm/style/index.less +8 -1
  36. package/dist/esm/types.d.ts +2 -2
  37. package/dist/esm/utils/formData.d.ts +28 -6
  38. package/dist/esm/utils/formData.js +99 -31
  39. package/package.json +2 -2
  40. package/dist/esm/utils/base64.d.ts +0 -29
  41. package/dist/esm/utils/base64.js +0 -132
@@ -4,25 +4,27 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useState } from 'react';
8
- import { Form, Button } from 'antd';
7
+ import React, { useEffect, useState } from 'react';
8
+ import { Form, Button, message } from 'antd';
9
9
  import { BizAttributeSelector, BizUserGroupHeader } from '@zgfe/business-lib';
10
10
  import EventFilter from "../../components/eventFilter";
11
11
  import "./styles/index.less";
12
- var classPrefix = 'top-panel';
12
+ import _ from 'lodash';
13
+ import { transformData } from "../content/utils";
14
+ var classPrefix = 'top-panel-interval';
13
15
  var TopPanel = function TopPanel(props) {
14
16
  var defaultValue = props.defaultValue,
15
- ajaxFlag = props.ajaxFlag,
16
- finalSearchData = props.finalSearchData,
17
+ loading = props.loading,
18
+ collapseRef = props.collapseRef,
17
19
  fetchRequest = props.fetchRequest;
18
20
  var _Form$useForm = Form.useForm(),
19
21
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
20
22
  form = _Form$useForm2[0];
21
- var _useState = useState(-100),
23
+ var _useState = useState(null),
22
24
  _useState2 = _slicedToArray(_useState, 2),
23
25
  startId = _useState2[0],
24
26
  setStartId = _useState2[1];
25
- var _useState3 = useState(-100),
27
+ var _useState3 = useState(null),
26
28
  _useState4 = _slicedToArray(_useState3, 2),
27
29
  endId = _useState4[0],
28
30
  setEndId = _useState4[1];
@@ -31,6 +33,10 @@ var TopPanel = function TopPanel(props) {
31
33
  _useState6 = _slicedToArray(_useState5, 2),
32
34
  relevancy = _useState6[0],
33
35
  setRelevancy = _useState6[1];
36
+ var _useState7 = useState(false),
37
+ _useState8 = _slicedToArray(_useState7, 2),
38
+ relevancyFl = _useState8[0],
39
+ setRelevancyFl = _useState8[1];
34
40
  // 筛选条件值
35
41
  var _ref = defaultValue,
36
42
  id = _ref.id,
@@ -39,58 +45,54 @@ var TopPanel = function TopPanel(props) {
39
45
  filters = _ref.filters,
40
46
  userGroup = _ref.userGroup;
41
47
  // 细分属性初始值
42
- var _useState7 = useState(),
43
- _useState8 = _slicedToArray(_useState7, 2),
44
- bizAttributeSelectorValue = _useState8[0],
45
- setBizAttributeSelectorValue = _useState8[1];
48
+ var _useState9 = useState(),
49
+ _useState10 = _slicedToArray(_useState9, 2),
50
+ bizAttributeSelectorValue = _useState10[0],
51
+ setBizAttributeSelectorValue = _useState10[1];
46
52
  // 用户组和事件变更
47
53
  var onValuesChange = function onValuesChange(data, allData) {
48
54
  var _data = {};
49
55
  if (allData.start) {
50
- if (allData.start.id !== -100) {
56
+ if (allData.start.id !== null) {
57
+ var _allData$start;
51
58
  _data = allData.start;
52
59
  setStartId(allData.start.id);
53
- if (allData.start.relevancy !== undefined) {
54
- // form.setFieldsValue({
55
- // associatedPreAttr: undefined,
56
- // associatedNextAttr: undefined,
57
- // });
58
- }
59
- setRelevancy(allData.start.relevancy);
60
+ setRelevancy(allData === null || allData === void 0 ? void 0 : (_allData$start = allData.start) === null || _allData$start === void 0 ? void 0 : _allData$start.relevancy);
60
61
  }
61
62
  }
62
63
  if (allData.end) {
63
- if (allData.end.id !== -100) {
64
+ if (allData.end.id !== null) {
64
65
  _data = allData.end;
65
66
  setEndId(allData.end.id);
66
67
  }
67
68
  }
69
+ if (startId && endId) {
70
+ setRelevancyFl(true);
71
+ }
68
72
  if (allData.userGroup) {
69
73
  _data.userGroup = [];
70
- allData.userGroup.map(function (item) {
71
- _data.userGroup && _data.userGroup.push(item);
72
- });
73
- if (_data.userGroup.length <= 0) _data.userGroup = [0];
74
- }
75
- if (data.start) {
76
- // 事件id不变,不自动请求
77
- if (finalSearchData && finalSearchData.id && data.start.id === finalSearchData.id) {
78
- ajaxFlag = false;
79
- } else {
80
- ajaxFlag = true;
81
- }
82
- }
83
- if (data.end) {
84
- // 事件id不变,不自动请求
85
- if (finalSearchData && finalSearchData.id && data.end.id === finalSearchData.id) {
86
- ajaxFlag = false;
74
+ if (_.isArray(allData.userGroup[0])) {
75
+ if (allData.userGroup[0].length > 20) {
76
+ message.warning('最多添加20个');
77
+ }
78
+ var app = [transformData(allData.userGroup)];
79
+ allData.userGroup = app;
87
80
  } else {
88
- ajaxFlag = true;
81
+ allData.userGroup = allData === null || allData === void 0 ? void 0 : allData.userGroup.map(function (group) {
82
+ return group === null || group === void 0 ? void 0 : group.id;
83
+ });
89
84
  }
90
85
  }
91
- props.onChange(allData, ajaxFlag);
86
+ props.onChange(allData, false);
92
87
  };
93
-
88
+ useEffect(function () {
89
+ onChangeAttr(undefined, 'dimension');
90
+ onChangeAttr(undefined, 'associatedPreAttr');
91
+ }, [startId]);
92
+ useEffect(function () {
93
+ onChangeAttr(undefined, 'dimension');
94
+ onChangeAttr(undefined, 'associatedNextAttr');
95
+ }, [endId]);
94
96
  // 重置
95
97
  var resetting = function resetting() {
96
98
  form.resetFields();
@@ -111,9 +113,35 @@ var TopPanel = function TopPanel(props) {
111
113
  }, true);
112
114
  };
113
115
  // 细分属性
114
- var onChangeAttr = function onChangeAttr(attr) {
116
+ var onChangeAttr = function onChangeAttr(attr, type) {
115
117
  if (attr === undefined) {
116
118
  // 删除细分属性
119
+ switch (type) {
120
+ case 'associatedPreAttr':
121
+ form.setFieldsValue({
122
+ associatedPreAttr: undefined
123
+ });
124
+ props.onChange({
125
+ associatedPreAttr: undefined
126
+ }, true);
127
+ break;
128
+ case 'associatedNextAttr':
129
+ form.setFieldsValue({
130
+ associatedNextAttr: undefined
131
+ });
132
+ props.onChange({
133
+ associatedNextAttr: undefined
134
+ }, true);
135
+ break;
136
+ case 'dimension':
137
+ form.setFieldsValue({
138
+ dimension: undefined
139
+ });
140
+ props.onChange({
141
+ dimension: undefined
142
+ }, true);
143
+ break;
144
+ }
117
145
  setBizAttributeSelectorValue(undefined);
118
146
  } else {
119
147
  var _value = attr.propCategory === 'eventProp' ? attr.id : attr.name;
@@ -162,12 +190,22 @@ var TopPanel = function TopPanel(props) {
162
190
  paddingLeft: 0
163
191
  }
164
192
  }, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
193
+ value: [{
194
+ id: 0
195
+ }],
196
+ enableTags: true,
165
197
  max: 1
166
- })), /*#__PURE__*/React.createElement(Form.Item, {
198
+ })), /*#__PURE__*/React.createElement("div", {
199
+ ref: collapseRef,
200
+ style: {
201
+ paddingLeft: 24
202
+ },
203
+ className: "collapseRefs"
204
+ }, /*#__PURE__*/React.createElement(Form.Item, {
167
205
  label: "\u5F00\u59CB\u4E8B\u4EF6",
168
206
  name: "start"
169
207
  }, /*#__PURE__*/React.createElement(EventFilter, {
170
- relevancy: true
208
+ relevancy: relevancyFl
171
209
  })), relevancy ? /*#__PURE__*/React.createElement(Form.Item, {
172
210
  style: {
173
211
  marginBottom: 0
@@ -197,7 +235,7 @@ var TopPanel = function TopPanel(props) {
197
235
  enableDelete: true,
198
236
  onChange: onChangeAttr,
199
237
  onDelete: function onDelete() {
200
- onChangeAttr(undefined);
238
+ onChangeAttr(undefined, 'associatedPreAttr');
201
239
  }
202
240
  })), /*#__PURE__*/React.createElement("span", {
203
241
  className: "associated-label"
@@ -215,9 +253,23 @@ var TopPanel = function TopPanel(props) {
215
253
  enableDelete: true,
216
254
  onChange: onChangeAttr,
217
255
  onDelete: function onDelete() {
218
- onChangeAttr(undefined);
256
+ onChangeAttr(undefined, 'associatedNextAttr');
219
257
  }
220
- }))) : '', /*#__PURE__*/React.createElement(Form.Item, {
258
+ })), /*#__PURE__*/React.createElement("i", {
259
+ style: {
260
+ lineHeight: '32px',
261
+ color: '#9AA1A9',
262
+ marginLeft: '28px',
263
+ cursor: 'pointer'
264
+ },
265
+ onClick: function onClick() {
266
+ onChangeAttr(undefined, 'associatedPreAttr');
267
+ onChangeAttr(undefined, 'associatedNextAttr');
268
+ setRelevancy(false);
269
+ setRelevancyFl(false);
270
+ },
271
+ className: "bsicon qingchu"
272
+ })) : '', /*#__PURE__*/React.createElement(Form.Item, {
221
273
  label: "\u7ED3\u675F\u4E8B\u4EF6",
222
274
  name: "end"
223
275
  }, /*#__PURE__*/React.createElement(EventFilter, null)), /*#__PURE__*/React.createElement(Form.Item, {
@@ -232,19 +284,19 @@ var TopPanel = function TopPanel(props) {
232
284
  enableDelete: true,
233
285
  onChange: onChangeAttr,
234
286
  onDelete: function onDelete() {
235
- onChangeAttr(undefined);
287
+ onChangeAttr(undefined, 'dimension');
236
288
  }
237
289
  })), /*#__PURE__*/React.createElement("div", {
238
290
  className: "".concat(classPrefix, "-form-botton-box")
239
291
  }, /*#__PURE__*/React.createElement(Button, {
240
292
  onClick: resetting
241
- }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button
242
- // disabled={ajaxFlag}
243
- , {
293
+ }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
294
+ loading: loading,
295
+ disabled: loading || !startId || !endId || relevancy && !(defaultValue !== null && defaultValue !== void 0 && defaultValue.associatedNextAttr) && !(defaultValue !== null && defaultValue !== void 0 && defaultValue.associatedNextAttr),
244
296
  type: "primary",
245
297
  onClick: function onClick() {
246
298
  fetchRequest(true);
247
299
  }
248
- }, "\u67E5\u8BE2")));
300
+ }, "\u67E5\u8BE2"))));
249
301
  };
250
302
  export default TopPanel;
@@ -1,7 +1,7 @@
1
1
  @import '../../../assets/icons/iconfont.css';
2
2
  @import '../../../assets/business/iconfont.css';
3
3
 
4
- .top-panel {
4
+ .top-panel-interval {
5
5
  &-form-botton-box {
6
6
  display: flex;
7
7
  justify-content: flex-end;
@@ -18,6 +18,25 @@
18
18
  }
19
19
 
20
20
  .panel-form {
21
+ .space-item {
22
+ .ant-space-item {
23
+ .biz-user-group {
24
+ width: 100%;
25
+ min-width: 208px;
26
+ }
27
+ }
28
+
29
+ .ant-space-horizontal .ant-space-item:nth-child(2) .tianjia {
30
+ display: none;
31
+ }
32
+ }
33
+
34
+ .collapseRefs {
35
+ .ant-form-item {
36
+ margin-bottom: 12px;
37
+ }
38
+ }
39
+
21
40
  .biz-event-select {
22
41
  width: 208px;
23
42
  }
@@ -53,15 +72,3 @@
53
72
  }
54
73
  }
55
74
  }
56
-
57
- .space-item {
58
- .ant-space-item {
59
- .biz-user-group {
60
- max-width: 208px;
61
- }
62
- }
63
-
64
- .ant-space-horizontal .ant-space-item:nth-child(2) .tianjia {
65
- display: none;
66
- }
67
- }
@@ -10,7 +10,7 @@ export interface FormDataProps {
10
10
  /**
11
11
  * 用户群
12
12
  */
13
- userGroup?: number[];
13
+ userGroup?: any[];
14
14
  /**
15
15
  * 事件、属性、属性细分
16
16
  */
@@ -35,6 +35,7 @@ export interface TopPanelProps {
35
35
  * 默认值
36
36
  */
37
37
  defaultValue?: SearchValue;
38
+ loading?: boolean;
38
39
  /**
39
40
  * 数据更新
40
41
  */
@@ -51,4 +52,5 @@ export interface TopPanelProps {
51
52
  * 请求数据方法
52
53
  */
53
54
  fetchRequest: (flag?: boolean) => void;
55
+ collapseRef?: any;
54
56
  }
@@ -1,7 +1,11 @@
1
- .event-form-data {
1
+ .interval-form-data {
2
2
  &-table-td {
3
3
  padding: 0 !important;
4
4
 
5
+ .ant-table-column-sorters {
6
+ justify-content: end !important;
7
+ }
8
+
5
9
  &-show {
6
10
  display: flex;
7
11
  align-items: center;
@@ -9,6 +13,7 @@
9
13
  min-width: 60px;
10
14
  height: 48px;
11
15
  cursor: pointer;
16
+
12
17
  span {
13
18
  width: 10px;
14
19
  height: 10px;
@@ -20,6 +25,7 @@
20
25
  &-name {
21
26
  display: flex;
22
27
  align-items: center;
28
+
23
29
  .bsicon {
24
30
  margin-right: 4px;
25
31
  color: #fd9f41;
@@ -37,6 +43,7 @@
37
43
 
38
44
  &-link {
39
45
  cursor: pointer;
46
+
40
47
  &:hover {
41
48
  color: #165dff;
42
49
  text-decoration: underline;
@@ -135,7 +135,7 @@ export interface ChartItemProp {
135
135
  disabled?: boolean;
136
136
  }
137
137
  export interface ChartData {
138
- app_data: {
138
+ appData: {
139
139
  series?: {
140
140
  names: string[];
141
141
  values: number[][];
@@ -145,7 +145,7 @@ export interface ChartData {
145
145
  };
146
146
  }
147
147
  export interface ResponseDataProps {
148
- app_data: any;
148
+ appData: any;
149
149
  xAxis?: string[];
150
150
  x_axis?: string[];
151
151
  series: SeriesProps[];
@@ -9,7 +9,7 @@ import { DisplaySetup } from '../components/searchPanel/types';
9
9
  * @param columnData xAxis
10
10
  * @returns column fields
11
11
  */
12
- export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], userGroup: number[], searchData: SearchValue, showList: string[]): ColumnsType<EventProps.ColumnsDataType>;
12
+ export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], dataSource: ResponseDataProps, userGroup: number[], searchData: SearchValue, showList: string[]): ColumnsType<EventProps.ColumnsDataType>;
13
13
  /**
14
14
  * 获取属性的label
15
15
  * @param attrData 当前属性
@@ -27,6 +27,16 @@ export declare function getColumns(eventGroupList: EventGroup[] | undefined, use
27
27
  * @returns
28
28
  */
29
29
  export declare function formTableData(originalData: ChartData): {
30
+ key: string;
31
+ time: string;
32
+ max: number;
33
+ Q1: number;
34
+ median: number;
35
+ Q3: number;
36
+ min: number;
37
+ perValue: number;
38
+ peopleNum: number;
39
+ }[] | {
30
40
  key: number;
31
41
  time: string;
32
42
  max: number;
@@ -36,24 +46,36 @@ export declare function formTableData(originalData: ChartData): {
36
46
  min: number;
37
47
  perValue: number;
38
48
  peopleNum: number;
49
+ children: {
50
+ key: string;
51
+ time: string;
52
+ max: number;
53
+ Q1: number;
54
+ median: number;
55
+ Q3: number;
56
+ min: number;
57
+ perValue: number;
58
+ peopleNum: number;
59
+ }[];
39
60
  }[] | undefined;
40
61
  type ChartData = {
41
- app_data: {
62
+ appData: {
42
63
  series?: {
43
64
  names: string[];
44
65
  values: number[][];
45
66
  total: number[];
46
67
  }[];
47
- x_axis?: string[];
68
+ xAxis?: string[];
48
69
  };
49
70
  };
71
+ export declare function convertDateArray(params: SearchValue | undefined, dateArray: string[]): string[] | undefined;
50
72
  /**
51
- * 获取查询结果的前10条
73
+ * 获取查询结果
52
74
  * @param source 结果数据
53
- * @returns 获取查询结果的前10条
75
+ * @returns 获取查询结果
54
76
  */
55
77
  export declare function getDefaultShow(source: ResponseDataProps, data: DisplaySetup[]): never[] | {
56
- app_data: any;
78
+ appData: any;
57
79
  xAxis?: string[] | undefined;
58
80
  x_axis?: string[] | undefined;
59
81
  series: SeriesProps[];