@zgfe/modules-dm 1.0.34-heyh.2 → 1.0.34-heyh.20

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.
@@ -16,7 +16,7 @@ var DemoWrapper2 = function DemoWrapper2(props) {
16
16
  }
17
17
  }, /*#__PURE__*/React.createElement(DemoWrapper, {
18
18
  needMeta: true,
19
- defaultApp: 209
19
+ defaultApp: 279
20
20
  }, props.children)));
21
21
  };
22
22
  export default DemoWrapper2;
@@ -148,10 +148,6 @@ var CollectionEventList = function CollectionEventList(props) {
148
148
  message.error('请输入分组名称');
149
149
  return;
150
150
  }
151
- if (eventNameInput.length > 20) {
152
- message.error('名称不可超过20字符');
153
- return;
154
- }
155
151
  request(apis.upsertEventGroup, {
156
152
  method: 'post',
157
153
  data: {
@@ -428,7 +424,8 @@ var CollectionEventList = function CollectionEventList(props) {
428
424
  Refresh: refreshHandle
429
425
  })), /*#__PURE__*/React.createElement(EventGroupingDrawer, {
430
426
  eventGroupingShow: eventGroupingShow,
431
- setEventGroupingShow: setEventGroupingShow
427
+ setEventGroupingShow: setEventGroupingShow,
428
+ refresh: refreshHandle
432
429
  }), /*#__PURE__*/React.createElement(Modal, {
433
430
  title: "\u521B\u5EFA\u5206\u7EC4",
434
431
  className: "creact-group",
@@ -443,6 +440,7 @@ var CollectionEventList = function CollectionEventList(props) {
443
440
  }, /*#__PURE__*/React.createElement(Input, {
444
441
  placeholder: "\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",
445
442
  value: eventNameInput,
443
+ maxLength: 20,
446
444
  onChange: function onChange(e) {
447
445
  return setEventNameInput(e.currentTarget.value);
448
446
  }
@@ -11,13 +11,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
14
- import { Input, Button, Select, Drawer, Form } from 'antd';
14
+ import { Input, Button, Select, Drawer, Form, message, Modal } from 'antd';
15
15
  import { Fragment } from 'react';
16
+ import moment from 'moment';
16
17
  var TextArea = Input.TextArea;
17
18
  import request from '../../../utils/ajax';
18
19
  import apis from '../../../constants/api';
19
20
  import React, { useContext, useState } from 'react';
20
- import { eventJsonHandle, getDelectAttributesData, getSubmitHandleData, getAppID } from '../../../utils';
21
+ import { eventJsonHandle, getDelectAttributesData, getSubmitHandleData, getAppID, getVirtualContentChange } from '../../../utils';
21
22
  import EventFilter from './eventFilter';
22
23
  import SelectAttributes from './selectAttributes';
23
24
  import _ from 'lodash';
@@ -33,22 +34,36 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
33
34
  _useState2 = _slicedToArray(_useState, 2),
34
35
  formSubmit = _useState2[0],
35
36
  setFormSubmit = _useState2[1];
37
+ var _useState3 = useState(),
38
+ _useState4 = _slicedToArray(_useState3, 2),
39
+ formSubmitData = _useState4[0],
40
+ setFormSubmitData = _useState4[1];
36
41
  var _useContext = useContext(BizGlobalDataContext),
37
42
  currentApp = _useContext.currentApp,
38
43
  eventGroupList = _useContext.eventGroupList;
39
- var _useState3 = useState(false),
40
- _useState4 = _slicedToArray(_useState3, 2),
41
- selectAttributesShow = _useState4[0],
42
- setSelectAttributesShow = _useState4[1];
43
- var _useState5 = useState({}),
44
+ var _useState5 = useState(false),
44
45
  _useState6 = _slicedToArray(_useState5, 2),
45
- selectAttributesData = _useState6[0],
46
- setSelectAttributesData = _useState6[1];
46
+ selectAttributesShow = _useState6[0],
47
+ setSelectAttributesShow = _useState6[1];
47
48
  var _useState7 = useState({}),
48
49
  _useState8 = _slicedToArray(_useState7, 2),
49
- submitData = _useState8[0],
50
- setSubmitData = _useState8[1];
51
- var onValuesChange = function onValuesChange(data, allData) {
50
+ selectAttributesData = _useState8[0],
51
+ setSelectAttributesData = _useState8[1];
52
+ var _useState9 = useState({}),
53
+ _useState10 = _slicedToArray(_useState9, 2),
54
+ submitData = _useState10[0],
55
+ setSubmitData = _useState10[1];
56
+ var _useState11 = useState([]),
57
+ _useState12 = _slicedToArray(_useState11, 2),
58
+ selectList = _useState12[0],
59
+ setSelectList = _useState12[1];
60
+ var onValuesChange = function onValuesChange(_, allData) {
61
+ var _selectList = [];
62
+ allData.eventJson.map(function (item) {
63
+ if (item === null || item === void 0 ? void 0 : item.eventId) _selectList.push(item.eventId);
64
+ });
65
+ setSelectList(_selectList);
66
+ setFormSubmitData(allData);
52
67
  setFormSubmit(eventJsonHandle(allData));
53
68
  };
54
69
  // 保存
@@ -76,9 +91,12 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
76
91
  platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform
77
92
  }, data)
78
93
  }).then(function (res) {
79
- if ((res === null || res === void 0 ? void 0 : res.code) === '100000') {
94
+ if ((res === null || res === void 0 ? void 0 : res.code) === '100000' && res.data === 1) {
95
+ message.success('编辑成功');
80
96
  refresh();
81
97
  setCreateVirtualShow(false);
98
+ } else {
99
+ message.error(res === null || res === void 0 ? void 0 : res.msg);
82
100
  }
83
101
  });
84
102
  } else {
@@ -89,13 +107,39 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
89
107
  platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform
90
108
  }, data)
91
109
  }).then(function (res) {
92
- if ((res === null || res === void 0 ? void 0 : res.code) === '100000') {
110
+ if ((res === null || res === void 0 ? void 0 : res.code) === '100000' && res.data === 1) {
111
+ message.success('创建成功');
93
112
  refresh();
94
113
  setCreateVirtualShow(false);
114
+ } else {
115
+ message.error(res === null || res === void 0 ? void 0 : res.msg);
95
116
  }
96
117
  });
97
118
  }
98
119
  };
120
+ var onClose = function onClose() {
121
+ if (virtualDrawerType === "edit") {
122
+ if (formSubmit && getVirtualContentChange(_.cloneDeep(editVirtualEventData), _.cloneDeep(formSubmitData))) {
123
+ Modal.confirm({
124
+ centered: true,
125
+ title: '内容发生了修改,请确认是否保存修改内容',
126
+ okText: '确认',
127
+ cancelText: '取消',
128
+ maskClosable: false,
129
+ onOk: function onOk() {
130
+ onFinish(formSubmitData);
131
+ },
132
+ onCancel: function onCancel() {
133
+ setCreateVirtualShow(false);
134
+ }
135
+ });
136
+ } else {
137
+ setCreateVirtualShow(false);
138
+ }
139
+ } else {
140
+ setCreateVirtualShow(false);
141
+ }
142
+ };
99
143
  var editGroupOptions = function editGroupOptions(eventGroupId) {
100
144
  var text = '';
101
145
  groupOptions.map(function (item) {
@@ -107,23 +151,19 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
107
151
  };
108
152
  return /*#__PURE__*/React.createElement(Drawer, {
109
153
  className: classPrefix,
110
- width: '60%',
154
+ width: 700,
111
155
  title: "".concat(virtualDrawerType === 'edit' ? '编辑' : virtualDrawerType === 'see' ? '查看' : '创建', "\u865A\u62DF\u4E8B\u4EF6"),
112
156
  placement: "right",
113
157
  destroyOnClose: true,
114
- onClose: function onClose() {
115
- return setCreateVirtualShow(false);
116
- },
158
+ onClose: onClose,
117
159
  open: createVirtualShow,
118
160
  extra: /*#__PURE__*/React.createElement(IconFont, {
119
161
  type: "qingchu",
120
- onClick: function onClick() {
121
- setCreateVirtualShow(false);
122
- }
162
+ onClick: onClose
123
163
  })
124
164
  }, /*#__PURE__*/React.createElement(Fragment, null, virtualDrawerType === 'see' && /*#__PURE__*/React.createElement("div", {
125
165
  className: "".concat(classPrefix, "-see-box")
126
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u540D\u79F0"), editVirtualEventData.eventName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u522B\u540D"), editVirtualEventData.aliasName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5206\u7EC4"), editGroupOptions(editVirtualEventData.eventGroupId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5907\u6CE8"), editVirtualEventData.description), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u4EBA"), editVirtualEventData.createUser), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u65F6\u95F4"), editVirtualEventData.insertTime), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u66F4\u65B0\u65F6\u95F4"), editVirtualEventData.updateTime)), /*#__PURE__*/React.createElement(Form, {
166
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u540D\u79F0"), editVirtualEventData.eventName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u522B\u540D"), editVirtualEventData.aliasName), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5206\u7EC4"), editGroupOptions((editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === null ? -1 : editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u5907\u6CE8"), editVirtualEventData.description), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u4EBA"), editVirtualEventData.createUser), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u521B\u5EFA\u65F6\u95F4"), moment(editVirtualEventData.insertTime).format('YYYY-MM-DD HH:mm:ss')), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, "\u66F4\u65B0\u65F6\u95F4"), moment(editVirtualEventData.updateTime).format('YYYY-MM-DD HH:mm:ss'))), /*#__PURE__*/React.createElement(Form, {
127
167
  name: "basic",
128
168
  labelCol: {
129
169
  span: 2
@@ -132,7 +172,8 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
132
172
  span: 16
133
173
  },
134
174
  initialValues: _objectSpread(_objectSpread({}, editVirtualEventData), {}, {
135
- desc: editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.description
175
+ desc: editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.description,
176
+ eventGroupId: (editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === null || (editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId) === undefined ? -1 : editVirtualEventData === null || editVirtualEventData === void 0 ? void 0 : editVirtualEventData.groupId
136
177
  }),
137
178
  onFinish: onFinish,
138
179
  onValuesChange: onValuesChange,
@@ -148,25 +189,29 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
148
189
  message: '仅能输入英文、符号、数字'
149
190
  }]
150
191
  }, /*#__PURE__*/React.createElement(Input, {
151
- maxLength: 50
192
+ maxLength: 20,
193
+ disabled: virtualDrawerType === 'edit'
152
194
  })), /*#__PURE__*/React.createElement(Form.Item, {
153
195
  label: "\u522B\u540D",
154
196
  name: "aliasName",
155
197
  rules: [{
156
198
  required: true,
157
- message: '请输入虚拟事件名称'
199
+ message: '请输入虚拟事件别名'
158
200
  }]
159
201
  }, /*#__PURE__*/React.createElement(Input, {
160
- maxLength: 50
202
+ maxLength: 20
161
203
  })), /*#__PURE__*/React.createElement(Form.Item, {
162
204
  label: "\u5206\u7EC4",
163
205
  name: "eventGroupId"
164
206
  }, /*#__PURE__*/React.createElement(Select, {
165
207
  defaultValue: -1,
166
- options: groupOptions
208
+ options: groupOptions.filter(function (item) {
209
+ return item.value !== -999;
210
+ })
167
211
  })), /*#__PURE__*/React.createElement(Form.Item, {
168
212
  label: "\u5907\u6CE8",
169
- name: "desc"
213
+ name: "desc",
214
+ className: "".concat(classPrefix, "-desc")
170
215
  }, /*#__PURE__*/React.createElement(TextArea, {
171
216
  rows: 4,
172
217
  placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8",
@@ -189,7 +234,8 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
189
234
  }), /*#__PURE__*/React.createElement(EventFilter, {
190
235
  remove: remove,
191
236
  index: _index,
192
- virtualDrawerType: virtualDrawerType
237
+ virtualDrawerType: virtualDrawerType,
238
+ selectList: selectList
193
239
  }));
194
240
  }), fields.length < 10 && virtualDrawerType !== 'see' && /*#__PURE__*/React.createElement("div", {
195
241
  className: "".concat(classPrefix, "-add")
@@ -207,7 +253,8 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
207
253
  }))), virtualDrawerType !== 'see' && /*#__PURE__*/React.createElement("div", {
208
254
  className: "".concat(classPrefix, "-formSubmit")
209
255
  }, /*#__PURE__*/React.createElement(Button, {
210
- type: "default"
256
+ type: "default",
257
+ onClick: onClose
211
258
  }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
212
259
  type: "primary",
213
260
  htmlType: "submit",
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { Tooltip } from 'antd';
13
+ import { Tooltip, message } from 'antd';
14
14
  import React, { useEffect, useRef, useState } from 'react';
15
15
  import { BizEventSelector, BizAttrConditionGroup, IconFont } from '@zgfe/business-lib';
16
16
  import './styles/index.less';
@@ -18,7 +18,8 @@ var classPrefix = 'eventfilter-box';
18
18
  var EventFilter = function EventFilter(props) {
19
19
  var remove = props.remove,
20
20
  index = props.index,
21
- virtualDrawerType = props.virtualDrawerType;
21
+ virtualDrawerType = props.virtualDrawerType,
22
+ selectList = props.selectList;
22
23
  // 筛选条件个数
23
24
  var _useState = useState(props.value && props.value.filters && props.value.filters.conditions ? props.value.filters.conditions.length : 0),
24
25
  _useState2 = _slicedToArray(_useState, 2),
@@ -56,6 +57,11 @@ var EventFilter = function EventFilter(props) {
56
57
  var onAdd = function onAdd() {
57
58
  // 最多可添加5条属性筛选
58
59
  if (count >= 5) {
60
+ message.error('最多可添加5条属性筛选');
61
+ return;
62
+ }
63
+ if (selectList.length <= 0) {
64
+ message.error('请选择事件');
59
65
  return;
60
66
  }
61
67
  setIsAdd(true);
@@ -103,6 +109,7 @@ var EventFilter = function EventFilter(props) {
103
109
  popupContainer: false,
104
110
  defaultSelectAble: false,
105
111
  disableVirtualEventShow: true,
112
+ selectList: selectList,
106
113
  value: event && event.eventId ? {
107
114
  event: {
108
115
  id: event.eventId,
@@ -115,7 +122,7 @@ var EventFilter = function EventFilter(props) {
115
122
  placement: "top",
116
123
  title: '添加属性筛选'
117
124
  }, /*#__PURE__*/React.createElement(IconFont, {
118
- className: "".concat(count >= 5 ? 'disable' : ''),
125
+ className: "".concat(count < 5 && selectList.length > 0 ? '' : 'disable'),
119
126
  type: "shaixuan",
120
127
  onClick: function onClick() {
121
128
  return onAdd();
@@ -127,6 +134,8 @@ var EventFilter = function EventFilter(props) {
127
134
  value: filter,
128
135
  onlyAnd: true,
129
136
  enableEventProp: true,
137
+ enableUserProp: false,
138
+ enableEnvProp: false,
130
139
  enableDelete: true,
131
140
  eventIdList: (event === null || event === void 0 ? void 0 : event.eventId) ? [event === null || event === void 0 ? void 0 : event.eventId] : [],
132
141
  onChange: onChangeFilters,
@@ -48,4 +48,5 @@ export interface EventFilterProps {
48
48
  remove: (index: number | number[]) => void;
49
49
  index: number;
50
50
  virtualDrawerType: string;
51
+ selectList: [];
51
52
  }
@@ -10,19 +10,20 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
13
+ import { BizGlobalDataContext, IconFont, BizLoading } from '@zgfe/business-lib';
14
14
  import { Input, Modal, message, Drawer, Popover, Checkbox, Select, Button } from 'antd';
15
15
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
16
16
  import request from '../../../utils/ajax';
17
17
  import apis from '../../../constants/api';
18
- import { eventListHandle, groupListSort, eventCheckedAll, openChangeData, groupDeleteData, eventShowOrHiddenData, eventMoveData, getAppID } from '../../../utils/index';
18
+ import { eventListHandle, groupListSort, eventCheckedAll, openChangeData, eventShowOrHiddenData, eventMoveData, getAppID } from '../../../utils/index';
19
19
  import React, { Fragment, useContext, useEffect, useState } from 'react';
20
20
  import _ from 'lodash';
21
21
  import SortableComponnet from './sortableComponnet';
22
22
  var EventGroupingDrawer = function EventGroupingDrawer(props) {
23
23
  var classPrefix = 'event-grouping-drawer';
24
24
  var eventGroupingShow = props.eventGroupingShow,
25
- setEventGroupingShow = props.setEventGroupingShow;
25
+ setEventGroupingShow = props.setEventGroupingShow,
26
+ refresh = props.refresh;
26
27
  var _useContext = useContext(BizGlobalDataContext),
27
28
  currentApp = _useContext.currentApp;
28
29
  var _useState = useState([]),
@@ -33,7 +34,12 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
33
34
  _useState4 = _slicedToArray(_useState3, 2),
34
35
  isDragDisabled = _useState4[0],
35
36
  setIsDragDisabled = _useState4[1];
37
+ var _useState5 = useState(false),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ loading = _useState6[0],
40
+ setLoading = _useState6[1];
36
41
  var queryList = function queryList() {
42
+ setLoading(true);
37
43
  request(apis.queryCollectionEventList, {
38
44
  method: 'post',
39
45
  data: {
@@ -46,6 +52,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
46
52
  eventListHandle(res.data);
47
53
  setGroupingData(res.data);
48
54
  }
55
+ setLoading(false);
49
56
  });
50
57
  };
51
58
  useEffect(function () {
@@ -69,6 +76,8 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
69
76
  appId: getAppID(currentApp),
70
77
  ids: ids
71
78
  }
79
+ }).then(function () {
80
+ refresh();
72
81
  });
73
82
  }
74
83
  setIsDragDisabled(false);
@@ -96,7 +105,8 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
96
105
  }).then(function (res) {
97
106
  if (res) {
98
107
  message.success('删除成功');
99
- groupDeleteData(groupId, groupingData, setGroupingData);
108
+ queryList();
109
+ refresh();
100
110
  }
101
111
  });
102
112
  }
@@ -113,30 +123,32 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
113
123
  hidden: type,
114
124
  ids: ids
115
125
  }
126
+ }).then(function () {
127
+ refresh();
116
128
  });
117
129
  }
118
130
  };
119
131
  // 移动
120
- var _useState5 = useState(undefined),
121
- _useState6 = _slicedToArray(_useState5, 2),
122
- eventMoveShow = _useState6[0],
123
- setEventMoveShow = _useState6[1];
124
- var _useState7 = useState(-1),
132
+ var _useState7 = useState(undefined),
125
133
  _useState8 = _slicedToArray(_useState7, 2),
126
- eventMoveChangeId = _useState8[0],
127
- setEventMoveChangeId = _useState8[1];
128
- var _useState9 = useState([]),
134
+ eventMoveShow = _useState8[0],
135
+ setEventMoveShow = _useState8[1];
136
+ var _useState9 = useState(-1),
129
137
  _useState10 = _slicedToArray(_useState9, 2),
130
- eventMoveOption = _useState10[0],
131
- setEventMoveOption = _useState10[1];
132
- var _useState11 = useState(0),
138
+ eventMoveChangeId = _useState10[0],
139
+ setEventMoveChangeId = _useState10[1];
140
+ var _useState11 = useState([]),
133
141
  _useState12 = _slicedToArray(_useState11, 2),
134
- eventMoveLength = _useState12[0],
135
- setEventMoveLength = _useState12[1];
136
- var _useState13 = useState(''),
142
+ eventMoveOption = _useState12[0],
143
+ setEventMoveOption = _useState12[1];
144
+ var _useState13 = useState(0),
137
145
  _useState14 = _slicedToArray(_useState13, 2),
138
- eventMoveIds = _useState14[0],
139
- setEventMoveIds = _useState14[1];
146
+ eventMoveLength = _useState14[0],
147
+ setEventMoveLength = _useState14[1];
148
+ var _useState15 = useState(''),
149
+ _useState16 = _slicedToArray(_useState15, 2),
150
+ eventMoveIds = _useState16[0],
151
+ setEventMoveIds = _useState16[1];
140
152
  var eventMove = function eventMove(groupId) {
141
153
  var data = eventMoveData(groupId, groupingData, setGroupingData);
142
154
  setEventMoveOption(data.groupingOption);
@@ -163,6 +175,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
163
175
  }).then(function (res) {
164
176
  if (res.code == '00') {
165
177
  queryList();
178
+ refresh();
166
179
  }
167
180
  }).finally(function () {
168
181
  setEventMoveShow(undefined);
@@ -193,18 +206,18 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
193
206
  }, "\u786E\u5B9A")));
194
207
  };
195
208
  // 创建分组 & 修改分组名
196
- var _useState15 = useState(null),
197
- _useState16 = _slicedToArray(_useState15, 2),
198
- createOrEditGrpup = _useState16[0],
199
- setCreateOrEditGrpup = _useState16[1];
200
- var _useState17 = useState(-1),
209
+ var _useState17 = useState(null),
201
210
  _useState18 = _slicedToArray(_useState17, 2),
202
- grpupModalSelectGrpupId = _useState18[0],
203
- setGrpupModalSelectGrpupId = _useState18[1];
204
- var _useState19 = useState(''),
211
+ createOrEditGrpup = _useState18[0],
212
+ setCreateOrEditGrpup = _useState18[1];
213
+ var _useState19 = useState(-1),
205
214
  _useState20 = _slicedToArray(_useState19, 2),
206
- grpupNameInput = _useState20[0],
207
- setGrpupNameInput = _useState20[1];
215
+ grpupModalSelectGrpupId = _useState20[0],
216
+ setGrpupModalSelectGrpupId = _useState20[1];
217
+ var _useState21 = useState(''),
218
+ _useState22 = _slicedToArray(_useState21, 2),
219
+ grpupNameInput = _useState22[0],
220
+ setGrpupNameInput = _useState22[1];
208
221
  var GrpupModalHandle = function GrpupModalHandle() {
209
222
  if (grpupNameInput === '') {
210
223
  message.error('请填写分组名');
@@ -227,8 +240,9 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
227
240
  message.error('事件组名称已存在');
228
241
  }
229
242
  if ((res === null || res === void 0 ? void 0 : res.code) == '00') {
230
- message.success("".concat(createOrEditGrpup === 'create' ? '创建' : '编辑', "'\u6210\u529F'"));
243
+ message.success("".concat(createOrEditGrpup === 'create' ? '创建' : '编辑', "\u6210\u529F"));
231
244
  queryList();
245
+ refresh();
232
246
  GrpupModalClose();
233
247
  }
234
248
  });
@@ -240,7 +254,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
240
254
  };
241
255
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
242
256
  className: classPrefix,
243
- width: '60%',
257
+ width: 700,
244
258
  title: /*#__PURE__*/React.createElement("div", null, "\u4E8B\u4EF6\u5206\u7EC4\u7BA1\u7406", /*#__PURE__*/React.createElement("span", null, "\u7EDF\u4E00\u7BA1\u7406\u57CB\u70B9\u4E8B\u4EF6\u548C\u865A\u62DF\u4E8B\u4EF6\u4E1A\u52A1\u5206\u7EC4\uFF0C\u652F\u6301\u5BF9\u4E8B\u4EF6\u8C03\u6574\u6392\u5E8F\u548C\u9690\u85CF")),
245
259
  placement: "right",
246
260
  onClose: function onClose() {
@@ -262,6 +276,8 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
262
276
  setEventMoveShow(undefined);
263
277
  }
264
278
  }))
279
+ }, /*#__PURE__*/React.createElement(BizLoading, {
280
+ spinning: loading
265
281
  }, /*#__PURE__*/React.createElement(DragDropContext, {
266
282
  onDragEnd: onDragEnd
267
283
  }, groupingData.map(function (item, index) {
@@ -301,7 +317,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
301
317
  onClick: function onClick() {
302
318
  return openChange(item.groupId);
303
319
  }
304
- }), /*#__PURE__*/React.createElement("div", null, item.groupName ? item.groupName : '未分组'), /*#__PURE__*/React.createElement(IconFont, {
320
+ }), /*#__PURE__*/React.createElement("div", null, item.groupName ? item.groupName : '未分组'), item.groupName && /*#__PURE__*/React.createElement(IconFont, {
305
321
  type: "zhongmingming",
306
322
  onClick: function onClick() {
307
323
  setCreateOrEditGrpup('edit');
@@ -322,8 +338,11 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
322
338
  title: null,
323
339
  content: moveContent
324
340
  }, /*#__PURE__*/React.createElement("span", {
341
+ className: "".concat(groupingData.length > 1 ? '' : 'not-operable'),
325
342
  onClick: function onClick() {
326
- return eventMove(item.groupId);
343
+ if (groupingData.length > 1) {
344
+ eventMove(item.groupId);
345
+ }
327
346
  }
328
347
  }, "\u79FB\u52A8")), /*#__PURE__*/React.createElement("span", {
329
348
  onClick: function onClick() {
@@ -333,7 +352,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
333
352
  onClick: function onClick() {
334
353
  return eventShowOrHidden(1, item.groupId);
335
354
  }
336
- }, "\u9690\u85CF")), /*#__PURE__*/React.createElement("span", {
355
+ }, "\u9690\u85CF")), item.groupName && /*#__PURE__*/React.createElement("span", {
337
356
  onClick: function onClick() {
338
357
  return groupDelete(item.groupId);
339
358
  }
@@ -346,11 +365,12 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
346
365
  componnetIndex: index,
347
366
  groupId: item.groupId,
348
367
  groupingData: groupingData,
349
- setGroupingData: setGroupingData
368
+ setGroupingData: setGroupingData,
369
+ refresh: refresh
350
370
  }))));
351
371
  }));
352
372
  });
353
- }))), /*#__PURE__*/React.createElement(Modal, {
373
+ })))), /*#__PURE__*/React.createElement(Modal, {
354
374
  wrapClassName: "create-or-edit-grpup-modal",
355
375
  title: "".concat(createOrEditGrpup === 'create' ? '创建分组' : '修改分组名'),
356
376
  bodyStyle: {
@@ -365,7 +385,7 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
365
385
  onCancel: GrpupModalClose
366
386
  }, /*#__PURE__*/React.createElement(Input, {
367
387
  placeholder: "\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",
368
- value: grpupNameInput,
388
+ defaultValue: grpupNameInput,
369
389
  maxLength: 20,
370
390
  onChange: function onChange(e) {
371
391
  return setGrpupNameInput(e.currentTarget.value);
@@ -125,7 +125,7 @@ var SelectAttributes = function SelectAttributes(props) {
125
125
  }, [searchValue]);
126
126
  // 渲染属性列表
127
127
  var selectAttributesRender = function selectAttributesRender() {
128
- return selectAttributesData.map(function (item, index) {
128
+ return selectAttributesData.map(function (item) {
129
129
  if (item.id === selectEventId) {
130
130
  return item.attrList.map(function (_item) {
131
131
  return attrShowList.indexOf(_item.label) !== -1 ? /*#__PURE__*/React.createElement("div", {
@@ -145,8 +145,11 @@ var SelectAttributes = function SelectAttributes(props) {
145
145
  title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
146
146
  type: "tishi1"
147
147
  }), "\u63D0\u793A", /*#__PURE__*/React.createElement(IconFont, {
148
- type: "qingchu"
148
+ type: "qingchu",
149
+ onClick: handleCancel
149
150
  })),
151
+ wrapClassName: "".concat(classPrefix, "-modal-box"),
152
+ closeIcon: null,
150
153
  open: selectAttributesShow,
151
154
  onOk: handleOk,
152
155
  onCancel: handleCancel
@@ -1,5 +1,5 @@
1
1
  import { BizGlobalDataContext } from '@zgfe/business-lib';
2
- import { Checkbox } from 'antd';
2
+ import { Checkbox, Tooltip } from 'antd';
3
3
  import request from '../../../utils/ajax';
4
4
  import apis from '../../../constants/api';
5
5
  import React, { useContext } from 'react';
@@ -15,34 +15,47 @@ var SortableComponnet = function SortableComponnet(props) {
15
15
  componnetIndex = props.componnetIndex,
16
16
  groupId = props.groupId,
17
17
  groupingData = props.groupingData,
18
- setGroupingData = props.setGroupingData;
18
+ setGroupingData = props.setGroupingData,
19
+ refresh = props.refresh;
19
20
  // 需要拖动的元素的容器
20
21
  var SortableItem = SortableElement(function (data) {
21
22
  var _data$value = data.value,
22
23
  item = _data$value.item,
23
24
  index = _data$value.index;
24
- return /*#__PURE__*/React.createElement(Checkbox, {
25
+ var name = item.alias_name ? item.alias_name : item.event_name;
26
+ return /*#__PURE__*/React.createElement(Tooltip, {
27
+ title: "".concat(item.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(name),
28
+ key: index
29
+ }, /*#__PURE__*/React.createElement(Checkbox, {
25
30
  className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
26
31
  checked: item.checked,
27
32
  key: index,
28
33
  onChange: function onChange() {
29
34
  return onChangeItem(groupId, item.event_id);
30
35
  }
31
- }, item.alias_name ? item.alias_name : item.event_name);
36
+ }, name));
32
37
  });
33
38
  // 不可拖动的元素(未分组数据)
34
39
  var SortableItemNotDrag = function SortableItemNotDrag(data) {
35
40
  var item = data.item,
36
41
  index = data.index;
37
- return /*#__PURE__*/React.createElement(Checkbox, {
42
+ var name = item.alias_name ? item.alias_name : item.event_name;
43
+ return /*#__PURE__*/React.createElement(Tooltip, {
44
+ title: "".concat(item.owner === 'zg_vtl' ? '虚拟事件' : '元事件', " | ").concat(name),
45
+ key: index
46
+ }, /*#__PURE__*/React.createElement(Checkbox, {
38
47
  className: "checkbox-item ".concat(item.event_hidden ? 'event-hidden' : '', " column-").concat(groupId),
39
48
  checked: item.checked,
40
49
  key: index,
41
50
  onChange: function onChange() {
42
51
  return onChangeItem(groupId, item.event_id);
43
52
  }
44
- }, item.alias_name ? item.alias_name : item.event_name);
53
+ }, name));
45
54
  };
55
+ // const onScroll = (e: React.UIEvent<HTMLElement, UIEvent>) => {
56
+ // if (e.currentTarget.scrollHeight - e.currentTarget.scrollTop === 400) {
57
+ // }
58
+ // };
46
59
  // 整个元素排序的容器
47
60
  var SortableList = SortableContainer(function () {
48
61
  return /*#__PURE__*/React.createElement("div", {
@@ -89,7 +102,9 @@ var SortableComponnet = function SortableComponnet(props) {
89
102
  groupId: groupId,
90
103
  ids: ids.join(',')
91
104
  }
92
- }).then(function () {});
105
+ }).then(function () {
106
+ refresh();
107
+ });
93
108
  };
94
109
  return /*#__PURE__*/React.createElement(SortableList, {
95
110
  distance: 5,
@@ -154,7 +154,7 @@ var TablePlus = function TablePlus(props) {
154
154
  }).then(function (res) {
155
155
  // 该事件在虚拟事件中有使用
156
156
  if (res.data === 1) {
157
- eventDelModal(record.event_id, '检测到该事件在虚拟事件中使用');
157
+ eventDelModal(record.event_id, '检测到该事件在虚拟事件中使用, 删除后,将停止采集该事件数据,也将不在分析平台中显示!');
158
158
  } else {
159
159
  eventDelModal(record.event_id, '删除后,将停止采集该事件数据,也将不在分析平台中显示!');
160
160
  }
@@ -411,7 +411,9 @@ var TablePlus = function TablePlus(props) {
411
411
  }, record.alias_name),
412
412
  trigger: "hover",
413
413
  placement: "top"
414
- }, /*#__PURE__*/React.createElement("div", null, record.alias_name)), /*#__PURE__*/React.createElement(IconFont, {
414
+ }, /*#__PURE__*/React.createElement("div", {
415
+ className: 'alias_name_text'
416
+ }, record.alias_name)), /*#__PURE__*/React.createElement(IconFont, {
415
417
  className: "edit-alias-name",
416
418
  onClick: function onClick() {
417
419
  setAliasNameInput(record.alias_name);
@@ -192,7 +192,9 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
192
192
  key: 'aliasName',
193
193
  width: 167,
194
194
  render: function render(_, record) {
195
- return /*#__PURE__*/React.createElement(Popover, {
195
+ return /*#__PURE__*/React.createElement("div", {
196
+ className: "alias_name"
197
+ }, /*#__PURE__*/React.createElement(Popover, {
196
198
  content: /*#__PURE__*/React.createElement("div", {
197
199
  style: {
198
200
  width: '200px',
@@ -201,7 +203,9 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
201
203
  }, record.aliasName),
202
204
  trigger: "hover",
203
205
  placement: "top"
204
- }, /*#__PURE__*/React.createElement("div", null, record.aliasName));
206
+ }, /*#__PURE__*/React.createElement("div", {
207
+ className: 'alias_name_text'
208
+ }, record.aliasName)));
205
209
  }
206
210
  }, {
207
211
  title: '首次上报时间',
@@ -209,7 +213,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
209
213
  key: 'insertTime',
210
214
  width: 187,
211
215
  render: function render(text) {
212
- return /*#__PURE__*/React.createElement("div", null, moment(text).format('YYYY-MM-DD HH:mm:ss'));
216
+ return /*#__PURE__*/React.createElement("div", null, text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '');
213
217
  }
214
218
  }, {
215
219
  title: '末次上报时间',
@@ -217,18 +221,54 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
217
221
  key: 'lastInsertTime',
218
222
  width: 187,
219
223
  render: function render(text) {
220
- return /*#__PURE__*/React.createElement("div", null, moment(text).format('YYYY-MM-DD HH:mm:ss'));
224
+ return /*#__PURE__*/React.createElement("div", null, text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '');
225
+ }
226
+ }, {
227
+ title: '显示状态',
228
+ dataIndex: 'hidden',
229
+ key: 'hidden',
230
+ width: 187,
231
+ render: function render(text) {
232
+ return /*#__PURE__*/React.createElement("div", null, text === 0 ? '显示' : '隐藏');
221
233
  }
222
234
  }, {
223
235
  title: '描述',
224
236
  dataIndex: 'description',
225
237
  key: 'description',
226
- width: 187
238
+ width: 187,
239
+ render: function render(text) {
240
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Popover, {
241
+ content: /*#__PURE__*/React.createElement("div", {
242
+ style: {
243
+ width: '200px',
244
+ wordBreak: 'break-all'
245
+ }
246
+ }, text),
247
+ trigger: "hover",
248
+ placement: "top"
249
+ }, /*#__PURE__*/React.createElement("div", {
250
+ className: 'description'
251
+ }, text)));
252
+ }
227
253
  }, {
228
254
  title: '包含埋点事件',
229
255
  dataIndex: 'bindEvent',
230
256
  key: 'bindEvent',
231
- width: 187
257
+ width: 187,
258
+ render: function render(text) {
259
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Popover, {
260
+ content: /*#__PURE__*/React.createElement("div", {
261
+ style: {
262
+ width: '200px',
263
+ wordBreak: 'break-all'
264
+ }
265
+ }, text),
266
+ trigger: "hover",
267
+ placement: "top"
268
+ }, /*#__PURE__*/React.createElement("div", {
269
+ className: 'bind-event'
270
+ }, text)));
271
+ }
232
272
  }, {
233
273
  title: '创建人',
234
274
  dataIndex: 'createUser',
@@ -19,7 +19,7 @@ var DataCollection = function DataCollection(props) {
19
19
  var _useContext = useContext(BizGlobalDataContext),
20
20
  currentApp = _useContext.currentApp,
21
21
  authority = _useContext.authority;
22
- var _useState = useState(3),
22
+ var _useState = useState(1),
23
23
  _useState2 = _slicedToArray(_useState, 2),
24
24
  listTab = _useState2[0],
25
25
  setListTab = _useState2[1];
@@ -72,7 +72,7 @@ var DataCollection = function DataCollection(props) {
72
72
  }
73
73
  }, authority[100020] && /*#__PURE__*/React.createElement(Radio.Button, {
74
74
  value: 1
75
- }, "\u57CB\u70B9\u4E8B\u4EF6"), /*#__PURE__*/React.createElement(Radio.Button, {
75
+ }, "\u5143\u4E8B\u4EF6"), /*#__PURE__*/React.createElement(Radio.Button, {
76
76
  value: 3
77
77
  }, "\u865A\u62DF\u4E8B\u4EF6"), authority[100021] && /*#__PURE__*/React.createElement(Radio.Button, {
78
78
  value: 2
@@ -15,7 +15,7 @@
15
15
  }
16
16
  .creact-group {
17
17
  .ant-modal-body {
18
- padding: 3px 20px 20px 20px;
18
+ padding: 3px 20px 20px 20px !important;
19
19
  }
20
20
  }
21
21
  }
@@ -115,10 +115,6 @@
115
115
  word-break: break-all;
116
116
  background: red;
117
117
  }
118
- .alias_name {
119
- border: none;
120
- cursor: pointer;
121
- }
122
118
  .ant-input:focus,
123
119
  .ant-input-focused {
124
120
  background-color: #fff !important;
@@ -260,6 +256,16 @@
260
256
  }
261
257
  .alias_name {
262
258
  display: flex;
259
+ border: none;
260
+ cursor: pointer;
261
+ .alias_name_text {
262
+ display: -webkit-box;
263
+ max-width: 167px;
264
+ overflow: hidden;
265
+ cursor: pointer;
266
+ -webkit-box-orient: vertical;
267
+ -webkit-line-clamp: 1;
268
+ }
263
269
  .edit-alias-name {
264
270
  display: none;
265
271
  margin-left: 10px;
@@ -269,6 +275,15 @@
269
275
  color: @primary-color;
270
276
  }
271
277
  }
278
+ .bind-event,
279
+ .description {
280
+ display: -webkit-box;
281
+ max-width: 180px;
282
+ overflow: hidden;
283
+ cursor: pointer;
284
+ -webkit-box-orient: vertical;
285
+ -webkit-line-clamp: 1;
286
+ }
272
287
  .ant-table-row:hover {
273
288
  .collect-icon {
274
289
  opacity: 1;
@@ -376,6 +391,26 @@
376
391
  }
377
392
 
378
393
  .create-virtual-drawer {
394
+ #basic {
395
+ padding-bottom: 100px;
396
+ .ant-input {
397
+ border: none;
398
+ }
399
+ }
400
+ &-desc {
401
+ .ant-form-item-control {
402
+ max-width: 100%;
403
+ }
404
+ }
405
+ &-add {
406
+ color: #165dff;
407
+ &-icon {
408
+ margin-right: 8px;
409
+ font-weight: 900;
410
+ font-size: 18px !important;
411
+ vertical-align: -2px;
412
+ }
413
+ }
379
414
  &-see-box {
380
415
  > div {
381
416
  display: flex;
@@ -384,6 +419,7 @@
384
419
  color: #021429;
385
420
  span {
386
421
  width: 84px;
422
+ min-width: 84px;
387
423
  color: #5f6085;
388
424
  text-align: right;
389
425
  }
@@ -402,6 +438,15 @@
402
438
  > :nth-child(2) {
403
439
  margin-top: 8px;
404
440
  }
441
+ > :nth-child(1)::before {
442
+ display: inline-block;
443
+ margin-right: 4px;
444
+ color: #ff4d4f;
445
+ font-size: 14px;
446
+ font-family: SimSun, sans-serif;
447
+ line-height: 1;
448
+ content: '*';
449
+ }
405
450
  }
406
451
  &-eventDataBox.see {
407
452
  > :nth-child(1) {
@@ -424,10 +469,15 @@
424
469
  }
425
470
  &-formSubmit {
426
471
  position: absolute;
427
- right: 24px;
428
- bottom: 24px;
472
+ background: #fff;
473
+ width: 100%;
474
+ border-top: 1px solid #F2F3F4;
475
+ right: 0;
476
+ bottom: 0;
477
+ padding: 24px;
429
478
  display: flex;
430
- gap: 8px;
479
+ gap: 16px;
480
+ justify-content: end;
431
481
  }
432
482
  }
433
483
 
@@ -482,23 +532,39 @@
482
532
  > div {
483
533
  display: flex;
484
534
  flex-wrap: wrap;
535
+ gap: 12px;
485
536
  justify-content: flex-start;
486
537
  width: 100%;
487
538
  .checkbox-item {
488
- width: 25%;
539
+ display: flex;
540
+ flex-shrink: 0;
541
+ align-items: center;
542
+ width: calc(25% - 9px);
543
+ height: 40px;
544
+ margin: 0;
545
+ padding: 9px 0 9px 16px;
546
+ background: #fafafb;
547
+ .ant-checkbox {
548
+ margin-top: -6px;
549
+ }
550
+ .ant-checkbox + span {
551
+ display: -webkit-box;
552
+ max-width: 100%;
553
+ overflow: hidden;
554
+ cursor: pointer;
555
+ user-select: none;
556
+ -webkit-box-orient: vertical;
557
+ -webkit-line-clamp: 1;
558
+ }
489
559
  }
490
- // width: 25%;
491
- // .ant-checkbox {
492
- // top: 0em;
493
- // }
494
- }
495
- .checkbox-item {
496
- display: flex;
497
- flex-shrink: 0;
498
- align-items: center;
499
- height: 40px;
500
- margin: 0;
501
560
  }
561
+ // .checkbox-item {
562
+ // display: flex;
563
+ // flex-shrink: 0;
564
+ // align-items: center;
565
+ // height: 40px;
566
+ // margin: 0;
567
+ // }
502
568
  .event-hidden {
503
569
  color: #ccd0d4;
504
570
  }
@@ -542,13 +608,13 @@
542
608
  }
543
609
  }
544
610
  .ant-modal-confirm-title {
545
- display: inline;
546
- color: #021429;
611
+ display: inline !important;
612
+ color: #021429 !important;
547
613
  font-weight: 500;
548
- font-size: 24px;
614
+ font-size: 24px !important;
549
615
  }
550
616
  .ant-modal-confirm-content {
551
- margin-top: 20px;
617
+ margin-top: 20px !important;
552
618
  }
553
619
  }
554
620
 
@@ -579,68 +645,84 @@
579
645
  }
580
646
 
581
647
  .select-attributes {
582
- &-select {
583
- .ant-select-dropdown {
584
- display: none !important;
585
- }
586
- }
587
- }
588
-
589
- .select-attributes-box {
590
- display: flex;
591
- width: 616px;
592
- height: 380px;
593
- background: #fff;
594
- border-radius: 10px;
595
- box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
596
- &-left {
648
+ &-box {
597
649
  display: flex;
598
- flex-direction: column;
599
- width: 205px;
650
+ width: 616px;
600
651
  height: 380px;
601
- padding: 8px;
602
- overflow-y: auto;
652
+ background: #fff;
653
+ border-radius: 10px;
603
654
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
604
- > div {
605
- display: flex;
606
- justify-content: space-between;
607
- padding: 6px 12px;
608
- }
609
- .active {
610
- color: #fff;
611
- background: #165dff;
612
- border-radius: 4px;
613
- > :nth-child(2) {
614
- padding: 0px 4px;
615
- border: 1px solid #fff;
616
- border-radius: 10px;
617
- }
618
- }
619
- }
620
- &-right {
621
- width: 100%;
622
- height: 380px;
623
- padding: 8px;
624
- > :nth-child(2) {
655
+ &-left {
625
656
  display: flex;
626
657
  flex-direction: column;
627
- gap: 8px;
628
- align-items: flex-start;
629
- width: 100%;
630
- height: 320px;
631
- margin-top: 8px;
658
+ width: 205px;
659
+ height: 380px;
660
+ padding: 8px;
632
661
  overflow-y: auto;
662
+ box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
633
663
  > div {
634
664
  display: flex;
635
- flex-shrink: 0;
636
- gap: 10px;
637
- align-items: center;
638
- align-self: stretch;
639
- height: 32px;
640
- padding: 0px 16px;
665
+ justify-content: space-between;
666
+ padding: 6px 12px;
641
667
  }
642
668
  .active {
643
- background: #e8efff;
669
+ color: #fff;
670
+ background: #165dff;
671
+ border-radius: 4px;
672
+ > :nth-child(2) {
673
+ padding: 0px 4px;
674
+ border: 1px solid #fff;
675
+ border-radius: 10px;
676
+ }
677
+ }
678
+ }
679
+ &-right {
680
+ width: 100%;
681
+ height: 380px;
682
+ padding: 8px;
683
+ > :nth-child(2) {
684
+ display: flex;
685
+ flex-direction: column;
686
+ gap: 8px;
687
+ align-items: flex-start;
688
+ width: 100%;
689
+ height: 320px;
690
+ margin-top: 8px;
691
+ overflow-y: auto;
692
+ > div {
693
+ display: flex;
694
+ flex-shrink: 0;
695
+ gap: 10px;
696
+ align-items: center;
697
+ align-self: stretch;
698
+ height: 32px;
699
+ padding: 0px 16px;
700
+ }
701
+ .active {
702
+ background: #e8efff;
703
+ }
704
+ }
705
+ }
706
+ }
707
+ &-select {
708
+ .ant-select-dropdown {
709
+ display: none !important;
710
+ }
711
+ }
712
+ &-modal-box {
713
+ .ant-modal-close-x {
714
+ display: none;
715
+ }
716
+ .ant-modal-title {
717
+ position: relative;
718
+ .tishi1 {
719
+ margin-right: 8px;
720
+ color: #fd9f41;
721
+ }
722
+ .qingchu {
723
+ position: absolute;
724
+ top: 0;
725
+ right: 0;
644
726
  }
645
727
  }
646
728
  }
@@ -649,3 +731,9 @@
649
731
  .sortable-componnet-sortableList {
650
732
  z-index: 9999;
651
733
  }
734
+
735
+ .not-operable {
736
+ color: #ccd0d4;
737
+ cursor: not-allowed !important;
738
+ user-select: none;
739
+ }
@@ -22,6 +22,7 @@ export interface eventJsonProps {
22
22
  }
23
23
  export interface VirtualEventProps extends VirtualEventBase {
24
24
  eventGroupId: number;
25
+ groupId?: number;
25
26
  eventJson: eventJsonProps[];
26
27
  id: number;
27
28
  }
@@ -72,4 +73,5 @@ export interface SubmitDataProps {
72
73
  export interface EventGroupingDrawerProps {
73
74
  eventGroupingShow: boolean;
74
75
  setEventGroupingShow: Function;
76
+ refresh: Function;
75
77
  }
@@ -120,10 +120,12 @@ var VirtualEventList = function VirtualEventList() {
120
120
  };
121
121
  // 筛选事件
122
122
  var eventNameChange = function eventNameChange(e) {
123
+ setPageNumber(1);
123
124
  setEventNameChangeData(e.currentTarget.value);
124
125
  };
125
126
  // 筛选收藏
126
127
  var markTypeFilter = function markTypeFilter(markActive) {
128
+ setPageNumber(1);
127
129
  setMarkTypeData(markActive ? 1 : 0);
128
130
  };
129
131
  // 获取虚拟事件列表
@@ -218,10 +220,6 @@ var VirtualEventList = function VirtualEventList() {
218
220
  message.error('请输入分组名称');
219
221
  return;
220
222
  }
221
- if (eventNameInput.length > 20) {
222
- message.error('名称不可超过20字符');
223
- return;
224
- }
225
223
  request(apis.upsertEventGroup, {
226
224
  method: 'post',
227
225
  data: {
@@ -298,8 +296,9 @@ var VirtualEventList = function VirtualEventList() {
298
296
  textAlign: 'right'
299
297
  },
300
298
  showQuickJumper: true,
301
- showSizeChanger: total > 10,
299
+ showSizeChanger: total > pageSize,
302
300
  defaultCurrent: 1,
301
+ defaultPageSize: pageSize,
303
302
  current: pageNumber,
304
303
  total: total,
305
304
  onChange: onPaginationChange
@@ -312,7 +311,8 @@ var VirtualEventList = function VirtualEventList() {
312
311
  refresh: queryList
313
312
  }), /*#__PURE__*/React.createElement(EventGroupingDrawer, {
314
313
  eventGroupingShow: eventGroupingShow,
315
- setEventGroupingShow: setEventGroupingShow
314
+ setEventGroupingShow: setEventGroupingShow,
315
+ refresh: queryList
316
316
  }), /*#__PURE__*/React.createElement(Modal, {
317
317
  title: "\u521B\u5EFA\u5206\u7EC4",
318
318
  className: "creact-group",
@@ -327,6 +327,7 @@ var VirtualEventList = function VirtualEventList() {
327
327
  }, /*#__PURE__*/React.createElement(Input, {
328
328
  placeholder: "\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",
329
329
  value: eventNameInput,
330
+ maxLength: 20,
330
331
  onChange: function onChange(e) {
331
332
  return setEventNameInput(e.currentTarget.value);
332
333
  }
@@ -1,3 +1,7 @@
1
+ /**
2
+ * 虚拟事件编辑 判断内容是否有改动;有改动返回true
3
+ */
4
+ export declare const getVirtualContentChange: (oldData: any, newData: any) => boolean;
1
5
  /**
2
6
  * 虚拟事件属性超过100个,选择属性后的回调,处理提交数据
3
7
  */
@@ -22,10 +26,6 @@ export declare const eventMoveData: (groupId: number, groupingData: any, setGrou
22
26
  * 指标分组管理:显示或隐藏
23
27
  */
24
28
  export declare const eventShowOrHiddenData: (type: number, groupId: number, groupingData: any, setGroupingData: Function) => any;
25
- /**
26
- * 指标分组管理:删除分组
27
- */
28
- export declare const groupDeleteData: (groupId: number, groupingData: any, setGroupingData: Function) => void;
29
29
  /**
30
30
  * 指标分组管理:分组展开与关闭
31
31
  */
@@ -47,6 +47,7 @@ export declare const groupListSort: (result: any, groupingData: any, setGrouping
47
47
  */
48
48
  export declare const eventListHandle: (data: any) => void;
49
49
  export declare const getAppID: (currentApp: any) => any;
50
+ export declare const nullToEmptyString: (data: any) => any;
50
51
  /**
51
52
  * 获取第一个表格的可视化高度
52
53
  * @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
package/es/utils/index.js CHANGED
@@ -1,3 +1,24 @@
1
+ /**
2
+ * 虚拟事件编辑 判断内容是否有改动;有改动返回true
3
+ */
4
+ export var getVirtualContentChange = function getVirtualContentChange(oldData, newData) {
5
+ if (oldData.aliasName != newData.aliasName) {
6
+ return true;
7
+ }
8
+ if (oldData.eventName != newData.eventName) {
9
+ return true;
10
+ }
11
+ if (oldData.groupId != newData.eventGroupId) {
12
+ return true;
13
+ }
14
+ if (nullToEmptyString(oldData.description) != nullToEmptyString(newData.desc)) {
15
+ return true;
16
+ }
17
+ if (JSON.stringify(oldData.eventJson) !== JSON.stringify(newData.eventJson)) {
18
+ return true;
19
+ }
20
+ return false;
21
+ };
1
22
  /**
2
23
  * 虚拟事件属性超过100个,选择属性后的回调,处理提交数据
3
24
  */
@@ -150,21 +171,6 @@ export var eventShowOrHiddenData = function eventShowOrHiddenData(type, groupId,
150
171
  setGroupingData(_groupingData);
151
172
  return ids.length > 0 ? ids.join(',') : '';
152
173
  };
153
- /**
154
- * 指标分组管理:删除分组
155
- */
156
- export var groupDeleteData = function groupDeleteData(groupId, groupingData, setGroupingData) {
157
- groupingData.map(function (item, index) {
158
- if (item.groupId === groupId) {
159
- delete groupingData[index];
160
- }
161
- });
162
- var _groupingData = [];
163
- groupingData.map(function (item) {
164
- _groupingData.push(item);
165
- });
166
- setGroupingData(_groupingData);
167
- };
168
174
  /**
169
175
  * 指标分组管理:分组展开与关闭
170
176
  */
@@ -239,9 +245,19 @@ export var groupListSort = function groupListSort(result, groupingData, setGroup
239
245
  * 指标分组管理:分组中事件列表初始化
240
246
  */
241
247
  export var eventListHandle = function eventListHandle(data) {
248
+ var _open = false;
242
249
  data.map(function (item) {
243
250
  item.checked = false;
244
- item.open = true;
251
+ item.open = false;
252
+ if (item.eventList.length > 0) {
253
+ item.eventList = item.eventList.filter(function (_item) {
254
+ return _item.is_delete === 0;
255
+ });
256
+ if (item.eventList.length > 0 && !_open) {
257
+ _open = true;
258
+ item.open = true;
259
+ }
260
+ }
245
261
  });
246
262
  };
247
263
  // 获取appId,为了解决之前遇到切换应用但是currentApp里面的appId不更新的问题
@@ -253,6 +269,13 @@ export var getAppID = function getAppID(currentApp) {
253
269
  return currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
254
270
  }
255
271
  };
272
+ // null 或 undefined 转为 空字符串
273
+ export var nullToEmptyString = function nullToEmptyString(data) {
274
+ if (data === null || data === undefined) {
275
+ return '';
276
+ }
277
+ return data;
278
+ };
256
279
  /**
257
280
  * 获取第一个表格的可视化高度
258
281
  * @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.34-heyh.2",
3
+ "version": "1.0.34-heyh.20",
4
4
  "license": "ISC",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "@types/lodash": "^4.14.182",
41
41
  "@umijs/fabric": "^2.8.1",
42
42
  "@umijs/test": "^3.0.5",
43
- "@zgfe/business-lib": "1.1.98",
43
+ "@zgfe/business-lib": "1.2.3-heyh.1",
44
44
  "antd": "4.24.10",
45
45
  "dumi": "^1.1.0",
46
46
  "father-build": "^1.17.2",
@@ -52,7 +52,7 @@
52
52
  "umi-request": "^1.4.0",
53
53
  "yorkie": "^2.0.0"
54
54
  },
55
- "gitHead": "9946c9d4ac13d31bfa3be622e1b5eae0a9447402",
55
+ "gitHead": "23102225c99fa4b4dbd948072bf3d943f2395d4a",
56
56
  "gitHooks": {
57
57
  "pre-commit": "lint-staged"
58
58
  }