@zgfe/modules-dm 1.0.31 → 1.0.34-heyh.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.
Files changed (43) hide show
  1. package/es/components/demo.js +2 -1
  2. package/es/constants/api.d.ts +11 -0
  3. package/es/constants/api.js +27 -12
  4. package/es/modules/dataCollection/collectionAttributeList.js +51 -26
  5. package/es/modules/dataCollection/collectionEventList.js +53 -83
  6. package/es/modules/dataCollection/components/createVirtualDrawer.d.ts +4 -0
  7. package/es/modules/dataCollection/components/createVirtualDrawer.js +222 -0
  8. package/es/modules/dataCollection/components/eventFilter/index.d.ts +5 -0
  9. package/es/modules/dataCollection/components/eventFilter/index.js +145 -0
  10. package/es/modules/dataCollection/components/eventFilter/styles/index.less +64 -0
  11. package/es/modules/dataCollection/components/eventFilter/types.d.ts +51 -0
  12. package/es/modules/dataCollection/components/eventFilter/types.js +1 -0
  13. package/es/modules/dataCollection/components/eventGroupingDrawer.d.ts +4 -0
  14. package/es/modules/dataCollection/components/eventGroupingDrawer.js +375 -0
  15. package/es/modules/dataCollection/components/selectAttributes.d.ts +3 -0
  16. package/es/modules/dataCollection/components/selectAttributes.js +207 -0
  17. package/es/modules/dataCollection/components/sortableComponnet.d.ts +3 -0
  18. package/es/modules/dataCollection/components/sortableComponnet.js +101 -0
  19. package/es/modules/dataCollection/{tablePlus.d.ts → components/tablePlus.d.ts} +2 -1
  20. package/es/modules/dataCollection/{tablePlus.js → components/tablePlus.js} +160 -147
  21. package/es/modules/dataCollection/components/virtualTablePlus.d.ts +5 -0
  22. package/es/modules/dataCollection/components/virtualTablePlus.js +351 -0
  23. package/es/modules/dataCollection/index.js +11 -10
  24. package/es/modules/dataCollection/styles/index.less +341 -14
  25. package/es/modules/dataCollection/types.d.ts +75 -0
  26. package/es/modules/dataCollection/types.js +1 -0
  27. package/es/modules/dataCollection/virtualEventList.d.ts +4 -0
  28. package/es/modules/dataCollection/virtualEventList.js +335 -0
  29. package/es/modules/dataManage/demo/index.js +16 -12
  30. package/es/modules/dataManage/index.js +4 -4
  31. package/es/modules/dataPlan/addEventOrUser.js +1 -2
  32. package/es/modules/dataPlan/addPlan.js +3 -12
  33. package/es/modules/dataPlan/eventList.js +0 -1
  34. package/es/modules/dataPlan/index.js +15 -15
  35. package/es/modules/dataPlan/tablePlus.js +0 -1
  36. package/es/modules/dataPlan/userAttributeList.js +0 -1
  37. package/es/utils/index.d.ts +48 -0
  38. package/es/utils/index.js +247 -0
  39. package/package.json +7 -4
  40. package/es/modules/dataCollection/demo/index.d.ts +0 -2
  41. package/es/modules/dataCollection/demo/index.js +0 -7
  42. package/es/modules/dataPlan/demo/index.d.ts +0 -2
  43. package/es/modules/dataPlan/demo/index.js +0 -6
@@ -0,0 +1,101 @@
1
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
2
+ import { Checkbox } from 'antd';
3
+ import request from '../../../utils/ajax';
4
+ import apis from '../../../constants/api';
5
+ import React, { useContext } from 'react';
6
+ import { getAppID, eventChecked } from '../../../utils';
7
+ import { arrayMoveImmutable } from 'array-move';
8
+ import _ from 'lodash';
9
+ import { SortableContainer, SortableElement } from 'react-sortable-hoc';
10
+ var SortableComponnet = function SortableComponnet(props) {
11
+ var classPrefix = 'sortable-componnet';
12
+ var _useContext = useContext(BizGlobalDataContext),
13
+ currentApp = _useContext.currentApp;
14
+ var componnetData = props.componnetData,
15
+ componnetIndex = props.componnetIndex,
16
+ groupId = props.groupId,
17
+ groupingData = props.groupingData,
18
+ setGroupingData = props.setGroupingData;
19
+ // 需要拖动的元素的容器
20
+ var SortableItem = SortableElement(function (data) {
21
+ var _data$value = data.value,
22
+ item = _data$value.item,
23
+ index = _data$value.index;
24
+ return /*#__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
+ }, item.alias_name ? item.alias_name : item.event_name);
32
+ });
33
+ // 不可拖动的元素(未分组数据)
34
+ var SortableItemNotDrag = function SortableItemNotDrag(data) {
35
+ var item = data.item,
36
+ index = data.index;
37
+ return /*#__PURE__*/React.createElement(Checkbox, {
38
+ className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
39
+ checked: item.checked,
40
+ key: index,
41
+ onChange: function onChange() {
42
+ return onChangeItem(groupId, item.event_id);
43
+ }
44
+ }, item.alias_name ? item.alias_name : item.event_name);
45
+ };
46
+ // 整个元素排序的容器
47
+ var SortableList = SortableContainer(function () {
48
+ return /*#__PURE__*/React.createElement("div", {
49
+ key: componnetIndex
50
+ }, componnetData.map(function (item, index) {
51
+ if (groupId !== -1) {
52
+ return /*#__PURE__*/React.createElement(SortableItem, {
53
+ key: "item-".concat(index),
54
+ index: index,
55
+ value: {
56
+ item: item,
57
+ index: index
58
+ }
59
+ });
60
+ } else {
61
+ return SortableItemNotDrag({
62
+ item: item,
63
+ index: index
64
+ });
65
+ }
66
+ }));
67
+ });
68
+ var onChangeItem = function onChangeItem(groupId, eventId) {
69
+ setGroupingData(_.cloneDeep(eventChecked(groupId, eventId, groupingData)));
70
+ };
71
+ var onSortEnd = function onSortEnd(data) {
72
+ var oldIndex = data.oldIndex,
73
+ newIndex = data.newIndex;
74
+ var eventList = arrayMoveImmutable(componnetData, oldIndex, newIndex);
75
+ var ids = [];
76
+ eventList.map(function (item) {
77
+ ids.push(item.event_id);
78
+ });
79
+ groupingData.map(function (item) {
80
+ if (item.groupId === groupId) {
81
+ item.eventList = eventList;
82
+ }
83
+ });
84
+ setGroupingData(_.cloneDeep(groupingData));
85
+ request(apis.orderEvent, {
86
+ method: 'post',
87
+ data: {
88
+ appId: getAppID(currentApp),
89
+ groupId: groupId,
90
+ ids: ids.join(',')
91
+ }
92
+ }).then(function () {});
93
+ };
94
+ return /*#__PURE__*/React.createElement(SortableList, {
95
+ distance: 5,
96
+ axis: 'xy',
97
+ helperClass: "".concat(classPrefix, "-sortableList"),
98
+ onSortEnd: onSortEnd
99
+ });
100
+ };
101
+ export default SortableComponnet;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import './styles/index.less';
2
+ import '../styles/index.less';
3
3
  interface DataType {
4
4
  key: React.Key;
5
5
  groupId?: number;
@@ -15,6 +15,7 @@ interface DataType {
15
15
  is_delete: number;
16
16
  _groupId?: number;
17
17
  mark_type: number;
18
+ owner: string;
18
19
  }
19
20
  interface queryPlanType {
20
21
  unexpectedPropList: string[];
@@ -12,14 +12,13 @@ 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 } from '@zgfe/business-lib';
14
14
  import { Input, Table, Select, message, Modal, Popover, Checkbox } from 'antd';
15
- import request from '../../utils/ajax';
16
- import apis from '../../constants/api';
17
- var Option = Select.Option;
15
+ import request from '../../../utils/ajax';
16
+ import apis from '../../../constants/api';
18
17
  import React, { useEffect, useState, useContext } from 'react';
19
- import './styles/index.less';
18
+ import '../styles/index.less';
20
19
  import _ from 'lodash';
21
- import { getAppID, getTableScroll } from '../../utils';
22
- import { DmContext } from '../../store';
20
+ import { getAppID, getTableScroll } from '../../../utils';
21
+ import { DmContext } from '../../../store';
23
22
  var TablePlus = function TablePlus(props) {
24
23
  var classPrefix = 'table-plus';
25
24
  var tableHandleData = props.tableHandleData,
@@ -27,61 +26,68 @@ var TablePlus = function TablePlus(props) {
27
26
  isOpen = props.isOpen;
28
27
  var _useContext = useContext(BizGlobalDataContext),
29
28
  currentApp = _useContext.currentApp,
30
- isDemo = _useContext.isDemo;
29
+ isDemo = _useContext.isDemo,
30
+ authority = _useContext.authority;
31
31
  var _useContext2 = useContext(DmContext),
32
32
  state = _useContext2.state;
33
- // 别名foucs
34
- var _useState = useState(''),
35
- _useState2 = _slicedToArray(_useState, 2),
36
- aliasFocusData = _useState2[0],
37
- setAliasFocusData = _useState2[1];
38
- var aliasFocus = function aliasFocus(e) {
39
- setAliasFocusData(e.currentTarget.value);
33
+ // 表格class处理
34
+ var rowClassNameHandle = function rowClassNameHandle(record) {
35
+ if (record.groupId != undefined) {
36
+ return 'group-row';
37
+ } else {
38
+ var _queryPlanData$unexpe;
39
+ return (queryPlanData === null || queryPlanData === void 0 ? void 0 : (_queryPlanData$unexpe = queryPlanData.unexpectedEventList) === null || _queryPlanData$unexpe === void 0 ? void 0 : _queryPlanData$unexpe.indexOf(record.event_name)) != -1 && isOpen == 1 && record.owner != 'zg_abp' ? 'error-row' : '';
40
+ }
40
41
  };
41
- // 修改别名
42
- var aliasNameBlur = function aliasNameBlur(e, record) {
43
- var value = e.currentTarget.value;
44
- if (aliasFocusData == value) return; // 失焦判断,内容无修改不请求接口
42
+ // 修改事件别名
43
+ var _useState = useState(false),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ aliasNameShow = _useState2[0],
46
+ setaliasNameShow = _useState2[1];
47
+ var _useState3 = useState(''),
48
+ _useState4 = _slicedToArray(_useState3, 2),
49
+ aliasNameInput = _useState4[0],
50
+ setAliasNameInput = _useState4[1];
51
+ var _useState5 = useState(-1),
52
+ _useState6 = _slicedToArray(_useState5, 2),
53
+ aliasNameId = _useState6[0],
54
+ setAliasNameId = _useState6[1];
55
+ // 修改事件别名
56
+ var aliasNameEdit = function aliasNameEdit() {
57
+ if (eventNameInput.length > 20) {
58
+ message.error('名称不可超过20字符');
59
+ return;
60
+ }
45
61
  request(apis.updateEventInfo, {
46
62
  method: 'post',
47
- params: {
48
- app_id: getAppID(currentApp),
49
- alias_name: value,
50
- event_id: record.event_id
63
+ data: {
64
+ appId: getAppID(currentApp),
65
+ aliasName: aliasNameInput,
66
+ eventId: aliasNameId
51
67
  }
52
68
  }).then(function (res) {
53
69
  if (res) {
54
70
  message.success('修改成功');
55
71
  props.Refresh();
56
- state.updateEventMetas && state.updateEventMetas(); // 更新store
57
72
  }
58
- }).catch(function (err) {}).finally(function () {
59
- setAliasFocusData('');
73
+ }).finally(function () {
74
+ setaliasNameShow(false);
60
75
  });
61
76
  };
62
- // 表格class处理
63
- var rowClassNameHandle = function rowClassNameHandle(record) {
64
- if (record.groupId != undefined) {
65
- return 'group-row';
66
- } else {
67
- var _queryPlanData$unexpe;
68
- return (queryPlanData === null || queryPlanData === void 0 ? void 0 : (_queryPlanData$unexpe = queryPlanData.unexpectedEventList) === null || _queryPlanData$unexpe === void 0 ? void 0 : _queryPlanData$unexpe.indexOf(record.event_name)) != -1 && isOpen == 1 && record.owner != 'zg_abp' ? 'error-row' : '';
69
- }
70
- };
71
77
  // 控制修改分组名弹框 显示隐藏
72
- var _useState3 = useState(false),
73
- _useState4 = _slicedToArray(_useState3, 2),
74
- eventNameShow = _useState4[0],
75
- setEventNameShow = _useState4[1];
76
- // 修改分组名数据
77
- var _useState5 = useState(''),
78
- _useState6 = _slicedToArray(_useState5, 2),
79
- eventNameInput = _useState6[0],
80
- setEventNameInput = _useState6[1];
81
- var _useState7 = useState({}),
78
+ var _useState7 = useState(false),
82
79
  _useState8 = _slicedToArray(_useState7, 2),
83
- eventNameData = _useState8[0],
84
- setEventNameData = _useState8[1];
80
+ eventNameShow = _useState8[0],
81
+ setEventNameShow = _useState8[1];
82
+ // 修改分组名数据
83
+ var _useState9 = useState(''),
84
+ _useState10 = _slicedToArray(_useState9, 2),
85
+ eventNameInput = _useState10[0],
86
+ setEventNameInput = _useState10[1];
87
+ var _useState11 = useState({}),
88
+ _useState12 = _slicedToArray(_useState11, 2),
89
+ eventNameData = _useState12[0],
90
+ setEventNameData = _useState12[1];
85
91
  // 修改分组名
86
92
  var eventNameEdit = function eventNameEdit() {
87
93
  if (eventNameInput.length > 20) {
@@ -100,10 +106,9 @@ var TablePlus = function TablePlus(props) {
100
106
  if (res.code == '00') {
101
107
  message.success('修改成功');
102
108
  props.Refresh();
109
+ setEventNameShow(false);
103
110
  state.updateEventMetas && state.updateEventMetas(); // 更新store
104
111
  }
105
- }).catch(function (err) {}).finally(function () {
106
- setEventNameShow(false);
107
112
  });
108
113
  };
109
114
  // 删除分组
@@ -132,32 +137,56 @@ var TablePlus = function TablePlus(props) {
132
137
  props.Refresh();
133
138
  state.updateEventMetas && state.updateEventMetas(); // 更新store
134
139
  }
135
- }).catch(function (err) {}).finally(function () {});
140
+ });
136
141
  }
137
142
  });
138
143
  };
139
144
  // 删除事件
140
- var eventItemDel = function eventItemDel(event_id) {
145
+ var eventItemDel = function eventItemDel(record) {
146
+ if (record.owner !== 'zg_abp') {
147
+ if (record.owner === 'zg') {
148
+ request(apis.checkEventStatus, {
149
+ method: 'get',
150
+ params: {
151
+ appId: getAppID(currentApp),
152
+ eventId: record.event_id
153
+ }
154
+ }).then(function (res) {
155
+ // 该事件在虚拟事件中有使用
156
+ if (res.data === 1) {
157
+ eventDelModal(record.event_id, '检测到该事件在虚拟事件中使用');
158
+ } else {
159
+ eventDelModal(record.event_id, '删除后,将停止采集该事件数据,也将不在分析平台中显示!');
160
+ }
161
+ });
162
+ } else {
163
+ eventDelModal(record.event_id, '删除后,将停止采集该事件数据,也将不在分析平台中显示!');
164
+ }
165
+ } else {
166
+ message.error('内置事件无法删除');
167
+ }
168
+ };
169
+ var eventDelModal = function eventDelModal(eventId, text) {
141
170
  Modal.confirm({
142
171
  centered: true,
143
172
  title: '是否确认删除?',
144
- content: '删除后,将停止采集该事件数据,也将不在分析平台中显示!',
173
+ content: text,
145
174
  okText: '确认',
146
175
  cancelText: '取消',
147
176
  maskClosable: false,
148
177
  onOk: function onOk() {
149
178
  request(apis.deleteEventMeta, {
150
179
  method: 'post',
151
- params: {
152
- app_id: getAppID(currentApp),
153
- event_id: event_id
180
+ data: {
181
+ appId: getAppID(currentApp),
182
+ eventId: eventId
154
183
  }
155
184
  }).then(function (res) {
156
185
  if (res) {
157
186
  message.success('删除成功');
158
187
  props.Refresh();
159
188
  }
160
- }).catch(function (err) {}).finally(function () {});
189
+ });
161
190
  }
162
191
  });
163
192
  };
@@ -172,26 +201,26 @@ var TablePlus = function TablePlus(props) {
172
201
  break;
173
202
  case 'is_stop':
174
203
  _temp = {
175
- is_stop: e
204
+ isStop: e
176
205
  };
177
206
  break;
178
207
  case 'mark_type':
179
208
  _temp = {
180
- mark_type: e == null ? 1 : 0
209
+ markType: e == null ? 1 : 0
181
210
  };
182
211
  break;
183
212
  }
184
213
  request(apis.updateEventInfo, {
185
214
  method: 'post',
186
215
  params: _objectSpread({
187
- app_id: getAppID(currentApp),
188
- event_id: record.event_id
216
+ appId: getAppID(currentApp),
217
+ eventId: record.event_id
189
218
  }, _temp)
190
- }).then(function (res) {
219
+ }).then(function () {
191
220
  message.success('修改成功');
192
221
  props.Refresh();
193
222
  state.updateEventMetas && state.updateEventMetas(); // 更新store
194
- }).catch(function (err) {}).finally(function () {});
223
+ });
195
224
  };
196
225
  // 复制事件名称
197
226
  var copyEventName = function copyEventName(event_name) {
@@ -210,17 +239,16 @@ var TablePlus = function TablePlus(props) {
210
239
  }
211
240
  };
212
241
  // 手否筛选收藏
213
- var _useState9 = useState(false),
214
- _useState10 = _slicedToArray(_useState9, 2),
215
- markActive = _useState10[0],
216
- setMarkActive = _useState10[1];
242
+ var _useState13 = useState(false),
243
+ _useState14 = _slicedToArray(_useState13, 2),
244
+ markActive = _useState14[0],
245
+ setMarkActive = _useState14[1];
217
246
  // 分组操作-勾选数据
218
- var _useState11 = useState({}),
219
- _useState12 = _slicedToArray(_useState11, 2),
220
- groupCheckedData = _useState12[0],
221
- setGroupCheckedData = _useState12[1];
247
+ var _useState15 = useState({}),
248
+ _useState16 = _slicedToArray(_useState15, 2),
249
+ groupCheckedData = _useState16[0],
250
+ setGroupCheckedData = _useState16[1];
222
251
  var eventItemCheckbox = function eventItemCheckbox(e, data) {
223
- // console.log(e.target.checked, data._groupId, data.event_id);
224
252
  var _groupCheckedData = _.cloneDeep(groupCheckedData);
225
253
  if (e.target.checked) {
226
254
  _groupCheckedData[data._groupId] == undefined ? _groupCheckedData[data._groupId] = [] : null;
@@ -232,12 +260,8 @@ var TablePlus = function TablePlus(props) {
232
260
  }
233
261
  setGroupCheckedData(_groupCheckedData);
234
262
  };
235
- // useEffect(() => {
236
- // console.log('groupCheckedData', groupCheckedData);
237
- // }, [groupCheckedData]);
238
263
  // 判断每一行的选中
239
264
  var checkedItemHandle = function checkedItemHandle(record) {
240
- // console.log(record.event_id, record._groupId, groupCheckedData);
241
265
  if (Object.keys(groupCheckedData).length <= 0) {
242
266
  return false;
243
267
  } else {
@@ -246,7 +270,6 @@ var TablePlus = function TablePlus(props) {
246
270
  };
247
271
  // 移入到组、移出分组、复制到组
248
272
  var groupHandle = function groupHandle(type, data, eventGroupId) {
249
- // console.log('type', type, eventGroupId, data.groupId);
250
273
  var _temp = {};
251
274
  if (eventGroupId != undefined) _temp = {
252
275
  eventGroupId: eventGroupId
@@ -270,7 +293,7 @@ var TablePlus = function TablePlus(props) {
270
293
  setGroupCheckedData({});
271
294
  state.updateEventMetas && state.updateEventMetas(); // 更新store
272
295
  }
273
- }).catch(function (err) {}).finally(function () {
296
+ }).finally(function () {
274
297
  props.Refresh();
275
298
  });
276
299
  };
@@ -307,7 +330,7 @@ var TablePlus = function TablePlus(props) {
307
330
  key: 'event_name',
308
331
  fixed: 'left',
309
332
  width: 180,
310
- render: function render(text, record, index) {
333
+ render: function render(text, record) {
311
334
  if (record.groupId) {
312
335
  var _groupCheckedData$rec;
313
336
  return /*#__PURE__*/React.createElement("div", {
@@ -376,46 +399,34 @@ var TablePlus = function TablePlus(props) {
376
399
  dataIndex: 'alias_name',
377
400
  key: 'alias_name',
378
401
  width: 167,
379
- render: function render(text, record, index) {
380
- if (!record.alias_name) {
381
- return /*#__PURE__*/React.createElement(Input, {
382
- className: "alias_name",
383
- placeholder: "\u7F16\u8F91\u522B\u540D",
384
- disabled: isDemo,
385
- defaultValue: record.alias_name,
386
- onFocus: aliasFocus,
387
- onBlur: function onBlur(e) {
388
- aliasNameBlur(e, record);
389
- }
390
- });
391
- } else {
392
- return /*#__PURE__*/React.createElement(Popover, {
393
- content: /*#__PURE__*/React.createElement("div", {
394
- style: {
395
- width: '200px',
396
- wordBreak: 'break-all'
397
- }
398
- }, record.alias_name),
399
- trigger: "hover",
400
- placement: "top"
401
- }, /*#__PURE__*/React.createElement(Input, {
402
- className: "alias_name",
403
- placeholder: "\u7F16\u8F91\u522B\u540D",
404
- disabled: isDemo,
405
- defaultValue: record.alias_name,
406
- onFocus: aliasFocus,
407
- onBlur: function onBlur(e) {
408
- aliasNameBlur(e, record);
402
+ render: function render(_, record) {
403
+ return /*#__PURE__*/React.createElement("div", {
404
+ className: "alias_name"
405
+ }, /*#__PURE__*/React.createElement(Popover, {
406
+ content: /*#__PURE__*/React.createElement("div", {
407
+ style: {
408
+ width: '200px',
409
+ wordBreak: 'break-all'
409
410
  }
410
- }));
411
- }
411
+ }, record.alias_name),
412
+ trigger: "hover",
413
+ placement: "top"
414
+ }, /*#__PURE__*/React.createElement("div", null, record.alias_name)), /*#__PURE__*/React.createElement(IconFont, {
415
+ className: "edit-alias-name",
416
+ onClick: function onClick() {
417
+ setAliasNameInput(record.alias_name);
418
+ setAliasNameId(record.event_id);
419
+ setaliasNameShow(true);
420
+ },
421
+ type: "zhongmingming"
422
+ }));
412
423
  }
413
424
  }, {
414
425
  title: '首次上报时间',
415
426
  dataIndex: 'insert_time',
416
427
  key: 'insert_time',
417
428
  width: 187,
418
- render: function render(text, record, index) {
429
+ render: function render(text) {
419
430
  return /*#__PURE__*/React.createElement("div", {
420
431
  className: "insert_time"
421
432
  }, text);
@@ -425,7 +436,7 @@ var TablePlus = function TablePlus(props) {
425
436
  dataIndex: 'last_insert_time',
426
437
  key: 'last_insert_time',
427
438
  width: 187,
428
- render: function render(text, record, index) {
439
+ render: function render(_, record) {
429
440
  return /*#__PURE__*/React.createElement("div", null, record.last_insert_time);
430
441
  }
431
442
  }, {
@@ -453,7 +464,7 @@ var TablePlus = function TablePlus(props) {
453
464
  dataIndex: 'event_hidden',
454
465
  key: 'event_hidden',
455
466
  width: 167,
456
- render: function render(text, record, index) {
467
+ render: function render(_, record) {
457
468
  return /*#__PURE__*/React.createElement(Select, {
458
469
  defaultValue: record.event_hidden,
459
470
  style: {
@@ -498,7 +509,7 @@ var TablePlus = function TablePlus(props) {
498
509
  dataIndex: 'is_stop',
499
510
  key: 'is_stop',
500
511
  width: 167,
501
- render: function render(text, record, index) {
512
+ render: function render(_, record) {
502
513
  return /*#__PURE__*/React.createElement(Select, {
503
514
  defaultValue: record.is_stop,
504
515
  style: {
@@ -522,12 +533,16 @@ var TablePlus = function TablePlus(props) {
522
533
  dataIndex: 'event_attrs',
523
534
  key: 'event_attrs',
524
535
  width: 167,
525
- render: function render(text, record, index) {
536
+ render: function render(_, record) {
526
537
  return /*#__PURE__*/React.createElement("div", {
527
538
  className: "event_attrs"
528
539
  }, record.event_attrs.length, /*#__PURE__*/React.createElement(IconFont, {
529
540
  type: "bianji1",
530
541
  onClick: function onClick() {
542
+ if (!authority[1000003]) {
543
+ message.error('无修改权限');
544
+ return;
545
+ }
531
546
  props.eventAttrDataHandle(record);
532
547
  }
533
548
  }));
@@ -536,17 +551,17 @@ var TablePlus = function TablePlus(props) {
536
551
  title: '操作',
537
552
  dataIndex: 'set',
538
553
  key: 'set',
539
- width: 80,
554
+ width: 110,
540
555
  fixed: 'right',
541
- render: function render(text, record, index) {
556
+ render: function render(_, record) {
542
557
  if (record.groupId) {
543
558
  if (record.groupId == -1) return '';
544
559
  return /*#__PURE__*/React.createElement("div", {
545
560
  className: "edit-del"
546
561
  }, /*#__PURE__*/React.createElement(IconFont, {
547
562
  onClick: function onClick() {
548
- if (isDemo) {
549
- message.error('demo环境无法修改');
563
+ if (!authority[1000003]) {
564
+ message.error('无修改权限');
550
565
  return;
551
566
  }
552
567
  setEventNameData({
@@ -559,8 +574,8 @@ var TablePlus = function TablePlus(props) {
559
574
  type: "bianji"
560
575
  }), /*#__PURE__*/React.createElement(IconFont, {
561
576
  onClick: function onClick() {
562
- if (isDemo) {
563
- message.error('demo环境无法删除');
577
+ if (!authority[1000004]) {
578
+ message.error('无修改权限');
564
579
  return;
565
580
  }
566
581
  eventNameDel(record.groupId);
@@ -571,39 +586,20 @@ var TablePlus = function TablePlus(props) {
571
586
  return /*#__PURE__*/React.createElement("div", {
572
587
  className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
573
588
  onClick: function onClick() {
574
- if (isDemo) {
575
- message.error('demo环境无法删除');
589
+ if (!authority[1000005]) {
590
+ message.error('无修改权限');
576
591
  return;
577
592
  }
578
- record.owner != 'zg_abp' ? eventItemDel(record.event_id) : message.error('内置事件无法删除');
593
+ eventItemDel(record);
579
594
  }
580
595
  }, "\u5220\u9664");
581
596
  }
582
597
  }
583
598
  }];
584
- // const [isMore, setIsMore] = useState(true); // 是否还有数据
585
- // const [pageNumber, setPageNumber] = useState(1); // 页码
586
- // let scrollRef: any;
587
- // const onScrollCapture = (e:any) => {
588
- // // scrollTop会有小数点导致等式不成立,解决方案:四舍五入
589
- // if (
590
- // Math.round(scrollRef.scrollTop) + scrollRef.clientHeight == scrollRef.scrollHeight
591
- // ) {
592
- // if (Math.ceil(props.total / 10) == pageNumber) {
593
- // setIsMore(false);
594
- // return false;
595
- // }
596
- // // getList(page + 1);
597
- // setPageNumber(pageNumber + 1);
598
- // }
599
- // };
600
- // useEffect(() => {
601
- // pageNumber != 1 && props.pageSizeChange(pageNumber);
602
- // }, [pageNumber]);
603
- var _useState13 = useState(''),
604
- _useState14 = _slicedToArray(_useState13, 2),
605
- scrollY = _useState14[0],
606
- setScrollY = _useState14[1];
599
+ var _useState17 = useState(''),
600
+ _useState18 = _slicedToArray(_useState17, 2),
601
+ scrollY = _useState18[0],
602
+ setScrollY = _useState18[1];
607
603
  //页面加载完成后才能获取到对应的元素及其位置
608
604
  useEffect(function () {
609
605
  var _Y = getTableScroll(102);
@@ -615,7 +611,6 @@ var TablePlus = function TablePlus(props) {
615
611
  }, /*#__PURE__*/React.createElement(Table, {
616
612
  className: "".concat(classPrefix, "-table"),
617
613
  id: "tablePlus",
618
- // style={{ minHeight: '640px' }}
619
614
  columns: columns,
620
615
  rowKey: "key",
621
616
  loading: props.loading,
@@ -647,6 +642,24 @@ var TablePlus = function TablePlus(props) {
647
642
  onChange: function onChange(e) {
648
643
  return setEventNameInput(e.currentTarget.value);
649
644
  }
645
+ })), /*#__PURE__*/React.createElement(Modal, {
646
+ title: "\u4FEE\u6539\u4E8B\u4EF6\u522B\u540D",
647
+ bodyStyle: {
648
+ padding: '0 24px 24px 24px'
649
+ },
650
+ destroyOnClose: true,
651
+ open: aliasNameShow,
652
+ getContainer: false,
653
+ onOk: aliasNameEdit,
654
+ onCancel: function onCancel() {
655
+ return setaliasNameShow(false);
656
+ }
657
+ }, /*#__PURE__*/React.createElement(Input, {
658
+ placeholder: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u522B\u540D",
659
+ value: aliasNameInput,
660
+ onChange: function onChange(e) {
661
+ return setAliasNameInput(e.currentTarget.value);
662
+ }
650
663
  })));
651
664
  };
652
665
  export default TablePlus;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import '../styles/index.less';
3
+ import { TablePlusType } from '../types';
4
+ declare const VirtualTablePlus: React.FC<TablePlusType>;
5
+ export default VirtualTablePlus;