@zgfe/business-lib 1.2.53 → 1.2.54-plat.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.
|
@@ -36,7 +36,8 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
36
36
|
labelFields = props.labelFields,
|
|
37
37
|
keyFields = props.keyFields,
|
|
38
38
|
valueFields = props.valueFields,
|
|
39
|
-
childFields = props.childFields
|
|
39
|
+
childFields = props.childFields,
|
|
40
|
+
isOpenLayer = props.isOpenLayer;
|
|
40
41
|
var timer = useRef(null);
|
|
41
42
|
var _useState = useState(''),
|
|
42
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -162,7 +163,8 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
162
163
|
labelGroup: currentSelect,
|
|
163
164
|
pageNo: pageNo,
|
|
164
165
|
pageSize: 20,
|
|
165
|
-
labelName: highlightText
|
|
166
|
+
labelName: highlightText,
|
|
167
|
+
isOpenLayer: isOpenLayer || true
|
|
166
168
|
}
|
|
167
169
|
}).then(function (res) {
|
|
168
170
|
if ((res === null || res === void 0 ? void 0 : res.data) && res.data.results) {
|
|
@@ -172,6 +174,11 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
172
174
|
if (item.labelGroup === currentSelect) {
|
|
173
175
|
item.children = pageNo === 1 ? _toConsumableArray(result) : item.children.concat(result);
|
|
174
176
|
}
|
|
177
|
+
if (!isOpenLayer) {
|
|
178
|
+
item.children.forEach(function (element) {
|
|
179
|
+
element.layers = [];
|
|
180
|
+
});
|
|
181
|
+
}
|
|
175
182
|
return _objectSpread({}, item);
|
|
176
183
|
});
|
|
177
184
|
});
|
|
@@ -209,7 +216,7 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
209
216
|
}
|
|
210
217
|
function onClickTag(data) {
|
|
211
218
|
setCurrentTag(data);
|
|
212
|
-
if ((data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.firstAndLastUpdate || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.fundingSource || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.eventPreference || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.sqlCreateTable) {
|
|
219
|
+
if ((data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.firstAndLastUpdate || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.fundingSource || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.eventPreference || (data === null || data === void 0 ? void 0 : data.labelCreateType) === LabelCreateType.sqlCreateTable || !isOpenLayer) {
|
|
213
220
|
var newValue = [{
|
|
214
221
|
id: groupMap[currentSelect].id,
|
|
215
222
|
labelGroup: currentSelect
|
|
@@ -230,7 +237,11 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
230
237
|
});
|
|
231
238
|
if (_index === -1) {
|
|
232
239
|
if (currentValue.length >= 20) return;
|
|
233
|
-
|
|
240
|
+
if (isOpenLayer) {
|
|
241
|
+
props.onChange([].concat(_toConsumableArray(currentValue), [newValue]));
|
|
242
|
+
} else {
|
|
243
|
+
props.onChange([newValue]);
|
|
244
|
+
}
|
|
234
245
|
} else {
|
|
235
246
|
currentValue.splice(_index, 1);
|
|
236
247
|
props.onChange(_toConsumableArray(currentValue));
|
|
@@ -269,7 +280,7 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
269
280
|
getTagsByGroup(Math.floor(groupMap[currentSelect].children.length / 20) + 1);
|
|
270
281
|
},
|
|
271
282
|
onClick: onClickTag
|
|
272
|
-
}) : /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E")), currentTag && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.firstAndLastUpdate && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.fundingSource && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.eventPreference && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.sqlCreateTable && /*#__PURE__*/React.createElement("div", {
|
|
283
|
+
}) : /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E")), isOpenLayer && currentTag && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.firstAndLastUpdate && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.fundingSource && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.eventPreference && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== LabelCreateType.sqlCreateTable && /*#__PURE__*/React.createElement("div", {
|
|
273
284
|
className: "".concat(classPrefix, "-overlay-selections")
|
|
274
285
|
}, /*#__PURE__*/React.createElement(MultipleCheckPanel, {
|
|
275
286
|
valueField: valueFields[2],
|
|
@@ -299,6 +310,7 @@ CascaderOverlay.defaultProps = {
|
|
|
299
310
|
childFields: ['children', 'layers'],
|
|
300
311
|
keyFields: ['labelGroup', 'id', 'layerLabelId'],
|
|
301
312
|
labelFields: ['labelGroup', 'labelName', 'layerLabelName'],
|
|
302
|
-
valueFields: ['labelGroup', 'id', 'layerLabelId']
|
|
313
|
+
valueFields: ['labelGroup', 'id', 'layerLabelId'],
|
|
314
|
+
isOpenLayer: true
|
|
303
315
|
};
|
|
304
316
|
export default CascaderOverlay;
|
|
@@ -26,7 +26,8 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
26
26
|
labelFields = props.labelFields,
|
|
27
27
|
childFields = props.childFields,
|
|
28
28
|
keyFields = props.keyFields,
|
|
29
|
-
valueFields = props.valueFields
|
|
29
|
+
valueFields = props.valueFields,
|
|
30
|
+
isOpenLayer = props.isOpenLayer;
|
|
30
31
|
var _useState = useState([]),
|
|
31
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
33
|
currentValue = _useState2[0],
|
|
@@ -42,7 +43,7 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
42
43
|
var pre_text = pre[labelFields[labelFields.length - 2]];
|
|
43
44
|
var last_text = last[labelFields[labelFields.length - 1]];
|
|
44
45
|
var res = _objectSpread(_objectSpread({}, last), {}, {
|
|
45
|
-
handleText: (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === 3 || (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === 6 || (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === LabelCreateType.sqlCreateTable ? pre_text : "".concat(pre_text, "\uFF1A").concat(last_text)
|
|
46
|
+
handleText: (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === 3 || (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === 6 || (pre === null || pre === void 0 ? void 0 : pre.labelCreateType) === LabelCreateType.sqlCreateTable || !isOpenLayer ? pre_text : "".concat(pre_text, "\uFF1A").concat(last_text)
|
|
46
47
|
});
|
|
47
48
|
return res;
|
|
48
49
|
});
|
|
@@ -75,6 +76,7 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
75
76
|
keyFields: keyFields,
|
|
76
77
|
labelFields: labelFields,
|
|
77
78
|
data: data,
|
|
79
|
+
isOpenLayer: isOpenLayer,
|
|
78
80
|
onChange: onChange
|
|
79
81
|
});
|
|
80
82
|
}
|
|
@@ -105,6 +107,7 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
105
107
|
}))));
|
|
106
108
|
};
|
|
107
109
|
UserTagsSelect.defaultProps = {
|
|
108
|
-
destroyPopupOnHide: false
|
|
110
|
+
destroyPopupOnHide: false,
|
|
111
|
+
isOpenLayer: true
|
|
109
112
|
};
|
|
110
113
|
export default UserTagsSelect;
|
|
@@ -30,6 +30,7 @@ export declare namespace UserTagsSelectorTypes {
|
|
|
30
30
|
defaultCurrent?: string[];
|
|
31
31
|
onChange: Function;
|
|
32
32
|
destroyPopupOnHide?: boolean;
|
|
33
|
+
isOpenLayer?: boolean;
|
|
33
34
|
}
|
|
34
35
|
interface CascaderOverlayProps {
|
|
35
36
|
className?: string;
|
|
@@ -40,6 +41,7 @@ export declare namespace UserTagsSelectorTypes {
|
|
|
40
41
|
valueFields?: string[];
|
|
41
42
|
currentValue: Value;
|
|
42
43
|
onChange: (val: Value) => void;
|
|
44
|
+
isOpenLayer?: boolean;
|
|
43
45
|
}
|
|
44
46
|
interface Groups {
|
|
45
47
|
data: any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.54-plat.0",
|
|
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": "61f2895d3451a2a2d81b55dffcdb66629d55c482",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|