ztxkui 4.2.18-90 → 4.2.18-92
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/dist/Demo.js
CHANGED
|
@@ -137,7 +137,10 @@ function Demo() {
|
|
|
137
137
|
React.createElement(EnhanceSelect, { style: selectStyle, placeholder: i18next.t('一次性加载数据'), url: "http://base-test.zmdms.com.cn:30079/api/zmdms-system/company/list", request: request, dataKey: "id", titleKey: "name", isClickRequest: true, isPaste: true, isCatch: true, mode: "multiple", value: value3, onChange: function (value, option, fullData) {
|
|
138
138
|
console.log(value);
|
|
139
139
|
setValue3(value);
|
|
140
|
-
}
|
|
140
|
+
} }),
|
|
141
|
+
React.createElement("button", { onClick: function () {
|
|
142
|
+
setValue3(['10005004', '10005009']);
|
|
143
|
+
} }, "\u8BBE\u7F6E\u503C"),
|
|
141
144
|
React.createElement("p", null, i18next.t('异步获取数据')),
|
|
142
145
|
React.createElement("button", { onClick: function () {
|
|
143
146
|
setParams1(JSON.stringify({
|
|
@@ -280,9 +280,8 @@ function EnhanceSelect(_a) {
|
|
|
280
280
|
function pasteHandle(value) {
|
|
281
281
|
if (isPaste && restProps.mode === 'multiple') {
|
|
282
282
|
var pasteRuleIndex = pasteRule.findIndex(function (item) { return value.indexOf(item) !== -1; });
|
|
283
|
-
if (pasteRuleIndex !== -1 ||
|
|
283
|
+
if (pasteRuleIndex !== -1 || isPasteAddItem) {
|
|
284
284
|
var splitStr = pasteRuleIndex !== -1 ? pasteRule[pasteRuleIndex] : ' ';
|
|
285
|
-
debugger;
|
|
286
285
|
var resultValue = value.split(splitStr);
|
|
287
286
|
resultValue = Array.from(new Set(resultValue));
|
|
288
287
|
if (Array.isArray(restProps.value)) {
|
|
@@ -875,7 +874,8 @@ function EnhanceSelect(_a) {
|
|
|
875
874
|
var currentData_1;
|
|
876
875
|
if (Array.isArray(value)) {
|
|
877
876
|
currentData_1 = value.map(function (valueItem) {
|
|
878
|
-
|
|
877
|
+
var _a;
|
|
878
|
+
var item = currentList.find(function (item) {
|
|
879
879
|
var _a, _b, _c;
|
|
880
880
|
if (!item) {
|
|
881
881
|
return false;
|
|
@@ -887,6 +887,14 @@ function EnhanceSelect(_a) {
|
|
|
887
887
|
return ((_b = (_a = item[key_1]) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) === ((_c = valueItem === null || valueItem === void 0 ? void 0 : valueItem.toString) === null || _c === void 0 ? void 0 : _c.call(valueItem));
|
|
888
888
|
}
|
|
889
889
|
});
|
|
890
|
+
if (item) {
|
|
891
|
+
return item;
|
|
892
|
+
}
|
|
893
|
+
// 有一种情况就是列表数据里面没有设置的值
|
|
894
|
+
return _a = {},
|
|
895
|
+
_a[key_1] = valueItem,
|
|
896
|
+
_a[titleKey] = valueItem,
|
|
897
|
+
_a;
|
|
890
898
|
});
|
|
891
899
|
currentData_1 = currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1.filter(function (item) { return item; });
|
|
892
900
|
if (remoteSearch) {
|