@zgfe/modules-dm 1.0.41 → 1.0.42-alpha.11

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 (36) hide show
  1. package/es/components/demo.js +1 -1
  2. package/es/index.d.ts +2 -3
  3. package/es/index.js +2 -3
  4. package/es/modules/{dataCollection → dataManage}/components/createVirtualDrawer.js +1 -1
  5. package/es/modules/{dataCollection → dataManage}/components/eventFilter/styles/index.less +1 -1
  6. package/es/modules/{dataCollection → dataManage}/components/eventGroupingDrawer.js +3 -3
  7. package/es/modules/{dataCollection → dataManage}/components/tablePlus.js +1 -1
  8. package/es/modules/{dataCollection → dataManage}/components/virtualTablePlus.js +3 -3
  9. package/es/modules/dataManage/index.d.ts +1 -16
  10. package/es/modules/dataManage/index.js +70 -22
  11. package/es/modules/dataManage/styles/index.less +834 -25
  12. package/package.json +2 -2
  13. package/README.md +0 -37
  14. package/es/modules/dataCollection/index.d.ts +0 -19
  15. package/es/modules/dataCollection/index.js +0 -99
  16. package/es/modules/dataCollection/styles/index.less +0 -832
  17. /package/es/modules/{dataCollection → dataManage}/collectionAttributeList.d.ts +0 -0
  18. /package/es/modules/{dataCollection → dataManage}/collectionAttributeList.js +0 -0
  19. /package/es/modules/{dataCollection → dataManage}/collectionEventList.d.ts +0 -0
  20. /package/es/modules/{dataCollection → dataManage}/collectionEventList.js +0 -0
  21. /package/es/modules/{dataCollection → dataManage}/components/createVirtualDrawer.d.ts +0 -0
  22. /package/es/modules/{dataCollection → dataManage}/components/eventFilter/index.d.ts +0 -0
  23. /package/es/modules/{dataCollection → dataManage}/components/eventFilter/index.js +0 -0
  24. /package/es/modules/{dataCollection → dataManage}/components/eventFilter/types.d.ts +0 -0
  25. /package/es/modules/{dataCollection → dataManage}/components/eventFilter/types.js +0 -0
  26. /package/es/modules/{dataCollection → dataManage}/components/eventGroupingDrawer.d.ts +0 -0
  27. /package/es/modules/{dataCollection → dataManage}/components/eventItem.d.ts +0 -0
  28. /package/es/modules/{dataCollection → dataManage}/components/eventItem.js +0 -0
  29. /package/es/modules/{dataCollection → dataManage}/components/selectAttributes.d.ts +0 -0
  30. /package/es/modules/{dataCollection → dataManage}/components/selectAttributes.js +0 -0
  31. /package/es/modules/{dataCollection → dataManage}/components/tablePlus.d.ts +0 -0
  32. /package/es/modules/{dataCollection → dataManage}/components/virtualTablePlus.d.ts +0 -0
  33. /package/es/modules/{dataCollection → dataManage}/types.d.ts +0 -0
  34. /package/es/modules/{dataCollection → dataManage}/types.js +0 -0
  35. /package/es/modules/{dataCollection → dataManage}/virtualEventList.d.ts +0 -0
  36. /package/es/modules/{dataCollection → dataManage}/virtualEventList.js +0 -0
@@ -24,7 +24,7 @@ var DemoWrapper2 = function DemoWrapper2(props) {
24
24
  }
25
25
  }, /*#__PURE__*/React.createElement(DemoWrapper, {
26
26
  needMeta: true,
27
- defaultApp: 501313
27
+ defaultApp: 461
28
28
  }, props.children)));
29
29
  };
30
30
  export default DemoWrapper2;
package/es/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
- import DataCollection from './modules/dataCollection';
3
- import PlanList from './modules/dataPlan';
4
2
  import DataManage from './modules/dataManage';
5
- export { PlanList, DataCollection, DataManage };
3
+ import PlanList from './modules/dataPlan';
4
+ export { PlanList, DataManage };
package/es/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
- import DataCollection from './modules/dataCollection';
3
- import PlanList from './modules/dataPlan';
4
2
  import DataManage from './modules/dataManage';
5
- export { PlanList, DataCollection, DataManage };
3
+ import PlanList from './modules/dataPlan';
4
+ export { PlanList, DataManage };
@@ -120,7 +120,7 @@ var CreateVirtualDrawer = function CreateVirtualDrawer(props) {
120
120
  }
121
121
  };
122
122
  var onClose = function onClose() {
123
- if (virtualDrawerType === "edit") {
123
+ if (virtualDrawerType === 'edit') {
124
124
  if (formSubmit && getVirtualContentChange(_.cloneDeep(editVirtualEventData), _.cloneDeep(formSubmitData))) {
125
125
  Modal.confirm({
126
126
  centered: true,
@@ -66,7 +66,7 @@
66
66
  }
67
67
  .delete-box:hover {
68
68
  .shanchu {
69
- color: #FB5547;
69
+ color: #fb5547;
70
70
  }
71
71
  }
72
72
  }
@@ -328,17 +328,17 @@ var EventGroupingDrawer = function EventGroupingDrawer(props) {
328
328
  }
329
329
  }
330
330
  }, "\u79FB\u52A8")), /*#__PURE__*/React.createElement("span", {
331
- className: 'handle',
331
+ className: "handle",
332
332
  onClick: function onClick() {
333
333
  return eventShowOrHidden(0, item.groupId);
334
334
  }
335
335
  }, "\u663E\u793A"), /*#__PURE__*/React.createElement("span", {
336
- className: 'handle',
336
+ className: "handle",
337
337
  onClick: function onClick() {
338
338
  return eventShowOrHidden(1, item.groupId);
339
339
  }
340
340
  }, "\u9690\u85CF")), item.groupName && /*#__PURE__*/React.createElement("span", {
341
- className: 'handle-delete',
341
+ className: "handle-delete",
342
342
  onClick: function onClick() {
343
343
  return groupDelete(item.groupId);
344
344
  }
@@ -417,7 +417,7 @@ var TablePlus = function TablePlus(props) {
417
417
  trigger: "hover",
418
418
  placement: "top"
419
419
  }, /*#__PURE__*/React.createElement("div", {
420
- className: 'alias_name_text'
420
+ className: "alias_name_text"
421
421
  }, record.alias_name)), /*#__PURE__*/React.createElement(IconFont, {
422
422
  className: "edit-alias-name",
423
423
  onClick: function onClick() {
@@ -213,7 +213,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
213
213
  trigger: "hover",
214
214
  placement: "top"
215
215
  }, /*#__PURE__*/React.createElement("div", {
216
- className: 'alias_name_text'
216
+ className: "alias_name_text"
217
217
  }, record.aliasName)));
218
218
  }
219
219
  }, {
@@ -256,7 +256,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
256
256
  trigger: "hover",
257
257
  placement: "top"
258
258
  }, /*#__PURE__*/React.createElement("div", {
259
- className: 'description'
259
+ className: "description"
260
260
  }, text)));
261
261
  }
262
262
  }, {
@@ -275,7 +275,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
275
275
  trigger: "hover",
276
276
  placement: "top"
277
277
  }, /*#__PURE__*/React.createElement("div", {
278
- className: 'bind-event'
278
+ className: "bind-event"
279
279
  }, text)));
280
280
  }
281
281
  }, {
@@ -1,12 +1,6 @@
1
1
  import React from 'react';
2
- import './styles/index.less';
3
2
  interface DataManageProps {
4
3
  updateEventMetas: Function;
5
- /**
6
- * 是否展示埋点方案
7
- * default: true
8
- */
9
- showPlan?: boolean;
10
4
  /**
11
5
  * 拓展的一级菜单
12
6
  */
@@ -16,19 +10,10 @@ interface DataManageProps {
16
10
  children: React.ReactNode;
17
11
  [other: string]: any;
18
12
  }[];
19
- /**
20
- * 拓展的二级菜单
21
- */
22
- extraSubTabs?: {
23
- key: string;
24
- label: string;
25
- children: React.ReactNode;
26
- [other: string]: any;
27
- }[];
28
13
  /**
29
14
  * 默认选中菜单
30
15
  */
31
- activeSubTab?: number | string;
16
+ activeTab?: number | string;
32
17
  }
33
18
  declare const DataManage: React.FC<DataManageProps>;
34
19
  export default DataManage;
@@ -10,18 +10,18 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { BizGlobalDataContext } from '@zgfe/business-lib';
12
12
  import { Tabs } from 'antd';
13
- import React, { useContext, useEffect } from 'react';
14
- import './styles/index.less';
15
13
  import { DmContext, upDatedDmFun } from '../../store';
16
14
  import { ActionType } from '../../store/action';
17
- import PlanList from '../dataPlan';
18
- import DataCollection from '../dataCollection';
15
+ import React, { useState, useContext, useEffect } from 'react';
16
+ import request from '../../utils/ajax';
17
+ import apis from '../../constants/api';
18
+ import { getAppID } from '../../utils';
19
+ import EventList from './collectionEventList';
20
+ import CollectionAttributeList from './collectionAttributeList';
21
+ import VirtualEventList from './virtualEventList';
19
22
  var DataManage = function DataManage(props) {
20
- var _useContext = useContext(BizGlobalDataContext),
21
- authority = _useContext.authority;
22
23
  var classPrefix = 'data-manage';
23
- var updateEventMetas = props.updateEventMetas,
24
- showPlan = props.showPlan;
24
+ var updateEventMetas = props.updateEventMetas;
25
25
  var _upDatedDmFun = upDatedDmFun(),
26
26
  _upDatedDmFun2 = _slicedToArray(_upDatedDmFun, 2),
27
27
  state = _upDatedDmFun2[0],
@@ -32,6 +32,49 @@ var DataManage = function DataManage(props) {
32
32
  payload: updateEventMetas
33
33
  });
34
34
  }, []);
35
+ var _useContext = useContext(BizGlobalDataContext),
36
+ currentApp = _useContext.currentApp,
37
+ authority = _useContext.authority;
38
+ // const [listTab, setListTab] = useState<string | number>(props.activeTab || 1);
39
+ // const tabsChange = (e: RadioChangeEvent) => {
40
+ // setListTab(e.target.value);
41
+ // };
42
+ // 判断埋点方案开关是否打开
43
+ var _useState = useState(0),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ isOpen = _useState2[0],
46
+ setIsOpen = _useState2[1];
47
+ var queryControlSwitch = function queryControlSwitch() {
48
+ request(apis.queryControlSwitch, {
49
+ method: 'get',
50
+ params: {
51
+ appId: getAppID(currentApp)
52
+ }
53
+ }).then(function (res) {
54
+ if (!res) return;
55
+ setIsOpen(res.data.isOpen);
56
+ });
57
+ };
58
+ // 不在方案中的数据
59
+ var _useState3 = useState({}),
60
+ _useState4 = _slicedToArray(_useState3, 2),
61
+ queryPlanData = _useState4[0],
62
+ setqueryPlanData = _useState4[1];
63
+ var queryPlan = function queryPlan() {
64
+ request(apis.queryPlan, {
65
+ method: 'post',
66
+ data: {
67
+ appId: getAppID(currentApp)
68
+ }
69
+ }).then(function (res) {
70
+ setqueryPlanData(res.data);
71
+ });
72
+ };
73
+ // 初始化数据
74
+ useEffect(function () {
75
+ queryControlSwitch();
76
+ queryPlan();
77
+ }, []);
35
78
  return /*#__PURE__*/React.createElement(DmContext.Provider, {
36
79
  value: {
37
80
  state: state,
@@ -42,22 +85,27 @@ var DataManage = function DataManage(props) {
42
85
  }, /*#__PURE__*/React.createElement(Tabs, {
43
86
  className: "tabs",
44
87
  defaultActiveKey: "0",
45
- items: [authority[10018] && {
46
- key: '0',
47
- label: '埋点管理',
48
- children: /*#__PURE__*/React.createElement(DataCollection, {
49
- activeTab: props.activeSubTab,
50
- extraTabs: props.extraSubTabs
51
- })
52
- }, authority[10019] && {
88
+ destroyInactiveTabPane: true,
89
+ items: [authority[100020] && {
53
90
  key: '1',
54
- label: '埋点方案管理',
55
- disabled: !showPlan,
56
- children: /*#__PURE__*/React.createElement(PlanList, null)
91
+ label: '元事件',
92
+ children: /*#__PURE__*/React.createElement(EventList, {
93
+ isOpen: isOpen,
94
+ queryPlanData: queryPlanData
95
+ })
96
+ }, authority[1700559695] && {
97
+ key: '3',
98
+ label: '虚拟事件',
99
+ children: /*#__PURE__*/React.createElement(VirtualEventList, null)
100
+ }, authority[100021] && {
101
+ key: '2',
102
+ label: '用户属性管理',
103
+ children: /*#__PURE__*/React.createElement(CollectionAttributeList, {
104
+ isOpen: isOpen,
105
+ queryPlanData: queryPlanData,
106
+ source: "user"
107
+ })
57
108
  }].concat(_toConsumableArray(props.extraTabs || []))
58
109
  })));
59
110
  };
60
- DataManage.defaultProps = {
61
- showPlan: true
62
- };
63
111
  export default DataManage;