@kmkf-fe-packages/services-components 0.7.15-alpha.6 → 0.7.15-alpha.61

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.
Files changed (82) hide show
  1. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -21
  2. package/dist/esm/commonComponents/ShopList/index.d.ts +1 -1
  3. package/dist/esm/commonComponents/ShopList/index.js +4 -2
  4. package/dist/esm/components/ActualPayment/index.d.ts +4 -4
  5. package/dist/esm/components/ActualPayment/index.js +24 -21
  6. package/dist/esm/components/BS/BsExchange/index.d.ts +12 -6
  7. package/dist/esm/components/BS/BsExchange/index.js +233 -111
  8. package/dist/esm/components/BS/BsGoods/index.d.ts +9 -9
  9. package/dist/esm/components/BS/BsGoods/index.js +82 -60
  10. package/dist/esm/components/BS/BsReissue/index.d.ts +16 -6
  11. package/dist/esm/components/BS/BsReissue/index.js +103 -54
  12. package/dist/esm/components/BS/common/{BsChildNumber.d.ts → BsHeaderCode.d.ts} +5 -4
  13. package/dist/esm/components/BS/common/{BsChildNumber.js → BsHeaderCode.js} +27 -11
  14. package/dist/esm/components/BS/common/BsHeaderGood.d.ts +27 -0
  15. package/dist/esm/components/BS/common/BsHeaderGood.js +156 -0
  16. package/dist/esm/components/BS/common/{BsChildMoney.d.ts → BsHeaderMoney.d.ts} +5 -4
  17. package/dist/esm/components/BS/common/{BsChildMoney.js → BsHeaderMoney.js} +27 -11
  18. package/dist/esm/components/BS/common/{BsChildName.d.ts → BsHeaderName.d.ts} +5 -4
  19. package/dist/esm/components/BS/common/{BsChildName.js → BsHeaderName.js} +28 -11
  20. package/dist/esm/components/BS/common/{BsChildCode.d.ts → BsHeaderNumber.d.ts} +5 -4
  21. package/dist/esm/components/BS/common/{BsChildCode.js → BsHeaderNumber.js} +27 -11
  22. package/dist/esm/components/BS/common/{BsChildPic.d.ts → BsHeaderPic.d.ts} +5 -4
  23. package/dist/esm/components/BS/common/{BsChildPic.js → BsHeaderPic.js} +26 -10
  24. package/dist/esm/components/BS/common/{BsChildShare.d.ts → BsHeaderShare.d.ts} +5 -4
  25. package/dist/esm/components/BS/common/{BsChildShare.js → BsHeaderShare.js} +27 -11
  26. package/dist/esm/components/BS/common/{BsChildSku.d.ts → BsHeaderSku.d.ts} +5 -4
  27. package/dist/esm/components/BS/common/{BsChildSku.js → BsHeaderSku.js} +27 -11
  28. package/dist/esm/components/BS/common/{BsChildType.d.ts → BsHeaderType.d.ts} +5 -4
  29. package/dist/esm/components/BS/common/{BsChildType.js → BsHeaderType.js} +27 -11
  30. package/dist/esm/components/BS/common/BsMemo.d.ts +8 -7
  31. package/dist/esm/components/BS/common/BsMemo.js +55 -21
  32. package/dist/esm/components/BS/common/BsType.d.ts +8 -6
  33. package/dist/esm/components/BS/common/BsType.js +53 -17
  34. package/dist/esm/components/BS/common/index.d.ts +9 -8
  35. package/dist/esm/components/BS/common/index.js +9 -8
  36. package/dist/esm/components/Cascader/index.d.ts +1 -0
  37. package/dist/esm/components/Cascader/index.js +3 -1
  38. package/dist/esm/components/Common/index.d.ts +7 -2
  39. package/dist/esm/components/Common/index.js +175 -77
  40. package/dist/esm/components/DataTime/ApaasDate.d.ts +2 -2
  41. package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +2 -2
  42. package/dist/esm/components/EItemId/ItemId.d.ts +2 -2
  43. package/dist/esm/components/EItemSelect/ItemSelect.d.ts +2 -2
  44. package/dist/esm/components/ExpressCompany/index.d.ts +2 -2
  45. package/dist/esm/components/File/index.d.ts +1 -1
  46. package/dist/esm/components/File/index.js +26 -5
  47. package/dist/esm/components/FlowStatusSelect/index.d.ts +0 -1
  48. package/dist/esm/components/FlowStatusSelect/index.js +30 -24
  49. package/dist/esm/components/FlowWorkOrderId/index.d.ts +33 -0
  50. package/dist/esm/components/FlowWorkOrderId/index.js +107 -0
  51. package/dist/esm/components/JST/JstLogistics/index.d.ts +19 -13
  52. package/dist/esm/components/JST/JstLogistics/index.js +65 -31
  53. package/dist/esm/components/JST/JstSendGood/index.d.ts +10 -4
  54. package/dist/esm/components/JST/JstSendGood/index.js +27 -17
  55. package/dist/esm/components/LogisticsTrajectory/index.d.ts +8 -9
  56. package/dist/esm/components/LogisticsTrajectory/index.js +12 -10
  57. package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +6 -5
  58. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +6 -6
  59. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +8 -8
  60. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +0 -1
  61. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +4 -10
  62. package/dist/esm/components/Payment/BuyerNick.js +1 -2
  63. package/dist/esm/components/Payment/index.d.ts +1 -0
  64. package/dist/esm/components/Payment/index.js +9 -6
  65. package/dist/esm/components/Popover/index.d.ts +2 -2
  66. package/dist/esm/components/PostIng/index.d.ts +6 -29
  67. package/dist/esm/components/PostIng/index.js +73 -77
  68. package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +2 -2
  69. package/dist/esm/components/TradeDateTime/index.d.ts +1 -9
  70. package/dist/esm/components/TradeDateTime/index.js +6 -1
  71. package/dist/esm/factory.d.ts +2 -2
  72. package/dist/esm/factory.js +6 -3
  73. package/dist/esm/index.d.ts +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/type.d.ts +10 -2
  76. package/package.json +4 -4
  77. package/dist/esm/components/BS/BsLogistics/index.d.ts +0 -50
  78. package/dist/esm/components/BS/BsLogistics/index.js +0 -115
  79. package/dist/esm/components/BS/common/BsExchangeImage.d.ts +0 -31
  80. package/dist/esm/components/BS/common/BsExchangeImage.js +0 -126
  81. package/dist/esm/components/BS/common/BsGoodImage.d.ts +0 -31
  82. package/dist/esm/components/BS/common/BsGoodImage.js +0 -88
@@ -8,16 +8,60 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
10
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
- import React from "react";
11
+ import React from 'react';
12
12
  import GetFormItem from "../../GetFormItem";
13
- import { BsGoodImage } from "../../Common";
14
- import { BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
15
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
- import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
13
+ import { BsGoodsTable } from "../../Common";
14
+ import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
15
+ import ItemView from "../../../commonComponents/ItemView";
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { BsGoods as Goods } from '@kmkf-fe-packages/basic-components';
17
18
  import { SYMBOL } from "../../../constant";
19
+ var childHeaderMap = {
20
+ pic: {
21
+ component: BsHeaderPic,
22
+ name: '图片',
23
+ key: 'pic'
24
+ },
25
+ name: {
26
+ component: BsHeaderName,
27
+ name: '名称',
28
+ key: 'name'
29
+ },
30
+ code: {
31
+ component: BsHeaderCode,
32
+ name: '编码',
33
+ key: 'code'
34
+ },
35
+ sku: {
36
+ component: BsHeaderSku,
37
+ name: 'sku编码',
38
+ key: 'sku'
39
+ },
40
+ money: {
41
+ component: BsHeaderMoney,
42
+ name: '实付金额',
43
+ key: 'money'
44
+ },
45
+ number: {
46
+ component: BsHeaderNumber,
47
+ name: '数量',
48
+ key: 'number'
49
+ },
50
+ share: {
51
+ component: BsHeaderShare,
52
+ name: '分摊价',
53
+ key: 'share'
54
+ },
55
+ type: {
56
+ component: BsHeaderType,
57
+ name: '赠品类型',
58
+ key: 'giftType'
59
+ }
60
+ };
18
61
  var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
19
62
  var _this = this,
20
- _this$componentConfig2;
63
+ _options$componentCon,
64
+ _this$componentConfig3;
21
65
  _classCallCheck(this, BsGoods);
22
66
  _defineProperty(this, "name", void 0);
23
67
  _defineProperty(this, "id", void 0);
@@ -32,28 +76,21 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
32
76
  _defineProperty(this, "children", void 0);
33
77
  _defineProperty(this, "dataType", void 0);
34
78
  _defineProperty(this, "renderClient", function (record) {
35
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? record === null || record === void 0 ? void 0 : record["".concat(_this.id)].map(function (item, index) {
36
- return /*#__PURE__*/React.createElement(BsGoodImage, {
37
- item: item,
38
- index: index
39
- });
40
- }) : null;
79
+ var _record, _this$componentConfig;
80
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
81
+ id: _this.id,
82
+ label: _this.name,
83
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
84
+ list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.bsGoods) || [],
85
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
86
+ })
87
+ })) : null;
41
88
  });
42
- _defineProperty(this, "renderPc", function (value, record) {
43
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")]) === undefined) {
44
- return /*#__PURE__*/React.createElement("span", null, "--");
45
- }
46
- //兼容多个商品
47
- return record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")].map(function (item, index) {
48
- return /*#__PURE__*/React.createElement(BsGoodImage, {
49
- item: item,
50
- index: index
51
- });
52
- });
89
+ _defineProperty(this, "renderPc", function () {
90
+ return null;
53
91
  });
54
92
  _defineProperty(this, "renderLog", function (r) {
55
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")])) return null;
56
- return _this.renderPc(undefined, r);
93
+ return null;
57
94
  });
58
95
  _defineProperty(this, "getComponentValue", function (r) {
59
96
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
@@ -62,7 +99,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
62
99
  return null;
63
100
  });
64
101
  _defineProperty(this, "editRender", function (p) {
65
- var _this$componentConfig, _this$effects, _this$effects2;
102
+ var _this$componentConfig2, _this$effects, _this$effects2;
66
103
  return /*#__PURE__*/React.createElement(GetFormItem, {
67
104
  title: _this.name,
68
105
  name: _this.id,
@@ -70,7 +107,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
70
107
  required: false,
71
108
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
72
109
  component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
73
- maxLength: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.maxLength) || 20,
110
+ maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
74
111
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
75
112
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
76
113
  width: "90%"
@@ -78,15 +115,15 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
78
115
  });
79
116
  });
80
117
  _defineProperty(this, "filterConfig", function (item) {
81
- return {
118
+ return [{
82
119
  searchDefaultConditions: SYMBOL.like,
83
120
  type: item.type,
84
121
  id: "".concat(item.id, "_bsGoods"),
85
122
  // 过滤组件id
86
123
  name: item.name,
87
124
  // 过滤组件名称
88
- filterComponentType: "Input"
89
- };
125
+ filterComponentType: 'Input'
126
+ }];
90
127
  });
91
128
  this.name = options.name;
92
129
  this.id = options.id;
@@ -94,43 +131,28 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
94
131
  this.formField = "".concat(options.id, "_bsGoods");
95
132
  this.type = options.type;
96
133
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
97
- this.isCombinationComponent = false;
134
+ this.isCombinationComponent = true;
98
135
  this.canSort = false;
99
- this.children = [new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
100
- name: "bs图片",
101
- id: "".concat(options.id, "_bsGoods")
102
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
103
- name: "名称",
104
- id: "".concat(options.id, "_bsGoods")
105
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
106
- name: "编码",
107
- id: "".concat(options.id, "_bsGoods")
108
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
109
- name: "sku编码",
110
- id: "".concat(options.id, "_bsGoods")
111
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
112
- name: "实付金额",
113
- id: "".concat(options.id, "_bsGoods")
114
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
115
- name: "数量",
116
- id: "".concat(options.id, "_bsGoods")
117
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
118
- name: "分摊价",
119
- id: "".concat(options.id, "_bsGoods")
120
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
121
- name: "赠品类型",
122
- id: "".concat(options.id, "_bsGoods")
123
- }))];
136
+ this.children = ((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
137
+ if (childHeaderMap[next]) {
138
+ prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
139
+ name: childHeaderMap[next].name,
140
+ id: "".concat(options.id, "_bsGoods_").concat(childHeaderMap[next].key)
141
+ })));
142
+ }
143
+ return prv;
144
+ }, []);
124
145
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
125
- this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
146
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
126
147
  required: true,
127
148
  validator: function validator(_, value) {
128
- if (!value || !value.length) {
129
- return Promise.reject(new Error("请选择bs商品"));
149
+ var _value$bsGoods;
150
+ if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
151
+ return Promise.reject(new Error('请选择bs商品'));
130
152
  }
131
153
  return Promise.resolve();
132
154
  }
133
155
  }] : [];
134
- this.dataType = "object";
156
+ this.dataType = 'object';
135
157
  });
136
158
  export default BsGoods;
@@ -1,18 +1,21 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { BsType, BsMemo } from '../common/index';
3
4
  declare class BsReissue implements ComponentInterface {
4
5
  name: string;
5
6
  id: string;
6
7
  sortField: string;
7
8
  type: string;
8
9
  rules: any[];
9
- componentConfig: ComponentInterface["componentConfig"];
10
- effects: ComponentInterface["effects"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
+ effects: ComponentInterface['effects'];
11
12
  isCombinationComponent: boolean;
12
13
  formField: string;
13
14
  canSort: boolean;
14
15
  children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
16
+ dataType: ComponentInterface['dataType'];
17
+ bsType: BsType;
18
+ bsMemo: BsMemo;
16
19
  constructor(options: PickOption);
17
20
  renderClient: (record: any) => React.JSX.Element | null;
18
21
  renderPc: () => null;
@@ -21,14 +24,20 @@ declare class BsReissue implements ComponentInterface {
21
24
  renderExport: () => null;
22
25
  editRender: (p: any) => React.JSX.Element;
23
26
  filterConfig: (item: ColumnConfig) => ({
24
- searchDefaultConditions: "eq";
27
+ searchDefaultConditions: "in";
25
28
  type: string;
26
29
  id: string;
27
30
  name: string;
28
31
  filterComponentType: "Cascader";
29
32
  props: {
30
33
  options: any[] | undefined;
34
+ fieldNames: {
35
+ label: string;
36
+ value: string;
37
+ children: string;
38
+ };
31
39
  };
40
+ formatFilterValue: (val: Array<string>) => string[] | undefined;
32
41
  filterFn: (value: string) => (i: Record) => boolean;
33
42
  } | {
34
43
  searchDefaultConditions: "like";
@@ -37,6 +46,7 @@ declare class BsReissue implements ComponentInterface {
37
46
  name: string;
38
47
  filterComponentType: "Input";
39
48
  props?: undefined;
49
+ formatFilterValue?: undefined;
40
50
  filterFn?: undefined;
41
51
  })[];
42
52
  }
@@ -1,4 +1,10 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
2
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
9
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
10
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -8,17 +14,60 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
16
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
- import React from "react";
17
+ import React from 'react';
12
18
  import GetFormItem from "../../GetFormItem";
13
- import { GoodImage } from "../../Common";
14
19
  import ItemView from "../../../commonComponents/ItemView";
15
- import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
16
- import { BsReissue as Reissue } from "@kmkf-fe-packages/basic-components";
20
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
21
+ import { BsReissue as Reissue } from '@kmkf-fe-packages/basic-components';
17
22
  import { SYMBOL } from "../../../constant";
18
- import { BsType, BsMemo, BsChildPic, BsChildName, BsChildCode, BsChildSku, BsChildMoney, BsChildNumber, BsChildShare, BsChildType } from "../common/index";
23
+ import { BsGoodsTable } from "../../Common";
24
+ import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
25
+ var childHeaderMap = {
26
+ pic: {
27
+ component: BsHeaderPic,
28
+ name: '图片',
29
+ key: 'pic'
30
+ },
31
+ name: {
32
+ component: BsHeaderName,
33
+ name: '名称',
34
+ key: 'name'
35
+ },
36
+ code: {
37
+ component: BsHeaderCode,
38
+ name: '编码',
39
+ key: 'code'
40
+ },
41
+ sku: {
42
+ component: BsHeaderSku,
43
+ name: 'sku编码',
44
+ key: 'sku'
45
+ },
46
+ money: {
47
+ component: BsHeaderMoney,
48
+ name: '实付金额',
49
+ key: 'money'
50
+ },
51
+ number: {
52
+ component: BsHeaderNumber,
53
+ name: '数量',
54
+ key: 'number'
55
+ },
56
+ share: {
57
+ component: BsHeaderShare,
58
+ name: '分摊价',
59
+ key: 'share'
60
+ },
61
+ type: {
62
+ component: BsHeaderType,
63
+ name: '赠品类型',
64
+ key: 'giftType'
65
+ }
66
+ };
19
67
  var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
20
68
  var _this = this,
21
- _this$componentConfig2;
69
+ _options$componentCon,
70
+ _this$componentConfig3;
22
71
  _classCallCheck(this, BsReissue);
23
72
  _defineProperty(this, "name", void 0);
24
73
  _defineProperty(this, "id", void 0);
@@ -32,15 +81,19 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
32
81
  _defineProperty(this, "canSort", void 0);
33
82
  _defineProperty(this, "children", void 0);
34
83
  _defineProperty(this, "dataType", void 0);
84
+ _defineProperty(this, "bsType", void 0);
85
+ _defineProperty(this, "bsMemo", void 0);
35
86
  _defineProperty(this, "renderClient", function (record) {
36
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
87
+ var _this$componentConfig;
88
+ console.log('bsreissue', record);
89
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.bsType.renderClient(record), _this.bsMemo.renderClient(record), /*#__PURE__*/React.createElement(ItemView, {
37
90
  id: _this.id,
38
91
  label: _this.name,
39
- value: /*#__PURE__*/React.createElement(GoodImage, {
40
- list: record === null || record === void 0 ? void 0 : record[_this.id],
41
- type: "itemId"
92
+ value: /*#__PURE__*/React.createElement(BsGoodsTable, {
93
+ list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsReissueGoods) || [],
94
+ showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
42
95
  })
43
- }) : null;
96
+ })) : null;
44
97
  });
45
98
  _defineProperty(this, "renderPc", function () {
46
99
  return null;
@@ -55,7 +108,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
55
108
  return null;
56
109
  });
57
110
  _defineProperty(this, "editRender", function (p) {
58
- var _this$componentConfig, _this$effects, _this$effects2;
111
+ var _this$componentConfig2, _this$effects, _this$effects2;
59
112
  return /*#__PURE__*/React.createElement(GetFormItem, {
60
113
  title: _this.name,
61
114
  name: _this.id,
@@ -63,7 +116,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
63
116
  required: false,
64
117
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
65
118
  component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
66
- maxLength: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.maxLength) || 20,
119
+ maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
67
120
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
68
121
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
69
122
  width: "90%"
@@ -71,15 +124,25 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
71
124
  });
72
125
  });
73
126
  _defineProperty(this, "filterConfig", function (item) {
74
- var _item$config;
127
+ var _item$templateConfig;
75
128
  return [{
76
- searchDefaultConditions: SYMBOL.eq,
129
+ searchDefaultConditions: SYMBOL.in,
77
130
  type: item.type,
78
131
  id: "".concat(item.id, "_bsReissueType"),
79
- name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
80
- filterComponentType: "Cascader",
132
+ name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
133
+ filterComponentType: 'Cascader',
81
134
  props: {
82
- options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
135
+ options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
136
+ fieldNames: {
137
+ label: 'label',
138
+ value: 'value',
139
+ children: 'children'
140
+ }
141
+ },
142
+ formatFilterValue: function formatFilterValue(val) {
143
+ if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
144
+ return [val[val.length - 1]];
145
+ }
83
146
  },
84
147
  filterFn: function filterFn(value) {
85
148
  return function (i) {
@@ -91,7 +154,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
91
154
  type: item.type,
92
155
  id: "".concat(item.id, "_bsReissueGoods"),
93
156
  name: "".concat(_this.name),
94
- filterComponentType: "Input"
157
+ filterComponentType: 'Input'
95
158
  }];
96
159
  });
97
160
  this.name = options.name;
@@ -100,50 +163,36 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
100
163
  this.formField = "".concat(options.id);
101
164
  this.type = options.type;
102
165
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
103
- this.isCombinationComponent = false;
166
+ this.isCombinationComponent = true;
104
167
  this.canSort = false;
105
- this.children = [new BsType(_objectSpread(_objectSpread({}, options), {}, {
106
- id: "".concat(options.id, "_bsReissueType"),
107
- name: "补发类型"
108
- })), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
109
- id: "".concat(options.id, "_bsReissueType"),
110
- name: "补发备注"
111
- })), new BsChildPic(_objectSpread(_objectSpread({}, options), {}, {
112
- name: "bs图片",
113
- id: "".concat(options.id, "_bsReissueGoods")
114
- })), new BsChildName(_objectSpread(_objectSpread({}, options), {}, {
115
- name: "名称",
116
- id: "".concat(options.id, "_bsReissueGoods")
117
- })), new BsChildCode(_objectSpread(_objectSpread({}, options), {}, {
118
- name: "编码",
119
- id: "".concat(options.id, "_bsReissueGoods")
120
- })), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
121
- name: "sku编码",
122
- id: "".concat(options.id, "_bsReissueGoods")
123
- })), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
124
- name: "实付金额",
125
- id: "".concat(options.id, "_bsReissueGoods")
126
- })), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
127
- name: "数量",
128
- id: "".concat(options.id, "_bsReissueGoods")
129
- })), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
130
- name: "分摊价",
131
- id: "".concat(options.id, "_bsReissueGoods")
132
- })), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
133
- name: "赠品类型",
134
- id: "".concat(options.id, "_bsReissueGoods")
135
- }))];
168
+ this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
169
+ id: "".concat(options.id, "_bsReissueType_type"),
170
+ name: '补发类型'
171
+ }));
172
+ this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
173
+ id: "".concat(options.id, "_bsReissueType_memo"),
174
+ name: '补发备注'
175
+ }));
176
+ this.children = [this.bsType, this.bsMemo].concat(_toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
177
+ if (childHeaderMap[next]) {
178
+ prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
179
+ name: childHeaderMap[next].name,
180
+ id: "".concat(options.id, "_bsReissueGoods_").concat(childHeaderMap[next].key)
181
+ })));
182
+ }
183
+ return prv;
184
+ }, [])));
136
185
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
137
- this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
186
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
138
187
  required: true,
139
188
  validator: function validator(_, value) {
140
189
  var _value$bsReissueGoods;
141
190
  if (!value || !(value !== null && value !== void 0 && (_value$bsReissueGoods = value.bsReissueGoods) !== null && _value$bsReissueGoods !== void 0 && _value$bsReissueGoods.length)) {
142
- return Promise.reject(new Error("请选择bs补发商品"));
191
+ return Promise.reject(new Error('请选择bs补发商品'));
143
192
  }
144
193
  return Promise.resolve();
145
194
  }
146
195
  }] : [];
147
- this.dataType = "object";
196
+ this.dataType = 'object';
148
197
  });
149
198
  export default BsReissue;
@@ -1,19 +1,20 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from "../../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
3
  declare class BsChildCode implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
- componentConfig: ComponentInterface["componentConfig"];
8
+ componentConfig: ComponentInterface['componentConfig'];
9
9
  align: ALignType;
10
10
  width: number;
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
15
+ dataType: ComponentInterface['dataType'];
16
16
  constructor(options: PickOption);
17
+ getParentId: () => string;
17
18
  renderClient: (record: any) => React.JSX.Element | null;
18
19
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
19
20
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -1,13 +1,19 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
11
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
13
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- import React from "react";
14
+ import React from 'react';
9
15
  import ItemView from "../../../commonComponents/ItemView";
10
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
11
17
  var BsChildCode = /*#__PURE__*/_createClass(function BsChildCode(options) {
12
18
  var _this = this;
13
19
  _classCallCheck(this, BsChildCode);
@@ -23,6 +29,14 @@ var BsChildCode = /*#__PURE__*/_createClass(function BsChildCode(options) {
23
29
  _defineProperty(this, "canSort", void 0);
24
30
  _defineProperty(this, "children", void 0);
25
31
  _defineProperty(this, "dataType", void 0);
32
+ _defineProperty(this, "getParentId", function () {
33
+ var _this$id$split = _this.id.split('_'),
34
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
35
+ key = _this$id$split2[0],
36
+ name = _this$id$split2[1],
37
+ code = _this$id$split2[2];
38
+ return "".concat(key, "_").concat(name);
39
+ });
26
40
  _defineProperty(this, "renderClient", function (record) {
27
41
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
28
42
  id: _this.id,
@@ -32,22 +46,24 @@ var BsChildCode = /*#__PURE__*/_createClass(function BsChildCode(options) {
32
46
  });
33
47
  _defineProperty(this, "renderPc", function (value, record) {
34
48
  var _this$getComponentVal;
35
- return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
49
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--');
36
50
  });
37
51
  _defineProperty(this, "renderLog", function (r) {
38
- if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
52
+ var id = _this.getParentId();
53
+ if (isNull(r === null || r === void 0 ? void 0 : r[id])) return null;
39
54
  return _this.renderPc(undefined, r);
40
55
  });
41
56
  _defineProperty(this, "getComponentValue", function (r) {
42
- var list = ((r === null || r === void 0 ? void 0 : r[_this.id]) || []).reduce(function (prv, next) {
43
- next["number"] && prv.push(next["number"]);
57
+ var id = _this.getParentId();
58
+ var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
59
+ next['code'] && prv.push(next['code']);
44
60
  return prv;
45
61
  }, []);
46
- return list.join(",");
62
+ return list.join(',');
47
63
  });
48
64
  _defineProperty(this, "renderExport", function (value, record) {
49
65
  var _this$getComponentVal2;
50
- return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
66
+ return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : '--';
51
67
  });
52
68
  _defineProperty(this, "editRender", function () {
53
69
  return null;
@@ -61,11 +77,11 @@ var BsChildCode = /*#__PURE__*/_createClass(function BsChildCode(options) {
61
77
  this.formField = options.id;
62
78
  this.type = options.type;
63
79
  this.componentConfig = options.componentConfig;
64
- this.align = "left";
80
+ this.align = 'left';
65
81
  this.width = 200;
66
82
  this.isCombinationComponent = false;
67
- this.canSort = true;
68
- this.dataType = "string";
83
+ this.canSort = false;
84
+ this.dataType = 'string';
69
85
  this.children = [];
70
86
  });
71
87
  export default BsChildCode;
@@ -0,0 +1,27 @@
1
+ import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
+ declare class BsHeaderGods 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 BsHeaderGods;