@bit-sun/business-component 4.0.12-alpha.11 → 4.0.12-alpha.13
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 +2 -0
- package/dist/index.esm.js +135 -68
- package/dist/index.js +135 -68
- package/package.json +1 -1
- package/src/components/Functional/SearchSelect/index.less +8 -0
- package/src/components/Functional/SearchSelect/index.tsx +49 -14
- package/src/components/Functional/SearchSelect/utils.ts +37 -1
|
@@ -10,3 +10,5 @@ export declare const getVisibleFieldsCount: (modalTableProps: any) => any;
|
|
|
10
10
|
export declare const hasMoreQueryFields: (modalTableProps: any) => boolean;
|
|
11
11
|
export declare const getRealStr: (oldSelect: any, newSelect: any, record: any) => any;
|
|
12
12
|
export declare const getTableHeigth: (list: any) => number;
|
|
13
|
+
export declare const getCurrentSRKs: (selectMode: any, labelInValue: boolean, value: any) => any;
|
|
14
|
+
export declare const getRenderSource: (currentSRKs: any, items: any) => any;
|
package/dist/index.esm.js
CHANGED
|
@@ -4075,7 +4075,7 @@ function ToCDB(str) {
|
|
|
4075
4075
|
return tmp;
|
|
4076
4076
|
}
|
|
4077
4077
|
|
|
4078
|
-
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-dropdown {\n top: 24px !important;\n width: calc(150%) !important;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_show .ant-select-multiple.ant-select-show-arrow .ant-select-selector,\n.search_select_show .ant-select-multiple.ant-select-allow-clear .ant-select-selector {\n padding-right: 28px;\n}\n.search_select_show.search_select_show_list .ant-select-dropdown {\n top: 24px !important;\n width: calc(141%) !important;\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 border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\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: calc(100vh - 235px);\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";
|
|
4078
|
+
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-dropdown {\n top: 24px !important;\n width: calc(150%) !important;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_show .ant-select-multiple.ant-select-show-arrow .ant-select-selector,\n.search_select_show .ant-select-multiple.ant-select-allow-clear .ant-select-selector {\n padding-right: 28px;\n}\n.search_select_show.search_select_show_list .ant-select-dropdown {\n top: 24px !important;\n width: calc(141%) !important;\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 border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\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: calc(100vh - 235px);\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.searchSelectMaxTagToolTip .ant-tooltip-inner {\n max-height: 72px;\n overflow-x: auto;\n padding: 0px;\n}\n";
|
|
4079
4079
|
styleInject(css_248z$5);
|
|
4080
4080
|
|
|
4081
4081
|
var columnsPerRow = 4; // 每行的列数
|
|
@@ -4083,6 +4083,7 @@ var ColSpan = 6; // 查询条件 每行col = 24 /columnsPerRow
|
|
|
4083
4083
|
var handleSourceName = function handleSourceName(sName) {
|
|
4084
4084
|
return sName;
|
|
4085
4085
|
};
|
|
4086
|
+
// ------------------------------------------处理样式相关--开始----------------------------------------
|
|
4086
4087
|
var getFormRowInfo = function getFormRowInfo(list) {
|
|
4087
4088
|
var totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
|
|
4088
4089
|
var lastRowColumns = (list.length + 1) % columnsPerRow; // 计算最后一行的实际列数
|
|
@@ -4123,6 +4124,36 @@ var getTableHeigth = function getTableHeigth(list) {
|
|
|
4123
4124
|
if (totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
|
|
4124
4125
|
return 411 - totalRows * 10;
|
|
4125
4126
|
};
|
|
4127
|
+
// ------------------------------------------处理样式相关--结束----------------------------------------
|
|
4128
|
+
// ------------------------------------------处理数据相关--开始----------------------------------------
|
|
4129
|
+
var getCurrentSRKs = function getCurrentSRKs(selectMode, labelInValue, value) {
|
|
4130
|
+
return selectMode ? labelInValue ? value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
4131
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
4132
|
+
}) : value : labelInValue ? (value === null || value === void 0 ? void 0 : value.value) && [value === null || value === void 0 ? void 0 : value.value] || [] : value && [value] || [];
|
|
4133
|
+
};
|
|
4134
|
+
var getRenderSource = function getRenderSource(currentSRKs, items) {
|
|
4135
|
+
// 判空处理
|
|
4136
|
+
if (!(currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.length)) return items || [];
|
|
4137
|
+
// 创建映射对象 用于记录原始选中顺序
|
|
4138
|
+
var orderMap = new Map();
|
|
4139
|
+
currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.forEach(function (value, index) {
|
|
4140
|
+
orderMap.set(value, index);
|
|
4141
|
+
});
|
|
4142
|
+
// 被选中数据集合,获取之后排序
|
|
4143
|
+
var selectedOption = (items === null || items === void 0 ? void 0 : items.filter(function (option) {
|
|
4144
|
+
return currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value);
|
|
4145
|
+
})) || [];
|
|
4146
|
+
var selectedOptionSort = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.sort(function (a, b) {
|
|
4147
|
+
var _orderMap$get, _orderMap$get2;
|
|
4148
|
+
return ((_orderMap$get = orderMap.get(a.value)) !== null && _orderMap$get !== void 0 ? _orderMap$get : Infinity) - ((_orderMap$get2 = orderMap.get(b.value)) !== null && _orderMap$get2 !== void 0 ? _orderMap$get2 : Infinity);
|
|
4149
|
+
})) || [];
|
|
4150
|
+
// 未选中数据集合
|
|
4151
|
+
var otherOptions = (items === null || items === void 0 ? void 0 : items.filter(function (option) {
|
|
4152
|
+
return !(currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value));
|
|
4153
|
+
})) || [];
|
|
4154
|
+
return [].concat(_toConsumableArray(selectedOptionSort), _toConsumableArray(otherOptions));
|
|
4155
|
+
};
|
|
4156
|
+
// ------------------------------------------处理数据相关--结束----------------------------------------
|
|
4126
4157
|
|
|
4127
4158
|
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";
|
|
4128
4159
|
|
|
@@ -4228,34 +4259,38 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4228
4259
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
4229
4260
|
selectOpen = _useState4[0],
|
|
4230
4261
|
setSelectOpen = _useState4[1];
|
|
4231
|
-
var _useState5 = useState(
|
|
4262
|
+
var _useState5 = useState(false),
|
|
4232
4263
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
var _useState7 = useState(
|
|
4264
|
+
isMaxTagsOpen = _useState6[0],
|
|
4265
|
+
setIsMaxTagsOpen = _useState6[1];
|
|
4266
|
+
var _useState7 = useState(1),
|
|
4236
4267
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
var _useState9 = useState(
|
|
4268
|
+
scrollPage = _useState8[0],
|
|
4269
|
+
setScrollPage = _useState8[1];
|
|
4270
|
+
var _useState9 = useState(0),
|
|
4240
4271
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
var _useState11 = useState(
|
|
4272
|
+
itemsTotal = _useState10[0],
|
|
4273
|
+
setItemsTotal = _useState10[1];
|
|
4274
|
+
var _useState11 = useState(false),
|
|
4244
4275
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
var _useState13 = useState(
|
|
4276
|
+
fetching = _useState12[0],
|
|
4277
|
+
setFetching = _useState12[1];
|
|
4278
|
+
var _useState13 = useState(''),
|
|
4248
4279
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
var _useState15 = useState(
|
|
4280
|
+
searchValue = _useState14[0],
|
|
4281
|
+
setSearchValue = _useState14[1];
|
|
4282
|
+
var _useState15 = useState(false),
|
|
4252
4283
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
var _useState17 = useState(
|
|
4284
|
+
isModalVisible = _useState16[0],
|
|
4285
|
+
setIsModalVisible = _useState16[1];
|
|
4286
|
+
var _useState17 = useState(initVal),
|
|
4256
4287
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
4257
|
-
|
|
4258
|
-
|
|
4288
|
+
popvalue = _useState18[0],
|
|
4289
|
+
setPopValue = _useState18[1];
|
|
4290
|
+
var _useState19 = useState(resultSourceKey),
|
|
4291
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4292
|
+
uniqueValue = _useState20[0],
|
|
4293
|
+
setUniqueValue = _useState20[1];
|
|
4259
4294
|
var _useDebounceFn = useDebounceFn(function (v) {
|
|
4260
4295
|
// 优化搜索参数 支持传多个
|
|
4261
4296
|
var searchParams = {};
|
|
@@ -4284,62 +4319,62 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4284
4319
|
var _Form$useForm = Form.useForm(),
|
|
4285
4320
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
4286
4321
|
form = _Form$useForm2[0];
|
|
4287
|
-
var _useState19 = useState(true),
|
|
4288
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
4289
|
-
collapsed = _useState20[0],
|
|
4290
|
-
setCollapsed = _useState20[1];
|
|
4291
4322
|
var _useState21 = useState(true),
|
|
4292
4323
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
var _useState23 = useState(
|
|
4324
|
+
collapsed = _useState22[0],
|
|
4325
|
+
setCollapsed = _useState22[1];
|
|
4326
|
+
var _useState23 = useState(true),
|
|
4296
4327
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
var _useState25 = useState(
|
|
4328
|
+
caretLeftFlag = _useState24[0],
|
|
4329
|
+
setCaretLeftFlag = _useState24[1];
|
|
4330
|
+
var _useState25 = useState([]),
|
|
4300
4331
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
var _useState27 = useState(
|
|
4332
|
+
tableData = _useState26[0],
|
|
4333
|
+
setTableData = _useState26[1];
|
|
4334
|
+
var _useState27 = useState(tableInitPagination),
|
|
4304
4335
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
4305
|
-
|
|
4306
|
-
|
|
4336
|
+
tablePagination = _useState28[0],
|
|
4337
|
+
setTablePagination = _useState28[1];
|
|
4307
4338
|
var _useState29 = useState([]),
|
|
4308
4339
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
var _useState31 = useState(
|
|
4340
|
+
selectedRowKeys = _useState30[0],
|
|
4341
|
+
setSelectedRowKeys = _useState30[1];
|
|
4342
|
+
var _useState31 = useState([]),
|
|
4312
4343
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
4313
|
-
|
|
4314
|
-
|
|
4344
|
+
selectedRows = _useState32[0],
|
|
4345
|
+
setSelectedRows = _useState32[1];
|
|
4315
4346
|
var _useState33 = useState(false),
|
|
4316
4347
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
var _useState35 = useState(
|
|
4348
|
+
checkedAll = _useState34[0],
|
|
4349
|
+
setCheckedAll = _useState34[1];
|
|
4350
|
+
var _useState35 = useState(false),
|
|
4320
4351
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
var _useState37 = useState(
|
|
4352
|
+
indeterminate = _useState36[0],
|
|
4353
|
+
setIndeterminate = _useState36[1];
|
|
4354
|
+
var _useState37 = useState({}),
|
|
4324
4355
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
var _useState39 = useState(
|
|
4356
|
+
tableFormParams = _useState38[0],
|
|
4357
|
+
setTableFormParams = _useState38[1];
|
|
4358
|
+
var _useState39 = useState(false),
|
|
4359
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
4360
|
+
tooltipVisible = _useState40[0],
|
|
4361
|
+
setTooltipVisible = _useState40[1];
|
|
4362
|
+
var _useState41 = useState((modalTableProps === null || modalTableProps === void 0 ? void 0 : (_modalTableProps$tabl = modalTableProps.tableColumns) === null || _modalTableProps$tabl === void 0 ? void 0 : (_modalTableProps$tabl2 = _modalTableProps$tabl.filter(function (s) {
|
|
4328
4363
|
return typeof s.defaultSort == 'number';
|
|
4329
4364
|
})) === null || _modalTableProps$tabl2 === void 0 ? void 0 : _modalTableProps$tabl2.sort(function (a, b) {
|
|
4330
4365
|
return a.defaultSort - b.defaultSort;
|
|
4331
4366
|
})) || []),
|
|
4332
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
4333
|
-
tableShowColumns = _useState40[0],
|
|
4334
|
-
setTabletShowColumns = _useState40[1];
|
|
4335
|
-
var _useState41 = useState(false),
|
|
4336
4367
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
4337
|
-
|
|
4338
|
-
|
|
4368
|
+
tableShowColumns = _useState42[0],
|
|
4369
|
+
setTabletShowColumns = _useState42[1];
|
|
4339
4370
|
var _useState43 = useState(false),
|
|
4340
4371
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
4341
|
-
|
|
4342
|
-
|
|
4372
|
+
confirmLoading = _useState44[0],
|
|
4373
|
+
setConfirmLoading = _useState44[1];
|
|
4374
|
+
var _useState45 = useState(false),
|
|
4375
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
4376
|
+
modalSearched = _useState46[0],
|
|
4377
|
+
setModalSearched = _useState46[1];
|
|
4343
4378
|
var setSelectDataSource = function setSelectDataSource(list, total) {
|
|
4344
4379
|
setItems(list);
|
|
4345
4380
|
setItemsTotal(total);
|
|
@@ -4588,6 +4623,19 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
4588
4623
|
});
|
|
4589
4624
|
})) : [];
|
|
4590
4625
|
}
|
|
4626
|
+
// 补充搜索项--选中的数据添加到数据源中去
|
|
4627
|
+
var currentSRKs = getCurrentSRKs(selectMode, labelInValue, value);
|
|
4628
|
+
if ((currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.length) && (currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.some(function (s) {
|
|
4629
|
+
var _source;
|
|
4630
|
+
return !((_source = source) === null || _source === void 0 ? void 0 : _source.find(function (r) {
|
|
4631
|
+
return r.value == s;
|
|
4632
|
+
}));
|
|
4633
|
+
}))) {
|
|
4634
|
+
var selectedOption = items.filter(function (option) {
|
|
4635
|
+
return currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value);
|
|
4636
|
+
}) || [];
|
|
4637
|
+
source = (source || []).concat(selectedOption);
|
|
4638
|
+
}
|
|
4591
4639
|
// 数据源 不可以有重复key
|
|
4592
4640
|
source = Array.isArray(source) ? _.uniqBy(source, 'value') : [];
|
|
4593
4641
|
if (callback) {
|
|
@@ -5165,13 +5213,20 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5165
5213
|
nr && setSelectOpen(false);
|
|
5166
5214
|
};
|
|
5167
5215
|
var onDropdownVisibleChange = function onDropdownVisibleChange(visible) {
|
|
5216
|
+
// 阻止maxTagPlaceholder点击事件触发下拉框展示事件
|
|
5217
|
+
if (isMaxTagsOpen && !selectOpen) return;
|
|
5168
5218
|
setSelectOpen(visible);
|
|
5169
5219
|
// 关闭下拉框 如果首次本身就不展示数据的 没有选中数据-需要清空查询数据源; 首次展示的默认展示
|
|
5170
5220
|
if (!visible && !(value === null || value === void 0 ? void 0 : value.length)) {
|
|
5171
|
-
|
|
5221
|
+
setTimeout(function () {
|
|
5222
|
+
// 延时 是为了避免 执行时候出现下拉框弹两次的问题-可以看到数据源从展示到显示空数据框的问题
|
|
5223
|
+
resetSelectDataSource();
|
|
5224
|
+
}, 200);
|
|
5172
5225
|
}
|
|
5173
5226
|
};
|
|
5174
5227
|
var renderTable = function renderTable(dataSource) {
|
|
5228
|
+
var currentSRKs = getCurrentSRKs(selectMode, labelInValue, value);
|
|
5229
|
+
var renderSource = getRenderSource(currentSRKs, items);
|
|
5175
5230
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
5176
5231
|
className: "search_select_dropdown_table ".concat(!selectMode ? 'search_select_dropdown_table1' : '')
|
|
5177
5232
|
}, /*#__PURE__*/React$1.createElement(Table, _objectSpread2(_objectSpread2({
|
|
@@ -5181,9 +5236,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5181
5236
|
rowSelection: {
|
|
5182
5237
|
type: 'checkbox',
|
|
5183
5238
|
columnWidth: '24px',
|
|
5184
|
-
selectedRowKeys:
|
|
5185
|
-
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5186
|
-
}) : value,
|
|
5239
|
+
selectedRowKeys: currentSRKs,
|
|
5187
5240
|
preserveSelectedRowKeys: true,
|
|
5188
5241
|
onChange: function onChange(sks, srs) {
|
|
5189
5242
|
var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
@@ -5224,7 +5277,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5224
5277
|
rowSelection: {
|
|
5225
5278
|
type: 'radio',
|
|
5226
5279
|
columnWidth: 0,
|
|
5227
|
-
selectedRowKeys:
|
|
5280
|
+
selectedRowKeys: currentSRKs
|
|
5228
5281
|
},
|
|
5229
5282
|
onRow: function onRow(record, rowKey) {
|
|
5230
5283
|
return {
|
|
@@ -5236,7 +5289,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5236
5289
|
}
|
|
5237
5290
|
}), {}, {
|
|
5238
5291
|
columns: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.renderTableColumns) || [],
|
|
5239
|
-
dataSource:
|
|
5292
|
+
dataSource: renderSource,
|
|
5240
5293
|
size: "middle",
|
|
5241
5294
|
pagination: false,
|
|
5242
5295
|
rowKey: mappingValueField,
|
|
@@ -5257,20 +5310,34 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
5257
5310
|
onChange(newValue);
|
|
5258
5311
|
};
|
|
5259
5312
|
return /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
5260
|
-
|
|
5313
|
+
overlayClassName: 'searchSelectMaxTagToolTip',
|
|
5314
|
+
destroyTooltipOnHide: true,
|
|
5315
|
+
placement: "topRight",
|
|
5316
|
+
autoAdjustOverflow: false,
|
|
5317
|
+
title: (/*#__PURE__*/React$1.createElement("div", {
|
|
5318
|
+
style: {
|
|
5319
|
+
margin: '6px 8px 0px'
|
|
5320
|
+
},
|
|
5321
|
+
onMouseEnter: function onMouseEnter() {
|
|
5322
|
+
setIsMaxTagsOpen(true);
|
|
5323
|
+
},
|
|
5324
|
+
onMouseLeave: function onMouseLeave() {
|
|
5325
|
+
setIsMaxTagsOpen(false);
|
|
5326
|
+
}
|
|
5327
|
+
}, selectedValues.map(function (i) {
|
|
5261
5328
|
return /*#__PURE__*/React$1.createElement(Tag, {
|
|
5262
5329
|
closable: true,
|
|
5263
5330
|
onClose: function onClose(e) {
|
|
5264
5331
|
return _onClose(e, i);
|
|
5265
5332
|
},
|
|
5266
5333
|
style: {
|
|
5267
|
-
|
|
5334
|
+
margin: '0px 3px 3px 0px',
|
|
5268
5335
|
background: '#f5f5f5',
|
|
5269
5336
|
height: '24px',
|
|
5270
5337
|
border: '1px solid #f0f0f0'
|
|
5271
5338
|
}
|
|
5272
5339
|
}, i.label);
|
|
5273
|
-
})
|
|
5340
|
+
})))
|
|
5274
5341
|
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
5275
5342
|
};
|
|
5276
5343
|
var handleSelectOptionsShowValue = function handleSelectOptionsShowValue(specialBracket, noNeedSplit, item) {
|
package/dist/index.js
CHANGED
|
@@ -4098,7 +4098,7 @@ function ToCDB(str) {
|
|
|
4098
4098
|
return tmp;
|
|
4099
4099
|
}
|
|
4100
4100
|
|
|
4101
|
-
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-dropdown {\n top: 24px !important;\n width: calc(150%) !important;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_show .ant-select-multiple.ant-select-show-arrow .ant-select-selector,\n.search_select_show .ant-select-multiple.ant-select-allow-clear .ant-select-selector {\n padding-right: 28px;\n}\n.search_select_show.search_select_show_list .ant-select-dropdown {\n top: 24px !important;\n width: calc(141%) !important;\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 border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\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: calc(100vh - 235px);\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";
|
|
4101
|
+
var css_248z$5 = ".search_select_show {\n display: flex;\n}\n.search_select_show .ant-select-dropdown {\n top: 24px !important;\n width: calc(150%) !important;\n}\n.search_select_show .ant-select-clear {\n right: 33px;\n}\n.search_select_show .ant-select-multiple.ant-select-show-arrow .ant-select-selector,\n.search_select_show .ant-select-multiple.ant-select-allow-clear .ant-select-selector {\n padding-right: 28px;\n}\n.search_select_show.search_select_show_list .ant-select-dropdown {\n top: 24px !important;\n width: calc(141%) !important;\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 border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\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: calc(100vh - 235px);\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.searchSelectMaxTagToolTip .ant-tooltip-inner {\n max-height: 72px;\n overflow-x: auto;\n padding: 0px;\n}\n";
|
|
4102
4102
|
styleInject(css_248z$5);
|
|
4103
4103
|
|
|
4104
4104
|
var columnsPerRow = 4; // 每行的列数
|
|
@@ -4106,6 +4106,7 @@ var ColSpan = 6; // 查询条件 每行col = 24 /columnsPerRow
|
|
|
4106
4106
|
var handleSourceName = function handleSourceName(sName) {
|
|
4107
4107
|
return sName;
|
|
4108
4108
|
};
|
|
4109
|
+
// ------------------------------------------处理样式相关--开始----------------------------------------
|
|
4109
4110
|
var getFormRowInfo = function getFormRowInfo(list) {
|
|
4110
4111
|
var totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
|
|
4111
4112
|
var lastRowColumns = (list.length + 1) % columnsPerRow; // 计算最后一行的实际列数
|
|
@@ -4146,6 +4147,36 @@ var getTableHeigth = function getTableHeigth(list) {
|
|
|
4146
4147
|
if (totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
|
|
4147
4148
|
return 411 - totalRows * 10;
|
|
4148
4149
|
};
|
|
4150
|
+
// ------------------------------------------处理样式相关--结束----------------------------------------
|
|
4151
|
+
// ------------------------------------------处理数据相关--开始----------------------------------------
|
|
4152
|
+
var getCurrentSRKs = function getCurrentSRKs(selectMode, labelInValue, value) {
|
|
4153
|
+
return selectMode ? labelInValue ? value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
4154
|
+
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
4155
|
+
}) : value : labelInValue ? (value === null || value === void 0 ? void 0 : value.value) && [value === null || value === void 0 ? void 0 : value.value] || [] : value && [value] || [];
|
|
4156
|
+
};
|
|
4157
|
+
var getRenderSource = function getRenderSource(currentSRKs, items) {
|
|
4158
|
+
// 判空处理
|
|
4159
|
+
if (!(currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.length)) return items || [];
|
|
4160
|
+
// 创建映射对象 用于记录原始选中顺序
|
|
4161
|
+
var orderMap = new Map();
|
|
4162
|
+
currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.forEach(function (value, index) {
|
|
4163
|
+
orderMap.set(value, index);
|
|
4164
|
+
});
|
|
4165
|
+
// 被选中数据集合,获取之后排序
|
|
4166
|
+
var selectedOption = (items === null || items === void 0 ? void 0 : items.filter(function (option) {
|
|
4167
|
+
return currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value);
|
|
4168
|
+
})) || [];
|
|
4169
|
+
var selectedOptionSort = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.sort(function (a, b) {
|
|
4170
|
+
var _orderMap$get, _orderMap$get2;
|
|
4171
|
+
return ((_orderMap$get = orderMap.get(a.value)) !== null && _orderMap$get !== void 0 ? _orderMap$get : Infinity) - ((_orderMap$get2 = orderMap.get(b.value)) !== null && _orderMap$get2 !== void 0 ? _orderMap$get2 : Infinity);
|
|
4172
|
+
})) || [];
|
|
4173
|
+
// 未选中数据集合
|
|
4174
|
+
var otherOptions = (items === null || items === void 0 ? void 0 : items.filter(function (option) {
|
|
4175
|
+
return !(currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value));
|
|
4176
|
+
})) || [];
|
|
4177
|
+
return [].concat(_toConsumableArray(selectedOptionSort), _toConsumableArray(otherOptions));
|
|
4178
|
+
};
|
|
4179
|
+
// ------------------------------------------处理数据相关--结束----------------------------------------
|
|
4149
4180
|
|
|
4150
4181
|
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";
|
|
4151
4182
|
|
|
@@ -4251,34 +4282,38 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4251
4282
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
4252
4283
|
selectOpen = _useState4[0],
|
|
4253
4284
|
setSelectOpen = _useState4[1];
|
|
4254
|
-
var _useState5 = React$1.useState(
|
|
4285
|
+
var _useState5 = React$1.useState(false),
|
|
4255
4286
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
var _useState7 = React$1.useState(
|
|
4287
|
+
isMaxTagsOpen = _useState6[0],
|
|
4288
|
+
setIsMaxTagsOpen = _useState6[1];
|
|
4289
|
+
var _useState7 = React$1.useState(1),
|
|
4259
4290
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
var _useState9 = React$1.useState(
|
|
4291
|
+
scrollPage = _useState8[0],
|
|
4292
|
+
setScrollPage = _useState8[1];
|
|
4293
|
+
var _useState9 = React$1.useState(0),
|
|
4263
4294
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
var _useState11 = React$1.useState(
|
|
4295
|
+
itemsTotal = _useState10[0],
|
|
4296
|
+
setItemsTotal = _useState10[1];
|
|
4297
|
+
var _useState11 = React$1.useState(false),
|
|
4267
4298
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
var _useState13 = React$1.useState(
|
|
4299
|
+
fetching = _useState12[0],
|
|
4300
|
+
setFetching = _useState12[1];
|
|
4301
|
+
var _useState13 = React$1.useState(''),
|
|
4271
4302
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
var _useState15 = React$1.useState(
|
|
4303
|
+
searchValue = _useState14[0],
|
|
4304
|
+
setSearchValue = _useState14[1];
|
|
4305
|
+
var _useState15 = React$1.useState(false),
|
|
4275
4306
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
var _useState17 = React$1.useState(
|
|
4307
|
+
isModalVisible = _useState16[0],
|
|
4308
|
+
setIsModalVisible = _useState16[1];
|
|
4309
|
+
var _useState17 = React$1.useState(initVal),
|
|
4279
4310
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
4280
|
-
|
|
4281
|
-
|
|
4311
|
+
popvalue = _useState18[0],
|
|
4312
|
+
setPopValue = _useState18[1];
|
|
4313
|
+
var _useState19 = React$1.useState(resultSourceKey),
|
|
4314
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4315
|
+
uniqueValue = _useState20[0],
|
|
4316
|
+
setUniqueValue = _useState20[1];
|
|
4282
4317
|
var _useDebounceFn = ahooks.useDebounceFn(function (v) {
|
|
4283
4318
|
// 优化搜索参数 支持传多个
|
|
4284
4319
|
var searchParams = {};
|
|
@@ -4307,62 +4342,62 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4307
4342
|
var _Form$useForm = antd.Form.useForm(),
|
|
4308
4343
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
4309
4344
|
form = _Form$useForm2[0];
|
|
4310
|
-
var _useState19 = React$1.useState(true),
|
|
4311
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
4312
|
-
collapsed = _useState20[0],
|
|
4313
|
-
setCollapsed = _useState20[1];
|
|
4314
4345
|
var _useState21 = React$1.useState(true),
|
|
4315
4346
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
var _useState23 = React$1.useState(
|
|
4347
|
+
collapsed = _useState22[0],
|
|
4348
|
+
setCollapsed = _useState22[1];
|
|
4349
|
+
var _useState23 = React$1.useState(true),
|
|
4319
4350
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
var _useState25 = React$1.useState(
|
|
4351
|
+
caretLeftFlag = _useState24[0],
|
|
4352
|
+
setCaretLeftFlag = _useState24[1];
|
|
4353
|
+
var _useState25 = React$1.useState([]),
|
|
4323
4354
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
var _useState27 = React$1.useState(
|
|
4355
|
+
tableData = _useState26[0],
|
|
4356
|
+
setTableData = _useState26[1];
|
|
4357
|
+
var _useState27 = React$1.useState(tableInitPagination),
|
|
4327
4358
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
4328
|
-
|
|
4329
|
-
|
|
4359
|
+
tablePagination = _useState28[0],
|
|
4360
|
+
setTablePagination = _useState28[1];
|
|
4330
4361
|
var _useState29 = React$1.useState([]),
|
|
4331
4362
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
var _useState31 = React$1.useState(
|
|
4363
|
+
selectedRowKeys = _useState30[0],
|
|
4364
|
+
setSelectedRowKeys = _useState30[1];
|
|
4365
|
+
var _useState31 = React$1.useState([]),
|
|
4335
4366
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
4336
|
-
|
|
4337
|
-
|
|
4367
|
+
selectedRows = _useState32[0],
|
|
4368
|
+
setSelectedRows = _useState32[1];
|
|
4338
4369
|
var _useState33 = React$1.useState(false),
|
|
4339
4370
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
var _useState35 = React$1.useState(
|
|
4371
|
+
checkedAll = _useState34[0],
|
|
4372
|
+
setCheckedAll = _useState34[1];
|
|
4373
|
+
var _useState35 = React$1.useState(false),
|
|
4343
4374
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
var _useState37 = React$1.useState(
|
|
4375
|
+
indeterminate = _useState36[0],
|
|
4376
|
+
setIndeterminate = _useState36[1];
|
|
4377
|
+
var _useState37 = React$1.useState({}),
|
|
4347
4378
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
var _useState39 = React$1.useState(
|
|
4379
|
+
tableFormParams = _useState38[0],
|
|
4380
|
+
setTableFormParams = _useState38[1];
|
|
4381
|
+
var _useState39 = React$1.useState(false),
|
|
4382
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
4383
|
+
tooltipVisible = _useState40[0],
|
|
4384
|
+
setTooltipVisible = _useState40[1];
|
|
4385
|
+
var _useState41 = React$1.useState((modalTableProps === null || modalTableProps === void 0 ? void 0 : (_modalTableProps$tabl = modalTableProps.tableColumns) === null || _modalTableProps$tabl === void 0 ? void 0 : (_modalTableProps$tabl2 = _modalTableProps$tabl.filter(function (s) {
|
|
4351
4386
|
return typeof s.defaultSort == 'number';
|
|
4352
4387
|
})) === null || _modalTableProps$tabl2 === void 0 ? void 0 : _modalTableProps$tabl2.sort(function (a, b) {
|
|
4353
4388
|
return a.defaultSort - b.defaultSort;
|
|
4354
4389
|
})) || []),
|
|
4355
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
4356
|
-
tableShowColumns = _useState40[0],
|
|
4357
|
-
setTabletShowColumns = _useState40[1];
|
|
4358
|
-
var _useState41 = React$1.useState(false),
|
|
4359
4390
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
4360
|
-
|
|
4361
|
-
|
|
4391
|
+
tableShowColumns = _useState42[0],
|
|
4392
|
+
setTabletShowColumns = _useState42[1];
|
|
4362
4393
|
var _useState43 = React$1.useState(false),
|
|
4363
4394
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
4364
|
-
|
|
4365
|
-
|
|
4395
|
+
confirmLoading = _useState44[0],
|
|
4396
|
+
setConfirmLoading = _useState44[1];
|
|
4397
|
+
var _useState45 = React$1.useState(false),
|
|
4398
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
4399
|
+
modalSearched = _useState46[0],
|
|
4400
|
+
setModalSearched = _useState46[1];
|
|
4366
4401
|
var setSelectDataSource = function setSelectDataSource(list, total) {
|
|
4367
4402
|
setItems(list);
|
|
4368
4403
|
setItemsTotal(total);
|
|
@@ -4611,6 +4646,19 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
4611
4646
|
});
|
|
4612
4647
|
})) : [];
|
|
4613
4648
|
}
|
|
4649
|
+
// 补充搜索项--选中的数据添加到数据源中去
|
|
4650
|
+
var currentSRKs = getCurrentSRKs(selectMode, labelInValue, value);
|
|
4651
|
+
if ((currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.length) && (currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.some(function (s) {
|
|
4652
|
+
var _source;
|
|
4653
|
+
return !((_source = source) === null || _source === void 0 ? void 0 : _source.find(function (r) {
|
|
4654
|
+
return r.value == s;
|
|
4655
|
+
}));
|
|
4656
|
+
}))) {
|
|
4657
|
+
var selectedOption = items.filter(function (option) {
|
|
4658
|
+
return currentSRKs === null || currentSRKs === void 0 ? void 0 : currentSRKs.includes(option.value);
|
|
4659
|
+
}) || [];
|
|
4660
|
+
source = (source || []).concat(selectedOption);
|
|
4661
|
+
}
|
|
4614
4662
|
// 数据源 不可以有重复key
|
|
4615
4663
|
source = Array.isArray(source) ? ___default['default'].uniqBy(source, 'value') : [];
|
|
4616
4664
|
if (callback) {
|
|
@@ -5188,13 +5236,20 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5188
5236
|
nr && setSelectOpen(false);
|
|
5189
5237
|
};
|
|
5190
5238
|
var onDropdownVisibleChange = function onDropdownVisibleChange(visible) {
|
|
5239
|
+
// 阻止maxTagPlaceholder点击事件触发下拉框展示事件
|
|
5240
|
+
if (isMaxTagsOpen && !selectOpen) return;
|
|
5191
5241
|
setSelectOpen(visible);
|
|
5192
5242
|
// 关闭下拉框 如果首次本身就不展示数据的 没有选中数据-需要清空查询数据源; 首次展示的默认展示
|
|
5193
5243
|
if (!visible && !(value === null || value === void 0 ? void 0 : value.length)) {
|
|
5194
|
-
|
|
5244
|
+
setTimeout(function () {
|
|
5245
|
+
// 延时 是为了避免 执行时候出现下拉框弹两次的问题-可以看到数据源从展示到显示空数据框的问题
|
|
5246
|
+
resetSelectDataSource();
|
|
5247
|
+
}, 200);
|
|
5195
5248
|
}
|
|
5196
5249
|
};
|
|
5197
5250
|
var renderTable = function renderTable(dataSource) {
|
|
5251
|
+
var currentSRKs = getCurrentSRKs(selectMode, labelInValue, value);
|
|
5252
|
+
var renderSource = getRenderSource(currentSRKs, items);
|
|
5198
5253
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5199
5254
|
className: "search_select_dropdown_table ".concat(!selectMode ? 'search_select_dropdown_table1' : '')
|
|
5200
5255
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({
|
|
@@ -5204,9 +5259,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5204
5259
|
rowSelection: {
|
|
5205
5260
|
type: 'checkbox',
|
|
5206
5261
|
columnWidth: '24px',
|
|
5207
|
-
selectedRowKeys:
|
|
5208
|
-
return (s === null || s === void 0 ? void 0 : s.value) || s;
|
|
5209
|
-
}) : value,
|
|
5262
|
+
selectedRowKeys: currentSRKs,
|
|
5210
5263
|
preserveSelectedRowKeys: true,
|
|
5211
5264
|
onChange: function onChange(sks, srs) {
|
|
5212
5265
|
var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
|
|
@@ -5247,7 +5300,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5247
5300
|
rowSelection: {
|
|
5248
5301
|
type: 'radio',
|
|
5249
5302
|
columnWidth: 0,
|
|
5250
|
-
selectedRowKeys:
|
|
5303
|
+
selectedRowKeys: currentSRKs
|
|
5251
5304
|
},
|
|
5252
5305
|
onRow: function onRow(record, rowKey) {
|
|
5253
5306
|
return {
|
|
@@ -5259,7 +5312,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5259
5312
|
}
|
|
5260
5313
|
}), {}, {
|
|
5261
5314
|
columns: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.renderTableColumns) || [],
|
|
5262
|
-
dataSource:
|
|
5315
|
+
dataSource: renderSource,
|
|
5263
5316
|
size: "middle",
|
|
5264
5317
|
pagination: false,
|
|
5265
5318
|
rowKey: mappingValueField,
|
|
@@ -5280,20 +5333,34 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
|
|
|
5280
5333
|
onChange(newValue);
|
|
5281
5334
|
};
|
|
5282
5335
|
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
5283
|
-
|
|
5336
|
+
overlayClassName: 'searchSelectMaxTagToolTip',
|
|
5337
|
+
destroyTooltipOnHide: true,
|
|
5338
|
+
placement: "topRight",
|
|
5339
|
+
autoAdjustOverflow: false,
|
|
5340
|
+
title: (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
5341
|
+
style: {
|
|
5342
|
+
margin: '6px 8px 0px'
|
|
5343
|
+
},
|
|
5344
|
+
onMouseEnter: function onMouseEnter() {
|
|
5345
|
+
setIsMaxTagsOpen(true);
|
|
5346
|
+
},
|
|
5347
|
+
onMouseLeave: function onMouseLeave() {
|
|
5348
|
+
setIsMaxTagsOpen(false);
|
|
5349
|
+
}
|
|
5350
|
+
}, selectedValues.map(function (i) {
|
|
5284
5351
|
return /*#__PURE__*/React__default['default'].createElement(antd.Tag, {
|
|
5285
5352
|
closable: true,
|
|
5286
5353
|
onClose: function onClose(e) {
|
|
5287
5354
|
return _onClose(e, i);
|
|
5288
5355
|
},
|
|
5289
5356
|
style: {
|
|
5290
|
-
|
|
5357
|
+
margin: '0px 3px 3px 0px',
|
|
5291
5358
|
background: '#f5f5f5',
|
|
5292
5359
|
height: '24px',
|
|
5293
5360
|
border: '1px solid #f0f0f0'
|
|
5294
5361
|
}
|
|
5295
5362
|
}, i.label);
|
|
5296
|
-
})
|
|
5363
|
+
})))
|
|
5297
5364
|
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
5298
5365
|
};
|
|
5299
5366
|
var handleSelectOptionsShowValue = function handleSelectOptionsShowValue(specialBracket, noNeedSplit, item) {
|
package/package.json
CHANGED
|
@@ -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, getRealStr, ColSpan, getTableHeigth } from './utils';
|
|
11
|
+
import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, ColSpan, getTableHeigth, getCurrentSRKs, getRenderSource } from './utils';
|
|
12
12
|
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
13
13
|
import zhankaitiaojian from '../../../assets/zhankaitiaojian-icon.svg';
|
|
14
14
|
|
|
@@ -92,6 +92,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
92
92
|
|
|
93
93
|
const [items, setItems] = useState([]);
|
|
94
94
|
const [selectOpen, setSelectOpen] = useState(false);
|
|
95
|
+
const [isMaxTagsOpen, setIsMaxTagsOpen] = useState(false);
|
|
95
96
|
const [scrollPage, setScrollPage] = useState(1);
|
|
96
97
|
const [itemsTotal, setItemsTotal] = useState(0);
|
|
97
98
|
const [fetching, setFetching] = useState(false);
|
|
@@ -403,8 +404,15 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
403
404
|
})
|
|
404
405
|
: [];
|
|
405
406
|
}
|
|
407
|
+
// 补充搜索项--选中的数据添加到数据源中去
|
|
408
|
+
const currentSRKs = getCurrentSRKs(selectMode,labelInValue,value)
|
|
409
|
+
if(currentSRKs?.length && currentSRKs?.some(s=> !source?.find(r=> r.value==s))) {
|
|
410
|
+
const selectedOption = items.filter(option => currentSRKs?.includes(option.value))||[];
|
|
411
|
+
source = (source||[]).concat(selectedOption)
|
|
412
|
+
}
|
|
406
413
|
// 数据源 不可以有重复key
|
|
407
414
|
source = Array.isArray(source) ? _.uniqBy(source, 'value') : [];
|
|
415
|
+
|
|
408
416
|
if(callback) {
|
|
409
417
|
callback(source)
|
|
410
418
|
} else {
|
|
@@ -915,13 +923,22 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
915
923
|
}
|
|
916
924
|
|
|
917
925
|
const onDropdownVisibleChange = (visible) => {
|
|
926
|
+
// 阻止maxTagPlaceholder点击事件触发下拉框展示事件
|
|
927
|
+
if(isMaxTagsOpen && !selectOpen) return;
|
|
928
|
+
|
|
918
929
|
setSelectOpen(visible);
|
|
919
930
|
// 关闭下拉框 如果首次本身就不展示数据的 没有选中数据-需要清空查询数据源; 首次展示的默认展示
|
|
920
931
|
if (!visible && !value?.length) {
|
|
921
|
-
|
|
932
|
+
setTimeout(() => {
|
|
933
|
+
// 延时 是为了避免 执行时候出现下拉框弹两次的问题-可以看到数据源从展示到显示空数据框的问题
|
|
934
|
+
resetSelectDataSource()
|
|
935
|
+
}, 200)
|
|
922
936
|
}
|
|
923
937
|
}
|
|
924
938
|
const renderTable = (dataSource) => {
|
|
939
|
+
const currentSRKs = getCurrentSRKs(selectMode,labelInValue,value)
|
|
940
|
+
const renderSource = getRenderSource(currentSRKs,items)
|
|
941
|
+
|
|
925
942
|
return (
|
|
926
943
|
<div className={`search_select_dropdown_table ${!selectMode?'search_select_dropdown_table1':''}`}>
|
|
927
944
|
<Table
|
|
@@ -931,7 +948,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
931
948
|
rowSelection: {
|
|
932
949
|
type: 'checkbox',
|
|
933
950
|
columnWidth: '24px',
|
|
934
|
-
selectedRowKeys:
|
|
951
|
+
selectedRowKeys: currentSRKs,
|
|
935
952
|
preserveSelectedRowKeys: true, // 避免搜索之后 没有了选中前的数据 保证sks的正确性
|
|
936
953
|
onChange: (sks, srs) => {
|
|
937
954
|
const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
|
|
@@ -955,7 +972,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
955
972
|
rowSelection: {
|
|
956
973
|
type: 'radio',
|
|
957
974
|
columnWidth: 0,
|
|
958
|
-
selectedRowKeys:
|
|
975
|
+
selectedRowKeys: currentSRKs,
|
|
959
976
|
},
|
|
960
977
|
onRow: (record, rowKey) => ({
|
|
961
978
|
onClick: event => {
|
|
@@ -965,7 +982,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
965
982
|
})
|
|
966
983
|
})}
|
|
967
984
|
columns={selectProps?.renderTableColumns||[]}
|
|
968
|
-
dataSource={
|
|
985
|
+
dataSource={renderSource}
|
|
969
986
|
size="middle"
|
|
970
987
|
pagination={false}
|
|
971
988
|
rowKey={mappingValueField}
|
|
@@ -982,15 +999,33 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
982
999
|
onChange(newValue);
|
|
983
1000
|
}
|
|
984
1001
|
return (
|
|
985
|
-
<Tooltip
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1002
|
+
<Tooltip
|
|
1003
|
+
overlayClassName='searchSelectMaxTagToolTip'
|
|
1004
|
+
destroyTooltipOnHide
|
|
1005
|
+
placement="topRight"
|
|
1006
|
+
autoAdjustOverflow={false}
|
|
1007
|
+
title={(
|
|
1008
|
+
<div
|
|
1009
|
+
style={{ margin: '6px 8px 0px' }}
|
|
1010
|
+
onMouseEnter={() => {
|
|
1011
|
+
setIsMaxTagsOpen(true)
|
|
1012
|
+
}}
|
|
1013
|
+
onMouseLeave={() => {
|
|
1014
|
+
setIsMaxTagsOpen(false)
|
|
1015
|
+
}}
|
|
1016
|
+
>
|
|
1017
|
+
{selectedValues.map((i: any) => (
|
|
1018
|
+
<Tag
|
|
1019
|
+
closable={true}
|
|
1020
|
+
onClose={(e) => onClose(e, i)}
|
|
1021
|
+
style={{ margin: '0px 3px 3px 0px', background: '#f5f5f5', height: '24px', border: '1px solid #f0f0f0' }}
|
|
1022
|
+
>
|
|
1023
|
+
{i.label}
|
|
1024
|
+
</Tag>
|
|
1025
|
+
))}
|
|
1026
|
+
</div>
|
|
1027
|
+
)}
|
|
1028
|
+
>
|
|
994
1029
|
{`+ ${selectedValues?.length}`}
|
|
995
1030
|
</Tooltip>
|
|
996
1031
|
)
|
|
@@ -4,6 +4,7 @@ export const handleSourceName = (sName: any) => {
|
|
|
4
4
|
return sName
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
// ------------------------------------------处理样式相关--开始----------------------------------------
|
|
7
8
|
export const getFormRowInfo = (list: any) => {
|
|
8
9
|
const totalRows = Math.ceil(list.length / columnsPerRow); // 计算总行数
|
|
9
10
|
const lastRowColumns = (list.length+1) % columnsPerRow; // 计算最后一行的实际列数
|
|
@@ -35,4 +36,39 @@ export const getTableHeigth = (list: any) => {
|
|
|
35
36
|
const totalRows = Math.ceil((list?.length+1) / 4);
|
|
36
37
|
if(totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
|
|
37
38
|
return 411 - totalRows*10
|
|
38
|
-
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ------------------------------------------处理样式相关--结束----------------------------------------
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// ------------------------------------------处理数据相关--开始----------------------------------------
|
|
45
|
+
export const getCurrentSRKs = (selectMode: any,labelInValue:boolean,value: any) => {
|
|
46
|
+
return selectMode ? (labelInValue ? value?.map((s: any)=> (s?.value||s)) : value) : (labelInValue ? value?.value&&[value?.value]||[] : value&&[value]||[])
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const getRenderSource = (currentSRKs: any, items: any) => {
|
|
50
|
+
// 判空处理
|
|
51
|
+
if(!currentSRKs?.length) return items||[];
|
|
52
|
+
|
|
53
|
+
// 创建映射对象 用于记录原始选中顺序
|
|
54
|
+
const orderMap = new Map<number, number>();
|
|
55
|
+
currentSRKs?.forEach((value: any, index: number) => {
|
|
56
|
+
orderMap.set(value, index);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// 被选中数据集合,获取之后排序
|
|
60
|
+
const selectedOption = items?.filter((option: any) => currentSRKs?.includes(option.value))||[];
|
|
61
|
+
const selectedOptionSort = selectedOption?.sort((a: any, b: any) => {
|
|
62
|
+
return (orderMap.get(a.value) ?? Infinity) - (orderMap.get(b.value) ?? Infinity);
|
|
63
|
+
})||[];
|
|
64
|
+
|
|
65
|
+
// 未选中数据集合
|
|
66
|
+
const otherOptions = items?.filter((option: any) => !currentSRKs?.includes(option.value))||[];
|
|
67
|
+
|
|
68
|
+
return [
|
|
69
|
+
...selectedOptionSort,
|
|
70
|
+
...otherOptions
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ------------------------------------------处理数据相关--结束----------------------------------------
|