@zgfe/business-lib 1.1.55-beta.10 → 1.1.55-beta.12
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.
|
@@ -185,7 +185,8 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
185
185
|
labelGroup: currentSelect
|
|
186
186
|
}, {
|
|
187
187
|
id: currentTag === null || currentTag === void 0 ? void 0 : currentTag.id,
|
|
188
|
-
labelName: currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelName
|
|
188
|
+
labelName: currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelName,
|
|
189
|
+
labelCreateType: currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType
|
|
189
190
|
}, _objectSpread({}, data)];
|
|
190
191
|
props.onChange([].concat(_toConsumableArray(currentValue), [newValue]));
|
|
191
192
|
}
|
|
@@ -205,6 +206,28 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
205
206
|
}
|
|
206
207
|
function onClickTag(data) {
|
|
207
208
|
setCurrentTag(data);
|
|
209
|
+
if ((data === null || data === void 0 ? void 0 : data.labelCreateType) === 3) {
|
|
210
|
+
var newValue = [{
|
|
211
|
+
id: groupMap[currentSelect].id,
|
|
212
|
+
labelGroup: currentSelect
|
|
213
|
+
}, {
|
|
214
|
+
id: data === null || data === void 0 ? void 0 : data.id,
|
|
215
|
+
labelName: data === null || data === void 0 ? void 0 : data.labelName,
|
|
216
|
+
labelCreateType: data === null || data === void 0 ? void 0 : data.labelCreateType
|
|
217
|
+
}];
|
|
218
|
+
var _index = -1;
|
|
219
|
+
currentValue.map(function (item, index) {
|
|
220
|
+
if (JSON.stringify(item) === JSON.stringify(newValue)) {
|
|
221
|
+
_index = index;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
if (_index === -1) {
|
|
225
|
+
props.onChange([].concat(_toConsumableArray(currentValue), [newValue]));
|
|
226
|
+
} else {
|
|
227
|
+
currentValue.splice(_index, 1);
|
|
228
|
+
props.onChange(_toConsumableArray(currentValue));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
208
231
|
}
|
|
209
232
|
function render() {
|
|
210
233
|
if (!groupList.length) return /*#__PURE__*/React.createElement("div", {
|
|
@@ -238,7 +261,7 @@ var CascaderOverlay = function CascaderOverlay(props) {
|
|
|
238
261
|
return getTagsByGroup(Math.floor(groupMap[currentSelect].children.length / 10) + 1);
|
|
239
262
|
},
|
|
240
263
|
onClick: onClickTag
|
|
241
|
-
}) : /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E")), /*#__PURE__*/React.createElement("div", {
|
|
264
|
+
}) : /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E")), currentTag && (currentTag === null || currentTag === void 0 ? void 0 : currentTag.labelCreateType) !== 3 && /*#__PURE__*/React.createElement("div", {
|
|
242
265
|
className: "".concat(classPrefix, "-overlay-selections")
|
|
243
266
|
}, /*#__PURE__*/React.createElement(MultipleCheckPanel, {
|
|
244
267
|
valueField: valueFields[2],
|
|
@@ -10,7 +10,7 @@ import { DemoWrapper } from '@zgfe/business-lib';
|
|
|
10
10
|
import { ajax } from '../../utils';
|
|
11
11
|
import apis from '../../constants/apis';
|
|
12
12
|
export default (function () {
|
|
13
|
-
var appId =
|
|
13
|
+
var appId = 204;
|
|
14
14
|
var _useState = useState([]),
|
|
15
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
16
|
groupList = _useState2[0],
|
|
@@ -36,10 +36,12 @@ var UserTagsSelect = function UserTagsSelect(props) {
|
|
|
36
36
|
setVisible = _useState4[1];
|
|
37
37
|
var handleValue = useMemo(function () {
|
|
38
38
|
return currentValue.map(function (item) {
|
|
39
|
-
var last = item[item.length - 1];
|
|
40
39
|
var pre = item[item.length - 2];
|
|
40
|
+
var last = item[item.length - 1];
|
|
41
|
+
var pre_text = pre[labelFields[labelFields.length - 2]];
|
|
42
|
+
var last_text = last[labelFields[labelFields.length - 1]];
|
|
41
43
|
var res = _objectSpread(_objectSpread({}, last), {}, {
|
|
42
|
-
handleText:
|
|
44
|
+
handleText: (last === null || last === void 0 ? void 0 : last.labelCreateType) === 3 ? last[labelFields[1]] : "".concat(pre_text, "\uFF1A").concat(last_text)
|
|
43
45
|
});
|
|
44
46
|
return res;
|
|
45
47
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.55-beta.
|
|
3
|
+
"version": "1.1.55-beta.12",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "9da314033963b8cefec0765465e871131fa1fd67"
|
|
64
64
|
}
|