ztxkui 4.2.18-91 → 4.2.18-93
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,12 @@ 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
|
+
// open={false}
|
|
142
|
+
isPasteAddItem: true }),
|
|
143
|
+
React.createElement("button", { onClick: function () {
|
|
144
|
+
setValue3(['10005004', '10005009']);
|
|
145
|
+
} }, "\u8BBE\u7F6E\u503C"),
|
|
141
146
|
React.createElement("p", null, i18next.t('异步获取数据')),
|
|
142
147
|
React.createElement("button", { onClick: function () {
|
|
143
148
|
setParams1(JSON.stringify({
|
|
@@ -874,7 +874,8 @@ function EnhanceSelect(_a) {
|
|
|
874
874
|
var currentData_1;
|
|
875
875
|
if (Array.isArray(value)) {
|
|
876
876
|
currentData_1 = value.map(function (valueItem) {
|
|
877
|
-
|
|
877
|
+
var _a;
|
|
878
|
+
var item = currentList.find(function (item) {
|
|
878
879
|
var _a, _b, _c;
|
|
879
880
|
if (!item) {
|
|
880
881
|
return false;
|
|
@@ -886,6 +887,14 @@ function EnhanceSelect(_a) {
|
|
|
886
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));
|
|
887
888
|
}
|
|
888
889
|
});
|
|
890
|
+
if (item) {
|
|
891
|
+
return item;
|
|
892
|
+
}
|
|
893
|
+
// 有一种情况就是列表数据里面没有设置的值
|
|
894
|
+
return _a = {},
|
|
895
|
+
_a[key_1] = valueItem,
|
|
896
|
+
_a[titleKey] = valueItem,
|
|
897
|
+
_a;
|
|
889
898
|
});
|
|
890
899
|
currentData_1 = currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1.filter(function (item) { return item; });
|
|
891
900
|
if (remoteSearch) {
|
|
@@ -918,7 +927,7 @@ function EnhanceSelect(_a) {
|
|
|
918
927
|
}
|
|
919
928
|
else {
|
|
920
929
|
// 否则 最后一个不是全部,那就去掉全部
|
|
921
|
-
__value = currentData_1.map(function (item) { return item[key_1]; });
|
|
930
|
+
__value = currentData_1 === null || currentData_1 === void 0 ? void 0 : currentData_1.filter(function (item) { return item[key_1] !== ''; }).map(function (item) { return item[key_1]; });
|
|
922
931
|
}
|
|
923
932
|
}
|
|
924
933
|
else if (!Array.isArray(__value) && __value != null && currentData_1) {
|