@zgfe/business-lib 1.0.24-userTag.0 → 1.0.24

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/es/addToPanel/components/addPanel.d.ts +2 -1
  2. package/es/addToPanel/index.js +17 -2
  3. package/es/assets/iconfont/demo_index.html +97 -5
  4. package/es/assets/iconfont/iconfont.css +19 -3
  5. package/es/assets/iconfont/iconfont.js +12 -12
  6. package/es/assets/iconfont/iconfont.json +28 -0
  7. package/es/assets/iconfont/iconfont.ttf +0 -0
  8. package/es/assets/iconfont/iconfont.woff +0 -0
  9. package/es/assets/iconfont/iconfont.woff2 +0 -0
  10. package/es/assets/styles/chunks.less +2 -2
  11. package/es/assets/styles/resetAntd.less +4 -4
  12. package/es/assets/styles/variable.less +2 -1
  13. package/es/attributeSelector/types.d.ts +1 -0
  14. package/es/attributeSelector/util.js +2 -1
  15. package/es/chart/util/color.js +1 -1
  16. package/es/context/index.d.ts +12 -0
  17. package/es/datePicker/demo/index.js +11 -2
  18. package/es/datePicker/index.js +21 -7
  19. package/es/datePicker/styles/index.less +1 -1
  20. package/es/datePicker/types.d.ts +2 -1
  21. package/es/dnd/demo/data.js +3 -2
  22. package/es/dnd/demo/styles/index.less +1 -1
  23. package/es/dnd/index.js +3 -1
  24. package/es/dnd/item.js +13 -4
  25. package/es/eventSelector/listPanel.js +40 -23
  26. package/es/eventSelector/option.d.ts +2 -1
  27. package/es/eventSelector/option.js +6 -1
  28. package/es/eventSelector/styles/index.less +6 -0
  29. package/es/eventSelector/types.d.ts +1 -1
  30. package/es/icon/iconFont.d.ts +1 -0
  31. package/es/icon/iconFont.js +1 -0
  32. package/es/index.d.ts +3 -2
  33. package/es/index.js +3 -2
  34. package/es/{analysisLayout → layout/analysisLayout}/demo/index.d.ts +0 -0
  35. package/es/{analysisLayout → layout/analysisLayout}/demo/index.js +0 -0
  36. package/es/{analysisLayout → layout/analysisLayout}/demo/index.less +0 -0
  37. package/es/{analysisLayout → layout/analysisLayout}/index.d.ts +0 -0
  38. package/es/{analysisLayout → layout/analysisLayout}/index.js +1 -1
  39. package/es/{analysisLayout → layout/analysisLayout}/index.less +12 -12
  40. package/es/layout/detail/demo/index.d.ts +2 -0
  41. package/es/layout/detail/demo/index.js +12 -0
  42. package/es/layout/detail/index.d.ts +9 -0
  43. package/es/layout/detail/index.js +24 -0
  44. package/es/layout/detail/index.less +28 -0
  45. package/es/mock/event.js +37 -0
  46. package/es/select/index.js +1 -1
  47. package/es/select/styles/index.less +1 -1
  48. package/es/targetConditionGroup/components/targetDimension.js +3 -1
  49. package/es/targetConditionGroup/demo/index.js +2 -2
  50. package/es/targetConditionGroup/index.js +46 -14
  51. package/es/targetSelector/demo/index.js +3 -1
  52. package/es/targetSelector/styles/index.less +1 -1
  53. package/es/targetSelector/types.d.ts +7 -17
  54. package/es/targetSelector/types.js +16 -1
  55. package/es/userCondition/conditionTypeList.js +5 -1
  56. package/es/userCondition/styles/conditionTypeList.less +4 -5
  57. package/es/userCondition/styles/conditionWrap.less +0 -1
  58. package/es/utils/type.d.ts +1 -0
  59. package/package.json +2 -2
  60. package/es/commonStyle/icon.less +0 -194
  61. package/es/commonStyle/index.less +0 -3
  62. package/es/commonStyle/select.less +0 -92
  63. package/es/commonStyle/theme.less +0 -523
  64. package/es/commonStyle/variable.less +0 -127
@@ -10,13 +10,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- import React, { useEffect, useRef, useState } from 'react';
13
+ import React, { useContext, useEffect, useRef, useState } from 'react';
14
14
  import BizTargetSelector from '../targetSelector';
15
15
  import BizTargetDimension from './components/targetDimension';
16
16
  import './styles/index.less';
17
17
  import BizConditionGroup from '../attrConditions/group';
18
18
  import { Skeleton } from 'antd';
19
19
  import _ from 'lodash';
20
+ import BizGlobalDataContext from '../context';
20
21
  export var classPrefix = 'biz-target';
21
22
 
22
23
  var BizTargetCondition = function BizTargetCondition(props) {
@@ -29,6 +30,9 @@ var BizTargetCondition = function BizTargetCondition(props) {
29
30
  targetData = _useState2[0],
30
31
  setTargetData = _useState2[1];
31
32
 
33
+ var _useContext = useContext(BizGlobalDataContext),
34
+ eventGroupList = _useContext.eventGroupList;
35
+
32
36
  var _useState3 = useState({
33
37
  analysisIndex: 'number'
34
38
  }),
@@ -65,8 +69,8 @@ var BizTargetCondition = function BizTargetCondition(props) {
65
69
 
66
70
  var _useState15 = useState(true),
67
71
  _useState16 = _slicedToArray(_useState15, 2),
68
- ready = _useState16[0],
69
- setReady = _useState16[1];
72
+ loading = _useState16[0],
73
+ setLoading = _useState16[1];
70
74
 
71
75
  useEffect(function () {
72
76
  var value = props.defaultValue || props.value;
@@ -83,7 +87,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
83
87
  }
84
88
  }
85
89
 
86
- setReady(false);
90
+ setLoading(false);
87
91
  }, []);
88
92
  useEffect(function () {
89
93
  if (targetData === null || targetData === void 0 ? void 0 : targetData.value) {
@@ -125,17 +129,45 @@ var BizTargetCondition = function BizTargetCondition(props) {
125
129
 
126
130
  if (data.eventId) {
127
131
  target.value = {
128
- event: {
129
- id: data.eventId,
130
- name: data.eventName
131
- }
132
+ event: undefined,
133
+ group: undefined
132
134
  };
133
135
 
134
- if (data.eventGroupId) {
136
+ if (!data.eventGroupId) {
135
137
  target.value.group = {
136
- id: data.eventGroupId
138
+ id: 0,
139
+ name: '所有分组',
140
+ eventList: []
141
+ };
142
+ }
143
+
144
+ if (data.eventId === -100) {
145
+ target.value.event = {
146
+ id: -100,
147
+ name: '事件概览',
148
+ attrList: []
137
149
  };
138
150
  }
151
+
152
+ for (var i = 0; i < eventGroupList.length; i++) {
153
+ var group = eventGroupList[i];
154
+
155
+ if (data.eventId !== -100) {
156
+ for (var j = 0; j < group.eventList.length; j++) {
157
+ var event = group.eventList[j];
158
+
159
+ if (event.id === data.eventId) {
160
+ target.value.event = event;
161
+ break;
162
+ }
163
+ }
164
+ }
165
+
166
+ if (data.eventGroupId && data.eventGroupId === group.id) {
167
+ target.value.group = group;
168
+ break;
169
+ }
170
+ }
139
171
  }
140
172
 
141
173
  return target;
@@ -169,14 +201,14 @@ var BizTargetCondition = function BizTargetCondition(props) {
169
201
 
170
202
  var onChange = function onChange(analysisDimension, target, filterDatas) {
171
203
  if (props.onChange) {
172
- var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$group;
204
+ var _target$value$event2, _target$value$event3, _target$value$event4, _target$value$event5, _target$value$event6, _target$value$group;
173
205
 
174
206
  if (!target || !target.value || !((_target$value$event2 = target.value.event) === null || _target$value$event2 === void 0 ? void 0 : _target$value$event2.id)) return;
175
207
  var data = {
176
208
  type: 'event',
177
- alias: (target === null || target === void 0 ? void 0 : target.alias) || ((_target$value$event3 = target.value.event) === null || _target$value$event3 === void 0 ? void 0 : _target$value$event3.name) || '',
209
+ alias: (target === null || target === void 0 ? void 0 : target.alias) || target.value.event.alias || ((_target$value$event3 = target.value.event) === null || _target$value$event3 === void 0 ? void 0 : _target$value$event3.name) || '',
178
210
  eventId: (_target$value$event4 = target.value.event) === null || _target$value$event4 === void 0 ? void 0 : _target$value$event4.id,
179
- eventName: (_target$value$event5 = target.value.event) === null || _target$value$event5 === void 0 ? void 0 : _target$value$event5.name,
211
+ eventName: ((_target$value$event5 = target.value.event) === null || _target$value$event5 === void 0 ? void 0 : _target$value$event5.alias) || ((_target$value$event6 = target.value.event) === null || _target$value$event6 === void 0 ? void 0 : _target$value$event6.name),
180
212
  eventGroupId: (_target$value$group = target.value.group) === null || _target$value$group === void 0 ? void 0 : _target$value$group.id,
181
213
  analysisDimension: analysisDimension,
182
214
  filters: filterDatas
@@ -199,7 +231,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
199
231
  return /*#__PURE__*/React.createElement("div", {
200
232
  className: classPrefix
201
233
  }, /*#__PURE__*/React.createElement(Skeleton, {
202
- loading: ready,
234
+ loading: loading,
203
235
  active: true,
204
236
  paragraph: {
205
237
  rows: 1
@@ -57,7 +57,9 @@ var EventDemo = function EventDemo() {
57
57
  onChange: handleChange,
58
58
  onAdd: handleAdd,
59
59
  onDelete: handleDelete
60
- }, /*#__PURE__*/React.createElement(BizEventSelector, null))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u6307\u6807\u4FE1\u606F\u662F\uFF1A", JSON.stringify(value)));
60
+ }, /*#__PURE__*/React.createElement(BizEventSelector, {
61
+ border: false
62
+ }))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u662F\uFF1A\u5206\u7EC4id: ", value.value.group.id, " \u4E8B\u4EF6\u540D\u79F0: ", value.value.event.name));
61
63
  };
62
64
 
63
65
  export default (function () {
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  &-option-icon {
29
- // display: none;
29
+ display: none;
30
30
  flex: none;
31
31
  width: @icon-width;
32
32
  color: @text-color-secondary;
@@ -1,18 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React from 'react';
2
+ import { TargetSelectTypes } from './types';
2
3
  import { EventSelectTypes } from '../eventSelector/types';
3
- export declare namespace TargetSelectTypes {
4
- interface Value {
5
- alias?: string;
6
- value?: EventSelectTypes.Value | EventSelectTypes.SimpleValue;
7
- }
8
- interface Props {
9
- defaultValue?: Value;
10
- value?: Value;
11
- enableAdd?: boolean;
12
- enableDelete?: boolean;
13
- children?: ReactNode;
14
- onAdd?: (data?: Value) => void;
15
- onDelete?: (data?: Value) => void;
16
- onChange: (data: Value) => void;
17
- }
18
- }
4
+ export declare const Props: React.FC<TargetSelectTypes.Props>;
5
+ export declare const Value: React.FC<TargetSelectTypes.Value>;
6
+ export declare const EventTargetValue: React.FC<EventSelectTypes.Value>;
7
+ export declare const EventGroup: React.FC<EventSelectTypes.Value['group']>;
8
+ export declare const AnalysisEvent: React.FC<EventSelectTypes.Value['event']>;
@@ -1 +1,16 @@
1
- export {};
1
+ import React from 'react';
2
+ export var Props = function Props() {
3
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
4
+ };
5
+ export var Value = function Value() {
6
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
7
+ };
8
+ export var EventTargetValue = function EventTargetValue() {
9
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
10
+ };
11
+ export var EventGroup = function EventGroup() {
12
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
13
+ };
14
+ export var AnalysisEvent = function AnalysisEvent() {
15
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
16
+ };
@@ -3,6 +3,7 @@ import { Space } from 'antd';
3
3
  import { PlusOutlined } from '@ant-design/icons';
4
4
  import './styles/conditionTypeList.less';
5
5
  import { BizUserConditionContext } from '.';
6
+ import BizGlobalDataContext from '../context';
6
7
 
7
8
  var ConditionTypeList = function ConditionTypeList(props) {
8
9
  var onAdd = props.onAdd,
@@ -13,6 +14,9 @@ var ConditionTypeList = function ConditionTypeList(props) {
13
14
  textMode = _useContext.textMode,
14
15
  openTagCondition = _useContext.openTagCondition;
15
16
 
17
+ var _useContext2 = useContext(BizGlobalDataContext),
18
+ menuNameMap = _useContext2.menuNameMap;
19
+
16
20
  if (!show || textMode) return null;
17
21
  return /*#__PURE__*/React.createElement("div", {
18
22
  className: "biz-user-condition-type-list"
@@ -52,7 +56,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
52
56
  }
53
57
  }, /*#__PURE__*/React.createElement(Space, {
54
58
  key: "prop"
55
- }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
59
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition && (!menuNameMap || menuNameMap['userTags']) ? /*#__PURE__*/React.createElement("li", {
56
60
  className: "condition-type",
57
61
  onClick: function onClick() {
58
62
  return onAdd('tag');
@@ -1,5 +1,4 @@
1
- @import '../../assets//styles//variable.less';
2
- @import '../../commonStyle//variable.less';
1
+ @import '../../assets/styles/inner.less';
3
2
  .biz-user-condition-type-list {
4
3
  display: flex;
5
4
  align-items: center;
@@ -20,11 +19,11 @@
20
19
  margin-left: @margin-md;
21
20
  }
22
21
  &:hover {
23
- color: @themeColor;
24
- background-color: @hoverBgColor;
22
+ color: @primary-color;
23
+ background-color: @primary-color-hover;
25
24
  }
26
25
  &:active {
27
- border-color: @themeColor;
26
+ border-color: @primary-color;
28
27
  }
29
28
  }
30
29
  }
@@ -10,7 +10,6 @@
10
10
  .biz-user-condition-item-delete {
11
11
  display: flex;
12
12
  align-items: center;
13
- height: 40px;
14
13
  margin-left: @margin-lg;
15
14
  cursor: pointer;
16
15
  }
@@ -31,6 +31,7 @@ export declare namespace OldSystem {
31
31
  is_delete: boolean;
32
32
  is_stop: boolean;
33
33
  plats: number[];
34
+ mark_type: 1 | null;
34
35
  }
35
36
  interface EventProp {
36
37
  alias_name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.24-userTag.0",
3
+ "version": "1.0.24",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "react": "^16.12.0 || ^17.0.0",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "5ed7cab8d6b63eef4f1f9bf59a945febafadb837"
61
+ "gitHead": "ac0ce337e692e43ec70d2ae2fadb4a4927904478"
62
62
  }
@@ -1,194 +0,0 @@
1
- @import './variable.less';
2
-
3
- .biz-icon-add {
4
- width: fit-content;
5
- padding: 2px;
6
- color: @fontColor3;
7
- font-weight: 400;
8
- font-size: 14px;
9
- line-height: 20px;
10
- cursor: pointer;
11
-
12
- &:not(.biz-disabled):hover {
13
- color: @hoverColor;
14
- background: @hoverBgColor;
15
- border-radius: 3px;
16
-
17
- span {
18
- color: @hoverColor;
19
- }
20
- }
21
-
22
- .biz-icon-text {
23
- margin-left: 6px;
24
- }
25
-
26
- &.biz-disabled {
27
- color: @disableColor;
28
- cursor: not-allowed;
29
-
30
- span {
31
- color: @disableColor;
32
- }
33
- }
34
- }
35
-
36
- .biz-icon {
37
- color: @fontColor3;
38
- font-size: 16px;
39
- }
40
-
41
- .biz-input-icon {
42
- color: #5f6085;
43
- font-size: 18px;
44
- }
45
-
46
- .biz-options {
47
- display: flex;
48
- }
49
-
50
- .biz-option-icon {
51
- display: none;
52
- width: 24px;
53
- height: 32px;
54
- padding-right: 1px;
55
- color: @iconColor;
56
- font-size: 15px;
57
- line-height: 32px;
58
- text-align: center;
59
- background-color: #fff;
60
- border-radius: 4px;
61
- cursor: pointer;
62
-
63
- &:not(.biz-disabled):hover {
64
- color: @hoverColor;
65
- background-color: @hoverBgColor;
66
- }
67
-
68
- &.biz-option-icon-delete:not(.biz-disabled):hover {
69
- color: @deleteHoverColor;
70
- background-color: @deleteHoverBgColor;
71
- }
72
-
73
- &.biz-disabled {
74
- color: @disableColor;
75
- cursor: not-allowed;
76
- }
77
- }
78
-
79
- // .biz-btn,
80
- // .ant-btn {
81
- // height: auto;
82
- // padding: 10px 24px;
83
- // font-weight: 400;
84
- // font-size: 14px;
85
- // line-height: 20px;
86
- // border-radius: 4px;
87
- // cursor: pointer;
88
-
89
- // .anticon {
90
- // margin-right: 8px;
91
- // font-size: 24px;
92
- // }
93
-
94
- // &.small {
95
- // padding: 5px 12px;
96
- // }
97
- // }
98
-
99
- // .biz-btn-primary,
100
- // .ant-btn-primary {
101
- // color: #fff;
102
- // background: @themeColor;
103
- // border: none;
104
-
105
- // &:hover,
106
- // &:active {
107
- // background: #85adfc;
108
- // }
109
-
110
- // &:focus {
111
- // background: #1451db;
112
- // }
113
-
114
- // &:disabled {
115
- // color: @disableColor;
116
- // background: @grayColor;
117
- // }
118
- // }
119
-
120
- // .biz-btn-default,
121
- // .ant-btn-default {
122
- // color: #242541;
123
- // background: #f6f6f6;
124
- // border: none;
125
-
126
- // &:hover,
127
- // &:focus {
128
- // color: #242541;
129
- // background: #cacdd4;
130
- // }
131
-
132
- // &:active {
133
- // color: #242541;
134
- // background: #94a6ce;
135
- // }
136
-
137
- // &:disabled {
138
- // color: #cacdd4;
139
- // background: #f6f6f6;
140
- // }
141
- // }
142
-
143
- // .biz-btn-text {
144
- // color: #021429;
145
-
146
- // &:hover {
147
- // background: #f6f6f6;
148
- // }
149
-
150
- // &:active {
151
- // background: #cacdd4;
152
- // }
153
-
154
- // &:disabled {
155
- // color: #cacdd4;
156
- // }
157
- // }
158
-
159
- // .biz-btn-line {
160
- // box-sizing: border-box;
161
- // color: #5f6085;
162
- // background: #ffffff;
163
- // border: 1px solid #ecedf0;
164
- // border-radius: 4px;
165
-
166
- // &:hover {
167
- // color: #165dff;
168
- // background: #e8efff;
169
- // border-color: #165dff;
170
- // }
171
- // }
172
-
173
- // .ant-tooltip {
174
- // .ant-tooltip-inner {
175
- // border-radius: @boxRadius2;
176
- // }
177
-
178
- // &.biz-tooltip {
179
- // width: auto;
180
-
181
- // .ant-tooltip-inner {
182
- // padding: 4px;
183
- // color: @fontColor;
184
- // background-color: #fff;
185
- // border-radius: 4px;
186
- // box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
187
- // }
188
-
189
- // .ant-tooltip-arrow-content {
190
- // background-color: #fff;
191
- // --antd-arrow-background-color: #fff;
192
- // }
193
- // }
194
- // }
@@ -1,3 +0,0 @@
1
- @import './theme.less';
2
- @import './icon.less';
3
- @import './select.less';
@@ -1,92 +0,0 @@
1
- @import './variable.less';
2
-
3
- /*文本框样式*/
4
- .biz-select-cotainer {
5
- position: relative;
6
- display: flex;
7
- flex: 1;
8
- flex-wrap: wrap;
9
- align-items: center;
10
- box-sizing: border-box;
11
- margin-bottom: 8px;
12
- padding: 4px;
13
- color: #021429;
14
- border: @boxBorder;
15
- border-radius: @boxRadius;
16
-
17
- &:hover {
18
- .biz-option-icon {
19
- display: block;
20
- }
21
- }
22
- }
23
-
24
- /*下拉框的文本框样式*/
25
-
26
- .biz-select-content {
27
- position: relative;
28
- display: flex;
29
- flex: 1;
30
- height: 100%;
31
- color: @fontColor;
32
- border-radius: 4px;
33
- cursor: pointer;
34
-
35
- &:not(.biz-gray-select):hover {
36
- color: @hoverColor;
37
- background-color: @hoverBgColor;
38
-
39
- .biz-select-zhankai {
40
- display: block;
41
- }
42
-
43
- span {
44
- color: @hoverColor;
45
- }
46
- }
47
-
48
- .biz-input {
49
- flex: 1;
50
- box-sizing: border-box;
51
- height: 32px;
52
- padding: 6px 8px;
53
- line-height: 20px;
54
- border-radius: @boxRadius;
55
- .boxBg();
56
-
57
- &.biz-bg-gray {
58
- background: @grayColor;
59
- }
60
- }
61
- }
62
-
63
- .biz-select-zhankai {
64
- position: absolute;
65
- top: 5px;
66
- right: 10px;
67
- display: none;
68
- color: @iconColor;
69
- font-size: @iconSize;
70
- }
71
-
72
- .biz-select-nodata {
73
- position: absolute;
74
- top: 42px;
75
- left: -4px;
76
- z-index: 9999;
77
- box-sizing: border-box;
78
- width: 268px;
79
- min-width: 322px;
80
- height: 48px;
81
- padding-left: 16px;
82
- color: @fontColor;
83
- font-size: @fontSize;
84
- line-height: 48px;
85
- background: #ffffff;
86
- border-radius: @boxRadius2;
87
- box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
88
- }
89
-
90
- .ant-select-item-empty {
91
- color: @fontColor;
92
- }