@zgfe/business-lib 1.0.13-alpha.0 → 1.0.13-alpha.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.
@@ -62,7 +62,7 @@
62
62
  // 选择框下拉选项
63
63
  .ant-select-item {
64
64
  height: @height-lg!important;
65
- padding: 0 @padding-sm!important;
65
+ padding: @padding-xs @padding-sm!important;
66
66
  border-radius: @border-radius-normal!important;
67
67
 
68
68
  &:hover:not(.ant-select-item-option-disabled, .ant-select-item-option-selected) {
@@ -5,24 +5,9 @@
5
5
  @border-radius-normal: 8px;
6
6
  @border-radius-large: 20px;
7
7
  @option-height: @height-lg;
8
- @background-color-base: #fafafb;
9
8
  @background-color-gray: #f6f6f6;
10
9
  @icon-width: 24px;
11
10
 
12
- @shadow-color: rgba(0, 0, 0, 0.1);
13
11
  @shadow-color-light: rgba(0, 0, 0, 0.1);
14
- @box-shadow-base: 0px 4px 10px @shadow-color;
15
12
  @box-shadow-small: 0px 1px 2px @shadow-color-light;
16
13
  @box-shadow-form: 0 0 0 4px @primary-1;
17
-
18
- // 正文
19
- @text-color: #021429;
20
- // 次要
21
- @text-color-secondary: #5f6085;
22
- // 中性色/重要-文标题2
23
- @tooltip-bg: #242541;
24
- // 错误颜色
25
- @error-color: #fb5547;
26
-
27
- // text-btn hover背景色
28
- @btn-text-hover-bg: #cacdd4;
@@ -1,10 +1,15 @@
1
1
  declare const _default: {
2
2
  'primary-color': string;
3
- 'border-color-base': string;
4
3
  'primary-1': string;
4
+ 'border-color-base': string;
5
+ 'background-color-base': string;
5
6
  'text-color': string;
6
7
  'text-color-secondary': string;
8
+ 'tooltip-bg': string;
7
9
  'error-color': string;
10
+ 'shadow-color': string;
11
+ 'box-shadow-base': string;
12
+ 'btn-text-hover-bg': string;
8
13
  'warning-color': string;
9
14
  };
10
15
  export default _default;
@@ -1,9 +1,14 @@
1
1
  export default {
2
2
  'primary-color': '#165dff',
3
- 'border-color-base': '#ECEDF0',
4
3
  'primary-1': '#E8EFFF',
4
+ 'border-color-base': '#ECEDF0',
5
+ 'background-color-base': '#fafafb',
5
6
  'text-color': '#021429',
6
7
  'text-color-secondary': '#5f6085',
7
- 'error-color': '#FB5547',
8
+ 'tooltip-bg': '#242541',
9
+ 'error-color': '#fb5547',
10
+ 'shadow-color': 'rgba(0, 0, 0, 0.1)',
11
+ 'box-shadow-base': '0px 4px 10px rgba(0, 0, 0, 0.1)',
12
+ 'btn-text-hover-bg': '#cacdd4',
8
13
  'warning-color': '#FD9F41'
9
14
  };
@@ -20,7 +20,7 @@ var BizOperateList = function BizOperateList(props) {
20
20
  var _props$attr2;
21
21
 
22
22
  var _useState = useState({
23
- value: props.defaultValue
23
+ value: ''
24
24
  }),
25
25
  _useState2 = _slicedToArray(_useState, 2),
26
26
  current = _useState2[0],
@@ -39,7 +39,7 @@ var BizOperateList = function BizOperateList(props) {
39
39
  setOptions(optionData);
40
40
  var flag = true;
41
41
 
42
- if (current) {
42
+ if (current.value) {
43
43
  optionData.forEach(function (item) {
44
44
  if (item.value === current.value) {
45
45
  if (current.name && current.name === item.name) {
@@ -47,6 +47,11 @@ var BizOperateList = function BizOperateList(props) {
47
47
  }
48
48
  }
49
49
  });
50
+ } else if (props.defaultValue) {
51
+ setCurrent({
52
+ value: props.defaultValue
53
+ });
54
+ return;
50
55
  }
51
56
 
52
57
  if (!flag) return;
@@ -16,7 +16,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
 
17
17
  import React, { useContext, useEffect, useState } from 'react';
18
18
  import { classPrefix } from '..';
19
- import { PropCategory } from '../../attributeSelector/types';
20
19
  import Apis from '../../constants/apis';
21
20
  import BizGlobalDataContext from '../../context';
22
21
  import BizSelect from '../../select';
@@ -84,8 +83,8 @@ var StringList = function StringList(props) {
84
83
  app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
85
84
  platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
86
85
  limit: 10000,
87
- attr: (attrData === null || attrData === void 0 ? void 0 : attrData.propCategory) === PropCategory.EventProp ? attrData.id : 0,
88
- dimension_sub: (attrData === null || attrData === void 0 ? void 0 : attrData.propCategory) === PropCategory.EventProp ? 'event_attr' : attrData === null || attrData === void 0 ? void 0 : attrData.name,
86
+ attr: (attrData === null || attrData === void 0 ? void 0 : attrData.id) || 0,
87
+ dimension_sub: attrData === null || attrData === void 0 ? void 0 : attrData.dimensionSub,
89
88
  v: ''
90
89
  };
91
90
 
@@ -18,6 +18,7 @@ import userData from '../../mock/user';
18
18
  import { Button } from 'antd';
19
19
  var conditions = [{
20
20
  propCategory: 'userProp',
21
+ attrId: 0,
21
22
  type: 2,
22
23
  operator: 'gt',
23
24
  values: ['25200', '1'],
@@ -29,6 +29,7 @@ export default (function () {
29
29
  values: ['25200', '1'],
30
30
  subtype: 2,
31
31
  attrName: 'duration',
32
+ attrId: 0,
32
33
  category: 'fixed'
33
34
  }
34
35
  }),
@@ -62,18 +62,22 @@ var BizConditionItem = function BizConditionItem(props) {
62
62
  id: data.attrId,
63
63
  propCategory: data.propCategory,
64
64
  type: data.type,
65
- key: data.attrId
65
+ key: data.attrId,
66
+ dimensionSub: data.dimensionSub || 'event_attr'
66
67
  };
67
68
  }
68
69
  } else if (data.propCategory === PropCategory.UserProp || data.propCategory === PropCategory.EnvProp) {
69
70
  if (data.attrName) {
71
+ var aId = data.attrId || 0;
70
72
  attrData = {
73
+ id: aId,
71
74
  name: data.attrName,
72
75
  propCategory: data.propCategory,
73
76
  type: data.type,
74
77
  category: data.category,
75
- key: "".concat(data.propCategory, "-").concat(data.attrName),
76
- subtype: data.subtype
78
+ key: "".concat(data.propCategory, "-").concat(data.dimensionSub || data.attrName, "-").concat(aId),
79
+ subtype: data.subtype,
80
+ dimensionSub: data.dimensionSub || data.attrName
77
81
  };
78
82
  }
79
83
  }
@@ -92,14 +96,16 @@ var BizConditionItem = function BizConditionItem(props) {
92
96
  if (props.onChange) {
93
97
  if (!attr) return;
94
98
  var responseData = {
99
+ attrId: attr.id,
95
100
  propCategory: attr.propCategory,
96
101
  type: attr.type,
97
102
  operator: operate,
98
- values: values || []
103
+ values: values || [],
104
+ dimensionSub: attr.dimensionSub
99
105
  };
100
106
 
101
107
  if (attr.propCategory === PropCategory.EventProp) {
102
- responseData.attrId = attr.id;
108
+ responseData.attrName = attr.label;
103
109
  } else {
104
110
  responseData.attrName = attr.name;
105
111
  responseData.category = attr.category;
@@ -23,7 +23,7 @@
23
23
  }
24
24
 
25
25
  .ant-input {
26
- background-color: @background-color-gray;
26
+ background-color: @background-color-gray !important;
27
27
  }
28
28
 
29
29
  .biz-attr-select-del-icon {
@@ -61,7 +61,7 @@
61
61
 
62
62
  &-input {
63
63
  .ant-input-group-addon {
64
- background-color: @background-color-gray;
64
+ background-color: @background-color-gray !important;
65
65
  border: none;
66
66
  }
67
67
 
@@ -15,6 +15,7 @@ export declare namespace AttrConditionTypes {
15
15
  type?: PropType;
16
16
  propCategory?: 'userProp' | 'eventProp' | 'envProp';
17
17
  category?: 'fixed' | 'custom';
18
+ dimensionSub?: string;
18
19
  operator?: string;
19
20
  values?: string[];
20
21
  }
@@ -144,6 +144,8 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
144
144
 
145
145
  BizAttributeSelector.defaultProps = {
146
146
  enableDelete: false,
147
- placeholder: '请选择'
147
+ placeholder: '请选择',
148
+ propSymbol: '*',
149
+ optionsHeaderTip: '带*的属性每日凌晨更新'
148
150
  };
149
151
  export default BizAttributeSelector;
@@ -166,7 +166,7 @@ var AttrListPanel = function AttrListPanel(props) {
166
166
  return setSearchValue(val);
167
167
  },
168
168
  placeholder: "\u641C\u7D22\u5C5E\u6027"
169
- }), showList.length ? /*#__PURE__*/React.createElement(Anchor, {
169
+ }), showList.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
170
170
  className: "".concat(classPrefix, "-anchor-panel"),
171
171
  affix: false,
172
172
  onClick: function onClick(e) {
@@ -191,7 +191,7 @@ var AttrListPanel = function AttrListPanel(props) {
191
191
  title: /*#__PURE__*/React.createElement(Button, {
192
192
  size: "small"
193
193
  }, "\u89E6\u53D1\u73AF\u5883")
194
- })) : null, /*#__PURE__*/React.createElement("div", {
194
+ }))) : null, /*#__PURE__*/React.createElement("div", {
195
195
  id: anchor.container,
196
196
  className: "".concat(classPrefix, "-container")
197
197
  }, showList.length ? showList : /*#__PURE__*/React.createElement("div", {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { AttributeSelect } from './types';
3
3
  declare const Option: React.FC<{
4
4
  option?: AttributeSelect.Value;
@@ -9,6 +9,7 @@ declare const Option: React.FC<{
9
9
  text: string;
10
10
  color?: string;
11
11
  };
12
+ propSymbol?: ReactNode;
12
13
  checked?: boolean;
13
14
  onClick?: (option: AttributeSelect.Value) => void;
14
15
  }>;
@@ -28,7 +28,7 @@
28
28
  }
29
29
  }
30
30
  &-anchor-panel {
31
- padding: 12px 0 20px 0;
31
+ padding: 12px 0;
32
32
  .ant-anchor {
33
33
  display: flex;
34
34
  flex-direction: row;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export declare enum PropType {
2
3
  STRING = 1,
3
4
  NUMBER = 2,
@@ -23,10 +24,12 @@ export interface EventGroup {
23
24
  eventList: AnalysisEvent[];
24
25
  }
25
26
  export interface BasicProp {
27
+ id: number;
26
28
  label?: string;
27
29
  alias?: string;
28
30
  type?: PropType;
29
31
  realTime?: boolean;
32
+ dimensionSub?: string;
30
33
  }
31
34
  export interface UserProp extends BasicProp {
32
35
  name: string;
@@ -43,7 +46,6 @@ export interface EnvProp extends BasicProp {
43
46
  }
44
47
  export interface EventProp extends BasicProp {
45
48
  eventId?: number;
46
- id: number;
47
49
  propCategory: 'eventProp';
48
50
  key?: number;
49
51
  isHidden?: boolean;
@@ -66,6 +68,8 @@ export declare namespace AttributeSelect {
66
68
  enableUserProp?: boolean;
67
69
  enableEnvProp?: boolean;
68
70
  eventIdList?: number[];
71
+ propSymbol?: ReactNode;
72
+ optionsHeaderTip?: string;
69
73
  onChange?: (value: Value) => void;
70
74
  onDelete?: (value?: Value) => void;
71
75
  }
@@ -28,7 +28,8 @@ export default function convertAttributeData(store) {
28
28
  label: item.attr_name,
29
29
  propCategory: 'eventProp',
30
30
  type: item.prop_type,
31
- realTime: true
31
+ realTime: true,
32
+ dimensionSub: item.dimension_sub || 'event_attr'
32
33
  };
33
34
  }),
34
35
  id: e.event_id,
@@ -42,27 +43,31 @@ export default function convertAttributeData(store) {
42
43
  });
43
44
  res.envPropList = (_store$envPropList = store.envPropList) === null || _store$envPropList === void 0 ? void 0 : _store$envPropList.map(function (prop) {
44
45
  return {
46
+ id: prop.id || 0,
45
47
  alias: prop.alias_name,
46
48
  category: prop.category,
47
- key: "envProp-".concat(prop.name),
49
+ key: "envProp-".concat(prop.dimension_sub, "-").concat(prop.id || 0),
48
50
  label: prop.text,
49
51
  name: prop.name,
50
52
  propCategory: 'envProp',
51
53
  type: prop.type,
52
- realTime: true
54
+ realTime: true,
55
+ dimensionSub: prop.dimension_sub || prop.name
53
56
  };
54
57
  });
55
58
  res.userPropList = (_store$userPropList = store.userPropList) === null || _store$userPropList === void 0 ? void 0 : _store$userPropList.map(function (prop) {
56
59
  return {
60
+ id: prop.id || 0,
57
61
  alias: prop.alias_name,
58
62
  category: prop.category,
59
- key: "userProp-".concat(prop.name),
60
- label: prop.text,
63
+ key: "userProp-".concat(prop.dimension_sub, "-").concat(prop.id || 0),
64
+ label: prop.text || prop.name,
61
65
  name: prop.name,
62
66
  propCategory: 'userProp',
63
67
  type: prop.type,
64
68
  subtype: prop.subtype,
65
- realTime: prop.category === 'custom'
69
+ realTime: prop.category === 'custom',
70
+ dimensionSub: prop.dimension_sub || prop.name
66
71
  };
67
72
  });
68
73
  return res;
@@ -7,7 +7,7 @@ export declare const baseConfig: EChartsOption;
7
7
  export declare const seriesConfig: any;
8
8
  export declare const legendConfig: LegendComponentOption;
9
9
  export declare const gridConfig: {
10
- left: number;
10
+ left: string;
11
11
  right: string;
12
12
  bottom: number;
13
13
  top: number;
@@ -44,7 +44,7 @@ export var legendConfig = {
44
44
  }
45
45
  };
46
46
  export var gridConfig = {
47
- left: 0,
47
+ left: '2%',
48
48
  right: '3%',
49
49
  bottom: 0,
50
50
  top: 24,
@@ -188,7 +188,7 @@ export var getChartOption = function getChartOption(chartType, data) {
188
188
  legend.left = 'left';
189
189
  legend.height = 'auto';
190
190
  legend.width = 50;
191
- grid.left = 80;
191
+ grid.left = '10%';
192
192
  }
193
193
 
194
194
  if (chartType === 'line') {
@@ -230,7 +230,7 @@ export var getPieOption = function getPieOption() {
230
230
  legend.left = 'left';
231
231
  legend.height = 'auto';
232
232
  legend.width = 50;
233
- grid.left = 80;
233
+ grid.left = '10%';
234
234
  }
235
235
 
236
236
  tooltip.trigger = 'item';
@@ -168,7 +168,7 @@ var EventListPanel = function EventListPanel(props) {
168
168
  onChange: function onChange(val) {
169
169
  return setSearchValue(val);
170
170
  },
171
- placeholder: "\u641C\u7D22\u4E8B\u4EF6"
171
+ placeholder: "\u641C\u7D22\u57CB\u70B9\u4E8B\u4EF6"
172
172
  }), /*#__PURE__*/React.createElement("div", {
173
173
  className: "".concat(classPrefix, "-list")
174
174
  }, /*#__PURE__*/React.createElement(InfiniteScroll, {
package/es/mock/user.js CHANGED
@@ -2,9 +2,9 @@ export default [{
2
2
  dimension_sub: 'name',
3
3
  value_dict: false,
4
4
  name: 'name',
5
- id: 0,
5
+ id: 114,
6
6
  text: '名称',
7
- category: 'fixed',
7
+ category: 'custom',
8
8
  type: 1,
9
9
  alias_name: null
10
10
  }, {
@@ -33,9 +33,6 @@ export var normalOptions = [{
33
33
  }, {
34
34
  label: '次数',
35
35
  value: 'times'
36
- }, {
37
- label: '活跃比',
38
- value: 'active_ratio'
39
36
  }, {
40
37
  label: '人均次数',
41
38
  value: 'per'
@@ -72,7 +72,8 @@ var BizEventNameEditBox = function BizEventNameEditBox(props) {
72
72
  className: "".concat(classPrefix, "-footer")
73
73
  }, /*#__PURE__*/React.createElement(Button, {
74
74
  onClick: onCancel,
75
- type: "text"
75
+ type: "text",
76
+ className: "".concat(classPrefix, "-mr8")
76
77
  }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
77
78
  onClick: onClick,
78
79
  type: "primary"
@@ -87,4 +87,8 @@
87
87
  &-footer {
88
88
  text-align: right;
89
89
  }
90
+
91
+ &-mr8 {
92
+ margin-right: @margin-xs;
93
+ }
90
94
  }
package/es/utils/ajax.js CHANGED
@@ -45,7 +45,7 @@ var errorHandler = function errorHandler(error) {
45
45
  return response;
46
46
  };
47
47
 
48
- function responseErrorHandler(url, apiResult) {
48
+ function responseErrorHandler(url, apiResult, errorTitle) {
49
49
  if (/\.jsp/.test(url)) {
50
50
  return apiResult;
51
51
  }
@@ -69,7 +69,7 @@ function responseErrorHandler(url, apiResult) {
69
69
  if (!flag) {
70
70
  message = apiResult.msg || message;
71
71
  notification.error({
72
- message: "\u8BF7\u6C42\u9519\u8BEF",
72
+ message: errorTitle || "\u8BF7\u6C42\u9519\u8BEF",
73
73
  description: message
74
74
  });
75
75
  throw new Error(message);
@@ -131,7 +131,7 @@ function _request() {
131
131
 
132
132
  case 13:
133
133
  res = _context.sent;
134
- return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res)) : responseErrorHandler(url, res));
134
+ return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle));
135
135
 
136
136
  case 17:
137
137
  _context.prev = 17;
@@ -40,6 +40,7 @@ export declare namespace OldSystem {
40
40
  prop_type: PropType;
41
41
  }
42
42
  interface UserProp {
43
+ id: number;
43
44
  alias_name?: string;
44
45
  category: 'fixed' | 'custom';
45
46
  dimension_sub: string;
@@ -75,6 +76,7 @@ export declare class ApiResult<T> implements InterfaceApiResult<T> {
75
76
  constructor(code: ResponseStatus, data: any, message?: string);
76
77
  }
77
78
  export declare type ajaxConfig<T> = RequestOptionsInit & {
79
+ errorTitle?: string;
78
80
  optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
79
81
  url: string;
80
82
  options?: RequestOptionsInit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.13-alpha.0",
3
+ "version": "1.0.13-alpha.1",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -59,5 +59,5 @@
59
59
  "prettier": "^2.2.1",
60
60
  "yorkie": "^2.0.0"
61
61
  },
62
- "gitHead": "f622cd527db39c1afb4bd457edc8457d337478fe"
62
+ "gitHead": "3ae87351c2adf5ca4586f89cd3bb7db2866da0ba"
63
63
  }