@zgfe/modules-dm 1.0.2-dm.6 → 1.0.2-dm.8
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.js +2 -1
- package/es/modules/dataCollection/index.d.ts +3 -1
- package/es/modules/dataCollection/index.js +2 -1
- package/es/modules/dataCollection/styles/index.less +1 -1
- package/es/modules/dataCollection/tablePlus.js +11 -3
- package/es/modules/dataManage/index.d.ts +4 -1
- package/es/modules/dataManage/index.js +15 -1
- package/es/store/action.d.ts +7 -0
- package/es/store/action.js +5 -0
- package/es/store/index.d.ts +7 -0
- package/es/store/index.js +24 -0
- package/es/store/state.d.ts +4 -0
- package/es/store/state.js +6 -0
- package/package.json +2 -2
|
@@ -24,7 +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
|
|
|
29
30
|
var _useState = useState(0),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -23,7 +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
|
|
|
28
29
|
var _useState = useState(1),
|
|
29
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24,6 +24,7 @@ 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';
|
|
@@ -33,7 +34,10 @@ var TablePlus = function TablePlus(props) {
|
|
|
33
34
|
|
|
34
35
|
var _useContext = useContext(BizGlobalDataContext),
|
|
35
36
|
currentApp = _useContext.currentApp,
|
|
36
|
-
isDemo = _useContext.isDemo;
|
|
37
|
+
isDemo = _useContext.isDemo;
|
|
38
|
+
|
|
39
|
+
var _useContext2 = useContext(DmContext),
|
|
40
|
+
state = _useContext2.state; // 别名foucs
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
var _useState = useState(''),
|
|
@@ -60,6 +64,8 @@ var TablePlus = function TablePlus(props) {
|
|
|
60
64
|
if (res) {
|
|
61
65
|
message.success('修改成功');
|
|
62
66
|
props.Refresh();
|
|
67
|
+
console.log(state.updateEventMetas);
|
|
68
|
+
state.updateEventMetas(); // 更新store
|
|
63
69
|
}
|
|
64
70
|
}).catch(function (err) {
|
|
65
71
|
message.error('修改失败');
|
|
@@ -272,14 +278,16 @@ var TablePlus = function TablePlus(props) {
|
|
|
272
278
|
if (eventGroupId != undefined) _temp = {
|
|
273
279
|
eventGroupId: eventGroupId
|
|
274
280
|
};
|
|
281
|
+
if (type != 'copy') _temp = _objectSpread(_objectSpread({}, _temp), {}, {
|
|
282
|
+
oldEventGroupId: data.groupId
|
|
283
|
+
});
|
|
275
284
|
request(apis.operateGroupRelations, {
|
|
276
285
|
method: 'post',
|
|
277
286
|
data: _objectSpread({
|
|
278
287
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
279
288
|
platform: 0,
|
|
280
289
|
hasPublicAttrView: true,
|
|
281
|
-
eventIds: groupCheckedData[data.groupId].join(',')
|
|
282
|
-
oldEventGroupId: type == 'copy' ? null : data.groupId
|
|
290
|
+
eventIds: groupCheckedData[data.groupId].join(',')
|
|
283
291
|
}, _temp)
|
|
284
292
|
}).then(function (res) {
|
|
285
293
|
message.success('成功');
|
|
@@ -12,15 +12,29 @@ 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, useContext, useEffect } from 'react';
|
|
16
16
|
import './styles/index.less'; // import EventList from './eventList';
|
|
17
17
|
// import UserAttributeList from './userAttributeList';
|
|
18
18
|
|
|
19
|
+
import { DmContext } 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';
|
|
26
|
+
var updateEventMetas = props.updateEventMetas; // const Context = createContext(updateEventMetas);
|
|
27
|
+
|
|
28
|
+
var _useContext = useContext(DmContext),
|
|
29
|
+
state = _useContext.state,
|
|
30
|
+
dispatch = _useContext.dispatch;
|
|
31
|
+
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
dispatch({
|
|
34
|
+
type: ActionType.SET_GLOBAL,
|
|
35
|
+
payload: updateEventMetas
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
24
38
|
|
|
25
39
|
var _useState = useState('0'),
|
|
26
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
import { createContext } from 'react';
|
|
8
|
+
import { initState } from './state';
|
|
9
|
+
import { ActionType } from './action';
|
|
10
|
+
|
|
11
|
+
var DmReducer = function DmReducer(prevState, action) {
|
|
12
|
+
switch (action.type) {
|
|
13
|
+
case ActionType.SET_GLOBAL:
|
|
14
|
+
return _objectSpread(_objectSpread({}, prevState), action.payload);
|
|
15
|
+
|
|
16
|
+
default:
|
|
17
|
+
return initState;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export var DmContext = /*#__PURE__*/createContext({
|
|
22
|
+
state: initState,
|
|
23
|
+
dispatch: function dispatch() {}
|
|
24
|
+
});
|
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.8",
|
|
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": "bdee61b7b991530f7bf645fd62ae7b5e72a70385",
|
|
57
57
|
"gitHooks": {
|
|
58
58
|
"pre-commit": "lint-staged"
|
|
59
59
|
}
|