@kmkf-fe-packages/services-components 0.7.15-alpha.5 → 0.7.15-alpha.51

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 (64) hide show
  1. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -21
  2. package/dist/esm/components/BS/BsExchange/index.d.ts +6 -8
  3. package/dist/esm/components/BS/BsExchange/index.js +207 -116
  4. package/dist/esm/components/BS/BsGoods/index.d.ts +9 -9
  5. package/dist/esm/components/BS/BsGoods/index.js +82 -60
  6. package/dist/esm/components/BS/BsLogistics/index.d.ts +7 -7
  7. package/dist/esm/components/BS/BsLogistics/index.js +14 -14
  8. package/dist/esm/components/BS/BsReissue/index.d.ts +8 -5
  9. package/dist/esm/components/BS/BsReissue/index.js +89 -50
  10. package/dist/esm/components/BS/common/{BsChildCode.d.ts → BsHeaderCode.d.ts} +5 -4
  11. package/dist/esm/components/BS/common/{BsChildCode.js → BsHeaderCode.js} +27 -11
  12. package/dist/esm/components/BS/common/{BsChildMoney.d.ts → BsHeaderMoney.d.ts} +5 -4
  13. package/dist/esm/components/BS/common/{BsChildMoney.js → BsHeaderMoney.js} +27 -11
  14. package/dist/esm/components/BS/common/{BsChildName.d.ts → BsHeaderName.d.ts} +5 -4
  15. package/dist/esm/components/BS/common/{BsChildName.js → BsHeaderName.js} +28 -11
  16. package/dist/esm/components/BS/common/{BsChildNumber.d.ts → BsHeaderNumber.d.ts} +5 -4
  17. package/dist/esm/components/BS/common/{BsChildNumber.js → BsHeaderNumber.js} +27 -11
  18. package/dist/esm/components/BS/common/{BsChildPic.d.ts → BsHeaderPic.d.ts} +5 -4
  19. package/dist/esm/components/BS/common/{BsChildPic.js → BsHeaderPic.js} +26 -10
  20. package/dist/esm/components/BS/common/{BsChildShare.d.ts → BsHeaderShare.d.ts} +5 -4
  21. package/dist/esm/components/BS/common/{BsChildShare.js → BsHeaderShare.js} +27 -11
  22. package/dist/esm/components/BS/common/{BsChildSku.d.ts → BsHeaderSku.d.ts} +5 -4
  23. package/dist/esm/components/BS/common/{BsChildSku.js → BsHeaderSku.js} +27 -11
  24. package/dist/esm/components/BS/common/{BsChildType.d.ts → BsHeaderType.d.ts} +5 -4
  25. package/dist/esm/components/BS/common/{BsChildType.js → BsHeaderType.js} +27 -11
  26. package/dist/esm/components/BS/common/BsMemo.d.ts +4 -3
  27. package/dist/esm/components/BS/common/BsMemo.js +43 -13
  28. package/dist/esm/components/BS/common/BsType.d.ts +1 -0
  29. package/dist/esm/components/BS/common/BsType.js +34 -8
  30. package/dist/esm/components/BS/common/index.d.ts +10 -10
  31. package/dist/esm/components/BS/common/index.js +8 -8
  32. package/dist/esm/components/Cascader/index.d.ts +1 -0
  33. package/dist/esm/components/Cascader/index.js +3 -1
  34. package/dist/esm/components/Common/index.d.ts +5 -0
  35. package/dist/esm/components/Common/index.js +102 -2
  36. package/dist/esm/components/File/index.d.ts +4 -4
  37. package/dist/esm/components/File/index.js +29 -9
  38. package/dist/esm/components/FlowStatusSelect/index.d.ts +0 -1
  39. package/dist/esm/components/FlowStatusSelect/index.js +30 -24
  40. package/dist/esm/components/FlowWorkOrderId/index.d.ts +33 -0
  41. package/dist/esm/components/FlowWorkOrderId/index.js +107 -0
  42. package/dist/esm/components/JST/JstLogistics/index.js +25 -8
  43. package/dist/esm/components/LogisticsTrajectory/index.d.ts +8 -9
  44. package/dist/esm/components/LogisticsTrajectory/index.js +12 -10
  45. package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +6 -5
  46. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +6 -6
  47. package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +8 -8
  48. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +0 -1
  49. package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +4 -10
  50. package/dist/esm/components/Payment/BuyerNick.js +1 -2
  51. package/dist/esm/components/Payment/index.d.ts +1 -0
  52. package/dist/esm/components/Payment/index.js +9 -6
  53. package/dist/esm/components/PostIng/index.d.ts +6 -29
  54. package/dist/esm/components/PostIng/index.js +73 -77
  55. package/dist/esm/factory.d.ts +2 -2
  56. package/dist/esm/factory.js +6 -3
  57. package/dist/esm/index.d.ts +1 -0
  58. package/dist/esm/index.js +1 -0
  59. package/dist/esm/type.d.ts +15 -14
  60. package/package.json +4 -4
  61. package/dist/esm/components/BS/common/BsExchangeImage.d.ts +0 -31
  62. package/dist/esm/components/BS/common/BsExchangeImage.js +0 -126
  63. package/dist/esm/components/BS/common/BsGoodImage.d.ts +0 -31
  64. 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,15 +1,15 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
- import Express from "../../Express";
5
- import ExpressCode from "../../ExpressCode";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
+ import Express from '../../Express';
5
+ import ExpressCode from '../../ExpressCode';
6
6
  declare class BsLogistics implements ComponentInterface {
7
7
  name: string;
8
8
  id: string;
9
9
  sortField: string;
10
10
  type: string;
11
11
  rules: any[];
12
- componentConfig: ComponentInterface["componentConfig"];
12
+ componentConfig: ComponentInterface['componentConfig'];
13
13
  expressDateInstance: InstanceType<typeof ExpressData>;
14
14
  express: Express;
15
15
  expressCode: ExpressCode;
@@ -17,7 +17,7 @@ declare class BsLogistics implements ComponentInterface {
17
17
  formField: string;
18
18
  canSort: boolean;
19
19
  children: ComponentInterface[];
20
- dataType: ComponentInterface["dataType"];
20
+ dataType: ComponentInterface['dataType'];
21
21
  constructor(options: PickOption);
22
22
  editRender: (p: any) => React.JSX.Element;
23
23
  renderClient: (record: Record) => React.JSX.Element;
@@ -8,9 +8,9 @@ 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";
12
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
13
- import { ExpressLogistics } from "@kmkf-fe-packages/basic-components";
11
+ import React from 'react';
12
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
13
+ import { ExpressLogistics } from '@kmkf-fe-packages/basic-components';
14
14
  import Express from "../../Express";
15
15
  import ExpressCode from "../../ExpressCode";
16
16
  import GetFormItem from "../../GetFormItem";
@@ -66,9 +66,9 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
66
66
  });
67
67
  _defineProperty(this, "filterConfig", function (item) {
68
68
  return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
69
- subKey: "bsLogisticsCompany"
69
+ subKey: 'bsLogisticsCompany'
70
70
  })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
71
- subKey: "bsLogisticsCode"
71
+ subKey: 'bsLogisticsCode'
72
72
  }))];
73
73
  });
74
74
  this.name = options.name;
@@ -79,33 +79,33 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
79
79
  this.componentConfig = options.componentConfig;
80
80
  this.expressDateInstance = ExpressData.getInstance();
81
81
  this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
82
- name: "快递物流公司",
82
+ name: '快递物流公司',
83
83
  id: "".concat(this.id, "_bsLogisticsCompany")
84
84
  }));
85
85
  this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
86
- name: "快递物流单号",
86
+ name: '快递物流单号',
87
87
  id: "".concat(this.id, "_bsLogisticsCode")
88
88
  }));
89
89
  this.isCombinationComponent = true;
90
90
  this.canSort = false;
91
- this.dataType = "object";
91
+ this.dataType = 'object';
92
92
  this.children = [this.express, this.expressCode];
93
93
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
94
94
  validator: function validator(_, value) {
95
95
  var _this$componentConfig4;
96
96
  if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
97
97
  var _this$componentConfig5, _this$componentConfig6;
98
- if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) === "EXPRESS_COMPANY" && !(value !== null && value !== void 0 && value.company)) {
99
- return Promise.reject(new Error("请选择物流公司"));
100
- } else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) === "EXPRESS_WAYBILL_CODE" && !(value !== null && value !== void 0 && value.order)) {
101
- return Promise.reject(new Error("请输入物流单号"));
98
+ if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showHeader) === 'EXPRESS_COMPANY' && !(value !== null && value !== void 0 && value.company)) {
99
+ return Promise.reject(new Error('请选择物流公司'));
100
+ } else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showHeader) === 'EXPRESS_WAYBILL_CODE' && !(value !== null && value !== void 0 && value.order)) {
101
+ return Promise.reject(new Error('请输入物流单号'));
102
102
  }
103
103
  } else {
104
104
  if (!(value !== null && value !== void 0 && value.company)) {
105
- return Promise.reject(new Error("请选择物流公司"));
105
+ return Promise.reject(new Error('请选择物流公司'));
106
106
  }
107
107
  if (!(value !== null && value !== void 0 && value.order)) {
108
- return Promise.reject(new Error("请输入物流单号"));
108
+ return Promise.reject(new Error('请输入物流单号'));
109
109
  }
110
110
  }
111
111
  return Promise.resolve();
@@ -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;
@@ -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%"
@@ -77,7 +130,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
77
130
  type: item.type,
78
131
  id: "".concat(item.id, "_bsReissueType"),
79
132
  name: "".concat(item.name, "-\u6362\u8D27\u7C7B\u578B"),
80
- filterComponentType: "Cascader",
133
+ filterComponentType: 'Cascader',
81
134
  props: {
82
135
  options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
83
136
  },
@@ -91,7 +144,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
91
144
  type: item.type,
92
145
  id: "".concat(item.id, "_bsReissueGoods"),
93
146
  name: "".concat(_this.name),
94
- filterComponentType: "Input"
147
+ filterComponentType: 'Input'
95
148
  }];
96
149
  });
97
150
  this.name = options.name;
@@ -100,50 +153,36 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
100
153
  this.formField = "".concat(options.id);
101
154
  this.type = options.type;
102
155
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
103
- this.isCombinationComponent = false;
156
+ this.isCombinationComponent = true;
104
157
  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
- }))];
158
+ this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
159
+ id: "".concat(options.id, "_bsReissueType_type"),
160
+ name: '补发类型'
161
+ }));
162
+ this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
163
+ id: "".concat(options.id, "_bsReissueType_memo"),
164
+ name: '补发备注'
165
+ }));
166
+ 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) {
167
+ if (childHeaderMap[next]) {
168
+ prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
169
+ name: childHeaderMap[next].name,
170
+ id: "".concat(options.id, "_bsReissueGoods_").concat(childHeaderMap[next].key)
171
+ })));
172
+ }
173
+ return prv;
174
+ }, [])));
136
175
  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 ? [{
176
+ this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
138
177
  required: true,
139
178
  validator: function validator(_, value) {
140
179
  var _value$bsReissueGoods;
141
180
  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补发商品"));
181
+ return Promise.reject(new Error('请选择bs补发商品'));
143
182
  }
144
183
  return Promise.resolve();
145
184
  }
146
185
  }] : [];
147
- this.dataType = "object";
186
+ this.dataType = 'object';
148
187
  });
149
188
  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;