@zgfe/business-lib 1.1.31-alpha.2 → 1.1.31

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 (59) hide show
  1. package/es/assets/colorIcon/demo.css +539 -0
  2. package/es/assets/colorIcon/demo_index.html +741 -0
  3. package/es/assets/colorIcon/iconfont.css +112 -0
  4. package/es/assets/colorIcon/iconfont.js +43 -0
  5. package/es/assets/colorIcon/iconfont.json +177 -0
  6. package/es/assets/colorIcon/iconfont.svg +67 -0
  7. package/es/assets/colorIcon/iconfont.ttf +0 -0
  8. package/es/assets/colorIcon/iconfont.woff +0 -0
  9. package/es/assets/colorIcon/iconfont.woff2 +0 -0
  10. package/es/assets/iconfont/demo_index.html +95 -3
  11. package/es/assets/iconfont/iconfont.css +19 -3
  12. package/es/assets/iconfont/iconfont.js +1 -1
  13. package/es/assets/iconfont/iconfont.json +28 -0
  14. package/es/assets/iconfont/iconfont.ttf +0 -0
  15. package/es/assets/iconfont/iconfont.woff +0 -0
  16. package/es/assets/iconfont/iconfont.woff2 +0 -0
  17. package/es/assets/styles/resetAntd.less +12 -36
  18. package/es/attrConditions/utils/operates.d.ts +0 -50
  19. package/es/attrConditions/utils/operates.js +0 -126
  20. package/es/colorIcon/demo/index.d.ts +3 -0
  21. package/es/colorIcon/demo/index.js +10 -0
  22. package/es/colorIcon/index.d.ts +9 -0
  23. package/es/colorIcon/index.js +19 -0
  24. package/es/constants/apis.d.ts +1 -0
  25. package/es/constants/apis.js +2 -1
  26. package/es/datePicker/index.d.ts +1 -1
  27. package/es/datePicker/index.js +1 -1
  28. package/es/datePicker/styles/index.less +1 -1
  29. package/es/demoWrapper/content.d.ts +2 -1
  30. package/es/demoWrapper/content.js +23 -12
  31. package/es/demoWrapper/demo/index.js +5 -3
  32. package/es/demoWrapper/head.d.ts +3 -1
  33. package/es/demoWrapper/head.js +17 -5
  34. package/es/demoWrapper/index.js +18 -10
  35. package/es/eventSelector/listPanel.js +11 -4
  36. package/es/index.d.ts +3 -1
  37. package/es/index.js +3 -1
  38. package/es/socket/demo/demo.d.ts +2 -0
  39. package/es/socket/demo/demo.js +145 -0
  40. package/es/socket/demo/index.less +27 -0
  41. package/es/socket/index.d.ts +31 -0
  42. package/es/socket/index.js +291 -0
  43. package/es/socket/types.d.ts +38 -0
  44. package/es/socket/types.js +28 -0
  45. package/es/userCondition/conditionTypeList.js +1 -17
  46. package/es/userCondition/conditions/constants.d.ts +0 -1
  47. package/es/userCondition/conditions/constants.js +1 -2
  48. package/es/userCondition/conditions/eventCondition.js +2 -77
  49. package/es/userCondition/orConditions.js +0 -15
  50. package/es/userCondition/types.d.ts +3 -34
  51. package/es/userCondition/util.d.ts +1 -1
  52. package/es/userCondition/util.js +0 -29
  53. package/package.json +61 -61
  54. package/es/userCondition/conditions/businessCondition.d.ts +0 -11
  55. package/es/userCondition/conditions/businessCondition.js +0 -413
  56. package/es/userCondition/conditions/dataAttribute.d.ts +0 -10
  57. package/es/userCondition/conditions/dataAttribute.js +0 -329
  58. package/es/userCondition/conditions/timeDimension.d.ts +0 -9
  59. package/es/userCondition/conditions/timeDimension.js +0 -200
@@ -16,12 +16,8 @@
16
16
  border-color: @primary-color!important;
17
17
  }
18
18
 
19
- &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
20
- .ant-input-affix-wrapper-borderless
21
- ):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper,
22
- &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
23
- .ant-input-affix-wrapper-borderless
24
- ):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper:hover {
19
+ &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper,
20
+ &.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless):not(.ant-input-affix-wrapper-focused).ant-input-affix-wrapper:hover {
25
21
  background-color: @background-color-base!important;
26
22
  }
27
23
  }
@@ -35,12 +31,8 @@
35
31
  }
36
32
  }
37
33
 
38
- .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
39
- .ant-input-affix-wrapper-borderless
40
- ).ant-input-affix-wrapper,
41
- .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(
42
- .ant-input-affix-wrapper-borderless
43
- ).ant-input-affix-wrapper:hover {
34
+ .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,
35
+ .ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover {
44
36
  border-color: @error-color!important;
45
37
  }
46
38
  // 输入框
@@ -70,9 +62,7 @@
70
62
  background-color: @background-color-base!important;
71
63
  }
72
64
 
73
- .ant-select:not(.ant-select-customize-input):not(.ant-pagination-size-changer):not(
74
- .ant-select-status-error
75
- )
65
+ .ant-select:not(.ant-select-customize-input):not(.ant-pagination-size-changer):not(.ant-select-status-error)
76
66
  .ant-select-selector {
77
67
  background: #fafafb;
78
68
  border-color: rgba(0, 0, 0, 0);
@@ -239,9 +229,7 @@
239
229
  /*日期hover*/
240
230
  &:hover {
241
231
  &:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,
242
- &:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(
243
- .ant-picker-cell-range-end
244
- ):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end)
232
+ &:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end)
245
233
  .ant-picker-cell-inner {
246
234
  background-color: transparent !important;
247
235
  border: 1px solid @primary-color!important;
@@ -251,13 +239,9 @@
251
239
 
252
240
  /*选中的日期范围*/
253
241
  /* 日期范围的起始时间radius */
254
- .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(
255
- .ant-picker-cell-range-end
256
- )
242
+ .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end)
257
243
  .ant-picker-cell-inner,
258
- .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(
259
- .ant-picker-cell-range-start
260
- )
244
+ .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start)
261
245
  .ant-picker-cell-inner {
262
246
  border-radius: 50% !important;
263
247
  }
@@ -288,12 +272,8 @@
288
272
  .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover::before,
289
273
  .ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover::before,
290
274
  .ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover::before,
291
- .ant-picker-cell-in-view.ant-picker-cell-range-start:not(
292
- .ant-picker-cell-range-start-single
293
- ).ant-picker-cell-range-hover-start::before,
294
- .ant-picker-cell-in-view.ant-picker-cell-range-end:not(
295
- .ant-picker-cell-range-end-single
296
- ).ant-picker-cell-range-hover-end::before,
275
+ .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single).ant-picker-cell-range-hover-start::before,
276
+ .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single).ant-picker-cell-range-hover-end::before,
297
277
  .ant-picker-panel
298
278
  > :not(.ant-picker-date-panel)
299
279
  .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start::before,
@@ -316,12 +296,8 @@
316
296
  }
317
297
  }
318
298
  }
319
- .ant-picker-cell-in-view.ant-picker-cell-range-start:not(
320
- .ant-picker-cell-range-start-single
321
- )::before,
322
- .ant-picker-cell-in-view.ant-picker-cell-range-end:not(
323
- .ant-picker-cell-range-end-single
324
- )::before {
299
+ .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single)::before,
300
+ .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single)::before {
325
301
  background: @primary-color-hover !important;
326
302
  }
327
303
  }
@@ -6,56 +6,6 @@ export declare const numberOperate: {
6
6
  name: string;
7
7
  value: string;
8
8
  }[];
9
- export declare const computeTypeList: {
10
- value: string;
11
- name: string;
12
- }[];
13
- export declare const typeList: {
14
- 'cont-string': {
15
- name: string;
16
- value: string;
17
- }[];
18
- 'cont-date': {
19
- name: string;
20
- value: string;
21
- }[];
22
- 'cont-num': {
23
- name: string;
24
- value: string;
25
- }[];
26
- };
27
- export declare const timeDimensionType: {
28
- name: string;
29
- value: number;
30
- }[];
31
- export declare const orderTypeList: {
32
- name: string;
33
- value: string;
34
- }[];
35
- export declare const skyTimeOperatorType: {
36
- name: string;
37
- value: string;
38
- }[];
39
- export declare const weekTimeOperatorType: {
40
- name: string;
41
- value: string;
42
- }[];
43
- export declare const monthTimeOperatorType: {
44
- name: string;
45
- value: string;
46
- }[];
47
- export declare const timeValuesType: {
48
- name: string;
49
- value: any;
50
- }[];
51
- export declare const weekValuesType: {
52
- name: string;
53
- value: number;
54
- }[];
55
- export declare const monthValuesType: {
56
- name: string;
57
- value: any;
58
- }[];
59
9
  export declare const dateOperate: {
60
10
  name: string;
61
11
  value: string;
@@ -1,4 +1,3 @@
1
- var _Array$from, _Array$from2;
2
1
  export var stringOperate = [{
3
2
  name: '是',
4
3
  value: 'equal'
@@ -49,131 +48,6 @@ export var numberOperate = [{
49
48
  name: '≠',
50
49
  value: 'not equal'
51
50
  }];
52
- export var computeTypeList = [{
53
- value: 'origin',
54
- name: '原值'
55
- }, {
56
- value: 'max',
57
- name: '最大值'
58
- }, {
59
- value: 'min',
60
- name: '最小值'
61
- }, {
62
- value: 'sum',
63
- name: '累计值'
64
- }, {
65
- value: 'avg',
66
- name: '平均值'
67
- }];
68
- export var typeList = {
69
- 'cont-string': stringOperate,
70
- 'cont-date': [{
71
- name: '最近',
72
- value: 'relative'
73
- }, {
74
- name: '最近区间',
75
- value: 'relativeInterval'
76
- }, {
77
- name: '未来',
78
- value: 'future'
79
- }, {
80
- name: '未来区间',
81
- value: 'futureInterval'
82
- }, {
83
- name: '固定时段',
84
- value: 'absolute'
85
- }],
86
- 'cont-num': [{
87
- name: '>',
88
- value: '>'
89
- }, {
90
- name: '=',
91
- value: '='
92
- }, {
93
- name: '<',
94
- value: '<'
95
- }, {
96
- name: '>=',
97
- value: '>='
98
- }, {
99
- name: '<=',
100
- value: '<='
101
- }, {
102
- name: '≠',
103
- value: 'not equal'
104
- }, {
105
- name: '区间',
106
- value: 'between'
107
- }]
108
- };
109
- export var timeDimensionType = [{
110
- name: '每天',
111
- value: 1
112
- }, {
113
- name: '每周',
114
- value: 2
115
- }, {
116
- name: '每月',
117
- value: 3
118
- }];
119
- export var orderTypeList = [{
120
- name: '主订单',
121
- value: 'master'
122
- }, {
123
- name: '子订单',
124
- value: 'son'
125
- }];
126
- export var skyTimeOperatorType = [{
127
- name: '整天',
128
- value: 'all'
129
- }, {
130
- name: '在',
131
- value: 'in'
132
- }, {
133
- name: '在区间',
134
- value: 'between'
135
- }];
136
- export var weekTimeOperatorType = [{
137
- name: '整周',
138
- value: 'all'
139
- }, {
140
- name: '在',
141
- value: 'in'
142
- }, {
143
- name: '在区间',
144
- value: 'between'
145
- }];
146
- export var monthTimeOperatorType = [{
147
- name: '整月',
148
- value: 'all'
149
- }, {
150
- name: '在',
151
- value: 'in'
152
- }, {
153
- name: '在区间',
154
- value: 'between'
155
- }];
156
- var arr1 = new Array(24).keys();
157
- export var timeValuesType = (_Array$from = Array.from(arr1)) === null || _Array$from === void 0 ? void 0 : _Array$from.map(function (item) {
158
- return {
159
- name: item + '时',
160
- value: item
161
- };
162
- });
163
- var arr2 = ['一', '二', '三', '四', '五', '六', '日'];
164
- export var weekValuesType = arr2.map(function (item, index) {
165
- return {
166
- name: '周' + item,
167
- value: index + 1
168
- };
169
- });
170
- var arr3 = new Array(31).keys();
171
- export var monthValuesType = (_Array$from2 = Array.from(arr3)) === null || _Array$from2 === void 0 ? void 0 : _Array$from2.map(function (item) {
172
- return {
173
- name: item + 1 + '号',
174
- value: item + 1
175
- };
176
- });
177
51
  export var dateOperate = [{
178
52
  name: '最近',
179
53
  value: 'relative'
@@ -0,0 +1,3 @@
1
+ import '../../assets/colorIcon/iconfont.js';
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ColorIcon } from '@zgfe/business-lib';
3
+ import '../../assets/colorIcon/iconfont.js';
4
+ export default (function () {
5
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ColorIcon, {
6
+ width: 50,
7
+ height: 50,
8
+ type: "icon-caidan-guanggaojiance"
9
+ }));
10
+ });
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ type: string;
4
+ width?: number;
5
+ height?: number;
6
+ className?: string;
7
+ }
8
+ declare const ColorIcon: React.FC<Props>;
9
+ export default ColorIcon;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ var ColorIcon = function ColorIcon(props) {
3
+ var className = props.className,
4
+ type = props.type;
5
+ return /*#__PURE__*/React.createElement("svg", {
6
+ className: className,
7
+ "aria-hidden": "true",
8
+ style: {
9
+ width: props.width ? "".concat(props.width, "px") : 'auto',
10
+ height: props.height ? "".concat(props.height, "px") : 'auto'
11
+ }
12
+ }, /*#__PURE__*/React.createElement("use", {
13
+ xlinkHref: "#".concat(type)
14
+ }));
15
+ };
16
+ ColorIcon.defaultProps = {
17
+ className: ''
18
+ };
19
+ export default ColorIcon;
@@ -7,5 +7,6 @@ declare const Apis: {
7
7
  queryPanelGroup: string;
8
8
  queryDatasetList: string;
9
9
  queryDatasetDetail: string;
10
+ getSocketToken: string;
10
11
  };
11
12
  export default Apis;
@@ -6,6 +6,7 @@ var Apis = {
6
6
  updatePanelTarget: '/apppanel/updateElemet.jsp',
7
7
  queryPanelGroup: '/apppanel/panels.jsp',
8
8
  queryDatasetList: '/zg/web/cdp/inner/dataset/list',
9
- queryDatasetDetail: '/zg/web/cdp/inner/dataset/detail'
9
+ queryDatasetDetail: '/zg/web/cdp/inner/dataset/detail',
10
+ getSocketToken: '/zg/web/v2/tracking/view/websocket/token'
10
11
  };
11
12
  export default Apis;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DatePickerTypes } from './types';
3
3
  import './styles/index.less';
4
- export declare const classPrefix = "biz-date-picker";
4
+ export declare const classPrefix = "biz-date-picker-wrap";
5
5
  declare const BizDatePicker: React.FC<DatePickerTypes.Props>;
6
6
  export default BizDatePicker;
@@ -16,7 +16,7 @@ import BizSelect from '../select';
16
16
  import BizDate from './datePicker';
17
17
  import './styles/index.less';
18
18
  import { Skeleton } from 'antd';
19
- export var classPrefix = 'biz-date-picker';
19
+ export var classPrefix = 'biz-date-picker-wrap';
20
20
  var BizDatePicker = function BizDatePicker(props) {
21
21
  var dateList = getDateList(props.mode, props.dateTypeList);
22
22
  var _useState = useState(dateList[0]),
@@ -1,6 +1,6 @@
1
1
  @import '../../assets/styles/inner.less';
2
2
 
3
- .biz-date-picker {
3
+ .biz-date-picker-wrap {
4
4
  display: flex;
5
5
 
6
6
  &-type {
@@ -1,7 +1,8 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { AppInfoProps } from '../context';
2
3
  declare const DemoContent: React.FC<{
3
4
  children?: ReactNode;
4
5
  needMeta?: boolean;
5
- currentApp?: number;
6
+ currentApp?: AppInfoProps;
6
7
  }>;
7
8
  export default DemoContent;
@@ -1,3 +1,9 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ 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; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
8
  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
9
  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); }
@@ -82,10 +88,16 @@ var DemoContent = function DemoContent(_ref3) {
82
88
  setStore = _useState18[1];
83
89
  useEffect(function () {
84
90
  if (!needMeta || !currentApp) return;
85
- loadUserProps();
86
- loadEvents();
87
- loadEnvList();
88
- loadUserGroup();
91
+ if (currentApp.appsHasData && currentApp.appsHasData.length) {
92
+ loadUserProps();
93
+ loadEvents();
94
+ loadEnvList();
95
+ loadUserGroup();
96
+ } else {
97
+ setLoadEnv(false);
98
+ setLoadEvent(false);
99
+ setLoadUsers(false);
100
+ }
89
101
  }, [currentApp, needMeta]);
90
102
  useEffect(function () {
91
103
  if (loadEnv || loadEvent || loadUsers || loadUserGroups) return;
@@ -100,7 +112,7 @@ var DemoContent = function DemoContent(_ref3) {
100
112
  ajax('/analysis/api/common/proxy/usergroup/getAll.jsp', {
101
113
  method: 'post',
102
114
  params: {
103
- appId: currentApp,
115
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
104
116
  platform: 0,
105
117
  includeDefault: true,
106
118
  includeToday: true
@@ -115,7 +127,7 @@ var DemoContent = function DemoContent(_ref3) {
115
127
  ajax('/analysis/api/common/proxy/appusergroup/getUserPropMeta.jsp', {
116
128
  method: 'post',
117
129
  params: {
118
- app_id: currentApp,
130
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
119
131
  platform: 0
120
132
  }
121
133
  }).then(function (res) {
@@ -128,7 +140,7 @@ var DemoContent = function DemoContent(_ref3) {
128
140
  ajax('/analysis/api/common/proxy/data/queryEventMetasOfGroup.jsp', {
129
141
  method: 'post',
130
142
  params: {
131
- app_id: currentApp,
143
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
132
144
  platform: 0,
133
145
  is_all: true
134
146
  }
@@ -142,7 +154,7 @@ var DemoContent = function DemoContent(_ref3) {
142
154
  ajax('/analysis/api/common/proxy/appusergroup/getEventEnvData.jsp', {
143
155
  method: 'post',
144
156
  params: {
145
- app_id: currentApp,
157
+ app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
146
158
  platform: 0
147
159
  }
148
160
  }).then(function (res) {
@@ -157,10 +169,9 @@ var DemoContent = function DemoContent(_ref3) {
157
169
  }
158
170
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
159
171
  value: {
160
- currentApp: {
161
- appId: currentApp,
162
- platform: 0
163
- },
172
+ currentApp: _objectSpread(_objectSpread({}, currentApp), {}, {
173
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id
174
+ }),
164
175
  eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
165
176
  userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
166
177
  eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import { DemoWrapper } from '@zgfe/business-lib';
2
+ import { DemoWrapper, BizGlobalDataContext } from '@zgfe/business-lib';
3
3
  export default (function () {
4
4
  return /*#__PURE__*/React.createElement(DemoWrapper, {
5
- defaultApp: 3,
6
5
  needMeta: true
7
- }, "xxx");
6
+ }, /*#__PURE__*/React.createElement(BizGlobalDataContext.Consumer, null, function (_ref) {
7
+ var currentApp = _ref.currentApp;
8
+ return /*#__PURE__*/React.createElement(React.Fragment, null, "\u5F53\u524D\u5E94\u7528\uFF1A", currentApp.appName, "(id: ", currentApp.id, ")");
9
+ }));
8
10
  });
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
+ import { AppInfoProps } from '../context';
2
3
  declare const DemoHeader: React.FC<{
3
4
  defaultApp?: number;
4
- onChangeApp?: (appId: number) => void;
5
+ onChangeApp?: (app: AppInfoProps) => void;
6
+ onLoading?: (loading: boolean) => void;
5
7
  }>;
6
8
  export default DemoHeader;
@@ -9,7 +9,8 @@ import React, { useEffect, useState } from 'react';
9
9
  import request from '../utils/ajax';
10
10
  var DemoHeader = function DemoHeader(_ref) {
11
11
  var defaultApp = _ref.defaultApp,
12
- onChangeApp = _ref.onChangeApp;
12
+ onChangeApp = _ref.onChangeApp,
13
+ onLoading = _ref.onLoading;
13
14
  var _useState = useState([]),
14
15
  _useState2 = _slicedToArray(_useState, 2),
15
16
  appList = _useState2[0],
@@ -21,17 +22,25 @@ var DemoHeader = function DemoHeader(_ref) {
21
22
  useEffect(function () {
22
23
  queryAppList();
23
24
  }, []);
25
+ useEffect(function () {
26
+ if (onLoading) onLoading(loading);
27
+ }, [loading, appList]);
24
28
  function queryAppList() {
25
29
  setLoading(true);
26
30
  request('/analysis/api/common/proxy/data/v2ajaxGetDataByApp.jsp').then(function (res) {
27
31
  setAppList(res.applist);
28
- if (!defaultApp && res.applist.length) onChange(res.applist[0].id);
32
+ if (defaultApp) {
33
+ _onChange(res.applist.find(function (item) {
34
+ return item.id === defaultApp;
35
+ }));
36
+ }
37
+ if (!defaultApp && res.applist.length) _onChange(res.applist[0]);
29
38
  }).finally(function () {
30
39
  setLoading(false);
31
40
  });
32
41
  }
33
- function onChange(id) {
34
- if (onChangeApp) onChangeApp(id);
42
+ function _onChange(item) {
43
+ if (onChangeApp) onChangeApp(item);
35
44
  }
36
45
  if (loading) return /*#__PURE__*/React.createElement(Skeleton.Input, null);
37
46
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
@@ -41,7 +50,10 @@ var DemoHeader = function DemoHeader(_ref) {
41
50
  label: 'appName',
42
51
  value: 'id'
43
52
  },
44
- onChange: onChange,
53
+ onChange: function onChange(_id, app) {
54
+ console.log('默认应用', app);
55
+ _onChange(app);
56
+ },
45
57
  style: {
46
58
  width: '200px'
47
59
  }
@@ -20,14 +20,18 @@ var DemoWrapper = function DemoWrapper(_ref) {
20
20
  _useState2 = _slicedToArray(_useState, 2),
21
21
  loading = _useState2[0],
22
22
  setLoading = _useState2[1];
23
- var _useState3 = useState(false),
23
+ var _useState3 = useState(true),
24
24
  _useState4 = _slicedToArray(_useState3, 2),
25
- notLogin = _useState4[0],
26
- setNotLogin = _useState4[1];
27
- var _useState5 = useState(defaultApp),
25
+ appListLoading = _useState4[0],
26
+ setAppListLoading = _useState4[1];
27
+ var _useState5 = useState(false),
28
28
  _useState6 = _slicedToArray(_useState5, 2),
29
- appId = _useState6[0],
30
- setAppId = _useState6[1];
29
+ notLogin = _useState6[0],
30
+ setNotLogin = _useState6[1];
31
+ var _useState7 = useState(),
32
+ _useState8 = _slicedToArray(_useState7, 2),
33
+ app = _useState8[0],
34
+ setApp = _useState8[1];
31
35
  useEffect(function () {
32
36
  getCurrentUser();
33
37
  }, []);
@@ -53,15 +57,19 @@ var DemoWrapper = function DemoWrapper(_ref) {
53
57
  return /*#__PURE__*/React.createElement(Card, {
54
58
  title: /*#__PURE__*/React.createElement(DemoHeader, {
55
59
  defaultApp: defaultApp,
56
- onChangeApp: setAppId
60
+ onChangeApp: setApp,
61
+ onLoading: setAppListLoading
57
62
  }),
58
63
  className: className,
59
64
  bodyStyle: {
60
65
  background: '#FAFAFB'
61
66
  }
62
- }, /*#__PURE__*/React.createElement(DemoContent, {
63
- currentApp: appId,
64
- needMeta: needMeta
67
+ }, appListLoading ? /*#__PURE__*/React.createElement(Spin, {
68
+ tip: "\u5E94\u7528\u4FE1\u606F\u521D\u59CB\u5316\u4E2D"
69
+ }) : /*#__PURE__*/React.createElement(DemoContent, {
70
+ currentApp: app,
71
+ needMeta: needMeta,
72
+ key: app === null || app === void 0 ? void 0 : app.appId
65
73
  }, children));
66
74
  };
67
75
  export default DemoWrapper;
@@ -166,18 +166,26 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
166
166
  _useState12 = _slicedToArray(_useState11, 2),
167
167
  showList = _useState12[0],
168
168
  setShowList = _useState12[1];
169
+ var _useState13 = useState([]),
170
+ _useState14 = _slicedToArray(_useState13, 2),
171
+ canShowList = _useState14[0],
172
+ setCanShowList = _useState14[1];
169
173
  useEffect(function () {
170
- setShowList(searchEventList.slice(0, 10));
174
+ var data = searchEventList.filter(function (item) {
175
+ return item.eventHidden !== ShowStatus.hidden;
176
+ });
177
+ setCanShowList(data);
178
+ setShowList(data.slice(0, 10));
171
179
  }, [searchEventList]);
172
180
  var loadMoreData = function loadMoreData() {
173
- var moreData = searchEventList.slice(showList.length, showList.length + 10);
181
+ var moreData = canShowList.slice(showList.length, showList.length + 10);
174
182
  setShowList(function (list) {
175
183
  return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
176
184
  });
177
185
  };
178
186
  return /*#__PURE__*/React.createElement(InfiniteScroll, {
179
187
  dataLength: showList.length,
180
- hasMore: showList.length < searchEventList.length,
188
+ hasMore: showList.length < canShowList.length,
181
189
  loader: /*#__PURE__*/React.createElement(Skeleton, {
182
190
  paragraph: {
183
191
  rows: 1
@@ -190,7 +198,6 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
190
198
  key: Math.random()
191
199
  }, showList.map(function (e) {
192
200
  var _currentValue$event2;
193
- if (e.eventHidden === ShowStatus.hidden) return null;
194
201
  return /*#__PURE__*/React.createElement(EventListOption, {
195
202
  label: e.alias || e.name,
196
203
  key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
package/es/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import BizDialog from './dialog';
13
13
  import BizChart from './chart';
14
14
  import BizTable from './table';
15
15
  import IconFont from './icon/iconFont';
16
+ import ColorIcon from './colorIcon';
16
17
  import { util, ajax } from './utils';
17
18
  import theme from './assets/theme.js';
18
19
  import convertAttributeData from './attributeSelector/util';
@@ -28,7 +29,8 @@ import BizDnd from './dnd';
28
29
  import BizDetailLayout from './layout/detail';
29
30
  import BizLoginForm from './loginForm';
30
31
  import DemoWrapper from './demoWrapper';
31
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
32
+ import SocketClient from './socket';
33
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
32
34
  export type { UserGroupTypes } from './userGroup/types';
33
35
  export type { BizSelectTypes } from './select/types';
34
36
  export type { AttributeSelect } from './attributeSelector/types';