@zgfe/business-lib 1.2.32 → 1.2.34-heyh.0
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/index.js +45 -4
- package/es/AUMFormulaTarget/components/formula/types.d.ts +2 -1
- 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 +12 -11
- package/es/AUMFormulaTarget/components/panel/types.d.ts +1 -0
- package/es/AUMFormulaTarget/index.js +6 -3
- package/es/AUMFormulaTarget/types.d.ts +1 -0
- package/es/attrConditions/utils/operates.js +3 -0
- 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 +1 -1
- package/es/constants/common.js +36 -34
- package/es/context/index.d.ts +5 -1
- package/es/dataSetGroup/index.js +8 -16
- package/es/dataSetGroup/overlay.js +5 -7
- package/es/dataSetGroup/types.d.ts +1 -0
- package/es/demoWrapper/content.d.ts +2 -0
- package/es/demoWrapper/content.js +5 -1
- 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/productCondition/conditions/cdpCshCondition.js +7 -5
- package/es/productCondition/conditions/textDesc.js +0 -3
- package/es/productCondition/index.js +2 -4
- package/es/productCondition/orConditions.js +0 -1
- package/es/productCondition/types.d.ts +3 -0
- package/es/select/handle.js +2 -2
- 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 +18 -20
- package/es/userCondition/conditions/cdpCshCondition.js +4 -1
- 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 +4 -0
- package/es/userGroup/overlay.js +1 -3
- package/es/userGroup/styles/index.less +0 -1
- package/package.json +2 -2
- package/es/demoWrapper/head.d.ts +0 -9
- package/es/demoWrapper/head.js +0 -67
|
@@ -28,13 +28,17 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
28
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29
29
|
fieldValue = _useState6[0],
|
|
30
30
|
setFieldValue = _useState6[1];
|
|
31
|
+
var _useState7 = useState(),
|
|
32
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
33
|
+
fieldMaxValue = _useState8[0],
|
|
34
|
+
setFieldMaxValue = _useState8[1];
|
|
31
35
|
useEffect(function () {
|
|
32
36
|
init();
|
|
33
37
|
}, []);
|
|
34
38
|
useEffect(function () {
|
|
35
39
|
var item = formatTarget(targetList, 1);
|
|
36
|
-
props.onChange && props.onChange(item.formulaList, item.formula, operator === null || operator === void 0 ? void 0 : operator.value, fieldValue);
|
|
37
|
-
}, [targetList, operator, fieldValue]);
|
|
40
|
+
props.onChange && props.onChange(item.formulaList, item.formula, operator === null || operator === void 0 ? void 0 : operator.value, fieldValue, fieldMaxValue);
|
|
41
|
+
}, [targetList, operator, fieldValue, fieldMaxValue]);
|
|
38
42
|
useImperativeHandle(ref, function () {
|
|
39
43
|
return {
|
|
40
44
|
reset: init
|
|
@@ -45,6 +49,7 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
49
|
value: props.operator
|
|
46
50
|
});
|
|
47
51
|
setFieldValue(props.fieldValue);
|
|
52
|
+
setFieldMaxValue(props.fieldMaxValue);
|
|
48
53
|
setTargetList(targetsFormat(props.formula, props.value, 1));
|
|
49
54
|
};
|
|
50
55
|
var _onChange = function onChange(index, data) {
|
|
@@ -138,14 +143,18 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
143
|
overlayWidth: 96,
|
|
139
144
|
value: operator,
|
|
140
145
|
onChange: onOperateChange
|
|
141
|
-
}), /*#__PURE__*/React.createElement(
|
|
146
|
+
}), operator && operator.value === 'between' ? /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
style: {
|
|
148
|
+
display: 'flex'
|
|
149
|
+
}
|
|
150
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
142
151
|
style: {
|
|
143
152
|
marginLeft: 16,
|
|
144
153
|
borderWidth: 0
|
|
145
154
|
},
|
|
146
155
|
type: "number",
|
|
147
156
|
value: fieldValue,
|
|
148
|
-
placeholder: "\u8BF7\u8F93\u5165",
|
|
157
|
+
placeholder: "\u8BF7\u8F93\u5165\u6700\u5C0F\u503C",
|
|
149
158
|
onChange: function onChange(e) {
|
|
150
159
|
var _e$target$value;
|
|
151
160
|
e.persist();
|
|
@@ -154,6 +163,38 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
154
163
|
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
155
164
|
setFieldValue(dealStr);
|
|
156
165
|
}
|
|
166
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
167
|
+
style: {
|
|
168
|
+
marginLeft: 16,
|
|
169
|
+
borderWidth: 0
|
|
170
|
+
},
|
|
171
|
+
type: "number",
|
|
172
|
+
value: fieldMaxValue,
|
|
173
|
+
placeholder: "\u8BF7\u8F93\u5165\u6700\u5927\u503C",
|
|
174
|
+
onChange: function onChange(e) {
|
|
175
|
+
var _e$target$value2;
|
|
176
|
+
e.persist();
|
|
177
|
+
var str = (_e$target$value2 = e.target.value) === null || _e$target$value2 === void 0 ? void 0 : _e$target$value2.slice(0, 20);
|
|
178
|
+
var xsStr = str.split('.')[1] ? str.split('.')[1].slice(0, 2) : '';
|
|
179
|
+
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
180
|
+
setFieldMaxValue(dealStr);
|
|
181
|
+
}
|
|
182
|
+
})) : /*#__PURE__*/React.createElement(Input, {
|
|
183
|
+
style: {
|
|
184
|
+
marginLeft: 16,
|
|
185
|
+
borderWidth: 0
|
|
186
|
+
},
|
|
187
|
+
type: "number",
|
|
188
|
+
value: fieldValue,
|
|
189
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
190
|
+
onChange: function onChange(e) {
|
|
191
|
+
var _e$target$value3;
|
|
192
|
+
e.persist();
|
|
193
|
+
var str = (_e$target$value3 = e.target.value) === null || _e$target$value3 === void 0 ? void 0 : _e$target$value3.slice(0, 20);
|
|
194
|
+
var xsStr = str.split('.')[1] ? str.split('.')[1].slice(0, 2) : '';
|
|
195
|
+
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
196
|
+
setFieldValue(dealStr);
|
|
197
|
+
}
|
|
157
198
|
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
158
199
|
style: {
|
|
159
200
|
marginLeft: 16
|
|
@@ -6,7 +6,8 @@ export declare namespace FormulaContainerTypes {
|
|
|
6
6
|
resultFormat?: string;
|
|
7
7
|
operator?: string;
|
|
8
8
|
fieldValue?: string;
|
|
9
|
-
|
|
9
|
+
fieldMaxValue?: string;
|
|
10
|
+
onChange?: (formulaList: TargetConditionTypes.Value[], formula: string, operator?: string, fieldValue?: string, fieldMaxValue?: string) => void;
|
|
10
11
|
}
|
|
11
12
|
type Value = null | string | TargetConditionTypes.Value;
|
|
12
13
|
interface FormulaItemValue {
|
|
@@ -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[], initNum?: number) => 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[];
|
|
@@ -170,9 +170,9 @@ export var validator = function validator(type, condition) {
|
|
|
170
170
|
msg: msg
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
|
-
export var getDimension = function getDimension(data, eId, eventGroupList) {
|
|
173
|
+
export var getDimension = function getDimension(currentApp, data, eId, eventGroupList) {
|
|
174
174
|
var name = '';
|
|
175
|
-
normalOptions.concat(attrOptions).forEach(function (item) {
|
|
175
|
+
normalOptions(currentApp === null || currentApp === void 0 ? void 0 : currentApp.type).concat(attrOptions).forEach(function (item) {
|
|
176
176
|
if (item.value === data.analysisIndex) {
|
|
177
177
|
name = item.label;
|
|
178
178
|
}
|
|
@@ -40,7 +40,8 @@ var FormulaItem = function FormulaItem(props) {
|
|
|
40
40
|
isValidate = _useState10[0],
|
|
41
41
|
setIsValidate = _useState10[1];
|
|
42
42
|
var _useContext = useContext(BizGlobalDataContext),
|
|
43
|
-
eventGroupList = _useContext.eventGroupList
|
|
43
|
+
eventGroupList = _useContext.eventGroupList,
|
|
44
|
+
currentApp = _useContext.currentApp;
|
|
44
45
|
var _useState11 = useState(false),
|
|
45
46
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
46
47
|
open = _useState12[0],
|
|
@@ -58,7 +59,7 @@ var FormulaItem = function FormulaItem(props) {
|
|
|
58
59
|
setLabel((condition === null || condition === void 0 ? void 0 : condition.eventName) || (condition === null || condition === void 0 ? void 0 : condition.datasetName) || '');
|
|
59
60
|
if (condition) {
|
|
60
61
|
if ((condition === null || condition === void 0 ? void 0 : condition.type) === FormulaTypes.EVENT) {
|
|
61
|
-
setDimension(getDimension(condition.analysisDimension, condition.eventId, eventGroupList));
|
|
62
|
+
setDimension(getDimension(currentApp, condition.analysisDimension, condition.eventId, eventGroupList));
|
|
62
63
|
setHaveFilter(judgeHaveFilter(condition.filters));
|
|
63
64
|
} else {
|
|
64
65
|
setHaveFilter(!!(condition.filters || []).length);
|
|
@@ -32,7 +32,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
32
32
|
var _useState = useState(function () {
|
|
33
33
|
if (props.value) {
|
|
34
34
|
return {
|
|
35
|
-
|
|
35
|
+
metaDatasetId: props.value.metaDatasetId,
|
|
36
|
+
datasetId: props.value.datasetId,
|
|
36
37
|
tableName: props.value.datasetTable
|
|
37
38
|
};
|
|
38
39
|
}
|
|
@@ -89,9 +90,11 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
89
90
|
datasetName = _props$value.datasetName,
|
|
90
91
|
datasetTable = _props$value.datasetTable,
|
|
91
92
|
fieldName = _props$value.fieldName,
|
|
92
|
-
filters = _props$value.filters
|
|
93
|
+
filters = _props$value.filters,
|
|
94
|
+
metaDatasetId = _props$value.metaDatasetId;
|
|
93
95
|
setDataset({
|
|
94
|
-
|
|
96
|
+
metaDatasetId: metaDatasetId,
|
|
97
|
+
datasetId: datasetId,
|
|
95
98
|
tableName: datasetTable,
|
|
96
99
|
datasetName: datasetName
|
|
97
100
|
});
|
|
@@ -112,7 +115,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
112
115
|
if (isFirst) return;
|
|
113
116
|
if (!dataset) return;
|
|
114
117
|
var data = {
|
|
115
|
-
|
|
118
|
+
metaDatasetId: dataset.metaDatasetId,
|
|
119
|
+
datasetId: dataset.datasetId,
|
|
116
120
|
datasetTable: dataset.tableName,
|
|
117
121
|
datasetName: dataset.datasetName,
|
|
118
122
|
fieldName: field === null || field === void 0 ? void 0 : field.name,
|
|
@@ -146,12 +150,12 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
146
150
|
});
|
|
147
151
|
};
|
|
148
152
|
var onTableChange = function onTableChange(data) {
|
|
149
|
-
if (data && data.
|
|
153
|
+
if (data && data.metaDatasetId !== (dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId)) {
|
|
150
154
|
setDataset(data);
|
|
151
155
|
setField({
|
|
152
156
|
name: undefined
|
|
153
157
|
});
|
|
154
|
-
onDatasetChange(data.
|
|
158
|
+
onDatasetChange(data.datasetId);
|
|
155
159
|
setFilters([]);
|
|
156
160
|
}
|
|
157
161
|
};
|
|
@@ -166,12 +170,12 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
166
170
|
}, /*#__PURE__*/React.createElement("div", {
|
|
167
171
|
className: "".concat(isDatasetError ? 'error' : '')
|
|
168
172
|
}, /*#__PURE__*/React.createElement(DataSetGroup, {
|
|
169
|
-
value: dataset === null || dataset === void 0 ? void 0 : dataset.
|
|
173
|
+
value: dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId,
|
|
170
174
|
placeholder: "\u8BF7\u9009\u62E9\u660E\u7EC6\u8868",
|
|
171
175
|
onChange: onTableChange
|
|
172
176
|
}), isDatasetError ? /*#__PURE__*/React.createElement("div", {
|
|
173
177
|
className: "".concat(classPrefix, "-error")
|
|
174
|
-
}, "AUM\u6307\u6807\u4E0D\u53EF\u4E3A\u7A7A") : null), (dataset === null || dataset === void 0 ? void 0 : dataset.
|
|
178
|
+
}, "AUM\u6307\u6807\u4E0D\u53EF\u4E3A\u7A7A") : null), (dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId) ? /*#__PURE__*/React.createElement("div", {
|
|
175
179
|
className: "".concat(classPrefix, "-item"),
|
|
176
180
|
style: {
|
|
177
181
|
flexDirection: 'column'
|
|
@@ -342,9 +346,6 @@ var RenderByType = function RenderByType(props) {
|
|
|
342
346
|
var CdpCondition = function CdpCondition(props) {
|
|
343
347
|
var value = props.value,
|
|
344
348
|
onChange = props.onChange;
|
|
345
|
-
useEffect(function () {
|
|
346
|
-
console.log(value);
|
|
347
|
-
}, []);
|
|
348
349
|
var onChangeCondition = function onChangeCondition(condition) {
|
|
349
350
|
console.log('onChangeCondition', condition);
|
|
350
351
|
onChange && onChange(condition);
|
|
@@ -19,21 +19,23 @@ var BizFormulaTarget = function BizFormulaTarget(props) {
|
|
|
19
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
20
|
condition = _useState2[0],
|
|
21
21
|
setCondition = _useState2[1];
|
|
22
|
-
var onChange = function onChange(customCondition, formula, operator, fieldValue) {
|
|
22
|
+
var onChange = function onChange(customCondition, formula, operator, fieldValue, fieldMaxValue) {
|
|
23
23
|
setCondition(function (value) {
|
|
24
24
|
props.onChange && props.onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
25
25
|
alias: (value || {}).eventName,
|
|
26
26
|
customCondition: customCondition,
|
|
27
27
|
formula: formula,
|
|
28
28
|
operator: operator,
|
|
29
|
-
fieldValue: fieldValue
|
|
29
|
+
fieldValue: fieldValue,
|
|
30
|
+
fieldMaxValue: fieldMaxValue
|
|
30
31
|
}));
|
|
31
32
|
return _objectSpread(_objectSpread({}, value), {}, {
|
|
32
33
|
alias: (value || {}).eventName,
|
|
33
34
|
customCondition: customCondition,
|
|
34
35
|
formula: formula,
|
|
35
36
|
operator: operator,
|
|
36
|
-
fieldValue: fieldValue
|
|
37
|
+
fieldValue: fieldValue,
|
|
38
|
+
fieldMaxValue: fieldMaxValue
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
};
|
|
@@ -44,6 +46,7 @@ var BizFormulaTarget = function BizFormulaTarget(props) {
|
|
|
44
46
|
formula: (condition || {}).formula,
|
|
45
47
|
operator: (condition || {}).operator,
|
|
46
48
|
fieldValue: (condition || {}).fieldValue,
|
|
49
|
+
fieldMaxValue: (condition || {}).fieldMaxValue,
|
|
47
50
|
onChange: onChange
|
|
48
51
|
}));
|
|
49
52
|
};
|
|
@@ -33,7 +33,8 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
33
33
|
var _useContext = useContext(BizGlobalDataContext),
|
|
34
34
|
eventGroupList = _useContext.eventGroupList,
|
|
35
35
|
userPropList = _useContext.userPropList,
|
|
36
|
-
eventEnvList = _useContext.eventEnvList
|
|
36
|
+
eventEnvList = _useContext.eventEnvList,
|
|
37
|
+
currentApp = _useContext.currentApp;
|
|
37
38
|
var _useState3 = useState([]),
|
|
38
39
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
40
|
optionList = _useState4[0],
|
|
@@ -100,7 +101,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
100
101
|
if (enableUserProp) {
|
|
101
102
|
list.push({
|
|
102
103
|
id: data.user,
|
|
103
|
-
name: '
|
|
104
|
+
name: "".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u5C5E\u6027")
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
if (enableEnvProp) {
|
|
@@ -187,7 +188,7 @@ var AttrListPanel = function AttrListPanel(props) {
|
|
|
187
188
|
if (enableUserProp) {
|
|
188
189
|
list.push({
|
|
189
190
|
isEvent: false,
|
|
190
|
-
groupName: '
|
|
191
|
+
groupName: "".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u5C5E\u6027"),
|
|
191
192
|
key: 'userProps',
|
|
192
193
|
anchor: anchor.user,
|
|
193
194
|
children: userPropList
|
package/es/constants/apis.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const Apis: {
|
|
|
10
10
|
queryDatasetList: string;
|
|
11
11
|
queryProduct: string;
|
|
12
12
|
queryDatasetDetail: string;
|
|
13
|
+
queryTableInfo: string;
|
|
13
14
|
getSocketToken: string;
|
|
14
15
|
bizDataTypeList: string;
|
|
15
16
|
orderAttributeMaster: string;
|
|
@@ -23,5 +24,7 @@ declare const Apis: {
|
|
|
23
24
|
queryAllTags: string;
|
|
24
25
|
querySubjectList: string;
|
|
25
26
|
queryPanels: string;
|
|
27
|
+
queryMetaDatasetList: string;
|
|
28
|
+
queryDatasetTableNames: string;
|
|
26
29
|
};
|
|
27
30
|
export default Apis;
|
package/es/constants/apis.js
CHANGED
|
@@ -10,6 +10,7 @@ var Apis = {
|
|
|
10
10
|
queryDatasetList: '/zg/web/cdp/inner/dataset/list',
|
|
11
11
|
queryProduct: '/zg/web/v2/productTag/queryProduct/',
|
|
12
12
|
queryDatasetDetail: '/zg/web/cdp/inner/dataset/detail',
|
|
13
|
+
queryTableInfo: '/zg/web/cdp/visual/flow/node/tableInfo',
|
|
13
14
|
getSocketToken: '/zg/web/v2/tracking/view/websocket/token',
|
|
14
15
|
bizDataTypeList: '/cep-console/api/v1/bizdata/type/list',
|
|
15
16
|
orderAttributeMaster: '/cep-console/api/v1/cdp/orderAttribute/master',
|
|
@@ -22,6 +23,8 @@ var Apis = {
|
|
|
22
23
|
queryUserGroup: '/zg/web/v2/userGroup/getAll',
|
|
23
24
|
queryAllTags: '/zg/web/v2/v4/userGroup/label/list',
|
|
24
25
|
querySubjectList: '/zg/web/v2/analysisSubject/queryAllSubject',
|
|
25
|
-
queryPanels: '/zg/web/v2/apppanel/panels'
|
|
26
|
+
queryPanels: '/zg/web/v2/apppanel/panels',
|
|
27
|
+
queryMetaDatasetList: '/zg/web/v2/meta/dataset/list',
|
|
28
|
+
queryDatasetTableNames: '/zg/web/cdp/dataset/manager/datasetList'
|
|
26
29
|
};
|
|
27
30
|
export default Apis;
|
package/es/constants/common.d.ts
CHANGED
package/es/constants/common.js
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
export var BuiltinIndicators = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
export var BuiltinIndicators = function BuiltinIndicators(type) {
|
|
2
|
+
return {
|
|
3
|
+
id: -2,
|
|
4
|
+
name: '整体',
|
|
5
|
+
eventList: [{
|
|
6
|
+
name: "".concat(type === 'user' ? '新增用户' : '新增主体'),
|
|
7
|
+
id: -201,
|
|
8
|
+
type: 'add',
|
|
9
|
+
isBuiltIn: true,
|
|
10
|
+
attrList: []
|
|
11
|
+
}, {
|
|
12
|
+
name: "".concat(type === 'user' ? '活跃用户' : '活跃主体'),
|
|
13
|
+
id: -202,
|
|
14
|
+
type: 'active',
|
|
15
|
+
isBuiltIn: true,
|
|
16
|
+
attrList: []
|
|
17
|
+
}, {
|
|
18
|
+
name: '访问次数',
|
|
19
|
+
id: -203,
|
|
20
|
+
type: 'times',
|
|
21
|
+
isBuiltIn: true,
|
|
22
|
+
attrList: []
|
|
23
|
+
}, {
|
|
24
|
+
name: '平均使用时长',
|
|
25
|
+
id: -204,
|
|
26
|
+
type: 'duration_avg',
|
|
27
|
+
isBuiltIn: true,
|
|
28
|
+
attrList: []
|
|
29
|
+
}, {
|
|
30
|
+
name: '使用时长分布',
|
|
31
|
+
id: -205,
|
|
32
|
+
type: 'duration',
|
|
33
|
+
isBuiltIn: true,
|
|
34
|
+
attrList: []
|
|
35
|
+
}]
|
|
36
|
+
};
|
|
35
37
|
};
|
|
36
38
|
export var indicatorList = [{
|
|
37
39
|
name: '新增用户',
|
package/es/context/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface AppInfoProps {
|
|
|
21
21
|
appId?: string | number;
|
|
22
22
|
platform?: string | number;
|
|
23
23
|
appVersion?: appVersionType;
|
|
24
|
+
type?: 'user' | 'custom' | 'product';
|
|
25
|
+
unit?: string;
|
|
24
26
|
[prop: string]: any;
|
|
25
27
|
}
|
|
26
28
|
export interface UserInfo {
|
|
@@ -62,8 +64,10 @@ export interface GlobalContextProps {
|
|
|
62
64
|
eventIdMap?: Record<number, AnalysisEvent>;
|
|
63
65
|
userPropList?: UserProp[];
|
|
64
66
|
eventEnvList?: EnvProp[];
|
|
65
|
-
currentApp?: AppInfoProps;
|
|
66
67
|
currentUser?: UserInfo;
|
|
68
|
+
currentApp?: AppInfoProps;
|
|
69
|
+
projectList?: any;
|
|
70
|
+
currentProject?: any;
|
|
67
71
|
isDemo?: boolean;
|
|
68
72
|
route?: any;
|
|
69
73
|
router?: any;
|
package/es/dataSetGroup/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
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; }
|
|
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
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
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."); }
|
|
9
3
|
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); }
|
|
@@ -46,22 +40,17 @@ var DataSetGroup = function DataSetGroup(_ref) {
|
|
|
46
40
|
getDatasetList();
|
|
47
41
|
}, []);
|
|
48
42
|
function getDatasetList() {
|
|
49
|
-
request(Apis.
|
|
43
|
+
request(Apis.queryMetaDatasetList, {
|
|
50
44
|
method: 'post',
|
|
51
45
|
data: {
|
|
52
|
-
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
53
|
-
platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform
|
|
46
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
54
47
|
}
|
|
55
48
|
}).then(function (result) {
|
|
56
|
-
var dealData = result.data
|
|
57
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
58
|
-
name: item.datasetName
|
|
59
|
-
});
|
|
60
|
-
}) || [];
|
|
49
|
+
var dealData = result.data;
|
|
61
50
|
setDataset(dealData);
|
|
62
51
|
if (value) {
|
|
63
52
|
var userGroup = dealData === null || dealData === void 0 ? void 0 : dealData.find(function (item) {
|
|
64
|
-
return item.
|
|
53
|
+
return item.metaDatasetId === value;
|
|
65
54
|
});
|
|
66
55
|
if (userGroup) {
|
|
67
56
|
setChosen(userGroup);
|
|
@@ -90,7 +79,10 @@ var DataSetGroup = function DataSetGroup(_ref) {
|
|
|
90
79
|
dataset: dataset,
|
|
91
80
|
onClickCreate: function onClickCreate() {
|
|
92
81
|
router && router.push({
|
|
93
|
-
name: routes.
|
|
82
|
+
name: routes.dataAccess.manage,
|
|
83
|
+
query: {
|
|
84
|
+
tab: 4
|
|
85
|
+
}
|
|
94
86
|
});
|
|
95
87
|
setOpen(false);
|
|
96
88
|
}
|
|
@@ -17,8 +17,8 @@ var GroupItem = function GroupItem(_ref) {
|
|
|
17
17
|
onClose = _ref.onClose,
|
|
18
18
|
setCurrentGroup = _ref.setCurrentGroup;
|
|
19
19
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "".concat(classPrefix, "-item ").concat((currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.
|
|
21
|
-
key: item.
|
|
20
|
+
className: "".concat(classPrefix, "-item ").concat((currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.metaDatasetId) === item.metaDatasetId ? 'active' : ''),
|
|
21
|
+
key: item.metaDatasetId,
|
|
22
22
|
onClick: function onClick() {
|
|
23
23
|
setCurrentGroup(item);
|
|
24
24
|
if (onClose) onClose();
|
|
@@ -82,9 +82,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
82
82
|
onClick: onClickAdd
|
|
83
83
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
84
|
type: "zengjia"
|
|
85
|
-
}), "\u5FEB\u901F\u521B\u5EFA\u660E\u7EC6\u8868")), /*#__PURE__*/React.createElement(
|
|
86
|
-
className: "".concat(classPrefix, "-divider")
|
|
87
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6240\u6709\u7528\u6237")), showList.length > 10 ? /*#__PURE__*/React.createElement(List, {
|
|
85
|
+
}), "\u5FEB\u901F\u521B\u5EFA\u660E\u7EC6\u8868")), showList.length > 10 ? /*#__PURE__*/React.createElement(List, {
|
|
88
86
|
data: showList || [],
|
|
89
87
|
itemHeight: 32,
|
|
90
88
|
itemKey: "id",
|
|
@@ -92,7 +90,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
92
90
|
className: "".concat(classPrefix, "-list")
|
|
93
91
|
}, function (item) {
|
|
94
92
|
return /*#__PURE__*/React.createElement(GroupItem, {
|
|
95
|
-
key: item.
|
|
93
|
+
key: item.metaDatasetId,
|
|
96
94
|
item: item,
|
|
97
95
|
currentGroup: currentGroup,
|
|
98
96
|
setCurrentGroup: setCurrentGroup,
|
|
@@ -102,7 +100,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
102
100
|
className: "".concat(classPrefix, "-list")
|
|
103
101
|
}, showList === null || showList === void 0 ? void 0 : showList.map(function (item) {
|
|
104
102
|
return /*#__PURE__*/React.createElement(GroupItem, {
|
|
105
|
-
key: item.
|
|
103
|
+
key: item.metaDatasetId,
|
|
106
104
|
item: item,
|
|
107
105
|
currentGroup: currentGroup,
|
|
108
106
|
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([]),
|
|
@@ -159,7 +161,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
159
161
|
}
|
|
160
162
|
useEffect(function () {
|
|
161
163
|
loadAuthorityList();
|
|
162
|
-
}, []);
|
|
164
|
+
}, [currentApp]);
|
|
163
165
|
function loadBasicConfigLoad() {
|
|
164
166
|
setLoadUsers(true);
|
|
165
167
|
ajax('/zg/web/v2/system/config', {
|
|
@@ -219,6 +221,8 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
219
221
|
currentApp: _objectSpread(_objectSpread({}, currentApp), {}, {
|
|
220
222
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id
|
|
221
223
|
}),
|
|
224
|
+
currentProject: currentProject,
|
|
225
|
+
projectList: projectList,
|
|
222
226
|
eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
|
|
223
227
|
userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
|
|
224
228
|
eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
|
|
@@ -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, {
|