@zgfe/business-lib 1.0.24-alpha.7 → 1.0.24-insight.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.
@@ -166,7 +166,9 @@ var BizAddToPanel = function BizAddToPanel(props) {
166
166
 
167
167
  if (router && routes) router.push({
168
168
  name: routes.panel,
169
- params: ((_result$panel = result.panel) === null || _result$panel === void 0 ? void 0 : _result$panel.id) || form.panel.id
169
+ params: {
170
+ panelId: ((_result$panel = result.panel) === null || _result$panel === void 0 ? void 0 : _result$panel.id) || form.panel.id
171
+ }
170
172
  });
171
173
  }
172
174
  }, form.panel.name || ((_result$panel2 = result.panel) === null || _result$panel2 === void 0 ? void 0 : _result$panel2.name)), "\u6210\u529F")
@@ -50,9 +50,21 @@ var BizDatePicker = function BizDatePicker(props) {
50
50
 
51
51
  if (data) {
52
52
  setCurrentType(function () {
53
- return dateList.filter(function (item) {
53
+ var list = dateList.filter(function (item) {
54
54
  return item.value === data.unit;
55
55
  })[0] || dateList[0];
56
+
57
+ if (data.relative) {
58
+ var valueData = list.children.filter(function (item) {
59
+ return item.count === data.relative[0];
60
+ })[0];
61
+
62
+ if (valueData) {
63
+ setCurrentTime(valueData);
64
+ }
65
+ }
66
+
67
+ return list;
56
68
  });
57
69
  setDateRange(function () {
58
70
  return {
@@ -55,15 +55,10 @@ var EventListPanel = function EventListPanel(props) {
55
55
  searchEventList = _useState8[0],
56
56
  setSearchEventList = _useState8[1];
57
57
 
58
- var _useState9 = useState([]),
58
+ var _useState9 = useState(),
59
59
  _useState10 = _slicedToArray(_useState9, 2),
60
- showList = _useState10[0],
61
- setShowList = _useState10[1];
62
-
63
- var _useState11 = useState(),
64
- _useState12 = _slicedToArray(_useState11, 2),
65
- currentValue = _useState12[0],
66
- setCurrentValue = _useState12[1];
60
+ currentValue = _useState10[0],
61
+ setCurrentValue = _useState10[1];
67
62
 
68
63
  var overviewData = {
69
64
  id: -100,
@@ -107,18 +102,8 @@ var EventListPanel = function EventListPanel(props) {
107
102
  setSearchEventList(function () {
108
103
  return list;
109
104
  });
110
- setShowList(function () {
111
- return list.slice(0, 10);
112
- });
113
105
  }, [searchValue, currentGroup, showOverview]);
114
106
 
115
- var loadMoreData = function loadMoreData() {
116
- var moreData = searchEventList.slice(showList.length, showList.length + 10);
117
- setShowList(function (list) {
118
- return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
119
- });
120
- };
121
-
122
107
  function onClickEvent(e) {
123
108
  var resVal = _.cloneDeep(currentValue) || {};
124
109
  resVal.event = e;
@@ -172,7 +157,39 @@ var EventListPanel = function EventListPanel(props) {
172
157
  }), /*#__PURE__*/React.createElement("div", {
173
158
  className: "".concat(classPrefix, "-list"),
174
159
  id: "scrollableDiv"
175
- }, /*#__PURE__*/React.createElement(InfiniteScroll, {
160
+ }, /*#__PURE__*/React.createElement(InfiniteScrollList, {
161
+ searchEventList: searchEventList,
162
+ searchValue: searchValue,
163
+ currentGroup: currentGroup,
164
+ currentValue: currentValue,
165
+ onClick: onClickEvent
166
+ }))));
167
+ };
168
+
169
+ var InfiniteScrollList = function InfiniteScrollList(_ref) {
170
+ var searchEventList = _ref.searchEventList,
171
+ searchValue = _ref.searchValue,
172
+ currentGroup = _ref.currentGroup,
173
+ currentValue = _ref.currentValue,
174
+ onClick = _ref.onClick;
175
+
176
+ var _useState11 = useState([]),
177
+ _useState12 = _slicedToArray(_useState11, 2),
178
+ showList = _useState12[0],
179
+ setShowList = _useState12[1];
180
+
181
+ useEffect(function () {
182
+ setShowList(searchEventList.slice(0, 10));
183
+ }, [searchEventList]);
184
+
185
+ var loadMoreData = function loadMoreData() {
186
+ var moreData = searchEventList.slice(showList.length, showList.length + 10);
187
+ setShowList(function (list) {
188
+ return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
189
+ });
190
+ };
191
+
192
+ return /*#__PURE__*/React.createElement(InfiniteScroll, {
176
193
  dataLength: showList.length,
177
194
  hasMore: showList.length < searchEventList.length,
178
195
  loader: /*#__PURE__*/React.createElement(Skeleton, {
@@ -184,7 +201,7 @@ var EventListPanel = function EventListPanel(props) {
184
201
  next: loadMoreData,
185
202
  scrollableTarget: "scrollableDiv",
186
203
  key: Math.random()
187
- }, showList === null || showList === void 0 ? void 0 : showList.map(function (e) {
204
+ }, showList.map(function (e) {
188
205
  var _currentValue$event;
189
206
 
190
207
  if (e.eventHidden === ShowStatus.hidden) return null;
@@ -197,9 +214,9 @@ var EventListPanel = function EventListPanel(props) {
197
214
  text: searchValue
198
215
  },
199
216
  data: e,
200
- onClick: onClickEvent
217
+ onClick: onClick
201
218
  });
202
- })))));
219
+ }));
203
220
  };
204
221
 
205
222
  export default EventListPanel;
@@ -4,5 +4,6 @@ declare const BizDetailLayout: React.FC<{
4
4
  width?: number;
5
5
  onBack?: () => void;
6
6
  extra?: React.ReactNode;
7
+ children?: React.ReactNode;
7
8
  }>;
8
9
  export default BizDetailLayout;
@@ -164,7 +164,7 @@ var BizSelect = function BizSelect(props) {
164
164
  width: overlayWidth || width
165
165
  },
166
166
  trigger: ['click'],
167
- getPopupContainer: props.popupContainer || props.multiple ? function () {
167
+ getPopupContainer: props.popupContainer ? function () {
168
168
  return document.getElementById(selectId);
169
169
  } : undefined,
170
170
  visible: visible,
@@ -127,21 +127,39 @@ var BizTargetCondition = function BizTargetCondition(props) {
127
127
  }
128
128
  }
129
129
 
130
- if (data.eventId || data.eventGroupId) {
130
+ if (data.eventId) {
131
131
  target.value = {
132
132
  event: undefined,
133
133
  group: undefined
134
134
  };
135
135
 
136
+ if (!data.eventGroupId) {
137
+ target.value.group = {
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: []
149
+ };
150
+ }
151
+
136
152
  for (var i = 0; i < eventGroupList.length; i++) {
137
153
  var group = eventGroupList[i];
138
154
 
139
- for (var j = 0; j < group.eventList.length; j++) {
140
- var event = group.eventList[j];
155
+ if (data.eventId !== -100) {
156
+ for (var j = 0; j < group.eventList.length; j++) {
157
+ var event = group.eventList[j];
141
158
 
142
- if (event.id === data.eventId) {
143
- target.value.event = event;
144
- break;
159
+ if (event.id === data.eventId) {
160
+ target.value.event = event;
161
+ break;
162
+ }
145
163
  }
146
164
  }
147
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.24-alpha.7",
3
+ "version": "1.0.24-insight.1",
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": "85992000873c6687eb018b768792ff8fb18a688e"
61
+ "gitHead": "21be119046cf82a711b32553270b4c6c0841111e"
62
62
  }