@zgfe/modules-dm 1.0.31 → 1.0.34-heyh.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.
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 +54 -83
  6. package/es/modules/dataCollection/components/createVirtualDrawer.d.ts +4 -0
  7. package/es/modules/dataCollection/components/createVirtualDrawer.js +227 -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 +385 -0
  15. package/es/modules/dataCollection/components/selectAttributes.d.ts +3 -0
  16. package/es/modules/dataCollection/components/selectAttributes.js +210 -0
  17. package/es/modules/dataCollection/components/sortableComponnet.d.ts +3 -0
  18. package/es/modules/dataCollection/components/sortableComponnet.js +109 -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} +162 -147
  21. package/es/modules/dataCollection/components/virtualTablePlus.d.ts +5 -0
  22. package/es/modules/dataCollection/components/virtualTablePlus.js +383 -0
  23. package/es/modules/dataCollection/index.js +10 -9
  24. package/es/modules/dataCollection/styles/index.less +381 -18
  25. package/es/modules/dataCollection/types.d.ts +76 -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 +337 -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,109 @@
1
+ import { BizGlobalDataContext } from '@zgfe/business-lib';
2
+ import { Checkbox, Tooltip } 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
+ var name = item.alias_name ? item.alias_name : item.event_name;
25
+ return /*#__PURE__*/React.createElement(Tooltip, {
26
+ title: "".concat(item.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(name),
27
+ key: index
28
+ }, /*#__PURE__*/React.createElement(Checkbox, {
29
+ className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
30
+ checked: item.checked,
31
+ key: index,
32
+ onChange: function onChange() {
33
+ return onChangeItem(groupId, item.event_id);
34
+ }
35
+ }, name));
36
+ });
37
+ // 不可拖动的元素(未分组数据)
38
+ var SortableItemNotDrag = function SortableItemNotDrag(data) {
39
+ var item = data.item,
40
+ index = data.index;
41
+ var name = item.alias_name ? item.alias_name : item.event_name;
42
+ return /*#__PURE__*/React.createElement(Tooltip, {
43
+ title: "".concat(item.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(name),
44
+ key: index
45
+ }, /*#__PURE__*/React.createElement(Checkbox, {
46
+ className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
47
+ checked: item.checked,
48
+ key: index,
49
+ onChange: function onChange() {
50
+ return onChangeItem(groupId, item.event_id);
51
+ }
52
+ }, name));
53
+ };
54
+ // 整个元素排序的容器
55
+ var SortableList = SortableContainer(function () {
56
+ return /*#__PURE__*/React.createElement("div", {
57
+ key: componnetIndex
58
+ }, componnetData.map(function (item, index) {
59
+ if (groupId !== -1) {
60
+ return /*#__PURE__*/React.createElement(SortableItem, {
61
+ key: "item-".concat(index),
62
+ index: index,
63
+ value: {
64
+ item: item,
65
+ index: index
66
+ }
67
+ });
68
+ } else {
69
+ return SortableItemNotDrag({
70
+ item: item,
71
+ index: index
72
+ });
73
+ }
74
+ }));
75
+ });
76
+ var onChangeItem = function onChangeItem(groupId, eventId) {
77
+ setGroupingData(_.cloneDeep(eventChecked(groupId, eventId, groupingData)));
78
+ };
79
+ var onSortEnd = function onSortEnd(data) {
80
+ var oldIndex = data.oldIndex,
81
+ newIndex = data.newIndex;
82
+ var eventList = arrayMoveImmutable(componnetData, oldIndex, newIndex);
83
+ var ids = [];
84
+ eventList.map(function (item) {
85
+ ids.push(item.event_id);
86
+ });
87
+ groupingData.map(function (item) {
88
+ if (item.groupId === groupId) {
89
+ item.eventList = eventList;
90
+ }
91
+ });
92
+ setGroupingData(_.cloneDeep(groupingData));
93
+ request(apis.orderEvent, {
94
+ method: 'post',
95
+ data: {
96
+ appId: getAppID(currentApp),
97
+ groupId: groupId,
98
+ ids: ids.join(',')
99
+ }
100
+ }).then(function () {});
101
+ };
102
+ return /*#__PURE__*/React.createElement(SortableList, {
103
+ distance: 5,
104
+ axis: 'xy',
105
+ helperClass: "".concat(classPrefix, "-sortableList"),
106
+ onSortEnd: onSortEnd
107
+ });
108
+ };
109
+ 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,36 @@ 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", {
415
+ className: 'alias_name_text'
416
+ }, record.alias_name)), /*#__PURE__*/React.createElement(IconFont, {
417
+ className: "edit-alias-name",
418
+ onClick: function onClick() {
419
+ setAliasNameInput(record.alias_name);
420
+ setAliasNameId(record.event_id);
421
+ setaliasNameShow(true);
422
+ },
423
+ type: "zhongmingming"
424
+ }));
412
425
  }
413
426
  }, {
414
427
  title: '首次上报时间',
415
428
  dataIndex: 'insert_time',
416
429
  key: 'insert_time',
417
430
  width: 187,
418
- render: function render(text, record, index) {
431
+ render: function render(text) {
419
432
  return /*#__PURE__*/React.createElement("div", {
420
433
  className: "insert_time"
421
434
  }, text);
@@ -425,7 +438,7 @@ var TablePlus = function TablePlus(props) {
425
438
  dataIndex: 'last_insert_time',
426
439
  key: 'last_insert_time',
427
440
  width: 187,
428
- render: function render(text, record, index) {
441
+ render: function render(_, record) {
429
442
  return /*#__PURE__*/React.createElement("div", null, record.last_insert_time);
430
443
  }
431
444
  }, {
@@ -453,7 +466,7 @@ var TablePlus = function TablePlus(props) {
453
466
  dataIndex: 'event_hidden',
454
467
  key: 'event_hidden',
455
468
  width: 167,
456
- render: function render(text, record, index) {
469
+ render: function render(_, record) {
457
470
  return /*#__PURE__*/React.createElement(Select, {
458
471
  defaultValue: record.event_hidden,
459
472
  style: {
@@ -498,7 +511,7 @@ var TablePlus = function TablePlus(props) {
498
511
  dataIndex: 'is_stop',
499
512
  key: 'is_stop',
500
513
  width: 167,
501
- render: function render(text, record, index) {
514
+ render: function render(_, record) {
502
515
  return /*#__PURE__*/React.createElement(Select, {
503
516
  defaultValue: record.is_stop,
504
517
  style: {
@@ -522,12 +535,16 @@ var TablePlus = function TablePlus(props) {
522
535
  dataIndex: 'event_attrs',
523
536
  key: 'event_attrs',
524
537
  width: 167,
525
- render: function render(text, record, index) {
538
+ render: function render(_, record) {
526
539
  return /*#__PURE__*/React.createElement("div", {
527
540
  className: "event_attrs"
528
541
  }, record.event_attrs.length, /*#__PURE__*/React.createElement(IconFont, {
529
542
  type: "bianji1",
530
543
  onClick: function onClick() {
544
+ if (!authority[1000003]) {
545
+ message.error('无修改权限');
546
+ return;
547
+ }
531
548
  props.eventAttrDataHandle(record);
532
549
  }
533
550
  }));
@@ -536,17 +553,17 @@ var TablePlus = function TablePlus(props) {
536
553
  title: '操作',
537
554
  dataIndex: 'set',
538
555
  key: 'set',
539
- width: 80,
556
+ width: 110,
540
557
  fixed: 'right',
541
- render: function render(text, record, index) {
558
+ render: function render(_, record) {
542
559
  if (record.groupId) {
543
560
  if (record.groupId == -1) return '';
544
561
  return /*#__PURE__*/React.createElement("div", {
545
562
  className: "edit-del"
546
563
  }, /*#__PURE__*/React.createElement(IconFont, {
547
564
  onClick: function onClick() {
548
- if (isDemo) {
549
- message.error('demo环境无法修改');
565
+ if (!authority[1000003]) {
566
+ message.error('无修改权限');
550
567
  return;
551
568
  }
552
569
  setEventNameData({
@@ -559,8 +576,8 @@ var TablePlus = function TablePlus(props) {
559
576
  type: "bianji"
560
577
  }), /*#__PURE__*/React.createElement(IconFont, {
561
578
  onClick: function onClick() {
562
- if (isDemo) {
563
- message.error('demo环境无法删除');
579
+ if (!authority[1000004]) {
580
+ message.error('无修改权限');
564
581
  return;
565
582
  }
566
583
  eventNameDel(record.groupId);
@@ -571,39 +588,20 @@ var TablePlus = function TablePlus(props) {
571
588
  return /*#__PURE__*/React.createElement("div", {
572
589
  className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
573
590
  onClick: function onClick() {
574
- if (isDemo) {
575
- message.error('demo环境无法删除');
591
+ if (!authority[1000005]) {
592
+ message.error('无修改权限');
576
593
  return;
577
594
  }
578
- record.owner != 'zg_abp' ? eventItemDel(record.event_id) : message.error('内置事件无法删除');
595
+ eventItemDel(record);
579
596
  }
580
597
  }, "\u5220\u9664");
581
598
  }
582
599
  }
583
600
  }];
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];
601
+ var _useState17 = useState(''),
602
+ _useState18 = _slicedToArray(_useState17, 2),
603
+ scrollY = _useState18[0],
604
+ setScrollY = _useState18[1];
607
605
  //页面加载完成后才能获取到对应的元素及其位置
608
606
  useEffect(function () {
609
607
  var _Y = getTableScroll(102);
@@ -615,7 +613,6 @@ var TablePlus = function TablePlus(props) {
615
613
  }, /*#__PURE__*/React.createElement(Table, {
616
614
  className: "".concat(classPrefix, "-table"),
617
615
  id: "tablePlus",
618
- // style={{ minHeight: '640px' }}
619
616
  columns: columns,
620
617
  rowKey: "key",
621
618
  loading: props.loading,
@@ -647,6 +644,24 @@ var TablePlus = function TablePlus(props) {
647
644
  onChange: function onChange(e) {
648
645
  return setEventNameInput(e.currentTarget.value);
649
646
  }
647
+ })), /*#__PURE__*/React.createElement(Modal, {
648
+ title: "\u4FEE\u6539\u4E8B\u4EF6\u522B\u540D",
649
+ bodyStyle: {
650
+ padding: '0 24px 24px 24px'
651
+ },
652
+ destroyOnClose: true,
653
+ open: aliasNameShow,
654
+ getContainer: false,
655
+ onOk: aliasNameEdit,
656
+ onCancel: function onCancel() {
657
+ return setaliasNameShow(false);
658
+ }
659
+ }, /*#__PURE__*/React.createElement(Input, {
660
+ placeholder: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u522B\u540D",
661
+ value: aliasNameInput,
662
+ onChange: function onChange(e) {
663
+ return setAliasNameInput(e.currentTarget.value);
664
+ }
650
665
  })));
651
666
  };
652
667
  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;