ztxkui 2.0.2 → 2.0.7
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.
|
@@ -183,9 +183,9 @@ function EnhanceSelect(_a) {
|
|
|
183
183
|
]);
|
|
184
184
|
var searchHandle = function (value) {
|
|
185
185
|
// 当value有值时才进行搜索
|
|
186
|
-
if (value) {
|
|
187
|
-
|
|
188
|
-
}
|
|
186
|
+
// if (value) {
|
|
187
|
+
getRemoteDataHandle(value, '');
|
|
188
|
+
// }
|
|
189
189
|
};
|
|
190
190
|
var onSearchHandle = debounce(searchHandle, 300);
|
|
191
191
|
// 1、如果传入list的话,那么直接使用list数据
|
|
@@ -247,7 +247,8 @@ function EnhanceSelect(_a) {
|
|
|
247
247
|
getRemoteDataHandle('', '');
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
|
-
if (typeof restProps.value === 'string'
|
|
250
|
+
if (typeof restProps.value === 'string' ||
|
|
251
|
+
Array.isArray(restProps.value)) {
|
|
251
252
|
setFirstLoading(true);
|
|
252
253
|
getRemoteDataHandle('', restProps.value);
|
|
253
254
|
}
|
|
@@ -271,7 +272,9 @@ function EnhanceSelect(_a) {
|
|
|
271
272
|
newData.forEach(function (item) {
|
|
272
273
|
// 如果源数组中找到了该条数据,那么不添加
|
|
273
274
|
// 否则添加
|
|
274
|
-
if (!resultData.find(function (resultItem) {
|
|
275
|
+
if (!resultData.find(function (resultItem) {
|
|
276
|
+
return resultItem && item && resultItem[dataKey] === item[dataKey];
|
|
277
|
+
})) {
|
|
275
278
|
resultData.push(item);
|
|
276
279
|
}
|
|
277
280
|
});
|
|
@@ -322,7 +325,10 @@ function EnhanceSelect(_a) {
|
|
|
322
325
|
currentData = value.map(function (valueItem) {
|
|
323
326
|
return currentList.find(function (item) { return item[key_1] === valueItem; });
|
|
324
327
|
});
|
|
325
|
-
|
|
328
|
+
currentData = currentData === null || currentData === void 0 ? void 0 : currentData.filter(function (item) { return item; });
|
|
329
|
+
if (remoteSearch) {
|
|
330
|
+
setMultipleList(currentData);
|
|
331
|
+
}
|
|
326
332
|
}
|
|
327
333
|
else {
|
|
328
334
|
currentData = currentList.find(function (item) { return item[key_1] === value; });
|