@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.
Files changed (55) hide show
  1. package/es/AUMFormulaTarget/components/formula/util.d.ts +2 -1
  2. package/es/AUMFormulaTarget/components/formula/util.js +2 -2
  3. package/es/AUMFormulaTarget/components/formulaItem/index.js +3 -2
  4. package/es/AUMFormulaTarget/components/panel/cdpCshCondition.js +25 -32
  5. package/es/AUMFormulaTarget/components/panel/index.js +3 -2
  6. package/es/AUMFormulaTarget/components/panel/types.d.ts +1 -0
  7. package/es/attrConditions/components/operateList.js +19 -7
  8. package/es/attrConditions/utils/operates.d.ts +8 -0
  9. package/es/attrConditions/utils/operates.js +27 -7
  10. package/es/attributeSelector/listPanel.js +4 -3
  11. package/es/constants/apis.d.ts +3 -0
  12. package/es/constants/apis.js +4 -1
  13. package/es/constants/common.d.ts +2 -2
  14. package/es/constants/common.js +43 -39
  15. package/es/context/index.d.ts +19 -5
  16. package/es/dataSetGroup/index.js +8 -16
  17. package/es/dataSetGroup/overlay.js +8 -5
  18. package/es/dataSetGroup/types.d.ts +1 -0
  19. package/es/demoWrapper/content.d.ts +2 -0
  20. package/es/demoWrapper/content.js +28 -11
  21. package/es/demoWrapper/demo/index.js +15 -2
  22. package/es/demoWrapper/index.js +78 -14
  23. package/es/eventSelector/index.js +3 -2
  24. package/es/eventSelector/listPanel.js +5 -4
  25. package/es/formulaTarget/components/formula/util.d.ts +2 -1
  26. package/es/formulaTarget/components/formula/util.js +2 -2
  27. package/es/formulaTarget/components/formulaItem/index.js +3 -2
  28. package/es/formulaTarget/components/panel/index.js +3 -2
  29. package/es/hooks/useBizStore.d.ts +8 -4
  30. package/es/hooks/useBizStore.js +129 -45
  31. package/es/hooks/useSubject.js +17 -4
  32. package/es/productCondition/conditions/cdpCshCondition.js +27 -27
  33. package/es/productCondition/conditions/textDesc.js +0 -3
  34. package/es/productCondition/index.js +3 -5
  35. package/es/productCondition/orConditions.js +0 -1
  36. package/es/productCondition/types.d.ts +4 -0
  37. package/es/targetConditionGroup/components/targetDimension.js +7 -5
  38. package/es/targetConditionGroup/data/operates.d.ts +1 -13
  39. package/es/targetConditionGroup/data/operates.js +10 -37
  40. package/es/targetConditionGroup/index.js +3 -2
  41. package/es/userCondition/conditionTypeList.js +4 -4
  42. package/es/userCondition/conditions/cdpCondition.js +21 -22
  43. package/es/userCondition/conditions/cdpCshCondition.js +31 -29
  44. package/es/userCondition/conditions/tagsCondition.js +4 -1
  45. package/es/userCondition/demo/index.js +1 -1
  46. package/es/userCondition/index.js +42 -53
  47. package/es/userCondition/types.d.ts +5 -0
  48. package/es/userGroup/index.js +0 -1
  49. package/es/userGroup/overlay.js +1 -3
  50. package/es/userGroup/styles/index.less +0 -1
  51. package/es/utils/util.d.ts +1 -0
  52. package/es/utils/util.js +9 -0
  53. package/package.json +2 -2
  54. package/es/demoWrapper/head.d.ts +0 -9
  55. package/es/demoWrapper/head.js +0 -67
@@ -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);
@@ -17,24 +17,21 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  import React, { useContext, useEffect, useState } from 'react';
18
18
  import BizSelect from '../../../select';
19
19
  import { isArray } from 'lodash';
20
- import { numberOperate, numberTypeCsh } from '../../../attrConditions/utils/operates';
20
+ import { numberAUMOperate, numberTypeCsh } from '../../../attrConditions/utils/operates';
21
21
  import { Input } from 'antd';
22
22
  import request from '../../../utils/ajax';
23
23
  import Apis from '../../../constants/apis';
24
- import BizGlobalDataContext from '../../../context';
25
24
  import DataSetGroup from '../../../dataSetGroup';
26
25
  import IconFont from '../../../icon/iconFont';
27
26
  var classPrefix = 'AUM-formula-panel-dataSet-condition';
28
27
  import { BizValidatorContext } from '../../../context';
29
28
  var CdpConditionItem = function CdpConditionItem(props) {
30
- var _useContext = useContext(BizGlobalDataContext),
31
- currentApp = _useContext.currentApp;
32
29
  var _useState = useState(function () {
33
30
  if (props.value) {
34
- return {
31
+ return _objectSpread(_objectSpread({}, props.value), {}, {
35
32
  id: props.value.datasetId,
36
33
  tableName: props.value.datasetTable
37
- };
34
+ });
38
35
  }
39
36
  return;
40
37
  }),
@@ -61,8 +58,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
61
58
  _useState12 = _slicedToArray(_useState11, 2),
62
59
  isFirst = _useState12[0],
63
60
  setIsFirst = _useState12[1];
64
- var _useContext2 = useContext(BizValidatorContext),
65
- isValidate = _useContext2.isValidate;
61
+ var _useContext = useContext(BizValidatorContext),
62
+ isValidate = _useContext.isValidate;
66
63
  var _useState13 = useState(false),
67
64
  _useState14 = _slicedToArray(_useState13, 2),
68
65
  isDatasetError = _useState14[0],
@@ -89,9 +86,12 @@ var CdpConditionItem = function CdpConditionItem(props) {
89
86
  datasetName = _props$value.datasetName,
90
87
  datasetTable = _props$value.datasetTable,
91
88
  fieldName = _props$value.fieldName,
92
- filters = _props$value.filters;
89
+ filters = _props$value.filters,
90
+ metaDatasetId = _props$value.metaDatasetId;
93
91
  setDataset({
94
92
  id: datasetId,
93
+ metaDatasetId: metaDatasetId,
94
+ datasetId: datasetId,
95
95
  tableName: datasetTable,
96
96
  datasetName: datasetName
97
97
  });
@@ -103,7 +103,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
103
103
  key: Math.random()
104
104
  });
105
105
  }));
106
- onDatasetChange(datasetId);
106
+ onDatasetChange(datasetTable);
107
107
  setTimeout(function () {
108
108
  setIsFirst(false);
109
109
  }, 0);
@@ -112,7 +112,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
112
112
  if (isFirst) return;
113
113
  if (!dataset) return;
114
114
  var data = {
115
- datasetId: dataset.id,
115
+ metaDatasetId: dataset.metaDatasetId,
116
+ datasetId: dataset.datasetId,
116
117
  datasetTable: dataset.tableName,
117
118
  datasetName: dataset.datasetName,
118
119
  fieldName: field === null || field === void 0 ? void 0 : field.name,
@@ -120,18 +121,16 @@ var CdpConditionItem = function CdpConditionItem(props) {
120
121
  };
121
122
  props.onChange(data);
122
123
  }, [dataset, field, filters]);
123
- var onDatasetChange = function onDatasetChange(datasetId) {
124
- if (!datasetId) {
124
+ var onDatasetChange = function onDatasetChange(tableName) {
125
+ if (!tableName) {
125
126
  setFieldList([]);
126
127
  return;
127
128
  }
128
129
  setLoading(true);
129
- request(Apis.queryDatasetDetail, {
130
- method: 'post',
131
- data: {
132
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
133
- platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
134
- datasetId: datasetId
130
+ request(Apis.queryTableInfo, {
131
+ method: 'get',
132
+ params: {
133
+ tableName: tableName
135
134
  }
136
135
  }).then(function (result) {
137
136
  setLoading(false);
@@ -146,12 +145,12 @@ var CdpConditionItem = function CdpConditionItem(props) {
146
145
  });
147
146
  };
148
147
  var onTableChange = function onTableChange(data) {
149
- if (data && data.id !== (dataset === null || dataset === void 0 ? void 0 : dataset.id)) {
148
+ if (data && data.metaDatasetId !== (dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId)) {
150
149
  setDataset(data);
151
150
  setField({
152
151
  name: undefined
153
152
  });
154
- onDatasetChange(data.id);
153
+ onDatasetChange(data.tableName);
155
154
  setFilters([]);
156
155
  }
157
156
  };
@@ -166,12 +165,12 @@ var CdpConditionItem = function CdpConditionItem(props) {
166
165
  }, /*#__PURE__*/React.createElement("div", {
167
166
  className: "".concat(isDatasetError ? 'error' : '')
168
167
  }, /*#__PURE__*/React.createElement(DataSetGroup, {
169
- value: dataset === null || dataset === void 0 ? void 0 : dataset.id,
168
+ value: dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId,
170
169
  placeholder: "\u8BF7\u9009\u62E9\u660E\u7EC6\u8868",
171
170
  onChange: onTableChange
172
171
  }), isDatasetError ? /*#__PURE__*/React.createElement("div", {
173
172
  className: "".concat(classPrefix, "-error")
174
- }, "AUM\u6307\u6807\u4E0D\u53EF\u4E3A\u7A7A") : null), (dataset === null || dataset === void 0 ? void 0 : dataset.id) ? /*#__PURE__*/React.createElement("div", {
173
+ }, "AUM\u6307\u6807\u4E0D\u53EF\u4E3A\u7A7A") : null), (dataset === null || dataset === void 0 ? void 0 : dataset.metaDatasetId) ? /*#__PURE__*/React.createElement("div", {
175
174
  className: "".concat(classPrefix, "-item"),
176
175
  style: {
177
176
  flexDirection: 'column'
@@ -199,7 +198,6 @@ var CdpConditionItem = function CdpConditionItem(props) {
199
198
  options: fieldList,
200
199
  field: field,
201
200
  onDelete: function onDelete() {
202
- console.log('k', k);
203
201
  var a = filters;
204
202
  a.splice(k, 1);
205
203
  setFilters(_toConsumableArray(a));
@@ -221,8 +219,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
221
219
  }), /*#__PURE__*/React.createElement("span", null, "\u6DFB\u52A0\u5B57\u6BB5\u7B5B\u9009")) : null);
222
220
  };
223
221
  var RenderByType = function RenderByType(props) {
224
- var _useContext3 = useContext(BizValidatorContext),
225
- isValidate = _useContext3.isValidate;
222
+ var _useContext2 = useContext(BizValidatorContext),
223
+ isValidate = _useContext2.isValidate;
226
224
  var onChange = props.onChange,
227
225
  options = props.options,
228
226
  field = props.field;
@@ -266,7 +264,6 @@ var RenderByType = function RenderByType(props) {
266
264
  setFieldValue('');
267
265
  };
268
266
  useEffect(function () {
269
- console.log('value', props.value);
270
267
  if (props.value) {
271
268
  setCalculate({
272
269
  value: props.value.calculate || 'original'
@@ -305,7 +302,7 @@ var RenderByType = function RenderByType(props) {
305
302
  onChange: onCalculateChange
306
303
  }), /*#__PURE__*/React.createElement(BizSelect, {
307
304
  className: "".concat(classPrefix, "-select-condition"),
308
- options: numberOperate,
305
+ options: numberAUMOperate,
309
306
  labelField: "name",
310
307
  keyField: "value",
311
308
  overlayWidth: 96,
@@ -342,11 +339,7 @@ var RenderByType = function RenderByType(props) {
342
339
  var CdpCondition = function CdpCondition(props) {
343
340
  var value = props.value,
344
341
  onChange = props.onChange;
345
- useEffect(function () {
346
- console.log(value);
347
- }, []);
348
342
  var onChangeCondition = function onChangeCondition(condition) {
349
- console.log('onChangeCondition', condition);
350
343
  onChange && onChange(condition);
351
344
  };
352
345
  return /*#__PURE__*/React.createElement("div", {
@@ -28,7 +28,8 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
28
  var _useContext = useContext(BizGlobalDataContext),
29
29
  eventGroupList = _useContext.eventGroupList,
30
30
  _useContext$authority = _useContext.authority,
31
- authority = _useContext$authority === void 0 ? {} : _useContext$authority;
31
+ authority = _useContext$authority === void 0 ? {} : _useContext$authority,
32
+ currentApp = _useContext.currentApp;
32
33
  var _useState = useState(FormulaTypes.EVENT),
33
34
  _useState2 = _slicedToArray(_useState, 2),
34
35
  type = _useState2[0],
@@ -75,7 +76,7 @@ var FormulaPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
75
76
  setEventList(events);
76
77
  setAllList({
77
78
  event: events,
78
- whole: indicatorList
79
+ whole: indicatorList(currentApp)
79
80
  });
80
81
  setCurrentValue(props.value);
81
82
  setType(props.value ? getParentType(props.value.type) : FormulaTypes.EVENT);
@@ -20,6 +20,7 @@ export interface BusinessProps {
20
20
  datasetTable: string;
21
21
  datasetName: string;
22
22
  fieldName: string;
23
+ metaDatasetId?: number;
23
24
  filters: {
24
25
  calculate: string;
25
26
  operator: string;
@@ -1,3 +1,7 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
6
  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."); }
3
7
  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); }
@@ -9,10 +13,10 @@ import { InputNumber, Space, message } from 'antd';
9
13
  import { classPrefix } from '..';
10
14
  import { PropType } from '../../attributeSelector/types';
11
15
  import BizSelect from '../../select';
12
- import { dateOperate, numberOperate, stringOperate, specialOperate } from '../utils/operates';
16
+ import { dateOperate, numberOperate, stringOperate, specialOperate, stringBusinessOperate } from '../utils/operates';
13
17
  import { OperateTypes } from '../types';
14
18
  var BizOperateList = function BizOperateList(props) {
15
- var _props$attr3;
19
+ var _props$attr4;
16
20
  var _useState = useState({
17
21
  value: ''
18
22
  }),
@@ -56,13 +60,21 @@ var BizOperateList = function BizOperateList(props) {
56
60
  } else if (type === PropType.DATE) {
57
61
  optionData = dateOperate;
58
62
  } else {
59
- var _props$attr2;
60
- if (specialOperateHandle((_props$attr2 = props.attr) === null || _props$attr2 === void 0 ? void 0 : _props$attr2.label)) {
63
+ var _props$attr2, _props$attr3;
64
+ if (((_props$attr2 = props.attr) === null || _props$attr2 === void 0 ? void 0 : _props$attr2.id) == 31415926) {
65
+ optionData = stringBusinessOperate;
66
+ } else if (specialOperateHandle((_props$attr3 = props.attr) === null || _props$attr3 === void 0 ? void 0 : _props$attr3.label)) {
61
67
  optionData = specialOperate;
62
68
  } else {
63
69
  optionData = stringOperate;
64
- if (!props.supportNPlace) {
65
- optionData = optionData.slice(0, -2);
70
+ if (props === null || props === void 0 ? void 0 : props.supportNPlace) {
71
+ optionData = [].concat(_toConsumableArray(optionData), [{
72
+ name: '第N位是',
73
+ value: '{n}th place is'
74
+ }, {
75
+ name: '第N位不是',
76
+ value: '{n}th place not is'
77
+ }]);
66
78
  }
67
79
  }
68
80
  }
@@ -86,7 +98,7 @@ var BizOperateList = function BizOperateList(props) {
86
98
  if (!flag) return;
87
99
  setCurrent(optionData[0]);
88
100
  onChange(optionData[0]);
89
- }, [(_props$attr3 = props.attr) === null || _props$attr3 === void 0 ? void 0 : _props$attr3.key]);
101
+ }, [(_props$attr4 = props.attr) === null || _props$attr4 === void 0 ? void 0 : _props$attr4.key]);
90
102
  var onChange = function onChange(data) {
91
103
  setCurrent(data);
92
104
  if (!ready) return;
@@ -2,10 +2,18 @@ export declare const specialOperate: {
2
2
  name: string;
3
3
  value: string;
4
4
  }[];
5
+ export declare const stringBusinessOperate: {
6
+ name: string;
7
+ value: string;
8
+ }[];
5
9
  export declare const stringOperate: {
6
10
  name: string;
7
11
  value: string;
8
12
  }[];
13
+ export declare const numberAUMOperate: {
14
+ name: string;
15
+ value: string;
16
+ }[];
9
17
  export declare const numberOperate: {
10
18
  name: string;
11
19
  value: string;
@@ -6,6 +6,13 @@ export var specialOperate = [{
6
6
  name: '不是',
7
7
  value: 'not equal'
8
8
  }];
9
+ export var stringBusinessOperate = [{
10
+ name: '是',
11
+ value: 'equal'
12
+ }, {
13
+ name: '不是',
14
+ value: 'not equal'
15
+ }];
9
16
  export var stringOperate = [{
10
17
  name: '是',
11
18
  value: 'equal'
@@ -36,14 +43,8 @@ export var stringOperate = [{
36
43
  }, {
37
44
  name: '不是空值',
38
45
  value: 'is not null'
39
- }, {
40
- name: '第N位是',
41
- value: '{n}th place is'
42
- }, {
43
- name: '第N位不是',
44
- value: '{n}th place not is'
45
46
  }];
46
- export var numberOperate = [{
47
+ export var numberAUMOperate = [{
47
48
  name: '>',
48
49
  value: 'gt'
49
50
  }, {
@@ -65,6 +66,25 @@ export var numberOperate = [{
65
66
  name: '区间',
66
67
  value: 'between'
67
68
  }];
69
+ export var numberOperate = [{
70
+ name: '>',
71
+ value: 'gt'
72
+ }, {
73
+ name: '=',
74
+ value: 'equal'
75
+ }, {
76
+ name: '<',
77
+ value: 'lt'
78
+ }, {
79
+ name: '≥',
80
+ value: 'ge'
81
+ }, {
82
+ name: '≤',
83
+ value: 'le'
84
+ }, {
85
+ name: '≠',
86
+ value: 'not equal'
87
+ }];
68
88
  export var numberOperateCsh = [{
69
89
  name: '>',
70
90
  value: 'greater'
@@ -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
@@ -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;
@@ -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;
@@ -1,4 +1,4 @@
1
- export declare const BuiltinIndicators: {
1
+ export declare const BuiltinIndicators: (type: 'user' | 'custom' | 'product' | undefined) => {
2
2
  id: number;
3
3
  name: string;
4
4
  eventList: {
@@ -9,7 +9,7 @@ export declare const BuiltinIndicators: {
9
9
  attrList: never[];
10
10
  }[];
11
11
  };
12
- export declare const indicatorList: {
12
+ export declare const indicatorList: (currentApp: any) => {
13
13
  name: string;
14
14
  id: number;
15
15
  type: string;
@@ -1,14 +1,49 @@
1
- export var BuiltinIndicators = {
2
- id: -2,
3
- name: '整体',
4
- eventList: [{
5
- name: '新增用户',
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
+ };
37
+ };
38
+ export var indicatorList = function indicatorList(currentApp) {
39
+ return [{
40
+ name: "\u65B0\u589E".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) != 'user' ? '主体' : '用户'),
6
41
  id: -201,
7
42
  type: 'add',
8
43
  isBuiltIn: true,
9
44
  attrList: []
10
45
  }, {
11
- name: '活跃用户',
46
+ name: "\u6D3B\u8DC3".concat((currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) != 'user' ? '主体' : '用户'),
12
47
  id: -202,
13
48
  type: 'active',
14
49
  isBuiltIn: true,
@@ -19,36 +54,5 @@ export var BuiltinIndicators = {
19
54
  type: 'times',
20
55
  isBuiltIn: true,
21
56
  attrList: []
22
- }, {
23
- name: '平均使用时长',
24
- id: -204,
25
- type: 'duration_avg',
26
- isBuiltIn: true,
27
- attrList: []
28
- }, {
29
- name: '使用时长分布',
30
- id: -205,
31
- type: 'duration',
32
- isBuiltIn: true,
33
- attrList: []
34
- }]
35
- };
36
- export var indicatorList = [{
37
- name: '新增用户',
38
- id: -201,
39
- type: 'add',
40
- isBuiltIn: true,
41
- attrList: []
42
- }, {
43
- name: '活跃用户',
44
- id: -202,
45
- type: 'active',
46
- isBuiltIn: true,
47
- attrList: []
48
- }, {
49
- name: '访问次数',
50
- id: -203,
51
- type: 'times',
52
- isBuiltIn: true,
53
- attrList: []
54
- }];
57
+ }];
58
+ };
@@ -21,21 +21,30 @@ 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
  }
28
+ export interface AuthConfig {
29
+ dataAuth?: Array<any>;
30
+ groupIds?: number[];
31
+ defaultAuth: any;
32
+ }
26
33
  export interface UserInfo {
27
34
  id: number;
35
+ userId: number;
28
36
  companyBuyVersion: number;
29
37
  username: string;
30
38
  email: string;
31
39
  emailNote: string;
32
- telphone?: string;
33
- secret?: string;
40
+ telphone: string;
41
+ secret: string;
34
42
  companyId: number;
35
43
  serviceType: serviceTypeType;
36
44
  companyName: string;
37
- isAdmin?: boolean;
38
- cdpVersion?: cdpVersionType;
45
+ isAdmin: boolean;
46
+ cdpVersion: cdpVersionType;
47
+ authConfig: AuthConfig;
39
48
  }
40
49
  export interface Menu {
41
50
  helpUrl: string;
@@ -53,6 +62,7 @@ export interface GlobalContextProps {
53
62
  setUserGroupList?: React.Dispatch<React.SetStateAction<UserGroupTypes.Group[]>>;
54
63
  tagList?: UserTagsSelectorTypes.Tag[];
55
64
  tagLoading?: boolean;
65
+ useBizStoreLoading?: boolean;
56
66
  setTagList?: React.Dispatch<React.SetStateAction<UserTagsSelectorTypes.Tag[]>>;
57
67
  queryGroups?: () => void;
58
68
  queryTags?: () => void;
@@ -62,10 +72,14 @@ export interface GlobalContextProps {
62
72
  eventIdMap?: Record<number, AnalysisEvent>;
63
73
  userPropList?: UserProp[];
64
74
  eventEnvList?: EnvProp[];
65
- currentApp?: AppInfoProps;
66
75
  currentUser?: UserInfo;
76
+ currentApp?: AppInfoProps;
77
+ projectList?: any;
78
+ currentProject?: any;
67
79
  isDemo?: boolean;
68
80
  route?: any;
81
+ getNowRoute?: () => any;
82
+ updatedRoute?: Function;
69
83
  router?: any;
70
84
  routes?: any;
71
85
  envs?: Record<string, any>;
@@ -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.queryDatasetList, {
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.map(function (item) {
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.id === value;
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.cdp.dataset
82
+ name: routes.dataAccess.manage,
83
+ query: {
84
+ tab: 4
85
+ }
94
86
  });
95
87
  setOpen(false);
96
88
  }