@zgfe/modules-interval 1.0.9 → 1.0.10-beiming.1

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 (64) hide show
  1. package/README.md +33 -33
  2. package/dist/esm/components/common/styles/index.less +40 -40
  3. package/dist/esm/components/eventFilter/index.js +17 -21
  4. package/dist/esm/components/eventFilter/styles/index.less +39 -39
  5. package/dist/esm/components/eventFilter/types.d.ts +4 -3
  6. package/dist/esm/components/renderContent/styles/index.less +36 -33
  7. package/dist/esm/components/searchPanel/index.js +3 -4
  8. package/dist/esm/components/searchPanel/styles/index.less +64 -64
  9. package/dist/esm/components/table/index.js +5 -4
  10. package/dist/esm/components/table/styles/index.less +138 -138
  11. package/dist/esm/components/topBar/index.js +4 -4
  12. package/dist/esm/components/topBar/styles/index.less +50 -50
  13. package/dist/esm/components/topBar/types.d.ts +3 -2
  14. package/dist/esm/constants/apis.d.ts +1 -5
  15. package/dist/esm/constants/apis.js +15 -4
  16. package/dist/esm/constants/fields.js +4 -4
  17. package/dist/esm/modules/chart/index.js +4 -3
  18. package/dist/esm/modules/chart/index.less +58 -58
  19. package/dist/esm/modules/chart/intervalChart.js +2 -2
  20. package/dist/esm/modules/chart/types.d.ts +1 -0
  21. package/dist/esm/modules/content/index.js +28 -44
  22. package/dist/esm/modules/content/styles/index.less +7 -7
  23. package/dist/esm/modules/content/types.d.ts +4 -3
  24. package/dist/esm/modules/content/utils.d.ts +2 -0
  25. package/dist/esm/modules/content/utils.js +16 -14
  26. package/dist/esm/modules/home/demo/edit.js +1 -1
  27. package/dist/esm/modules/home/demo/index.js +7 -15
  28. package/dist/esm/modules/home/demo/scene.js +1 -1
  29. package/dist/esm/modules/home/demo/styles/index.less +33 -33
  30. package/dist/esm/modules/home/index.d.ts +2 -2
  31. package/dist/esm/modules/home/index.js +59 -46
  32. package/dist/esm/modules/home/styles/index.less +66 -60
  33. package/dist/esm/modules/home/types.d.ts +7 -4
  34. package/dist/esm/modules/home/types.js +2 -2
  35. package/dist/esm/modules/topPanel/index.js +246 -127
  36. package/dist/esm/modules/topPanel/styles/index.less +213 -186
  37. package/dist/esm/modules/topPanel/types.d.ts +6 -9
  38. package/dist/esm/modules/topPanel/types.js +5 -1
  39. package/dist/esm/style/image/empty.png +0 -0
  40. package/dist/esm/style/image/ring.svg +9 -9
  41. package/dist/esm/style/index.less +67 -53
  42. package/dist/esm/types.d.ts +25 -28
  43. package/dist/esm/types.js +7 -7
  44. package/dist/esm/utils/ajaxConfig.js +5 -5
  45. package/dist/esm/utils/formData.d.ts +7 -2
  46. package/dist/esm/utils/formData.js +91 -39
  47. package/dist/esm/utils/util.js +28 -28
  48. package/package.json +9 -4
  49. package/dist/esm/assets/business/demo.css +0 -539
  50. package/dist/esm/assets/business/demo_index.html +0 -3316
  51. package/dist/esm/assets/business/iconfont.css +0 -559
  52. package/dist/esm/assets/business/iconfont.js +0 -43
  53. package/dist/esm/assets/business/iconfont.json +0 -961
  54. package/dist/esm/assets/business/iconfont.ttf +0 -0
  55. package/dist/esm/assets/business/iconfont.woff +0 -0
  56. package/dist/esm/assets/business/iconfont.woff2 +0 -0
  57. package/dist/esm/assets/icons/demo.css +0 -539
  58. package/dist/esm/assets/icons/demo_index.html +0 -9618
  59. package/dist/esm/assets/icons/iconfont.css +0 -1655
  60. package/dist/esm/assets/icons/iconfont.js +0 -43
  61. package/dist/esm/assets/icons/iconfont.json +0 -2879
  62. package/dist/esm/assets/icons/iconfont.ttf +0 -0
  63. package/dist/esm/assets/icons/iconfont.woff +0 -0
  64. package/dist/esm/assets/icons/iconfont.woff2 +0 -0
package/README.md CHANGED
@@ -1,33 +1,33 @@
1
- # modules-interval
2
-
3
- ## Getting Started
4
-
5
- Install dependencies,
6
-
7
- ```bash
8
- $ npm i
9
- ```
10
-
11
- Start the dev server,
12
-
13
- ```bash
14
- $ npm start
15
- ```
16
-
17
- Build documentation,
18
-
19
- ```bash
20
- $ npm run docs:build
21
- ```
22
-
23
- Run test,
24
-
25
- ```bash
26
- $ npm test
27
- ```
28
-
29
- Build library via `father`,
30
-
31
- ```bash
32
- $ npm run build
33
- ```
1
+ # modules-interval
2
+
3
+ ## Getting Started
4
+
5
+ Install dependencies,
6
+
7
+ ```bash
8
+ $ npm i
9
+ ```
10
+
11
+ Start the dev server,
12
+
13
+ ```bash
14
+ $ npm start
15
+ ```
16
+
17
+ Build documentation,
18
+
19
+ ```bash
20
+ $ npm run docs:build
21
+ ```
22
+
23
+ Run test,
24
+
25
+ ```bash
26
+ $ npm test
27
+ ```
28
+
29
+ Build library via `father`,
30
+
31
+ ```bash
32
+ $ npm run build
33
+ ```
@@ -1,40 +1,40 @@
1
- @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
-
3
- .mi-common-interval {
4
- &-loading-icon {
5
- z-index: 1000;
6
- display: inline-block;
7
- width: 40px;
8
- height: 40px;
9
- background: url('../../../style/image/ring.svg') no-repeat;
10
- background-size: contain;
11
- }
12
-
13
- &-none-text {
14
- color: #354354;
15
- font-size: 14px;
16
- }
17
-
18
- &-none-empty {
19
- width: 88px;
20
- height: 88px;
21
- background-image: url('../../../style/image/empty.png');
22
- background-repeat: no-repeat;
23
- background-size: cover;
24
- }
25
-
26
- &-none-container {
27
- display: flex;
28
- flex-direction: column;
29
- align-items: center;
30
- }
31
- }
32
- .mi-common-interval-content {
33
- width: 100%;
34
- .ant-spin-text {
35
- color: #ccc;
36
- }
37
- }
38
- .ant-spin-nested-loading {
39
- width: 100%;
40
- }
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+
3
+ .mi-common-interval {
4
+ .ant-spin-nested-loading {
5
+ width: 100%;
6
+ }
7
+ &-loading-icon {
8
+ z-index: 1000;
9
+ display: inline-block;
10
+ width: 40px;
11
+ height: 40px;
12
+ background: url('../../../style/image/ring.svg') no-repeat;
13
+ background-size: contain;
14
+ }
15
+
16
+ &-none-text {
17
+ color: #354354;
18
+ font-size: 14px;
19
+ }
20
+
21
+ &-none-empty {
22
+ width: 88px;
23
+ height: 88px;
24
+ background-image: url('../../../style/image/empty.png');
25
+ background-repeat: no-repeat;
26
+ background-size: cover;
27
+ }
28
+
29
+ &-none-container {
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: center;
33
+ }
34
+ }
35
+ .mi-common-interval-content {
36
+ width: 100%;
37
+ .ant-spin-text {
38
+ color: #ccc;
39
+ }
40
+ }
@@ -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 { Switch, Tooltip, message } from 'antd';
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";
@@ -137,9 +137,6 @@ var EventFilter = function EventFilter(props) {
137
137
  delete _dimension.key;
138
138
  _event.dimension = _dimension;
139
139
  }
140
- if (props.relevancy && relevancy !== undefined) {
141
- _event.relevancy = relevancy;
142
- }
143
140
  props.onChange && props.onChange(_event);
144
141
  }, [bizAttributeSelectorValue, filter, event, relevancy]);
145
142
  return /*#__PURE__*/React.createElement("div", {
@@ -149,10 +146,24 @@ var EventFilter = function EventFilter(props) {
149
146
  showBuiltInTarget: false,
150
147
  popupContainer: false,
151
148
  defaultSelectAble: false,
149
+ destroyPopupOnHide: true,
152
150
  value: {
153
151
  event: event
154
152
  },
155
153
  onChange: onChangeEvent,
154
+ filter: function filter(event) {
155
+ if (!props.subject) return true;
156
+ var propMatch = false;
157
+ for (var i = 0; i < event.attrList.length; i++) {
158
+ var _props$subject;
159
+ var attr = event.attrList[i];
160
+ if (attr.label === ((_props$subject = props.subject) === null || _props$subject === void 0 ? void 0 : _props$subject.subjectName)) {
161
+ propMatch = true;
162
+ break;
163
+ }
164
+ }
165
+ return propMatch;
166
+ },
156
167
  placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
157
168
  }), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
158
169
  placement: "top",
@@ -163,28 +174,13 @@ var EventFilter = function EventFilter(props) {
163
174
  onClick: function onClick() {
164
175
  return onAdd();
165
176
  }
166
- }))), props !== null && props !== void 0 && props.relevancy ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
167
- placement: "top",
168
- title: props.relevancyFl ? '请选择开始和结束事件' : ''
169
- }, /*#__PURE__*/React.createElement(Switch, {
170
- size: "default",
171
- style: {
172
- marginLeft: 24
173
- },
174
- checked: relevancy && !props.relevancyFl,
175
- disabled: props.relevancyFl,
176
- onChange: function onChange(checked) {
177
- return setRelevancy(checked);
178
- }
179
- })), /*#__PURE__*/React.createElement("span", {
180
- className: "switch-title"
181
- }, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027")) : ''), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
177
+ })))), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
182
178
  className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
183
179
  }, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
184
180
  ref: conditionRef,
185
181
  value: filter,
186
- onlyAnd: true,
187
182
  enableEventProp: true,
183
+ enableUserProp: props.analysisType === 'user',
188
184
  enableDelete: true,
189
185
  eventIdList: [event.id],
190
186
  onChange: onChangeFilters,
@@ -1,39 +1,39 @@
1
- .interval-box {
2
- > :nth-child(1) {
3
- display: flex;
4
- gap: 16px;
5
- align-items: center;
6
- margin-bottom: 0 !important;
7
- .biz-event-select,
8
- .biz-attr-select {
9
- width: 208px;
10
- }
11
-
12
- .shaixuan {
13
- margin-top: 2px;
14
- color: #9aa1a9;
15
- font-size: 20px !important;
16
- cursor: pointer;
17
- }
18
-
19
- .shaixuan:hover {
20
- color: #165dff;
21
- }
22
-
23
- .disable {
24
- color: #ccd0d4 !important;
25
- cursor: not-allowed !important;
26
- }
27
-
28
- .switch-title {
29
- margin-left: -8px;
30
- color: var(--io-n-8, #354354);
31
- font-weight: 400;
32
- font-size: 14px;
33
- font-family: PingFang SC;
34
- font-style: normal;
35
- line-height: normal;
36
- letter-spacing: 1px;
37
- }
38
- }
39
- }
1
+ .interval-box {
2
+ > :nth-child(1) {
3
+ display: flex;
4
+ gap: 16px;
5
+ align-items: center;
6
+ margin-bottom: 0 !important;
7
+ .biz-event-select,
8
+ .biz-attr-select {
9
+ width: 208px;
10
+ }
11
+
12
+ .shaixuan {
13
+ margin-top: 2px;
14
+ color: #9aa1a9;
15
+ font-size: 20px !important;
16
+ cursor: pointer;
17
+ }
18
+
19
+ .shaixuan:hover {
20
+ color: #165dff;
21
+ }
22
+
23
+ .disable {
24
+ color: #ccd0d4 !important;
25
+ cursor: not-allowed !important;
26
+ }
27
+
28
+ .switch-title {
29
+ margin-left: -8px;
30
+ color: var(--io-n-8, #354354);
31
+ font-weight: 400;
32
+ font-size: 14px;
33
+ font-family: PingFang SC;
34
+ font-style: normal;
35
+ line-height: normal;
36
+ letter-spacing: 1px;
37
+ }
38
+ }
39
+ }
@@ -1,3 +1,4 @@
1
+ import SubjectTypes from '@zgfe/business-lib/es/hooks/types/subject';
1
2
  import { eventProps } from '../../types';
2
3
  /**
3
4
  * 事件属性
@@ -46,7 +47,7 @@ export interface ConditionsnProps {
46
47
  export interface EventFilterProps {
47
48
  id?: string;
48
49
  value?: eventProps;
49
- relevancyFl?: boolean;
50
- relevancy?: boolean;
51
- onChange?: (event: eventProps) => {};
50
+ subject?: SubjectTypes.Subject;
51
+ analysisType?: 'user' | 'eventProp';
52
+ onChange?: (event: eventProps) => void;
52
53
  }
@@ -1,33 +1,36 @@
1
- .render-content-interval {
2
- &-chart-container {
3
- display: flex;
4
- flex-direction: column;
5
- align-items: center;
6
- justify-content: center;
7
-
8
- .echarts-for-react {
9
- width: 100%;
10
- background: #fff;
11
- border: 1px solid var(--unnamed, #ecedf0);
12
- border-radius: 8px;
13
- }
14
- }
15
-
16
- &-MiNone {
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- width: 100%;
21
- height: 368px;
22
- padding: 24px 16px;
23
- border: 1px solid #ecedf0;
24
- border-radius: 8px;
25
- }
26
-
27
- &-spin-container {
28
- display: flex !important;
29
- align-items: center;
30
- justify-content: center;
31
- min-height: 300px;
32
- }
33
- }
1
+ .render-content-interval {
2
+ &-chart-container {
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ justify-content: center;
7
+
8
+ .echarts-for-react {
9
+ width: 100%;
10
+ background: #fff;
11
+ border: 1px solid var(--unnamed, #ecedf0);
12
+ border-radius: 8px;
13
+ }
14
+ }
15
+
16
+ &-MiNone {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ width: 100%;
21
+ height: 368px;
22
+ padding: 24px 16px;
23
+ border: 1px solid #ecedf0;
24
+ border-radius: 8px;
25
+ }
26
+
27
+ &-spin-container {
28
+ display: flex !important;
29
+ align-items: center;
30
+ justify-content: center;
31
+ min-height: 300px;
32
+ .biz-loading-wrapper {
33
+ width: 100%;
34
+ }
35
+ }
36
+ }
@@ -13,12 +13,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { BizDatePicker, BizSelect } from '@zgfe/business-lib';
14
14
  import React, { useContext, useEffect, useState } from 'react';
15
15
  import { chartTypeOptions, getInitDate } from "../../constants";
16
- import { EventContext } from "../../types";
16
+ import { IntervalContext } from "../../types";
17
17
  import "./styles/index.less";
18
18
  import { extractNames } from "../../utils/formData";
19
19
  var classPrefix = 'search-panel-interval';
20
20
  var SearchPanel = function SearchPanel(props) {
21
- var _useContext = useContext(EventContext),
21
+ var _useContext = useContext(IntervalContext),
22
22
  includeToday = _useContext.includeToday;
23
23
  // 当前时间段
24
24
  var _useState = useState(props.time || getInitDate(includeToday)),
@@ -105,9 +105,8 @@ var SearchPanel = function SearchPanel(props) {
105
105
  display: 'flex'
106
106
  }
107
107
  }, /*#__PURE__*/React.createElement(BizDatePicker, {
108
- dateTypeList: ['day', 'week', 'month'],
108
+ dateTypeList: ['day', 'week', 'month', 'custom'],
109
109
  value: time,
110
- mode: "simple",
111
110
  includeToday: true,
112
111
  onChange: onChangeTime
113
112
  }), /*#__PURE__*/React.createElement(BizSelect, {
@@ -1,64 +1,64 @@
1
- .search-panel-interval {
2
- display: flex;
3
- align-items: center;
4
- justify-content: space-between;
5
- height: 32px;
6
- margin-bottom: 24px;
7
-
8
- .biz-date-picker-wrap-list {
9
- font-size: 14px;
10
- }
11
-
12
- &-search-right {
13
- display: flex;
14
- }
15
-
16
- &-select {
17
- width: 208px;
18
- margin-left: 16px;
19
-
20
- .biz-select-handle-input-multiple {
21
- .ant-tag:not(:nth-child(-n + 3)) {
22
- display: none;
23
- }
24
- }
25
- }
26
- }
27
-
28
- .interval-select-overlay {
29
- .biz-select-option.biz-select-option-multiple:hover:not(.disabled) {
30
- color: var(--1, #021429);
31
- background: var(--io-i-1, #e8efff);
32
- }
33
-
34
- .biz-select-overlay {
35
- padding: 0;
36
- }
37
-
38
- .biz-select-list-panel {
39
- display: grid;
40
- gap: 8px;
41
- }
42
-
43
- .biz-select-option {
44
- padding: 0 16px;
45
- border-radius: 0;
46
- }
47
-
48
- .biz-select-option.biz-select-option-multiple.active:not(.disabled) {
49
- color: var(--1, #021429);
50
- }
51
-
52
- .biz-select-option.biz-select-option-multiple:hover:not(.disabled) .biz-select-checkbox {
53
- color: #ccd0d4;
54
- }
55
-
56
- .biz-select-option.biz-select-option-multiple.active:hover:not(.disabled) .biz-select-checkbox {
57
- color: #165dff;
58
- }
59
-
60
- .biz-select-option.biz-select-option-multiple:active:not(.disabled) {
61
- color: #165dff;
62
- background: var(--io-i-1, #e8efff);
63
- }
64
- }
1
+ .search-panel-interval {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ height: 32px;
6
+ margin-bottom: 24px;
7
+
8
+ .biz-date-picker-wrap-list {
9
+ font-size: 14px;
10
+ }
11
+
12
+ &-search-right {
13
+ display: flex;
14
+ }
15
+
16
+ &-select {
17
+ width: 208px;
18
+ margin-left: 16px;
19
+
20
+ .biz-select-handle-input-multiple {
21
+ .ant-tag:not(:nth-child(-n + 3)) {
22
+ display: none;
23
+ }
24
+ }
25
+ }
26
+ }
27
+
28
+ .interval-select-overlay {
29
+ .biz-select-option.biz-select-option-multiple:hover:not(.disabled) {
30
+ color: var(--1, #021429);
31
+ background: var(--io-i-1, #e8efff);
32
+ }
33
+
34
+ .biz-select-overlay {
35
+ padding: 0;
36
+ }
37
+
38
+ .biz-select-list-panel {
39
+ display: grid;
40
+ gap: 8px;
41
+ }
42
+
43
+ .biz-select-option {
44
+ padding: 0 16px;
45
+ border-radius: 0;
46
+ }
47
+
48
+ .biz-select-option.biz-select-option-multiple.active:not(.disabled) {
49
+ color: var(--1, #021429);
50
+ }
51
+
52
+ .biz-select-option.biz-select-option-multiple:hover:not(.disabled) .biz-select-checkbox {
53
+ color: #ccd0d4;
54
+ }
55
+
56
+ .biz-select-option.biz-select-option-multiple.active:hover:not(.disabled) .biz-select-checkbox {
57
+ color: #165dff;
58
+ }
59
+
60
+ .biz-select-option.biz-select-option-multiple:active:not(.disabled) {
61
+ color: #165dff;
62
+ background: var(--io-i-1, #e8efff);
63
+ }
64
+ }
@@ -17,7 +17,7 @@ import { message } from 'antd';
17
17
  import { formTableData, getColumns } from "../../utils/formData";
18
18
  import "./styles/index.less";
19
19
  import { searchDataParams } from "../../modules/content/utils";
20
- import { EventContext } from "../../types";
20
+ import { IntervalContext } from "../../types";
21
21
  var classPrefix = 'mi-interval-table';
22
22
  var EventTable = function EventTable(props) {
23
23
  var _dataSource$appData2;
@@ -36,8 +36,9 @@ var EventTable = function EventTable(props) {
36
36
  eventEnvList = _useContext.eventEnvList,
37
37
  userPropList = _useContext.userPropList,
38
38
  authority = _useContext.authority;
39
- var _useContext2 = useContext(EventContext),
40
- panelName = _useContext2.panelName;
39
+ var _useContext2 = useContext(IntervalContext),
40
+ panelName = _useContext2.panelName,
41
+ onUserDrill = _useContext2.onUserDrill;
41
42
 
42
43
  // 按属性排序后的数据(用于合并行)
43
44
  var _useState3 = useState({
@@ -70,7 +71,7 @@ var EventTable = function EventTable(props) {
70
71
  var _dataSource$appData;
71
72
  var _searchData$userGroup = searchData.userGroup,
72
73
  userGroup = _searchData$userGroup === void 0 ? [0] : _searchData$userGroup;
73
- var _getColumns = getColumns(eventGroupList, userPropList, eventEnvList, (dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData = dataSource.appData) === null || _dataSource$appData === void 0 ? void 0 : _dataSource$appData.x_axis) || [], dataSource, userGroup, searchData, showList);
74
+ var _getColumns = getColumns(eventGroupList, userPropList, eventEnvList, (dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData = dataSource.appData) === null || _dataSource$appData === void 0 ? void 0 : _dataSource$appData.x_axis) || [], dataSource, userGroup, searchData, showList, onUserDrill);
74
75
  return _getColumns;
75
76
  }, [dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$appData2 = dataSource.appData) === null || _dataSource$appData2 === void 0 ? void 0 : _dataSource$appData2.x_axis, showList, sortTable, panelName]);
76
77