@zgfe/business-lib 1.2.38 → 1.2.39
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/AUMFormulaTarget/components/formula/util.d.ts +2 -1
- package/es/AUMFormulaTarget/components/formula/util.js +2 -2
- package/es/AUMFormulaTarget/components/formulaItem/index.js +3 -2
- package/es/AUMFormulaTarget/components/panel/cdpCshCondition.js +25 -32
- package/es/AUMFormulaTarget/components/panel/index.js +3 -2
- package/es/AUMFormulaTarget/components/panel/types.d.ts +1 -0
- package/es/attrConditions/components/operateList.js +19 -7
- package/es/attrConditions/utils/operates.d.ts +8 -0
- package/es/attrConditions/utils/operates.js +27 -7
- package/es/attributeSelector/listPanel.js +4 -3
- package/es/constants/apis.d.ts +3 -0
- package/es/constants/apis.js +4 -1
- package/es/constants/common.d.ts +2 -2
- package/es/constants/common.js +43 -39
- package/es/context/index.d.ts +19 -5
- package/es/dataSetGroup/index.js +8 -16
- package/es/dataSetGroup/overlay.js +8 -5
- package/es/dataSetGroup/types.d.ts +1 -0
- package/es/demoWrapper/content.d.ts +2 -0
- package/es/demoWrapper/content.js +28 -11
- package/es/demoWrapper/demo/index.js +15 -2
- package/es/demoWrapper/index.js +78 -14
- package/es/eventSelector/index.js +3 -2
- package/es/eventSelector/listPanel.js +5 -4
- package/es/formulaTarget/components/formula/util.d.ts +2 -1
- package/es/formulaTarget/components/formula/util.js +2 -2
- package/es/formulaTarget/components/formulaItem/index.js +3 -2
- package/es/formulaTarget/components/panel/index.js +3 -2
- package/es/hooks/useBizStore.d.ts +8 -4
- package/es/hooks/useBizStore.js +129 -45
- package/es/hooks/useSubject.js +17 -4
- package/es/productCondition/conditions/cdpCshCondition.js +27 -27
- package/es/productCondition/conditions/textDesc.js +0 -3
- package/es/productCondition/index.js +3 -5
- package/es/productCondition/orConditions.js +0 -1
- package/es/productCondition/types.d.ts +4 -0
- package/es/targetConditionGroup/components/targetDimension.js +7 -5
- package/es/targetConditionGroup/data/operates.d.ts +1 -13
- package/es/targetConditionGroup/data/operates.js +10 -37
- package/es/targetConditionGroup/index.js +3 -2
- package/es/userCondition/conditionTypeList.js +4 -4
- package/es/userCondition/conditions/cdpCondition.js +21 -22
- package/es/userCondition/conditions/cdpCshCondition.js +31 -29
- package/es/userCondition/conditions/tagsCondition.js +4 -1
- package/es/userCondition/demo/index.js +1 -1
- package/es/userCondition/index.js +42 -53
- package/es/userCondition/types.d.ts +5 -0
- package/es/userGroup/index.js +0 -1
- package/es/userGroup/overlay.js +1 -3
- package/es/userGroup/styles/index.less +0 -1
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.js +9 -0
- package/package.json +2 -2
- package/es/demoWrapper/head.d.ts +0 -9
- package/es/demoWrapper/head.js +0 -67
|
@@ -11,14 +11,15 @@ import List from 'rc-virtual-list';
|
|
|
11
11
|
import _ from 'lodash';
|
|
12
12
|
import IconFont from '../icon/iconFont';
|
|
13
13
|
import UserGroupContext from './context';
|
|
14
|
+
import BizGlobalDataContext from '../context';
|
|
14
15
|
var GroupItem = function GroupItem(_ref) {
|
|
15
16
|
var item = _ref.item,
|
|
16
17
|
currentGroup = _ref.currentGroup,
|
|
17
18
|
onClose = _ref.onClose,
|
|
18
19
|
setCurrentGroup = _ref.setCurrentGroup;
|
|
19
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "".concat(classPrefix, "-item ").concat((currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.
|
|
21
|
-
key: item.
|
|
21
|
+
className: "".concat(classPrefix, "-item ").concat((currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.metaDatasetId) === item.metaDatasetId ? 'active' : ''),
|
|
22
|
+
key: item.metaDatasetId,
|
|
22
23
|
onClick: function onClick() {
|
|
23
24
|
setCurrentGroup(item);
|
|
24
25
|
if (onClose) onClose();
|
|
@@ -44,6 +45,8 @@ var Overlay = function Overlay(_ref2) {
|
|
|
44
45
|
var _useContext = useContext(UserGroupContext),
|
|
45
46
|
value = _useContext.value,
|
|
46
47
|
setValue = _useContext.setValue;
|
|
48
|
+
var _useContext2 = useContext(BizGlobalDataContext),
|
|
49
|
+
currentApp = _useContext2.currentApp;
|
|
47
50
|
useEffect(function () {
|
|
48
51
|
onSearch('');
|
|
49
52
|
setType('userGroup');
|
|
@@ -84,7 +87,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
84
87
|
type: "zengjia"
|
|
85
88
|
}), "\u5FEB\u901F\u521B\u5EFA\u660E\u7EC6\u8868")), /*#__PURE__*/React.createElement("div", {
|
|
86
89
|
className: "".concat(classPrefix, "-divider")
|
|
87
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6240\u6709
|
|
90
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u6240\u6709", (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) != 'user' ? '主体' : '用户')), showList.length > 10 ? /*#__PURE__*/React.createElement(List, {
|
|
88
91
|
data: showList || [],
|
|
89
92
|
itemHeight: 32,
|
|
90
93
|
itemKey: "id",
|
|
@@ -92,7 +95,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
92
95
|
className: "".concat(classPrefix, "-list")
|
|
93
96
|
}, function (item) {
|
|
94
97
|
return /*#__PURE__*/React.createElement(GroupItem, {
|
|
95
|
-
key: item.
|
|
98
|
+
key: item.metaDatasetId,
|
|
96
99
|
item: item,
|
|
97
100
|
currentGroup: currentGroup,
|
|
98
101
|
setCurrentGroup: setCurrentGroup,
|
|
@@ -102,7 +105,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
102
105
|
className: "".concat(classPrefix, "-list")
|
|
103
106
|
}, showList === null || showList === void 0 ? void 0 : showList.map(function (item) {
|
|
104
107
|
return /*#__PURE__*/React.createElement(GroupItem, {
|
|
105
|
-
key: item.
|
|
108
|
+
key: item.metaDatasetId,
|
|
106
109
|
item: item,
|
|
107
110
|
currentGroup: currentGroup,
|
|
108
111
|
setCurrentGroup: setCurrentGroup,
|
|
@@ -50,6 +50,8 @@ function ajax(url, options) {
|
|
|
50
50
|
var DemoContent = function DemoContent(_ref3) {
|
|
51
51
|
var children = _ref3.children,
|
|
52
52
|
currentApp = _ref3.currentApp,
|
|
53
|
+
currentProject = _ref3.currentProject,
|
|
54
|
+
projectList = _ref3.projectList,
|
|
53
55
|
needMeta = _ref3.needMeta,
|
|
54
56
|
contextProps = _ref3.contextProps;
|
|
55
57
|
var _useState = useState([]),
|
|
@@ -88,17 +90,20 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
88
90
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
89
91
|
loadUsers = _useState18[0],
|
|
90
92
|
setLoadUsers = _useState18[1];
|
|
91
|
-
var _useState19 = useState(),
|
|
93
|
+
var _useState19 = useState({}),
|
|
92
94
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var _useState21 = useState(
|
|
95
|
+
currentUser = _useState20[0],
|
|
96
|
+
setCurrentUser = _useState20[1];
|
|
97
|
+
var _useState21 = useState(),
|
|
96
98
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
store = _useState22[0],
|
|
100
|
+
setStore = _useState22[1];
|
|
101
|
+
var _useState23 = useState(false),
|
|
102
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
103
|
+
storeReady = _useState24[0],
|
|
104
|
+
setStoreReady = _useState24[1];
|
|
99
105
|
var _useBizStore = useBizStore({
|
|
100
|
-
currentApp: currentApp
|
|
101
|
-
authority: authority
|
|
106
|
+
currentApp: currentApp
|
|
102
107
|
}),
|
|
103
108
|
userGroupList = _useBizStore.userGroupList,
|
|
104
109
|
groupLoading = _useBizStore.groupLoading,
|
|
@@ -115,6 +120,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
115
120
|
loadEvents();
|
|
116
121
|
loadEnvList();
|
|
117
122
|
loadBasicConfigLoad();
|
|
123
|
+
loadCurrentUserLoad();
|
|
118
124
|
} else {
|
|
119
125
|
setLoadEnv(false);
|
|
120
126
|
setLoadEvent(false);
|
|
@@ -159,7 +165,15 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
159
165
|
}
|
|
160
166
|
useEffect(function () {
|
|
161
167
|
loadAuthorityList();
|
|
162
|
-
}, []);
|
|
168
|
+
}, [currentApp]);
|
|
169
|
+
function loadCurrentUserLoad() {
|
|
170
|
+
ajax('/zg/web/v2/company/currentUser', {
|
|
171
|
+
method: 'get'
|
|
172
|
+
}).then(function (res) {
|
|
173
|
+
var _res$data;
|
|
174
|
+
setCurrentUser(res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.user);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
163
177
|
function loadBasicConfigLoad() {
|
|
164
178
|
setLoadUsers(true);
|
|
165
179
|
ajax('/zg/web/v2/system/config', {
|
|
@@ -222,11 +236,14 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
222
236
|
eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
|
|
223
237
|
userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
|
|
224
238
|
eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
|
|
225
|
-
authority: authority,
|
|
226
|
-
basicConfig: basicConfig,
|
|
227
239
|
eventIdMap: store === null || store === void 0 ? void 0 : store.eventIdMap,
|
|
228
240
|
eventNameMap: store === null || store === void 0 ? void 0 : store.eventNameMap,
|
|
241
|
+
currentProject: currentProject,
|
|
242
|
+
projectList: projectList,
|
|
243
|
+
basicConfig: basicConfig,
|
|
229
244
|
userGroupList: userGroupList,
|
|
245
|
+
authority: authority,
|
|
246
|
+
currentUser: currentUser,
|
|
230
247
|
groupLoading: groupLoading,
|
|
231
248
|
setUserGroupList: setUserGroupList,
|
|
232
249
|
tagList: tagList,
|
|
@@ -2,11 +2,24 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import { DemoWrapper, BizGlobalDataContext, useChanged } from '@zgfe/business-lib';
|
|
3
3
|
function Test() {
|
|
4
4
|
var _useContext = useContext(BizGlobalDataContext),
|
|
5
|
-
currentApp = _useContext.currentApp
|
|
5
|
+
currentApp = _useContext.currentApp,
|
|
6
|
+
currentProject = _useContext.currentProject;
|
|
6
7
|
useChanged(function () {
|
|
7
8
|
console.log('currentApp changed', currentApp);
|
|
8
9
|
}, currentApp);
|
|
9
|
-
return /*#__PURE__*/React.createElement("
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
style: {
|
|
12
|
+
margin: '20px',
|
|
13
|
+
padding: '20px 20px 10px 20px',
|
|
14
|
+
background: 'pink'
|
|
15
|
+
}
|
|
16
|
+
}, /*#__PURE__*/React.createElement("p", null, " \u5F53\u524D\u5E94\u7528\u540D\u79F0: ", currentProject === null || currentProject === void 0 ? void 0 : currentProject.projectName), /*#__PURE__*/React.createElement("p", null, " \u5F53\u524D\u5E94\u7528id: ", currentProject === null || currentProject === void 0 ? void 0 : currentProject.projectId)), /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
style: {
|
|
18
|
+
margin: '20px',
|
|
19
|
+
padding: '20px 20px 10px 20px',
|
|
20
|
+
background: '#FFEB3B'
|
|
21
|
+
}
|
|
22
|
+
}, /*#__PURE__*/React.createElement("p", null, " \u5F53\u524D\u4E3B\u4F53\u540D\u79F0: ", currentApp === null || currentApp === void 0 ? void 0 : currentApp.appName), /*#__PURE__*/React.createElement("p", null, " \u5F53\u524D\u4E3B\u4F53id: ", currentApp === null || currentApp === void 0 ? void 0 : currentApp.id)));
|
|
10
23
|
}
|
|
11
24
|
export default (function () {
|
|
12
25
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
package/es/demoWrapper/index.js
CHANGED
|
@@ -4,12 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { Card, Spin } from 'antd';
|
|
7
|
+
import { Card, Spin, Select, message } from 'antd';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
import BizLoginForm from '../loginForm';
|
|
10
10
|
import request from '../utils/ajax';
|
|
11
11
|
import DemoContent from './content';
|
|
12
|
-
import DemoHeader from './head';
|
|
13
12
|
import './index.less';
|
|
14
13
|
import { ResponseStatus } from '../utils/type';
|
|
15
14
|
var DemoWrapper = function DemoWrapper(_ref) {
|
|
@@ -30,12 +29,21 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
30
29
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
31
30
|
notLogin = _useState6[0],
|
|
32
31
|
setNotLogin = _useState6[1];
|
|
33
|
-
var _useState7 = useState(),
|
|
32
|
+
var _useState7 = useState([]),
|
|
34
33
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
projectList = _useState8[0],
|
|
35
|
+
setrPojectList = _useState8[1];
|
|
36
|
+
var _useState9 = useState({}),
|
|
37
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
38
|
+
currentProject = _useState10[0],
|
|
39
|
+
setCurrentProject = _useState10[1];
|
|
40
|
+
var _useState11 = useState({}),
|
|
41
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
42
|
+
currentApp = _useState12[0],
|
|
43
|
+
setCurrentApp = _useState12[1];
|
|
37
44
|
useEffect(function () {
|
|
38
45
|
getCurrentUser();
|
|
46
|
+
queryAppList();
|
|
39
47
|
}, []);
|
|
40
48
|
function getCurrentUser() {
|
|
41
49
|
request('/zg/web/v2/user/getUserInfo').then(function (res) {
|
|
@@ -46,6 +54,39 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
46
54
|
setLoading(false);
|
|
47
55
|
});
|
|
48
56
|
}
|
|
57
|
+
function queryAppList() {
|
|
58
|
+
setLoading(true);
|
|
59
|
+
request('/zg/web/v2/data/v2ajaxGetDataByApp').then(function (res) {
|
|
60
|
+
if (!res.data) {
|
|
61
|
+
message.error('获取应用列表失败,请重新登录');
|
|
62
|
+
setNotLogin(true);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setrPojectList(res.data.projectList);
|
|
66
|
+
var hasDefaultApp = false;
|
|
67
|
+
if (defaultApp) {
|
|
68
|
+
res.data.projectList.map(function (item) {
|
|
69
|
+
item.appList.map(function (_item) {
|
|
70
|
+
if (defaultApp === _item.id) {
|
|
71
|
+
hasDefaultApp = true;
|
|
72
|
+
setCurrentProject(item);
|
|
73
|
+
setCurrentApp(_item);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
setCurrentProject(res.data.projectList[0]);
|
|
79
|
+
setCurrentApp(res.data.projectList[0].appList[0]);
|
|
80
|
+
}
|
|
81
|
+
if (!hasDefaultApp) {
|
|
82
|
+
setCurrentProject(res.data.projectList[0]);
|
|
83
|
+
setCurrentApp(res.data.projectList[0].appList[0]);
|
|
84
|
+
}
|
|
85
|
+
setAppListLoading(false);
|
|
86
|
+
}).finally(function () {
|
|
87
|
+
setLoading(false);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
49
90
|
if (loading) {
|
|
50
91
|
return /*#__PURE__*/React.createElement(Spin, null);
|
|
51
92
|
}
|
|
@@ -57,14 +98,35 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
57
98
|
}));
|
|
58
99
|
}
|
|
59
100
|
return /*#__PURE__*/React.createElement(Card, {
|
|
60
|
-
title: /*#__PURE__*/React.createElement(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
101
|
+
title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
|
|
102
|
+
value: currentProject.projectId,
|
|
103
|
+
options: projectList,
|
|
104
|
+
fieldNames: {
|
|
105
|
+
label: 'projectName',
|
|
106
|
+
value: 'projectId'
|
|
107
|
+
},
|
|
108
|
+
onChange: function onChange(_id, app) {
|
|
109
|
+
setCurrentProject(app);
|
|
110
|
+
setCurrentApp(app === null || app === void 0 ? void 0 : app.appList[0]);
|
|
111
|
+
},
|
|
112
|
+
style: {
|
|
113
|
+
width: '200px',
|
|
114
|
+
marginRight: '20px'
|
|
115
|
+
}
|
|
116
|
+
}), /*#__PURE__*/React.createElement(Select, {
|
|
117
|
+
value: currentApp.id,
|
|
118
|
+
options: currentProject === null || currentProject === void 0 ? void 0 : currentProject.appList,
|
|
119
|
+
fieldNames: {
|
|
120
|
+
label: 'appName',
|
|
121
|
+
value: 'id'
|
|
122
|
+
},
|
|
123
|
+
onChange: function onChange(_id, app) {
|
|
124
|
+
setCurrentApp(app);
|
|
125
|
+
},
|
|
126
|
+
style: {
|
|
127
|
+
width: '200px'
|
|
66
128
|
}
|
|
67
|
-
}),
|
|
129
|
+
})),
|
|
68
130
|
className: className,
|
|
69
131
|
bodyStyle: {
|
|
70
132
|
background: '#FAFAFB'
|
|
@@ -72,9 +134,11 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
72
134
|
}, appListLoading ? /*#__PURE__*/React.createElement(Spin, {
|
|
73
135
|
tip: "\u5E94\u7528\u4FE1\u606F\u521D\u59CB\u5316\u4E2D"
|
|
74
136
|
}) : /*#__PURE__*/React.createElement(DemoContent, {
|
|
75
|
-
currentApp:
|
|
137
|
+
currentApp: currentApp,
|
|
138
|
+
currentProject: currentProject,
|
|
139
|
+
projectList: projectList,
|
|
76
140
|
needMeta: needMeta,
|
|
77
|
-
key:
|
|
141
|
+
key: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
78
142
|
contextProps: contextProps
|
|
79
143
|
}, children));
|
|
80
144
|
};
|
|
@@ -40,7 +40,8 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
40
40
|
_useContext$eventGrou = _useContext.eventGroupList,
|
|
41
41
|
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
|
|
42
42
|
_useContext$eventIdMa = _useContext.eventIdMap,
|
|
43
|
-
eventIdMap = _useContext$eventIdMa === void 0 ? {} : _useContext$eventIdMa
|
|
43
|
+
eventIdMap = _useContext$eventIdMa === void 0 ? {} : _useContext$eventIdMa,
|
|
44
|
+
currentApp = _useContext.currentApp;
|
|
44
45
|
var selectId = (Math.random() + 10).toString();
|
|
45
46
|
useEffect(function () {
|
|
46
47
|
if (!props.defaultValue) {
|
|
@@ -67,7 +68,7 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
67
68
|
}
|
|
68
69
|
var getValue = function getValue(param) {
|
|
69
70
|
var res = {};
|
|
70
|
-
var allEvents = props.showBuiltInTarget ? eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.concat(BuiltinIndicators) : eventGroupList;
|
|
71
|
+
var allEvents = props.showBuiltInTarget ? eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.concat(BuiltinIndicators(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type)) : eventGroupList;
|
|
71
72
|
if (props.multiple) {
|
|
72
73
|
var params = param;
|
|
73
74
|
return params.filter(function (item) {
|
|
@@ -34,7 +34,8 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
34
34
|
searchValue = _useState2[0],
|
|
35
35
|
setSearchValue = _useState2[1];
|
|
36
36
|
var _useContext = useContext(BizGlobalDataContext),
|
|
37
|
-
eventGroupList = _useContext.eventGroupList
|
|
37
|
+
eventGroupList = _useContext.eventGroupList,
|
|
38
|
+
currentApp = _useContext.currentApp;
|
|
38
39
|
var _useState3 = useState([]),
|
|
39
40
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
41
|
eventGroupListData = _useState4[0],
|
|
@@ -107,7 +108,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
});
|
|
110
|
-
list = props.showBuiltInTarget ? [].concat(_toConsumableArray(BuiltinIndicators.eventList), markList, _toConsumableArray(list)) : [].concat(markList, _toConsumableArray(list));
|
|
111
|
+
list = props.showBuiltInTarget ? [].concat(_toConsumableArray(BuiltinIndicators(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type).eventList), markList, _toConsumableArray(list)) : [].concat(markList, _toConsumableArray(list));
|
|
111
112
|
if (props.extendEvents) {
|
|
112
113
|
list = [].concat(_toConsumableArray(props.extendEvents), _toConsumableArray(list));
|
|
113
114
|
}
|
|
@@ -116,7 +117,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
116
117
|
name: '所有分组'
|
|
117
118
|
};
|
|
118
119
|
setGroupList(function (list) {
|
|
119
|
-
var result = props.showBuiltInTarget ? [group, BuiltinIndicators].concat(_toConsumableArray(list)) : [group].concat(_toConsumableArray(list));
|
|
120
|
+
var result = props.showBuiltInTarget ? [group, BuiltinIndicators(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type)].concat(_toConsumableArray(list)) : [group].concat(_toConsumableArray(list));
|
|
120
121
|
if (!props.filter) return result;
|
|
121
122
|
var finalList = [];
|
|
122
123
|
result.forEach(function (group) {
|
|
@@ -142,7 +143,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
142
143
|
if (props.defaultSelectAble && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.group)) {
|
|
143
144
|
var _props$value$group;
|
|
144
145
|
if (props.showBuiltInTarget && ((_props$value$group = props.value.group) === null || _props$value$group === void 0 ? void 0 : _props$value$group.id) === -2) {
|
|
145
|
-
resultGroup = BuiltinIndicators;
|
|
146
|
+
resultGroup = BuiltinIndicators(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type);
|
|
146
147
|
} else {
|
|
147
148
|
var _currentGroup = group;
|
|
148
149
|
eventGroupListData === null || eventGroupListData === void 0 ? void 0 : eventGroupListData.forEach(function (eGroup) {
|
|
@@ -2,6 +2,7 @@ import { AttrConditionTypes, TargetConditionTypes } from '../../..';
|
|
|
2
2
|
import { EventGroup } from '../../../attributeSelector/types';
|
|
3
3
|
import { FormulaContainerTypes } from './types';
|
|
4
4
|
import { BizFormulaTargetTypes } from '../../types';
|
|
5
|
+
import { AppInfoProps } from '../../../context/index';
|
|
5
6
|
export declare const newItem: FormulaContainerTypes.FormulaItemValue;
|
|
6
7
|
export declare const newSymbol: FormulaContainerTypes.FormulaItemValue;
|
|
7
8
|
export declare const targetsFormat: (targetFormula?: string, targets?: TargetConditionTypes.Value[]) => FormulaContainerTypes.FormulaItemValue[];
|
|
@@ -16,7 +17,7 @@ export declare const validator: (type: string, condition?: TargetConditionTypes.
|
|
|
16
17
|
isOk: boolean;
|
|
17
18
|
msg: string;
|
|
18
19
|
};
|
|
19
|
-
export declare const getDimension: (data: TargetConditionTypes.DimensionValue, eId?: number, eventGroupList?: EventGroup[]) => string;
|
|
20
|
+
export declare const getDimension: (currentApp: AppInfoProps | undefined, data: TargetConditionTypes.DimensionValue, eId?: number, eventGroupList?: EventGroup[]) => string;
|
|
20
21
|
export declare const judgeHaveFilter: (filter?: AttrConditionTypes.GroupValue) => boolean;
|
|
21
22
|
export declare const getFilters: (filters?: AttrConditionTypes.GroupValue) => {
|
|
22
23
|
conditions: AttrConditionTypes.ItemValue[];
|
|
@@ -166,9 +166,9 @@ export var validator = function validator(type, condition) {
|
|
|
166
166
|
msg: msg
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
-
export var getDimension = function getDimension(data, eId, eventGroupList) {
|
|
169
|
+
export var getDimension = function getDimension(currentApp, data, eId, eventGroupList) {
|
|
170
170
|
var name = '';
|
|
171
|
-
normalOptions.concat(attrOptions).forEach(function (item) {
|
|
171
|
+
normalOptions(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type).concat(attrOptions).forEach(function (item) {
|
|
172
172
|
if (item.value === data.analysisIndex) {
|
|
173
173
|
name = item.label;
|
|
174
174
|
}
|
|
@@ -45,7 +45,8 @@ var FormulaItem = function FormulaItem(props) {
|
|
|
45
45
|
isValidate = _useState14[0],
|
|
46
46
|
setIsValidate = _useState14[1];
|
|
47
47
|
var _useContext = useContext(BizGlobalDataContext),
|
|
48
|
-
eventGroupList = _useContext.eventGroupList
|
|
48
|
+
eventGroupList = _useContext.eventGroupList,
|
|
49
|
+
currentApp = _useContext.currentApp;
|
|
49
50
|
var _useState15 = useState(false),
|
|
50
51
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
51
52
|
open = _useState16[0],
|
|
@@ -67,7 +68,7 @@ var FormulaItem = function FormulaItem(props) {
|
|
|
67
68
|
setLabel((condition === null || condition === void 0 ? void 0 : condition.eventName) || (formulaValue === null || formulaValue === void 0 ? void 0 : formulaValue.condition));
|
|
68
69
|
if (condition === null || condition === void 0 ? void 0 : condition.type) {
|
|
69
70
|
if ((condition === null || condition === void 0 ? void 0 : condition.type) === FormulaTypes.EVENT) {
|
|
70
|
-
setDimension(getDimension(condition.analysisDimension, condition.eventId, eventGroupList));
|
|
71
|
+
setDimension(getDimension(currentApp, condition.analysisDimension, condition.eventId, eventGroupList));
|
|
71
72
|
setHaveFilter(judgeHaveFilter(condition.filters));
|
|
72
73
|
} else {
|
|
73
74
|
setHaveFilter(judgeHaveFilter(condition.filters));
|
|
@@ -25,7 +25,8 @@ import _ from 'lodash';
|
|
|
25
25
|
export var classPrefix = 'formula-panel';
|
|
26
26
|
var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
27
27
|
var _useContext = useContext(BizGlobalDataContext),
|
|
28
|
-
eventGroupList = _useContext.eventGroupList
|
|
28
|
+
eventGroupList = _useContext.eventGroupList,
|
|
29
|
+
currentApp = _useContext.currentApp;
|
|
29
30
|
var _useState = useState(FormulaTypes.EVENT),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
32
|
type = _useState2[0],
|
|
@@ -66,7 +67,7 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
67
|
setEventList(events);
|
|
67
68
|
setAllList({
|
|
68
69
|
event: events,
|
|
69
|
-
whole: indicatorList
|
|
70
|
+
whole: indicatorList(currentApp)
|
|
70
71
|
});
|
|
71
72
|
setCurrentValue(props.value);
|
|
72
73
|
setType(props.value ? getParentType(props.value.type) : FormulaTypes.EVENT);
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { UserTagsSelectorTypes } from '../userTagsSelector/types';
|
|
3
2
|
import { UserGroupTypes } from '../userGroup/types';
|
|
4
3
|
import { AppInfoProps } from '../context';
|
|
5
4
|
declare function useBizStore({ currentApp }: {
|
|
6
5
|
currentApp: AppInfoProps;
|
|
7
|
-
authority: any;
|
|
8
6
|
}): {
|
|
7
|
+
eventGroupList?: import("../attributeSelector/types").EventGroup[] | undefined;
|
|
8
|
+
userPropList?: import("../attributeSelector/types").UserProp[] | undefined;
|
|
9
|
+
envPropList?: import("../attributeSelector/types").EnvProp[] | undefined;
|
|
10
|
+
eventNameMap?: Record<string, import("../attributeSelector/types").AnalysisEvent> | undefined;
|
|
11
|
+
eventIdMap?: Record<number, import("../attributeSelector/types").AnalysisEvent> | undefined;
|
|
12
|
+
useBizStoreLoading: boolean;
|
|
9
13
|
groupLoading: boolean;
|
|
10
14
|
userGroupList: UserGroupTypes.Group[];
|
|
11
15
|
tagList: UserTagsSelectorTypes.Tag[];
|
|
12
16
|
tagLoading: boolean;
|
|
13
|
-
setUserGroupList:
|
|
14
|
-
setTagList:
|
|
17
|
+
setUserGroupList: import("react").Dispatch<import("react").SetStateAction<UserGroupTypes.Group[]>>;
|
|
18
|
+
setTagList: import("react").Dispatch<import("react").SetStateAction<UserTagsSelectorTypes.Tag[]>>;
|
|
15
19
|
queryTags: () => void;
|
|
16
20
|
queryGroups: () => void;
|
|
17
21
|
};
|