@kmkf-fe-packages/services-components 0.7.15-alpha.2 → 0.7.15-alpha.4

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 (43) hide show
  1. package/dist/esm/components/BS/BsExchange/index.d.ts +22 -6
  2. package/dist/esm/components/BS/BsExchange/index.js +175 -39
  3. package/dist/esm/components/BS/BsGoods/index.d.ts +4 -5
  4. package/dist/esm/components/BS/BsGoods/index.js +43 -29
  5. package/dist/esm/components/BS/BsReissue/index.d.ts +17 -6
  6. package/dist/esm/components/BS/BsReissue/index.js +61 -34
  7. package/dist/esm/components/BS/common/BsChildCode.d.ts +25 -0
  8. package/dist/esm/components/BS/common/BsChildCode.js +71 -0
  9. package/dist/esm/components/BS/common/BsChildMoney.d.ts +25 -0
  10. package/dist/esm/components/BS/common/BsChildMoney.js +71 -0
  11. package/dist/esm/components/BS/common/BsChildName.d.ts +25 -0
  12. package/dist/esm/components/BS/common/BsChildName.js +71 -0
  13. package/dist/esm/components/BS/common/BsChildNumber.d.ts +25 -0
  14. package/dist/esm/components/BS/common/BsChildNumber.js +71 -0
  15. package/dist/esm/components/BS/common/BsChildPic.d.ts +25 -0
  16. package/dist/esm/components/BS/common/BsChildPic.js +72 -0
  17. package/dist/esm/components/BS/common/BsChildShare.d.ts +25 -0
  18. package/dist/esm/components/BS/common/BsChildShare.js +71 -0
  19. package/dist/esm/components/BS/common/BsChildSku.d.ts +25 -0
  20. package/dist/esm/components/BS/common/BsChildSku.js +71 -0
  21. package/dist/esm/components/BS/common/BsChildType.d.ts +25 -0
  22. package/dist/esm/components/BS/common/BsChildType.js +71 -0
  23. package/dist/esm/components/BS/common/BsExchangeImage.d.ts +31 -0
  24. package/dist/esm/components/BS/common/BsExchangeImage.js +126 -0
  25. package/dist/esm/components/BS/common/BsGoodImage.d.ts +31 -0
  26. package/dist/esm/components/BS/common/BsGoodImage.js +88 -0
  27. package/dist/esm/components/BS/common/BsMemo.d.ts +25 -0
  28. package/dist/esm/components/BS/common/BsMemo.js +76 -0
  29. package/dist/esm/components/BS/common/BsType.d.ts +35 -0
  30. package/dist/esm/components/BS/common/{BsPic.js → BsType.js} +40 -49
  31. package/dist/esm/components/BS/common/index.d.ts +10 -0
  32. package/dist/esm/components/BS/common/index.js +10 -0
  33. package/dist/esm/components/Common/index.d.ts +12 -6
  34. package/dist/esm/components/Common/index.js +115 -50
  35. package/dist/esm/components/Common/index.module.less +8 -0
  36. package/dist/esm/components/File/index.d.ts +7 -8
  37. package/dist/esm/components/File/index.js +18 -47
  38. package/dist/esm/components/Input/index.js +3 -0
  39. package/dist/esm/components/LogisticsTrajectory/index.js +6 -16
  40. package/dist/esm/factory.d.ts +1 -1
  41. package/dist/esm/type.d.ts +1 -0
  42. package/package.json +4 -4
  43. package/dist/esm/components/BS/common/BsPic.d.ts +0 -43
@@ -5,94 +5,85 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
5
  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
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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";
9
+ import ItemView from "../../../commonComponents/ItemView";
8
10
  import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
9
- import { ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
10
11
  import { SYMBOL } from "../../../constant";
11
- var BsPic = /*#__PURE__*/_createClass(function BsPic(options) {
12
+ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
12
13
  var _this = this;
13
- _classCallCheck(this, BsPic);
14
+ _classCallCheck(this, BsType);
14
15
  _defineProperty(this, "name", void 0);
15
- _defineProperty(this, "parentId", void 0);
16
16
  _defineProperty(this, "id", void 0);
17
17
  _defineProperty(this, "sortField", void 0);
18
18
  _defineProperty(this, "type", void 0);
19
- _defineProperty(this, "rules", void 0);
20
19
  _defineProperty(this, "componentConfig", void 0);
21
- _defineProperty(this, "effects", void 0);
22
20
  _defineProperty(this, "align", void 0);
23
21
  _defineProperty(this, "width", void 0);
24
22
  _defineProperty(this, "isCombinationComponent", void 0);
25
23
  _defineProperty(this, "formField", void 0);
26
24
  _defineProperty(this, "canSort", void 0);
27
25
  _defineProperty(this, "children", void 0);
28
- _defineProperty(this, "expressInterceptInstance", void 0);
29
26
  _defineProperty(this, "dataType", void 0);
30
- _defineProperty(this, "getComponentValue", function (r) {
31
- return r === null || r === void 0 ? void 0 : r[_this.id];
32
- });
33
27
  _defineProperty(this, "renderClient", function (record) {
34
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? null : null;
28
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
29
+ id: _this.id,
30
+ label: _this.name,
31
+ value: _this.getComponentValue(record)
32
+ }) : null;
35
33
  });
36
34
  _defineProperty(this, "renderPc", function (value, record) {
37
- return null;
35
+ var _this$getComponentVal;
36
+ return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
38
37
  });
39
38
  _defineProperty(this, "renderLog", function (r) {
40
- var _this$expressIntercep;
41
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id)])) return null;
42
- return (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[r === null || r === void 0 ? void 0 : r["".concat(_this.id)]];
39
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
40
+ return _this.renderPc(undefined, r);
41
+ });
42
+ _defineProperty(this, "getComponentValue", function (r) {
43
+ var _find, _this$componentConfig;
44
+ var type = r !== null && r !== void 0 && r[_this.id] ? r === null || r === void 0 ? void 0 : r[_this.id][0] : "";
45
+ var text = (_find = (((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.reasonList) || []).find(function (item) {
46
+ return item.value === type;
47
+ })) === null || _find === void 0 ? void 0 : _find.label;
48
+ return text;
43
49
  });
44
50
  _defineProperty(this, "renderExport", function (value, record) {
45
- var _this$expressIntercep2, _this$expressIntercep3;
46
- return (_this$expressIntercep2 = (_this$expressIntercep3 = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep3 === void 0 ? void 0 : _this$expressIntercep3["".concat(record === null || record === void 0 ? void 0 : record[_this.id])]) !== null && _this$expressIntercep2 !== void 0 ? _this$expressIntercep2 : "--";
51
+ var _this$getComponentVal2;
52
+ return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
47
53
  });
48
54
  _defineProperty(this, "editRender", function () {
49
55
  return null;
50
56
  });
51
57
  _defineProperty(this, "filterConfig", function (item) {
58
+ var _item$config;
59
+ var subKey = item.subKey;
52
60
  return {
53
- searchDefaultConditions: SYMBOL.in,
61
+ searchDefaultConditions: SYMBOL.eq,
54
62
  type: item.type,
55
- id: "".concat(item.id, "_interceptLogisticsStatus"),
56
- name: "".concat(item.name, "-\u7269\u6D41\u72B6\u6001"),
57
- filterComponentType: "MultipleSelect",
63
+ id: item.id,
64
+ name: "".concat(item.name, "-\u7C7B\u578B"),
65
+ filterComponentType: "Cascader",
58
66
  props: {
59
- options: _this.expressInterceptInstance.getStatusOptions() || []
60
- },
61
- formatFilterValue: function formatFilterValue(value) {
62
- var _value$map;
63
- return value === null || value === void 0 ? void 0 : (_value$map = value.map(function (v) {
64
- return v === null || v === void 0 ? void 0 : v.split(",");
65
- })) === null || _value$map === void 0 ? void 0 : _value$map.flat();
67
+ options: item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.reasonList
66
68
  },
67
69
  filterFn: function filterFn(value) {
68
70
  return function (i) {
69
- var _value$map2, _value$map2$flat;
70
- return value === null || value === void 0 ? void 0 : (_value$map2 = value.map(function (v) {
71
- return v === null || v === void 0 ? void 0 : v.split(",");
72
- })) === null || _value$map2 === void 0 ? void 0 : (_value$map2$flat = _value$map2.flat()) === null || _value$map2$flat === void 0 ? void 0 : _value$map2$flat.includes(_filterFn.filterTableListItemColumnValue(i, item.id, "interceptLogisticsStatus"));
71
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "".concat(subKey)), value);
73
72
  };
74
73
  }
75
74
  };
76
75
  });
77
- this.name = "bs商品图片";
78
- this.parentId = options.id;
79
- this.id = "".concat(options.id);
80
- this.sortField = "".concat(options.id);
81
- this.formField = "".concat(options.id);
76
+ this.name = options.name;
77
+ this.id = options.id;
78
+ this.sortField = options.id;
79
+ this.formField = options.id;
82
80
  this.type = options.type;
83
81
  this.componentConfig = options.componentConfig;
84
- this.rules = [];
85
82
  this.align = "left";
86
- this.width = 220;
83
+ this.width = 200;
87
84
  this.isCombinationComponent = false;
88
- this.canSort = false;
89
- this.children = [];
90
- this.effects = options === null || options === void 0 ? void 0 : options.effects;
91
- this.expressInterceptInstance = ExpressInterceptData.getInstance();
85
+ this.canSort = true;
92
86
  this.dataType = "string";
93
- }
94
-
95
- //物流轨迹查询
96
- );
97
-
98
- export default BsPic;
87
+ this.children = [];
88
+ });
89
+ export default BsType;
@@ -0,0 +1,10 @@
1
+ export { default as BsType } from "./BsType";
2
+ export { default as BsMemo } from "./BsMemo";
3
+ export { default as BsChildPic } from "./BsChildPic";
4
+ export { default as BsChildName } from "./BsChildName";
5
+ export { default as BsChildCode } from "./BsChildCode";
6
+ export { default as BsChildSku } from "./BsChildSku";
7
+ export { default as BsChildMoney } from "./BsChildMoney";
8
+ export { default as BsChildNumber } from "./BsChildNumber";
9
+ export { default as BsChildShare } from "./BsChildShare";
10
+ export { default as BsChildType } from "./BsChildType";
@@ -0,0 +1,10 @@
1
+ export { default as BsType } from "./BsType";
2
+ export { default as BsMemo } from "./BsMemo";
3
+ export { default as BsChildPic } from "./BsChildPic";
4
+ export { default as BsChildName } from "./BsChildName";
5
+ export { default as BsChildCode } from "./BsChildCode";
6
+ export { default as BsChildSku } from "./BsChildSku";
7
+ export { default as BsChildMoney } from "./BsChildMoney";
8
+ export { default as BsChildNumber } from "./BsChildNumber";
9
+ export { default as BsChildShare } from "./BsChildShare";
10
+ export { default as BsChildType } from "./BsChildType";
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;
@@ -6,13 +6,19 @@ declare type getFormItemProps = {
6
6
  required: boolean;
7
7
  component: JSX.Element | string | null;
8
8
  };
9
- export declare const getFormItem: ({ name, title, rules, required, component }: getFormItemProps) => JSX.Element;
10
- export declare const showImage: ({ item, type, index }: {
9
+ export declare const getFormItem: ({ name, title, rules, required, component, }: getFormItemProps) => React.JSX.Element;
10
+ export declare const showImage: ({ item, type, index, }: {
11
11
  item: any;
12
12
  type: string;
13
13
  index: number;
14
- }) => JSX.Element;
15
- export declare const ShowTotalImage: ({ total, allImage, type }: any) => JSX.Element;
16
- export declare const GoodImage: ({ list, type }: any) => JSX.Element | null;
14
+ }) => React.JSX.Element;
15
+ export declare const ShowTotalImage: ({ total, allImage, type }: any) => React.JSX.Element;
16
+ export declare const GoodImage: ({ list, type }: any) => React.JSX.Element | null;
17
17
  export declare const JstGoodImage: ({ list, type }: any) => any;
18
+ export declare const BsGoodImage: ({ item, index }: {
19
+ item: any;
20
+ index: number;
21
+ }) => React.JSX.Element;
22
+ export declare const BsExchangeList: ({ list }: any) => React.JSX.Element;
23
+ export declare const BsGoodPic: (list: string[]) => React.JSX.Element[];
18
24
  export {};
@@ -4,9 +4,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  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; }
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Form, Button, Modal, Tooltip, Space, Image, Popover } from 'antd';
8
- import React, { useState } from 'react';
9
- import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { Form, Button, Modal, Tooltip, Space, Image, Popover } from "antd";
8
+ import React, { useState } from "react";
9
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
10
10
  import styles from "./index.module.less";
11
11
  import defaultImg from "./img/default-img.png";
12
12
  export var getFormItem = function getFormItem(_ref) {
@@ -26,7 +26,7 @@ export var getFormItem = function getFormItem(_ref) {
26
26
  return /*#__PURE__*/React.createElement("div", {
27
27
  className: "form-item--wrap",
28
28
  style: {
29
- position: 'relative'
29
+ position: "relative"
30
30
  }
31
31
  }, /*#__PURE__*/React.createElement(Form.Item, {
32
32
  name: name,
@@ -40,43 +40,43 @@ export var showImage = function showImage(_ref2) {
40
40
  var item = _ref2.item,
41
41
  type = _ref2.type,
42
42
  index = _ref2.index;
43
- var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== 'tabao' ? item.picUrl : item.picUrl + '_40x40.jpg' : defaultImg;
43
+ var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : defaultImg;
44
44
  return /*#__PURE__*/React.createElement("div", {
45
45
  className: styles.goodImgBox,
46
46
  key: index
47
- }, (item === null || item === void 0 ? void 0 : item.platform) === 'taobao' ? /*#__PURE__*/React.createElement("a", {
47
+ }, (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? /*#__PURE__*/React.createElement("a", {
48
48
  target: "_blank",
49
49
  href: "https://item.taobao.com/item.htm?id=".concat(item.numIid)
50
50
  }, /*#__PURE__*/React.createElement("img", {
51
51
  style: {
52
- width: '40px',
53
- height: '40px',
54
- objectFit: 'contain'
52
+ width: "40px",
53
+ height: "40px",
54
+ objectFit: "contain"
55
55
  },
56
56
  src: picUrl
57
57
  })) : /*#__PURE__*/React.createElement("img", {
58
58
  style: {
59
- width: '40px',
60
- height: '40px',
61
- objectFit: 'contain'
59
+ width: "40px",
60
+ height: "40px",
61
+ objectFit: "contain"
62
62
  },
63
63
  src: picUrl
64
64
  }), /*#__PURE__*/React.createElement("div", {
65
65
  className: styles.options
66
- }, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
67
- title: '商品id',
66
+ }, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
67
+ title: "商品id",
68
68
  text: item.numIid
69
- }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
70
- title: '商品编码',
69
+ }), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
70
+ title: "商品编码",
71
71
  text: item.outerId
72
- }), (type === 'itemThird' || type === 'jstItemThird') && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
73
- title: '供应商编码',
72
+ }), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
73
+ title: "供应商编码",
74
74
  text: item.itemId || item.supplierItemOuterId
75
- }), (type === 'itemThird' || type === 'jstItemThird') && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
76
- title: '供应商名称',
75
+ }), (type === "itemThird" || type === "jstItemThird") && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
76
+ title: "供应商名称",
77
77
  text: item.supplierName
78
78
  }), item.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
79
- title: '规格',
79
+ title: "规格",
80
80
  text: item.propertiesName
81
81
  })));
82
82
  };
@@ -89,9 +89,9 @@ var TextTool = function TextTool(_ref3) {
89
89
  title: text
90
90
  }, /*#__PURE__*/React.createElement("div", {
91
91
  style: {
92
- overflow: 'hidden',
93
- whiteSpace: 'nowrap',
94
- textOverflow: 'ellipsis'
92
+ overflow: "hidden",
93
+ whiteSpace: "nowrap",
94
+ textOverflow: "ellipsis"
95
95
  }
96
96
  }, title, ":", text));
97
97
  };
@@ -119,47 +119,47 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
119
119
  title: "\u6240\u6709\u9009\u62E9\u5B9D\u8D1D"
120
120
  }, /*#__PURE__*/React.createElement("div", {
121
121
  style: {
122
- display: 'flex',
123
- flexWrap: 'wrap'
122
+ display: "flex",
123
+ flexWrap: "wrap"
124
124
  }
125
125
  }, allImage.map(function (i, index) {
126
126
  return /*#__PURE__*/React.createElement("div", {
127
127
  style: {
128
- width: '50%'
128
+ width: "50%"
129
129
  },
130
130
  key: index
131
131
  }, /*#__PURE__*/React.createElement("a", {
132
132
  href: i.link,
133
133
  target: "__blank",
134
134
  style: {
135
- marginRight: '12px',
136
- marginTop: '8px',
137
- padding: '2px',
138
- border: '1px dashed #ccc',
139
- display: 'inline-block'
135
+ marginRight: "12px",
136
+ marginTop: "8px",
137
+ padding: "2px",
138
+ border: "1px dashed #ccc",
139
+ display: "inline-block"
140
140
  }
141
141
  }, /*#__PURE__*/React.createElement("img", {
142
142
  alt: "",
143
143
  src: i.picUrl || defaultImg,
144
144
  style: {
145
- width: '72px',
146
- height: '72px',
147
- objectFit: 'contain'
145
+ width: "72px",
146
+ height: "72px",
147
+ objectFit: "contain"
148
148
  }
149
- })), /*#__PURE__*/React.createElement("div", null, type === 'itemId' && /*#__PURE__*/React.createElement(TextTool, {
150
- title: '商品id',
149
+ })), /*#__PURE__*/React.createElement("div", null, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
150
+ title: "商品id",
151
151
  text: i.numIid
152
- }), type === 'itemCode' && /*#__PURE__*/React.createElement(TextTool, {
153
- title: '商品编码',
152
+ }), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
153
+ title: "商品编码",
154
154
  text: i.outerId
155
- }), (type === 'itemThird' || type === 'jstItemThird') && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
156
- title: '供应商编码',
155
+ }), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
156
+ title: "供应商编码",
157
157
  text: i.itemId || i.supplierItemOuterId
158
- }), (type === 'itemThird' || type === 'jstItemThird') && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
159
- title: '供应商名称',
158
+ }), (type === "itemThird" || type === "jstItemThird") && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
159
+ title: "供应商名称",
160
160
  text: i.supplierName
161
161
  }), i.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
162
- title: '规格',
162
+ title: "规格",
163
163
  text: i.propertiesName
164
164
  })));
165
165
  }))));
@@ -169,12 +169,12 @@ export var GoodImage = function GoodImage(_ref5) {
169
169
  var _list$slice;
170
170
  var list = _ref5.list,
171
171
  _ref5$type = _ref5.type,
172
- type = _ref5$type === void 0 ? '' : _ref5$type;
172
+ type = _ref5$type === void 0 ? "" : _ref5$type;
173
173
  var total = (list === null || list === void 0 ? void 0 : list.length) || 0;
174
174
  var initShowTotal = 3;
175
175
  return (list === null || list === void 0 ? void 0 : list.length) > 0 ? /*#__PURE__*/React.createElement("div", {
176
176
  style: {
177
- display: type === 'itemSelect' ? 'flex' : 'block'
177
+ display: type === "itemSelect" ? "flex" : "block"
178
178
  }
179
179
  }, list === null || list === void 0 ? void 0 : (_list$slice = list.slice(0, initShowTotal)) === null || _list$slice === void 0 ? void 0 : _list$slice.map(function (item, index) {
180
180
  return showImage({
@@ -191,7 +191,7 @@ export var GoodImage = function GoodImage(_ref5) {
191
191
  var content = function content(item, index) {
192
192
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
193
193
  style: {
194
- textAlign: 'center'
194
+ textAlign: "center"
195
195
  }
196
196
  }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
197
197
  return /*#__PURE__*/React.createElement("div", {
@@ -215,9 +215,74 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
215
215
  }, /*#__PURE__*/React.createElement("span", {
216
216
  key: index,
217
217
  style: {
218
- color: '#1890ff',
219
- cursor: 'pointer'
218
+ color: "#1890ff",
219
+ cursor: "pointer"
220
220
  }
221
- }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join('/') : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join('/') : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join('/') : item.sendId ? item.sendId : item.sendName) : null));
221
+ }, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join("/") : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join("/") : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join("/") : item.sendId ? item.sendId : item.sendName) : null));
222
222
  }) : null;
223
+ };
224
+ //bs商品展示 todo
225
+ export var BsGoodImage = function BsGoodImage(_ref7) {
226
+ var item = _ref7.item,
227
+ index = _ref7.index;
228
+ var picUrl = item.picUrl || defaultImg;
229
+ var keyMap = {
230
+ name: "bs名称",
231
+ code: "bs编码",
232
+ skuId: "bssku编码",
233
+ money: "bs实付金额",
234
+ number: "bs数量",
235
+ share: "bs分摊价",
236
+ type: "bs赠品类型"
237
+ };
238
+ return /*#__PURE__*/React.createElement("div", {
239
+ className: styles.goodImgBox,
240
+ key: index
241
+ }, /*#__PURE__*/React.createElement("img", {
242
+ style: {
243
+ width: "40px",
244
+ height: "40px",
245
+ objectFit: "contain"
246
+ },
247
+ src: picUrl
248
+ }), /*#__PURE__*/React.createElement("div", {
249
+ className: styles.options
250
+ }, Object.keys(keyMap).map(function (key) {
251
+ return item[key] ? /*#__PURE__*/React.createElement(TextTool, {
252
+ title: keyMap[key],
253
+ text: item[key]
254
+ }) : null;
255
+ })));
256
+ };
257
+ //bs换货 todo
258
+ export var BsExchangeList = function BsExchangeList(_ref8) {
259
+ var list = _ref8.list;
260
+ return /*#__PURE__*/React.createElement("div", {
261
+ className: styles.bsImgBox
262
+ }, list.map(function (item) {
263
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
264
+ className: styles.bsImgItem
265
+ }, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
266
+ return BsGoodImage({
267
+ item: t,
268
+ index: i
269
+ });
270
+ })), "==>", /*#__PURE__*/React.createElement("div", {
271
+ className: styles.bsImgItem
272
+ }, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
273
+ return BsGoodImage({
274
+ item: t,
275
+ index: i
276
+ });
277
+ })));
278
+ }));
279
+ };
280
+ //bs图片展示
281
+ export var BsGoodPic = function BsGoodPic(list) {
282
+ return list.map(function (t) {
283
+ return /*#__PURE__*/React.createElement(Image, {
284
+ width: 60,
285
+ src: t
286
+ });
287
+ });
223
288
  };
@@ -6,3 +6,11 @@
6
6
  width: calc(100% - 40px);
7
7
  }
8
8
  }
9
+
10
+ .bsImgBox {
11
+ display: flex;
12
+ border-bottom: 1px solid #eee;
13
+ .bsImgItem{
14
+ display: flex;
15
+ }
16
+ }
@@ -1,32 +1,31 @@
1
1
  import { ComponentInterface, PickOption, Record } from "../../type";
2
2
  import React from "react";
3
- declare type Value = string[] | undefined;
4
3
  declare class BasicFile implements ComponentInterface {
5
4
  name: string;
6
5
  id: string;
7
6
  sortField: string;
7
+ formField: string;
8
8
  type: string;
9
9
  rules: any[];
10
10
  componentConfig: ComponentInterface["componentConfig"];
11
11
  isCombinationComponent: boolean;
12
12
  canSort: boolean;
13
13
  children: ComponentInterface[];
14
+ dataType: ComponentInterface["dataType"];
14
15
  constructor(options: PickOption);
15
- formatPictures: (pictures: string) => string[];
16
- render: (value: Value) => React.JSX.Element | null;
17
- renderPc: (value: any, record: Record) => React.JSX.Element | React.JSX.Element[];
18
- renderLog: (r: Record) => React.JSX.Element | React.JSX.Element[] | null;
16
+ renderPc: (value: any, record: Record) => any;
17
+ renderLog: (r: Record) => any;
19
18
  getComponentValue: (r: Record) => any;
20
19
  renderClient: (record: any) => React.JSX.Element | null;
21
20
  editRender: () => React.JSX.Element;
22
21
  /**
23
22
  *
24
- * @returns 图片类型的导出需要在导出时单独处理
23
+ * @returns
25
24
  */
26
- renderExport: () => null;
25
+ renderExport: (value: any, record: any) => any;
27
26
  /**
28
27
  *
29
- * @returns 图片不支持过滤
28
+ * @returns 文件不支持过滤
30
29
  */
31
30
  filterConfig: () => never[];
32
31
  }
@@ -7,9 +7,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
7
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
8
  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); }
9
9
  import React from "react";
10
- import { Image } from "antd";
11
10
  import { ApaasUploadFile } from "@kmkf-fe-packages/basic-components";
12
- import { imgResize } from "@kmkf-fe-packages/kmkf-utils";
13
11
  import GetFormItem from "../GetFormItem";
14
12
  import ItemView from "../../commonComponents/ItemView";
15
13
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
@@ -19,56 +17,23 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
19
17
  _defineProperty(this, "name", void 0);
20
18
  _defineProperty(this, "id", void 0);
21
19
  _defineProperty(this, "sortField", void 0);
20
+ _defineProperty(this, "formField", void 0);
22
21
  _defineProperty(this, "type", void 0);
23
22
  _defineProperty(this, "rules", void 0);
24
23
  _defineProperty(this, "componentConfig", void 0);
25
24
  _defineProperty(this, "isCombinationComponent", void 0);
26
25
  _defineProperty(this, "canSort", void 0);
27
26
  _defineProperty(this, "children", void 0);
28
- _defineProperty(this, "formatPictures", function (pictures) {
29
- pictures = pictures.replace(/[\[\]]/g, "");
30
- pictures = pictures.replace(/\s/g, "");
31
- return pictures ? pictures.split(",") : [];
32
- });
33
- _defineProperty(this, "render", function (value) {
34
- if (!(value !== null && value !== void 0 && value.length)) {
35
- return null;
36
- }
37
- return /*#__PURE__*/React.createElement("div", null, value === null || value === void 0 ? void 0 : value.map(function (pic) {
38
- return /*#__PURE__*/React.createElement("div", {
39
- style: {
40
- marginRight: "5px",
41
- display: "inline-block"
42
- }
43
- }, /*#__PURE__*/React.createElement(Image, {
44
- width: 32,
45
- src: imgResize(pic || ""),
46
- preview: {
47
- src: imgResize(pic || "", 0, 0)
48
- }
49
- }));
50
- }));
51
- });
27
+ _defineProperty(this, "dataType", void 0);
52
28
  _defineProperty(this, "renderPc", function (value, record) {
53
- if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) === undefined) {
29
+ var fileList = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) || [];
30
+ if (!fileList.length) {
54
31
  return /*#__PURE__*/React.createElement("span", null, "--");
55
32
  }
56
- var finalPictures = _this.formatPictures(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]).map(function (item) {
57
- return "".concat(window.location.origin, "/").concat(item);
58
- });
59
- return finalPictures === null || finalPictures === void 0 ? void 0 : finalPictures.map(function (pic) {
60
- return /*#__PURE__*/React.createElement("div", {
61
- style: {
62
- marginRight: "5px",
63
- display: "inline-block"
64
- }
65
- }, /*#__PURE__*/React.createElement(Image, {
66
- width: 32,
67
- src: "".concat(pic, "?x-oss-process=image/resize,m_pad,h_40,w_40"),
68
- preview: {
69
- src: pic
70
- }
71
- }));
33
+ return fileList === null || fileList === void 0 ? void 0 : fileList.map(function (file) {
34
+ return /*#__PURE__*/React.createElement("a", {
35
+ href: file.url
36
+ }, file.name);
72
37
  });
73
38
  });
74
39
  _defineProperty(this, "renderLog", function (r) {
@@ -79,10 +44,10 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
79
44
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_file")];
80
45
  });
81
46
  _defineProperty(this, "renderClient", function (record) {
82
- return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
47
+ return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) ? /*#__PURE__*/React.createElement(ItemView, {
83
48
  id: _this.id,
84
49
  label: _this.name,
85
- value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
50
+ value: _this.renderPc(null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")])
86
51
  }) : null;
87
52
  });
88
53
  _defineProperty(this, "editRender", function () {
@@ -98,8 +63,12 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
98
63
  }))
99
64
  });
100
65
  });
101
- _defineProperty(this, "renderExport", function () {
102
- return null;
66
+ _defineProperty(this, "renderExport", function (value, record) {
67
+ var textArr = ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_rate")]) || []).reduce(function (prv, next) {
68
+ prv.push(next.url);
69
+ return prv;
70
+ }, []);
71
+ return textArr === null || textArr === void 0 ? void 0 : textArr.join(",");
103
72
  });
104
73
  _defineProperty(this, "filterConfig", function () {
105
74
  return [];
@@ -107,11 +76,13 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
107
76
  this.name = options.name;
108
77
  this.id = options.id;
109
78
  this.sortField = "".concat(options.id, "_file");
79
+ this.formField = "".concat(options.id, "_file");
110
80
  this.type = options.type;
111
81
  this.componentConfig = options.componentConfig;
112
82
  this.rules = [];
113
83
  this.isCombinationComponent = false;
114
84
  this.canSort = false;
115
85
  this.children = [];
86
+ this.dataType = "array";
116
87
  });
117
88
  export default BasicFile;
@@ -87,6 +87,9 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
87
87
  this.rules = [{
88
88
  validator: function validator(_, value) {
89
89
  var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
90
+ if (!value) {
91
+ return Promise.resolve();
92
+ }
90
93
  var number = /^(([0-9]*(\.[0-9]{1,})$)|([0-9]+$))/;
91
94
  var mail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
92
95
  var phone = /^1\d{10}$/;