@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
|
@@ -61,12 +61,12 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
61
61
|
}
|
|
62
62
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
63
63
|
key: "prop"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\
|
|
64
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u5C5E\u6027\u6EE1\u8DB3"))) : null, openTagCondition && authority[10038] ? /*#__PURE__*/React.createElement("li", {
|
|
65
65
|
className: "condition-type",
|
|
66
66
|
onClick: function onClick() {
|
|
67
67
|
return onAdd('tag');
|
|
68
68
|
}
|
|
69
|
-
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户' : '主体', "\u6807\u7B7E"))) : null, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appVersion) === 2 ? /*#__PURE__*/React.createElement("li", {
|
|
70
70
|
className: "condition-type",
|
|
71
71
|
onClick: function onClick() {
|
|
72
72
|
return onAdd('cdp_csh');
|
|
@@ -84,7 +84,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
84
84
|
title: cdpTip
|
|
85
85
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
86
86
|
type: "tishiicon"
|
|
87
|
-
})) : null)) : null, openBusinessDataCondition || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
|
|
87
|
+
})) : null)) : null, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' && (openBusinessDataCondition || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2) ? /*#__PURE__*/React.createElement("li", {
|
|
88
88
|
className: "condition-type",
|
|
89
89
|
key: "business",
|
|
90
90
|
onClick: function onClick() {
|
|
@@ -92,7 +92,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
|
|
|
92
92
|
}
|
|
93
93
|
}, /*#__PURE__*/React.createElement(Space, {
|
|
94
94
|
key: "business"
|
|
95
|
-
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))) : null, openOrderDataCondition || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2 ? /*#__PURE__*/React.createElement("li", {
|
|
95
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u4E1A\u52A1\u6570\u636E"))) : null, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' && (openOrderDataCondition || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 0 || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType) === 2) ? /*#__PURE__*/React.createElement("li", {
|
|
96
96
|
className: "condition-type",
|
|
97
97
|
key: "order",
|
|
98
98
|
onClick: function onClick() {
|
|
@@ -21,20 +21,17 @@ import moment from 'moment';
|
|
|
21
21
|
import { BizUserConditionContext } from '..';
|
|
22
22
|
import request from '../../utils/ajax';
|
|
23
23
|
import Apis from '../../constants/apis';
|
|
24
|
-
import BizGlobalDataContext from '../../context';
|
|
25
24
|
var classPrefix = 'biz-user-condition-cdp';
|
|
26
25
|
var CdpConditionItem = function CdpConditionItem(props) {
|
|
27
|
-
var _useContext = useContext(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_useContext2$datasetL = _useContext2.datasetList,
|
|
31
|
-
datasetList = _useContext2$datasetL === void 0 ? [] : _useContext2$datasetL;
|
|
26
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
27
|
+
_useContext$datasetLi = _useContext.datasetList,
|
|
28
|
+
datasetList = _useContext$datasetLi === void 0 ? [] : _useContext$datasetLi;
|
|
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
|
}),
|
|
@@ -74,6 +71,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
74
71
|
datasetId = _props$value.datasetId,
|
|
75
72
|
datasetTable = _props$value.datasetTable,
|
|
76
73
|
datasetName = _props$value.datasetName,
|
|
74
|
+
metaDatasetId = _props$value.metaDatasetId,
|
|
77
75
|
fieldName = _props$value.fieldName,
|
|
78
76
|
fieldType = _props$value.fieldType,
|
|
79
77
|
webType = _props$value.webType,
|
|
@@ -82,7 +80,9 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
82
80
|
setDataset({
|
|
83
81
|
id: datasetId,
|
|
84
82
|
tableName: datasetTable,
|
|
85
|
-
|
|
83
|
+
datasetId: datasetId,
|
|
84
|
+
datasetName: datasetName,
|
|
85
|
+
metaDatasetId: metaDatasetId
|
|
86
86
|
});
|
|
87
87
|
setField({
|
|
88
88
|
name: fieldName,
|
|
@@ -95,7 +95,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
95
95
|
if (params) {
|
|
96
96
|
setFieldValue(params);
|
|
97
97
|
}
|
|
98
|
-
onDatasetChange(
|
|
98
|
+
onDatasetChange(datasetTable);
|
|
99
99
|
setTimeout(function () {
|
|
100
100
|
setIsFirst(false);
|
|
101
101
|
}, 0);
|
|
@@ -104,7 +104,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
104
104
|
if (isFirst) return;
|
|
105
105
|
if (!dataset) return;
|
|
106
106
|
props.onChange({
|
|
107
|
-
|
|
107
|
+
metaDatasetId: dataset.metaDatasetId,
|
|
108
|
+
datasetId: dataset.datasetId,
|
|
108
109
|
datasetTable: dataset.tableName,
|
|
109
110
|
datasetName: dataset.datasetName,
|
|
110
111
|
fieldName: field === null || field === void 0 ? void 0 : field.name,
|
|
@@ -131,18 +132,16 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
131
132
|
return PropType.DATE;
|
|
132
133
|
}
|
|
133
134
|
};
|
|
134
|
-
var onDatasetChange = function onDatasetChange(
|
|
135
|
-
if (!
|
|
135
|
+
var onDatasetChange = function onDatasetChange(tableName) {
|
|
136
|
+
if (!tableName) {
|
|
136
137
|
setFieldList([]);
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
140
|
setLoading(true);
|
|
140
|
-
request(Apis.
|
|
141
|
-
method: '
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
|
|
145
|
-
datasetId: datasetId
|
|
141
|
+
request(Apis.queryTableInfo, {
|
|
142
|
+
method: 'get',
|
|
143
|
+
params: {
|
|
144
|
+
tableName: tableName
|
|
146
145
|
}
|
|
147
146
|
}).then(function (result) {
|
|
148
147
|
setLoading(false);
|
|
@@ -160,7 +159,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
160
159
|
});
|
|
161
160
|
setOperator(undefined);
|
|
162
161
|
setFieldValue([]);
|
|
163
|
-
onDatasetChange(data.
|
|
162
|
+
onDatasetChange(data.tableName);
|
|
164
163
|
};
|
|
165
164
|
var onFieldChange = function onFieldChange(data) {
|
|
166
165
|
setField(data);
|
|
@@ -260,8 +259,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
260
259
|
className: "".concat(classPrefix, "-select-dataset"),
|
|
261
260
|
options: datasetList,
|
|
262
261
|
placeholder: "\u9009\u62E9\u660E\u7EC6\u8868",
|
|
263
|
-
labelField: "
|
|
264
|
-
keyField: "
|
|
262
|
+
labelField: "name",
|
|
263
|
+
keyField: "metaDatasetId",
|
|
265
264
|
value: dataset,
|
|
266
265
|
onChange: onTableChange
|
|
267
266
|
}), dataset ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -21,20 +21,17 @@ import moment from 'moment';
|
|
|
21
21
|
import { BizUserConditionContext } from '..';
|
|
22
22
|
import request from '../../utils/ajax';
|
|
23
23
|
import Apis from '../../constants/apis';
|
|
24
|
-
import BizGlobalDataContext from '../../context';
|
|
25
24
|
var classPrefix = 'biz-user-condition-cdp-csh';
|
|
26
25
|
var CdpConditionItem = function CdpConditionItem(props) {
|
|
27
|
-
var _useContext = useContext(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_useContext2$datasetL = _useContext2.datasetList,
|
|
31
|
-
datasetList = _useContext2$datasetL === void 0 ? [] : _useContext2$datasetL;
|
|
26
|
+
var _useContext = useContext(BizUserConditionContext),
|
|
27
|
+
_useContext$datasetLi = _useContext.datasetList,
|
|
28
|
+
datasetList = _useContext$datasetLi === void 0 ? [] : _useContext$datasetLi;
|
|
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
|
}),
|
|
@@ -98,6 +95,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
98
95
|
datasetId = _props$value.datasetId,
|
|
99
96
|
datasetName = _props$value.datasetName,
|
|
100
97
|
datasetTable = _props$value.datasetTable,
|
|
98
|
+
metaDatasetId = _props$value.metaDatasetId,
|
|
101
99
|
fieldName = _props$value.fieldName,
|
|
102
100
|
fieldType = _props$value.fieldType,
|
|
103
101
|
webType = _props$value.webType,
|
|
@@ -108,8 +106,10 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
108
106
|
subCondition = _props$value.subCondition;
|
|
109
107
|
setDataset({
|
|
110
108
|
id: datasetId,
|
|
109
|
+
datasetId: datasetId,
|
|
111
110
|
tableName: datasetTable,
|
|
112
|
-
datasetName: datasetName
|
|
111
|
+
datasetName: datasetName,
|
|
112
|
+
metaDatasetId: metaDatasetId
|
|
113
113
|
});
|
|
114
114
|
setField({
|
|
115
115
|
name: fieldName,
|
|
@@ -122,8 +122,10 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
122
122
|
if (subCondition) {
|
|
123
123
|
setSubDataset({
|
|
124
124
|
id: subCondition.datasetId,
|
|
125
|
+
datasetId: subCondition.datasetId,
|
|
125
126
|
tableName: subCondition.datasetTable,
|
|
126
|
-
datasetName: subCondition.datasetName
|
|
127
|
+
datasetName: subCondition.datasetName,
|
|
128
|
+
metaDatasetId: subCondition.metaDatasetId
|
|
127
129
|
});
|
|
128
130
|
setSubField({
|
|
129
131
|
name: subCondition.fieldName,
|
|
@@ -148,9 +150,9 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
152
|
if (params || between) {
|
|
151
|
-
setFieldValue(operator === 'between' ? between : [params]);
|
|
153
|
+
setFieldValue(operator === 'between' ? between : Array.isArray(params) ? params : [params]);
|
|
152
154
|
}
|
|
153
|
-
onDatasetChange(
|
|
155
|
+
onDatasetChange(datasetTable);
|
|
154
156
|
setTimeout(function () {
|
|
155
157
|
setIsFirst(false);
|
|
156
158
|
}, 0);
|
|
@@ -159,9 +161,10 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
159
161
|
if (isFirst) return;
|
|
160
162
|
if (!dataset) return;
|
|
161
163
|
var data = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
metaDatasetId: dataset.metaDatasetId,
|
|
165
|
+
datasetId: dataset.datasetId,
|
|
164
166
|
datasetTable: dataset.tableName,
|
|
167
|
+
datasetName: dataset.datasetName,
|
|
165
168
|
fieldName: field === null || field === void 0 ? void 0 : field.name,
|
|
166
169
|
fieldType: field === null || field === void 0 ? void 0 : field.type,
|
|
167
170
|
webType: field === null || field === void 0 ? void 0 : field.webType,
|
|
@@ -172,9 +175,10 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
172
175
|
if (['add', 'subtraction', 'multiplication', 'division'].includes((operator === null || operator === void 0 ? void 0 : operator.value) || '')) {
|
|
173
176
|
data.subCondition = {
|
|
174
177
|
operator: operator === null || operator === void 0 ? void 0 : operator.value,
|
|
175
|
-
datasetId: subDataset && subDataset.
|
|
178
|
+
datasetId: subDataset && subDataset.datasetId,
|
|
176
179
|
datasetName: subDataset && subDataset.datasetName,
|
|
177
180
|
datasetTable: subDataset && subDataset.tableName,
|
|
181
|
+
metaDatasetId: subDataset && subDataset.metaDatasetId,
|
|
178
182
|
fieldName: subField === null || subField === void 0 ? void 0 : subField.name,
|
|
179
183
|
calculate: subcalculate === null || subcalculate === void 0 ? void 0 : subcalculate.value
|
|
180
184
|
};
|
|
@@ -203,18 +207,16 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
203
207
|
return PropType.DATE;
|
|
204
208
|
}
|
|
205
209
|
};
|
|
206
|
-
var onDatasetChange = function onDatasetChange(
|
|
207
|
-
if (!
|
|
210
|
+
var onDatasetChange = function onDatasetChange(tableName, isSub) {
|
|
211
|
+
if (!tableName) {
|
|
208
212
|
isSub ? setSubFieldList([]) : setFieldList([]);
|
|
209
213
|
return;
|
|
210
214
|
}
|
|
211
215
|
setLoading(true);
|
|
212
|
-
request(Apis.
|
|
213
|
-
method: '
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
|
|
217
|
-
datasetId: datasetId
|
|
216
|
+
request(Apis.queryTableInfo, {
|
|
217
|
+
method: 'get',
|
|
218
|
+
params: {
|
|
219
|
+
tableName: tableName
|
|
218
220
|
}
|
|
219
221
|
}).then(function (result) {
|
|
220
222
|
setLoading(false);
|
|
@@ -234,7 +236,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
234
236
|
});
|
|
235
237
|
setOperator(undefined);
|
|
236
238
|
setFieldValue([]);
|
|
237
|
-
onDatasetChange(data.
|
|
239
|
+
onDatasetChange(data.tableName);
|
|
238
240
|
};
|
|
239
241
|
var onSubTableChange = function onSubTableChange(data) {
|
|
240
242
|
setSubDataset(data);
|
|
@@ -242,7 +244,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
242
244
|
name: undefined
|
|
243
245
|
});
|
|
244
246
|
setSubOperator(undefined);
|
|
245
|
-
onDatasetChange(data.
|
|
247
|
+
onDatasetChange(data.tableName, true);
|
|
246
248
|
};
|
|
247
249
|
var onFieldChange = function onFieldChange(data) {
|
|
248
250
|
setField(data);
|
|
@@ -401,8 +403,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
401
403
|
className: "".concat(classPrefix, "-select-dataset"),
|
|
402
404
|
options: datasetList,
|
|
403
405
|
placeholder: "\u9009\u62E9\u660E\u7EC6\u8868",
|
|
404
|
-
labelField: "
|
|
405
|
-
keyField: "
|
|
406
|
+
labelField: "name",
|
|
407
|
+
keyField: "metaDatasetId",
|
|
406
408
|
value: subDataset,
|
|
407
409
|
onChange: onSubTableChange
|
|
408
410
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -458,8 +460,8 @@ var CdpConditionItem = function CdpConditionItem(props) {
|
|
|
458
460
|
className: "".concat(classPrefix, "-select-dataset"),
|
|
459
461
|
options: datasetList,
|
|
460
462
|
placeholder: "\u9009\u62E9\u660E\u7EC6\u8868",
|
|
461
|
-
labelField: "
|
|
462
|
-
keyField: "
|
|
463
|
+
labelField: "name",
|
|
464
|
+
keyField: "metaDatasetId",
|
|
463
465
|
value: dataset,
|
|
464
466
|
onChange: onTableChange
|
|
465
467
|
}), dataset ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -15,6 +15,7 @@ import { BizUserConditionContext, classPrefix } from '..';
|
|
|
15
15
|
import BizSelect from '../../select';
|
|
16
16
|
import { operatorMap } from './constants';
|
|
17
17
|
import BizUserTagsSelect from '../../userTagsSelector';
|
|
18
|
+
import BizGlobalDataContext from '../../context';
|
|
18
19
|
import './styles/tagsCondition.less';
|
|
19
20
|
import _ from 'lodash';
|
|
20
21
|
import { buildSelectLayer } from '../util';
|
|
@@ -28,6 +29,8 @@ var options = [{
|
|
|
28
29
|
var TagsCondition = function TagsCondition(props) {
|
|
29
30
|
var _useContext = useContext(BizUserConditionContext),
|
|
30
31
|
userTagsData = _useContext.userTagsData;
|
|
32
|
+
var _useContext2 = useContext(BizGlobalDataContext),
|
|
33
|
+
currentApp = _useContext2.currentApp;
|
|
31
34
|
var labels = props.labels,
|
|
32
35
|
dataId = props.dataId,
|
|
33
36
|
onChange = props.onChange;
|
|
@@ -67,7 +70,7 @@ var TagsCondition = function TagsCondition(props) {
|
|
|
67
70
|
className: "".concat(classPrefix, "-tags-condition")
|
|
68
71
|
}, /*#__PURE__*/React.createElement("div", {
|
|
69
72
|
className: "".concat(classPrefix, "-tags-condition-label")
|
|
70
|
-
},
|
|
73
|
+
}, (currentApp === null || currentApp === void 0 ? void 0 : currentApp.type) === 'user' ? '用户标签' : '主体标签'), /*#__PURE__*/React.createElement("div", {
|
|
71
74
|
className: "".concat(classPrefix, "-tags-condition-operator")
|
|
72
75
|
}, /*#__PURE__*/React.createElement(BizSelect, {
|
|
73
76
|
options: options,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
function
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
6
|
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."); }
|
|
4
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -16,7 +19,6 @@ import OrConditions from './orConditions';
|
|
|
16
19
|
import './styles/index.less';
|
|
17
20
|
import { buildCondition } from './util';
|
|
18
21
|
import BizGlobalDataContext from '../context';
|
|
19
|
-
import IconFont from '../icon/iconFont';
|
|
20
22
|
import request from '../utils/ajax';
|
|
21
23
|
import Apis from '../constants/apis';
|
|
22
24
|
import { Spin } from 'antd';
|
|
@@ -65,7 +67,7 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
65
67
|
var showTag = openTagCondition && authority[10038];
|
|
66
68
|
var showCdp = openCdpCondition && authority[1006];
|
|
67
69
|
var flag = false;
|
|
68
|
-
defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.forEach(function (item) {
|
|
70
|
+
Array.isArray(defaultValue) && (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.forEach(function (item) {
|
|
69
71
|
var showItem = _toConsumableArray(item);
|
|
70
72
|
if (!(showTag && showCdp && (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appVersion) === 2)) {
|
|
71
73
|
item === null || item === void 0 ? void 0 : item.forEach(function (data, index) {
|
|
@@ -85,7 +87,7 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
85
87
|
if (showItem.length > 0) {
|
|
86
88
|
list.push(showItem);
|
|
87
89
|
}
|
|
88
|
-
});
|
|
90
|
+
}));
|
|
89
91
|
if (flag) {
|
|
90
92
|
props.onChange(list);
|
|
91
93
|
}
|
|
@@ -123,36 +125,6 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
123
125
|
setLoading(false);
|
|
124
126
|
}
|
|
125
127
|
}, []);
|
|
126
|
-
var haveCdpValues = useMemo(function () {
|
|
127
|
-
var flag = false;
|
|
128
|
-
var _iterator = _createForOfIteratorHelper(value),
|
|
129
|
-
_step;
|
|
130
|
-
try {
|
|
131
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
132
|
-
var condition = _step.value;
|
|
133
|
-
var _iterator2 = _createForOfIteratorHelper(condition),
|
|
134
|
-
_step2;
|
|
135
|
-
try {
|
|
136
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
137
|
-
var item = _step2.value;
|
|
138
|
-
if (item.dataset || item.data_set_csh) {
|
|
139
|
-
flag = true;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
} catch (err) {
|
|
144
|
-
_iterator2.e(err);
|
|
145
|
-
} finally {
|
|
146
|
-
_iterator2.f();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
} catch (err) {
|
|
150
|
-
_iterator.e(err);
|
|
151
|
-
} finally {
|
|
152
|
-
_iterator.f();
|
|
153
|
-
}
|
|
154
|
-
return flag;
|
|
155
|
-
}, [value]);
|
|
156
128
|
function initShowList() {
|
|
157
129
|
var showList = [];
|
|
158
130
|
value.forEach(function (item) {
|
|
@@ -205,20 +177,41 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
205
177
|
props.onChange && props.onChange(newValue);
|
|
206
178
|
}
|
|
207
179
|
function getDatasetList() {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
180
|
+
return _getDatasetList.apply(this, arguments);
|
|
181
|
+
}
|
|
182
|
+
function _getDatasetList() {
|
|
183
|
+
_getDatasetList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
184
|
+
var res;
|
|
185
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
186
|
+
while (1) switch (_context.prev = _context.next) {
|
|
187
|
+
case 0:
|
|
188
|
+
_context.prev = 0;
|
|
189
|
+
_context.next = 3;
|
|
190
|
+
return request(Apis.queryMetaDatasetList, {
|
|
191
|
+
method: 'post',
|
|
192
|
+
data: {
|
|
193
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
case 3:
|
|
197
|
+
res = _context.sent;
|
|
198
|
+
setDataset(res.data);
|
|
199
|
+
setLoading(false);
|
|
200
|
+
_context.next = 13;
|
|
201
|
+
break;
|
|
202
|
+
case 8:
|
|
203
|
+
_context.prev = 8;
|
|
204
|
+
_context.t0 = _context["catch"](0);
|
|
205
|
+
console.error(_context.t0);
|
|
206
|
+
setDataset([]);
|
|
207
|
+
setLoading(false);
|
|
208
|
+
case 13:
|
|
209
|
+
case "end":
|
|
210
|
+
return _context.stop();
|
|
211
|
+
}
|
|
212
|
+
}, _callee, null, [[0, 8]]);
|
|
213
|
+
}));
|
|
214
|
+
return _getDatasetList.apply(this, arguments);
|
|
222
215
|
}
|
|
223
216
|
if (loading) {
|
|
224
217
|
return /*#__PURE__*/React.createElement(Spin, null);
|
|
@@ -262,11 +255,7 @@ var BizUserCondition = function BizUserCondition(props) {
|
|
|
262
255
|
show: value.length < andConditionNum,
|
|
263
256
|
label: "\u4E14",
|
|
264
257
|
onAdd: onAdd
|
|
265
|
-
})
|
|
266
|
-
className: "".concat(classPrefix, "-tip")
|
|
267
|
-
}, ' ', /*#__PURE__*/React.createElement(IconFont, {
|
|
268
|
-
type: "tishiicon"
|
|
269
|
-
}), "\u660E\u7EC6\u8868\u4E2D\u9700\u5B58\u5728\u300Capp_user_id\u300D\u6761\u4EF6\u65B9\u53EF\u751F\u6548\u3002") : null));
|
|
258
|
+
})));
|
|
270
259
|
};
|
|
271
260
|
BizUserCondition.defaultProps = {
|
|
272
261
|
andConditionNum: 5,
|
|
@@ -189,6 +189,8 @@ export declare namespace BizUserConditionT {
|
|
|
189
189
|
}
|
|
190
190
|
interface CdpDataSet {
|
|
191
191
|
id: number;
|
|
192
|
+
metaDatasetId?: number;
|
|
193
|
+
datasetId: number;
|
|
192
194
|
datasetName: string;
|
|
193
195
|
tableName: string;
|
|
194
196
|
}
|
|
@@ -198,6 +200,7 @@ export declare namespace BizUserConditionT {
|
|
|
198
200
|
webType?: PropType;
|
|
199
201
|
}
|
|
200
202
|
interface CdpConditionDetail {
|
|
203
|
+
metaDatasetId?: number;
|
|
201
204
|
datasetId?: number;
|
|
202
205
|
datasetTable?: string;
|
|
203
206
|
datasetName?: string;
|
|
@@ -210,6 +213,7 @@ export declare namespace BizUserConditionT {
|
|
|
210
213
|
}
|
|
211
214
|
interface CdpCshConditionDetail {
|
|
212
215
|
datasetId?: number;
|
|
216
|
+
metaDatasetId?: number;
|
|
213
217
|
datasetTable?: string;
|
|
214
218
|
datasetName?: string;
|
|
215
219
|
fieldName?: string;
|
|
@@ -220,6 +224,7 @@ export declare namespace BizUserConditionT {
|
|
|
220
224
|
paramType?: PropType;
|
|
221
225
|
subCondition?: {
|
|
222
226
|
datasetId?: number;
|
|
227
|
+
metaDatasetId?: number;
|
|
223
228
|
datasetTable?: string;
|
|
224
229
|
datasetName?: string;
|
|
225
230
|
fieldName?: string;
|
package/es/userGroup/index.js
CHANGED
|
@@ -136,7 +136,6 @@ var BizUserGroup = function BizUserGroup(_ref) {
|
|
|
136
136
|
return /*#__PURE__*/React.createElement(Overlay, {
|
|
137
137
|
onClose: setOpen.bind(undefined, false),
|
|
138
138
|
onClickCreate: function onClickCreate() {
|
|
139
|
-
console.log('点击新建用户群');
|
|
140
139
|
setOpen(false);
|
|
141
140
|
}
|
|
142
141
|
});
|
package/es/userGroup/overlay.js
CHANGED
|
@@ -129,9 +129,7 @@ var Overlay = function Overlay(_ref2) {
|
|
|
129
129
|
onClick: onClickAdd
|
|
130
130
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
131
131
|
type: "zengjia"
|
|
132
|
-
}), "\u65B0\u5EFA\u7528\u6237\u7FA4")), /*#__PURE__*/React.createElement(
|
|
133
|
-
className: "".concat(classPrefix, "-divider")
|
|
134
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6240\u6709\u7528\u6237")), showList.length > 10 ? /*#__PURE__*/React.createElement(List, {
|
|
132
|
+
}), "\u65B0\u5EFA\u7528\u6237\u7FA4")), showList.length > 10 ? /*#__PURE__*/React.createElement(List, {
|
|
135
133
|
data: showList || [],
|
|
136
134
|
itemHeight: 32,
|
|
137
135
|
itemKey: "id",
|
package/es/utils/util.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare let util: {
|
|
|
10
10
|
isBlob(obj: any): boolean;
|
|
11
11
|
isEqual(a?: {}, b?: {}): boolean;
|
|
12
12
|
equal(a: any, b: any): boolean;
|
|
13
|
+
getParamByUrl(name: string, url?: string): string | null;
|
|
13
14
|
random(min: number, max: number): number;
|
|
14
15
|
guid(): string;
|
|
15
16
|
mergeObject(defaults: {
|
package/es/utils/util.js
CHANGED
|
@@ -33,6 +33,15 @@ var util = {
|
|
|
33
33
|
equal: function equal(a, b) {
|
|
34
34
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
35
35
|
},
|
|
36
|
+
getParamByUrl: function getParamByUrl(name, url) {
|
|
37
|
+
if (!url) url = window.location.href;
|
|
38
|
+
name = name.replace(/[\[\]]/g, '\\$&');
|
|
39
|
+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
|
40
|
+
results = regex.exec(url);
|
|
41
|
+
if (!results) return null;
|
|
42
|
+
if (!results[2]) return '';
|
|
43
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
44
|
+
},
|
|
36
45
|
random: function random(min, max) {
|
|
37
46
|
return Math.round(Math.random() * (max - min)) + min;
|
|
38
47
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.39",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "39e347891d736be091704d410225760d1a996d7a",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|
package/es/demoWrapper/head.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AppInfoProps } from '../context';
|
|
3
|
-
declare const DemoHeader: React.FC<{
|
|
4
|
-
defaultApp?: number;
|
|
5
|
-
onChangeApp?: (app: AppInfoProps) => void;
|
|
6
|
-
onLoading?: (loading: boolean) => void;
|
|
7
|
-
onLogin?: () => void;
|
|
8
|
-
}>;
|
|
9
|
-
export default DemoHeader;
|