@zgfe/modules-dm 1.0.2-dm.2 → 1.0.2-dm.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.
@@ -35,6 +35,11 @@ var PlanList = function PlanList(props) {
35
35
 
36
36
 
37
37
  var tableDel = function tableDel(data) {
38
+ if (isDemo) {
39
+ message.error('demo环境,无法删除');
40
+ return;
41
+ }
42
+
38
43
  Modal.confirm({
39
44
  centered: true,
40
45
  title: '是否确认删除方案?',
@@ -52,7 +57,7 @@ var PlanList = function PlanList(props) {
52
57
  message.success('删除成功');
53
58
  queryList();
54
59
  }).catch(function (err) {
55
- message.success('删除失败');
60
+ message.error('删除失败');
56
61
  }).finally(function () {});
57
62
  }
58
63
  });
@@ -204,7 +209,12 @@ var PlanList = function PlanList(props) {
204
209
  unCheckedChildren: "\u5173",
205
210
  checked: isOpen
206
211
  })), /*#__PURE__*/React.createElement(Button, {
212
+ disabled: isDemo,
207
213
  onClick: function onClick() {
214
+ if (listData.length >= 10) {
215
+ return message.error('最多创建10个埋点方案');
216
+ }
217
+
208
218
  setDrawerShow(true);
209
219
  },
210
220
  type: "primary",
@@ -223,6 +233,7 @@ var PlanList = function PlanList(props) {
223
233
  // onChange={onChange}
224
234
  pagination: false
225
235
  })), /*#__PURE__*/React.createElement(AddPlan, {
236
+ listData: listData,
226
237
  detailName: detailName,
227
238
  drawerShow: drawerShow,
228
239
  drawerClose: drawerClose,
@@ -6,6 +6,7 @@ interface PropsType {
6
6
  searchData: string;
7
7
  setSearchData: Function;
8
8
  setVisible: Function;
9
+ isDemo?: boolean;
9
10
  }
10
11
  declare const Search: React.FC<PropsType>;
11
12
  export default Search;
@@ -32,6 +32,7 @@ var Search = function Search(props) {
32
32
  }
33
33
  }),
34
34
  type: "primary",
35
+ disabled: props.isDemo,
35
36
  className: "".concat(classPrefix, "-add-button"),
36
37
  onClick: function onClick() {
37
38
  props.setVisible(true);
@@ -76,6 +76,11 @@
76
76
  .add-plan {
77
77
  position: relative;
78
78
  height: 100%;
79
+ .spin {
80
+ position: absolute;
81
+ top: 50%;
82
+ left: 50%;
83
+ }
79
84
  .point-active,
80
85
  .point-active-null {
81
86
  display: inline-block;
@@ -1,31 +1,11 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- 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; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
1
  import { Select, Table, Checkbox } from 'antd';
14
2
  var Option = Select.Option;
15
- import React, { useEffect, useState } from 'react';
3
+ import React from 'react';
16
4
  import './styles/index.less';
17
5
 
18
6
  var UserAttributeList = function UserAttributeList(props) {
19
7
  var classPrefix = 'user-list'; // console.log('userAttrData', props.userAttrData);
20
-
21
- var _useState = useState([]),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- renderData = _useState2[0],
24
- setRenderData = _useState2[1];
25
-
26
- useEffect(function () {
27
- setRenderData(props.userAttrData);
28
- }, [props.userAttrData]); // 表格列
8
+ // 表格列
29
9
 
30
10
  var columns = [{
31
11
  title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Checkbox, {
@@ -68,7 +48,7 @@ var UserAttributeList = function UserAttributeList(props) {
68
48
  }, /*#__PURE__*/React.createElement(Table, {
69
49
  className: "".concat(classPrefix, "-table"),
70
50
  columns: columns,
71
- dataSource: renderData,
51
+ dataSource: props.userAttrData,
72
52
  bordered: true,
73
53
  pagination: false
74
54
  }));
@@ -0,0 +1,7 @@
1
+ export interface Action {
2
+ type: ActionType;
3
+ payload: any;
4
+ }
5
+ export declare enum ActionType {
6
+ SET_GLOBAL = "SET_GLOBAL"
7
+ }
@@ -0,0 +1,5 @@
1
+ export var ActionType;
2
+
3
+ (function (ActionType) {
4
+ ActionType["SET_GLOBAL"] = "SET_GLOBAL";
5
+ })(ActionType || (ActionType = {}));
@@ -0,0 +1,8 @@
1
+ import { Dispatch } from 'react';
2
+ import { State } from './state';
3
+ import { Action } from './action';
4
+ export declare const DmContext: import("react").Context<{
5
+ state: State;
6
+ dispatch: Dispatch<Action>;
7
+ }>;
8
+ export declare const upDatedDmFun: () => [state: State, dispatch: Dispatch<Action>];
@@ -0,0 +1,41 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+
7
+ 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; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import { useReducer, createContext } from 'react';
14
+ import { initState } from './state';
15
+ import { ActionType } from './action';
16
+
17
+ var DmReducer = function DmReducer(prevState, action) {
18
+ // console.log('DmReducer', prevState, action);
19
+ switch (action.type) {
20
+ case ActionType.SET_GLOBAL:
21
+ return {
22
+ updateEventMetas: action.payload
23
+ };
24
+
25
+ default:
26
+ return initState;
27
+ }
28
+ };
29
+
30
+ export var DmContext = /*#__PURE__*/createContext({
31
+ state: initState,
32
+ dispatch: function dispatch() {}
33
+ });
34
+ export var upDatedDmFun = function upDatedDmFun() {
35
+ var _useReducer = useReducer(DmReducer, initState),
36
+ _useReducer2 = _slicedToArray(_useReducer, 2),
37
+ state = _useReducer2[0],
38
+ dispatch = _useReducer2[1];
39
+
40
+ return [state, dispatch];
41
+ };
@@ -0,0 +1,4 @@
1
+ export declare const initState: State;
2
+ export interface State {
3
+ updateEventMetas: Function;
4
+ }
@@ -0,0 +1,4 @@
1
+ export var initState = {
2
+ // 更新主应用回调
3
+ updateEventMetas: function updateEventMetas() {}
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-dm",
3
- "version": "1.0.2-dm.2",
3
+ "version": "1.0.2-dm.20",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "license": "ISC",
@@ -41,7 +41,7 @@
41
41
  "@types/lodash": "^4.14.182",
42
42
  "@umijs/fabric": "^2.8.1",
43
43
  "@umijs/test": "^3.0.5",
44
- "@zgfe/business-lib": "1.1.7-dmd.1",
44
+ "@zgfe/business-lib": "1.1.7-dmd2.7",
45
45
  "antd": "4.22.6",
46
46
  "dumi": "^1.1.0",
47
47
  "father-build": "^1.17.2",
@@ -53,7 +53,7 @@
53
53
  "umi-request": "^1.4.0",
54
54
  "yorkie": "^2.0.0"
55
55
  },
56
- "gitHead": "21b241c8db6f499daff43a19cbea9bdae598bd2f",
56
+ "gitHead": "d0bf84e8a1b86247fd042fcca3c497f0e065e0a9",
57
57
  "gitHooks": {
58
58
  "pre-commit": "lint-staged"
59
59
  }