@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.js
CHANGED
|
@@ -89,14 +89,14 @@ function _inherits(subClass, superClass) {
|
|
|
89
89
|
throw new TypeError("Super expression must either be null or a function");
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
93
|
+
constructor: {
|
|
94
|
+
value: subClass,
|
|
95
|
+
writable: true,
|
|
96
|
+
configurable: true
|
|
97
|
+
}
|
|
98
|
+
});
|
|
92
99
|
Object.defineProperty(subClass, "prototype", {
|
|
93
|
-
value: Object.create(superClass && superClass.prototype, {
|
|
94
|
-
constructor: {
|
|
95
|
-
value: subClass,
|
|
96
|
-
writable: true,
|
|
97
|
-
configurable: true
|
|
98
|
-
}
|
|
99
|
-
}),
|
|
100
100
|
writable: false
|
|
101
101
|
});
|
|
102
102
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
@@ -1276,6 +1276,14 @@ function injectCSS(css) {
|
|
|
1276
1276
|
return styleNode;
|
|
1277
1277
|
}
|
|
1278
1278
|
var containerCache = new Map();
|
|
1279
|
+
|
|
1280
|
+
function findExistNode(key) {
|
|
1281
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1282
|
+
var container = getContainer(option);
|
|
1283
|
+
return Array.from(containerCache.get(container).children).find(function (node) {
|
|
1284
|
+
return node.tagName === 'STYLE' && node[MARK_KEY] === key;
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1279
1287
|
function updateCSS(css, key) {
|
|
1280
1288
|
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1281
1289
|
var container = getContainer(option); // Get real parent
|
|
@@ -1287,9 +1295,7 @@ function updateCSS(css, key) {
|
|
|
1287
1295
|
parentNode.removeChild(placeholderStyle);
|
|
1288
1296
|
}
|
|
1289
1297
|
|
|
1290
|
-
var existNode =
|
|
1291
|
-
return node.tagName === 'STYLE' && node[MARK_KEY] === key;
|
|
1292
|
-
});
|
|
1298
|
+
var existNode = findExistNode(key, option);
|
|
1293
1299
|
|
|
1294
1300
|
if (existNode) {
|
|
1295
1301
|
var _option$csp3, _option$csp4;
|
|
@@ -2427,26 +2433,31 @@ function getStorageVale(storageKeyString) {
|
|
|
2427
2433
|
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";
|
|
2428
2434
|
styleInject(css_248z$2);
|
|
2429
2435
|
|
|
2430
|
-
var Option = antd.Select.Option;
|
|
2431
|
-
|
|
2432
|
-
var SearchSelect = function SearchSelect(
|
|
2433
|
-
var
|
|
2434
|
-
|
|
2435
|
-
selectProps =
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2436
|
+
var Option = antd.Select.Option;
|
|
2437
|
+
|
|
2438
|
+
var SearchSelect = function SearchSelect(props) {
|
|
2439
|
+
var value = props.value,
|
|
2440
|
+
onChange = props.onChange,
|
|
2441
|
+
_props$selectProps = props.selectProps,
|
|
2442
|
+
selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
|
|
2443
|
+
_props$modalTableProp = props.modalTableProps,
|
|
2444
|
+
modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
|
|
2445
|
+
_props$labelInValue = props.labelInValue,
|
|
2446
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
2447
|
+
requestConfig = props.requestConfig,
|
|
2448
|
+
ctx = props.ctx;
|
|
2440
2449
|
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
2441
2450
|
|
|
2442
|
-
var initVal =
|
|
2451
|
+
var initVal = value || (selectMode ? [] : null);
|
|
2443
2452
|
var pageSize = 100; // 下拉框默认分页 条数
|
|
2444
2453
|
|
|
2445
2454
|
var tableInitPageSize = 10; // 弹框默认分页 条数
|
|
2446
2455
|
|
|
2447
2456
|
var currentPage = 1;
|
|
2457
|
+
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
2448
2458
|
|
|
2449
2459
|
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
2460
|
+
// 以下属性不可更改----设计配置项
|
|
2450
2461
|
showSearch: false,
|
|
2451
2462
|
filterOption: false,
|
|
2452
2463
|
allowClear: true,
|
|
@@ -2487,19 +2498,26 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2487
2498
|
|
|
2488
2499
|
var _useState13 = React.useState(initVal),
|
|
2489
2500
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
var _useState15 = React.useState(initVal),
|
|
2494
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
2495
|
-
popvalue = _useState16[0],
|
|
2496
|
-
setPopValue = _useState16[1];
|
|
2501
|
+
popvalue = _useState14[0],
|
|
2502
|
+
setPopValue = _useState14[1];
|
|
2497
2503
|
|
|
2498
2504
|
var _useDebounceFn = ahooks.useDebounceFn(function () {
|
|
2505
|
+
// 优化搜索参数 支持传多个
|
|
2506
|
+
var searchParams = {};
|
|
2507
|
+
|
|
2508
|
+
if (typeof selectParamsKey === 'string') {
|
|
2509
|
+
searchParams = _defineProperty({}, selectParamsKey, searchValue);
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
if (Array.isArray(selectParamsKey)) {
|
|
2513
|
+
selectParamsKey.forEach(function (i) {
|
|
2514
|
+
searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
|
|
2515
|
+
});
|
|
2516
|
+
} // 防抖函数 待定
|
|
2517
|
+
|
|
2518
|
+
|
|
2499
2519
|
// 防抖函数 待定
|
|
2500
|
-
getData(
|
|
2501
|
-
'qp-name-like': searchValue
|
|
2502
|
-
});
|
|
2520
|
+
getData(searchParams);
|
|
2503
2521
|
}, {
|
|
2504
2522
|
wait: 1000
|
|
2505
2523
|
}),
|
|
@@ -2509,73 +2527,92 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2509
2527
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
2510
2528
|
form = _Form$useForm2[0];
|
|
2511
2529
|
|
|
2512
|
-
var
|
|
2513
|
-
|
|
2514
|
-
caretLeftFlag =
|
|
2515
|
-
setCaretLeftFlag =
|
|
2530
|
+
var _useState15 = React.useState(true),
|
|
2531
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
2532
|
+
caretLeftFlag = _useState16[0],
|
|
2533
|
+
setCaretLeftFlag = _useState16[1];
|
|
2516
2534
|
|
|
2517
|
-
var
|
|
2518
|
-
|
|
2519
|
-
tableData =
|
|
2520
|
-
setTableData =
|
|
2535
|
+
var _useState17 = React.useState([]),
|
|
2536
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
2537
|
+
tableData = _useState18[0],
|
|
2538
|
+
setTableData = _useState18[1];
|
|
2521
2539
|
|
|
2522
|
-
var
|
|
2540
|
+
var _useState19 = React.useState({
|
|
2523
2541
|
showQuickJumper: true,
|
|
2524
2542
|
total: 0,
|
|
2525
2543
|
current: 1,
|
|
2526
2544
|
pageSize: tableInitPageSize
|
|
2527
2545
|
}),
|
|
2546
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
2547
|
+
tablePagination = _useState20[0],
|
|
2548
|
+
setTablePagination = _useState20[1];
|
|
2549
|
+
|
|
2550
|
+
var _useState21 = React.useState([]),
|
|
2528
2551
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
2529
|
-
|
|
2530
|
-
|
|
2552
|
+
selectedRowKeys = _useState22[0],
|
|
2553
|
+
setSelectedRowKeys = _useState22[1];
|
|
2531
2554
|
|
|
2532
2555
|
var _useState23 = React.useState([]),
|
|
2533
2556
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
2534
|
-
|
|
2535
|
-
|
|
2557
|
+
selectedRows = _useState24[0],
|
|
2558
|
+
setSelectedRows = _useState24[1];
|
|
2536
2559
|
|
|
2537
2560
|
var _useState25 = React.useState([]),
|
|
2538
2561
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
2539
|
-
|
|
2540
|
-
|
|
2562
|
+
doubleArr = _useState26[0],
|
|
2563
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
2564
|
+
|
|
2541
2565
|
|
|
2542
2566
|
var _useState27 = React.useState([]),
|
|
2543
2567
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
2544
|
-
|
|
2545
|
-
|
|
2568
|
+
filterRows = _useState28[0],
|
|
2569
|
+
setFilterRows = _useState28[1]; // 存放拼接后的一维数组的变量
|
|
2546
2570
|
|
|
2547
2571
|
|
|
2548
|
-
var _useState29 = React.useState(
|
|
2572
|
+
var _useState29 = React.useState(false),
|
|
2549
2573
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2574
|
+
checkedAll = _useState30[0],
|
|
2575
|
+
setCheckedAll = _useState30[1];
|
|
2553
2576
|
|
|
2554
2577
|
var _useState31 = React.useState(false),
|
|
2555
2578
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
2556
|
-
|
|
2557
|
-
|
|
2579
|
+
indeterminate = _useState32[0],
|
|
2580
|
+
setIndeterminate = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2558
2581
|
|
|
2559
|
-
var _useState33 = React.useState(false),
|
|
2560
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
2561
|
-
indeterminate = _useState34[0],
|
|
2562
|
-
setIndeterminate = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2563
2582
|
|
|
2564
|
-
|
|
2565
|
-
|
|
2583
|
+
var getData = function getData() {
|
|
2584
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2566
2585
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2567
|
-
|
|
2586
|
+
if (!requestConfig) return;
|
|
2587
|
+
var url = requestConfig.url,
|
|
2588
|
+
otherParams = requestConfig.otherParams,
|
|
2589
|
+
isMap = requestConfig.isMap,
|
|
2590
|
+
fixedparameter = requestConfig.fixedparameter,
|
|
2591
|
+
fieldValToParam = requestConfig.fieldValToParam,
|
|
2592
|
+
_requestConfig$mappin = requestConfig.mappingTextField,
|
|
2593
|
+
mappingTextField = _requestConfig$mappin === void 0 ? 'name' : _requestConfig$mappin,
|
|
2594
|
+
_requestConfig$mappin2 = requestConfig.mappingValueField,
|
|
2595
|
+
mappingValueField = _requestConfig$mappin2 === void 0 ? 'code' : _requestConfig$mappin2;
|
|
2596
|
+
setFetching(true); // 处理dependence参数
|
|
2597
|
+
|
|
2598
|
+
var fixedParam = {};
|
|
2599
|
+
|
|
2600
|
+
if (fixedparameter && fieldValToParam && ctx) {
|
|
2601
|
+
fixedparameter.forEach(function (item, index) {
|
|
2602
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
2603
|
+
|
|
2604
|
+
if (fixedParamVal) {
|
|
2605
|
+
fixedParam[item] = fixedParamVal;
|
|
2606
|
+
}
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2568
2609
|
|
|
2569
|
-
var queryParams = _objectSpread2(_objectSpread2({
|
|
2610
|
+
var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
2570
2611
|
pageSize: pageSize,
|
|
2571
2612
|
currentPage: currentPage
|
|
2572
|
-
},
|
|
2573
|
-
sorter: 'desc-createTime'
|
|
2574
|
-
});
|
|
2575
|
-
|
|
2576
|
-
axios__default['default'].get("".concat(selectDataUrl, "?").concat(querystring.stringify(queryParams))).then(function (result) {
|
|
2577
|
-
var _result$data;
|
|
2613
|
+
}, otherParams), fixedParam), params);
|
|
2578
2614
|
|
|
2615
|
+
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
|
|
2579
2616
|
setFetching(false);
|
|
2580
2617
|
result = result.data;
|
|
2581
2618
|
|
|
@@ -2584,24 +2621,46 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2584
2621
|
return;
|
|
2585
2622
|
}
|
|
2586
2623
|
|
|
2587
|
-
var res =
|
|
2624
|
+
var res = result.data;
|
|
2625
|
+
var source = [];
|
|
2626
|
+
|
|
2627
|
+
if (isMap) {
|
|
2628
|
+
source = Object.keys(res).map(function (d, i) {
|
|
2629
|
+
return {
|
|
2630
|
+
text: Object.values(res)[i],
|
|
2631
|
+
value: d
|
|
2632
|
+
};
|
|
2633
|
+
});
|
|
2634
|
+
} else {
|
|
2635
|
+
var keys = res.list ? 'list' : 'items';
|
|
2636
|
+
source = res ? res[keys] ? res[keys].map(function (item) {
|
|
2637
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2638
|
+
text: item[mappingTextField],
|
|
2639
|
+
value: item[mappingValueField]
|
|
2640
|
+
});
|
|
2641
|
+
}) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
|
|
2642
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2643
|
+
text: item[mappingTextField],
|
|
2644
|
+
value: item[mappingValueField]
|
|
2645
|
+
});
|
|
2646
|
+
})) : [];
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
source = Array.isArray(source) ? source : [];
|
|
2588
2650
|
|
|
2589
2651
|
if (type === 1) {
|
|
2590
|
-
var
|
|
2652
|
+
var _ctx$form;
|
|
2591
2653
|
|
|
2592
|
-
|
|
2593
|
-
|
|
2654
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource('supplierCode', source);
|
|
2655
|
+
setItems(source);
|
|
2656
|
+
setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
|
|
2594
2657
|
} else {
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
setTableData(res);
|
|
2658
|
+
setTableData(source);
|
|
2598
2659
|
setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
|
|
2599
|
-
total: Number(
|
|
2600
|
-
pageSize: Number(
|
|
2601
|
-
current: Number(
|
|
2602
|
-
}));
|
|
2603
|
-
// onChangeSelectedKeys(res.map((i) => i.code), res, result.data?.page, 'show')
|
|
2604
|
-
// }
|
|
2660
|
+
total: Number(res === null || res === void 0 ? void 0 : res.total),
|
|
2661
|
+
pageSize: Number(res === null || res === void 0 ? void 0 : res.size),
|
|
2662
|
+
current: Number(res === null || res === void 0 ? void 0 : res.page)
|
|
2663
|
+
}));
|
|
2605
2664
|
}
|
|
2606
2665
|
}).catch(function (err) {
|
|
2607
2666
|
setFetching(false);
|
|
@@ -2630,8 +2689,10 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2630
2689
|
getData();
|
|
2631
2690
|
}, []);
|
|
2632
2691
|
React.useEffect(function () {
|
|
2633
|
-
|
|
2634
|
-
|
|
2692
|
+
if (value) {
|
|
2693
|
+
setPopValue(value);
|
|
2694
|
+
onChange(value);
|
|
2695
|
+
}
|
|
2635
2696
|
}, [value]);
|
|
2636
2697
|
|
|
2637
2698
|
var showModal = function showModal() {
|
|
@@ -2643,32 +2704,44 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2643
2704
|
|
|
2644
2705
|
if (value) {
|
|
2645
2706
|
if (selectMode) {
|
|
2646
|
-
setSelectedRowKeys(value.map(function (i) {
|
|
2707
|
+
setSelectedRowKeys(labelInValue ? value.map(function (i) {
|
|
2647
2708
|
return i.key;
|
|
2648
|
-
}));
|
|
2649
|
-
setSelectedRows(value.map(function (i) {
|
|
2709
|
+
}) : value);
|
|
2710
|
+
setSelectedRows(labelInValue ? value.map(function (i) {
|
|
2650
2711
|
return {
|
|
2651
|
-
|
|
2652
|
-
|
|
2712
|
+
value: i.key,
|
|
2713
|
+
text: i.label
|
|
2714
|
+
};
|
|
2715
|
+
}) : value.map(function (i) {
|
|
2716
|
+
return {
|
|
2717
|
+
value: i
|
|
2653
2718
|
};
|
|
2654
2719
|
}));
|
|
2655
|
-
setPopValue(value.map(function (i) {
|
|
2720
|
+
setPopValue(labelInValue ? value.map(function (i) {
|
|
2656
2721
|
return {
|
|
2657
|
-
|
|
2658
|
-
|
|
2722
|
+
value: i.key,
|
|
2723
|
+
text: i.label
|
|
2724
|
+
};
|
|
2725
|
+
}) : value.map(function (i) {
|
|
2726
|
+
return {
|
|
2727
|
+
value: i
|
|
2659
2728
|
};
|
|
2660
2729
|
}));
|
|
2661
2730
|
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
2662
2731
|
setCheckedAll(value.length === itemsTotal);
|
|
2663
2732
|
} else {
|
|
2664
|
-
setSelectedRowKeys([value.key]);
|
|
2665
|
-
setSelectedRows([{
|
|
2666
|
-
|
|
2667
|
-
|
|
2733
|
+
setSelectedRowKeys(labelInValue ? [value.key] : [value]);
|
|
2734
|
+
setSelectedRows(labelInValue ? [{
|
|
2735
|
+
value: value.key,
|
|
2736
|
+
text: value.label
|
|
2737
|
+
}] : [{
|
|
2738
|
+
value: value.key
|
|
2668
2739
|
}]);
|
|
2669
|
-
setPopValue([{
|
|
2670
|
-
|
|
2671
|
-
|
|
2740
|
+
setPopValue(labelInValue ? [{
|
|
2741
|
+
value: value.key,
|
|
2742
|
+
text: value.label
|
|
2743
|
+
}] : [{
|
|
2744
|
+
value: value.key
|
|
2672
2745
|
}]);
|
|
2673
2746
|
}
|
|
2674
2747
|
}
|
|
@@ -2683,14 +2756,22 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2683
2756
|
};
|
|
2684
2757
|
|
|
2685
2758
|
var formaData = function formaData(value) {
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2759
|
+
if (labelInValue) {
|
|
2760
|
+
var formatResult = value.map(function (i) {
|
|
2761
|
+
return {
|
|
2762
|
+
key: i.code,
|
|
2763
|
+
label: i.name,
|
|
2764
|
+
value: i.code
|
|
2765
|
+
};
|
|
2766
|
+
});
|
|
2767
|
+
onChange(selectMode ? formatResult : formatResult[0]);
|
|
2768
|
+
} else {
|
|
2769
|
+
var _formatResult = selectMode ? value.map(function (i) {
|
|
2770
|
+
return i.value;
|
|
2771
|
+
}) : ___default['default'].get(value[0], 'value');
|
|
2772
|
+
|
|
2773
|
+
onChange(_formatResult);
|
|
2774
|
+
}
|
|
2694
2775
|
};
|
|
2695
2776
|
|
|
2696
2777
|
var handleCancel = function handleCancel() {
|
|
@@ -2705,11 +2786,6 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2705
2786
|
var onSearchBlur = function onSearchBlur() {
|
|
2706
2787
|
setSearchValue('');
|
|
2707
2788
|
run();
|
|
2708
|
-
}; //( 多选模式下 选中数据再搜索 删除部分搜索内容会优先触发这个函数 删除掉已选中内容才会去触发onSearchChange函数进行搜索)
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
var outerChange = function outerChange(sValue) {
|
|
2712
|
-
setValue(sValue);
|
|
2713
2789
|
};
|
|
2714
2790
|
|
|
2715
2791
|
var onSearchTable = function onSearchTable() {
|
|
@@ -2736,14 +2812,11 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2736
2812
|
|
|
2737
2813
|
var onChangeCheckAll = function onChangeCheckAll(e) {
|
|
2738
2814
|
if (e.target.checked) {
|
|
2739
|
-
//
|
|
2740
|
-
// const currentTableData = JSON.parse(JSON.stringify(tableData))
|
|
2741
|
-
// onChangeSelectedKeys(currentTableData.map((i) => i.code),currentTableData,tablePagination.current, 'checkAll')
|
|
2742
|
-
// 方案二:如果下拉框有所有数据就处理选中所有,如果没有 就默认查出所有数据
|
|
2815
|
+
// 如果下拉框有所有数据就处理选中所有,如果没有 就默认查出所有数据
|
|
2743
2816
|
if (items.length === itemsTotal) {
|
|
2744
2817
|
var currentItemsData = JSON.parse(JSON.stringify(items));
|
|
2745
2818
|
setSelectedRowKeys(currentItemsData.map(function (i) {
|
|
2746
|
-
return i.
|
|
2819
|
+
return i.value;
|
|
2747
2820
|
}));
|
|
2748
2821
|
setSelectedRows(currentItemsData);
|
|
2749
2822
|
setPopValue(currentItemsData);
|
|
@@ -2788,69 +2861,68 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2788
2861
|
for (var i = 0; i < params.length; i++) {
|
|
2789
2862
|
if (Array.isArray(params[i])) {
|
|
2790
2863
|
// 去重
|
|
2791
|
-
res = ___default['default'].uniqBy(res.concat(mapRows(params[i])), '
|
|
2864
|
+
res = ___default['default'].uniqBy(res.concat(mapRows(params[i])), 'value');
|
|
2792
2865
|
} else {
|
|
2793
2866
|
res.push(params[i]); // 去重
|
|
2794
2867
|
|
|
2795
|
-
res = ___default['default'].uniqBy(res, '
|
|
2868
|
+
res = ___default['default'].uniqBy(res, 'value');
|
|
2796
2869
|
}
|
|
2797
2870
|
}
|
|
2798
2871
|
|
|
2799
2872
|
return res.filter(Boolean); //去掉undefined的情况
|
|
2800
2873
|
};
|
|
2801
2874
|
|
|
2802
|
-
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
setDoubleArr(doubleArr); // 这块扁平化成为一位数组
|
|
2830
|
-
|
|
2831
|
-
var filterRows = mapRows(doubleArr); // console.log(filterRows)
|
|
2832
|
-
|
|
2833
|
-
setFilterRows(filterRows);
|
|
2834
|
-
var sksResult = filterRows.map(function (i) {
|
|
2835
|
-
return i.code;
|
|
2836
|
-
});
|
|
2875
|
+
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
|
|
2876
|
+
var nowPage = tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.current;
|
|
2877
|
+
var filterRows = [];
|
|
2878
|
+
var sksResult = [];
|
|
2879
|
+
|
|
2880
|
+
if (selectMode) {
|
|
2881
|
+
// 处理多选分页累计选中
|
|
2882
|
+
// 勾选生成二维数组
|
|
2883
|
+
doubleArr[nowPage ? nowPage - 1 : 0] = selectRows; // console.log(doubleArr)
|
|
2884
|
+
|
|
2885
|
+
setDoubleArr(doubleArr); // 这块扁平化成为一位数组
|
|
2886
|
+
|
|
2887
|
+
filterRows = mapRows(doubleArr); // console.log(filterRows)
|
|
2888
|
+
|
|
2889
|
+
setFilterRows(filterRows);
|
|
2890
|
+
sksResult = filterRows.map(function (i) {
|
|
2891
|
+
return i.value;
|
|
2892
|
+
});
|
|
2893
|
+
} else {
|
|
2894
|
+
// 处理单选
|
|
2895
|
+
filterRows = selectRows;
|
|
2896
|
+
sksResult = selectRows.map(function (i) {
|
|
2897
|
+
return i.value;
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2837
2901
|
setSelectedRowKeys(sksResult);
|
|
2838
2902
|
setSelectedRows(filterRows);
|
|
2839
2903
|
setPopValue(filterRows);
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2843
|
-
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2844
|
-
}
|
|
2904
|
+
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2905
|
+
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2845
2906
|
};
|
|
2846
2907
|
|
|
2847
2908
|
var rowSelection = {
|
|
2848
2909
|
type: selectMode ? 'checkbox' : 'radio',
|
|
2849
2910
|
selectedRowKeys: selectedRowKeys,
|
|
2850
2911
|
onChange: function onChange(sks, srs) {
|
|
2851
|
-
onChangeSelectedKeys(sks, srs
|
|
2912
|
+
onChangeSelectedKeys(sks, srs);
|
|
2913
|
+
}
|
|
2914
|
+
};
|
|
2915
|
+
|
|
2916
|
+
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
2917
|
+
if (!selectMode) {
|
|
2918
|
+
var srs = [JSON.parse(JSON.stringify(record))];
|
|
2919
|
+
var sks = srs.map(function (i) {
|
|
2920
|
+
return i.value;
|
|
2921
|
+
});
|
|
2922
|
+
onChangeSelectedKeys(sks, srs);
|
|
2852
2923
|
}
|
|
2853
2924
|
};
|
|
2925
|
+
|
|
2854
2926
|
var themeColor = {
|
|
2855
2927
|
color: '#1890ff'
|
|
2856
2928
|
};
|
|
@@ -2906,9 +2978,9 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2906
2978
|
id: 'search_select_div'
|
|
2907
2979
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({
|
|
2908
2980
|
virtual: true,
|
|
2909
|
-
labelInValue:
|
|
2981
|
+
labelInValue: labelInValue,
|
|
2910
2982
|
value: value,
|
|
2911
|
-
onChange:
|
|
2983
|
+
onChange: onChange,
|
|
2912
2984
|
dropdownRender: function dropdownRender(menu) {
|
|
2913
2985
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
2914
2986
|
value: searchValue,
|
|
@@ -2920,7 +2992,11 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2920
2992
|
onChange: function onChange(e) {
|
|
2921
2993
|
return onSearchChange(e);
|
|
2922
2994
|
},
|
|
2923
|
-
onBlur: onSearchBlur
|
|
2995
|
+
onBlur: onSearchBlur,
|
|
2996
|
+
onKeyDown: function onKeyDown(e) {
|
|
2997
|
+
// 阻止多选的冒泡
|
|
2998
|
+
e.stopPropagation();
|
|
2999
|
+
}
|
|
2924
3000
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Divider, {
|
|
2925
3001
|
style: {
|
|
2926
3002
|
margin: '8px 0'
|
|
@@ -2953,10 +3029,10 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2953
3029
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
2954
3030
|
}), items.map(function (item) {
|
|
2955
3031
|
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
2956
|
-
key: item.
|
|
2957
|
-
label: item.
|
|
3032
|
+
key: item.value,
|
|
3033
|
+
label: item.text
|
|
2958
3034
|
}, LightHeightOption({
|
|
2959
|
-
text: "".concat(item.
|
|
3035
|
+
text: "".concat(item.value, " ").concat(item.text),
|
|
2960
3036
|
filterTxt: searchValue
|
|
2961
3037
|
}));
|
|
2962
3038
|
})), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -2979,7 +3055,8 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
2979
3055
|
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
2980
3056
|
key: "submit",
|
|
2981
3057
|
type: "primary",
|
|
2982
|
-
onClick: handleOk
|
|
3058
|
+
onClick: handleOk,
|
|
3059
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
2983
3060
|
}, "\u786E\u5B9A")]
|
|
2984
3061
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2985
3062
|
className: 'search_select_wrapper'
|
|
@@ -3000,7 +3077,8 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3000
3077
|
className: 'select_list_columns_formItems'
|
|
3001
3078
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
3002
3079
|
form: form,
|
|
3003
|
-
layout: 'vertical'
|
|
3080
|
+
layout: 'vertical',
|
|
3081
|
+
key: 'modalForm'
|
|
3004
3082
|
}, formItem(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm)))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3005
3083
|
className: 'select_list_searchButton'
|
|
3006
3084
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -3038,6 +3116,13 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3038
3116
|
scroll: {
|
|
3039
3117
|
x: modalTableProps.overScrollX || 'max-content',
|
|
3040
3118
|
y: modalTableProps.overScrollY || null
|
|
3119
|
+
},
|
|
3120
|
+
onRow: function onRow(record) {
|
|
3121
|
+
return {
|
|
3122
|
+
onDoubleClick: function onDoubleClick(event) {
|
|
3123
|
+
return onDoubleClickSelect(event, record);
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3041
3126
|
}
|
|
3042
3127
|
}), selectMode ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3043
3128
|
className: 'select_list_selectAll'
|
|
@@ -3048,6 +3133,245 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3048
3133
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
3049
3134
|
};
|
|
3050
3135
|
|
|
3136
|
+
var getDicData = function getDicData(dicCode) {
|
|
3137
|
+
var dicData = {};
|
|
3138
|
+
|
|
3139
|
+
{
|
|
3140
|
+
var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
|
|
3141
|
+
dicData = storageDic[dicCode];
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
if (!dicData || !dicData.length) ;
|
|
3145
|
+
|
|
3146
|
+
return dicData;
|
|
3147
|
+
};
|
|
3148
|
+
|
|
3149
|
+
var getDictionarySource = function getDictionarySource(dicCode) {
|
|
3150
|
+
var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3151
|
+
var dicData = getDicData(dicCode);
|
|
3152
|
+
|
|
3153
|
+
try {
|
|
3154
|
+
if (needConvertInterger) {
|
|
3155
|
+
dicData = dicData.map(function (item) {
|
|
3156
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
3157
|
+
value: parseFloat(item.value)
|
|
3158
|
+
});
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
} catch (e) {}
|
|
3162
|
+
|
|
3163
|
+
return dicData;
|
|
3164
|
+
};
|
|
3165
|
+
|
|
3166
|
+
var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
|
|
3167
|
+
var dicData = getDicData(dicCode);
|
|
3168
|
+
if (value === undefined) return '';
|
|
3169
|
+
var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
|
|
3170
|
+
return item.value === value.toString();
|
|
3171
|
+
});
|
|
3172
|
+
|
|
3173
|
+
if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
|
|
3174
|
+
// throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
|
|
3175
|
+
return value;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
return dicItemArray[0].text;
|
|
3179
|
+
};
|
|
3180
|
+
|
|
3181
|
+
var loadSelectSource = function loadSelectSource(url, params) {
|
|
3182
|
+
return new Promise(function (resolve, reject) {
|
|
3183
|
+
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(params))).then(function (result) {
|
|
3184
|
+
result = result.data;
|
|
3185
|
+
|
|
3186
|
+
if (result.status !== '0') {
|
|
3187
|
+
antd.message.error(result.msg);
|
|
3188
|
+
return;
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
resolve(result);
|
|
3192
|
+
}).catch(function (err) {
|
|
3193
|
+
reject(err);
|
|
3194
|
+
});
|
|
3195
|
+
});
|
|
3196
|
+
};
|
|
3197
|
+
|
|
3198
|
+
function commonFun(type, prefixURL) {
|
|
3199
|
+
// 默认type === 'supplier' 供应商选择器
|
|
3200
|
+
var requestConfig = {
|
|
3201
|
+
url: "".concat(prefixURL.selectPrefix, "/supplier"),
|
|
3202
|
+
filter: 'qp-nameAndCode-like',
|
|
3203
|
+
otherParams: {
|
|
3204
|
+
sorter: 'desc-id'
|
|
3205
|
+
} // 默认参数
|
|
3206
|
+
|
|
3207
|
+
};
|
|
3208
|
+
/*
|
|
3209
|
+
* 处理 格式化下拉框数据源
|
|
3210
|
+
* reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
|
|
3211
|
+
* 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
|
|
3212
|
+
* position 必传 为获取Promise.all请求结果的位置
|
|
3213
|
+
* changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
|
|
3214
|
+
* changeSearchForm 必传 为搜索表单Form数据
|
|
3215
|
+
* */
|
|
3216
|
+
|
|
3217
|
+
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
3218
|
+
var _reData$position, _reData$position$data;
|
|
3219
|
+
|
|
3220
|
+
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) || [];
|
|
3221
|
+
var formatData = (data === null || data === void 0 ? void 0 : data.length) ? data.map(function (v) {
|
|
3222
|
+
return {
|
|
3223
|
+
text: v.name,
|
|
3224
|
+
value: v.code
|
|
3225
|
+
};
|
|
3226
|
+
}) : [];
|
|
3227
|
+
changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
|
|
3228
|
+
initialSource: formatData
|
|
3229
|
+
});
|
|
3230
|
+
};
|
|
3231
|
+
|
|
3232
|
+
var tableSearchForm = [];
|
|
3233
|
+
|
|
3234
|
+
if (type === 'supplier') {
|
|
3235
|
+
tableSearchForm = [{
|
|
3236
|
+
name: 'qp-name-like',
|
|
3237
|
+
label: '客户名称'
|
|
3238
|
+
}, {
|
|
3239
|
+
name: 'qp-code-like',
|
|
3240
|
+
label: '客户编码'
|
|
3241
|
+
}, {
|
|
3242
|
+
name: 'qp-conglomerateCode-in',
|
|
3243
|
+
type: 'select',
|
|
3244
|
+
label: '归属集团',
|
|
3245
|
+
field: {
|
|
3246
|
+
type: 'select',
|
|
3247
|
+
props: {
|
|
3248
|
+
mode: 'multiple',
|
|
3249
|
+
notFoundContent: '暂无数据',
|
|
3250
|
+
allowClear: true,
|
|
3251
|
+
showSearch: true,
|
|
3252
|
+
showArrow: true,
|
|
3253
|
+
maxTagCount: 1,
|
|
3254
|
+
optionFilterProp: 'children',
|
|
3255
|
+
filterOption: function filterOption(input, option) {
|
|
3256
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
}, {
|
|
3261
|
+
name: 'qp-accountingCode-in',
|
|
3262
|
+
type: 'select',
|
|
3263
|
+
label: '归属核算主体',
|
|
3264
|
+
field: {
|
|
3265
|
+
type: 'select',
|
|
3266
|
+
props: {
|
|
3267
|
+
mode: 'multiple',
|
|
3268
|
+
notFoundContent: '暂无数据',
|
|
3269
|
+
allowClear: true,
|
|
3270
|
+
showSearch: true,
|
|
3271
|
+
showArrow: true,
|
|
3272
|
+
maxTagCount: 1,
|
|
3273
|
+
optionFilterProp: 'children',
|
|
3274
|
+
filterOption: function filterOption(input, option) {
|
|
3275
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
}, {
|
|
3280
|
+
name: 'qp-companyCode-in',
|
|
3281
|
+
type: 'select',
|
|
3282
|
+
label: '归属法人公司',
|
|
3283
|
+
field: {
|
|
3284
|
+
type: 'select',
|
|
3285
|
+
props: {
|
|
3286
|
+
mode: 'multiple',
|
|
3287
|
+
notFoundContent: '暂无数据',
|
|
3288
|
+
allowClear: true,
|
|
3289
|
+
showSearch: true,
|
|
3290
|
+
showArrow: true,
|
|
3291
|
+
maxTagCount: 1,
|
|
3292
|
+
optionFilterProp: 'children',
|
|
3293
|
+
filterOption: function filterOption(input, option) {
|
|
3294
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
}, {
|
|
3299
|
+
name: 'qp-sharingType-eq',
|
|
3300
|
+
type: 'select',
|
|
3301
|
+
label: '共享类型',
|
|
3302
|
+
initialSource: getDictionarySource('UC000013')
|
|
3303
|
+
}];
|
|
3304
|
+
Promise.all([loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
|
|
3305
|
+
pageSize: 5000,
|
|
3306
|
+
currentPage: 1,
|
|
3307
|
+
'qp-companyType-eq': '30'
|
|
3308
|
+
}), loadSelectSource("".concat(prefixURL.formSelectFix, "/accountingSubject"), {
|
|
3309
|
+
pageSize: 5000,
|
|
3310
|
+
currentPage: 1
|
|
3311
|
+
}), loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
|
|
3312
|
+
pageSize: 5000,
|
|
3313
|
+
currentPage: 1,
|
|
3314
|
+
'qp-companyType-eq': '20'
|
|
3315
|
+
})]).then(function (x) {
|
|
3316
|
+
formatSource(x, 0, 2, tableSearchForm);
|
|
3317
|
+
formatSource(x, 1, 3, tableSearchForm);
|
|
3318
|
+
formatSource(x, 2, 4, tableSearchForm);
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
var modalTableProps = {
|
|
3323
|
+
modalTableTitle: '选择供应商',
|
|
3324
|
+
tableSearchForm: tableSearchForm,
|
|
3325
|
+
tableColumns: [{
|
|
3326
|
+
title: '客户编码',
|
|
3327
|
+
dataIndex: 'code'
|
|
3328
|
+
}, {
|
|
3329
|
+
title: '客户名称',
|
|
3330
|
+
dataIndex: 'name'
|
|
3331
|
+
}, {
|
|
3332
|
+
title: '归属集团',
|
|
3333
|
+
dataIndex: 'conglomerateName'
|
|
3334
|
+
}, {
|
|
3335
|
+
title: '归属法人公司',
|
|
3336
|
+
dataIndex: 'legalCompanyName'
|
|
3337
|
+
}, {
|
|
3338
|
+
title: '归属核算主体',
|
|
3339
|
+
dataIndex: 'accountingName'
|
|
3340
|
+
}, {
|
|
3341
|
+
title: '共享类型',
|
|
3342
|
+
dataIndex: 'sharingType',
|
|
3343
|
+
render: function render(text) {
|
|
3344
|
+
return getDictionaryTextByValue('UC000013', text);
|
|
3345
|
+
}
|
|
3346
|
+
}]
|
|
3347
|
+
}; // 商品选择器
|
|
3348
|
+
|
|
3349
|
+
return {
|
|
3350
|
+
modalTableProps: modalTableProps,
|
|
3351
|
+
requestConfig: requestConfig
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
3356
|
+
var businessType = (props === null || props === void 0 ? void 0 : props.SelectBusinessType) || 'supplier';
|
|
3357
|
+
var prefixURL = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
3358
|
+
selectPrefix: '/bop/api',
|
|
3359
|
+
formSelectFix: '/bop/api'
|
|
3360
|
+
};
|
|
3361
|
+
|
|
3362
|
+
var _commonFun = commonFun(businessType, prefixURL),
|
|
3363
|
+
requestConfig = _commonFun.requestConfig,
|
|
3364
|
+
modalTableProps = _commonFun.modalTableProps;
|
|
3365
|
+
|
|
3366
|
+
var currentProps = _objectSpread2(_objectSpread2({
|
|
3367
|
+
requestConfig: requestConfig
|
|
3368
|
+
}, props), {}, {
|
|
3369
|
+
modalTableProps: modalTableProps
|
|
3370
|
+
});
|
|
3371
|
+
|
|
3372
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(SearchSelect, _objectSpread2({}, currentProps)));
|
|
3373
|
+
};
|
|
3374
|
+
|
|
3051
3375
|
/*
|
|
3052
3376
|
* @Description:
|
|
3053
3377
|
* @Author: rodchen
|
|
@@ -3059,6 +3383,7 @@ var SearchSelect = function SearchSelect(_ref) {
|
|
|
3059
3383
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
3060
3384
|
axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
3061
3385
|
|
|
3386
|
+
exports.BusinessSearchSelect = BusinessSearchSelect;
|
|
3062
3387
|
exports.CheckOneUser = index;
|
|
3063
3388
|
exports.DataValidation = DataValidation;
|
|
3064
3389
|
exports.QueryMutipleInput = QueryMutipleInput;
|