@bit-sun/business-component 1.1.3 → 1.1.7
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/SearchSelect/business/BusinessSearchSelect.d.ts +2 -0
- package/dist/components/SearchSelect/business/BusinessUtils.d.ts +22 -0
- package/dist/components/SearchSelect/index.d.ts +1 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +492 -168
- package/dist/index.js +492 -167
- package/package.json +1 -1
- package/src/components/SearchSelect/business/BusinessSearchSelect.tsx +25 -0
- package/src/components/SearchSelect/business/BusinessUtils.ts +210 -0
- package/src/components/SearchSelect/business/index.md +56 -0
- package/src/components/SearchSelect/index.md +23 -15
- package/src/components/SearchSelect/index.tsx +166 -94
- package/src/index.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -78,14 +78,14 @@ function _inherits(subClass, superClass) {
|
|
|
78
78
|
throw new TypeError("Super expression must either be null or a function");
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
82
|
+
constructor: {
|
|
83
|
+
value: subClass,
|
|
84
|
+
writable: true,
|
|
85
|
+
configurable: true
|
|
86
|
+
}
|
|
87
|
+
});
|
|
81
88
|
Object.defineProperty(subClass, "prototype", {
|
|
82
|
-
value: Object.create(superClass && superClass.prototype, {
|
|
83
|
-
constructor: {
|
|
84
|
-
value: subClass,
|
|
85
|
-
writable: true,
|
|
86
|
-
configurable: true
|
|
87
|
-
}
|
|
88
|
-
}),
|
|
89
89
|
writable: false
|
|
90
90
|
});
|
|
91
91
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
@@ -1265,6 +1265,14 @@ function injectCSS(css) {
|
|
|
1265
1265
|
return styleNode;
|
|
1266
1266
|
}
|
|
1267
1267
|
var containerCache = new Map();
|
|
1268
|
+
|
|
1269
|
+
function findExistNode(key) {
|
|
1270
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1271
|
+
var container = getContainer(option);
|
|
1272
|
+
return Array.from(containerCache.get(container).children).find(function (node) {
|
|
1273
|
+
return node.tagName === 'STYLE' && node[MARK_KEY] === key;
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1268
1276
|
function updateCSS(css, key) {
|
|
1269
1277
|
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1270
1278
|
var container = getContainer(option); // Get real parent
|
|
@@ -1276,9 +1284,7 @@ function updateCSS(css, key) {
|
|
|
1276
1284
|
parentNode.removeChild(placeholderStyle);
|
|
1277
1285
|
}
|
|
1278
1286
|
|
|
1279
|
-
var existNode =
|
|
1280
|
-
return node.tagName === 'STYLE' && node[MARK_KEY] === key;
|
|
1281
|
-
});
|
|
1287
|
+
var existNode = findExistNode(key, option);
|
|
1282
1288
|
|
|
1283
1289
|
if (existNode) {
|
|
1284
1290
|
var _option$csp3, _option$csp4;
|
|
@@ -2416,26 +2422,31 @@ function getStorageVale(storageKeyString) {
|
|
|
2416
2422
|
var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper _right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
|
|
2417
2423
|
styleInject(css_248z$2);
|
|
2418
2424
|
|
|
2419
|
-
var Option = Select.Option;
|
|
2420
|
-
|
|
2421
|
-
var SearchSelect = function SearchSelect(
|
|
2422
|
-
var
|
|
2423
|
-
|
|
2424
|
-
selectProps =
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2425
|
+
var Option = Select.Option;
|
|
2426
|
+
|
|
2427
|
+
var SearchSelect = function SearchSelect(props) {
|
|
2428
|
+
var value = props.value,
|
|
2429
|
+
onChange = props.onChange,
|
|
2430
|
+
_props$selectProps = props.selectProps,
|
|
2431
|
+
selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
|
|
2432
|
+
_props$modalTableProp = props.modalTableProps,
|
|
2433
|
+
modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
|
|
2434
|
+
_props$labelInValue = props.labelInValue,
|
|
2435
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
2436
|
+
requestConfig = props.requestConfig,
|
|
2437
|
+
ctx = props.ctx;
|
|
2429
2438
|
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
2430
2439
|
|
|
2431
|
-
var initVal =
|
|
2440
|
+
var initVal = value || (selectMode ? [] : null);
|
|
2432
2441
|
var pageSize = 100; // 下拉框默认分页 条数
|
|
2433
2442
|
|
|
2434
2443
|
var tableInitPageSize = 10; // 弹框默认分页 条数
|
|
2435
2444
|
|
|
2436
2445
|
var currentPage = 1;
|
|
2446
|
+
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
2437
2447
|
|
|
2438
2448
|
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
2449
|
+
// 以下属性不可更改----设计配置项
|
|
2439
2450
|
showSearch: false,
|
|
2440
2451
|
filterOption: false,
|
|
2441
2452
|
allowClear: true,
|
|
@@ -2476,19 +2487,26 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2476
2487
|
|
|
2477
2488
|
var _useState13 = useState(initVal),
|
|
2478
2489
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
var _useState15 = useState(initVal),
|
|
2483
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
2484
|
-
popvalue = _useState16[0],
|
|
2485
|
-
setPopValue = _useState16[1];
|
|
2490
|
+
popvalue = _useState14[0],
|
|
2491
|
+
setPopValue = _useState14[1];
|
|
2486
2492
|
|
|
2487
2493
|
var _useDebounceFn = useDebounceFn(function () {
|
|
2494
|
+
// 优化搜索参数 支持传多个
|
|
2495
|
+
var searchParams = {};
|
|
2496
|
+
|
|
2497
|
+
if (typeof selectParamsKey === 'string') {
|
|
2498
|
+
searchParams = _defineProperty({}, selectParamsKey, searchValue);
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
if (Array.isArray(selectParamsKey)) {
|
|
2502
|
+
selectParamsKey.forEach(function (i) {
|
|
2503
|
+
searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
|
|
2504
|
+
});
|
|
2505
|
+
} // 防抖函数 待定
|
|
2506
|
+
|
|
2507
|
+
|
|
2488
2508
|
// 防抖函数 待定
|
|
2489
|
-
getData(
|
|
2490
|
-
'qp-name-like': searchValue
|
|
2491
|
-
});
|
|
2509
|
+
getData(searchParams);
|
|
2492
2510
|
}, {
|
|
2493
2511
|
wait: 1000
|
|
2494
2512
|
}),
|
|
@@ -2498,73 +2516,92 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2498
2516
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
2499
2517
|
form = _Form$useForm2[0];
|
|
2500
2518
|
|
|
2501
|
-
var
|
|
2502
|
-
|
|
2503
|
-
caretLeftFlag =
|
|
2504
|
-
setCaretLeftFlag =
|
|
2519
|
+
var _useState15 = useState(true),
|
|
2520
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
2521
|
+
caretLeftFlag = _useState16[0],
|
|
2522
|
+
setCaretLeftFlag = _useState16[1];
|
|
2505
2523
|
|
|
2506
|
-
var
|
|
2507
|
-
|
|
2508
|
-
tableData =
|
|
2509
|
-
setTableData =
|
|
2524
|
+
var _useState17 = useState([]),
|
|
2525
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
2526
|
+
tableData = _useState18[0],
|
|
2527
|
+
setTableData = _useState18[1];
|
|
2510
2528
|
|
|
2511
|
-
var
|
|
2529
|
+
var _useState19 = useState({
|
|
2512
2530
|
showQuickJumper: true,
|
|
2513
2531
|
total: 0,
|
|
2514
2532
|
current: 1,
|
|
2515
2533
|
pageSize: tableInitPageSize
|
|
2516
2534
|
}),
|
|
2535
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
2536
|
+
tablePagination = _useState20[0],
|
|
2537
|
+
setTablePagination = _useState20[1];
|
|
2538
|
+
|
|
2539
|
+
var _useState21 = useState([]),
|
|
2517
2540
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
2518
|
-
|
|
2519
|
-
|
|
2541
|
+
selectedRowKeys = _useState22[0],
|
|
2542
|
+
setSelectedRowKeys = _useState22[1];
|
|
2520
2543
|
|
|
2521
2544
|
var _useState23 = useState([]),
|
|
2522
2545
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
2523
|
-
|
|
2524
|
-
|
|
2546
|
+
selectedRows = _useState24[0],
|
|
2547
|
+
setSelectedRows = _useState24[1];
|
|
2525
2548
|
|
|
2526
2549
|
var _useState25 = useState([]),
|
|
2527
2550
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
2528
|
-
|
|
2529
|
-
|
|
2551
|
+
doubleArr = _useState26[0],
|
|
2552
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
2553
|
+
|
|
2530
2554
|
|
|
2531
2555
|
var _useState27 = useState([]),
|
|
2532
2556
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
2533
|
-
|
|
2534
|
-
|
|
2557
|
+
filterRows = _useState28[0],
|
|
2558
|
+
setFilterRows = _useState28[1]; // 存放拼接后的一维数组的变量
|
|
2535
2559
|
|
|
2536
2560
|
|
|
2537
|
-
var _useState29 = useState(
|
|
2561
|
+
var _useState29 = useState(false),
|
|
2538
2562
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2563
|
+
checkedAll = _useState30[0],
|
|
2564
|
+
setCheckedAll = _useState30[1];
|
|
2542
2565
|
|
|
2543
2566
|
var _useState31 = useState(false),
|
|
2544
2567
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
2545
|
-
|
|
2546
|
-
|
|
2568
|
+
indeterminate = _useState32[0],
|
|
2569
|
+
setIndeterminate = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2547
2570
|
|
|
2548
|
-
var _useState33 = useState(false),
|
|
2549
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
2550
|
-
indeterminate = _useState34[0],
|
|
2551
|
-
setIndeterminate = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2552
2571
|
|
|
2553
|
-
|
|
2554
|
-
|
|
2572
|
+
var getData = function getData() {
|
|
2573
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2555
2574
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2556
|
-
|
|
2575
|
+
if (!requestConfig) return;
|
|
2576
|
+
var url = requestConfig.url,
|
|
2577
|
+
otherParams = requestConfig.otherParams,
|
|
2578
|
+
isMap = requestConfig.isMap,
|
|
2579
|
+
fixedparameter = requestConfig.fixedparameter,
|
|
2580
|
+
fieldValToParam = requestConfig.fieldValToParam,
|
|
2581
|
+
_requestConfig$mappin = requestConfig.mappingTextField,
|
|
2582
|
+
mappingTextField = _requestConfig$mappin === void 0 ? 'name' : _requestConfig$mappin,
|
|
2583
|
+
_requestConfig$mappin2 = requestConfig.mappingValueField,
|
|
2584
|
+
mappingValueField = _requestConfig$mappin2 === void 0 ? 'code' : _requestConfig$mappin2;
|
|
2585
|
+
setFetching(true); // 处理dependence参数
|
|
2586
|
+
|
|
2587
|
+
var fixedParam = {};
|
|
2588
|
+
|
|
2589
|
+
if (fixedparameter && fieldValToParam && ctx) {
|
|
2590
|
+
fixedparameter.forEach(function (item, index) {
|
|
2591
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
2592
|
+
|
|
2593
|
+
if (fixedParamVal) {
|
|
2594
|
+
fixedParam[item] = fixedParamVal;
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2557
2598
|
|
|
2558
|
-
var queryParams = _objectSpread2(_objectSpread2({
|
|
2599
|
+
var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
2559
2600
|
pageSize: pageSize,
|
|
2560
2601
|
currentPage: currentPage
|
|
2561
|
-
},
|
|
2562
|
-
sorter: 'desc-createTime'
|
|
2563
|
-
});
|
|
2564
|
-
|
|
2565
|
-
axios.get("".concat(selectDataUrl, "?").concat(stringify(queryParams))).then(function (result) {
|
|
2566
|
-
var _result$data;
|
|
2602
|
+
}, otherParams), fixedParam), params);
|
|
2567
2603
|
|
|
2604
|
+
axios.get("".concat(url, "?").concat(stringify(queryParams))).then(function (result) {
|
|
2568
2605
|
setFetching(false);
|
|
2569
2606
|
result = result.data;
|
|
2570
2607
|
|
|
@@ -2573,24 +2610,46 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2573
2610
|
return;
|
|
2574
2611
|
}
|
|
2575
2612
|
|
|
2576
|
-
var res =
|
|
2613
|
+
var res = result.data;
|
|
2614
|
+
var source = [];
|
|
2615
|
+
|
|
2616
|
+
if (isMap) {
|
|
2617
|
+
source = Object.keys(res).map(function (d, i) {
|
|
2618
|
+
return {
|
|
2619
|
+
text: Object.values(res)[i],
|
|
2620
|
+
value: d
|
|
2621
|
+
};
|
|
2622
|
+
});
|
|
2623
|
+
} else {
|
|
2624
|
+
var keys = res.list ? 'list' : 'items';
|
|
2625
|
+
source = res ? res[keys] ? res[keys].map(function (item) {
|
|
2626
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2627
|
+
text: item[mappingTextField],
|
|
2628
|
+
value: item[mappingValueField]
|
|
2629
|
+
});
|
|
2630
|
+
}) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
|
|
2631
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2632
|
+
text: item[mappingTextField],
|
|
2633
|
+
value: item[mappingValueField]
|
|
2634
|
+
});
|
|
2635
|
+
})) : [];
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
source = Array.isArray(source) ? source : [];
|
|
2577
2639
|
|
|
2578
2640
|
if (type === 1) {
|
|
2579
|
-
var
|
|
2641
|
+
var _ctx$form;
|
|
2580
2642
|
|
|
2581
|
-
|
|
2582
|
-
|
|
2643
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
|
|
2644
|
+
setItems(source);
|
|
2645
|
+
setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
|
|
2583
2646
|
} else {
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
setTableData(res);
|
|
2647
|
+
setTableData(source);
|
|
2587
2648
|
setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
|
|
2588
|
-
total: Number(
|
|
2589
|
-
pageSize: Number(
|
|
2590
|
-
current: Number(
|
|
2591
|
-
}));
|
|
2592
|
-
// onChangeSelectedKeys(res.map((i) => i.code), res, result.data?.page, 'show')
|
|
2593
|
-
// }
|
|
2649
|
+
total: Number(res === null || res === void 0 ? void 0 : res.total),
|
|
2650
|
+
pageSize: Number(res === null || res === void 0 ? void 0 : res.size),
|
|
2651
|
+
current: Number(res === null || res === void 0 ? void 0 : res.page)
|
|
2652
|
+
}));
|
|
2594
2653
|
}
|
|
2595
2654
|
}).catch(function (err) {
|
|
2596
2655
|
setFetching(false);
|
|
@@ -2619,8 +2678,10 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2619
2678
|
getData();
|
|
2620
2679
|
}, []);
|
|
2621
2680
|
useEffect(function () {
|
|
2622
|
-
|
|
2623
|
-
|
|
2681
|
+
if (value) {
|
|
2682
|
+
setPopValue(value);
|
|
2683
|
+
onChange(value);
|
|
2684
|
+
}
|
|
2624
2685
|
}, [value]);
|
|
2625
2686
|
|
|
2626
2687
|
var showModal = function showModal() {
|
|
@@ -2632,32 +2693,44 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2632
2693
|
|
|
2633
2694
|
if (value) {
|
|
2634
2695
|
if (selectMode) {
|
|
2635
|
-
setSelectedRowKeys(value.map(function (i) {
|
|
2696
|
+
setSelectedRowKeys(labelInValue ? value.map(function (i) {
|
|
2636
2697
|
return i.key;
|
|
2637
|
-
}));
|
|
2638
|
-
setSelectedRows(value.map(function (i) {
|
|
2698
|
+
}) : value);
|
|
2699
|
+
setSelectedRows(labelInValue ? value.map(function (i) {
|
|
2639
2700
|
return {
|
|
2640
|
-
|
|
2641
|
-
|
|
2701
|
+
value: i.key,
|
|
2702
|
+
text: i.label
|
|
2703
|
+
};
|
|
2704
|
+
}) : value.map(function (i) {
|
|
2705
|
+
return {
|
|
2706
|
+
value: i
|
|
2642
2707
|
};
|
|
2643
2708
|
}));
|
|
2644
|
-
setPopValue(value.map(function (i) {
|
|
2709
|
+
setPopValue(labelInValue ? value.map(function (i) {
|
|
2645
2710
|
return {
|
|
2646
|
-
|
|
2647
|
-
|
|
2711
|
+
value: i.key,
|
|
2712
|
+
text: i.label
|
|
2713
|
+
};
|
|
2714
|
+
}) : value.map(function (i) {
|
|
2715
|
+
return {
|
|
2716
|
+
value: i
|
|
2648
2717
|
};
|
|
2649
2718
|
}));
|
|
2650
2719
|
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
2651
2720
|
setCheckedAll(value.length === itemsTotal);
|
|
2652
2721
|
} else {
|
|
2653
|
-
setSelectedRowKeys([value.key]);
|
|
2654
|
-
setSelectedRows([{
|
|
2655
|
-
|
|
2656
|
-
|
|
2722
|
+
setSelectedRowKeys(labelInValue ? [value.key] : [value]);
|
|
2723
|
+
setSelectedRows(labelInValue ? [{
|
|
2724
|
+
value: value.key,
|
|
2725
|
+
text: value.label
|
|
2726
|
+
}] : [{
|
|
2727
|
+
value: value.key
|
|
2657
2728
|
}]);
|
|
2658
|
-
setPopValue([{
|
|
2659
|
-
|
|
2660
|
-
|
|
2729
|
+
setPopValue(labelInValue ? [{
|
|
2730
|
+
value: value.key,
|
|
2731
|
+
text: value.label
|
|
2732
|
+
}] : [{
|
|
2733
|
+
value: value.key
|
|
2661
2734
|
}]);
|
|
2662
2735
|
}
|
|
2663
2736
|
}
|
|
@@ -2672,14 +2745,22 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2672
2745
|
};
|
|
2673
2746
|
|
|
2674
2747
|
var formaData = function formaData(value) {
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2748
|
+
if (labelInValue) {
|
|
2749
|
+
var formatResult = value.map(function (i) {
|
|
2750
|
+
return {
|
|
2751
|
+
key: i.code,
|
|
2752
|
+
label: i.name,
|
|
2753
|
+
value: i.code
|
|
2754
|
+
};
|
|
2755
|
+
});
|
|
2756
|
+
onChange(selectMode ? formatResult : formatResult[0]);
|
|
2757
|
+
} else {
|
|
2758
|
+
var _formatResult = selectMode ? value.map(function (i) {
|
|
2759
|
+
return i.value;
|
|
2760
|
+
}) : _.get(value[0], 'value');
|
|
2761
|
+
|
|
2762
|
+
onChange(_formatResult);
|
|
2763
|
+
}
|
|
2683
2764
|
};
|
|
2684
2765
|
|
|
2685
2766
|
var handleCancel = function handleCancel() {
|
|
@@ -2694,11 +2775,6 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2694
2775
|
var onSearchBlur = function onSearchBlur() {
|
|
2695
2776
|
setSearchValue('');
|
|
2696
2777
|
run();
|
|
2697
|
-
}; //( 多选模式下 选中数据再搜索 删除部分搜索内容会优先触发这个函数 删除掉已选中内容才会去触发onSearchChange函数进行搜索)
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
var outerChange = function outerChange(sValue) {
|
|
2701
|
-
setValue(sValue);
|
|
2702
2778
|
};
|
|
2703
2779
|
|
|
2704
2780
|
var onSearchTable = function onSearchTable() {
|
|
@@ -2725,14 +2801,11 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2725
2801
|
|
|
2726
2802
|
var onChangeCheckAll = function onChangeCheckAll(e) {
|
|
2727
2803
|
if (e.target.checked) {
|
|
2728
|
-
//
|
|
2729
|
-
// const currentTableData = JSON.parse(JSON.stringify(tableData))
|
|
2730
|
-
// onChangeSelectedKeys(currentTableData.map((i) => i.code),currentTableData,tablePagination.current, 'checkAll')
|
|
2731
|
-
// 方案二:如果下拉框有所有数据就处理选中所有,如果没有 就默认查出所有数据
|
|
2804
|
+
// 如果下拉框有所有数据就处理选中所有,如果没有 就默认查出所有数据
|
|
2732
2805
|
if (items.length === itemsTotal) {
|
|
2733
2806
|
var currentItemsData = JSON.parse(JSON.stringify(items));
|
|
2734
2807
|
setSelectedRowKeys(currentItemsData.map(function (i) {
|
|
2735
|
-
return i.
|
|
2808
|
+
return i.value;
|
|
2736
2809
|
}));
|
|
2737
2810
|
setSelectedRows(currentItemsData);
|
|
2738
2811
|
setPopValue(currentItemsData);
|
|
@@ -2777,69 +2850,68 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2777
2850
|
for (var i = 0; i < params.length; i++) {
|
|
2778
2851
|
if (Array.isArray(params[i])) {
|
|
2779
2852
|
// 去重
|
|
2780
|
-
res = _.uniqBy(res.concat(mapRows(params[i])), '
|
|
2853
|
+
res = _.uniqBy(res.concat(mapRows(params[i])), 'value');
|
|
2781
2854
|
} else {
|
|
2782
2855
|
res.push(params[i]); // 去重
|
|
2783
2856
|
|
|
2784
|
-
res = _.uniqBy(res, '
|
|
2857
|
+
res = _.uniqBy(res, 'value');
|
|
2785
2858
|
}
|
|
2786
2859
|
}
|
|
2787
2860
|
|
|
2788
2861
|
return res.filter(Boolean); //去掉undefined的情况
|
|
2789
2862
|
};
|
|
2790
2863
|
|
|
2791
|
-
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
setDoubleArr(doubleArr); // 这块扁平化成为一位数组
|
|
2819
|
-
|
|
2820
|
-
var filterRows = mapRows(doubleArr); // console.log(filterRows)
|
|
2821
|
-
|
|
2822
|
-
setFilterRows(filterRows);
|
|
2823
|
-
var sksResult = filterRows.map(function (i) {
|
|
2824
|
-
return i.code;
|
|
2825
|
-
});
|
|
2864
|
+
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
|
|
2865
|
+
var nowPage = tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.current;
|
|
2866
|
+
var filterRows = [];
|
|
2867
|
+
var sksResult = [];
|
|
2868
|
+
|
|
2869
|
+
if (selectMode) {
|
|
2870
|
+
// 处理多选分页累计选中
|
|
2871
|
+
// 勾选生成二维数组
|
|
2872
|
+
doubleArr[nowPage ? nowPage - 1 : 0] = selectRows; // console.log(doubleArr)
|
|
2873
|
+
|
|
2874
|
+
setDoubleArr(doubleArr); // 这块扁平化成为一位数组
|
|
2875
|
+
|
|
2876
|
+
filterRows = mapRows(doubleArr); // console.log(filterRows)
|
|
2877
|
+
|
|
2878
|
+
setFilterRows(filterRows);
|
|
2879
|
+
sksResult = filterRows.map(function (i) {
|
|
2880
|
+
return i.value;
|
|
2881
|
+
});
|
|
2882
|
+
} else {
|
|
2883
|
+
// 处理单选
|
|
2884
|
+
filterRows = selectRows;
|
|
2885
|
+
sksResult = selectRows.map(function (i) {
|
|
2886
|
+
return i.value;
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2826
2890
|
setSelectedRowKeys(sksResult);
|
|
2827
2891
|
setSelectedRows(filterRows);
|
|
2828
2892
|
setPopValue(filterRows);
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2832
|
-
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2833
|
-
}
|
|
2893
|
+
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2894
|
+
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2834
2895
|
};
|
|
2835
2896
|
|
|
2836
2897
|
var rowSelection = {
|
|
2837
2898
|
type: selectMode ? 'checkbox' : 'radio',
|
|
2838
2899
|
selectedRowKeys: selectedRowKeys,
|
|
2839
2900
|
onChange: function onChange(sks, srs) {
|
|
2840
|
-
onChangeSelectedKeys(sks, srs
|
|
2901
|
+
onChangeSelectedKeys(sks, srs);
|
|
2902
|
+
}
|
|
2903
|
+
};
|
|
2904
|
+
|
|
2905
|
+
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
2906
|
+
if (!selectMode) {
|
|
2907
|
+
var srs = [JSON.parse(JSON.stringify(record))];
|
|
2908
|
+
var sks = srs.map(function (i) {
|
|
2909
|
+
return i.value;
|
|
2910
|
+
});
|
|
2911
|
+
onChangeSelectedKeys(sks, srs);
|
|
2841
2912
|
}
|
|
2842
2913
|
};
|
|
2914
|
+
|
|
2843
2915
|
var themeColor = {
|
|
2844
2916
|
color: '#1890ff'
|
|
2845
2917
|
};
|
|
@@ -2895,9 +2967,9 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2895
2967
|
id: 'search_select_div'
|
|
2896
2968
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
|
|
2897
2969
|
virtual: true,
|
|
2898
|
-
labelInValue:
|
|
2970
|
+
labelInValue: labelInValue,
|
|
2899
2971
|
value: value,
|
|
2900
|
-
onChange:
|
|
2972
|
+
onChange: onChange,
|
|
2901
2973
|
dropdownRender: function dropdownRender(menu) {
|
|
2902
2974
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {
|
|
2903
2975
|
value: searchValue,
|
|
@@ -2909,7 +2981,11 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2909
2981
|
onChange: function onChange(e) {
|
|
2910
2982
|
return onSearchChange(e);
|
|
2911
2983
|
},
|
|
2912
|
-
onBlur: onSearchBlur
|
|
2984
|
+
onBlur: onSearchBlur,
|
|
2985
|
+
onKeyDown: function onKeyDown(e) {
|
|
2986
|
+
// 阻止多选的冒泡
|
|
2987
|
+
e.stopPropagation();
|
|
2988
|
+
}
|
|
2913
2989
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
2914
2990
|
style: {
|
|
2915
2991
|
margin: '8px 0'
|
|
@@ -2942,10 +3018,10 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2942
3018
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
2943
3019
|
}), items.map(function (item) {
|
|
2944
3020
|
return /*#__PURE__*/React.createElement(Option, {
|
|
2945
|
-
key: item.
|
|
2946
|
-
label: item.
|
|
3021
|
+
key: item.value,
|
|
3022
|
+
label: item.text
|
|
2947
3023
|
}, LightHeightOption({
|
|
2948
|
-
text: "".concat(item.
|
|
3024
|
+
text: "".concat(item.value, " ").concat(item.text),
|
|
2949
3025
|
filterTxt: searchValue
|
|
2950
3026
|
}));
|
|
2951
3027
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -2968,7 +3044,8 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2968
3044
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
2969
3045
|
key: "submit",
|
|
2970
3046
|
type: "primary",
|
|
2971
|
-
onClick: handleOk
|
|
3047
|
+
onClick: handleOk,
|
|
3048
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
2972
3049
|
}, "\u786E\u5B9A")]
|
|
2973
3050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2974
3051
|
className: 'search_select_wrapper'
|
|
@@ -2989,7 +3066,8 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2989
3066
|
className: 'select_list_columns_formItems'
|
|
2990
3067
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
2991
3068
|
form: form,
|
|
2992
|
-
layout: 'vertical'
|
|
3069
|
+
layout: 'vertical',
|
|
3070
|
+
key: 'modalForm'
|
|
2993
3071
|
}, formItem(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm)))), /*#__PURE__*/React.createElement("div", {
|
|
2994
3072
|
className: 'select_list_searchButton'
|
|
2995
3073
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -3027,6 +3105,13 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3027
3105
|
scroll: {
|
|
3028
3106
|
x: modalTableProps.overScrollX || 'max-content',
|
|
3029
3107
|
y: modalTableProps.overScrollY || null
|
|
3108
|
+
},
|
|
3109
|
+
onRow: function onRow(record) {
|
|
3110
|
+
return {
|
|
3111
|
+
onDoubleClick: function onDoubleClick(event) {
|
|
3112
|
+
return onDoubleClickSelect(event, record);
|
|
3113
|
+
}
|
|
3114
|
+
};
|
|
3030
3115
|
}
|
|
3031
3116
|
}), selectMode ? /*#__PURE__*/React.createElement("div", {
|
|
3032
3117
|
className: 'select_list_selectAll'
|
|
@@ -3037,6 +3122,245 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3037
3122
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
3038
3123
|
};
|
|
3039
3124
|
|
|
3125
|
+
var getDicData = function getDicData(dicCode) {
|
|
3126
|
+
var dicData = {};
|
|
3127
|
+
|
|
3128
|
+
{
|
|
3129
|
+
var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
|
|
3130
|
+
dicData = storageDic[dicCode];
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
if (!dicData || !dicData.length) ;
|
|
3134
|
+
|
|
3135
|
+
return dicData;
|
|
3136
|
+
};
|
|
3137
|
+
|
|
3138
|
+
var getDictionarySource = function getDictionarySource(dicCode) {
|
|
3139
|
+
var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3140
|
+
var dicData = getDicData(dicCode);
|
|
3141
|
+
|
|
3142
|
+
try {
|
|
3143
|
+
if (needConvertInterger) {
|
|
3144
|
+
dicData = dicData.map(function (item) {
|
|
3145
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
3146
|
+
value: parseFloat(item.value)
|
|
3147
|
+
});
|
|
3148
|
+
});
|
|
3149
|
+
}
|
|
3150
|
+
} catch (e) {}
|
|
3151
|
+
|
|
3152
|
+
return dicData;
|
|
3153
|
+
};
|
|
3154
|
+
|
|
3155
|
+
var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
|
|
3156
|
+
var dicData = getDicData(dicCode);
|
|
3157
|
+
if (value === undefined) return '';
|
|
3158
|
+
var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
|
|
3159
|
+
return item.value === value.toString();
|
|
3160
|
+
});
|
|
3161
|
+
|
|
3162
|
+
if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
|
|
3163
|
+
// throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
|
|
3164
|
+
return value;
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
return dicItemArray[0].text;
|
|
3168
|
+
};
|
|
3169
|
+
|
|
3170
|
+
var loadSelectSource = function loadSelectSource(url, params) {
|
|
3171
|
+
return new Promise(function (resolve, reject) {
|
|
3172
|
+
axios.get("".concat(url, "?").concat(stringify(params))).then(function (result) {
|
|
3173
|
+
result = result.data;
|
|
3174
|
+
|
|
3175
|
+
if (result.status !== '0') {
|
|
3176
|
+
message.error(result.msg);
|
|
3177
|
+
return;
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
resolve(result);
|
|
3181
|
+
}).catch(function (err) {
|
|
3182
|
+
reject(err);
|
|
3183
|
+
});
|
|
3184
|
+
});
|
|
3185
|
+
};
|
|
3186
|
+
|
|
3187
|
+
function commonFun(type, prefixURL) {
|
|
3188
|
+
// 默认type === 'supplier' 供应商选择器
|
|
3189
|
+
var requestConfig = {
|
|
3190
|
+
url: "".concat(prefixURL.selectPrefix, "/supplier"),
|
|
3191
|
+
filter: 'qp-nameAndCode-like',
|
|
3192
|
+
otherParams: {
|
|
3193
|
+
sorter: 'desc-id'
|
|
3194
|
+
} // 默认参数
|
|
3195
|
+
|
|
3196
|
+
};
|
|
3197
|
+
/*
|
|
3198
|
+
* 处理 格式化下拉框数据源
|
|
3199
|
+
* reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
|
|
3200
|
+
* 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
|
|
3201
|
+
* position 必传 为获取Promise.all请求结果的位置
|
|
3202
|
+
* changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
|
|
3203
|
+
* changeSearchForm 必传 为搜索表单Form数据
|
|
3204
|
+
* */
|
|
3205
|
+
|
|
3206
|
+
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
3207
|
+
var _reData$position, _reData$position$data;
|
|
3208
|
+
|
|
3209
|
+
var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : (_reData$position$data = _reData$position.data) === null || _reData$position$data === void 0 ? void 0 : _reData$position$data.items) || [];
|
|
3210
|
+
var formatData = (data === null || data === void 0 ? void 0 : data.length) ? data.map(function (v) {
|
|
3211
|
+
return {
|
|
3212
|
+
text: v.name,
|
|
3213
|
+
value: v.code
|
|
3214
|
+
};
|
|
3215
|
+
}) : [];
|
|
3216
|
+
changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
|
|
3217
|
+
initialSource: formatData
|
|
3218
|
+
});
|
|
3219
|
+
};
|
|
3220
|
+
|
|
3221
|
+
var tableSearchForm = [];
|
|
3222
|
+
|
|
3223
|
+
if (type === 'supplier') {
|
|
3224
|
+
tableSearchForm = [{
|
|
3225
|
+
name: 'qp-name-like',
|
|
3226
|
+
label: '客户名称'
|
|
3227
|
+
}, {
|
|
3228
|
+
name: 'qp-code-like',
|
|
3229
|
+
label: '客户编码'
|
|
3230
|
+
}, {
|
|
3231
|
+
name: 'qp-conglomerateCode-in',
|
|
3232
|
+
type: 'select',
|
|
3233
|
+
label: '归属集团',
|
|
3234
|
+
field: {
|
|
3235
|
+
type: 'select',
|
|
3236
|
+
props: {
|
|
3237
|
+
mode: 'multiple',
|
|
3238
|
+
notFoundContent: '暂无数据',
|
|
3239
|
+
allowClear: true,
|
|
3240
|
+
showSearch: true,
|
|
3241
|
+
showArrow: true,
|
|
3242
|
+
maxTagCount: 1,
|
|
3243
|
+
optionFilterProp: 'children',
|
|
3244
|
+
filterOption: function filterOption(input, option) {
|
|
3245
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
}, {
|
|
3250
|
+
name: 'qp-accountingCode-in',
|
|
3251
|
+
type: 'select',
|
|
3252
|
+
label: '归属核算主体',
|
|
3253
|
+
field: {
|
|
3254
|
+
type: 'select',
|
|
3255
|
+
props: {
|
|
3256
|
+
mode: 'multiple',
|
|
3257
|
+
notFoundContent: '暂无数据',
|
|
3258
|
+
allowClear: true,
|
|
3259
|
+
showSearch: true,
|
|
3260
|
+
showArrow: true,
|
|
3261
|
+
maxTagCount: 1,
|
|
3262
|
+
optionFilterProp: 'children',
|
|
3263
|
+
filterOption: function filterOption(input, option) {
|
|
3264
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
}, {
|
|
3269
|
+
name: 'qp-companyCode-in',
|
|
3270
|
+
type: 'select',
|
|
3271
|
+
label: '归属法人公司',
|
|
3272
|
+
field: {
|
|
3273
|
+
type: 'select',
|
|
3274
|
+
props: {
|
|
3275
|
+
mode: 'multiple',
|
|
3276
|
+
notFoundContent: '暂无数据',
|
|
3277
|
+
allowClear: true,
|
|
3278
|
+
showSearch: true,
|
|
3279
|
+
showArrow: true,
|
|
3280
|
+
maxTagCount: 1,
|
|
3281
|
+
optionFilterProp: 'children',
|
|
3282
|
+
filterOption: function filterOption(input, option) {
|
|
3283
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
}, {
|
|
3288
|
+
name: 'qp-sharingType-eq',
|
|
3289
|
+
type: 'select',
|
|
3290
|
+
label: '共享类型',
|
|
3291
|
+
initialSource: getDictionarySource('UC000013')
|
|
3292
|
+
}];
|
|
3293
|
+
Promise.all([loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
|
|
3294
|
+
pageSize: 5000,
|
|
3295
|
+
currentPage: 1,
|
|
3296
|
+
'qp-companyType-eq': '30'
|
|
3297
|
+
}), loadSelectSource("".concat(prefixURL.formSelectFix, "/accountingSubject"), {
|
|
3298
|
+
pageSize: 5000,
|
|
3299
|
+
currentPage: 1
|
|
3300
|
+
}), loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
|
|
3301
|
+
pageSize: 5000,
|
|
3302
|
+
currentPage: 1,
|
|
3303
|
+
'qp-companyType-eq': '20'
|
|
3304
|
+
})]).then(function (x) {
|
|
3305
|
+
formatSource(x, 0, 2, tableSearchForm);
|
|
3306
|
+
formatSource(x, 1, 3, tableSearchForm);
|
|
3307
|
+
formatSource(x, 2, 4, tableSearchForm);
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
var modalTableProps = {
|
|
3312
|
+
modalTableTitle: '选择供应商',
|
|
3313
|
+
tableSearchForm: tableSearchForm,
|
|
3314
|
+
tableColumns: [{
|
|
3315
|
+
title: '客户编码',
|
|
3316
|
+
dataIndex: 'code'
|
|
3317
|
+
}, {
|
|
3318
|
+
title: '客户名称',
|
|
3319
|
+
dataIndex: 'name'
|
|
3320
|
+
}, {
|
|
3321
|
+
title: '归属集团',
|
|
3322
|
+
dataIndex: 'conglomerateName'
|
|
3323
|
+
}, {
|
|
3324
|
+
title: '归属法人公司',
|
|
3325
|
+
dataIndex: 'legalCompanyName'
|
|
3326
|
+
}, {
|
|
3327
|
+
title: '归属核算主体',
|
|
3328
|
+
dataIndex: 'accountingName'
|
|
3329
|
+
}, {
|
|
3330
|
+
title: '共享类型',
|
|
3331
|
+
dataIndex: 'sharingType',
|
|
3332
|
+
render: function render(text) {
|
|
3333
|
+
return getDictionaryTextByValue('UC000013', text);
|
|
3334
|
+
}
|
|
3335
|
+
}]
|
|
3336
|
+
}; // 商品选择器
|
|
3337
|
+
|
|
3338
|
+
return {
|
|
3339
|
+
modalTableProps: modalTableProps,
|
|
3340
|
+
requestConfig: requestConfig
|
|
3341
|
+
};
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
3345
|
+
var businessType = (props === null || props === void 0 ? void 0 : props.SelectBusinessType) || 'supplier';
|
|
3346
|
+
var prefixURL = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
3347
|
+
selectPrefix: '/bop/api',
|
|
3348
|
+
formSelectFix: '/bop/api'
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
var _commonFun = commonFun(businessType, prefixURL),
|
|
3352
|
+
requestConfig = _commonFun.requestConfig,
|
|
3353
|
+
modalTableProps = _commonFun.modalTableProps;
|
|
3354
|
+
|
|
3355
|
+
var currentProps = _objectSpread2(_objectSpread2({
|
|
3356
|
+
requestConfig: requestConfig
|
|
3357
|
+
}, props), {}, {
|
|
3358
|
+
modalTableProps: modalTableProps
|
|
3359
|
+
});
|
|
3360
|
+
|
|
3361
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchSelect, _objectSpread2({}, currentProps)));
|
|
3362
|
+
};
|
|
3363
|
+
|
|
3040
3364
|
/*
|
|
3041
3365
|
* @Description:
|
|
3042
3366
|
* @Author: rodchen
|
|
@@ -3048,4 +3372,4 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3048
3372
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
3049
3373
|
axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
3050
3374
|
|
|
3051
|
-
export { index as CheckOneUser, DataValidation, QueryMutipleInput, SearchSelect };
|
|
3375
|
+
export { BusinessSearchSelect, index as CheckOneUser, DataValidation, QueryMutipleInput, SearchSelect };
|