@zgfe/modules-dm 1.0.2-dm.7 → 1.0.2-dm.9
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.
- package/es/modules/dataCollection/collectionEventList.d.ts +0 -1
- package/es/modules/dataCollection/collectionEventList.js +2 -4
- package/es/modules/dataCollection/index.d.ts +0 -1
- package/es/modules/dataCollection/index.js +2 -4
- package/es/modules/dataCollection/tablePlus.d.ts +0 -1
- package/es/modules/dataCollection/tablePlus.js +8 -5
- package/es/modules/dataManage/index.js +28 -7
- package/es/store/action.d.ts +7 -0
- package/es/store/action.js +5 -0
- package/es/store/index.d.ts +8 -0
- package/es/store/index.js +42 -0
- package/es/store/state.d.ts +4 -0
- package/es/store/state.js +6 -0
- package/package.json +2 -2
|
@@ -24,9 +24,8 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
24
24
|
|
|
25
25
|
var _useContext = useContext(BizGlobalDataContext),
|
|
26
26
|
currentApp = _useContext.currentApp,
|
|
27
|
-
isDemo = _useContext.isDemo;
|
|
27
|
+
isDemo = _useContext.isDemo; // const { updateEventMetas } = props;
|
|
28
28
|
|
|
29
|
-
var updateEventMetas = props.updateEventMetas;
|
|
30
29
|
|
|
31
30
|
var _useState = useState(0),
|
|
32
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -306,8 +305,7 @@ var CollectionEventList = function CollectionEventList(props) {
|
|
|
306
305
|
markTypeFilter: markTypeFilter,
|
|
307
306
|
isOpen: props.isOpen,
|
|
308
307
|
queryPlanData: props.queryPlanData,
|
|
309
|
-
eventAttrDataHandle: eventAttrDataHandle
|
|
310
|
-
updateEventMetas: updateEventMetas
|
|
308
|
+
eventAttrDataHandle: eventAttrDataHandle
|
|
311
309
|
})), eventAttrListShow && /*#__PURE__*/React.createElement(CollectionAttributeList, {
|
|
312
310
|
isOpen: props.isOpen,
|
|
313
311
|
queryPlanData: props.queryPlanData,
|
|
@@ -23,9 +23,8 @@ var DataCollection = function DataCollection(props) {
|
|
|
23
23
|
|
|
24
24
|
var _useContext = useContext(BizGlobalDataContext),
|
|
25
25
|
currentApp = _useContext.currentApp,
|
|
26
|
-
isDemo = _useContext.isDemo;
|
|
26
|
+
isDemo = _useContext.isDemo; // const { updateEventMetas } = props;
|
|
27
27
|
|
|
28
|
-
var updateEventMetas = props.updateEventMetas;
|
|
29
28
|
|
|
30
29
|
var _useState = useState(1),
|
|
31
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -88,8 +87,7 @@ var DataCollection = function DataCollection(props) {
|
|
|
88
87
|
key: "2"
|
|
89
88
|
})), listTab == 1 && /*#__PURE__*/React.createElement(EventList, {
|
|
90
89
|
isOpen: isOpen,
|
|
91
|
-
queryPlanData: queryPlanData
|
|
92
|
-
updateEventMetas: updateEventMetas
|
|
90
|
+
queryPlanData: queryPlanData
|
|
93
91
|
}), listTab == 2 && /*#__PURE__*/React.createElement(UserAttributeList, {
|
|
94
92
|
isOpen: isOpen,
|
|
95
93
|
queryPlanData: queryPlanData,
|
|
@@ -24,17 +24,20 @@ var Option = Select.Option;
|
|
|
24
24
|
import React, { useState, useContext } from 'react';
|
|
25
25
|
import './styles/index.less';
|
|
26
26
|
import _ from 'lodash';
|
|
27
|
+
import { DmContext } from '../../store';
|
|
27
28
|
|
|
28
29
|
var TablePlus = function TablePlus(props) {
|
|
29
30
|
var classPrefix = 'table-plus';
|
|
30
31
|
var tableHandleData = props.tableHandleData,
|
|
31
32
|
queryPlanData = props.queryPlanData,
|
|
32
|
-
isOpen = props.isOpen
|
|
33
|
-
updateEventMetas = props.updateEventMetas;
|
|
33
|
+
isOpen = props.isOpen;
|
|
34
34
|
|
|
35
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
36
36
|
currentApp = _useContext.currentApp,
|
|
37
|
-
isDemo = _useContext.isDemo;
|
|
37
|
+
isDemo = _useContext.isDemo;
|
|
38
|
+
|
|
39
|
+
var _useContext2 = useContext(DmContext),
|
|
40
|
+
state = _useContext2.state; // 别名foucs
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
var _useState = useState(''),
|
|
@@ -61,8 +64,8 @@ var TablePlus = function TablePlus(props) {
|
|
|
61
64
|
if (res) {
|
|
62
65
|
message.success('修改成功');
|
|
63
66
|
props.Refresh();
|
|
64
|
-
console.log(updateEventMetas);
|
|
65
|
-
updateEventMetas
|
|
67
|
+
console.log(state.updateEventMetas);
|
|
68
|
+
state.updateEventMetas && state.updateEventMetas(); // 更新store
|
|
66
69
|
}
|
|
67
70
|
}).catch(function (err) {
|
|
68
71
|
message.error('修改失败');
|
|
@@ -12,16 +12,30 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
|
|
13
13
|
import { IconFont } from '@zgfe/business-lib';
|
|
14
14
|
import { Menu } from 'antd';
|
|
15
|
-
import React, { useState } from 'react';
|
|
15
|
+
import React, { useState, useEffect } from 'react';
|
|
16
16
|
import './styles/index.less'; // import EventList from './eventList';
|
|
17
17
|
// import UserAttributeList from './userAttributeList';
|
|
18
18
|
|
|
19
|
+
import { DmContext, upDatedDmFun } from '../../store';
|
|
20
|
+
import { ActionType } from '../../store/action';
|
|
19
21
|
import PlanList from '../dataPlan';
|
|
20
22
|
import DataCollection from '../dataCollection';
|
|
21
23
|
|
|
22
24
|
var DataManage = function DataManage(props) {
|
|
23
25
|
var classPrefix = 'data-manage';
|
|
24
|
-
var updateEventMetas = props.updateEventMetas;
|
|
26
|
+
var updateEventMetas = props.updateEventMetas; // const { state, dispatch } = useContext(DmContext);
|
|
27
|
+
|
|
28
|
+
var _upDatedDmFun = upDatedDmFun(),
|
|
29
|
+
_upDatedDmFun2 = _slicedToArray(_upDatedDmFun, 2),
|
|
30
|
+
state = _upDatedDmFun2[0],
|
|
31
|
+
dispatch = _upDatedDmFun2[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
dispatch({
|
|
35
|
+
type: ActionType.SET_GLOBAL,
|
|
36
|
+
payload: updateEventMetas
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
25
39
|
|
|
26
40
|
var _useState = useState('0'),
|
|
27
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -45,7 +59,12 @@ var DataManage = function DataManage(props) {
|
|
|
45
59
|
type: "maidianfanganguanli"
|
|
46
60
|
})
|
|
47
61
|
}];
|
|
48
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
+
return /*#__PURE__*/React.createElement(DmContext.Provider, {
|
|
63
|
+
value: {
|
|
64
|
+
state: state,
|
|
65
|
+
dispatch: dispatch
|
|
66
|
+
}
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
68
|
className: classPrefix
|
|
50
69
|
}, /*#__PURE__*/React.createElement("div", {
|
|
51
70
|
className: "".concat(classPrefix, "-menu")
|
|
@@ -53,9 +72,11 @@ var DataManage = function DataManage(props) {
|
|
|
53
72
|
defaultSelectedKeys: ['0'],
|
|
54
73
|
onSelect: onSelect,
|
|
55
74
|
items: items
|
|
56
|
-
})), menuTab == '0' && /*#__PURE__*/React.createElement(DataCollection,
|
|
57
|
-
updateEventMetas: updateEventMetas
|
|
58
|
-
}), menuTab == '1' && /*#__PURE__*/React.createElement(PlanList, null));
|
|
75
|
+
})), menuTab == '0' && /*#__PURE__*/React.createElement(DataCollection, null), menuTab == '1' && /*#__PURE__*/React.createElement(PlanList, null)));
|
|
59
76
|
};
|
|
60
77
|
|
|
61
|
-
export default DataManage;
|
|
78
|
+
export default DataManage; // export default forwardRef<{}, DataManageProps>((props, ref) => (
|
|
79
|
+
// <DmProvider>
|
|
80
|
+
// <DataManage {...props} />
|
|
81
|
+
// </DmProvider>
|
|
82
|
+
// ));
|
|
@@ -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,42 @@
|
|
|
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
|
+
|
|
20
|
+
switch (action.type) {
|
|
21
|
+
case ActionType.SET_GLOBAL:
|
|
22
|
+
return {
|
|
23
|
+
updateEventMetas: action.payload
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
return initState;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export var DmContext = /*#__PURE__*/createContext({
|
|
32
|
+
state: initState,
|
|
33
|
+
dispatch: function dispatch() {}
|
|
34
|
+
});
|
|
35
|
+
export var upDatedDmFun = function upDatedDmFun() {
|
|
36
|
+
var _useReducer = useReducer(DmReducer, initState),
|
|
37
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
38
|
+
state = _useReducer2[0],
|
|
39
|
+
dispatch = _useReducer2[1];
|
|
40
|
+
|
|
41
|
+
return [state, dispatch];
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.2-dm.
|
|
3
|
+
"version": "1.0.2-dm.9",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"license": "ISC",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"umi-request": "^1.4.0",
|
|
54
54
|
"yorkie": "^2.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d8ae6500f3351c63b291bbadcae1b688d4a3e8e1",
|
|
57
57
|
"gitHooks": {
|
|
58
58
|
"pre-commit": "lint-staged"
|
|
59
59
|
}
|