@zgfe/modules-attribution 1.0.2-alpha.0 → 1.0.2-alpha.10

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.
@@ -50,7 +50,7 @@ var OptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
50
50
  panel: {
51
51
  id: panelId
52
52
  },
53
- name: panelName ? panelName + '(1)' : '归因分析'
53
+ name: panelName ? panelName + '(1)' : '归因'
54
54
  };
55
55
  setPanelValue(item);
56
56
  setShowPanelDialog(true);
@@ -1,5 +1,8 @@
1
1
  .table-list {
2
2
  margin-top: 25px;
3
+ .ant-table-wrapper{
4
+ margin-bottom: 40px;
5
+ }
3
6
  &-empty-tips {
4
7
  margin-top: 112px;
5
8
  text-align: center;
@@ -182,7 +182,7 @@ var EditTitle = function EditTitle(props) {
182
182
  }, "\u4FDD\u5B58")));
183
183
  };
184
184
  EditTitle.defaultProps = {
185
- title: '归因分析',
185
+ title: '归因',
186
186
  type: 'edit'
187
187
  };
188
188
  export default EditTitle;
@@ -5,3 +5,7 @@ export declare const chartTypes: {
5
5
  value: string;
6
6
  }[];
7
7
  export declare const searchFields: SearchPanelTypes.FieldProp[];
8
+ export declare const attributionTypeTooltips: {
9
+ text: string;
10
+ title: string;
11
+ }[];
@@ -29,4 +29,17 @@ export var searchFields = [{
29
29
  max: 5,
30
30
  addLabel: '添加属性',
31
31
  required: false
32
+ }];
33
+ export var attributionTypeTooltips = [{
34
+ text: '首次触点归因',
35
+ title: '完成目标事件的「待归因事件」中,第一个「待归因事件」贡献为100%'
36
+ }, {
37
+ text: '末次触点归因',
38
+ title: '完成目标事件的「待归因事件」中,最后一个「待归因事件」贡献为100%'
39
+ }, {
40
+ text: '线性归因',
41
+ title: '完成目标事件的「待归因事件」中,所有「待归因事件」平均分配贡献'
42
+ }, {
43
+ text: '位置归因',
44
+ title: '完成目标事件的「待归因事件」中,首位和末位「待归因事件」各获40%贡献,其余「待归因事件」平分20%贡献'
32
45
  }];
@@ -106,6 +106,8 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
106
106
  };
107
107
  return /*#__PURE__*/React.createElement("div", {
108
108
  className: classPrefix
109
+ }, /*#__PURE__*/React.createElement("div", {
110
+ className: "".concat(classPrefix, "-top-content")
109
111
  }, /*#__PURE__*/React.createElement("div", {
110
112
  className: "".concat(classPrefix, "-top-content-box")
111
113
  }, /*#__PURE__*/React.createElement(SearchPanel, {
@@ -113,7 +115,7 @@ var AttributionContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
113
115
  defaultValue: searchData,
114
116
  onChange: onChangeSearch,
115
117
  resetTime: resetTime
116
- })), /*#__PURE__*/React.createElement("div", {
118
+ }))), /*#__PURE__*/React.createElement("div", {
117
119
  className: "".concat(classPrefix, "-bottom-content-box")
118
120
  }, /*#__PURE__*/React.createElement("div", {
119
121
  className: "".concat(classPrefix, "-bottom-content-box-times")
@@ -118,7 +118,7 @@ var AttributionHome = function AttributionHome(props) {
118
118
  onEditTitle: setTitle
119
119
  }), !panelId && /*#__PURE__*/React.createElement("div", {
120
120
  className: "".concat(classPrefix, "-header-title")
121
- }, "\u5F52\u56E0\u5206\u6790"), /*#__PURE__*/React.createElement("div", {
121
+ }, "\u5F52\u56E0"), /*#__PURE__*/React.createElement("div", {
122
122
  className: "".concat(classPrefix, "-content ").concat(panelId ? classPrefix + '-content2' : '')
123
123
  }, /*#__PURE__*/React.createElement(AttributionContent, {
124
124
  ref: attributionRef,
@@ -14,20 +14,24 @@
14
14
  font-weight: 500;
15
15
  font-size: 16px;
16
16
  line-height: 48px;
17
- border-bottom: 1px solid #f2f3f4;
18
17
  }
19
18
  &-content {
20
19
  width: 100%;
21
20
  height: 100%;
22
21
  // overflow: auto;
23
22
  overflow-x: hidden;
24
- background: #fafafb;
23
+ background: #fff;
25
24
  border-top: 1px solid #eaeaea;
26
25
  .attribution-content {
27
- &-top-content-box {
28
- margin: 16px 24px;
29
- padding: 24px;
30
- background: #fff;
26
+ &-top-content {
27
+ background: #fafafb;
28
+ padding: 16px 24px;
29
+ &-box{
30
+ padding: 24px;
31
+ background: #fff;
32
+ border: 1px solid #ECEDF0;
33
+ border-radius: 8px;
34
+ }
31
35
  }
32
36
  &-bottom-content-box {
33
37
  min-height: 382px;
@@ -11,6 +11,7 @@ import _ from 'lodash';
11
11
  import { Tooltip, message } from 'antd';
12
12
  var AttributableEvents = function AttributableEvents(props) {
13
13
  var value = props.value,
14
+ fieldsLength = props.fieldsLength,
14
15
  setMincePropCount = props.setMincePropCount,
15
16
  mincePropCount = props.mincePropCount,
16
17
  attrSourceCount = props.attrSourceCount,
@@ -38,17 +39,21 @@ var AttributableEvents = function AttributableEvents(props) {
38
39
  setCount = _useState8[1];
39
40
  var _useState9 = useState(false),
40
41
  _useState10 = _slicedToArray(_useState9, 2),
41
- isAdd = _useState10[0],
42
- setIsAdd = _useState10[1];
43
- var conditionRef = useRef(null);
44
- var _useState11 = useState(-1),
42
+ countLoading = _useState10[0],
43
+ setCountLoading = _useState10[1];
44
+ var _useState11 = useState(false),
45
45
  _useState12 = _slicedToArray(_useState11, 2),
46
- eventId = _useState12[0],
47
- setEventId = _useState12[1];
48
- var _useState13 = useState(),
46
+ isAdd = _useState12[0],
47
+ setIsAdd = _useState12[1];
48
+ var conditionRef = useRef(null);
49
+ var _useState13 = useState(-1),
49
50
  _useState14 = _slicedToArray(_useState13, 2),
50
- minceAttr = _useState14[0],
51
- setMinceAttr = _useState14[1];
51
+ eventId = _useState14[0],
52
+ setEventId = _useState14[1];
53
+ var _useState15 = useState(),
54
+ _useState16 = _slicedToArray(_useState15, 2),
55
+ minceAttr = _useState16[0],
56
+ setMinceAttr = _useState16[1];
52
57
  var bizEventSelectorDefaultValue = {};
53
58
  if (value && value.eventId && value.eventId != -100) {
54
59
  bizEventSelectorDefaultValue = {
@@ -58,10 +63,10 @@ var AttributableEvents = function AttributableEvents(props) {
58
63
  }
59
64
  };
60
65
  }
61
- var _useState15 = useState(),
62
- _useState16 = _slicedToArray(_useState15, 2),
63
- bizAttributeSelectorValue = _useState16[0],
64
- setBizAttributeSelectorValue = _useState16[1];
66
+ var _useState17 = useState(),
67
+ _useState18 = _slicedToArray(_useState17, 2),
68
+ bizAttributeSelectorValue = _useState18[0],
69
+ setBizAttributeSelectorValue = _useState18[1];
65
70
  useEffect(function () {
66
71
  if (value) {
67
72
  var _value$filters;
@@ -91,16 +96,19 @@ var AttributableEvents = function AttributableEvents(props) {
91
96
  }
92
97
  }, []);
93
98
  useEffect(function () {
99
+ setCountLoading(false);
94
100
  if (ReasonData) {
95
101
  handleCount('add', attrSourceCount, setAttrSourceCount, count);
96
102
  }
97
- setTimeout(function () {
98
- onChangeHandle(ReasonData, filters, minceAttr);
99
- }, 0);
100
103
  }, [count]);
101
104
  var onEventDelete = function onEventDelete() {
102
105
  if (formData && formData.sourceFilters.length <= 1) {
103
- message.error('至少保留一个待归因事件');
106
+ setReasonData(undefined);
107
+ setAttrSelectShow(false);
108
+ setFilters(undefined);
109
+ setIsAdd(false);
110
+ setBizAttributeSelectorValue(undefined);
111
+ onChangeHandle(undefined, undefined, undefined);
104
112
  return;
105
113
  }
106
114
  if (ReasonData) {
@@ -133,6 +141,10 @@ var AttributableEvents = function AttributableEvents(props) {
133
141
  message.error('最多可添加5条属性筛选');
134
142
  return;
135
143
  }
144
+ if (countLoading) {
145
+ return;
146
+ }
147
+ setCountLoading(true);
136
148
  setIsAdd(true);
137
149
  setTimeout(function () {
138
150
  conditionRef.current.add();
@@ -189,7 +201,11 @@ var AttributableEvents = function AttributableEvents(props) {
189
201
  var onChangeHandle = function onChangeHandle(reason, filterData, minceAttr) {
190
202
  if (props.onChange) {
191
203
  var _reason$event2;
192
- if (!reason || !reason.event || !((_reason$event2 = reason.event) === null || _reason$event2 === void 0 ? void 0 : _reason$event2.id)) return;
204
+ if (!reason || !reason.event || !((_reason$event2 = reason.event) === null || _reason$event2 === void 0 ? void 0 : _reason$event2.id)) {
205
+ props.onChange(undefined);
206
+ return;
207
+ }
208
+ ;
193
209
  var event = reason.event;
194
210
  var data = {
195
211
  eventId: event === null || event === void 0 ? void 0 : event.id,
@@ -200,10 +216,10 @@ var AttributableEvents = function AttributableEvents(props) {
200
216
  props.onChange(data);
201
217
  }
202
218
  };
203
- var _useState17 = useState(null),
204
- _useState18 = _slicedToArray(_useState17, 2),
205
- notClickable = _useState18[0],
206
- setNotClickable = _useState18[1];
219
+ var _useState19 = useState(null),
220
+ _useState20 = _slicedToArray(_useState19, 2),
221
+ notClickable = _useState20[0],
222
+ setNotClickable = _useState20[1];
207
223
  useEffect(function () {
208
224
  var _ReasonData$event;
209
225
  if (ReasonData === undefined || (ReasonData === null || ReasonData === void 0 ? void 0 : (_ReasonData$event = ReasonData.event) === null || _ReasonData$event === void 0 ? void 0 : _ReasonData$event.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0) {
@@ -222,7 +238,7 @@ var AttributableEvents = function AttributableEvents(props) {
222
238
  popupContainer: false,
223
239
  defaultSelectAble: false,
224
240
  onChange: onChangeReason,
225
- defaultValue: bizEventSelectorDefaultValue,
241
+ value: bizEventSelectorDefaultValue,
226
242
  selectList: eventIdList,
227
243
  placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
228
244
  }), attrSelectShow && /*#__PURE__*/React.createElement(BizAttributeSelector, {
@@ -239,7 +255,7 @@ var AttributableEvents = function AttributableEvents(props) {
239
255
  }
240
256
  }), /*#__PURE__*/React.createElement("div", {
241
257
  className: "button-box"
242
- }, notClickable === false && /*#__PURE__*/React.createElement(IconFont, {
258
+ }, (notClickable === false || fieldsLength && fieldsLength > 1) && /*#__PURE__*/React.createElement(IconFont, {
243
259
  type: "qingchu",
244
260
  onClick: onEventDelete
245
261
  }), /*#__PURE__*/React.createElement(Tooltip, {
@@ -258,7 +274,9 @@ var AttributableEvents = function AttributableEvents(props) {
258
274
  onClick: function onClick() {
259
275
  return onAdd();
260
276
  }
261
- })))), /*#__PURE__*/React.createElement("div", null, (filters || isAdd) && /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
277
+ })))), /*#__PURE__*/React.createElement("div", null, (filters || isAdd) && /*#__PURE__*/React.createElement("div", {
278
+ className: "".concat(count > 0 ? 'attr-box-show' : '')
279
+ }, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
262
280
  ref: conditionRef,
263
281
  value: filters,
264
282
  onlyAnd: true,
@@ -267,6 +285,6 @@ var AttributableEvents = function AttributableEvents(props) {
267
285
  eventIdList: [eventId],
268
286
  onChange: onChangeFilters,
269
287
  onConditionsCount: setCount
270
- })));
288
+ }))));
271
289
  };
272
290
  export default AttributableEvents;
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { BizAttrConditionGroup, IconFont } from '@zgfe/business-lib';
8
8
  import React, { useEffect, useRef, useState } from 'react';
9
9
  var GlobalAttribute = function GlobalAttribute(props) {
10
- var classPrefix = 'mi-left-form';
10
+ var classPrefix = 'form-box';
11
11
  var max = props.max,
12
12
  onChange = props.onChange,
13
13
  setAttrGlobalCount = props.setAttrGlobalCount;
@@ -33,13 +33,15 @@ var GlobalAttribute = function GlobalAttribute(props) {
33
33
  }
34
34
  }, [props.eventIdList, props.value]);
35
35
  var onAdd = function onAdd() {
36
- if (props.eventIdList[0] === -100) return;
36
+ if (props.eventIdList && props.eventIdList.length <= 0 || props.eventIdList[0] === -100) return;
37
37
  conditionRef.current.add();
38
38
  };
39
39
  useEffect(function () {
40
40
  setAttrGlobalCount(count);
41
41
  }, [count]);
42
- return /*#__PURE__*/React.createElement("div", null, props.eventIdList && props.eventIdList[0] === -100 ? '' : /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
42
+ return /*#__PURE__*/React.createElement("div", null, props.eventIdList && props.eventIdList[0] === -100 ? '' : /*#__PURE__*/React.createElement("div", {
43
+ className: "".concat(count > 0 ? 'attr-box-show' : '')
44
+ }, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
43
45
  ref: conditionRef,
44
46
  value: props.value,
45
47
  onlyAnd: true,
@@ -48,7 +50,7 @@ var GlobalAttribute = function GlobalAttribute(props) {
48
50
  eventIdList: props.eventIdList,
49
51
  onChange: onChange,
50
52
  onConditionsCount: setCount
51
- }), count < max && /*#__PURE__*/React.createElement("div", {
53
+ })), count < max && /*#__PURE__*/React.createElement("div", {
52
54
  className: "".concat(classPrefix, "-add ").concat(props.eventIdList && props.eventIdList.length <= 0 ? 'disabled' : ''),
53
55
  onClick: onAdd
54
56
  }, /*#__PURE__*/React.createElement(IconFont, {
@@ -66,7 +66,6 @@ var TargetEvent = function TargetEvent(props) {
66
66
  };
67
67
  var onAdd = function onAdd() {
68
68
  var _targetData$event;
69
- console.log('添加筛选', targetData, bizEventSelectorDefaultValue);
70
69
  if ((targetData === null || targetData === void 0 ? void 0 : (_targetData$event = targetData.event) === null || _targetData$event === void 0 ? void 0 : _targetData$event.id) === -100 && Object.keys(bizEventSelectorDefaultValue).length <= 0) {
71
70
  message.error('请先选择目标事件');
72
71
  return;
@@ -93,9 +92,6 @@ var TargetEvent = function TargetEvent(props) {
93
92
  };
94
93
  useEffect(function () {
95
94
  setAttrTargetCount(count);
96
- setTimeout(function () {
97
- onChangeHandle(targetData, filters);
98
- }, 0);
99
95
  }, [count]);
100
96
  var onChangeHandle = function onChangeHandle(reason, filterData) {
101
97
  if (props.onChange) {
@@ -147,7 +143,9 @@ var TargetEvent = function TargetEvent(props) {
147
143
  onClick: function onClick() {
148
144
  return onAdd();
149
145
  }
150
- }))), /*#__PURE__*/React.createElement("div", null, (filters || isAdd) && /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
146
+ }))), /*#__PURE__*/React.createElement("div", null, (filters || isAdd) && /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(count > 0 ? 'attr-box-show' : '')
148
+ }, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
151
149
  ref: conditionRef,
152
150
  value: undefined,
153
151
  onlyAnd: true,
@@ -156,6 +154,6 @@ var TargetEvent = function TargetEvent(props) {
156
154
  eventIdList: [eventId],
157
155
  onChange: onChangeFilters,
158
156
  onConditionsCount: setCount
159
- })));
157
+ }))));
160
158
  };
161
159
  export default TargetEvent;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SearchPanelTypes } from './types';
3
3
  import './styles/index.less';
4
- export declare const classPrefix = "mi-left-form";
4
+ export declare const classPrefix = "form-box";
5
5
  declare const SearchPanel: React.ForwardRefExoticComponent<SearchPanelTypes.Props & React.RefAttributes<any>>;
6
6
  export default SearchPanel;
@@ -16,9 +16,9 @@ import GlobalAttribute from './components/globalAttribute';
16
16
  import './styles/index.less';
17
17
  import _ from 'lodash';
18
18
  import { targetChangeCallback, operableOrNotHandle } from './utils';
19
- import { searchFields } from '../../constants/fields';
19
+ import { searchFields, attributionTypeTooltips } from '../../constants/fields';
20
20
  import { AttributableContext } from '../../types';
21
- export var classPrefix = 'mi-left-form';
21
+ export var classPrefix = 'form-box';
22
22
  var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
23
23
  var defaultValue = props.defaultValue,
24
24
  resetTime = props.resetTime;
@@ -173,9 +173,21 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
173
173
  _useState24 = _slicedToArray(_useState23, 2),
174
174
  windowType = _useState24[0],
175
175
  setWindowType = _useState24[1];
176
+ var attributionTypeTooltip = function attributionTypeTooltip(type) {
177
+ return /*#__PURE__*/React.createElement(Tooltip, {
178
+ overlayClassName: "attribution-type-tooltip ".concat(type === 2 || type === 3 ? 'attribution-type-tooltip-distance' : ''),
179
+ placement: "right",
180
+ getPopupContainer: function getPopupContainer() {
181
+ return document.getElementById('attribution-type');
182
+ },
183
+ title: attributionTypeTooltips[type].title
184
+ }, /*#__PURE__*/React.createElement("p", null, attributionTypeTooltips[type].text));
185
+ };
176
186
  return /*#__PURE__*/React.createElement("div", {
177
187
  className: classPrefix
178
- }, /*#__PURE__*/React.createElement(Skeleton, {
188
+ }, /*#__PURE__*/React.createElement("p", {
189
+ className: "".concat(classPrefix, "-bottom-form-title")
190
+ }, "\u9009\u62E9\u4E8B\u4EF6"), /*#__PURE__*/React.createElement(Skeleton, {
179
191
  loading: loading,
180
192
  active: true,
181
193
  paragraph: {
@@ -189,9 +201,10 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
189
201
  }, searchFields.map(function (item) {
190
202
  if (item.type === 'globalFilters') {
191
203
  return /*#__PURE__*/React.createElement(Form.Item, {
192
- key: item.key
204
+ key: item.key,
205
+ className: "".concat(classPrefix, "-form-item")
193
206
  }, /*#__PURE__*/React.createElement(Form.Item, {
194
- className: "".concat(classPrefix, "-title")
207
+ className: "".concat(classPrefix, "-title global-attr")
195
208
  }, item.label), /*#__PURE__*/React.createElement(Form.Item, {
196
209
  className: "".concat(classPrefix, "-item"),
197
210
  name: item.name
@@ -208,6 +221,7 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
208
221
  var add = _ref.add,
209
222
  remove = _ref.remove;
210
223
  return /*#__PURE__*/React.createElement(Form.Item, {
224
+ className: "".concat(classPrefix, "-form-item"),
211
225
  key: "".concat(item.key, "-item-").concat(index)
212
226
  }, /*#__PURE__*/React.createElement(Form.Item, {
213
227
  className: "".concat(classPrefix, "-title")
@@ -216,7 +230,7 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
216
230
  color: 'red'
217
231
  }
218
232
  }, "* "), item.label, /*#__PURE__*/React.createElement(Tooltip, {
219
- placement: "left",
233
+ placement: "right",
220
234
  title: item.tips
221
235
  }, /*#__PURE__*/React.createElement(IconFont, {
222
236
  type: "tishiicon"
@@ -225,6 +239,7 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
225
239
  key: field.key,
226
240
  className: "".concat(classPrefix, "-item")
227
241
  }), /*#__PURE__*/React.createElement(SearchContent, {
242
+ fieldsLength: fields.length,
228
243
  type: item.type,
229
244
  key: field.key,
230
245
  eventIdList: eventIdList,
@@ -265,7 +280,8 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
265
280
  color: 'red'
266
281
  }
267
282
  }, "* "), "\u5F52\u56E0\u6A21\u578B"), /*#__PURE__*/React.createElement("div", {
268
- className: "".concat(classPrefix, "-bottom-form")
283
+ className: "".concat(classPrefix, "-bottom-form"),
284
+ id: "attribution-type"
269
285
  }, /*#__PURE__*/React.createElement("p", {
270
286
  className: "p"
271
287
  }, "\u5206\u6790\u6A21\u578B"), /*#__PURE__*/React.createElement(Form.Item, {
@@ -275,23 +291,32 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
275
291
  message: '请选择分析模型'
276
292
  }]
277
293
  }, /*#__PURE__*/React.createElement(Select, {
278
- className: "attributionType",
294
+ className: "attribution-type",
295
+ getPopupContainer: function getPopupContainer() {
296
+ return document.getElementById('attribution-type');
297
+ },
279
298
  placeholder: "\u8BF7\u9009\u62E9",
280
299
  style: {
281
300
  width: 208
282
301
  },
302
+ suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
303
+ type: "xiangxia",
304
+ style: {
305
+ color: '#021429'
306
+ }
307
+ }),
283
308
  options: [{
284
309
  value: 1,
285
- label: '首次触点归因'
310
+ label: attributionTypeTooltip(0)
286
311
  }, {
287
312
  value: 2,
288
- label: '末次触点归因'
313
+ label: attributionTypeTooltip(1)
289
314
  }, {
290
315
  value: 3,
291
- label: '线性归因'
316
+ label: attributionTypeTooltip(2)
292
317
  }, {
293
318
  value: 4,
294
- label: '位置归因'
319
+ label: attributionTypeTooltip(3)
295
320
  }]
296
321
  })), /*#__PURE__*/React.createElement("p", {
297
322
  className: "p"
@@ -306,6 +331,12 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
306
331
  style: {
307
332
  width: 208
308
333
  },
334
+ suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
335
+ type: "xiangxia",
336
+ style: {
337
+ color: '#021429'
338
+ }
339
+ }),
309
340
  onChange: function onChange(e) {
310
341
  setWindowType(e);
311
342
  e === 1 ? setWindowCnt(-1) : setWindowCnt(1);
@@ -337,6 +368,12 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
337
368
  onChange: function onChange(e) {
338
369
  return setwindowTypeUnit(e);
339
370
  },
371
+ suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
372
+ type: "xiangxia",
373
+ style: {
374
+ color: '#021429'
375
+ }
376
+ }),
340
377
  options: [{
341
378
  value: 'day',
342
379
  label: '天'
@@ -356,6 +393,6 @@ var SearchPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
356
393
  onClick: function onClick() {
357
394
  return onFinish(true);
358
395
  }
359
- }, "\u63D0\u4EA4")))));
396
+ }, "\u67E5\u8BE2")))));
360
397
  });
361
398
  export default SearchPanel;
@@ -1,6 +1,16 @@
1
1
  @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
2
 
3
- .mi-left-form {
3
+ .form-box {
4
+ .xiangxia {
5
+ font-size: 14px !important;
6
+ }
7
+ &-form-item {
8
+ margin-bottom: 16px;
9
+ .attr-box-show {
10
+ margin: 12px 0px;
11
+ }
12
+ }
13
+
4
14
  &-bottom-form-title {
5
15
  margin-top: 34px;
6
16
  margin-bottom: 16px;
@@ -23,13 +33,29 @@
23
33
  color: #9aa1a9;
24
34
  }
25
35
  }
26
- .attributionType {
36
+ .attribution-type {
27
37
  margin-right: 24px;
28
38
  }
29
39
  .windowCnt {
30
40
  margin: 0 16px;
31
41
  }
32
42
  }
43
+
44
+ #attribution-type{
45
+ position: relative;
46
+ .ant-select-dropdown{
47
+ z-index: 998;
48
+ }
49
+ .attribution-type-tooltip {
50
+ z-index: 999;
51
+ right: 0px!important;
52
+ // left: 200px!important;
53
+ &-distance{
54
+ // left: 170px!important;
55
+ }
56
+ }
57
+ }
58
+
33
59
  &-otherEvent {
34
60
  color: #021429;
35
61
  font-size: 14px;
@@ -71,13 +97,12 @@
71
97
  }
72
98
 
73
99
  &-item.ant-form-item {
74
- margin-bottom: 12px;
100
+ margin-bottom: 0px;
75
101
  }
76
102
 
77
103
  &-add {
78
104
  width: fit-content;
79
105
  height: 20px;
80
- margin-top: 8px;
81
106
  color: #165dff;
82
107
  font-size: 14px;
83
108
  line-height: 20px;
@@ -97,6 +122,10 @@
97
122
  }
98
123
  }
99
124
 
125
+ .global-attr {
126
+ margin-bottom: 0 !important;
127
+ }
128
+
100
129
  .biz-condition-item-input {
101
130
  border-color: transparent;
102
131
  }
@@ -128,18 +157,13 @@
128
157
  right: 40px;
129
158
  }
130
159
  }
131
- // .biz-attr-select-handle:hover{
132
- // .xiangxia{
133
- // display: none;
134
- // }
135
- // }
136
160
  }
137
161
  .button-box {
138
162
  .qingchu,
139
163
  .tianjia2,
140
164
  .shaixuan {
141
165
  margin-top: 2px;
142
- margin-right: 20px;
166
+ margin-right: 16px;
143
167
  // color: #CCD0D4;
144
168
  color: #9aa1a9;
145
169
  font-size: 20px !important;
@@ -162,7 +186,6 @@
162
186
  .target-events-box {
163
187
  .selector-content {
164
188
  display: flex;
165
- margin-bottom: 12px;
166
189
  .ant-dropdown-trigger {
167
190
  width: 208px;
168
191
  margin-right: 16px;
@@ -175,7 +198,7 @@
175
198
  }
176
199
  }
177
200
  .shaixuan {
178
- margin: 2px 0 0 20px;
201
+ margin: 2px 0 0 16px;
179
202
  color: #9aa1a9;
180
203
  font-size: 20px !important;
181
204
  cursor: pointer;
@@ -199,4 +222,4 @@
199
222
  margin-top: -14px;
200
223
  color: #fb5547;
201
224
  }
202
- }
225
+ }
@@ -18,8 +18,9 @@ export declare namespace SearchPanelTypes {
18
18
  interface PanelProp {
19
19
  type: string;
20
20
  value?: FiltersProps;
21
+ fieldsLength?: number;
21
22
  eventIdList?: number[];
22
- onChange?: (data: FiltersProps) => void;
23
+ onChange?: (data: FiltersProps | undefined) => void;
23
24
  onDelete: () => void;
24
25
  formData: SearchValueProps;
25
26
  setAttrTargetCount: Function;
@@ -39,50 +39,43 @@ var judgeAttrInEvents = function judgeAttrInEvents(elds, attrId, eventGroupList)
39
39
  return flag;
40
40
  };
41
41
  export function operableOrNotHandle(data, attrSourceCount, attrTargetCount, mincePropCount, attrGlobalCount) {
42
- var flag = false;
43
- data.attributionType === undefined ? flag = true : null;
44
- if (subsetHandle(data, 'sourceFilters', attrSourceCount, mincePropCount)) flag = true;
45
- if (subsetHandle(data, 'targetFilters', attrTargetCount)) flag = true;
46
- if (attrGlobalCount && data.globalFilters === undefined) flag = true;
47
- if (data.globalFilters && conditionsHandle('globalFilters', data.globalFilters, attrGlobalCount, 0)) {
48
- flag = true;
49
- }
50
- return flag;
42
+ var flagList = [];
43
+ if (data.attributionType === undefined) return true;
44
+ subsetHandle(flagList, data, 'sourceFilters', attrSourceCount, mincePropCount);
45
+ subsetHandle(flagList, data, 'targetFilters', attrTargetCount);
46
+ if (attrGlobalCount && data.globalFilters === undefined) return true;
47
+ data.globalFilters && conditionsHandle('globalFilters', data.globalFilters, attrGlobalCount, 0, flagList);
48
+ return flagList.indexOf(true) !== -1;
51
49
  }
52
- var subsetHandle = function subsetHandle(data, type, count, mincePropCount) {
53
- var flag = false;
50
+ var subsetHandle = function subsetHandle(flagList, data, type, count, mincePropCount) {
54
51
  data[type].map(function (item) {
55
- item === undefined ? flag = true : null;
52
+ item === undefined ? flagList.push(true) : null;
56
53
  if (item !== undefined) {
57
- var _item$filters;
58
- (item === null || item === void 0 ? void 0 : item.eventId) === -100 ? flag = true : null;
54
+ (item === null || item === void 0 ? void 0 : item.eventId) === -100 ? flagList.push(true) : null;
59
55
  if (type === 'targetFilters') {
60
- item.filters === undefined && count != 0 ? flag = true : null;
56
+ item.filters === undefined && count != 0 ? flagList.push(true) : null;
61
57
  } else {
62
- item.filters === undefined && Object.keys(count).length > 0 && count[item.eventId] !== undefined ? flag = true : null;
58
+ item.filters === undefined && Object.keys(count).length > 0 && count[item.eventId] !== undefined ? flagList.push(true) : null;
63
59
  if (mincePropCount != undefined) {
64
- item.attributionSubdivision === undefined && Object.keys(mincePropCount).length > 0 && mincePropCount[item.eventId] !== undefined ? flag = true : null;
60
+ item.attributionSubdivision === undefined && Object.keys(mincePropCount).length > 0 && mincePropCount[item.eventId] !== undefined ? flagList.push(true) : null;
65
61
  }
66
62
  }
67
- if ((item === null || item === void 0 ? void 0 : item.filters) && ((_item$filters = item.filters) === null || _item$filters === void 0 ? void 0 : _item$filters.conditions.length) > 0) {
68
- flag = conditionsHandle(type, item.filters, count, item.eventId);
69
- }
63
+ (item === null || item === void 0 ? void 0 : item.filters) && conditionsHandle(type, item.filters, count, item.eventId, flagList);
70
64
  }
71
65
  });
72
- return flag;
73
66
  };
74
- var conditionsHandle = function conditionsHandle(type, data, count, eventId) {
75
- var flag = false;
76
- data.conditions.map(function (_item) {
77
- if (_item.operator !== 'is null' && _item.operator !== 'is not null') {
78
- var _item$values;
79
- _item.values && ((_item$values = _item.values) === null || _item$values === void 0 ? void 0 : _item$values.length) <= 0 ? flag = true : null;
80
- }
81
- });
67
+ var conditionsHandle = function conditionsHandle(type, data, count, eventId, flagList) {
68
+ if (data.conditions.length > 0) {
69
+ data.conditions.map(function (_item) {
70
+ if (_item.operator !== 'is null' && _item.operator !== 'is not null') {
71
+ var _item$values;
72
+ _item.values && (((_item$values = _item.values) === null || _item$values === void 0 ? void 0 : _item$values.length) <= 0 || _item.values[0] === '') ? flagList.push(true) : null;
73
+ }
74
+ });
75
+ }
82
76
  if (type === 'targetFilters' || type === 'globalFilters') {
83
- data.conditions.length != count ? flag = true : null;
77
+ data.conditions.length != count ? flagList.push(true) : null;
84
78
  } else {
85
- data.conditions.length != count[eventId] ? flag = true : null;
79
+ count[eventId] && data.conditions.length != count[eventId] ? flagList.push(true) : null;
86
80
  }
87
- return flag;
88
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-attribution",
3
- "version": "1.0.2-alpha.0",
3
+ "version": "1.0.2-alpha.10",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "@types/lodash": "^4.14.191",
38
38
  "@umijs/fabric": "^2.8.1",
39
39
  "@umijs/test": "^3.0.5",
40
- "@zgfe/business-lib": "1.1.41-attribution.10",
40
+ "@zgfe/business-lib": "1.1.41-attribution.19",
41
41
  "antd": "^4.22.6",
42
42
  "dumi": "^1.1.0",
43
43
  "echarts": "^5.3.2",
@@ -50,5 +50,5 @@
50
50
  "react": "^16.12.0 || ^17.0.0",
51
51
  "yorkie": "^2.0.0"
52
52
  },
53
- "gitHead": "7765039dbcf529e5a42e5bf9dd849f0c9f1405a6"
53
+ "gitHead": "03e43cb109cc415ae8b55772cbff5a7e79f7ab0f"
54
54
  }