@zgfe/modules-dm 1.0.34-heyh.30 → 1.0.34-heyh.32
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.
- package/es/modules/dataCollection/components/eventGroupingDrawer.js +161 -160
- package/es/modules/dataCollection/components/eventItem.d.ts +3 -0
- package/es/modules/dataCollection/components/eventItem.js +49 -0
- package/es/modules/dataCollection/components/{sortableComponnet.js → sortableComponnet copy.js } +1 -1
- package/es/modules/dataCollection/styles/index.less +6 -5
- package/es/utils/index.d.ts +0 -4
- package/es/utils/index.js +0 -21
- package/package.json +2 -3
- /package/es/modules/dataCollection/components/{sortableComponnet.d.ts → sortableComponnet copy.d.ts} +0 -0
|
@@ -12,15 +12,16 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { BizGlobalDataContext, IconFont, BizLoading } from '@zgfe/business-lib';
|
|
14
14
|
import { Input, Modal, message, Drawer, Popover, Checkbox, Select, Button } from 'antd';
|
|
15
|
-
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
16
15
|
import request from '../../../utils/ajax';
|
|
17
16
|
import apis from '../../../constants/api';
|
|
18
|
-
import { eventListHandle,
|
|
17
|
+
import { eventListHandle, eventCheckedAll, openChangeData, eventShowOrHiddenData, eventMoveData, getAppID, eventShow } from '../../../utils/index';
|
|
19
18
|
import React, { Fragment, useContext, useEffect, useState } from 'react';
|
|
20
19
|
import _ from 'lodash';
|
|
21
|
-
import
|
|
20
|
+
import EventItem from './eventItem';
|
|
22
21
|
var requestMove = false;
|
|
23
22
|
import { DmContext } from '../../../store';
|
|
23
|
+
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
|
|
24
|
+
import { arrayMoveImmutable } from 'array-move';
|
|
24
25
|
var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
25
26
|
var classPrefix = 'event-grouping-drawer';
|
|
26
27
|
var eventGroupingShow = props.eventGroupingShow,
|
|
@@ -36,18 +37,14 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
36
37
|
setGroupingData = _useState2[1];
|
|
37
38
|
var _useContext2 = useContext(DmContext),
|
|
38
39
|
state = _useContext2.state;
|
|
39
|
-
var _useState3 = useState(
|
|
40
|
+
var _useState3 = useState(''),
|
|
40
41
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var _useState5 = useState(
|
|
42
|
+
searchData = _useState4[0],
|
|
43
|
+
setSearchData = _useState4[1];
|
|
44
|
+
var _useState5 = useState(false),
|
|
44
45
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var _useState7 = useState(false),
|
|
48
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
-
loading = _useState8[0],
|
|
50
|
-
setLoading = _useState8[1];
|
|
46
|
+
loading = _useState6[0],
|
|
47
|
+
setLoading = _useState6[1];
|
|
51
48
|
var queryList = function queryList() {
|
|
52
49
|
setLoading(true);
|
|
53
50
|
request(apis.queryCollectionEventList, {
|
|
@@ -60,8 +57,6 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
60
57
|
}).then(function (res) {
|
|
61
58
|
if (res && res.data) {
|
|
62
59
|
var _data = eventListHandle(res.data);
|
|
63
|
-
// setInitialData(_data);
|
|
64
|
-
// setGroupingData(eventShow(_.cloneDeep(_data), searchData));
|
|
65
60
|
setGroupingData(_data);
|
|
66
61
|
}
|
|
67
62
|
setLoading(false);
|
|
@@ -84,28 +79,9 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
84
79
|
var openChange = function openChange(groupId) {
|
|
85
80
|
setGroupingData(_.cloneDeep(openChangeData(groupId, groupingData)));
|
|
86
81
|
};
|
|
87
|
-
// 拖拽之后改变对应数据
|
|
88
|
-
var onDragEnd = function onDragEnd(result) {
|
|
89
|
-
// console.log('拖拽之后改变对应数据: ', result);
|
|
90
|
-
// 分组移动
|
|
91
|
-
if (result.source.droppableId.indexOf('item') === -1) {
|
|
92
|
-
var ids = groupListSort(result, groupingData, setGroupingData);
|
|
93
|
-
request(apis.orderEventGroup, {
|
|
94
|
-
method: 'post',
|
|
95
|
-
data: {
|
|
96
|
-
appId: getAppID(currentApp),
|
|
97
|
-
ids: ids
|
|
98
|
-
}
|
|
99
|
-
}).then(function () {
|
|
100
|
-
// queryList();
|
|
101
|
-
refresh();
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
setIsDragDisabled(false);
|
|
105
|
-
};
|
|
106
82
|
// 删除事件分组
|
|
107
83
|
var groupDelete = function groupDelete(groupId) {
|
|
108
|
-
if (!authority[source ===
|
|
84
|
+
if (!authority[source === 'virtual' ? 1700636179 : 1700636359]) {
|
|
109
85
|
message.error('无操作权限');
|
|
110
86
|
return;
|
|
111
87
|
}
|
|
@@ -157,26 +133,26 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
157
133
|
}
|
|
158
134
|
};
|
|
159
135
|
// 移动
|
|
160
|
-
var
|
|
136
|
+
var _useState7 = useState(undefined),
|
|
137
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
138
|
+
eventMoveShow = _useState8[0],
|
|
139
|
+
setEventMoveShow = _useState8[1];
|
|
140
|
+
var _useState9 = useState(-1),
|
|
161
141
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var _useState11 = useState(
|
|
142
|
+
eventMoveChangeId = _useState10[0],
|
|
143
|
+
setEventMoveChangeId = _useState10[1];
|
|
144
|
+
var _useState11 = useState([]),
|
|
165
145
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var _useState13 = useState(
|
|
146
|
+
eventMoveOption = _useState12[0],
|
|
147
|
+
setEventMoveOption = _useState12[1];
|
|
148
|
+
var _useState13 = useState(0),
|
|
169
149
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var _useState15 = useState(
|
|
150
|
+
eventMoveLength = _useState14[0],
|
|
151
|
+
setEventMoveLength = _useState14[1];
|
|
152
|
+
var _useState15 = useState(''),
|
|
173
153
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
var _useState17 = useState(''),
|
|
177
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
178
|
-
eventMoveIds = _useState18[0],
|
|
179
|
-
setEventMoveIds = _useState18[1];
|
|
154
|
+
eventMoveIds = _useState16[0],
|
|
155
|
+
setEventMoveIds = _useState16[1];
|
|
180
156
|
var eventMove = function eventMove(groupId) {
|
|
181
157
|
var data = eventMoveData(groupId, groupingData, setGroupingData);
|
|
182
158
|
setEventMoveOption(data.groupingOption);
|
|
@@ -242,18 +218,18 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
242
218
|
}, "\u786E\u5B9A")));
|
|
243
219
|
};
|
|
244
220
|
// 创建分组 & 修改分组名
|
|
245
|
-
var
|
|
221
|
+
var _useState17 = useState(null),
|
|
222
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
223
|
+
createOrEditGrpup = _useState18[0],
|
|
224
|
+
setCreateOrEditGrpup = _useState18[1];
|
|
225
|
+
var _useState19 = useState(-1),
|
|
246
226
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
var _useState21 = useState(
|
|
227
|
+
grpupModalSelectGrpupId = _useState20[0],
|
|
228
|
+
setGrpupModalSelectGrpupId = _useState20[1];
|
|
229
|
+
var _useState21 = useState(''),
|
|
250
230
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
var _useState23 = useState(''),
|
|
254
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
255
|
-
grpupNameInput = _useState24[0],
|
|
256
|
-
setGrpupNameInput = _useState24[1];
|
|
231
|
+
grpupNameInput = _useState22[0],
|
|
232
|
+
setGrpupNameInput = _useState22[1];
|
|
257
233
|
var GrpupModalHandle = function GrpupModalHandle() {
|
|
258
234
|
if (grpupNameInput === '') {
|
|
259
235
|
message.error('请填写分组名');
|
|
@@ -290,6 +266,122 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
290
266
|
setGrpupModalSelectGrpupId(-1);
|
|
291
267
|
setGrpupNameInput('');
|
|
292
268
|
};
|
|
269
|
+
// 拖动手柄
|
|
270
|
+
var DragHandle = SortableHandle(function () {
|
|
271
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
272
|
+
type: "tuozhuai1"
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
// 需要拖动的元素的容器
|
|
276
|
+
var SortableItem = SortableElement(function (data) {
|
|
277
|
+
var _data$value = data.value,
|
|
278
|
+
item = _data$value.item,
|
|
279
|
+
index = _data$value.index;
|
|
280
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
281
|
+
className: "".concat(classPrefix, "-box"),
|
|
282
|
+
key: index
|
|
283
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
284
|
+
className: "".concat(classPrefix, "-box-header")
|
|
285
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
286
|
+
className: "operate-left"
|
|
287
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
id: "create-or-edit-grpup-modal"
|
|
289
|
+
}, item.open && /*#__PURE__*/React.createElement(IconFont, {
|
|
290
|
+
type: "fangxiangxia",
|
|
291
|
+
onClick: function onClick() {
|
|
292
|
+
return openChange(item.groupId);
|
|
293
|
+
}
|
|
294
|
+
}), !item.open && /*#__PURE__*/React.createElement(IconFont, {
|
|
295
|
+
type: "fangxiangshang",
|
|
296
|
+
onClick: function onClick() {
|
|
297
|
+
return openChange(item.groupId);
|
|
298
|
+
}
|
|
299
|
+
}), /*#__PURE__*/React.createElement("div", null, item.groupName ? item.groupName : '未分组'), item.groupName && /*#__PURE__*/React.createElement(IconFont, {
|
|
300
|
+
type: "zhongmingming",
|
|
301
|
+
onClick: function onClick() {
|
|
302
|
+
if (!authority[source === 'virtual' ? 1700636172 : 1700636344]) {
|
|
303
|
+
message.error('无操作权限');
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
setCreateOrEditGrpup('edit');
|
|
307
|
+
setGrpupNameInput(item.groupName ? item.groupName : '未分组');
|
|
308
|
+
setGrpupModalSelectGrpupId(item.groupId);
|
|
309
|
+
}
|
|
310
|
+
})), /*#__PURE__*/React.createElement("div", null, item.count, "\u4E2A\u6307\u6807")), /*#__PURE__*/React.createElement("div", {
|
|
311
|
+
className: "operate-right"
|
|
312
|
+
}, item.count > 0 && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
313
|
+
checked: item.checked,
|
|
314
|
+
onChange: function onChange() {
|
|
315
|
+
return onChangeAll(item.groupId);
|
|
316
|
+
}
|
|
317
|
+
}, "\u5168\u9009"), /*#__PURE__*/React.createElement(Popover, {
|
|
318
|
+
overlayClassName: "move-popover ".concat(eventMoveLength ? 'show' : 'hidden'),
|
|
319
|
+
placement: "bottomRight",
|
|
320
|
+
open: eventMoveShow === item.groupId,
|
|
321
|
+
title: null,
|
|
322
|
+
content: moveContent
|
|
323
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
324
|
+
className: "".concat(groupingData.length > 1 ? '' : 'not-operable'),
|
|
325
|
+
onClick: function onClick() {
|
|
326
|
+
if (groupingData.length > 1) {
|
|
327
|
+
eventMove(item.groupId);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}, "\u79FB\u52A8")), /*#__PURE__*/React.createElement("span", {
|
|
331
|
+
onClick: function onClick() {
|
|
332
|
+
return eventShowOrHidden(0, item.groupId);
|
|
333
|
+
}
|
|
334
|
+
}, "\u663E\u793A"), /*#__PURE__*/React.createElement("span", {
|
|
335
|
+
onClick: function onClick() {
|
|
336
|
+
return eventShowOrHidden(1, item.groupId);
|
|
337
|
+
}
|
|
338
|
+
}, "\u9690\u85CF")), item.groupName && /*#__PURE__*/React.createElement("span", {
|
|
339
|
+
onClick: function onClick() {
|
|
340
|
+
return groupDelete(item.groupId);
|
|
341
|
+
}
|
|
342
|
+
}, "\u5220\u9664"), /*#__PURE__*/React.createElement(DragHandle, null))), /*#__PURE__*/React.createElement("div", {
|
|
343
|
+
className: "".concat(classPrefix, "-box-content ").concat(item.open ? 'open' : 'close')
|
|
344
|
+
}, /*#__PURE__*/React.createElement(EventItem, {
|
|
345
|
+
componnetData: item.eventList,
|
|
346
|
+
componnetIndex: index,
|
|
347
|
+
groupId: item.groupId,
|
|
348
|
+
groupingData: groupingData,
|
|
349
|
+
setGroupingData: setGroupingData,
|
|
350
|
+
searchData: searchData
|
|
351
|
+
})));
|
|
352
|
+
});
|
|
353
|
+
// 拖拽盒子容器
|
|
354
|
+
var SortableList = SortableContainer(function () {
|
|
355
|
+
return /*#__PURE__*/React.createElement("div", null, groupingData.map(function (item, index) {
|
|
356
|
+
return /*#__PURE__*/React.createElement(SortableItem, {
|
|
357
|
+
key: "item-".concat(index),
|
|
358
|
+
index: index,
|
|
359
|
+
value: {
|
|
360
|
+
item: item,
|
|
361
|
+
index: index
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}));
|
|
365
|
+
});
|
|
366
|
+
var onSortEnd = function onSortEnd(data) {
|
|
367
|
+
var oldIndex = data.oldIndex,
|
|
368
|
+
newIndex = data.newIndex;
|
|
369
|
+
var _groupingData = arrayMoveImmutable(groupingData, oldIndex, newIndex);
|
|
370
|
+
setGroupingData(_.cloneDeep(_groupingData));
|
|
371
|
+
var ids = [];
|
|
372
|
+
_groupingData.map(function (item) {
|
|
373
|
+
ids.push(item.groupId);
|
|
374
|
+
});
|
|
375
|
+
request(apis.orderEventGroup, {
|
|
376
|
+
method: 'post',
|
|
377
|
+
data: {
|
|
378
|
+
appId: getAppID(currentApp),
|
|
379
|
+
ids: ids.join(',')
|
|
380
|
+
}
|
|
381
|
+
}).then(function () {
|
|
382
|
+
refresh();
|
|
383
|
+
});
|
|
384
|
+
};
|
|
293
385
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
|
|
294
386
|
className: classPrefix,
|
|
295
387
|
width: 700,
|
|
@@ -322,108 +414,17 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
|
|
|
322
414
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
323
415
|
type: "primary",
|
|
324
416
|
size: "small",
|
|
325
|
-
disabled: !authority[source ===
|
|
417
|
+
disabled: !authority[source === 'virtual' ? 1700636137 : 1000002],
|
|
326
418
|
onClick: function onClick() {
|
|
327
419
|
setCreateOrEditGrpup('create');
|
|
328
420
|
}
|
|
329
|
-
}, "\u521B\u5EFA\u5206\u7EC4")), /*#__PURE__*/React.createElement(
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
isDragDisabled: false,
|
|
337
|
-
direction: "vertical"
|
|
338
|
-
}, function (provided) {
|
|
339
|
-
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
340
|
-
key: index,
|
|
341
|
-
ref: provided.innerRef
|
|
342
|
-
}, provided.droppableProps), /*#__PURE__*/React.createElement(Draggable, {
|
|
343
|
-
isDragDisabled: isDragDisabled,
|
|
344
|
-
key: item.groupId.toString(),
|
|
345
|
-
draggableId: item.groupId.toString(),
|
|
346
|
-
index: index
|
|
347
|
-
}, function (provided) {
|
|
348
|
-
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
|
349
|
-
ref: provided.innerRef
|
|
350
|
-
}, provided.draggableProps), /*#__PURE__*/React.createElement("div", {
|
|
351
|
-
className: "".concat(classPrefix, "-box")
|
|
352
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
353
|
-
className: "".concat(classPrefix, "-box-header")
|
|
354
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
355
|
-
className: "operate-left"
|
|
356
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
357
|
-
id: "create-or-edit-grpup-modal"
|
|
358
|
-
}, item.open && /*#__PURE__*/React.createElement(IconFont, {
|
|
359
|
-
type: "fangxiangxia",
|
|
360
|
-
onClick: function onClick() {
|
|
361
|
-
return openChange(item.groupId);
|
|
362
|
-
}
|
|
363
|
-
}), !item.open && /*#__PURE__*/React.createElement(IconFont, {
|
|
364
|
-
type: "fangxiangshang",
|
|
365
|
-
onClick: function onClick() {
|
|
366
|
-
return openChange(item.groupId);
|
|
367
|
-
}
|
|
368
|
-
}), /*#__PURE__*/React.createElement("div", null, item.groupName ? item.groupName : '未分组'), item.groupName && /*#__PURE__*/React.createElement(IconFont, {
|
|
369
|
-
type: "zhongmingming",
|
|
370
|
-
onClick: function onClick() {
|
|
371
|
-
if (!authority[source === "virtual" ? 1700636172 : 1700636344]) {
|
|
372
|
-
message.error('无操作权限');
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
setCreateOrEditGrpup('edit');
|
|
376
|
-
setGrpupNameInput(item.groupName ? item.groupName : '未分组');
|
|
377
|
-
setGrpupModalSelectGrpupId(item.groupId);
|
|
378
|
-
}
|
|
379
|
-
})), /*#__PURE__*/React.createElement("div", null, item.count, "\u4E2A\u6307\u6807")), /*#__PURE__*/React.createElement("div", {
|
|
380
|
-
className: "operate-right"
|
|
381
|
-
}, item.count > 0 && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
382
|
-
checked: item.checked,
|
|
383
|
-
onChange: function onChange() {
|
|
384
|
-
return onChangeAll(item.groupId);
|
|
385
|
-
}
|
|
386
|
-
}, "\u5168\u9009"), /*#__PURE__*/React.createElement(Popover, {
|
|
387
|
-
overlayClassName: "move-popover ".concat(eventMoveLength ? 'show' : 'hidden'),
|
|
388
|
-
placement: "bottomRight",
|
|
389
|
-
open: eventMoveShow === item.groupId,
|
|
390
|
-
title: null,
|
|
391
|
-
content: moveContent
|
|
392
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
393
|
-
className: "".concat(groupingData.length > 1 ? '' : 'not-operable'),
|
|
394
|
-
onClick: function onClick() {
|
|
395
|
-
if (groupingData.length > 1) {
|
|
396
|
-
eventMove(item.groupId);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}, "\u79FB\u52A8")), /*#__PURE__*/React.createElement("span", {
|
|
400
|
-
onClick: function onClick() {
|
|
401
|
-
return eventShowOrHidden(0, item.groupId);
|
|
402
|
-
}
|
|
403
|
-
}, "\u663E\u793A"), /*#__PURE__*/React.createElement("span", {
|
|
404
|
-
onClick: function onClick() {
|
|
405
|
-
return eventShowOrHidden(1, item.groupId);
|
|
406
|
-
}
|
|
407
|
-
}, "\u9690\u85CF")), item.groupName && /*#__PURE__*/React.createElement("span", {
|
|
408
|
-
onClick: function onClick() {
|
|
409
|
-
return groupDelete(item.groupId);
|
|
410
|
-
}
|
|
411
|
-
}, "\u5220\u9664"), /*#__PURE__*/React.createElement(IconFont, _objectSpread(_objectSpread({}, provided.dragHandleProps), {}, {
|
|
412
|
-
type: "tuozhuai1"
|
|
413
|
-
})))), /*#__PURE__*/React.createElement("div", {
|
|
414
|
-
className: "".concat(classPrefix, "-box-content ").concat(item.open ? 'open' : 'close')
|
|
415
|
-
}, /*#__PURE__*/React.createElement(SortableComponnet, {
|
|
416
|
-
componnetData: item.eventList,
|
|
417
|
-
componnetIndex: index,
|
|
418
|
-
groupId: item.groupId,
|
|
419
|
-
groupingData: groupingData,
|
|
420
|
-
setGroupingData: setGroupingData,
|
|
421
|
-
refresh: refresh,
|
|
422
|
-
searchData: searchData
|
|
423
|
-
}))));
|
|
424
|
-
}));
|
|
425
|
-
});
|
|
426
|
-
})))), /*#__PURE__*/React.createElement(Modal, {
|
|
421
|
+
}, "\u521B\u5EFA\u5206\u7EC4")), /*#__PURE__*/React.createElement(SortableList, {
|
|
422
|
+
distance: 5,
|
|
423
|
+
axis: 'xy',
|
|
424
|
+
helperClass: "".concat(classPrefix, "-sortablelist"),
|
|
425
|
+
onSortEnd: onSortEnd,
|
|
426
|
+
useDragHandle: true
|
|
427
|
+
}))), /*#__PURE__*/React.createElement(Modal, {
|
|
427
428
|
wrapClassName: "create-or-edit-grpup-modal",
|
|
428
429
|
title: "".concat(createOrEditGrpup === 'create' ? '创建分组' : '修改分组名'),
|
|
429
430
|
bodyStyle: {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Checkbox, Tooltip } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { eventChecked } from '../../../utils';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
var EventItem = function EventItem(props) {
|
|
6
|
+
var componnetData = props.componnetData,
|
|
7
|
+
componnetIndex = props.componnetIndex,
|
|
8
|
+
groupId = props.groupId,
|
|
9
|
+
groupingData = props.groupingData,
|
|
10
|
+
setGroupingData = props.setGroupingData,
|
|
11
|
+
searchData = props.searchData;
|
|
12
|
+
var SortableItem = function SortableItem(data) {
|
|
13
|
+
var item = data.item,
|
|
14
|
+
index = data.index;
|
|
15
|
+
var name = '';
|
|
16
|
+
if (searchData === '') {
|
|
17
|
+
name = item.alias_name ? item.alias_name : item.event_name;
|
|
18
|
+
} else {
|
|
19
|
+
name = item.alias_name ? "".concat(item.alias_name, "(").concat(item.event_name, ")") : item.event_name;
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
22
|
+
title: "".concat(item.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(name),
|
|
23
|
+
key: index
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
25
|
+
className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
|
|
26
|
+
checked: item.checked,
|
|
27
|
+
key: index,
|
|
28
|
+
onChange: function onChange() {
|
|
29
|
+
return onChangeItem(groupId, item.event_id);
|
|
30
|
+
}
|
|
31
|
+
}, name));
|
|
32
|
+
};
|
|
33
|
+
var onChangeItem = function onChangeItem(groupId, eventId) {
|
|
34
|
+
setGroupingData(_.cloneDeep(eventChecked(groupId, eventId, groupingData)));
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
key: componnetIndex
|
|
38
|
+
}, componnetData.map(function (item, index) {
|
|
39
|
+
if (item.searchShow === 1) {
|
|
40
|
+
return SortableItem({
|
|
41
|
+
item: item,
|
|
42
|
+
index: index
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
export default EventItem;
|
package/es/modules/dataCollection/components/{sortableComponnet.js → sortableComponnet copy.js }
RENAMED
|
@@ -63,7 +63,7 @@ var SortableComponnet = function SortableComponnet(props) {
|
|
|
63
63
|
key: componnetIndex
|
|
64
64
|
}, componnetData.map(function (item, index) {
|
|
65
65
|
if (item.searchShow === 1) {
|
|
66
|
-
if (groupId !== -1 && searchData ===
|
|
66
|
+
if (groupId !== -1 && searchData === '') {
|
|
67
67
|
return /*#__PURE__*/React.createElement(SortableItem, {
|
|
68
68
|
key: "item-".concat(index),
|
|
69
69
|
index: index,
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
align-items: center;
|
|
517
517
|
justify-content: start;
|
|
518
518
|
> :nth-child(1) {
|
|
519
|
-
color: #
|
|
519
|
+
color: #9aa1a9;
|
|
520
520
|
}
|
|
521
521
|
> :nth-child(2) {
|
|
522
522
|
font-weight: 500;
|
|
@@ -536,6 +536,7 @@
|
|
|
536
536
|
}
|
|
537
537
|
.tuozhuai1 {
|
|
538
538
|
font-size: 18px !important;
|
|
539
|
+
cursor: pointer;
|
|
539
540
|
}
|
|
540
541
|
}
|
|
541
542
|
}
|
|
@@ -616,6 +617,10 @@
|
|
|
616
617
|
}
|
|
617
618
|
}
|
|
618
619
|
|
|
620
|
+
.event-grouping-drawer-sortablelist {
|
|
621
|
+
z-index: 99999;
|
|
622
|
+
}
|
|
623
|
+
|
|
619
624
|
.group-delete-modal {
|
|
620
625
|
.ant-modal-body {
|
|
621
626
|
padding: 24px;
|
|
@@ -767,10 +772,6 @@
|
|
|
767
772
|
}
|
|
768
773
|
}
|
|
769
774
|
|
|
770
|
-
.sortable-componnet-sortableList {
|
|
771
|
-
z-index: 9999;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
775
|
.not-operable {
|
|
775
776
|
color: #ccd0d4;
|
|
776
777
|
cursor: not-allowed !important;
|
package/es/utils/index.d.ts
CHANGED
|
@@ -46,10 +46,6 @@ export declare const eventShow: (data: any, searchData: string) => any;
|
|
|
46
46
|
* 指标分组管理:单个事件选中处理
|
|
47
47
|
*/
|
|
48
48
|
export declare const eventChecked: (groupId: number, eventId: number, groupingData: any) => any;
|
|
49
|
-
/**
|
|
50
|
-
* 指标分组管理:分组排序
|
|
51
|
-
*/
|
|
52
|
-
export declare const groupListSort: (result: any, groupingData: any, setGroupingData: Function) => any;
|
|
53
49
|
export declare const getAppID: (currentApp: any) => any;
|
|
54
50
|
export declare const nullToEmptyString: (data: any) => any;
|
|
55
51
|
/**
|
package/es/utils/index.js
CHANGED
|
@@ -304,27 +304,6 @@ export var eventChecked = function eventChecked(groupId, eventId, groupingData)
|
|
|
304
304
|
});
|
|
305
305
|
return groupingData;
|
|
306
306
|
};
|
|
307
|
-
/**
|
|
308
|
-
* 指标分组管理:分组排序
|
|
309
|
-
*/
|
|
310
|
-
export var groupListSort = function groupListSort(result, groupingData, setGroupingData) {
|
|
311
|
-
var _result$destination, _result$destination2;
|
|
312
|
-
var sourceIndex = result.source.index;
|
|
313
|
-
var targetIndex = ((_result$destination = result.destination) === null || _result$destination === void 0 ? void 0 : _result$destination.index) ? (_result$destination2 = result.destination) === null || _result$destination2 === void 0 ? void 0 : _result$destination2.index : 0;
|
|
314
|
-
var ids = [];
|
|
315
|
-
var sourceItem = groupingData[sourceIndex];
|
|
316
|
-
delete groupingData[sourceIndex];
|
|
317
|
-
groupingData.splice(targetIndex, 0, sourceItem);
|
|
318
|
-
groupingData.map(function (item) {
|
|
319
|
-
ids.push(item.groupId);
|
|
320
|
-
});
|
|
321
|
-
var _groupingData = [];
|
|
322
|
-
groupingData.map(function (item) {
|
|
323
|
-
_groupingData.push(item);
|
|
324
|
-
});
|
|
325
|
-
setGroupingData(_groupingData);
|
|
326
|
-
return ids.join(',');
|
|
327
|
-
};
|
|
328
307
|
// 获取appId,为了解决之前遇到切换应用但是currentApp里面的appId不更新的问题
|
|
329
308
|
export var getAppID = function getAppID(currentApp) {
|
|
330
309
|
var href = window.location.href;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.34-heyh.
|
|
3
|
+
"version": "1.0.34-heyh.32",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "es/index.d.ts",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"array-move": "^4.0.0",
|
|
32
32
|
"react": "^16.12.0 || ^17.0.0",
|
|
33
|
-
"react-beautiful-dnd": "^13.1.1",
|
|
34
33
|
"react-sortable-hoc": "^2.0.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
"umi-request": "^1.4.0",
|
|
53
52
|
"yorkie": "^2.0.0"
|
|
54
53
|
},
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "cfe4a63f7e2d58c69febec65e2573d99e0af49a7",
|
|
56
55
|
"gitHooks": {
|
|
57
56
|
"pre-commit": "lint-staged"
|
|
58
57
|
}
|
/package/es/modules/dataCollection/components/{sortableComponnet.d.ts → sortableComponnet copy.d.ts}
RENAMED
|
File without changes
|