@bit-sun/business-component 4.0.11-alpha.11 → 4.0.11-alpha.12
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/components/Functional/SearchSelect/utils.d.ts +1 -0
- package/dist/index.esm.js +87 -28
- package/dist/index.js +87 -28
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +0 -1
- package/src/components/Business/SearchSelect/index.md +5 -5
- package/src/components/Functional/SearchSelect/index.less +15 -4
- package/src/components/Functional/SearchSelect/index.tsx +63 -32
- package/src/components/Functional/SearchSelect/utils.ts +4 -0
|
@@ -6,3 +6,4 @@ export declare const getFormRowInfo: (list: any) => {
|
|
|
6
6
|
export declare const defaultVisibleFieldsCount = 7;
|
|
7
7
|
export declare const getVisibleFieldsCount: (modalTableProps: any) => any;
|
|
8
8
|
export declare const hasMoreQueryFields: (modalTableProps: any) => boolean;
|
|
9
|
+
export declare const getRealStr: (oldSelect: any, newSelect: any, record: any) => any;
|
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_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: 684px;\n overflow: hidden;\n}\n.
|
|
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_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: 684px;\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 handleSourceName = function handleSourceName(sName) {
|
|
@@ -4106,6 +4106,13 @@ var hasMoreQueryFields = function hasMoreQueryFields(modalTableProps) {
|
|
|
4106
4106
|
var visibleFieldsCount = getVisibleFieldsCount(modalTableProps);
|
|
4107
4107
|
return visibleFieldsCount < (tableSearchForm === null || tableSearchForm === void 0 ? void 0 : tableSearchForm.length);
|
|
4108
4108
|
};
|
|
4109
|
+
var getRealStr = function getRealStr(oldSelect, newSelect, record) {
|
|
4110
|
+
return (oldSelect === null || oldSelect === void 0 ? void 0 : oldSelect.length) ? oldSelect.some(function (o) {
|
|
4111
|
+
return o.value == record.value;
|
|
4112
|
+
}) ? oldSelect.filter(function (s) {
|
|
4113
|
+
return s.value != record.value;
|
|
4114
|
+
}) : [].concat(_toConsumableArray(oldSelect), _toConsumableArray(newSelect)) : newSelect;
|
|
4115
|
+
};
|
|
4109
4116
|
|
|
4110
4117
|
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";
|
|
4111
4118
|
|
|
@@ -4174,15 +4181,15 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4174
4181
|
});
|
|
4175
4182
|
var initPagination = {
|
|
4176
4183
|
showQuickJumper: true,
|
|
4177
|
-
showSizeChanger:
|
|
4184
|
+
showSizeChanger: false,
|
|
4178
4185
|
showTotal: function showTotal(total) {
|
|
4179
4186
|
return "\u5171 ".concat(total, " \u6761");
|
|
4180
|
-
}
|
|
4187
|
+
},
|
|
4188
|
+
pageSize: tableInitPageSize
|
|
4181
4189
|
};
|
|
4182
4190
|
var tableInitPagination = _objectSpread2(_objectSpread2({}, initPagination), {}, {
|
|
4183
4191
|
total: 0,
|
|
4184
|
-
current: 1
|
|
4185
|
-
pageSize: tableInitPageSize
|
|
4192
|
+
current: 1
|
|
4186
4193
|
});
|
|
4187
4194
|
var _useState = useState([]),
|
|
4188
4195
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -4300,6 +4307,10 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4300
4307
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
4301
4308
|
confirmLoading = _useState42[0],
|
|
4302
4309
|
setConfirmLoading = _useState42[1];
|
|
4310
|
+
var _useState43 = useState(false),
|
|
4311
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
4312
|
+
modalSearched = _useState44[0],
|
|
4313
|
+
setModalSearched = _useState44[1];
|
|
4303
4314
|
useImperativeHandle(ref, function () {
|
|
4304
4315
|
return {
|
|
4305
4316
|
refreshDataSource: function refreshDataSource() {
|
|
@@ -4332,6 +4343,13 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4332
4343
|
},
|
|
4333
4344
|
refreshSelectDataSource: function refreshSelectDataSource() {
|
|
4334
4345
|
refreshItems();
|
|
4346
|
+
},
|
|
4347
|
+
handleModalVisible: function handleModalVisible(flag) {
|
|
4348
|
+
if (flag) {
|
|
4349
|
+
showModal();
|
|
4350
|
+
} else {
|
|
4351
|
+
handleCancel();
|
|
4352
|
+
}
|
|
4335
4353
|
}
|
|
4336
4354
|
};
|
|
4337
4355
|
});
|
|
@@ -4619,7 +4637,6 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4619
4637
|
}, [selectBusinessType]);
|
|
4620
4638
|
// 处理键盘事件
|
|
4621
4639
|
var handleKeyPress = function handleKeyPress(event) {
|
|
4622
|
-
console.log(event, '----event');
|
|
4623
4640
|
if ((event.metaKey || event.ctrlKey) && (event.key === 'U' || event.keyCode == 85)) {
|
|
4624
4641
|
// ctrl + U 键 重置
|
|
4625
4642
|
onResetTable();
|
|
@@ -4643,8 +4660,9 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4643
4660
|
};
|
|
4644
4661
|
}, [isModalVisible]);
|
|
4645
4662
|
var showModal = function showModal() {
|
|
4646
|
-
|
|
4647
|
-
|
|
4663
|
+
setSelectOpen(false);
|
|
4664
|
+
setSearchValue('');
|
|
4665
|
+
setModalSearched(false);
|
|
4648
4666
|
setIsModalVisible(true);
|
|
4649
4667
|
// 回显
|
|
4650
4668
|
if (value) {
|
|
@@ -4755,9 +4773,6 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4755
4773
|
var handleCancel = function handleCancel() {
|
|
4756
4774
|
clearModalTable();
|
|
4757
4775
|
setIsModalVisible(false);
|
|
4758
|
-
if (selectMode) {
|
|
4759
|
-
run();
|
|
4760
|
-
}
|
|
4761
4776
|
};
|
|
4762
4777
|
var refreshItems = function refreshItems() {
|
|
4763
4778
|
// 查看是否存在关联值 如果有关联值 就查询 没有就不能查询
|
|
@@ -4786,13 +4801,12 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4786
4801
|
};
|
|
4787
4802
|
var onSearchTable = function onSearchTable() {
|
|
4788
4803
|
var params = form.getFieldsValue();
|
|
4804
|
+
// const isHaveParams = params && Object.keys(params).filter(item => params[item]).length > 0;
|
|
4805
|
+
setModalSearched(true);
|
|
4789
4806
|
setTableFormParams(params);
|
|
4790
4807
|
getData(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
4791
4808
|
pageSize: tableInitPageSize
|
|
4792
4809
|
}), 2);
|
|
4793
|
-
if (selectMode) {
|
|
4794
|
-
getData(params);
|
|
4795
|
-
}
|
|
4796
4810
|
};
|
|
4797
4811
|
var onResetTable = function onResetTable() {
|
|
4798
4812
|
form.resetFields();
|
|
@@ -4880,8 +4894,13 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4880
4894
|
}
|
|
4881
4895
|
};
|
|
4882
4896
|
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
4883
|
-
if (!
|
|
4897
|
+
if (!((selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled) || !items.length && !tableData.length)) {
|
|
4884
4898
|
var srs = [JSON.parse(JSON.stringify(record))];
|
|
4899
|
+
if (selectMode) {
|
|
4900
|
+
var oldSelect = selectedRows;
|
|
4901
|
+
var newSelect = [JSON.parse(JSON.stringify(record))];
|
|
4902
|
+
srs = getRealStr(oldSelect, newSelect, record);
|
|
4903
|
+
}
|
|
4885
4904
|
var sks = srs.map(function (i) {
|
|
4886
4905
|
return i.value;
|
|
4887
4906
|
});
|
|
@@ -4926,7 +4945,10 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4926
4945
|
style: {
|
|
4927
4946
|
width: '100%'
|
|
4928
4947
|
},
|
|
4929
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
4948
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
4949
|
+
onDeselect: function onDeselect(v) {
|
|
4950
|
+
return onSearchTable();
|
|
4951
|
+
}
|
|
4930
4952
|
}, i === null || i === void 0 ? void 0 : (_i$field2 = i.field) === null || _i$field2 === void 0 ? void 0 : _i$field2.props), {}, {
|
|
4931
4953
|
disabled: setDisabled(i.name)
|
|
4932
4954
|
}), (i === null || i === void 0 ? void 0 : (_i$initialSource = i.initialSource) === null || _i$initialSource === void 0 ? void 0 : _i$initialSource.length) && (i === null || i === void 0 ? void 0 : i.initialSource.map(function (m) {
|
|
@@ -5015,9 +5037,12 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5015
5037
|
// bsTableCode={bsTableCode}
|
|
5016
5038
|
// />
|
|
5017
5039
|
var renderShowTable = function renderShowTable(tableList, type) {
|
|
5040
|
+
var _getFormRowInfo2 = getFormRowInfo(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
|
|
5041
|
+
totalRows = _getFormRowInfo2.totalRows;
|
|
5042
|
+
var tableBoxHeighth = 548 - totalRows * 10;
|
|
5018
5043
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
5019
5044
|
style: {
|
|
5020
|
-
height:
|
|
5045
|
+
height: "".concat(tableBoxHeighth, "px")
|
|
5021
5046
|
}
|
|
5022
5047
|
}, /*#__PURE__*/React$1.createElement(Table, _objectSpread2(_objectSpread2({
|
|
5023
5048
|
bordered: true,
|
|
@@ -5026,11 +5051,17 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5026
5051
|
columns: tableShowColumns,
|
|
5027
5052
|
dataSource: tableList
|
|
5028
5053
|
}, type == 'noPage' ? {
|
|
5029
|
-
pagination: initPagination
|
|
5054
|
+
pagination: initPagination,
|
|
5055
|
+
locale: {
|
|
5056
|
+
emptyText: '暂无已选结果'
|
|
5057
|
+
}
|
|
5030
5058
|
} : {
|
|
5031
5059
|
pagination: tablePagination,
|
|
5032
5060
|
onChange: handleTableChange,
|
|
5033
|
-
loading: fetching
|
|
5061
|
+
loading: fetching,
|
|
5062
|
+
locale: {
|
|
5063
|
+
emptyText: modalSearched ? '无匹配结果,请更换其他内容再试' : '请输入搜索条件'
|
|
5064
|
+
}
|
|
5034
5065
|
}), {}, {
|
|
5035
5066
|
rowKey: mappingValueField,
|
|
5036
5067
|
scroll: {
|
|
@@ -5064,10 +5095,18 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5064
5095
|
var onClear = function onClear() {
|
|
5065
5096
|
formaData([], items);
|
|
5066
5097
|
};
|
|
5098
|
+
var onSelectClick = function onSelectClick(srs, ds) {
|
|
5099
|
+
var nr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
5100
|
+
formaData(srs, ds);
|
|
5101
|
+
nr && setSelectOpen(false);
|
|
5102
|
+
};
|
|
5067
5103
|
var onDropdownVisibleChange = function onDropdownVisibleChange(visible) {
|
|
5068
5104
|
setSelectOpen(visible);
|
|
5069
|
-
//
|
|
5070
|
-
|
|
5105
|
+
// 关闭下拉框 如果没有选中数据-需要清空查询数据源
|
|
5106
|
+
if (!visible && !(value === null || value === void 0 ? void 0 : value.length)) {
|
|
5107
|
+
setItems([]);
|
|
5108
|
+
setItemsTotal(0);
|
|
5109
|
+
}
|
|
5071
5110
|
};
|
|
5072
5111
|
var renderTable = function renderTable(dataSource) {
|
|
5073
5112
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
@@ -5078,12 +5117,33 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5078
5117
|
}, selectMode ? {
|
|
5079
5118
|
rowSelection: {
|
|
5080
5119
|
type: 'checkbox',
|
|
5120
|
+
columnWidth: '24px',
|
|
5081
5121
|
selectedRowKeys: labelInValue ? value.map(function (s) {
|
|
5082
5122
|
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5083
5123
|
}) : value,
|
|
5084
5124
|
onChange: function onChange(sks, srs) {
|
|
5085
|
-
|
|
5125
|
+
var oldSelect = labelInValue ? value : value.map(function (s) {
|
|
5126
|
+
return {
|
|
5127
|
+
value: s
|
|
5128
|
+
};
|
|
5129
|
+
});
|
|
5130
|
+
var realSrs = getRealStr(oldSelect, srs, srs[0]);
|
|
5131
|
+
onSelectClick(realSrs, dataSource, false);
|
|
5086
5132
|
}
|
|
5133
|
+
},
|
|
5134
|
+
onRow: function onRow(record, rowKey) {
|
|
5135
|
+
return {
|
|
5136
|
+
onClick: function onClick(event) {
|
|
5137
|
+
var oldSelect = labelInValue ? value : value.map(function (s) {
|
|
5138
|
+
return {
|
|
5139
|
+
value: s
|
|
5140
|
+
};
|
|
5141
|
+
});
|
|
5142
|
+
var newSelect = [JSON.parse(JSON.stringify(record))];
|
|
5143
|
+
var srs = getRealStr(oldSelect, newSelect, record);
|
|
5144
|
+
onSelectClick(srs, dataSource, false);
|
|
5145
|
+
} // 点击行
|
|
5146
|
+
};
|
|
5087
5147
|
}
|
|
5088
5148
|
} : {
|
|
5089
5149
|
rowSelection: {
|
|
@@ -5093,11 +5153,10 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5093
5153
|
},
|
|
5094
5154
|
onRow: function onRow(record, rowKey) {
|
|
5095
5155
|
return {
|
|
5096
|
-
|
|
5156
|
+
onClick: function onClick(event) {
|
|
5097
5157
|
var srs = [JSON.parse(JSON.stringify(record))];
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
}
|
|
5158
|
+
onSelectClick(srs, dataSource);
|
|
5159
|
+
} // 点击行
|
|
5101
5160
|
};
|
|
5102
5161
|
}
|
|
5103
5162
|
}), {}, {
|
|
@@ -5250,6 +5309,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5250
5309
|
filterTxt: searchValue
|
|
5251
5310
|
}));
|
|
5252
5311
|
}))), needModalTable && isModalVisible && (/*#__PURE__*/React$1.createElement(Modal, _objectSpread2({
|
|
5312
|
+
maskClosable: false,
|
|
5253
5313
|
destroyOnClose: true,
|
|
5254
5314
|
width: "80%",
|
|
5255
5315
|
title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
|
|
@@ -5265,7 +5325,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5265
5325
|
type: "primary",
|
|
5266
5326
|
loading: confirmLoading,
|
|
5267
5327
|
onClick: handleOk,
|
|
5268
|
-
disabled:
|
|
5328
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5269
5329
|
}, "\u786E\u5B9A")] : null,
|
|
5270
5330
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5271
5331
|
}, (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalProps) || {}), /*#__PURE__*/React$1.createElement("div", {
|
|
@@ -8898,7 +8958,6 @@ function commonFun(type, prefixUrl, parentProps) {
|
|
|
8898
8958
|
modalTableTitle: '选择SKU',
|
|
8899
8959
|
tableSearchForm: tableSearchForm,
|
|
8900
8960
|
isHorizontally: true,
|
|
8901
|
-
modalRadioNeedFooter: true,
|
|
8902
8961
|
tableColumns: [{
|
|
8903
8962
|
title: '序号',
|
|
8904
8963
|
dataIndex: 'keyIndex',
|
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_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: 684px;\n overflow: hidden;\n}\n.
|
|
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_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: 684px;\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 handleSourceName = function handleSourceName(sName) {
|
|
@@ -4129,6 +4129,13 @@ var hasMoreQueryFields = function hasMoreQueryFields(modalTableProps) {
|
|
|
4129
4129
|
var visibleFieldsCount = getVisibleFieldsCount(modalTableProps);
|
|
4130
4130
|
return visibleFieldsCount < (tableSearchForm === null || tableSearchForm === void 0 ? void 0 : tableSearchForm.length);
|
|
4131
4131
|
};
|
|
4132
|
+
var getRealStr = function getRealStr(oldSelect, newSelect, record) {
|
|
4133
|
+
return (oldSelect === null || oldSelect === void 0 ? void 0 : oldSelect.length) ? oldSelect.some(function (o) {
|
|
4134
|
+
return o.value == record.value;
|
|
4135
|
+
}) ? oldSelect.filter(function (s) {
|
|
4136
|
+
return s.value != record.value;
|
|
4137
|
+
}) : [].concat(_toConsumableArray(oldSelect), _toConsumableArray(newSelect)) : newSelect;
|
|
4138
|
+
};
|
|
4132
4139
|
|
|
4133
4140
|
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";
|
|
4134
4141
|
|
|
@@ -4197,15 +4204,15 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4197
4204
|
});
|
|
4198
4205
|
var initPagination = {
|
|
4199
4206
|
showQuickJumper: true,
|
|
4200
|
-
showSizeChanger:
|
|
4207
|
+
showSizeChanger: false,
|
|
4201
4208
|
showTotal: function showTotal(total) {
|
|
4202
4209
|
return "\u5171 ".concat(total, " \u6761");
|
|
4203
|
-
}
|
|
4210
|
+
},
|
|
4211
|
+
pageSize: tableInitPageSize
|
|
4204
4212
|
};
|
|
4205
4213
|
var tableInitPagination = _objectSpread2(_objectSpread2({}, initPagination), {}, {
|
|
4206
4214
|
total: 0,
|
|
4207
|
-
current: 1
|
|
4208
|
-
pageSize: tableInitPageSize
|
|
4215
|
+
current: 1
|
|
4209
4216
|
});
|
|
4210
4217
|
var _useState = React$1.useState([]),
|
|
4211
4218
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -4323,6 +4330,10 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4323
4330
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
4324
4331
|
confirmLoading = _useState42[0],
|
|
4325
4332
|
setConfirmLoading = _useState42[1];
|
|
4333
|
+
var _useState43 = React$1.useState(false),
|
|
4334
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
4335
|
+
modalSearched = _useState44[0],
|
|
4336
|
+
setModalSearched = _useState44[1];
|
|
4326
4337
|
React$1.useImperativeHandle(ref, function () {
|
|
4327
4338
|
return {
|
|
4328
4339
|
refreshDataSource: function refreshDataSource() {
|
|
@@ -4355,6 +4366,13 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4355
4366
|
},
|
|
4356
4367
|
refreshSelectDataSource: function refreshSelectDataSource() {
|
|
4357
4368
|
refreshItems();
|
|
4369
|
+
},
|
|
4370
|
+
handleModalVisible: function handleModalVisible(flag) {
|
|
4371
|
+
if (flag) {
|
|
4372
|
+
showModal();
|
|
4373
|
+
} else {
|
|
4374
|
+
handleCancel();
|
|
4375
|
+
}
|
|
4358
4376
|
}
|
|
4359
4377
|
};
|
|
4360
4378
|
});
|
|
@@ -4642,7 +4660,6 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4642
4660
|
}, [selectBusinessType]);
|
|
4643
4661
|
// 处理键盘事件
|
|
4644
4662
|
var handleKeyPress = function handleKeyPress(event) {
|
|
4645
|
-
console.log(event, '----event');
|
|
4646
4663
|
if ((event.metaKey || event.ctrlKey) && (event.key === 'U' || event.keyCode == 85)) {
|
|
4647
4664
|
// ctrl + U 键 重置
|
|
4648
4665
|
onResetTable();
|
|
@@ -4666,8 +4683,9 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4666
4683
|
};
|
|
4667
4684
|
}, [isModalVisible]);
|
|
4668
4685
|
var showModal = function showModal() {
|
|
4669
|
-
|
|
4670
|
-
|
|
4686
|
+
setSelectOpen(false);
|
|
4687
|
+
setSearchValue('');
|
|
4688
|
+
setModalSearched(false);
|
|
4671
4689
|
setIsModalVisible(true);
|
|
4672
4690
|
// 回显
|
|
4673
4691
|
if (value) {
|
|
@@ -4778,9 +4796,6 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4778
4796
|
var handleCancel = function handleCancel() {
|
|
4779
4797
|
clearModalTable();
|
|
4780
4798
|
setIsModalVisible(false);
|
|
4781
|
-
if (selectMode) {
|
|
4782
|
-
run();
|
|
4783
|
-
}
|
|
4784
4799
|
};
|
|
4785
4800
|
var refreshItems = function refreshItems() {
|
|
4786
4801
|
// 查看是否存在关联值 如果有关联值 就查询 没有就不能查询
|
|
@@ -4809,13 +4824,12 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4809
4824
|
};
|
|
4810
4825
|
var onSearchTable = function onSearchTable() {
|
|
4811
4826
|
var params = form.getFieldsValue();
|
|
4827
|
+
// const isHaveParams = params && Object.keys(params).filter(item => params[item]).length > 0;
|
|
4828
|
+
setModalSearched(true);
|
|
4812
4829
|
setTableFormParams(params);
|
|
4813
4830
|
getData(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
4814
4831
|
pageSize: tableInitPageSize
|
|
4815
4832
|
}), 2);
|
|
4816
|
-
if (selectMode) {
|
|
4817
|
-
getData(params);
|
|
4818
|
-
}
|
|
4819
4833
|
};
|
|
4820
4834
|
var onResetTable = function onResetTable() {
|
|
4821
4835
|
form.resetFields();
|
|
@@ -4903,8 +4917,13 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4903
4917
|
}
|
|
4904
4918
|
};
|
|
4905
4919
|
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
4906
|
-
if (!
|
|
4920
|
+
if (!((selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled) || !items.length && !tableData.length)) {
|
|
4907
4921
|
var srs = [JSON.parse(JSON.stringify(record))];
|
|
4922
|
+
if (selectMode) {
|
|
4923
|
+
var oldSelect = selectedRows;
|
|
4924
|
+
var newSelect = [JSON.parse(JSON.stringify(record))];
|
|
4925
|
+
srs = getRealStr(oldSelect, newSelect, record);
|
|
4926
|
+
}
|
|
4908
4927
|
var sks = srs.map(function (i) {
|
|
4909
4928
|
return i.value;
|
|
4910
4929
|
});
|
|
@@ -4949,7 +4968,10 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4949
4968
|
style: {
|
|
4950
4969
|
width: '100%'
|
|
4951
4970
|
},
|
|
4952
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
4971
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
4972
|
+
onDeselect: function onDeselect(v) {
|
|
4973
|
+
return onSearchTable();
|
|
4974
|
+
}
|
|
4953
4975
|
}, i === null || i === void 0 ? void 0 : (_i$field2 = i.field) === null || _i$field2 === void 0 ? void 0 : _i$field2.props), {}, {
|
|
4954
4976
|
disabled: setDisabled(i.name)
|
|
4955
4977
|
}), (i === null || i === void 0 ? void 0 : (_i$initialSource = i.initialSource) === null || _i$initialSource === void 0 ? void 0 : _i$initialSource.length) && (i === null || i === void 0 ? void 0 : i.initialSource.map(function (m) {
|
|
@@ -5038,9 +5060,12 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5038
5060
|
// bsTableCode={bsTableCode}
|
|
5039
5061
|
// />
|
|
5040
5062
|
var renderShowTable = function renderShowTable(tableList, type) {
|
|
5063
|
+
var _getFormRowInfo2 = getFormRowInfo(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
|
|
5064
|
+
totalRows = _getFormRowInfo2.totalRows;
|
|
5065
|
+
var tableBoxHeighth = 548 - totalRows * 10;
|
|
5041
5066
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5042
5067
|
style: {
|
|
5043
|
-
height:
|
|
5068
|
+
height: "".concat(tableBoxHeighth, "px")
|
|
5044
5069
|
}
|
|
5045
5070
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({
|
|
5046
5071
|
bordered: true,
|
|
@@ -5049,11 +5074,17 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5049
5074
|
columns: tableShowColumns,
|
|
5050
5075
|
dataSource: tableList
|
|
5051
5076
|
}, type == 'noPage' ? {
|
|
5052
|
-
pagination: initPagination
|
|
5077
|
+
pagination: initPagination,
|
|
5078
|
+
locale: {
|
|
5079
|
+
emptyText: '暂无已选结果'
|
|
5080
|
+
}
|
|
5053
5081
|
} : {
|
|
5054
5082
|
pagination: tablePagination,
|
|
5055
5083
|
onChange: handleTableChange,
|
|
5056
|
-
loading: fetching
|
|
5084
|
+
loading: fetching,
|
|
5085
|
+
locale: {
|
|
5086
|
+
emptyText: modalSearched ? '无匹配结果,请更换其他内容再试' : '请输入搜索条件'
|
|
5087
|
+
}
|
|
5057
5088
|
}), {}, {
|
|
5058
5089
|
rowKey: mappingValueField,
|
|
5059
5090
|
scroll: {
|
|
@@ -5087,10 +5118,18 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5087
5118
|
var onClear = function onClear() {
|
|
5088
5119
|
formaData([], items);
|
|
5089
5120
|
};
|
|
5121
|
+
var onSelectClick = function onSelectClick(srs, ds) {
|
|
5122
|
+
var nr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
5123
|
+
formaData(srs, ds);
|
|
5124
|
+
nr && setSelectOpen(false);
|
|
5125
|
+
};
|
|
5090
5126
|
var onDropdownVisibleChange = function onDropdownVisibleChange(visible) {
|
|
5091
5127
|
setSelectOpen(visible);
|
|
5092
|
-
//
|
|
5093
|
-
|
|
5128
|
+
// 关闭下拉框 如果没有选中数据-需要清空查询数据源
|
|
5129
|
+
if (!visible && !(value === null || value === void 0 ? void 0 : value.length)) {
|
|
5130
|
+
setItems([]);
|
|
5131
|
+
setItemsTotal(0);
|
|
5132
|
+
}
|
|
5094
5133
|
};
|
|
5095
5134
|
var renderTable = function renderTable(dataSource) {
|
|
5096
5135
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -5101,12 +5140,33 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5101
5140
|
}, selectMode ? {
|
|
5102
5141
|
rowSelection: {
|
|
5103
5142
|
type: 'checkbox',
|
|
5143
|
+
columnWidth: '24px',
|
|
5104
5144
|
selectedRowKeys: labelInValue ? value.map(function (s) {
|
|
5105
5145
|
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5106
5146
|
}) : value,
|
|
5107
5147
|
onChange: function onChange(sks, srs) {
|
|
5108
|
-
|
|
5148
|
+
var oldSelect = labelInValue ? value : value.map(function (s) {
|
|
5149
|
+
return {
|
|
5150
|
+
value: s
|
|
5151
|
+
};
|
|
5152
|
+
});
|
|
5153
|
+
var realSrs = getRealStr(oldSelect, srs, srs[0]);
|
|
5154
|
+
onSelectClick(realSrs, dataSource, false);
|
|
5109
5155
|
}
|
|
5156
|
+
},
|
|
5157
|
+
onRow: function onRow(record, rowKey) {
|
|
5158
|
+
return {
|
|
5159
|
+
onClick: function onClick(event) {
|
|
5160
|
+
var oldSelect = labelInValue ? value : value.map(function (s) {
|
|
5161
|
+
return {
|
|
5162
|
+
value: s
|
|
5163
|
+
};
|
|
5164
|
+
});
|
|
5165
|
+
var newSelect = [JSON.parse(JSON.stringify(record))];
|
|
5166
|
+
var srs = getRealStr(oldSelect, newSelect, record);
|
|
5167
|
+
onSelectClick(srs, dataSource, false);
|
|
5168
|
+
} // 点击行
|
|
5169
|
+
};
|
|
5110
5170
|
}
|
|
5111
5171
|
} : {
|
|
5112
5172
|
rowSelection: {
|
|
@@ -5116,11 +5176,10 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5116
5176
|
},
|
|
5117
5177
|
onRow: function onRow(record, rowKey) {
|
|
5118
5178
|
return {
|
|
5119
|
-
|
|
5179
|
+
onClick: function onClick(event) {
|
|
5120
5180
|
var srs = [JSON.parse(JSON.stringify(record))];
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
}
|
|
5181
|
+
onSelectClick(srs, dataSource);
|
|
5182
|
+
} // 点击行
|
|
5124
5183
|
};
|
|
5125
5184
|
}
|
|
5126
5185
|
}), {}, {
|
|
@@ -5273,6 +5332,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5273
5332
|
filterTxt: searchValue
|
|
5274
5333
|
}));
|
|
5275
5334
|
}))), needModalTable && isModalVisible && (/*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2({
|
|
5335
|
+
maskClosable: false,
|
|
5276
5336
|
destroyOnClose: true,
|
|
5277
5337
|
width: "80%",
|
|
5278
5338
|
title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
|
|
@@ -5288,7 +5348,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5288
5348
|
type: "primary",
|
|
5289
5349
|
loading: confirmLoading,
|
|
5290
5350
|
onClick: handleOk,
|
|
5291
|
-
disabled:
|
|
5351
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5292
5352
|
}, "\u786E\u5B9A")] : null,
|
|
5293
5353
|
wrapClassName: 'search_select_modal_wrapper'
|
|
5294
5354
|
}, (modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalProps) || {}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -8921,7 +8981,6 @@ function commonFun(type, prefixUrl, parentProps) {
|
|
|
8921
8981
|
modalTableTitle: '选择SKU',
|
|
8922
8982
|
tableSearchForm: tableSearchForm,
|
|
8923
8983
|
isHorizontally: true,
|
|
8924
|
-
modalRadioNeedFooter: true,
|
|
8925
8984
|
tableColumns: [{
|
|
8926
8985
|
title: '序号',
|
|
8927
8986
|
dataIndex: 'keyIndex',
|
package/package.json
CHANGED
|
@@ -115,6 +115,11 @@ export default () => {
|
|
|
115
115
|
const selectPropsMultiple = {
|
|
116
116
|
mode: 'multiple',
|
|
117
117
|
maxTagCount: 1,
|
|
118
|
+
onSaveCallback: (rows) => {
|
|
119
|
+
console.log('save call', rows);
|
|
120
|
+
return Promise.resolve(true);
|
|
121
|
+
// return Promise.reject('FAILE')
|
|
122
|
+
}
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
const singleConfirmModalTableProps = {
|
|
@@ -146,11 +151,6 @@ export default () => {
|
|
|
146
151
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
147
152
|
selectProps,
|
|
148
153
|
selectBusinessType: 'skuCommodity',
|
|
149
|
-
onSaveCallback: (rows) => {
|
|
150
|
-
console.log('save call', rows);
|
|
151
|
-
return Promise.resolve(true);
|
|
152
|
-
// return Promise.reject('FAILE')
|
|
153
|
-
}
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
const onTabChange = (key) => {
|
|
@@ -95,13 +95,24 @@
|
|
|
95
95
|
height: 684px;
|
|
96
96
|
overflow: hidden;
|
|
97
97
|
}
|
|
98
|
+
.ant-modal-footer {
|
|
99
|
+
.ant-btn.ant-btn-default {
|
|
100
|
+
color: @primary-color;
|
|
101
|
+
border-color: @primary-color;
|
|
102
|
+
}
|
|
103
|
+
.ant-btn-primary,.ant-btn-primary[disabled] {
|
|
104
|
+
background: @primary-color;
|
|
105
|
+
border-color: @primary-color;
|
|
106
|
+
}
|
|
107
|
+
.ant-btn-primary[disabled] {
|
|
108
|
+
opacity: .5;
|
|
109
|
+
color: #fff;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
98
112
|
}
|
|
99
113
|
|
|
100
114
|
&_wrapper {
|
|
101
115
|
position: relative;
|
|
102
|
-
min-height: 80vh;
|
|
103
|
-
max-height: 80vh;
|
|
104
|
-
overflow: hidden;
|
|
105
116
|
font-size: 14px;
|
|
106
117
|
|
|
107
118
|
&_topForm {
|
|
@@ -115,7 +126,7 @@
|
|
|
115
126
|
display: flex;
|
|
116
127
|
align-items: flex-start;
|
|
117
128
|
|
|
118
|
-
.ant-row .ant-form-item {
|
|
129
|
+
.ant-row .ant-form-item, .ant-row .ant-col .ant-space {
|
|
119
130
|
font-size: 12px !important;
|
|
120
131
|
margin-right: 0px !important;
|
|
121
132
|
margin-bottom: 8px !important;
|
|
@@ -8,7 +8,7 @@ import { stringify } from 'querystring';
|
|
|
8
8
|
import _, { escapeRegExp, isNil, values } from "lodash"
|
|
9
9
|
import './index.less';
|
|
10
10
|
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
|
-
import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount } from './utils';
|
|
11
|
+
import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr } from './utils';
|
|
12
12
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
13
13
|
import zhankaitiaojian from '../../../assets/zhankaitiaojian-icon.svg';
|
|
14
14
|
|
|
@@ -68,8 +68,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
68
68
|
optionLabelProp: "label",
|
|
69
69
|
autoClearSearchValue: false
|
|
70
70
|
}
|
|
71
|
-
const initPagination = { showQuickJumper: true, showSizeChanger:
|
|
72
|
-
const tableInitPagination = { ...initPagination, total: 0, current: 1
|
|
71
|
+
const initPagination = { showQuickJumper: true, showSizeChanger: false, showTotal: (total: any) => `共 ${total} 条`, pageSize: tableInitPageSize }
|
|
72
|
+
const tableInitPagination = { ...initPagination, total: 0, current: 1 }
|
|
73
73
|
|
|
74
74
|
const [items, setItems] = useState([]);
|
|
75
75
|
const [selectOpen, setSelectOpen] = useState(false);
|
|
@@ -119,6 +119,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
119
119
|
const [tooltipVisible, setTooltipVisible] = useState(false);
|
|
120
120
|
const [tableShowColumns, setTabletShowColumns] = useState(modalTableProps?.tableColumns?.filter(s => typeof s.defaultSort == 'number')?.sort((a,b)=> a.defaultSort-b.defaultSort)||[]);
|
|
121
121
|
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
122
|
+
const [modalSearched, setModalSearched]=useState(false);
|
|
122
123
|
|
|
123
124
|
useImperativeHandle(ref, () => ({
|
|
124
125
|
refreshDataSource: (reset: boolean = false) => {
|
|
@@ -146,6 +147,9 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
146
147
|
},
|
|
147
148
|
refreshSelectDataSource: () => {
|
|
148
149
|
refreshItems()
|
|
150
|
+
},
|
|
151
|
+
handleModalVisible: (flag) => {
|
|
152
|
+
if (flag) { showModal(); } else { handleCancel(); }
|
|
149
153
|
}
|
|
150
154
|
}))
|
|
151
155
|
|
|
@@ -453,7 +457,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
453
457
|
|
|
454
458
|
// 处理键盘事件
|
|
455
459
|
const handleKeyPress = (event) => {
|
|
456
|
-
console.log(event,'----event')
|
|
457
460
|
if ((event.metaKey || event.ctrlKey) && (event.key === 'U' || event.keyCode == 85)) {
|
|
458
461
|
// ctrl + U 键 重置
|
|
459
462
|
onResetTable()
|
|
@@ -478,8 +481,10 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
478
481
|
},[isModalVisible])
|
|
479
482
|
|
|
480
483
|
const showModal = () => {
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
setSelectOpen(false)
|
|
485
|
+
setSearchValue('');
|
|
486
|
+
setModalSearched(false);
|
|
487
|
+
|
|
483
488
|
setIsModalVisible(true);
|
|
484
489
|
// 回显
|
|
485
490
|
if (value) {
|
|
@@ -566,9 +571,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
566
571
|
const handleCancel = () => {
|
|
567
572
|
clearModalTable();
|
|
568
573
|
setIsModalVisible(false);
|
|
569
|
-
if (selectMode) {
|
|
570
|
-
run();
|
|
571
|
-
}
|
|
572
574
|
};
|
|
573
575
|
|
|
574
576
|
const refreshItems = () => {
|
|
@@ -598,11 +600,12 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
598
600
|
|
|
599
601
|
const onSearchTable = () => {
|
|
600
602
|
const params = form.getFieldsValue();
|
|
603
|
+
|
|
604
|
+
// const isHaveParams = params && Object.keys(params).filter(item => params[item]).length > 0;
|
|
605
|
+
setModalSearched(true);
|
|
606
|
+
|
|
601
607
|
setTableFormParams(params);
|
|
602
608
|
getData({ ...params, pageSize: tableInitPageSize }, 2)
|
|
603
|
-
if (selectMode) {
|
|
604
|
-
getData(params)
|
|
605
|
-
}
|
|
606
609
|
}
|
|
607
610
|
|
|
608
611
|
const onResetTable = () => {
|
|
@@ -701,9 +704,15 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
701
704
|
};
|
|
702
705
|
|
|
703
706
|
const onDoubleClickSelect = (e, record) => {
|
|
704
|
-
if (!
|
|
705
|
-
|
|
707
|
+
if (!(selectProps?.disabled || props?.disabled || (!items.length && !tableData.length))) {
|
|
708
|
+
let srs = [JSON.parse(JSON.stringify(record))]
|
|
709
|
+
if(selectMode) {
|
|
710
|
+
const oldSelect = selectedRows;
|
|
711
|
+
const newSelect = [JSON.parse(JSON.stringify(record))];
|
|
712
|
+
srs = getRealStr(oldSelect,newSelect,record);
|
|
713
|
+
}
|
|
706
714
|
const sks = srs.map((i: any) => i.value)
|
|
715
|
+
|
|
707
716
|
onChangeSelectedKeys(sks, srs)
|
|
708
717
|
}
|
|
709
718
|
}
|
|
@@ -729,7 +738,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
729
738
|
return (
|
|
730
739
|
<Col span={ColSpan} key={i.name}>
|
|
731
740
|
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
732
|
-
<Select style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props} disabled={setDisabled(i.name)}>
|
|
741
|
+
<Select style={{ width: '100%' }} placeholder='请选择' onDeselect ={v => onSearchTable()} {...i?.field?.props} disabled={setDisabled(i.name)}>
|
|
733
742
|
{i?.initialSource?.length && i?.initialSource.map((m: any) => (
|
|
734
743
|
<Option value={m.value} key={m.value}>{m.text}</Option>
|
|
735
744
|
))}
|
|
@@ -800,9 +809,11 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
800
809
|
// bsTableCode={bsTableCode}
|
|
801
810
|
// />
|
|
802
811
|
|
|
803
|
-
const renderShowTable = (tableList, type
|
|
812
|
+
const renderShowTable = (tableList, type) => {
|
|
813
|
+
const { totalRows } = getFormRowInfo(modalTableProps?.tableSearchForm);
|
|
814
|
+
const tableBoxHeighth = 548 - totalRows*10;
|
|
804
815
|
return (
|
|
805
|
-
<div style={{ height:
|
|
816
|
+
<div style={{ height: `${tableBoxHeighth}px` }}>
|
|
806
817
|
<Table
|
|
807
818
|
bordered
|
|
808
819
|
size="middle"
|
|
@@ -810,11 +821,17 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
810
821
|
columns={tableShowColumns}
|
|
811
822
|
dataSource={tableList}
|
|
812
823
|
{...type=='noPage'?{
|
|
813
|
-
pagination: initPagination
|
|
824
|
+
pagination: initPagination,
|
|
825
|
+
locale: {
|
|
826
|
+
emptyText: '暂无已选结果',
|
|
827
|
+
}
|
|
814
828
|
}:{
|
|
815
829
|
pagination: tablePagination,
|
|
816
830
|
onChange: handleTableChange,
|
|
817
|
-
loading: fetching
|
|
831
|
+
loading: fetching,
|
|
832
|
+
locale: {
|
|
833
|
+
emptyText: modalSearched? '无匹配结果,请更换其他内容再试' : '请输入搜索条件',
|
|
834
|
+
}
|
|
818
835
|
}}
|
|
819
836
|
rowKey={mappingValueField}
|
|
820
837
|
scroll={{
|
|
@@ -842,11 +859,18 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
842
859
|
const onClear = () => {
|
|
843
860
|
formaData([], items);
|
|
844
861
|
}
|
|
862
|
+
const onSelectClick = (srs, ds,nr=true) => {
|
|
863
|
+
formaData(srs, ds);
|
|
864
|
+
nr && setSelectOpen(false);
|
|
865
|
+
}
|
|
845
866
|
|
|
846
867
|
const onDropdownVisibleChange = (visible) => {
|
|
847
868
|
setSelectOpen(visible);
|
|
848
|
-
//
|
|
849
|
-
|
|
869
|
+
// 关闭下拉框 如果没有选中数据-需要清空查询数据源
|
|
870
|
+
if (!visible && !value?.length) {
|
|
871
|
+
setItems([]);
|
|
872
|
+
setItemsTotal(0);
|
|
873
|
+
}
|
|
850
874
|
}
|
|
851
875
|
const renderTable = (dataSource) => {
|
|
852
876
|
return (
|
|
@@ -857,11 +881,22 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
857
881
|
{...(selectMode?{
|
|
858
882
|
rowSelection: {
|
|
859
883
|
type: 'checkbox',
|
|
884
|
+
columnWidth: '24px',
|
|
860
885
|
selectedRowKeys: labelInValue ? value.map(s=> (s?.value||s)) : value,
|
|
861
886
|
onChange: (sks, srs) => {
|
|
862
|
-
|
|
887
|
+
const oldSelect = labelInValue ? value : value.map(s => ({ value: s }));
|
|
888
|
+
const realSrs = getRealStr(oldSelect,srs,srs[0]);
|
|
889
|
+
onSelectClick(realSrs, dataSource,false)
|
|
863
890
|
}
|
|
864
|
-
}
|
|
891
|
+
},
|
|
892
|
+
onRow: (record, rowKey) => ({
|
|
893
|
+
onClick: event => {
|
|
894
|
+
const oldSelect = labelInValue ? value : value.map(s => ({ value: s }));
|
|
895
|
+
const newSelect = [JSON.parse(JSON.stringify(record))];
|
|
896
|
+
const srs = getRealStr(oldSelect,newSelect,record);
|
|
897
|
+
onSelectClick(srs,dataSource,false)
|
|
898
|
+
}, // 点击行
|
|
899
|
+
})
|
|
865
900
|
}:{
|
|
866
901
|
rowSelection: {
|
|
867
902
|
type: 'radio',
|
|
@@ -869,11 +904,10 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
869
904
|
selectedRowKeys: labelInValue ? value?.value&&[value?.value]||[] : value&&[value]||[],
|
|
870
905
|
},
|
|
871
906
|
onRow: (record, rowKey) => ({
|
|
872
|
-
|
|
907
|
+
onClick: event => {
|
|
873
908
|
const srs = [JSON.parse(JSON.stringify(record))]
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
},
|
|
909
|
+
onSelectClick(srs,dataSource)
|
|
910
|
+
}, // 点击行
|
|
877
911
|
})
|
|
878
912
|
})}
|
|
879
913
|
columns={selectProps?.renderTableColumns||[]}
|
|
@@ -1009,6 +1043,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1009
1043
|
)}
|
|
1010
1044
|
{needModalTable && isModalVisible && (
|
|
1011
1045
|
<Modal
|
|
1046
|
+
maskClosable={false}
|
|
1012
1047
|
destroyOnClose
|
|
1013
1048
|
width="80%"
|
|
1014
1049
|
title={modalTableProps?.modalTableTitle}
|
|
@@ -1027,11 +1062,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
1027
1062
|
type="primary"
|
|
1028
1063
|
loading={confirmLoading}
|
|
1029
1064
|
onClick={handleOk}
|
|
1030
|
-
disabled={
|
|
1031
|
-
!tableData.length ||
|
|
1032
|
-
selectProps?.disabled ||
|
|
1033
|
-
props?.disabled
|
|
1034
|
-
}
|
|
1065
|
+
disabled={selectProps?.disabled || props?.disabled}
|
|
1035
1066
|
>
|
|
1036
1067
|
确定
|
|
1037
1068
|
</Button>,
|
|
@@ -24,4 +24,8 @@ export const hasMoreQueryFields = (modalTableProps: any) => {
|
|
|
24
24
|
const { tableSearchForm } = modalTableProps || {}
|
|
25
25
|
const visibleFieldsCount = getVisibleFieldsCount(modalTableProps);
|
|
26
26
|
return visibleFieldsCount < tableSearchForm?.length;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const getRealStr = (oldSelect: any,newSelect: any, record: any) => {
|
|
30
|
+
return oldSelect?.length ? oldSelect.some((o: any) => o.value == record.value) ? oldSelect.filter((s: any) => s.value != record.value) : [...oldSelect,...newSelect] : newSelect;
|
|
27
31
|
}
|