@zgfe/business-lib 1.1.69-beta.0 → 1.1.69-beta.2

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.
@@ -1,7 +1,7 @@
1
1
  @import '../../assets/styles/inner.less';
2
2
  .biz-attr-condition {
3
3
  gap: 16px !important;
4
- align-items: flex-start;
4
+ align-items: flex-start !important;
5
5
  width: 100%;
6
6
  &-btn-del {
7
7
  color: #9aa1a9;
@@ -1,8 +1,9 @@
1
1
  import { AttrConditionTypes } from '../../..';
2
2
  import { AnalysisEvent, EventGroup } from '../../../attributeSelector/types';
3
+ import { FormulaTypes } from './types';
3
4
  export declare const leftMenu: {
4
5
  name: string;
5
- value: string;
6
+ value: FormulaTypes;
6
7
  }[];
7
8
  export declare const filterData: AttrConditionTypes.GroupValue;
8
9
  export declare const getEventList: (eventGroupList?: EventGroup[]) => AnalysisEvent[];
@@ -1,12 +1,13 @@
1
+ import { FormulaTypes } from './types';
1
2
  export var leftMenu = [{
2
3
  name: '事件',
3
- value: 'event'
4
+ value: FormulaTypes.EVENT
4
5
  }, {
5
6
  name: '整体',
6
- value: 'whole'
7
+ value: FormulaTypes.WHOLE
7
8
  }, {
8
9
  name: '常数',
9
- value: 'constant'
10
+ value: FormulaTypes.CONSTANT
10
11
  }];
11
12
  export var filterData = {
12
13
  relation: 'and',
@@ -19,12 +19,13 @@ import { BuiltinIndicators } from '../../../constants/common';
19
19
  import { InfiniteScrollList } from '../../../eventSelector/listPanel';
20
20
  import PanelItem from './item';
21
21
  import { validator } from '../formula/util';
22
+ import { FormulaTypes } from './types';
22
23
  import { BizValidatorContext } from '../../../context';
23
24
  export var classPrefix = 'formula-panel';
24
25
  var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
25
26
  var _useContext = useContext(BizGlobalDataContext),
26
27
  eventGroupList = _useContext.eventGroupList;
27
- var _useState = useState('event'),
28
+ var _useState = useState(FormulaTypes.EVENT),
28
29
  _useState2 = _slicedToArray(_useState, 2),
29
30
  type = _useState2[0],
30
31
  setType = _useState2[1];
@@ -57,7 +58,7 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
57
58
  whole: BuiltinIndicators.eventList
58
59
  });
59
60
  setCurrentValue(props.value);
60
- setType(props.value ? props.value.type ? props.value.type : 'constant' : 'event');
61
+ setType(props.value ? getParentType(props.value.type) : FormulaTypes.EVENT);
61
62
  setTimeout(function () {
62
63
  setLoading(false);
63
64
  }, 0);
@@ -65,13 +66,17 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
65
66
  useEffect(function () {
66
67
  props.onChange && props.onChange(currentValue);
67
68
  }, [currentValue]);
69
+ var getParentType = function getParentType(type) {
70
+ if (!type) return FormulaTypes.CONSTANT;
71
+ return type === FormulaTypes.EVENT ? FormulaTypes.EVENT : FormulaTypes.WHOLE;
72
+ };
68
73
  var onClickMenu = function onClickMenu(data) {
69
74
  setType(data);
70
75
  };
71
76
  var onClick = function onClick(data) {
72
77
  setValidateData('');
73
78
  setCurrentValue({
74
- type: type,
79
+ type: data.isBuiltIn ? data.type : type,
75
80
  eventId: data.id,
76
81
  eventName: data.alias || data.name,
77
82
  alias: data.alias || data.name,
@@ -96,7 +101,6 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
96
101
  var onSubmit = function onSubmit() {
97
102
  var conditionType = currentValue && currentValue.type ? currentValue.type : type;
98
103
  var data = validator(conditionType, currentValue);
99
- console.log('submit:', data, conditionType, currentValue);
100
104
  if (!data.isOk) {
101
105
  setValidateData(data.msg);
102
106
  setValidate && setValidate(true);
@@ -119,7 +123,7 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
119
123
  return onClickMenu(item.value);
120
124
  }
121
125
  }, item.name);
122
- })), currentValue && currentValue.eventId && currentValue.type === type ? /*#__PURE__*/React.createElement(PanelItem, {
126
+ })), currentValue && currentValue.eventId && getParentType(currentValue.type) === type ? /*#__PURE__*/React.createElement(PanelItem, {
123
127
  value: currentValue,
124
128
  onBack: function onBack() {
125
129
  return setCurrentValue(null);
@@ -127,10 +131,10 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
127
131
  onChange: onChangeFilter
128
132
  }) : /*#__PURE__*/React.createElement("div", {
129
133
  className: "".concat(classPrefix, "-right")
130
- }, type === 'event' && allList[type] && allList[type].length ? /*#__PURE__*/React.createElement(BizSearchInput, {
134
+ }, type === FormulaTypes.EVENT && allList[type] && allList[type].length ? /*#__PURE__*/React.createElement(BizSearchInput, {
131
135
  className: "".concat(classPrefix, "-right-search"),
132
136
  onChange: setSearchValue
133
- }) : null, type === 'constant' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputNumber, {
137
+ }) : null, type === FormulaTypes.CONSTANT ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputNumber, {
134
138
  className: "".concat(classPrefix, "-right-number"),
135
139
  value: typeof currentValue === 'string' || typeof currentValue === 'number' ? Number(currentValue) : undefined,
136
140
  min: 0,
@@ -47,7 +47,7 @@
47
47
  .__select-option();
48
48
  }
49
49
 
50
- &-number {
50
+ &-number.ant-input-number {
51
51
  min-width: 184px;
52
52
  background-color: @background-color-base;
53
53
  border: 1px solid @background-color-base;
@@ -11,3 +11,8 @@ export interface PanelItemProps {
11
11
  onBack?: () => void;
12
12
  onChange?: (dimension: TargetConditionTypes.DimensionValue, filters?: AttrConditionTypes.GroupValue) => void;
13
13
  }
14
+ export declare enum FormulaTypes {
15
+ EVENT = "event",
16
+ WHOLE = "whole",
17
+ CONSTANT = "constant"
18
+ }
@@ -1 +1,6 @@
1
- export {};
1
+ export var FormulaTypes;
2
+ (function (FormulaTypes) {
3
+ FormulaTypes["EVENT"] = "event";
4
+ FormulaTypes["WHOLE"] = "whole";
5
+ FormulaTypes["CONSTANT"] = "constant";
6
+ })(FormulaTypes || (FormulaTypes = {}));
@@ -24,11 +24,12 @@ var defaultValue = {
24
24
  eventName: '自定义指标'
25
25
  };
26
26
  var BizFormulaTarget = function BizFormulaTarget(props) {
27
+ var _props$value;
27
28
  var _useState = useState(false),
28
29
  _useState2 = _slicedToArray(_useState, 2),
29
30
  isEdit = _useState2[0],
30
31
  setIsEdit = _useState2[1];
31
- var _useState3 = useState(),
32
+ var _useState3 = useState(((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.eventName) || defaultValue.eventName),
32
33
  _useState4 = _slicedToArray(_useState3, 2),
33
34
  temporaryName = _useState4[0],
34
35
  setTemporaryName = _useState4[1];
@@ -85,7 +86,7 @@ var BizFormulaTarget = function BizFormulaTarget(props) {
85
86
  return flag;
86
87
  };
87
88
  var onCancelChangeName = function onCancelChangeName() {
88
- setTemporaryName(condition === null || condition === void 0 ? void 0 : condition.eventName);
89
+ setTemporaryName((condition === null || condition === void 0 ? void 0 : condition.eventName) || defaultValue.eventName);
89
90
  setIsEdit(false);
90
91
  setNameError('');
91
92
  };
@@ -76,7 +76,8 @@ export default (function () {
76
76
  }, "Submit")))));
77
77
  return /*#__PURE__*/React.createElement("div", {
78
78
  style: {
79
- boxShadow: '0px 4px 10px 0px rgba(0, 0, 0, 0.10)'
79
+ boxShadow: '0px 4px 10px 0px rgba(0, 0, 0, 0.10)',
80
+ background: '#fafafb'
80
81
  }
81
82
  }, /*#__PURE__*/React.createElement(BizLayout, {
82
83
  title: "\u6D1E\u5BDF",
@@ -27,6 +27,8 @@ var BizLayout = function BizLayout(props) {
27
27
  className: "".concat(classPrefix, "-title")
28
28
  }, props.title) : null, /*#__PURE__*/React.createElement("div", {
29
29
  className: "".concat(classPrefix, "-top")
30
+ }, /*#__PURE__*/React.createElement("div", {
31
+ className: "".concat(classPrefix, "-top-container")
30
32
  }, /*#__PURE__*/React.createElement("div", {
31
33
  ref: collapseRef
32
34
  }, props.topPanel), props.hasCollapse ? /*#__PURE__*/React.createElement("div", {
@@ -35,7 +37,7 @@ var BizLayout = function BizLayout(props) {
35
37
  }, /*#__PURE__*/React.createElement(IconFont, {
36
38
  className: isOpen ? 'transform180' : '',
37
39
  type: "xiangxia"
38
- }), ' ', /*#__PURE__*/React.createElement("span", null, isOpen ? '收起' : '展开')) : null), /*#__PURE__*/React.createElement("div", {
40
+ }), ' ', /*#__PURE__*/React.createElement("span", null, isOpen ? '收起' : '展开')) : null)), /*#__PURE__*/React.createElement("div", {
39
41
  className: "".concat(classPrefix, "-content")
40
42
  }, props.children));
41
43
  };
@@ -1,7 +1,6 @@
1
1
  @import '../../assets/styles/inner.less';
2
2
 
3
3
  .biz-layout {
4
- background: #fafafb;
5
4
  &-title {
6
5
  display: flex;
7
6
  align-items: center;
@@ -15,11 +14,14 @@
15
14
  }
16
15
 
17
16
  &-top {
18
- margin: 16px 24px;
19
- padding-top: 24px;
20
- background-color: #fff;
21
- border: 1px solid #ecedf0;
22
- border-radius: 8px;
17
+ padding: 16px 24px;
18
+ background: #fafafb;
19
+ &-container {
20
+ padding-top: 24px;
21
+ background-color: #fff;
22
+ border: 1px solid #ecedf0;
23
+ border-radius: 8px;
24
+ }
23
25
  }
24
26
 
25
27
  &-collapse-handle {
@@ -21,4 +21,10 @@
21
21
  .__default-hover();
22
22
  }
23
23
  }
24
+
25
+ &-content {
26
+ width: 100%;
27
+ height: 100%;
28
+ overflow: auto;
29
+ }
24
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.69-beta.0",
3
+ "version": "1.1.69-beta.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.12.0 || ^17.0.0",
61
61
  "yorkie": "^2.0.0"
62
62
  },
63
- "gitHead": "f6fb9c2f96cbb4c40941f97b66330f9dc3fffd95"
63
+ "gitHead": "e93527cb913d4800234df4c963a21bdeb8195a79"
64
64
  }