@bit-sun/business-component 1.1.39 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1959,7 +1959,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1959
1959
  }).map(function (item) {
1960
1960
  var obj = {};
1961
1961
  item.slice(0, itemsTemp.length).map(function (innerItem, index) {
1962
- obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.v : innerItem.m);
1962
+ obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
1963
1963
  });
1964
1964
  return obj;
1965
1965
  });
@@ -2259,6 +2259,639 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2259
2259
  return DataValidation;
2260
2260
  }(React.Component);
2261
2261
 
2262
+ var _excluded$3 = ["flag", "checkResults"],
2263
+ _excluded2$1 = ["flag", "checkResults"];
2264
+
2265
+ var itemsTemp$1 = [];
2266
+ var luckysheet$1; // const mapping = [
2267
+ // { "key": "skuCode", "name": "SKU编码", "rule": "skuCode" },
2268
+ // { "key": "quantity", "name": "数量", "rule": "quantity" },
2269
+ // { "key": "price", "name": "单价", "rule": "price" }
2270
+ // ]
2271
+
2272
+ var mapping$1 = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号'], ['warehouseCode', '仓库编码'], ['regionCode', '库区'], ['locationCode', '货位'], ['rowNumber', '货位排数'], ['layerNumber', '货位层数'], ['gridNumber', '货位格号'], ['oldUniqueCode', '原始唯一码'], ['newUniqueCode', '新唯一码'], ['relationRecordCode', '单据编码'], ['remark', '备注']]); // for dnd
2273
+
2274
+
2275
+ var reorder$1 = function reorder(list, startIndex, endIndex) {
2276
+ var result = Array.from(list);
2277
+
2278
+ var _result$splice = result.splice(startIndex, 1),
2279
+ _result$splice2 = _slicedToArray(_result$splice, 1),
2280
+ removed = _result$splice2[0];
2281
+
2282
+ result.splice(endIndex, 0, removed);
2283
+ return result;
2284
+ };
2285
+
2286
+ var grid$1 = 8;
2287
+
2288
+ var getItemStyle$1 = function getItemStyle(isDragging, draggableStyle) {
2289
+ return _objectSpread2({
2290
+ // some basic styles to make the items look a bit nicer
2291
+ userSelect: 'none',
2292
+ padding: "4px",
2293
+ margin: "4px"
2294
+ }, draggableStyle);
2295
+ };
2296
+
2297
+ var getListStyle$1 = function getListStyle(isDraggingOver) {
2298
+ return {
2299
+ background: isDraggingOver ? '#fff' : '#fff',
2300
+ display: 'flex',
2301
+ padding: grid$1,
2302
+ overflow: 'auto'
2303
+ };
2304
+ };
2305
+
2306
+ var filterLetters$1 = function filterLetters(i) {
2307
+ if (i >= 0 && i <= 25) {
2308
+ return String.fromCharCode(65 + i);
2309
+ } else {
2310
+ return undefined;
2311
+ }
2312
+ };
2313
+
2314
+ var DataValidation$1 = /*#__PURE__*/function (_React$Component) {
2315
+ _inherits(DataValidation, _React$Component);
2316
+
2317
+ var _super = _createSuper(DataValidation);
2318
+
2319
+ function DataValidation(props) {
2320
+ var _this;
2321
+
2322
+ _classCallCheck(this, DataValidation);
2323
+
2324
+ _this = _super.call(this, props);
2325
+
2326
+ _this.getCount = function () {
2327
+ var resultData = _this.state.resultData;
2328
+ return {
2329
+ total: resultData.length,
2330
+ error: resultData.filter(function (item) {
2331
+ return !item.flag;
2332
+ }).length
2333
+ };
2334
+ };
2335
+
2336
+ _this.setConfig = function (data) {
2337
+ var _ref;
2338
+
2339
+ var items = _this.state.items;
2340
+ var notValid = _this.props.notValid;
2341
+ return {
2342
+ container: 'luckysheet',
2343
+ showtoolbar: false,
2344
+ hook: {
2345
+ columnTitleCellRenderBefore: function columnTitleCellRenderBefore(columnAbc, postion, ctx) {
2346
+ if (columnAbc.name) {
2347
+ var charCode = columnAbc.name.charCodeAt();
2348
+
2349
+ if (charCode - 65 <= items.length) {
2350
+ columnAbc.name = itemsTemp$1[charCode - 65] ? itemsTemp$1[charCode - 65].content : !notValid ? '校验结果' : '';
2351
+ } else {
2352
+ columnAbc.name = '';
2353
+ }
2354
+ }
2355
+ },
2356
+ cellRenderBefore: function cellRenderBefore(cell, postion, sheetFile, ctx) {
2357
+ if (cell) {
2358
+ cell.fs = 10;
2359
+
2360
+ if (typeof cell.v === 'string') {
2361
+ cell.m = cell.v = cell.m.trim();
2362
+ }
2363
+
2364
+ if (cell && cell.m && cell.m.indexOf('E+') !== -1) {
2365
+ cell.v = cell.v.toString();
2366
+ cell.m = cell.v;
2367
+ }
2368
+
2369
+ if (typeof cell.v === 'number') {
2370
+ cell.v = cell.m;
2371
+ }
2372
+ } // console.log(postion);
2373
+
2374
+ },
2375
+ cellAllRenderBefore: function cellAllRenderBefore(data, sheetFile, ctx) {
2376
+ sheetFile.config.borderInfo = []; // console.info(data,sheetFile,ctx)
2377
+ }
2378
+ },
2379
+ // showtoolbarConfig: {
2380
+ // undoRedo: true, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏
2381
+ // paintFormat: false, //格式刷
2382
+ // currencyFormat: false, //货币格式
2383
+ // percentageFormat: false, //百分比格式
2384
+ // numberDecrease: false, // '减少小数位数'
2385
+ // numberIncrease: false, // '增加小数位数
2386
+ // moreFormats: false, // '更多格式'
2387
+ // font: true, // '字体'
2388
+ // fontSize: true, // '字号大小'
2389
+ // },
2390
+ data: [(_ref = {
2391
+ name: 'Cell',
2392
+ color: '',
2393
+ index: 0,
2394
+ status: 1,
2395
+ order: 0,
2396
+ hide: 0,
2397
+ row: 36,
2398
+ column: 18,
2399
+ defaultRowHeight: 20,
2400
+ defaultColWidth: 120,
2401
+ config: {},
2402
+ // celldata:
2403
+ // data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
2404
+ // "r": b,
2405
+ // "c": d,
2406
+ // "v": { "ct": { "fa": "@", "t": "s" }, }
2407
+ // }))))
2408
+ // ,
2409
+ celldata: data && data.length !== 0 ? data : _.flattenDeep(Array.from({
2410
+ length: 100
2411
+ }).map(function (a, b) {
2412
+ return Array.from({
2413
+ length: 100
2414
+ }).map(function (c, d) {
2415
+ return {
2416
+ "r": b,
2417
+ "c": d,
2418
+ "v": {
2419
+ "ct": {
2420
+ "fa": "@",
2421
+ "t": "s"
2422
+ }
2423
+ }
2424
+ };
2425
+ });
2426
+ })),
2427
+ scrollLeft: 0,
2428
+ // "scrollTop": 315, //上下滚动条位置
2429
+ luckysheet_select_save: [],
2430
+ calcChain: [],
2431
+ isPivotTable: false,
2432
+ pivotTable: {},
2433
+ filter_select: {},
2434
+ filter: null,
2435
+ luckysheet_alternateformat_save: [],
2436
+ luckysheet_alternateformat_save_modelCustom: [],
2437
+ luckysheet_conditionformat_save: {},
2438
+ frozen: {},
2439
+ chart: [],
2440
+ zoomRatio: 1,
2441
+ image: [],
2442
+ showGridLines: 1,
2443
+ dataVerification: {}
2444
+ }, _defineProperty(_ref, "luckysheet_alternateformat_save", [{
2445
+ cellrange: {
2446
+ //单元格范围
2447
+ row: [0, 1000],
2448
+ column: [0, 18]
2449
+ },
2450
+ format: {
2451
+ head: {
2452
+ //页眉颜色
2453
+ fc: '#6aa84f',
2454
+ bc: '#ffffff'
2455
+ },
2456
+ one: {
2457
+ //第一种颜色
2458
+ bc: '#ffffff'
2459
+ },
2460
+ two: {
2461
+ //第二种颜色
2462
+ bc: '#f2f4f5'
2463
+ },
2464
+ foot: {
2465
+ //页脚颜色
2466
+ fc: '#000',
2467
+ bc: '#a5efcc'
2468
+ }
2469
+ },
2470
+ hasRowHeader: false,
2471
+ hasRowFooter: false //含有页脚
2472
+
2473
+ }]), _defineProperty(_ref, "luckysheet_alternateformat_save_modelCustom", [{
2474
+ head: {
2475
+ //页眉颜色
2476
+ fc: '#6aa84f',
2477
+ bc: '#ffffff'
2478
+ },
2479
+ one: {
2480
+ //第一种颜色
2481
+ fc: '#000',
2482
+ bc: '#ffffff'
2483
+ },
2484
+ two: {
2485
+ //第二种颜色
2486
+ fc: '#000',
2487
+ bc: '#e5fbee'
2488
+ },
2489
+ foot: {
2490
+ //页脚颜色
2491
+ fc: '#000',
2492
+ bc: '#a5efcc'
2493
+ }
2494
+ }]), _ref)],
2495
+ cellRightClickConfig: {
2496
+ copy: false,
2497
+ copyAs: false,
2498
+ paste: false,
2499
+ insertRow: false,
2500
+ insertColumn: false,
2501
+ // deleteRow: false, // 删除选中行
2502
+ // deleteColumn: false, // 删除选中列
2503
+ deleteCell: false,
2504
+ hideRow: false,
2505
+ hideColumn: false,
2506
+ rowHeight: false,
2507
+ columnWidth: false,
2508
+ clear: false,
2509
+ matrix: false,
2510
+ sort: false,
2511
+ filter: false,
2512
+ chart: false,
2513
+ image: false,
2514
+ link: false,
2515
+ data: false,
2516
+ cellFormat: false // 设置单元格格式
2517
+
2518
+ },
2519
+ showsheetbar: false,
2520
+ optionstate: false,
2521
+ showstatisticBarConfig: {
2522
+ count: false,
2523
+ view: false,
2524
+ zoom: false // 缩放
2525
+
2526
+ },
2527
+ column: 10,
2528
+ columnHeaderHeight: 30,
2529
+ lang: 'zh',
2530
+ defaultFontSize: '10',
2531
+ frozen: {
2532
+ type: 'rangeBoth',
2533
+ range: {
2534
+ row_focus: 1,
2535
+ column_focus: 1
2536
+ }
2537
+ }
2538
+ };
2539
+ };
2540
+
2541
+ _this.getValidateData = function () {
2542
+ var resultData = _this.state.resultData;
2543
+ return {
2544
+ successData: resultData.filter(function (item) {
2545
+ return item.flag;
2546
+ }).map(function (_ref2) {
2547
+ var flag = _ref2.flag,
2548
+ checkResults = _ref2.checkResults,
2549
+ item = _objectWithoutProperties(_ref2, _excluded$3);
2550
+
2551
+ return item;
2552
+ }),
2553
+ failData: resultData.filter(function (item) {
2554
+ return !item.flag;
2555
+ }).map(function (_ref3) {
2556
+ var flag = _ref3.flag,
2557
+ checkResults = _ref3.checkResults,
2558
+ item = _objectWithoutProperties(_ref3, _excluded2$1);
2559
+
2560
+ return item;
2561
+ })
2562
+ };
2563
+ };
2564
+
2565
+ _this.getData = function () {
2566
+ console.time();
2567
+ var sheetData = luckysheet$1.getSheetData();
2568
+ var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
2569
+ debugger;
2570
+ return item[0];
2571
+ }).map(function (item) {
2572
+ var obj = {};
2573
+ item.slice(0, itemsTemp$1.length).map(function (innerItem, index) {
2574
+ obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
2575
+ });
2576
+ return obj;
2577
+ });
2578
+ return data.filter(function (item) {
2579
+ return item[_this.props.customerColumnsMapping[0].name];
2580
+ });
2581
+ };
2582
+
2583
+ _this.resetData = function () {
2584
+ var _this$props = _this.props,
2585
+ validDataUrl = _this$props.validDataUrl,
2586
+ updateData = _this$props.updateData,
2587
+ columns = _this$props.columns;
2588
+
2589
+ var resultData = _this.getData().filter(function (d) {
2590
+ return _.compact(Object.values(d)).length;
2591
+ });
2592
+
2593
+ axios.post(validDataUrl, {
2594
+ columns: columns,
2595
+ data: resultData
2596
+ }).then(function (result) {
2597
+ result = result.data;
2598
+
2599
+ if (result.status !== '0') {
2600
+ message.error(result.msg);
2601
+ return;
2602
+ }
2603
+
2604
+ var items = _this.state.items;
2605
+ var validIndex = items.length;
2606
+ var res = result.data;
2607
+ var sheetData = luckysheet$1.getSheetData();
2608
+ sheetData.map(function (item, index) {
2609
+ if (!res[index]) return item;
2610
+
2611
+ var changeVMIndex = _this.props.columns.findIndex(function (i) {
2612
+ return i === 'skuCode';
2613
+ });
2614
+
2615
+ if (_this.props.columns.find(function (i) {
2616
+ return i === 'skuCode';
2617
+ }) && item[changeVMIndex].v !== res[index].skuCode) {
2618
+ item[changeVMIndex].v = res[index].skuCode;
2619
+ item[changeVMIndex].m = res[index].skuCode;
2620
+ }
2621
+
2622
+ if (res[index].flag) {
2623
+ item[validIndex] = _objectSpread2(_objectSpread2({}, item[validIndex]), {}, {
2624
+ v: '通过',
2625
+ m: '通过',
2626
+ fc: 'green' //字体颜色为 "#990000"
2627
+
2628
+ });
2629
+ } else {
2630
+ item[validIndex] = _objectSpread2(_objectSpread2({}, item[validIndex]), {}, {
2631
+ v: res[index].checkResults,
2632
+ m: res[index].checkResults,
2633
+ fc: 'red' //字体颜色为 "#990000"
2634
+
2635
+ });
2636
+ }
2637
+
2638
+ item[validIndex].ct = {
2639
+ fa: 'General',
2640
+ t: 'g'
2641
+ };
2642
+ }); // sheetData.map((item, index) => {
2643
+ // luckysheet.setCellValue(index + 1, 4, 345)
2644
+ // })
2645
+
2646
+ luckysheet$1.create(_this.setConfig(luckysheet$1.transToCellData(sheetData)));
2647
+
2648
+ _this.setState({
2649
+ data: luckysheet$1.transToCellData(sheetData),
2650
+ errorListCheck: false,
2651
+ resultData: res
2652
+ });
2653
+
2654
+ console.log(setExportData);
2655
+ setExportData([123123]);
2656
+ }).catch(function (err) {});
2657
+ };
2658
+
2659
+ _this.filterData = function (type) {
2660
+ var _this$state = _this.state,
2661
+ showErrorData = _this$state.showErrorData,
2662
+ data = _this$state.data,
2663
+ resultData = _this$state.resultData;
2664
+ var sheetData = luckysheet$1.transToData(data).filter(function (item, index) {
2665
+ if (type === 'all') {
2666
+ return false;
2667
+ }
2668
+
2669
+ if (type === 'error') {
2670
+ return item[itemsTemp$1.length] && item[itemsTemp$1.length].v === '通过';
2671
+ }
2672
+ });
2673
+ luckysheet$1.create(_this.setConfig(luckysheet$1.transToCellData(sheetData)));
2674
+
2675
+ _this.setState({
2676
+ data: luckysheet$1.transToCellData(sheetData),
2677
+ errorListCheck: false,
2678
+ resultData: type === 'all' ? [] : resultData.filter(function (item) {
2679
+ return item.flag;
2680
+ })
2681
+ });
2682
+ };
2683
+
2684
+ _this.toggleData = function () {
2685
+ var _this$state2 = _this.state,
2686
+ showErrorData = _this$state2.showErrorData,
2687
+ data = _this$state2.data;
2688
+
2689
+ if (showErrorData) {
2690
+ luckysheet$1.create(_this.setConfig(data));
2691
+ } else {
2692
+ var sheetData = luckysheet$1.getSheetData();
2693
+ sheetData = sheetData.filter(function (item, index) {
2694
+ return !item[itemsTemp$1.length] || item[itemsTemp$1.length].v !== '通过';
2695
+ });
2696
+ luckysheet$1.create(_this.setConfig(luckysheet$1.transToCellData(sheetData)));
2697
+ }
2698
+
2699
+ _this.setState({
2700
+ showErrorData: !showErrorData
2701
+ });
2702
+ };
2703
+
2704
+ _this.onChange = function (e) {
2705
+ _this.setState({
2706
+ radioValue: e.target.value
2707
+ });
2708
+
2709
+ _this.toggleData();
2710
+ };
2711
+
2712
+ _this.errorChange = function (e) {
2713
+ _this.toggleData();
2714
+
2715
+ _this.setState({
2716
+ errorListCheck: e.target.checked
2717
+ });
2718
+ };
2719
+
2720
+ _this.menuList = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
2721
+ key: "1",
2722
+ className: "sheet_table-menu_item_text"
2723
+ }, /*#__PURE__*/React.createElement("a", {
2724
+ onClick: function onClick() {
2725
+ return _this.filterData('all');
2726
+ }
2727
+ }, "\u6E05\u7A7A\u5168\u90E8\u6570\u636E")), /*#__PURE__*/React.createElement(Menu.Divider, null), !_this.props.notValid && /*#__PURE__*/React.createElement(Menu.Item, {
2728
+ key: "2",
2729
+ className: "sheet_table-menu_item_text"
2730
+ }, /*#__PURE__*/React.createElement("a", {
2731
+ onClick: function onClick() {
2732
+ return _this.filterData('error');
2733
+ }
2734
+ }, "\u4EC5\u6E05\u7A7A\u9519\u8BEF\u6570\u636E")));
2735
+ _this.leftMenu = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
2736
+ key: "3",
2737
+ className: "sheet_table-menu_item_text"
2738
+ }, /*#__PURE__*/React.createElement("span", {
2739
+ className: "sheet_table_text"
2740
+ }, "\u8BF7\u62D6\u52A8\u5B57\u6BB5\u6765\u5BF9\u5E94\u5217")), /*#__PURE__*/React.createElement(Menu.Divider, null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DragDropContext, {
2741
+ onDragEnd: function onDragEnd(e) {
2742
+ return _this.onDragEnd(e);
2743
+ }
2744
+ }, /*#__PURE__*/React.createElement(Droppable, {
2745
+ droppableId: "droppable",
2746
+ direction: "vertical"
2747
+ }, function (provided, snapshot) {
2748
+ return /*#__PURE__*/React.createElement("div", _objectSpread2({
2749
+ ref: provided.innerRef,
2750
+ style: _objectSpread2(_objectSpread2({}, getListStyle$1(snapshot.isDraggingOver)), {}, {
2751
+ flexDirection: 'column'
2752
+ })
2753
+ }, provided.droppableProps), _this.state.items.map(function (item, index) {
2754
+ return /*#__PURE__*/React.createElement(Draggable, {
2755
+ key: item.id,
2756
+ draggableId: item.id,
2757
+ index: index
2758
+ }, function (provided, snapshot) {
2759
+ return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2(_objectSpread2({
2760
+ ref: provided.innerRef
2761
+ }, provided.draggableProps), provided.dragHandleProps), {}, {
2762
+ style: getItemStyle$1(snapshot.isDragging, provided.draggableProps.style)
2763
+ }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement("span", null, filterLetters$1(index), " \u5217 "), /*#__PURE__*/React.createElement(Space, {
2764
+ className: "sheet_table_dnd_text"
2765
+ }, /*#__PURE__*/React.createElement(UnorderedListOutlined$2, null), item.content)));
2766
+ });
2767
+ }), provided.placeholder);
2768
+ }))));
2769
+
2770
+ _this.props.onRef(_assertThisInitialized(_this));
2771
+
2772
+ if (props.customerColumnsMapping) {
2773
+ itemsTemp$1 = props.customerColumnsMapping.map(function (item, index) {
2774
+ return {
2775
+ id: "item-0".concat(index),
2776
+ content: item.title,
2777
+ code: item.name,
2778
+ "ct": {
2779
+ "fa": "General",
2780
+ "t": "s" //格式类型为数字类型
2781
+
2782
+ }
2783
+ };
2784
+ });
2785
+ } else {
2786
+ itemsTemp$1 = props.columns.map(function (item, index) {
2787
+ if (!mapping$1.get(item)) throw Error("".concat(item, " is not in DataValidation component, please fix this error"));
2788
+ return {
2789
+ id: "item-0".concat(index),
2790
+ content: mapping$1.get(item),
2791
+ code: item,
2792
+ "ct": {
2793
+ "fa": "General",
2794
+ "t": "s" //格式类型为数字类型
2795
+
2796
+ }
2797
+ };
2798
+ });
2799
+ }
2800
+
2801
+ luckysheet$1 = window.luckysheet;
2802
+ _this.state = {
2803
+ showErrorData: false,
2804
+ data: [],
2805
+ items: _toConsumableArray(itemsTemp$1),
2806
+ resultData: [],
2807
+ errorListCheck: false
2808
+ };
2809
+ return _this;
2810
+ }
2811
+
2812
+ _createClass(DataValidation, [{
2813
+ key: "onDragEnd",
2814
+ value: function onDragEnd(result) {
2815
+ // dropped outside the list
2816
+ if (!result.destination) {
2817
+ return;
2818
+ }
2819
+
2820
+ var items = reorder$1(this.state.items, result.source.index, result.destination.index);
2821
+ this.setState({
2822
+ items: items
2823
+ });
2824
+ itemsTemp$1 = items;
2825
+ luckysheet$1.refresh();
2826
+ }
2827
+ }, {
2828
+ key: "componentDidMount",
2829
+ value: function componentDidMount() {
2830
+ luckysheet$1.create(this.setConfig([]));
2831
+ }
2832
+ }, {
2833
+ key: "componentWillUnmount",
2834
+ value: function componentWillUnmount() {
2835
+ // luckysheet.create(this.setConfig([]));
2836
+ luckysheet$1.destroy();
2837
+ }
2838
+ }, {
2839
+ key: "render",
2840
+ value: function render() {
2841
+ var errorListCheck = this.state.errorListCheck;
2842
+ var _this$props2 = this.props,
2843
+ title = _this$props2.title,
2844
+ notValid = _this$props2.notValid,
2845
+ customerColumnsMapping = _this$props2.customerColumnsMapping;
2846
+ var totalSummary = this.getCount();
2847
+ var luckyCss = {
2848
+ margin: '0px',
2849
+ padding: '0px',
2850
+ position: 'absolute',
2851
+ width: '100%',
2852
+ height: '100%',
2853
+ left: '0px',
2854
+ top: '0px'
2855
+ };
2856
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2857
+ className: "sheet_table_top"
2858
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement("span", null, "\u6392\u5E8F\u5217"), /*#__PURE__*/React.createElement(Dropdown, {
2859
+ trigger: ['click'],
2860
+ overlay: this.leftMenu,
2861
+ placement: "bottomLeft"
2862
+ }, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(ProfileTwoTone$2, null))), /*#__PURE__*/React.createElement(Tooltip, {
2863
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "\u4F7F\u7528\u6307\u5357\uFF1A"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("span", null, "1\u3001\u62D6\u52A8\u6570\u636E\u9879\uFF0C\u4EE5\u9002\u914D\u6E90\u6570\u636E\u7684\u987A\u5E8F\uFF0C\u5982\u60A8Excel\u4E2D\u6570\u636E\u6392\u5E8F\u4F9D\u6B21\u4E3A\u7F16\u7801\u3001\u4EF7\u683C\u548C\u6570\u91CF\uFF0C\u5219\u60A8\u4E5F\u53EF\u4EE5\u5C06\u6570\u636E\u9879\u7684\u987A\u5E8F\u8C03\u6574\u4E3A\u4E00\u81F4"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("span", null, "2\u3001\u590D\u5236\u6587\u4EF6\u6570\u636E\uFF08\u591A\u5217\u4E00\u8D77\uFF09\uFF0C\u5728\u6587\u672C\u6846\u5185\u8FDB\u884C\u7C98\u8D34"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("span", null, "3\u3001\u70B9\u51FB\u8BC6\u522B\u6309\u94AE\u8FDB\u884C\u6570\u636E\u6821\u9A8C\uFF0C\u5982\u5168\u90E8\u6B63\u786E\uFF0C\u5219\u70B9\u51FB\u5F55\u5165\u6309\u94AE\u53EF\u5F55\u5165\u6570\u636E\uFF0C\u5982\u5B58\u5728\u9519\u8BEF\u6570\u636E\uFF0C\u5219\u9700\u4FEE\u6539\u540E\u518D\u8FDB\u884C\u5F55\u5165"))
2864
+ }, /*#__PURE__*/React.createElement(ExclamationCircleOutlined$2, null))), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Dropdown, {
2865
+ trigger: ['click'],
2866
+ overlay: this.menuList,
2867
+ placement: "bottomRight"
2868
+ }, /*#__PURE__*/React.createElement(Button, null, "\u6E05\u7A7A", /*#__PURE__*/React.createElement(DownOutlined$2, null))), !notValid && /*#__PURE__*/React.createElement(Button, {
2869
+ type: "primary",
2870
+ onClick: this.resetData
2871
+ }, "\u8BC6\u522B"))), /*#__PURE__*/React.createElement("div", {
2872
+ style: {
2873
+ position: 'relative',
2874
+ height: '400px'
2875
+ }
2876
+ }, /*#__PURE__*/React.createElement("div", {
2877
+ id: "luckysheet",
2878
+ style: luckyCss
2879
+ })), !this.props.notValid && /*#__PURE__*/React.createElement("div", {
2880
+ className: "sheet_table_footer"
2881
+ }, /*#__PURE__*/React.createElement("span", {
2882
+ className: "sheet_table_footer_l"
2883
+ }, "\u5171 ", totalSummary.total, " \u6761\u6570\u636E", !notValid && ", \u5176\u4E2D\u9519\u8BEF ".concat(totalSummary.error, " \u9879")), !notValid && /*#__PURE__*/React.createElement(Space, {
2884
+ className: "sheet_table_footer_r"
2885
+ }, /*#__PURE__*/React.createElement(Checkbox, {
2886
+ checked: errorListCheck,
2887
+ onClick: this.errorChange
2888
+ }), "\u4EC5\u5C55\u793A\u9519\u8BEF\u6570\u636E")));
2889
+ }
2890
+ }]);
2891
+
2892
+ return DataValidation;
2893
+ }(React.Component);
2894
+
2262
2895
  var css_248z$1 = ".query_input_show {\n display: flex;\n}\n.query_input_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.query_input_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.query_input_wrapper {\n display: flex;\n}\n.query_input_wrapper_left {\n width: 100px;\n}\n.query_input_wrapper_right {\n color: #9e9e9e;\n}\n.query_input_textArea {\n margin-top: 15px;\n}\n";
2263
2896
  styleInject(css_248z$1);
2264
2897
 
@@ -2579,6 +3212,7 @@ var SearchSelect = function SearchSelect(props) {
2579
3212
 
2580
3213
  if (fixedParamVal) {
2581
3214
  fixedParam[item] = fixedParamVal;
3215
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
2582
3216
  }
2583
3217
  });
2584
3218
  } // 数组对象处理,对带有特殊标记的name进行处理
@@ -2758,13 +3392,13 @@ var SearchSelect = function SearchSelect(props) {
2758
3392
 
2759
3393
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
2760
3394
  setItems(source);
2761
- setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
3395
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
2762
3396
  } else {
2763
3397
  setTableData(source);
2764
3398
  setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
2765
- total: Number(res === null || res === void 0 ? void 0 : res.total),
2766
- pageSize: Number(res === null || res === void 0 ? void 0 : res.size),
2767
- current: Number(res === null || res === void 0 ? void 0 : res.page)
3399
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
3400
+ pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
3401
+ current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
2768
3402
  }));
2769
3403
  }
2770
3404
  }).catch(function (err) {
@@ -3410,9 +4044,11 @@ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value)
3410
4044
  var loadSelectSource = function loadSelectSource(url, params) {
3411
4045
  return new Promise(function (resolve, reject) {
3412
4046
  axios.get("".concat(url, "?").concat(stringify(params))).then(function (result) {
4047
+ var _result;
4048
+
3413
4049
  result = result.data;
3414
4050
 
3415
- if (result.status !== '0') {
4051
+ if (result.status && result.status !== '0' || ((_result = result) === null || _result === void 0 ? void 0 : _result.code) && result.code !== '000000') {
3416
4052
  message.error(result.msg);
3417
4053
  return;
3418
4054
  }
@@ -3490,7 +4126,15 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
3490
4126
  changeSearchForm[changePosition].field.props.treeData = formatData;
3491
4127
  };
3492
4128
 
3493
- var tableSearchForm = []; // 供应商选择器
4129
+ var tableSearchForm = [];
4130
+
4131
+ var modalTableProps = _objectSpread2({
4132
+ modalTableTitle: '',
4133
+ tableSearchForm: tableSearchForm,
4134
+ tableColumns: []
4135
+ }, modalTableBusProps);
4136
+
4137
+ var needModalTable = true; // 供应商选择器
3494
4138
 
3495
4139
  if (type === 'supplier') {
3496
4140
  tableSearchForm = [{
@@ -3578,40 +4222,108 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
3578
4222
  formatSource(x, 1, 3, tableSearchForm);
3579
4223
  formatSource(x, 2, 4, tableSearchForm);
3580
4224
  });
4225
+ modalTableProps = _objectSpread2({
4226
+ modalTableTitle: '选择供应商',
4227
+ tableSearchForm: tableSearchForm,
4228
+ tableColumns: [{
4229
+ title: '供应商编码',
4230
+ dataIndex: 'code'
4231
+ }, {
4232
+ title: '供应商名称',
4233
+ dataIndex: 'name'
4234
+ }, {
4235
+ title: '归属集团',
4236
+ dataIndex: 'conglomerateName'
4237
+ }, {
4238
+ title: '归属法人公司',
4239
+ dataIndex: 'legalCompanyName'
4240
+ }, {
4241
+ title: '归属核算主体',
4242
+ dataIndex: 'accountingName'
4243
+ }, {
4244
+ title: '共享类型',
4245
+ dataIndex: 'sharingType',
4246
+ render: function render(text) {
4247
+ var _sharingType$find;
4248
+
4249
+ return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find = sharingType.find(function (i) {
4250
+ return i.value === text;
4251
+ })) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
4252
+ }
4253
+ }]
4254
+ }, modalTableBusProps);
3581
4255
  }
3582
4256
 
3583
- var modalTableProps = _objectSpread2({
3584
- modalTableTitle: '选择供应商',
3585
- tableSearchForm: tableSearchForm,
3586
- tableColumns: [{
3587
- title: '供应商编码',
3588
- dataIndex: 'code'
3589
- }, {
3590
- title: '供应商名称',
3591
- dataIndex: 'name'
3592
- }, {
3593
- title: '归属集团',
3594
- dataIndex: 'conglomerateName'
4257
+ if (type === 'supplier2') {
4258
+ // 版本2
4259
+ tableSearchForm = [{
4260
+ name: 'qp-name-like',
4261
+ label: '供应商名称'
3595
4262
  }, {
3596
- title: '归属法人公司',
3597
- dataIndex: 'legalCompanyName'
4263
+ name: 'qp-code-like',
4264
+ label: '供应商编码'
3598
4265
  }, {
3599
- title: '归属核算主体',
3600
- dataIndex: 'accountingName'
4266
+ name: 'qp-createOrgCode-eq',
4267
+ type: 'select',
4268
+ label: '创建组织',
4269
+ field: {
4270
+ type: 'select',
4271
+ props: {
4272
+ // mode: 'multiple',
4273
+ notFoundContent: '暂无数据',
4274
+ allowClear: true,
4275
+ showSearch: true,
4276
+ showArrow: true,
4277
+ // maxTagCount: 1,
4278
+ optionFilterProp: 'children',
4279
+ filterOption: function filterOption(input, option) {
4280
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4281
+ }
4282
+ }
4283
+ }
3601
4284
  }, {
3602
- title: '共享类型',
3603
- dataIndex: 'sharingType',
3604
- render: function render(text) {
3605
- var _sharingType$find;
3606
-
3607
- return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find = sharingType.find(function (i) {
3608
- return i.value === text;
3609
- })) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
4285
+ name: 'qp-supplierOrgCode-eq',
4286
+ type: 'select',
4287
+ label: '使用组织',
4288
+ field: {
4289
+ type: 'select',
4290
+ props: {
4291
+ // mode: 'multiple',
4292
+ notFoundContent: '暂无数据',
4293
+ allowClear: true,
4294
+ showSearch: true,
4295
+ showArrow: true,
4296
+ // maxTagCount: 1,
4297
+ optionFilterProp: 'children',
4298
+ filterOption: function filterOption(input, option) {
4299
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4300
+ }
4301
+ }
3610
4302
  }
3611
- }]
3612
- }, modalTableBusProps);
4303
+ }];
4304
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
4305
+ formatSource(x, 0, 2, tableSearchForm);
4306
+ formatSource(x, 1, 3, tableSearchForm);
4307
+ });
4308
+ modalTableProps = _objectSpread2({
4309
+ modalTableTitle: '选择供应商',
4310
+ tableSearchForm: tableSearchForm,
4311
+ tableColumns: [{
4312
+ title: '供应商编码',
4313
+ dataIndex: 'code'
4314
+ }, {
4315
+ title: '供应商名称',
4316
+ dataIndex: 'name'
4317
+ }, {
4318
+ title: '创建组织',
4319
+ dataIndex: 'createOrgName'
4320
+ }, {
4321
+ title: '使用组织',
4322
+ dataIndex: 'salesOrgName'
4323
+ }]
4324
+ }, modalTableBusProps);
4325
+ } // 商品选择器sku
3613
4326
 
3614
- var needModalTable = true; // 商品选择器sku
3615
4327
 
3616
4328
  if (type === 'skuCommodity') {
3617
4329
  requestConfig = _objectSpread2({
@@ -3663,7 +4375,9 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
3663
4375
  mode: 'multiple',
3664
4376
  maxTagCount: 1
3665
4377
  }
3666
- }, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuPropertyValueRequestConfig) || {})
4378
+ }, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuPropertyValueRequestConfig) || {
4379
+ prefixUrl: prefixUrl
4380
+ })
3667
4381
  }
3668
4382
  } : null, {
3669
4383
  name: 'qp-brandId-in',
@@ -4301,6 +5015,86 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4301
5015
  }
4302
5016
  }]
4303
5017
  }, modalTableBusProps);
5018
+ }
5019
+
5020
+ if (type === 'customer2') {
5021
+ // 版本2
5022
+ requestConfig = _objectSpread2({
5023
+ url: "".concat(prefixUrl.selectPrefix, "/customer"),
5024
+ filter: 'qp-name,code-orGroup,like',
5025
+ mappingTextField: 'name',
5026
+ mappingValueField: 'code',
5027
+ otherParams: {
5028
+ sorter: 'desc-id'
5029
+ },
5030
+ sourceName: 'customCode'
5031
+ }, requestConfigProp);
5032
+ tableSearchForm = [{
5033
+ name: 'qp-name-like',
5034
+ label: '客户名称'
5035
+ }, {
5036
+ name: 'qp-code-like',
5037
+ label: '客户编码'
5038
+ }, {
5039
+ name: 'qp-createOrgCode-eq',
5040
+ type: 'select',
5041
+ label: '创建组织',
5042
+ field: {
5043
+ type: 'select',
5044
+ props: {
5045
+ // mode: 'multiple',
5046
+ notFoundContent: '暂无数据',
5047
+ allowClear: true,
5048
+ showSearch: true,
5049
+ showArrow: true,
5050
+ // maxTagCount: 1,
5051
+ optionFilterProp: 'children',
5052
+ filterOption: function filterOption(input, option) {
5053
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
5054
+ }
5055
+ }
5056
+ }
5057
+ }, {
5058
+ name: 'qp-salesOrgCode-eq',
5059
+ type: 'select',
5060
+ label: '使用组织',
5061
+ field: {
5062
+ type: 'select',
5063
+ props: {
5064
+ // mode: 'multiple',
5065
+ notFoundContent: '暂无数据',
5066
+ allowClear: true,
5067
+ showSearch: true,
5068
+ showArrow: true,
5069
+ // maxTagCount: 1,
5070
+ optionFilterProp: 'children',
5071
+ filterOption: function filterOption(input, option) {
5072
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
5073
+ }
5074
+ }
5075
+ }
5076
+ }];
5077
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5078
+ formatSource(x, 0, 2, tableSearchForm);
5079
+ formatSource(x, 1, 3, tableSearchForm);
5080
+ });
5081
+ modalTableProps = _objectSpread2({
5082
+ modalTableTitle: '选择客户',
5083
+ tableSearchForm: tableSearchForm,
5084
+ tableColumns: [{
5085
+ title: '客户编码',
5086
+ dataIndex: 'code'
5087
+ }, {
5088
+ title: '客户名称',
5089
+ dataIndex: 'name'
5090
+ }, {
5091
+ title: '创建组织',
5092
+ dataIndex: 'createOrgName'
5093
+ }, {
5094
+ title: '使用组织',
5095
+ dataIndex: 'salesOrgName'
5096
+ }]
5097
+ }, modalTableBusProps);
4304
5098
  } // 店铺选择器
4305
5099
 
4306
5100
 
@@ -4580,6 +5374,77 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4580
5374
  dataIndex: 'officeTelephone'
4581
5375
  }]
4582
5376
  }, modalTableBusProps);
5377
+ }
5378
+
5379
+ if (type === 'employee2') {
5380
+ // 版本2
5381
+ requestConfig = _objectSpread2({
5382
+ url: "".concat(prefixUrl.selectPrefix, "/employee/pageList/v2"),
5383
+ filter: 'qp-employeeNumber,name-orGroup,like',
5384
+ mappingTextField: 'name',
5385
+ mappingTextShowKeyField: 'employeeNumber',
5386
+ mappingValueField: 'id',
5387
+ otherParams: {
5388
+ 'qp-enable-eq': 10,
5389
+ sorter: 'desc-id'
5390
+ },
5391
+ sourceName: 'employeeNumber'
5392
+ }, requestConfigProp);
5393
+ tableSearchForm = [{
5394
+ name: 'qp-name-like',
5395
+ label: '员工名称'
5396
+ }, {
5397
+ name: 'qp-employeeNumber-like',
5398
+ label: '员工编码'
5399
+ }, {
5400
+ name: 'qp-directOrgCode-in',
5401
+ type: 'select',
5402
+ label: '所属组织机构',
5403
+ field: {
5404
+ type: 'select',
5405
+ props: {
5406
+ mode: 'multiple',
5407
+ notFoundContent: '暂无数据',
5408
+ allowClear: true,
5409
+ showSearch: true,
5410
+ showArrow: true,
5411
+ maxTagCount: 1,
5412
+ optionFilterProp: 'children',
5413
+ filterOption: function filterOption(input, option) {
5414
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
5415
+ }
5416
+ }
5417
+ }
5418
+ }, {
5419
+ name: 'qp-email-like',
5420
+ label: '邮箱'
5421
+ }, {
5422
+ name: 'qp-officeTelephone-like',
5423
+ label: '手机号'
5424
+ }];
5425
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5426
+ formatSource(x, 0, 2, tableSearchForm);
5427
+ });
5428
+ modalTableProps = _objectSpread2({
5429
+ modalTableTitle: '选择员工',
5430
+ tableSearchForm: tableSearchForm,
5431
+ tableColumns: [{
5432
+ title: '员工编码',
5433
+ dataIndex: 'employeeNumber'
5434
+ }, {
5435
+ title: '员工名称',
5436
+ dataIndex: 'name'
5437
+ }, {
5438
+ title: '所属组织机构',
5439
+ dataIndex: 'directOrgName'
5440
+ }, {
5441
+ title: '邮箱',
5442
+ dataIndex: 'email'
5443
+ }, {
5444
+ title: '手机号',
5445
+ dataIndex: 'officeTelephone'
5446
+ }]
5447
+ }, modalTableBusProps);
4583
5448
  } // 配送方式选择器
4584
5449
 
4585
5450
 
@@ -4889,4 +5754,4 @@ function getStorageVale(storageKeyString) {
4889
5754
  var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
4890
5755
  axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
4891
5756
 
4892
- export { BusinessSearchSelect$1 as BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };
5757
+ export { BusinessSearchSelect$1 as BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataValidation$1 as DataImport, DataValidation, QueryMutipleInput, SearchSelect };