@zgfe/modules-dm 1.0.31 → 1.0.34-qirui.1

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.
@@ -24,5 +24,6 @@ declare let apis: {
24
24
  queryControlSwitch: string;
25
25
  updateControlSwitch: string;
26
26
  exportPlanTmp: string;
27
+ exportAliasTmp: string;
27
28
  };
28
29
  export default apis;
@@ -48,7 +48,9 @@ var apis = {
48
48
  // 更新 埋点方案控制开关状态
49
49
  updateControlSwitch: '/zg/web/v2/managementPlan/updateControlSwitch',
50
50
  // 导出方案模板
51
- exportPlanTmp: '/zg/web/v2/managementPlan/downloadPlanTemplate'
51
+ exportPlanTmp: '/zg/web/v2/managementPlan/downloadPlanTemplate',
52
+ // 导出别名模板
53
+ exportAliasTmp: '/zg/web/v2/utm/template'
52
54
  };
53
55
  // for (const api in apis) {
54
56
  // if (api != 'propUpload') {
@@ -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 { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
13
+ import { BizGlobalDataContext, IconFont, ajax } from '@zgfe/business-lib';
14
14
  import { Input, Button, Select, Table, message, Modal, Upload, Popover } from 'antd';
15
15
  import React, { useEffect, useState, useContext } from 'react';
16
16
  import './styles/index.less';
@@ -339,6 +339,10 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
339
339
  _useState16 = _slicedToArray(_useState15, 2),
340
340
  batchId = _useState16[0],
341
341
  setBatchId = _useState16[1];
342
+ var _useState17 = useState(false),
343
+ _useState18 = _slicedToArray(_useState17, 2),
344
+ exportAliasTmp = _useState18[0],
345
+ setExportAliasTmp = _useState18[1];
342
346
  var uploadProps = {
343
347
  maxCount: 1,
344
348
  showUploadList: false,
@@ -368,10 +372,10 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
368
372
  }
369
373
  };
370
374
  // 清空属性值别名excel数据
371
- var _useState17 = useState(false),
372
- _useState18 = _slicedToArray(_useState17, 2),
373
- clearFlag = _useState18[0],
374
- setClearFlag = _useState18[1];
375
+ var _useState19 = useState(false),
376
+ _useState20 = _slicedToArray(_useState19, 2),
377
+ clearFlag = _useState20[0],
378
+ setClearFlag = _useState20[1];
375
379
  var clearData = function clearData() {
376
380
  setAttrExcelData([]);
377
381
  setClearFlag(true);
@@ -454,12 +458,24 @@ var CollectionAttributeList = function CollectionAttributeList(props) {
454
458
  type: "daochu1"
455
459
  })
456
460
  }, "\u4E0A\u4F20 excel \u6587\u4EF6")), /*#__PURE__*/React.createElement(Button, {
461
+ loading: exportAliasTmp,
457
462
  icon: /*#__PURE__*/React.createElement(IconFont, {
458
463
  type: "xiazai1"
459
464
  }),
460
465
  size: "small",
461
466
  onClick: function onClick() {
462
- return window.location.href = "/analysis/api/utm/template?fileName=".concat(source == 'user' ? '用户' : '事件', "\u5C5E\u6027\u503C\u6A21\u677F.xlsx");
467
+ setExportAliasTmp(true);
468
+ ajax(apis.exportAliasTmp, {
469
+ method: 'get',
470
+ responseType: 'blob',
471
+ fileName: "".concat(source == 'user' ? '用户' : '事件', "\u5C5E\u6027\u503C\u6A21\u677F"),
472
+ getResponse: true,
473
+ params: {
474
+ fileName: '事件属性值模板.xlsx'
475
+ }
476
+ }).finally(function () {
477
+ setExportAliasTmp(false);
478
+ });
463
479
  }
464
480
  }, "\u6A21\u677F\u4E0B\u8F7D")), attrExcelData.length > 0 && /*#__PURE__*/React.createElement("div", {
465
481
  className: "clearData",
@@ -23,7 +23,7 @@ var CollectionEventList = function CollectionEventList(props) {
23
23
  var classPrefix = 'event-list';
24
24
  var _useContext = useContext(BizGlobalDataContext),
25
25
  currentApp = _useContext.currentApp,
26
- isDemo = _useContext.isDemo;
26
+ authority = _useContext.authority;
27
27
  var _useContext2 = useContext(DmContext),
28
28
  state = _useContext2.state;
29
29
  // const { updateEventMetas } = props;
@@ -412,7 +412,7 @@ var CollectionEventList = function CollectionEventList(props) {
412
412
  className: "top-button",
413
413
  type: "primary",
414
414
  shape: "round",
415
- disabled: isDemo,
415
+ disabled: !authority[1000002],
416
416
  icon: /*#__PURE__*/React.createElement(IconFont, {
417
417
  style: {
418
418
  marginRight: '5px'
@@ -16,7 +16,7 @@ var DataCollection = function DataCollection(props) {
16
16
  var _props$extraTabs, _props$extraTabs2;
17
17
  var _useContext = useContext(BizGlobalDataContext),
18
18
  currentApp = _useContext.currentApp,
19
- isDemo = _useContext.isDemo;
19
+ authority = _useContext.authority;
20
20
  var classPrefix = 'data-collection';
21
21
  // const { updateEventMetas } = props;
22
22
  // console.log('①埋点方案', currentApp?.appId, getAppID(currentApp));
@@ -71,9 +71,9 @@ var DataCollection = function DataCollection(props) {
71
71
  style: {
72
72
  marginBottom: 16
73
73
  }
74
- }, /*#__PURE__*/React.createElement(Radio.Button, {
74
+ }, authority[100020] && /*#__PURE__*/React.createElement(Radio.Button, {
75
75
  value: 1
76
- }, "\u4E8B\u4EF6\u5217\u8868"), /*#__PURE__*/React.createElement(Radio.Button, {
76
+ }, "\u4E8B\u4EF6\u5217\u8868"), authority[100021] && /*#__PURE__*/React.createElement(Radio.Button, {
77
77
  value: 2
78
78
  }, "\u7528\u6237\u5C5E\u6027\u5217\u8868"), (_props$extraTabs = props.extraTabs) === null || _props$extraTabs === void 0 ? void 0 : _props$extraTabs.map(function (item) {
79
79
  return /*#__PURE__*/React.createElement(Radio.Button, {
@@ -81,10 +81,10 @@ var DataCollection = function DataCollection(props) {
81
81
  value: item.key,
82
82
  disabled: item.disabled
83
83
  }, item.label);
84
- })), listTab == 1 && /*#__PURE__*/React.createElement(EventList, {
84
+ })), listTab == 1 && authority[100020] && /*#__PURE__*/React.createElement(EventList, {
85
85
  isOpen: isOpen,
86
86
  queryPlanData: queryPlanData
87
- }), listTab == 2 && /*#__PURE__*/React.createElement(CollectionAttributeList, {
87
+ }), listTab == 2 && authority[100021] && /*#__PURE__*/React.createElement(CollectionAttributeList, {
88
88
  isOpen: isOpen,
89
89
  queryPlanData: queryPlanData,
90
90
  source: "user"
@@ -191,7 +191,6 @@
191
191
  cursor: pointer;
192
192
  .event_name-text {
193
193
  display: -webkit-box;
194
- width: 120px;
195
194
  overflow: hidden;
196
195
  -webkit-box-orient: vertical;
197
196
  -webkit-line-clamp: 1;
@@ -27,7 +27,8 @@ var TablePlus = function TablePlus(props) {
27
27
  isOpen = props.isOpen;
28
28
  var _useContext = useContext(BizGlobalDataContext),
29
29
  currentApp = _useContext.currentApp,
30
- isDemo = _useContext.isDemo;
30
+ isDemo = _useContext.isDemo,
31
+ authority = _useContext.authority;
31
32
  var _useContext2 = useContext(DmContext),
32
33
  state = _useContext2.state;
33
34
  // 别名foucs
@@ -306,7 +307,7 @@ var TablePlus = function TablePlus(props) {
306
307
  dataIndex: 'event_name',
307
308
  key: 'event_name',
308
309
  fixed: 'left',
309
- width: 180,
310
+ width: 380,
310
311
  render: function render(text, record, index) {
311
312
  if (record.groupId) {
312
313
  var _groupCheckedData$rec;
@@ -528,6 +529,10 @@ var TablePlus = function TablePlus(props) {
528
529
  }, record.event_attrs.length, /*#__PURE__*/React.createElement(IconFont, {
529
530
  type: "bianji1",
530
531
  onClick: function onClick() {
532
+ if (!authority[1000003]) {
533
+ message.error('无修改权限');
534
+ return;
535
+ }
531
536
  props.eventAttrDataHandle(record);
532
537
  }
533
538
  }));
@@ -545,8 +550,8 @@ var TablePlus = function TablePlus(props) {
545
550
  className: "edit-del"
546
551
  }, /*#__PURE__*/React.createElement(IconFont, {
547
552
  onClick: function onClick() {
548
- if (isDemo) {
549
- message.error('demo环境无法修改');
553
+ if (!authority[1000003]) {
554
+ message.error('无修改权限');
550
555
  return;
551
556
  }
552
557
  setEventNameData({
@@ -559,8 +564,8 @@ var TablePlus = function TablePlus(props) {
559
564
  type: "bianji"
560
565
  }), /*#__PURE__*/React.createElement(IconFont, {
561
566
  onClick: function onClick() {
562
- if (isDemo) {
563
- message.error('demo环境无法删除');
567
+ if (!authority[1000004]) {
568
+ message.error('无修改权限');
564
569
  return;
565
570
  }
566
571
  eventNameDel(record.groupId);
@@ -571,8 +576,8 @@ var TablePlus = function TablePlus(props) {
571
576
  return /*#__PURE__*/React.createElement("div", {
572
577
  className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
573
578
  onClick: function onClick() {
574
- if (isDemo) {
575
- message.error('demo环境无法删除');
579
+ if (!authority[1000005]) {
580
+ message.error('无修改权限');
576
581
  return;
577
582
  }
578
583
  record.owner != 'zg_abp' ? eventItemDel(record.event_id) : message.error('内置事件无法删除');
@@ -18,7 +18,7 @@ import PlanList from '../dataPlan';
18
18
  import DataCollection from '../dataCollection';
19
19
  var DataManage = function DataManage(props) {
20
20
  var _useContext = useContext(BizGlobalDataContext),
21
- isDemo = _useContext.isDemo;
21
+ authority = _useContext.authority;
22
22
  var classPrefix = 'data-manage';
23
23
  var updateEventMetas = props.updateEventMetas,
24
24
  showPlan = props.showPlan;
@@ -40,15 +40,15 @@ var DataManage = function DataManage(props) {
40
40
  }, /*#__PURE__*/React.createElement("div", {
41
41
  className: classPrefix
42
42
  }, /*#__PURE__*/React.createElement(Tabs, {
43
- className: "tabs ".concat(isDemo && 'tabs-demo'),
43
+ className: "tabs",
44
44
  defaultActiveKey: "0",
45
- items: [{
45
+ items: [authority[10018] && {
46
46
  key: '0',
47
47
  label: '埋点管理',
48
48
  children: /*#__PURE__*/React.createElement(DataCollection, {
49
49
  extraTabs: props.extraSubTabs
50
50
  })
51
- }, {
51
+ }, authority[10019] && {
52
52
  key: '1',
53
53
  label: '埋点方案管理',
54
54
  disabled: !showPlan,
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
8
8
  import { Switch, Button, DatePicker, Table, Modal, message } from 'antd';
9
9
  var RangePicker = DatePicker.RangePicker;
10
- import React, { useEffect, useState, useContext } from 'react';
10
+ import React, { useEffect, useState, useContext, Fragment } from 'react';
11
11
  import './styles/index.less';
12
12
  import request from '../../utils/ajax';
13
13
  import apis from '../../constants/api';
@@ -17,7 +17,8 @@ var PlanList = function PlanList(props) {
17
17
  var classPrefix = 'plan-list';
18
18
  var _useContext = useContext(BizGlobalDataContext),
19
19
  currentApp = _useContext.currentApp,
20
- isDemo = _useContext.isDemo;
20
+ isDemo = _useContext.isDemo,
21
+ authority = _useContext.authority;
21
22
  // console.log('②埋点方案管理', currentApp?.appId, getAppID(currentApp));
22
23
  // 查看方案
23
24
  var tableSee = function tableSee(data) {
@@ -85,17 +86,17 @@ var PlanList = function PlanList(props) {
85
86
  title: '操作',
86
87
  dataIndex: 'set',
87
88
  render: function render(_text, _record) {
88
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
89
+ return /*#__PURE__*/React.createElement("div", null, authority[100024] && /*#__PURE__*/React.createElement(Fragment, null, authority[1000006] && /*#__PURE__*/React.createElement("span", {
89
90
  className: "".concat(classPrefix, "-table-see"),
90
91
  onClick: function onClick() {
91
92
  return tableSee(_record);
92
93
  }
93
- }, "\u67E5\u770B"), /*#__PURE__*/React.createElement("span", {
94
+ }, "\u67E5\u770B"), authority[1000007] && /*#__PURE__*/React.createElement("span", {
94
95
  className: "".concat(classPrefix, "-table-del"),
95
96
  onClick: function onClick() {
96
97
  return tableDel(_record.planName);
97
98
  }
98
- }, "\u5220\u9664"));
99
+ }, "\u5220\u9664")), !authority[100024] && /*#__PURE__*/React.createElement("span", null, " - "));
99
100
  }
100
101
  }];
101
102
  // 方案列表
@@ -200,7 +201,7 @@ var PlanList = function PlanList(props) {
200
201
  unCheckedChildren: "\u5173",
201
202
  checked: isOpen
202
203
  })), /*#__PURE__*/React.createElement(Button, {
203
- disabled: isDemo,
204
+ disabled: !authority[100023],
204
205
  onClick: function onClick() {
205
206
  if (listData.length >= 10) {
206
207
  return message.error('最多创建10个埋点方案');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.31",
3
+ "version": "1.0.34-qirui.1",
4
4
  "license": "ISC",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "@types/lodash": "^4.14.182",
38
38
  "@umijs/fabric": "^2.8.1",
39
39
  "@umijs/test": "^3.0.5",
40
- "@zgfe/business-lib": "^1.1.57",
40
+ "@zgfe/business-lib": "1.1.96-qirui.0",
41
41
  "antd": "4.24.10",
42
42
  "dumi": "^1.1.0",
43
43
  "father-build": "^1.17.2",
@@ -49,7 +49,7 @@
49
49
  "umi-request": "^1.4.0",
50
50
  "yorkie": "^2.0.0"
51
51
  },
52
- "gitHead": "0e2ce6bb2f5bbe673ba0e09552ff7d5aa12ebd6d",
52
+ "gitHead": "4bb72f2f78a3b969c52e8ac1dc8a0fd96cebc5ed",
53
53
  "gitHooks": {
54
54
  "pre-commit": "lint-staged"
55
55
  }