@bit-sun/business-component 4.0.11-alpha.22 → 4.0.11-alpha.24
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
CHANGED
|
@@ -4071,7 +4071,7 @@ function ToCDB(str) {
|
|
|
4071
4071
|
return tmp;
|
|
4072
4072
|
}
|
|
4073
4073
|
|
|
4074
|
-
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_expand_button {\n position: relative;\n right: -11px;\n width: 30px;\n border-left: 1px solid #d9d9d9;\n height: 24px;\n cursor: pointer;\n font-size: 14px;\n font-weight: bolder;\n}\n.search_select_expand_button span {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_expand_button:hover {\n background-color: #005cff;\n color: #fff;\n}\n.search_select_expand_button_disabled:hover {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.25);\n cursor: not-allowed;\n}\n.search_select_dropdown_table .ant-table-cell .ant-table-selection-column .ant-radio,\n.search_select_dropdown_table table tr td.ant-table-selection-column .ant-radio-wrapper {\n display: none;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {\n font-family: MiSans-Regular;\n font-weight: 400;\n font-size: 12px;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table tbody > tr > td {\n color: #333333;\n}\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-body > table > tbody > tr > td.ant-table-selection-column,\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-header > table > thead > tr > th.ant-table-selection-column {\n display: none;\n}\n.search_select_modal_wrapper .ant-modal {\n top: 60px;\n}\n.search_select_modal_wrapper .ant-modal-header {\n padding: 6px 0px 6px 16px;\n}\n.search_select_modal_wrapper .ant-modal-header .ant-modal-title {\n height: 20px;\n color: #000000;\n line-height: 20px;\n}\n.search_select_modal_wrapper .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n}\n.search_select_modal_wrapper .ant-modal-body {\n padding: 0px;\n background: #F3F3F3;\n height:
|
|
4074
|
+
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_expand_button {\n position: relative;\n right: -11px;\n width: 30px;\n border-left: 1px solid #d9d9d9;\n height: 24px;\n cursor: pointer;\n font-size: 14px;\n font-weight: bolder;\n}\n.search_select_expand_button span {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_expand_button:hover {\n background-color: #005cff;\n color: #fff;\n}\n.search_select_expand_button_disabled:hover {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.25);\n cursor: not-allowed;\n}\n.search_select_dropdown_table .ant-table-cell .ant-table-selection-column .ant-radio,\n.search_select_dropdown_table table tr td.ant-table-selection-column .ant-radio-wrapper {\n display: none;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {\n font-family: MiSans-Regular;\n font-weight: 400;\n font-size: 12px;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table tbody > tr > td {\n color: #333333;\n}\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-body > table > tbody > tr > td.ant-table-selection-column,\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-header > table > thead > tr > th.ant-table-selection-column {\n display: none;\n}\n.search_select_modal_wrapper .ant-modal {\n top: 60px;\n}\n.search_select_modal_wrapper .ant-modal-header {\n padding: 6px 0px 6px 16px;\n}\n.search_select_modal_wrapper .ant-modal-header .ant-modal-title {\n height: 20px;\n color: #000000;\n line-height: 20px;\n}\n.search_select_modal_wrapper .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n}\n.search_select_modal_wrapper .ant-modal-body {\n padding: 0px;\n background: #F3F3F3;\n height: 624px;\n overflow: hidden;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn.ant-btn-default {\n color: #005cff;\n border-color: #005cff;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary,\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary[disabled] {\n background: #005cff;\n border-color: #005cff;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary[disabled] {\n opacity: 0.5;\n color: #fff;\n}\n.search_select_wrapper {\n position: relative;\n font-size: 14px;\n}\n.search_select_wrapper_topForm .select_list_columns {\n width: 100%;\n padding: 10px 6px 2px 16px;\n background-color: #fff;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form {\n padding: 0;\n overflow: hidden;\n display: flex;\n align-items: flex-start;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item,\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-col .ant-space {\n font-size: 12px !important;\n margin-right: 0px !important;\n margin-bottom: 8px !important;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row.ant-form-item-row {\n background-color: #fafafa;\n border: 0.8px solid #D9D9D9;\n border-radius: 2px;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row {\n width: 100%;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-label {\n width: 110px;\n order: 1;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-label label {\n width: 100%;\n text-align: left;\n padding: 0 10px;\n color: #333333;\n font-size: 12px;\n font-family: PingFangSC-Regular;\n font-weight: 400;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control {\n order: 2;\n width: 100px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-input-affix-wrapper {\n border: 0;\n font-size: 12px;\n background-color: #fafafa;\n padding: 0 11px;\n height: 24px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-input-affix-wrapper .ant-input {\n background-color: #fafafa !important;\n border: 0;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-select-selector {\n border: 0 !important;\n background-color: #fafafa !important;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .query_input .ant-input {\n background-color: #fafafa !important;\n border: 0;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-btn-primary {\n background: #005cff;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form > .ant-row > .ant-col {\n order: 2;\n padding-right: 10px;\n}\n.search_select_wrapper_topForm .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper_bottomTable {\n margin: 10px;\n display: flex;\n justify-content: space-between;\n}\n.search_select_wrapper_bottomTable_wrapLeft1,\n.search_select_wrapper_bottomTable_wrapLeft2,\n.search_select_wrapper_bottomTable_wrapRight {\n background: #fff;\n width: calc(50% - 5px);\n}\n.search_select_wrapper_bottomTable_wrapLeft1 {\n width: 100%;\n}\n.search_select_wrapper_bottomTable_wrapRight {\n margin-left: 10px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav {\n margin: 0;\n padding: 6px 18.5px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-nav-wrap {\n height: 28px;\n font-size: 14px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-tab {\n padding: 4px 0;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-ink-bar {\n left: 3px !important;\n width: 40px !important;\n background: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-extra-content > span {\n color: #005cff;\n cursor: pointer;\n}\n.search_select_wrapper_bottomTable .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n color: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder {\n padding: 10px 10px 7px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table-thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table.ant-table-small .ant-table-tbody > tr > td {\n color: #333333;\n}\n.search_select_wrapper_bottomTable .ant-checkbox-checked .ant-checkbox-inner {\n color: #005cff;\n background: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-pagination-item-active a {\n color: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-pagination-item-active {\n border-color: #005cff;\n}\n.searchSelectSpin > div {\n height: 300px !important;\n}\n";
|
|
4075
4075
|
styleInject(css_248z$5);
|
|
4076
4076
|
|
|
4077
4077
|
var columnsPerRow = 4; // 每行的列数
|
|
@@ -4116,8 +4116,8 @@ var getRealStr = function getRealStr(oldSelect, newSelect, record) {
|
|
|
4116
4116
|
};
|
|
4117
4117
|
var getTableHeigth = function getTableHeigth(list) {
|
|
4118
4118
|
var totalRows = Math.ceil(((list === null || list === void 0 ? void 0 : list.length) + 1) / 4);
|
|
4119
|
-
if (totalRows == 1) return
|
|
4120
|
-
return
|
|
4119
|
+
if (totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
|
|
4120
|
+
return 488 - totalRows * 10;
|
|
4121
4121
|
};
|
|
4122
4122
|
|
|
4123
4123
|
var zhankaitiaojian = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3Ezhankaitiaojian-icon%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Crect%20id%3D%22path-1%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2224%22%20height%3D%2224%22%3E%3C%2Frect%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22%E9%A1%B5%E9%9D%A2-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22icon%22%20transform%3D%22translate%28-702.000000%2C%20-498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22zhankaitiaojian-icon%22%20transform%3D%22translate%28702.000000%2C%20498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmask%20id%3D%22mask-2%22%20fill%3D%22white%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fmask%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20id%3D%22%E8%92%99%E7%89%88%22%20fill%3D%22%23D8D8D8%22%20opacity%3D%220%22%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0142082%2C6%20L18%2C11.9972435%20L12.0142082%2C18%20L11.04209%2C17.0260337%20L16.0562218%2C11.9972435%20L11.04209%2C6.97396631%20L12.0142082%2C6%20Z%20M6.97257658%2C6%20L12.9583683%2C11.9972435%20L6.97257658%2C18%20L6.00091666%2C17.0260337%20L11.0150485%2C11.9972435%20L6%2C6.97396631%20L6.97257658%2C6%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%20fill%3D%22%23005CFF%22%20fill-rule%3D%22nonzero%22%20mask%3D%22url%28%23mask-2%29%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%28-270.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
@@ -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();
|
|
@@ -5054,6 +5066,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5054
5066
|
// />
|
|
5055
5067
|
var renderShowTable = function renderShowTable(tableList, type) {
|
|
5056
5068
|
var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
|
|
5069
|
+
var oSY = tableBoxHeighth - 82; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
|
|
5057
5070
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
5058
5071
|
style: {
|
|
5059
5072
|
height: "".concat(tableBoxHeighth, "px")
|
|
@@ -5080,7 +5093,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5080
5093
|
rowKey: mappingValueField,
|
|
5081
5094
|
scroll: {
|
|
5082
5095
|
x: modalTableProps.overScrollX || 'max-content',
|
|
5083
|
-
y: modalTableProps.overScrollY ||
|
|
5096
|
+
y: modalTableProps.overScrollY || oSY
|
|
5084
5097
|
},
|
|
5085
5098
|
onRow: function onRow(record) {
|
|
5086
5099
|
return {
|
|
@@ -5111,6 +5124,8 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5111
5124
|
}];
|
|
5112
5125
|
var resetSelectDataSource = function resetSelectDataSource() {
|
|
5113
5126
|
setSearchValue('');
|
|
5127
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
5128
|
+
if (isHaveDependency) return;
|
|
5114
5129
|
clearSelectDataSource();
|
|
5115
5130
|
init && run('init');
|
|
5116
5131
|
};
|
|
@@ -5164,7 +5179,12 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5164
5179
|
var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
|
|
5165
5180
|
return item != undefined;
|
|
5166
5181
|
});
|
|
5167
|
-
var
|
|
5182
|
+
var realStr = _toConsumableArray(new Set(((value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
5183
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5184
|
+
})) || []).concat(sks))).filter(function (item) {
|
|
5185
|
+
return item != undefined;
|
|
5186
|
+
}); // 避免搜索之后 没有了选中前的数据
|
|
5187
|
+
var realSrs = realStr.map(function (key) {
|
|
5168
5188
|
return tmpSelectedRows.filter(function (item) {
|
|
5169
5189
|
return item[mappingValueField] == key;
|
|
5170
5190
|
})[0];
|
|
@@ -5312,7 +5332,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5312
5332
|
onChange: onchange,
|
|
5313
5333
|
onClear: onClear,
|
|
5314
5334
|
onDeselect: onDeselect,
|
|
5315
|
-
disabled:
|
|
5335
|
+
disabled: sDisabled,
|
|
5316
5336
|
dropdownStyle: {
|
|
5317
5337
|
borderRadius: '2px',
|
|
5318
5338
|
padding: '10px 2px'
|
|
@@ -5329,7 +5349,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5329
5349
|
style: {
|
|
5330
5350
|
textAlign: 'center'
|
|
5331
5351
|
}
|
|
5332
|
-
}, /*#__PURE__*/React$1.createElement("div", null, searchValue ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5352
|
+
}, /*#__PURE__*/React$1.createElement("div", null, searchValue || init ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5333
5353
|
onPopupScroll: SelectScroll,
|
|
5334
5354
|
style: {
|
|
5335
5355
|
width: 'calc(100%)'
|
|
@@ -5341,7 +5361,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5341
5361
|
}
|
|
5342
5362
|
}, needModalTable ? {
|
|
5343
5363
|
suffixIcon: /*#__PURE__*/React$1.createElement("div", {
|
|
5344
|
-
className: "search_select_expand_button ".concat(
|
|
5364
|
+
className: "search_select_expand_button ".concat(sDisabled ? 'search_select_expand_button_disabled' : ''),
|
|
5345
5365
|
onClick: showModal
|
|
5346
5366
|
}, /*#__PURE__*/React$1.createElement(SearchOutlined, null))
|
|
5347
5367
|
} : {}), currentSelectProps), {}, {
|
|
@@ -5373,7 +5393,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5373
5393
|
type: "primary",
|
|
5374
5394
|
loading: confirmLoading,
|
|
5375
5395
|
onClick: handleOk,
|
|
5376
|
-
disabled:
|
|
5396
|
+
disabled: sDisabled
|
|
5377
5397
|
}, "\u786E\u5B9A")] : null,
|
|
5378
5398
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5379
5399
|
}, (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalProps) || {}), /*#__PURE__*/React$1.createElement("div", {
|
package/dist/index.js
CHANGED
|
@@ -4094,7 +4094,7 @@ function ToCDB(str) {
|
|
|
4094
4094
|
return tmp;
|
|
4095
4095
|
}
|
|
4096
4096
|
|
|
4097
|
-
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_expand_button {\n position: relative;\n right: -11px;\n width: 30px;\n border-left: 1px solid #d9d9d9;\n height: 24px;\n cursor: pointer;\n font-size: 14px;\n font-weight: bolder;\n}\n.search_select_expand_button span {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_expand_button:hover {\n background-color: #005cff;\n color: #fff;\n}\n.search_select_expand_button_disabled:hover {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.25);\n cursor: not-allowed;\n}\n.search_select_dropdown_table .ant-table-cell .ant-table-selection-column .ant-radio,\n.search_select_dropdown_table table tr td.ant-table-selection-column .ant-radio-wrapper {\n display: none;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {\n font-family: MiSans-Regular;\n font-weight: 400;\n font-size: 12px;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table tbody > tr > td {\n color: #333333;\n}\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-body > table > tbody > tr > td.ant-table-selection-column,\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-header > table > thead > tr > th.ant-table-selection-column {\n display: none;\n}\n.search_select_modal_wrapper .ant-modal {\n top: 60px;\n}\n.search_select_modal_wrapper .ant-modal-header {\n padding: 6px 0px 6px 16px;\n}\n.search_select_modal_wrapper .ant-modal-header .ant-modal-title {\n height: 20px;\n color: #000000;\n line-height: 20px;\n}\n.search_select_modal_wrapper .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n}\n.search_select_modal_wrapper .ant-modal-body {\n padding: 0px;\n background: #F3F3F3;\n height:
|
|
4097
|
+
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_expand_button {\n position: relative;\n right: -11px;\n width: 30px;\n border-left: 1px solid #d9d9d9;\n height: 24px;\n cursor: pointer;\n font-size: 14px;\n font-weight: bolder;\n}\n.search_select_expand_button span {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_expand_button:hover {\n background-color: #005cff;\n color: #fff;\n}\n.search_select_expand_button_disabled:hover {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.25);\n cursor: not-allowed;\n}\n.search_select_dropdown_table .ant-table-cell .ant-table-selection-column .ant-radio,\n.search_select_dropdown_table table tr td.ant-table-selection-column .ant-radio-wrapper {\n display: none;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table {\n font-family: MiSans-Regular;\n font-weight: 400;\n font-size: 12px;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_dropdown_table .ant-table.ant-table-bordered > .ant-table-container > .ant-table-header > table tbody > tr > td {\n color: #333333;\n}\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-body > table > tbody > tr > td.ant-table-selection-column,\n.search_select_dropdown_table1 .ant-table.ant-table-bordered > .ant-table-container .ant-table-header > table > thead > tr > th.ant-table-selection-column {\n display: none;\n}\n.search_select_modal_wrapper .ant-modal {\n top: 60px;\n}\n.search_select_modal_wrapper .ant-modal-header {\n padding: 6px 0px 6px 16px;\n}\n.search_select_modal_wrapper .ant-modal-header .ant-modal-title {\n height: 20px;\n color: #000000;\n line-height: 20px;\n}\n.search_select_modal_wrapper .ant-modal-close-x {\n width: 32px;\n height: 32px;\n line-height: 32px;\n}\n.search_select_modal_wrapper .ant-modal-body {\n padding: 0px;\n background: #F3F3F3;\n height: 624px;\n overflow: hidden;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn.ant-btn-default {\n color: #005cff;\n border-color: #005cff;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary,\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary[disabled] {\n background: #005cff;\n border-color: #005cff;\n}\n.search_select_modal_wrapper .ant-modal-footer .ant-btn-primary[disabled] {\n opacity: 0.5;\n color: #fff;\n}\n.search_select_wrapper {\n position: relative;\n font-size: 14px;\n}\n.search_select_wrapper_topForm .select_list_columns {\n width: 100%;\n padding: 10px 6px 2px 16px;\n background-color: #fff;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form {\n padding: 0;\n overflow: hidden;\n display: flex;\n align-items: flex-start;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item,\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-col .ant-space {\n font-size: 12px !important;\n margin-right: 0px !important;\n margin-bottom: 8px !important;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row.ant-form-item-row {\n background-color: #fafafa;\n border: 0.8px solid #D9D9D9;\n border-radius: 2px;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row {\n width: 100%;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-label {\n width: 110px;\n order: 1;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-label label {\n width: 100%;\n text-align: left;\n padding: 0 10px;\n color: #333333;\n font-size: 12px;\n font-family: PingFangSC-Regular;\n font-weight: 400;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control {\n order: 2;\n width: 100px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-input-affix-wrapper {\n border: 0;\n font-size: 12px;\n background-color: #fafafa;\n padding: 0 11px;\n height: 24px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-input-affix-wrapper .ant-input {\n background-color: #fafafa !important;\n border: 0;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .ant-select-selector {\n border: 0 !important;\n background-color: #fafafa !important;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-row .ant-form-item-control .query_input .ant-input {\n background-color: #fafafa !important;\n border: 0;\n font-size: 12px;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form .ant-btn-primary {\n background: #005cff;\n}\n.search_select_wrapper_topForm .select_list_columns .ant-form > .ant-row > .ant-col {\n order: 2;\n padding-right: 10px;\n}\n.search_select_wrapper_topForm .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper_bottomTable {\n margin: 10px;\n display: flex;\n justify-content: space-between;\n}\n.search_select_wrapper_bottomTable_wrapLeft1,\n.search_select_wrapper_bottomTable_wrapLeft2,\n.search_select_wrapper_bottomTable_wrapRight {\n background: #fff;\n width: calc(50% - 5px);\n}\n.search_select_wrapper_bottomTable_wrapLeft1 {\n width: 100%;\n}\n.search_select_wrapper_bottomTable_wrapRight {\n margin-left: 10px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav {\n margin: 0;\n padding: 6px 18.5px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-nav-wrap {\n height: 28px;\n font-size: 14px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-tab {\n padding: 4px 0;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-ink-bar {\n left: 3px !important;\n width: 40px !important;\n background: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-tabs-nav .ant-tabs-extra-content > span {\n color: #005cff;\n cursor: pointer;\n}\n.search_select_wrapper_bottomTable .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n color: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder {\n padding: 10px 10px 7px;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table-thead > tr > th {\n color: #7F7F7F;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table-thead .ant-table-selection .ant-checkbox-wrapper {\n justify-content: center;\n}\n.search_select_wrapper_bottomTable .ant-tabs-content-holder .ant-tabs-content .ant-table-wrapper .ant-table .ant-table-container .ant-table-content .ant-table.ant-table-small .ant-table-tbody > tr > td {\n color: #333333;\n}\n.search_select_wrapper_bottomTable .ant-checkbox-checked .ant-checkbox-inner {\n color: #005cff;\n background: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-pagination-item-active a {\n color: #005cff;\n}\n.search_select_wrapper_bottomTable .ant-pagination-item-active {\n border-color: #005cff;\n}\n.searchSelectSpin > div {\n height: 300px !important;\n}\n";
|
|
4098
4098
|
styleInject(css_248z$5);
|
|
4099
4099
|
|
|
4100
4100
|
var columnsPerRow = 4; // 每行的列数
|
|
@@ -4139,8 +4139,8 @@ var getRealStr = function getRealStr(oldSelect, newSelect, record) {
|
|
|
4139
4139
|
};
|
|
4140
4140
|
var getTableHeigth = function getTableHeigth(list) {
|
|
4141
4141
|
var totalRows = Math.ceil(((list === null || list === void 0 ? void 0 : list.length) + 1) / 4);
|
|
4142
|
-
if (totalRows == 1) return
|
|
4143
|
-
return
|
|
4142
|
+
if (totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
|
|
4143
|
+
return 488 - totalRows * 10;
|
|
4144
4144
|
};
|
|
4145
4145
|
|
|
4146
4146
|
var zhankaitiaojian = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3Ezhankaitiaojian-icon%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Crect%20id%3D%22path-1%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2224%22%20height%3D%2224%22%3E%3C%2Frect%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22%E9%A1%B5%E9%9D%A2-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22icon%22%20transform%3D%22translate%28-702.000000%2C%20-498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22zhankaitiaojian-icon%22%20transform%3D%22translate%28702.000000%2C%20498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmask%20id%3D%22mask-2%22%20fill%3D%22white%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fmask%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20id%3D%22%E8%92%99%E7%89%88%22%20fill%3D%22%23D8D8D8%22%20opacity%3D%220%22%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0142082%2C6%20L18%2C11.9972435%20L12.0142082%2C18%20L11.04209%2C17.0260337%20L16.0562218%2C11.9972435%20L11.04209%2C6.97396631%20L12.0142082%2C6%20Z%20M6.97257658%2C6%20L12.9583683%2C11.9972435%20L6.97257658%2C18%20L6.00091666%2C17.0260337%20L11.0150485%2C11.9972435%20L6%2C6.97396631%20L6.97257658%2C6%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%20fill%3D%22%23005CFF%22%20fill-rule%3D%22nonzero%22%20mask%3D%22url%28%23mask-2%29%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%28-270.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
|
|
@@ -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();
|
|
@@ -5077,6 +5089,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5077
5089
|
// />
|
|
5078
5090
|
var renderShowTable = function renderShowTable(tableList, type) {
|
|
5079
5091
|
var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
|
|
5092
|
+
var oSY = tableBoxHeighth - 82; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
|
|
5080
5093
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5081
5094
|
style: {
|
|
5082
5095
|
height: "".concat(tableBoxHeighth, "px")
|
|
@@ -5103,7 +5116,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5103
5116
|
rowKey: mappingValueField,
|
|
5104
5117
|
scroll: {
|
|
5105
5118
|
x: modalTableProps.overScrollX || 'max-content',
|
|
5106
|
-
y: modalTableProps.overScrollY ||
|
|
5119
|
+
y: modalTableProps.overScrollY || oSY
|
|
5107
5120
|
},
|
|
5108
5121
|
onRow: function onRow(record) {
|
|
5109
5122
|
return {
|
|
@@ -5134,6 +5147,8 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5134
5147
|
}];
|
|
5135
5148
|
var resetSelectDataSource = function resetSelectDataSource() {
|
|
5136
5149
|
setSearchValue('');
|
|
5150
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
5151
|
+
if (isHaveDependency) return;
|
|
5137
5152
|
clearSelectDataSource();
|
|
5138
5153
|
init && run('init');
|
|
5139
5154
|
};
|
|
@@ -5187,7 +5202,12 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5187
5202
|
var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
|
|
5188
5203
|
return item != undefined;
|
|
5189
5204
|
});
|
|
5190
|
-
var
|
|
5205
|
+
var realStr = _toConsumableArray(new Set(((value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
5206
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5207
|
+
})) || []).concat(sks))).filter(function (item) {
|
|
5208
|
+
return item != undefined;
|
|
5209
|
+
}); // 避免搜索之后 没有了选中前的数据
|
|
5210
|
+
var realSrs = realStr.map(function (key) {
|
|
5191
5211
|
return tmpSelectedRows.filter(function (item) {
|
|
5192
5212
|
return item[mappingValueField] == key;
|
|
5193
5213
|
})[0];
|
|
@@ -5335,7 +5355,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5335
5355
|
onChange: onchange,
|
|
5336
5356
|
onClear: onClear,
|
|
5337
5357
|
onDeselect: onDeselect,
|
|
5338
|
-
disabled:
|
|
5358
|
+
disabled: sDisabled,
|
|
5339
5359
|
dropdownStyle: {
|
|
5340
5360
|
borderRadius: '2px',
|
|
5341
5361
|
padding: '10px 2px'
|
|
@@ -5352,7 +5372,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5352
5372
|
style: {
|
|
5353
5373
|
textAlign: 'center'
|
|
5354
5374
|
}
|
|
5355
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", null, searchValue ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5375
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, searchValue || init ? '无匹配结果,请更换其他内容再试' : "\u8BF7\u5F55\u5165".concat(searchStartLength ? '4位数以上' : '', "\u5B57\u7B26\u8FDB\u884C\u6A21\u7CCA\u67E5\u8BE2")))),
|
|
5356
5376
|
onPopupScroll: SelectScroll,
|
|
5357
5377
|
style: {
|
|
5358
5378
|
width: 'calc(100%)'
|
|
@@ -5364,7 +5384,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5364
5384
|
}
|
|
5365
5385
|
}, needModalTable ? {
|
|
5366
5386
|
suffixIcon: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5367
|
-
className: "search_select_expand_button ".concat(
|
|
5387
|
+
className: "search_select_expand_button ".concat(sDisabled ? 'search_select_expand_button_disabled' : ''),
|
|
5368
5388
|
onClick: showModal
|
|
5369
5389
|
}, /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, null))
|
|
5370
5390
|
} : {}), currentSelectProps), {}, {
|
|
@@ -5396,7 +5416,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5396
5416
|
type: "primary",
|
|
5397
5417
|
loading: confirmLoading,
|
|
5398
5418
|
onClick: handleOk,
|
|
5399
|
-
disabled:
|
|
5419
|
+
disabled: sDisabled
|
|
5400
5420
|
}, "\u786E\u5B9A")] : null,
|
|
5401
5421
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5402
5422
|
}, (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();
|
|
@@ -820,6 +833,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
820
833
|
|
|
821
834
|
const renderShowTable = (tableList, type) => {
|
|
822
835
|
const tableBoxHeighth = getTableHeigth(modalTableProps?.tableSearchForm);
|
|
836
|
+
const oSY = tableBoxHeighth - 82 // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
|
|
823
837
|
return (
|
|
824
838
|
<div style={{ height: `${tableBoxHeighth}px` }}>
|
|
825
839
|
<Table
|
|
@@ -844,7 +858,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
844
858
|
rowKey={mappingValueField}
|
|
845
859
|
scroll={{
|
|
846
860
|
x: modalTableProps.overScrollX || 'max-content',
|
|
847
|
-
y: modalTableProps.overScrollY ||
|
|
861
|
+
y: modalTableProps.overScrollY || oSY,
|
|
848
862
|
}}
|
|
849
863
|
onRow={(record) => {
|
|
850
864
|
return {
|
|
@@ -867,6 +881,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
867
881
|
|
|
868
882
|
const resetSelectDataSource = () => {
|
|
869
883
|
setSearchValue('');
|
|
884
|
+
// 有关联值 不需要清空下拉框数据 也不需要重新去请求了
|
|
885
|
+
if(isHaveDependency) return;
|
|
870
886
|
clearSelectDataSource();
|
|
871
887
|
init && run('init')
|
|
872
888
|
}
|
|
@@ -908,7 +924,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
908
924
|
onChange: (sks, srs) => {
|
|
909
925
|
const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
|
|
910
926
|
let tmpSelectedRows = oldSelect.concat(srs).filter(item => item != undefined);
|
|
911
|
-
|
|
927
|
+
const realStr = [...new Set((value?.map(s => s?.value || s) || []).concat(sks))].filter(item => item != undefined); // 避免搜索之后 没有了选中前的数据
|
|
928
|
+
let realSrs = realStr.map(key => tmpSelectedRows.filter(item => item[mappingValueField] == key)[0]).filter(item => item != undefined)
|
|
912
929
|
onSelectClick(realSrs, dataSource,false)
|
|
913
930
|
}
|
|
914
931
|
},
|
|
@@ -1008,7 +1025,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1008
1025
|
return getShowValueStr(kongValue);
|
|
1009
1026
|
}
|
|
1010
1027
|
|
|
1011
|
-
const isShouldShowStr = (props.disabled && ctx) || ctx?.mode == 'view'
|
|
1028
|
+
const isShouldShowStr = (props.disabled && ctx) || ctx?.mode == 'view';
|
|
1012
1029
|
return (
|
|
1013
1030
|
<div className={'search_select'}>
|
|
1014
1031
|
{fieldComponent ? (
|
|
@@ -1035,7 +1052,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1035
1052
|
onChange={onchange}
|
|
1036
1053
|
onClear={onClear}
|
|
1037
1054
|
onDeselect={onDeselect}
|
|
1038
|
-
disabled={
|
|
1055
|
+
disabled={sDisabled}
|
|
1039
1056
|
dropdownStyle={{ borderRadius: '2px', padding: '10px 2px' }}
|
|
1040
1057
|
open={selectOpen}
|
|
1041
1058
|
onDropdownVisibleChange={onDropdownVisibleChange}
|
|
@@ -1045,7 +1062,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1045
1062
|
<Spin size="small" className='searchSelectSpin' />
|
|
1046
1063
|
) : (
|
|
1047
1064
|
<div style={{ textAlign: 'center' }}>
|
|
1048
|
-
<div>{searchValue?'无匹配结果,请更换其他内容再试':`请录入${searchStartLength?'4位数以上':''}字符进行模糊查询`}</div>
|
|
1065
|
+
<div>{(searchValue||init)?'无匹配结果,请更换其他内容再试':`请录入${searchStartLength?'4位数以上':''}字符进行模糊查询`}</div>
|
|
1049
1066
|
</div>
|
|
1050
1067
|
)
|
|
1051
1068
|
}
|
|
@@ -1055,7 +1072,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1055
1072
|
maxTagPlaceholder={maxTagPlaceholder}
|
|
1056
1073
|
onSearch={(v) => onSearchChange(v)}
|
|
1057
1074
|
{...(needModalTable ? {
|
|
1058
|
-
suffixIcon: <div className={`search_select_expand_button ${(
|
|
1075
|
+
suffixIcon: <div className={`search_select_expand_button ${(sDisabled)?'search_select_expand_button_disabled':''}`} onClick={showModal}><SearchOutlined /></div>
|
|
1059
1076
|
} : {})}
|
|
1060
1077
|
{...currentSelectProps}
|
|
1061
1078
|
getPopupContainer={(triggerNode) => (getPopupContainer && getPopupContainer(triggerNode)) || triggerNode.parentElement}
|
|
@@ -1092,7 +1109,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1092
1109
|
type="primary"
|
|
1093
1110
|
loading={confirmLoading}
|
|
1094
1111
|
onClick={handleOk}
|
|
1095
|
-
disabled={
|
|
1112
|
+
disabled={sDisabled}
|
|
1096
1113
|
>
|
|
1097
1114
|
确定
|
|
1098
1115
|
</Button>,
|
|
@@ -33,6 +33,6 @@ export const getRealStr = (oldSelect: any,newSelect: any, record: any) => {
|
|
|
33
33
|
|
|
34
34
|
export const getTableHeigth = (list: any) => {
|
|
35
35
|
const totalRows = Math.ceil((list?.length+1) / 4);
|
|
36
|
-
if(totalRows == 1) return
|
|
37
|
-
return
|
|
36
|
+
if(totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
|
|
37
|
+
return 488 - totalRows*10
|
|
38
38
|
}
|