@kmkf-fe-packages/services-components 0.26.0-alpha.0 → 0.26.0-alpha.5

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.
@@ -391,171 +391,276 @@ export var BsGoodPic = function BsGoodPic(list) {
391
391
  });
392
392
  });
393
393
  };
394
- var getTable = function getTable(GOODS_INFO_COLUMNS) {
395
- return function (_ref11) {
396
- var list = _ref11.list,
397
- showHeader = _ref11.showHeader,
398
- _ref11$text = _ref11.text,
399
- text = _ref11$text === void 0 ? "" : _ref11$text;
400
- var newColumns = useMemo(function () {
401
- var columnList = [{
402
- dataIndex: "",
403
- title: "序号",
404
- align: "center",
405
- ellipsis: true,
406
- width: 50,
407
- render: function render(val, record, index) {
408
- return /*#__PURE__*/React.createElement("span", null, index + 1);
409
- }
410
- }].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
411
- return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
412
- })));
413
- return columnList;
414
- }, [showHeader, list]);
415
- return /*#__PURE__*/React.createElement(Table, {
416
- columns: newColumns,
417
- dataSource: list,
418
- rowKey: "uuid",
419
- size: "small",
420
- pagination: false,
421
- scroll: {
422
- x: "100%"
423
- },
424
- locale: {
425
- emptyText: "暂无数据"
394
+ export var BsGoodsTable = function BsGoodsTable(_ref11) {
395
+ var list = _ref11.list,
396
+ showHeader = _ref11.showHeader,
397
+ _ref11$text = _ref11.text,
398
+ text = _ref11$text === void 0 ? '' : _ref11$text,
399
+ type = _ref11.type;
400
+ //商品信息
401
+
402
+ var COLUMNS_MAP = function COLUMNS_MAP() {
403
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
404
+ return function (type) {
405
+ var columns = [];
406
+ switch (type) {
407
+ case 'ITEM_ENCODE':
408
+ columns = [{
409
+ dataIndex: "title",
410
+ title: "商品名称",
411
+ align: "center",
412
+ ellipsis: true,
413
+ width: 200
414
+ }, {
415
+ dataIndex: "outerId",
416
+ title: "商品编码",
417
+ align: "center",
418
+ ellipsis: true,
419
+ width: 140
420
+ }, {
421
+ dataIndex: "picUrl",
422
+ title: "图片",
423
+ align: "center",
424
+ ellipsis: true,
425
+ width: 100,
426
+ render: function render(val) {
427
+ return /*#__PURE__*/React.createElement(Image, {
428
+ width: 60,
429
+ src: val
430
+ });
431
+ }
432
+ }, {
433
+ dataIndex: "numIid",
434
+ title: "商品id",
435
+ align: "center",
436
+ ellipsis: true,
437
+ width: 200
438
+ }, {
439
+ dataIndex: "skuId",
440
+ title: "SKU ID",
441
+ align: "center",
442
+ ellipsis: true,
443
+ width: 200
444
+ }, {
445
+ dataIndex: "outerSkuId",
446
+ title: "SKU 编码",
447
+ align: "center",
448
+ ellipsis: true,
449
+ width: 100
450
+ }, {
451
+ dataIndex: "propertiesName",
452
+ title: "SKU 信息",
453
+ align: "center",
454
+ ellipsis: true,
455
+ width: 200
456
+ }];
457
+ break;
458
+ case 'WDT_REISSUE_GOODS':
459
+ case 'WDT_GOODS':
460
+ columns = [{
461
+ dataIndex: 'goodId',
462
+ title: "SPUID",
463
+ align: 'center',
464
+ ellipsis: true,
465
+ width: 70
466
+ }, {
467
+ dataIndex: 'goodNo',
468
+ title: "\u5546\u54C1SPU\u7F16\u7801",
469
+ align: 'center',
470
+ ellipsis: true,
471
+ width: 180
472
+ }, {
473
+ dataIndex: 'goodName',
474
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
475
+ align: 'center',
476
+ ellipsis: true,
477
+ width: 250
478
+ }, {
479
+ dataIndex: 'specId',
480
+ title: "".concat(text, "SKUID"),
481
+ align: 'center',
482
+ ellipsis: true,
483
+ width: 100
484
+ }, {
485
+ dataIndex: 'specNo',
486
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
487
+ align: 'center',
488
+ ellipsis: true,
489
+ width: 180
490
+ }, {
491
+ dataIndex: 'specName',
492
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
493
+ align: 'center',
494
+ ellipsis: true,
495
+ width: 250
496
+ }, {
497
+ dataIndex: 'imgUrl',
498
+ title: "\u56FE\u7247",
499
+ align: 'center',
500
+ ellipsis: true,
501
+ width: 100,
502
+ render: function render(val) {
503
+ return /*#__PURE__*/React.createElement(Image, {
504
+ width: 60,
505
+ src: val
506
+ });
507
+ }
508
+ }, {
509
+ dataIndex: 'orderPrice',
510
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
511
+ align: 'center',
512
+ ellipsis: true,
513
+ width: 100
514
+ }, {
515
+ dataIndex: 'num',
516
+ title: "".concat(text, "\u6570\u91CF"),
517
+ align: 'center',
518
+ ellipsis: true,
519
+ width: 100
520
+ },
521
+ // {
522
+ // dataIndex: 'actualNum',
523
+ // title: `${text}实发数量`,
524
+ // align: 'center',
525
+ // ellipsis: true,
526
+ // width: 100,
527
+ // },
528
+ {
529
+ dataIndex: 'sharePrice',
530
+ title: "\u5206\u644A\u4EF7",
531
+ align: 'center',
532
+ ellipsis: true,
533
+ width: 70
534
+ }, {
535
+ dataIndex: 'giftType',
536
+ title: "\u8D60\u54C1\u65B9\u5F0F",
537
+ align: 'center',
538
+ ellipsis: true,
539
+ width: 100,
540
+ render: function render(val) {
541
+ var giftTypeMap = {
542
+ 0: '非赠品',
543
+ 1: '自动赠送',
544
+ 2: '手工赠送',
545
+ 3: '回购自动送赠品',
546
+ 4: '前N有礼送赠品',
547
+ 6: '天猫优仓赠品',
548
+ 7: '淘宝CRM会员送赠'
549
+ };
550
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
551
+ }
552
+ }];
553
+ break;
554
+ default:
555
+ columns = [{
556
+ dataIndex: 'mark',
557
+ title: "\u5546\u54C1\u6807\u8BB0",
558
+ align: 'center',
559
+ ellipsis: true,
560
+ width: 100
561
+ }, {
562
+ dataIndex: 'skuName',
563
+ title: "".concat(text, "sku\u540D\u79F0"),
564
+ align: 'center',
565
+ ellipsis: true,
566
+ width: 200
567
+ }, {
568
+ dataIndex: 'sku',
569
+ title: "".concat(text, "sku\u7F16\u7801"),
570
+ align: 'center',
571
+ ellipsis: true,
572
+ width: 100
573
+ }, {
574
+ dataIndex: 'name',
575
+ title: "".concat(text, "\u540D\u79F0"),
576
+ align: 'center',
577
+ ellipsis: true,
578
+ width: 200
579
+ }, {
580
+ dataIndex: 'pic',
581
+ title: "\u56FE\u7247",
582
+ align: 'center',
583
+ ellipsis: true,
584
+ width: 100,
585
+ render: function render(val) {
586
+ return /*#__PURE__*/React.createElement(Image, {
587
+ width: 60,
588
+ src: val
589
+ });
590
+ }
591
+ }, {
592
+ dataIndex: 'code',
593
+ title: "".concat(text, "\u7F16\u7801"),
594
+ align: 'center',
595
+ ellipsis: true,
596
+ width: 100
597
+ }, {
598
+ dataIndex: 'money',
599
+ title: "\u5B9E\u4ED8\u91D1\u989D",
600
+ align: 'center',
601
+ ellipsis: true,
602
+ width: 100
603
+ }, {
604
+ dataIndex: 'number',
605
+ title: "".concat(text, "\u6570\u91CF"),
606
+ align: 'center',
607
+ ellipsis: true,
608
+ width: 100
609
+ }, {
610
+ dataIndex: 'share',
611
+ title: "\u5206\u644A\u4EF7",
612
+ align: 'center',
613
+ ellipsis: true,
614
+ width: 70
615
+ }, {
616
+ dataIndex: 'type',
617
+ title: "\u8D60\u54C1\u7C7B\u578B",
618
+ align: 'center',
619
+ ellipsis: true,
620
+ width: 100
621
+ }];
426
622
  }
427
- });
623
+ return columns;
624
+ };
428
625
  };
429
- };
430
- export var BsGoodsTable = getTable(function () {
431
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
432
- return [{
433
- dataIndex: "mark",
434
- title: "\u5546\u54C1\u6807\u8BB0",
435
- align: "center",
436
- ellipsis: true,
437
- width: 100
438
- }, {
439
- dataIndex: "skuName",
440
- title: "".concat(text, "sku\u540D\u79F0"),
441
- align: "center",
442
- ellipsis: true,
443
- width: 200
444
- }, {
445
- dataIndex: "sku",
446
- title: "".concat(text, "sku\u7F16\u7801"),
447
- align: "center",
448
- ellipsis: true,
449
- width: 100
450
- }, {
451
- dataIndex: "name",
452
- title: "".concat(text, "\u540D\u79F0"),
453
- align: "center",
454
- ellipsis: true,
455
- width: 200
456
- }, {
457
- dataIndex: "pic",
458
- title: "\u56FE\u7247",
459
- align: "center",
460
- ellipsis: true,
461
- width: 100,
462
- render: function render(val) {
463
- return /*#__PURE__*/React.createElement(Image, {
464
- width: 60,
465
- src: val
466
- });
467
- }
468
- }, {
469
- dataIndex: "code",
470
- title: "".concat(text, "\u7F16\u7801"),
471
- align: "center",
472
- ellipsis: true,
473
- width: 100
474
- }, {
475
- dataIndex: "money",
476
- title: "\u5B9E\u4ED8\u91D1\u989D",
477
- align: "center",
478
- ellipsis: true,
479
- width: 100
480
- }, {
481
- dataIndex: "number",
482
- title: "".concat(text, "\u6570\u91CF"),
483
- align: "center",
484
- ellipsis: true,
485
- width: 100
486
- }, {
487
- dataIndex: "share",
488
- title: "\u5206\u644A\u4EF7",
489
- align: "center",
490
- ellipsis: true,
491
- width: 70
492
- }, {
493
- dataIndex: "type",
494
- title: "\u8D60\u54C1\u7C7B\u578B",
495
- align: "center",
496
- ellipsis: true,
497
- width: 100
498
- }];
499
- });
500
- export var TBGoodTable = getTable(function () {
501
- return [{
502
- dataIndex: "title",
503
- title: "商品名称",
504
- align: "center",
505
- ellipsis: true,
506
- width: 200
507
- }, {
508
- dataIndex: "outerId",
509
- title: "商品编码",
510
- align: "center",
511
- ellipsis: true,
512
- width: 140
513
- }, {
514
- dataIndex: "picUrl",
515
- title: "图片",
516
- align: "center",
517
- ellipsis: true,
518
- width: 100,
519
- render: function render(val) {
520
- return /*#__PURE__*/React.createElement(Image, {
521
- width: 60,
522
- src: val
523
- });
626
+ //商品信息
627
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
628
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
629
+ var COLUMNS_INFO = COLUMNS_MAP(text);
630
+ return COLUMNS_INFO(type);
631
+ };
632
+ // const GOODS_INFO_COLUMNS = (text = '') => {
633
+ // return
634
+ // }
635
+ var newColumns = useMemo(function () {
636
+ var columnList = [{
637
+ dataIndex: '',
638
+ title: '序号',
639
+ align: 'center',
640
+ ellipsis: true,
641
+ width: 50,
642
+ render: function render(val, record, index) {
643
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
644
+ }
645
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
646
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
647
+ })));
648
+ return columnList;
649
+ }, [showHeader, list]);
650
+ return /*#__PURE__*/React.createElement(Table, {
651
+ columns: newColumns,
652
+ dataSource: list,
653
+ rowKey: 'uuid',
654
+ size: "small",
655
+ pagination: false,
656
+ scroll: {
657
+ x: '100%'
658
+ },
659
+ locale: {
660
+ emptyText: '暂无数据'
524
661
  }
525
- }, {
526
- dataIndex: "numIid",
527
- title: "商品id",
528
- align: "center",
529
- ellipsis: true,
530
- width: 200
531
- }, {
532
- dataIndex: "skuId",
533
- title: "SKU ID",
534
- align: "center",
535
- ellipsis: true,
536
- width: 200
537
- }, {
538
- dataIndex: "outerSkuId",
539
- title: "SKU 编码",
540
- align: "center",
541
- ellipsis: true,
542
- width: 100
543
- }, {
544
- dataIndex: "propertiesName",
545
- title: "SKU 信息",
546
- align: "center",
547
- ellipsis: true,
548
- width: 200
549
- }];
550
- // title: '商品名称',
551
- // outerId: '商品编码',
552
- // picUrl: '图片',
553
- // numIid: '商品id',
554
- // skuId: 'SKU ID',
555
- // outerSkuId: 'SKU 编码',
556
- // propertiesName: 'SKU 信息',
557
- });
558
-
662
+ });
663
+ };
559
664
  export var FileRender = function FileRender(_ref12) {
560
665
  var _ref12$fileList = _ref12.fileList,
561
666
  fileList = _ref12$fileList === void 0 ? [] : _ref12$fileList,
@@ -673,25 +778,38 @@ export var FileRender = function FileRender(_ref12) {
673
778
  export var BsSystemOrderTable = function BsSystemOrderTable(_ref13) {
674
779
  var value = _ref13.value,
675
780
  type = _ref13.type;
676
- var columns = type === "WLN_SYSTEM_ORDER" ? [{
677
- dataIndex: "billType",
678
- title: "单据类型"
679
- }, {
680
- dataIndex: "billNo",
681
- title: "系统订单号"
682
- }, {
683
- dataIndex: "billTag",
684
- title: "标签"
685
- }] : [{
686
- dataIndex: "billType",
687
- title: "订单类型"
688
- }, {
689
- dataIndex: "billNo",
690
- title: "系统订单号"
691
- }, {
692
- dataIndex: "billTag",
693
- title: "标记"
694
- }];
781
+ var columnMap = {
782
+ BS_SYSTEM_ORDER: [{
783
+ dataIndex: "billType",
784
+ title: "订单类型"
785
+ }, {
786
+ dataIndex: "billNo",
787
+ title: "系统订单号"
788
+ }, {
789
+ dataIndex: "billTag",
790
+ title: "标记"
791
+ }],
792
+ WLN_SYSTEM_ORDER: [{
793
+ dataIndex: "billType",
794
+ title: "单据类型"
795
+ }, {
796
+ dataIndex: "billNo",
797
+ title: "系统订单号"
798
+ }, {
799
+ dataIndex: "billTag",
800
+ title: "标签"
801
+ }],
802
+ WDT_SYSTEM_ORDER: [{
803
+ dataIndex: "billType",
804
+ title: "订单类型"
805
+ }, {
806
+ dataIndex: "billNo",
807
+ title: "系统订单号"
808
+ }, {
809
+ dataIndex: "billTag",
810
+ title: "订单标签"
811
+ }]
812
+ };
695
813
  var rowSelection = {
696
814
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || ((value === null || value === void 0 ? void 0 : value.showOrderInfo) || []).reduce(function (prv, next) {
697
815
  if (next.select) {
@@ -709,7 +827,7 @@ export var BsSystemOrderTable = function BsSystemOrderTable(_ref13) {
709
827
  };
710
828
  return /*#__PURE__*/React.createElement(Table, {
711
829
  dataSource: (value === null || value === void 0 ? void 0 : value.showOrderInfo) || [],
712
- columns: columns,
830
+ columns: columnMap[type] || [],
713
831
  rowSelection: rowSelection,
714
832
  rowKey: "billNo",
715
833
  size: "small",
@@ -0,0 +1,27 @@
1
+ import { ComponentInterface, PickOption, ALignType, Record } from "../../type";
2
+ import React from "react";
3
+ declare class CommonHeaderGoods implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ type: string;
8
+ componentConfig: ComponentInterface["componentConfig"];
9
+ align: ALignType;
10
+ width: number;
11
+ isCombinationComponent: boolean;
12
+ formField: string;
13
+ canSort: boolean;
14
+ children: ComponentInterface[];
15
+ dataType: ComponentInterface["dataType"];
16
+ itemKey: any;
17
+ constructor(options: PickOption);
18
+ getParentId: () => string;
19
+ renderClient: (record: any) => React.JSX.Element | null;
20
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
21
+ renderLog: (r: Record) => React.JSX.Element | null;
22
+ getComponentValue: (r: Record) => any;
23
+ renderExport: (value: string, record: Record) => any;
24
+ editRender: () => null;
25
+ filterConfig: () => never[];
26
+ }
27
+ export default CommonHeaderGoods;