@bit-sun/business-component 4.0.11-alpha.22 → 4.0.11-alpha.23
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/index.esm.js +34 -15
- package/dist/index.js +34 -15
- package/package.json +1 -1
- package/src/components/Functional/SearchSelect/index.tsx +31 -15
package/dist/index.esm.js
CHANGED
|
@@ -4185,7 +4185,8 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4185
4185
|
allowClear: true,
|
|
4186
4186
|
listHeight: 160,
|
|
4187
4187
|
optionLabelProp: "label",
|
|
4188
|
-
autoClearSearchValue: false
|
|
4188
|
+
autoClearSearchValue: false,
|
|
4189
|
+
placement: 'bottomLeft'
|
|
4189
4190
|
});
|
|
4190
4191
|
var initPagination = {
|
|
4191
4192
|
showQuickJumper: true,
|
|
@@ -4200,6 +4201,18 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4200
4201
|
current: 1
|
|
4201
4202
|
});
|
|
4202
4203
|
var disabled = noOperate || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled);
|
|
4204
|
+
var isHaveDependency = fixedparameter && fieldValToParam && ctx;
|
|
4205
|
+
var isHaveDValue = function isHaveDValue() {
|
|
4206
|
+
var formValueList = [];
|
|
4207
|
+
fieldValToParam.forEach(function (item, index) {
|
|
4208
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4209
|
+
formValueList.push(fixedParamVal);
|
|
4210
|
+
});
|
|
4211
|
+
return formValueList.filter(function (item) {
|
|
4212
|
+
return item;
|
|
4213
|
+
}).length > 0;
|
|
4214
|
+
};
|
|
4215
|
+
var sDisabled = disabled || isHaveDependency && !!!isHaveDValue();
|
|
4203
4216
|
var _useState = useState([]),
|
|
4204
4217
|
_useState2 = _slicedToArray(_useState, 2),
|
|
4205
4218
|
items = _useState2[0],
|
|
@@ -4333,6 +4346,11 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4333
4346
|
var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
4334
4347
|
if (reset) {
|
|
4335
4348
|
if (init) {
|
|
4349
|
+
// 有关联,依赖项清空,此form项数据源也应清空, 也不可点击搜索
|
|
4350
|
+
if (isHaveDependency) {
|
|
4351
|
+
clearSelectDataSource();
|
|
4352
|
+
return;
|
|
4353
|
+
}
|
|
4336
4354
|
run('init');
|
|
4337
4355
|
} else {
|
|
4338
4356
|
clearSelectDataSource();
|
|
@@ -4371,7 +4389,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4371
4389
|
setFetching(true);
|
|
4372
4390
|
// 处理dependence参数
|
|
4373
4391
|
var fixedParam = {};
|
|
4374
|
-
if (
|
|
4392
|
+
if (isHaveDependency) {
|
|
4375
4393
|
fixedparameter.forEach(function (item, index) {
|
|
4376
4394
|
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4377
4395
|
if (fixedParamVal) {
|
|
@@ -4671,6 +4689,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4671
4689
|
};
|
|
4672
4690
|
}, [isModalVisible]);
|
|
4673
4691
|
var showModal = function showModal() {
|
|
4692
|
+
if (sDisabled) return;
|
|
4674
4693
|
setSelectOpen(false);
|
|
4675
4694
|
setSearchValue('');
|
|
4676
4695
|
setModalSearched(false);
|
|
@@ -4788,14 +4807,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4788
4807
|
var refreshItems = function refreshItems() {
|
|
4789
4808
|
// 查看是否存在关联值 如果有关联值 就查询 没有就不能查询
|
|
4790
4809
|
if (fieldValToParam && ctx && fixedparamsDisabled) {
|
|
4791
|
-
|
|
4792
|
-
fieldValToParam.forEach(function (item, index) {
|
|
4793
|
-
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4794
|
-
formValueList.push(fixedParamVal);
|
|
4795
|
-
});
|
|
4796
|
-
if (formValueList.filter(function (item) {
|
|
4797
|
-
return item;
|
|
4798
|
-
}).length > 0) {
|
|
4810
|
+
if (!!isHaveDValue()) {
|
|
4799
4811
|
run();
|
|
4800
4812
|
} else {
|
|
4801
4813
|
clearSelectDataSource();
|
|
@@ -5111,6 +5123,8 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5111
5123
|
}];
|
|
5112
5124
|
var resetSelectDataSource = function resetSelectDataSource() {
|
|
5113
5125
|
setSearchValue('');
|
|
5126
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
5127
|
+
if (isHaveDependency) return;
|
|
5114
5128
|
clearSelectDataSource();
|
|
5115
5129
|
init && run('init');
|
|
5116
5130
|
};
|
|
@@ -5164,7 +5178,12 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5164
5178
|
var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
|
|
5165
5179
|
return item != undefined;
|
|
5166
5180
|
});
|
|
5167
|
-
var
|
|
5181
|
+
var realStr = _toConsumableArray(((value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
5182
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5183
|
+
})) || []).concat(sks)).filter(function (item) {
|
|
5184
|
+
return item != undefined;
|
|
5185
|
+
}); // 避免搜索之后 没有了选中前的数据
|
|
5186
|
+
var realSrs = realStr.map(function (key) {
|
|
5168
5187
|
return tmpSelectedRows.filter(function (item) {
|
|
5169
5188
|
return item[mappingValueField] == key;
|
|
5170
5189
|
})[0];
|
|
@@ -5312,7 +5331,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5312
5331
|
onChange: onchange,
|
|
5313
5332
|
onClear: onClear,
|
|
5314
5333
|
onDeselect: onDeselect,
|
|
5315
|
-
disabled:
|
|
5334
|
+
disabled: sDisabled,
|
|
5316
5335
|
dropdownStyle: {
|
|
5317
5336
|
borderRadius: '2px',
|
|
5318
5337
|
padding: '10px 2px'
|
|
@@ -5329,7 +5348,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5329
5348
|
style: {
|
|
5330
5349
|
textAlign: 'center'
|
|
5331
5350
|
}
|
|
5332
|
-
}, /*#__PURE__*/React$1.createElement("div", null, searchValue ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5351
|
+
}, /*#__PURE__*/React$1.createElement("div", null, searchValue || init ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5333
5352
|
onPopupScroll: SelectScroll,
|
|
5334
5353
|
style: {
|
|
5335
5354
|
width: 'calc(100%)'
|
|
@@ -5341,7 +5360,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5341
5360
|
}
|
|
5342
5361
|
}, needModalTable ? {
|
|
5343
5362
|
suffixIcon: /*#__PURE__*/React$1.createElement("div", {
|
|
5344
|
-
className: "search_select_expand_button ".concat(
|
|
5363
|
+
className: "search_select_expand_button ".concat(sDisabled ? 'search_select_expand_button_disabled' : ''),
|
|
5345
5364
|
onClick: showModal
|
|
5346
5365
|
}, /*#__PURE__*/React$1.createElement(SearchOutlined, null))
|
|
5347
5366
|
} : {}), currentSelectProps), {}, {
|
|
@@ -5373,7 +5392,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5373
5392
|
type: "primary",
|
|
5374
5393
|
loading: confirmLoading,
|
|
5375
5394
|
onClick: handleOk,
|
|
5376
|
-
disabled:
|
|
5395
|
+
disabled: sDisabled
|
|
5377
5396
|
}, "\u786E\u5B9A")] : null,
|
|
5378
5397
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5379
5398
|
}, (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalProps) || {}), /*#__PURE__*/React$1.createElement("div", {
|
package/dist/index.js
CHANGED
|
@@ -4208,7 +4208,8 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4208
4208
|
allowClear: true,
|
|
4209
4209
|
listHeight: 160,
|
|
4210
4210
|
optionLabelProp: "label",
|
|
4211
|
-
autoClearSearchValue: false
|
|
4211
|
+
autoClearSearchValue: false,
|
|
4212
|
+
placement: 'bottomLeft'
|
|
4212
4213
|
});
|
|
4213
4214
|
var initPagination = {
|
|
4214
4215
|
showQuickJumper: true,
|
|
@@ -4223,6 +4224,18 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4223
4224
|
current: 1
|
|
4224
4225
|
});
|
|
4225
4226
|
var disabled = noOperate || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled);
|
|
4227
|
+
var isHaveDependency = fixedparameter && fieldValToParam && ctx;
|
|
4228
|
+
var isHaveDValue = function isHaveDValue() {
|
|
4229
|
+
var formValueList = [];
|
|
4230
|
+
fieldValToParam.forEach(function (item, index) {
|
|
4231
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4232
|
+
formValueList.push(fixedParamVal);
|
|
4233
|
+
});
|
|
4234
|
+
return formValueList.filter(function (item) {
|
|
4235
|
+
return item;
|
|
4236
|
+
}).length > 0;
|
|
4237
|
+
};
|
|
4238
|
+
var sDisabled = disabled || isHaveDependency && !!!isHaveDValue();
|
|
4226
4239
|
var _useState = React$1.useState([]),
|
|
4227
4240
|
_useState2 = _slicedToArray(_useState, 2),
|
|
4228
4241
|
items = _useState2[0],
|
|
@@ -4356,6 +4369,11 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4356
4369
|
var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
4357
4370
|
if (reset) {
|
|
4358
4371
|
if (init) {
|
|
4372
|
+
// 有关联,依赖项清空,此form项数据源也应清空, 也不可点击搜索
|
|
4373
|
+
if (isHaveDependency) {
|
|
4374
|
+
clearSelectDataSource();
|
|
4375
|
+
return;
|
|
4376
|
+
}
|
|
4359
4377
|
run('init');
|
|
4360
4378
|
} else {
|
|
4361
4379
|
clearSelectDataSource();
|
|
@@ -4394,7 +4412,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4394
4412
|
setFetching(true);
|
|
4395
4413
|
// 处理dependence参数
|
|
4396
4414
|
var fixedParam = {};
|
|
4397
|
-
if (
|
|
4415
|
+
if (isHaveDependency) {
|
|
4398
4416
|
fixedparameter.forEach(function (item, index) {
|
|
4399
4417
|
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4400
4418
|
if (fixedParamVal) {
|
|
@@ -4694,6 +4712,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4694
4712
|
};
|
|
4695
4713
|
}, [isModalVisible]);
|
|
4696
4714
|
var showModal = function showModal() {
|
|
4715
|
+
if (sDisabled) return;
|
|
4697
4716
|
setSelectOpen(false);
|
|
4698
4717
|
setSearchValue('');
|
|
4699
4718
|
setModalSearched(false);
|
|
@@ -4811,14 +4830,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4811
4830
|
var refreshItems = function refreshItems() {
|
|
4812
4831
|
// 查看是否存在关联值 如果有关联值 就查询 没有就不能查询
|
|
4813
4832
|
if (fieldValToParam && ctx && fixedparamsDisabled) {
|
|
4814
|
-
|
|
4815
|
-
fieldValToParam.forEach(function (item, index) {
|
|
4816
|
-
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4817
|
-
formValueList.push(fixedParamVal);
|
|
4818
|
-
});
|
|
4819
|
-
if (formValueList.filter(function (item) {
|
|
4820
|
-
return item;
|
|
4821
|
-
}).length > 0) {
|
|
4833
|
+
if (!!isHaveDValue()) {
|
|
4822
4834
|
run();
|
|
4823
4835
|
} else {
|
|
4824
4836
|
clearSelectDataSource();
|
|
@@ -5134,6 +5146,8 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5134
5146
|
}];
|
|
5135
5147
|
var resetSelectDataSource = function resetSelectDataSource() {
|
|
5136
5148
|
setSearchValue('');
|
|
5149
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
5150
|
+
if (isHaveDependency) return;
|
|
5137
5151
|
clearSelectDataSource();
|
|
5138
5152
|
init && run('init');
|
|
5139
5153
|
};
|
|
@@ -5187,7 +5201,12 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5187
5201
|
var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
|
|
5188
5202
|
return item != undefined;
|
|
5189
5203
|
});
|
|
5190
|
-
var
|
|
5204
|
+
var realStr = _toConsumableArray(((value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
5205
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5206
|
+
})) || []).concat(sks)).filter(function (item) {
|
|
5207
|
+
return item != undefined;
|
|
5208
|
+
}); // 避免搜索之后 没有了选中前的数据
|
|
5209
|
+
var realSrs = realStr.map(function (key) {
|
|
5191
5210
|
return tmpSelectedRows.filter(function (item) {
|
|
5192
5211
|
return item[mappingValueField] == key;
|
|
5193
5212
|
})[0];
|
|
@@ -5335,7 +5354,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5335
5354
|
onChange: onchange,
|
|
5336
5355
|
onClear: onClear,
|
|
5337
5356
|
onDeselect: onDeselect,
|
|
5338
|
-
disabled:
|
|
5357
|
+
disabled: sDisabled,
|
|
5339
5358
|
dropdownStyle: {
|
|
5340
5359
|
borderRadius: '2px',
|
|
5341
5360
|
padding: '10px 2px'
|
|
@@ -5352,7 +5371,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5352
5371
|
style: {
|
|
5353
5372
|
textAlign: 'center'
|
|
5354
5373
|
}
|
|
5355
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", null, searchValue ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5374
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, searchValue || init ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5356
5375
|
onPopupScroll: SelectScroll,
|
|
5357
5376
|
style: {
|
|
5358
5377
|
width: 'calc(100%)'
|
|
@@ -5364,7 +5383,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5364
5383
|
}
|
|
5365
5384
|
}, needModalTable ? {
|
|
5366
5385
|
suffixIcon: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5367
|
-
className: "search_select_expand_button ".concat(
|
|
5386
|
+
className: "search_select_expand_button ".concat(sDisabled ? 'search_select_expand_button_disabled' : ''),
|
|
5368
5387
|
onClick: showModal
|
|
5369
5388
|
}, /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, null))
|
|
5370
5389
|
} : {}), currentSelectProps), {}, {
|
|
@@ -5396,7 +5415,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5396
5415
|
type: "primary",
|
|
5397
5416
|
loading: confirmLoading,
|
|
5398
5417
|
onClick: handleOk,
|
|
5399
|
-
disabled:
|
|
5418
|
+
disabled: sDisabled
|
|
5400
5419
|
}, "\u786E\u5B9A")] : null,
|
|
5401
5420
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5402
5421
|
}, (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalProps) || {}), /*#__PURE__*/React__default['default'].createElement("div", {
|
package/package.json
CHANGED
|
@@ -68,11 +68,22 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
68
68
|
allowClear: true,
|
|
69
69
|
listHeight: 160,
|
|
70
70
|
optionLabelProp: "label",
|
|
71
|
-
autoClearSearchValue: false
|
|
71
|
+
autoClearSearchValue: false,
|
|
72
|
+
placement: 'bottomLeft'
|
|
72
73
|
}
|
|
73
74
|
const initPagination = { showQuickJumper: true, showSizeChanger: false, showTotal: (total: any) => `共 ${total} 条`, pageSize: tableInitPageSize }
|
|
74
75
|
const tableInitPagination = { ...initPagination, total: 0, current: 1 }
|
|
75
|
-
const disabled = noOperate || selectProps?.disabled || props?.disabled
|
|
76
|
+
const disabled = noOperate || selectProps?.disabled || props?.disabled;
|
|
77
|
+
const isHaveDependency = fixedparameter && fieldValToParam && ctx;
|
|
78
|
+
const isHaveDValue = () => {
|
|
79
|
+
let formValueList = [];
|
|
80
|
+
fieldValToParam.forEach((item: any, index: any) => {
|
|
81
|
+
const fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
82
|
+
formValueList.push(fixedParamVal);
|
|
83
|
+
});
|
|
84
|
+
return formValueList.filter((item: any) => item).length > 0
|
|
85
|
+
}
|
|
86
|
+
const sDisabled = disabled || (isHaveDependency && !!!isHaveDValue());
|
|
76
87
|
|
|
77
88
|
const [items, setItems] = useState([]);
|
|
78
89
|
const [selectOpen, setSelectOpen] = useState(false);
|
|
@@ -136,6 +147,11 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
136
147
|
refreshDataSource: (reset: boolean = false) => {
|
|
137
148
|
if (reset) {
|
|
138
149
|
if (init) {
|
|
150
|
+
// 有关联,依赖项清空,此form项数据源也应清空, 也不可点击搜索
|
|
151
|
+
if(isHaveDependency){
|
|
152
|
+
clearSelectDataSource();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
139
155
|
run('init');
|
|
140
156
|
} else {
|
|
141
157
|
clearSelectDataSource();
|
|
@@ -165,7 +181,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
165
181
|
|
|
166
182
|
// 处理dependence参数
|
|
167
183
|
const fixedParam = {};
|
|
168
|
-
if (
|
|
184
|
+
if (isHaveDependency) {
|
|
169
185
|
fixedparameter.forEach((item: any, index: any) => {
|
|
170
186
|
const fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
171
187
|
if(fixedParamVal) {
|
|
@@ -487,6 +503,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
487
503
|
},[isModalVisible])
|
|
488
504
|
|
|
489
505
|
const showModal = () => {
|
|
506
|
+
if(sDisabled) return;
|
|
507
|
+
|
|
490
508
|
setSelectOpen(false)
|
|
491
509
|
setSearchValue('');
|
|
492
510
|
setModalSearched(false);
|
|
@@ -582,12 +600,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
582
600
|
const refreshItems = () => {
|
|
583
601
|
// 查看是否存在关联值 如果有关联值 就查询 没有就不能查询
|
|
584
602
|
if (fieldValToParam && ctx && fixedparamsDisabled) {
|
|
585
|
-
|
|
586
|
-
fieldValToParam.forEach((item: any, index: any) => {
|
|
587
|
-
const fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
588
|
-
formValueList.push(fixedParamVal);
|
|
589
|
-
});
|
|
590
|
-
if (formValueList.filter((item: any) => item).length > 0) {
|
|
603
|
+
if (!!isHaveDValue()) {
|
|
591
604
|
run();
|
|
592
605
|
} else {
|
|
593
606
|
clearSelectDataSource();
|
|
@@ -867,6 +880,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
867
880
|
|
|
868
881
|
const resetSelectDataSource = () => {
|
|
869
882
|
setSearchValue('');
|
|
883
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
884
|
+
if(isHaveDependency) return;
|
|
870
885
|
clearSelectDataSource();
|
|
871
886
|
init && run('init')
|
|
872
887
|
}
|
|
@@ -908,7 +923,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
908
923
|
onChange: (sks, srs) => {
|
|
909
924
|
const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
|
|
910
925
|
let tmpSelectedRows = oldSelect.concat(srs).filter(item => item != undefined);
|
|
911
|
-
|
|
926
|
+
const realStr = [...((value?.map(s => s?.value||s)||[]).concat(sks))].filter(item => item != undefined); // 避免搜索之后 没有了选中前的数据
|
|
927
|
+
let realSrs = realStr.map(key => tmpSelectedRows.filter(item => item[mappingValueField] == key)[0]).filter(item => item != undefined)
|
|
912
928
|
onSelectClick(realSrs, dataSource,false)
|
|
913
929
|
}
|
|
914
930
|
},
|
|
@@ -1008,7 +1024,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1008
1024
|
return getShowValueStr(kongValue);
|
|
1009
1025
|
}
|
|
1010
1026
|
|
|
1011
|
-
const isShouldShowStr = (props.disabled && ctx) || ctx?.mode == 'view'
|
|
1027
|
+
const isShouldShowStr = (props.disabled && ctx) || ctx?.mode == 'view';
|
|
1012
1028
|
return (
|
|
1013
1029
|
<div className={'search_select'}>
|
|
1014
1030
|
{fieldComponent ? (
|
|
@@ -1035,7 +1051,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1035
1051
|
onChange={onchange}
|
|
1036
1052
|
onClear={onClear}
|
|
1037
1053
|
onDeselect={onDeselect}
|
|
1038
|
-
disabled={
|
|
1054
|
+
disabled={sDisabled}
|
|
1039
1055
|
dropdownStyle={{ borderRadius: '2px', padding: '10px 2px' }}
|
|
1040
1056
|
open={selectOpen}
|
|
1041
1057
|
onDropdownVisibleChange={onDropdownVisibleChange}
|
|
@@ -1045,7 +1061,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1045
1061
|
<Spin size="small" className='searchSelectSpin' />
|
|
1046
1062
|
) : (
|
|
1047
1063
|
<div style={{ textAlign: 'center' }}>
|
|
1048
|
-
<div>{searchValue?'无匹配结果,请更换其他内容再试':`请录入${searchStartLength?'4位数以上':''}字符进行模糊查询`}</div>
|
|
1064
|
+
<div>{(searchValue||init)?'无匹配结果,请更换其他内容再试':`请录入${searchStartLength?'4位数以上':''}字符进行模糊查询`}</div>
|
|
1049
1065
|
</div>
|
|
1050
1066
|
)
|
|
1051
1067
|
}
|
|
@@ -1055,7 +1071,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1055
1071
|
maxTagPlaceholder={maxTagPlaceholder}
|
|
1056
1072
|
onSearch={(v) => onSearchChange(v)}
|
|
1057
1073
|
{...(needModalTable ? {
|
|
1058
|
-
suffixIcon: <div className={`search_select_expand_button ${(
|
|
1074
|
+
suffixIcon: <div className={`search_select_expand_button ${(sDisabled)?'search_select_expand_button_disabled':''}`} onClick={showModal}><SearchOutlined /></div>
|
|
1059
1075
|
} : {})}
|
|
1060
1076
|
{...currentSelectProps}
|
|
1061
1077
|
getPopupContainer={(triggerNode) => (getPopupContainer && getPopupContainer(triggerNode)) || triggerNode.parentElement}
|
|
@@ -1092,7 +1108,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1092
1108
|
type="primary"
|
|
1093
1109
|
loading={confirmLoading}
|
|
1094
1110
|
onClick={handleOk}
|
|
1095
|
-
disabled={
|
|
1111
|
+
disabled={sDisabled}
|
|
1096
1112
|
>
|
|
1097
1113
|
确定
|
|
1098
1114
|
</Button>,
|