@kmkf-fe-packages/services-components 2.5.0-rc.0 → 2.5.0

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 (121) hide show
  1. package/dist/esm/Hooks/index.d.ts +2 -0
  2. package/dist/esm/Hooks/index.js +2 -0
  3. package/dist/esm/Hooks/useColumnsConfig.d.ts +26 -0
  4. package/dist/esm/Hooks/useColumnsConfig.js +243 -0
  5. package/dist/esm/Hooks/useGoodsSourceFormat.d.ts +29 -0
  6. package/dist/esm/Hooks/useGoodsSourceFormat.js +441 -0
  7. package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.d.ts +1 -1
  8. package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.js +4 -2
  9. package/dist/esm/commonComponents/GlobalContext/index.js +60 -20
  10. package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +14 -11
  11. package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpLogisticsCompany.js +14 -12
  12. package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpSendData.js +11 -9
  13. package/dist/esm/commonComponents/OperationLog/index.d.ts +2 -1
  14. package/dist/esm/commonComponents/OperationLog/index.js +4 -2
  15. package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +5 -3
  16. package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -19
  17. package/dist/esm/commonComponents/ShopList/index.js +3 -1
  18. package/dist/esm/components/BS/BsLogistics/index.d.ts +7 -2
  19. package/dist/esm/components/BS/BsLogistics/index.js +61 -8
  20. package/dist/esm/components/BS/BsSystemOrder/index.d.ts +8 -0
  21. package/dist/esm/components/BS/BsSystemOrder/index.js +56 -9
  22. package/dist/esm/components/BS/common/BsHeaderGood.js +2 -2
  23. package/dist/esm/components/BS/common/BsHeaderPic.d.ts +2 -0
  24. package/dist/esm/components/BS/common/BsHeaderPic.js +17 -2
  25. package/dist/esm/components/BS/common/BsMemo.js +4 -1
  26. package/dist/esm/components/BS/common/BsType.js +4 -1
  27. package/dist/esm/components/BS/common/SystemOrderNo.js +4 -1
  28. package/dist/esm/components/BS/common/expressCode.d.ts +4 -1
  29. package/dist/esm/components/BS/common/expressCode.js +16 -4
  30. package/dist/esm/components/BS/common/expressCompany.d.ts +5 -2
  31. package/dist/esm/components/BS/common/expressCompany.js +31 -5
  32. package/dist/esm/components/BsE3/BsReissueE3/index.js +4 -1
  33. package/dist/esm/components/Cascader/index.d.ts +8 -6
  34. package/dist/esm/components/Cascader/index.js +26 -22
  35. package/dist/esm/components/Common/constants/bs.js +2 -2
  36. package/dist/esm/components/Common/constants/columnsBaseInfoMap.js +6 -2
  37. package/dist/esm/components/Common/constants/defaultColumns.js +2 -2
  38. package/dist/esm/components/Common/constants/wdt.js +104 -0
  39. package/dist/esm/components/Common/index.d.ts +2 -2
  40. package/dist/esm/components/Common/index.js +40 -24
  41. package/dist/esm/components/CommonDataTime/index.d.ts +2 -2
  42. package/dist/esm/components/CommonDataTime/index.js +2 -2
  43. package/dist/esm/components/CommonHeaderGood/index.js +1165 -18
  44. package/dist/esm/components/CommonInput/index.js +11 -3
  45. package/dist/esm/components/CommonMultiStatus/index.js +73 -36
  46. package/dist/esm/components/ErpTradeId/index.d.ts +2 -2
  47. package/dist/esm/components/ErpTradeId/index.js +7 -4
  48. package/dist/esm/components/File/index.d.ts +6 -6
  49. package/dist/esm/components/File/index.js +9 -10
  50. package/dist/esm/components/FlowOverallStatusSelect/index.d.ts +40 -0
  51. package/dist/esm/components/FlowOverallStatusSelect/index.js +180 -0
  52. package/dist/esm/components/GY/GyGoods/index.js +5 -1
  53. package/dist/esm/components/GY/GyReissue/index.js +5 -1
  54. package/dist/esm/components/GY/GyReturn/index.js +5 -1
  55. package/dist/esm/components/Input/index.d.ts +4 -4
  56. package/dist/esm/components/Input/index.js +35 -31
  57. package/dist/esm/components/JST/JstSendGood/index.js +17 -1
  58. package/dist/esm/components/KM/KmExchange/index.d.ts +35 -0
  59. package/dist/esm/components/KM/KmExchange/index.js +136 -0
  60. package/dist/esm/components/KmErpSendGood/index.js +1 -1
  61. package/dist/esm/components/Logistics/index.d.ts +1 -0
  62. package/dist/esm/components/Logistics/index.js +10 -0
  63. package/dist/esm/components/LogisticsInterception/columnHeader.js +1 -1
  64. package/dist/esm/components/LogisticsInterception/index.d.ts +20 -0
  65. package/dist/esm/components/LogisticsInterception/index.js +10 -5
  66. package/dist/esm/components/LogisticsInterception/interceptApiStatusReason.d.ts +45 -0
  67. package/dist/esm/components/LogisticsInterception/interceptApiStatusReason.js +97 -0
  68. package/dist/esm/components/LogisticsInterception/interceptSenderMobile.js +3 -2
  69. package/dist/esm/components/LogisticsMoreInterception/InterceptAddress.js +4 -2
  70. package/dist/esm/components/LogisticsMoreInterception/InterceptApiStatus.js +1 -1
  71. package/dist/esm/components/LogisticsMoreInterception/index.js +1 -0
  72. package/dist/esm/components/LogisticsMoreInterception/interceptSenderMobile.d.ts +5 -5
  73. package/dist/esm/components/LogisticsMoreInterception/interceptSenderMobile.js +9 -9
  74. package/dist/esm/components/OrderSubForm/index.d.ts +7 -0
  75. package/dist/esm/components/OrderSubForm/index.js +24 -7
  76. package/dist/esm/components/Payment/index.d.ts +13 -12
  77. package/dist/esm/components/Payment/index.js +31 -11
  78. package/dist/esm/components/PaymentVoucherCode/Preview.js +35 -9
  79. package/dist/esm/components/Picture/index.d.ts +5 -5
  80. package/dist/esm/components/Picture/index.js +20 -20
  81. package/dist/esm/components/PicturePro/index.d.ts +15 -6
  82. package/dist/esm/components/PicturePro/index.js +42 -25
  83. package/dist/esm/components/PostIng/index.d.ts +5 -0
  84. package/dist/esm/components/PostIng/index.js +42 -8
  85. package/dist/esm/components/Public/Goods/index.d.ts +10 -8
  86. package/dist/esm/components/Public/Goods/index.js +42 -2
  87. package/dist/esm/components/Public/ReissueGoods/index.js +62 -4
  88. package/dist/esm/components/Public/ReturnWarehouse/index.d.ts +51 -0
  89. package/dist/esm/components/Public/ReturnWarehouse/index.js +210 -0
  90. package/dist/esm/components/ReceiverAddress/index.d.ts +7 -6
  91. package/dist/esm/components/ReceiverAddress/index.js +41 -27
  92. package/dist/esm/components/Reissue/Logistics/index.js +2 -2
  93. package/dist/esm/components/Remark/index.d.ts +18 -2
  94. package/dist/esm/components/Remark/index.js +37 -2
  95. package/dist/esm/components/ReturnLogistics/index.d.ts +7 -6
  96. package/dist/esm/components/ReturnLogistics/index.js +34 -17
  97. package/dist/esm/components/SKX/SkxGoods/index.js +4 -0
  98. package/dist/esm/components/SKX/SkxIdInputSelect/index.js +4 -0
  99. package/dist/esm/components/Select/index.d.ts +1 -0
  100. package/dist/esm/components/Select/index.js +19 -11
  101. package/dist/esm/components/ShopInput/index.d.ts +5 -5
  102. package/dist/esm/components/ShopInput/index.js +12 -9
  103. package/dist/esm/components/StatusSelect/index.js +4 -0
  104. package/dist/esm/components/SubForm/children/HeaderChildFile.d.ts +30 -0
  105. package/dist/esm/components/SubForm/children/HeaderChildFile.js +117 -0
  106. package/dist/esm/components/SubForm/children/HeaderChildPic.d.ts +30 -0
  107. package/dist/esm/components/SubForm/children/HeaderChildPic.js +116 -0
  108. package/dist/esm/components/SubForm/index.js +78 -6
  109. package/dist/esm/components/TradeId/index.d.ts +5 -5
  110. package/dist/esm/components/TradeId/index.js +17 -14
  111. package/dist/esm/components/WDT/WdtRessuie/index.js +28 -8
  112. package/dist/esm/factory.d.ts +2 -2
  113. package/dist/esm/factory.js +34 -7
  114. package/dist/esm/index.d.ts +4 -0
  115. package/dist/esm/index.js +6 -1
  116. package/dist/esm/service/api.d.ts +3 -0
  117. package/dist/esm/service/api.js +34 -1
  118. package/dist/esm/type.d.ts +38 -0
  119. package/package.json +4 -4
  120. package/dist/esm/components/Common/constants/gy.d.ts +0 -3
  121. package/dist/esm/components/Common/constants/gy.js +0 -219
@@ -27,6 +27,10 @@ var Preview = function Preview(_ref) {
27
27
  }),
28
28
  _usePdf2 = _slicedToArray(_usePdf, 1),
29
29
  loading = _usePdf2[0];
30
+ var copyUrl = function copyUrl() {
31
+ copy(url);
32
+ message.success("复制图片链接成功");
33
+ };
30
34
  var copyHandle = /*#__PURE__*/function () {
31
35
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
32
36
  var _yield$navigator$perm, state;
@@ -43,9 +47,28 @@ var Preview = function Preview(_ref) {
43
47
  state = _yield$navigator$perm.state;
44
48
  if (state == "granted") {
45
49
  html2canvas(canvasEl === null || canvasEl === void 0 ? void 0 : canvasEl.current, {
46
- useCORS: true
50
+ useCORS: true,
51
+ // scale: 2,
52
+ width: 595,
53
+ height: 455,
54
+ onclone: function onclone(clonedDoc) {
55
+ var _clonedDoc$querySelec;
56
+ var ctx = (_clonedDoc$querySelec = clonedDoc.querySelector("canvas")) === null || _clonedDoc$querySelec === void 0 ? void 0 : _clonedDoc$querySelec.getContext("2d");
57
+ if (ctx) {
58
+ ctx.mozImageSmoothingEnabled = false;
59
+ ctx.webkitImageSmoothingEnabled = false;
60
+ ctx.msImageSmoothingEnabled = false;
61
+ ctx.imageSmoothingEnabled = false;
62
+ }
63
+ }
47
64
  }).then(function (canvas) {
48
- var imgUrl = canvas.toDataURL("image/png");
65
+ var scale = window.devicePixelRatio || 1;
66
+ canvas.style.width = "".concat(canvas.width / scale, "px"); // [citation:1][citation:6]
67
+ canvas.style.height = "".concat(canvas.height / scale, "px");
68
+
69
+ // 将Canvas插入页面或转换为图片
70
+ // document.body.appendChild(canvas);
71
+ var imgUrl = canvas.toDataURL("image/png", 1.0);
49
72
  var str = imgUrl.replace(/data:image\/png;base64,/, "");
50
73
  var file = b64toBlob(str, "image/png");
51
74
  var clipboardItemInput = new window.ClipboardItem({
@@ -55,17 +78,15 @@ var Preview = function Preview(_ref) {
55
78
  message.success("复制图片成功");
56
79
  });
57
80
  } else {
58
- copy(url);
59
- message.success("复制图片链接成功");
81
+ copyUrl();
60
82
  }
61
- _context.next = 12;
83
+ _context.next = 11;
62
84
  break;
63
85
  case 8:
64
86
  _context.prev = 8;
65
87
  _context.t0 = _context["catch"](0);
66
- copy(url);
67
- message.success("复制图片链接成功");
68
- case 12:
88
+ copyUrl();
89
+ case 11:
69
90
  case "end":
70
91
  return _context.stop();
71
92
  }
@@ -78,7 +99,12 @@ var Preview = function Preview(_ref) {
78
99
  return /*#__PURE__*/React.createElement("div", null, !loading && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
79
100
  type: "link",
80
101
  onClick: copyHandle
81
- }, "\u590D\u5236\u51ED\u8BC1")), /*#__PURE__*/React.createElement("canvas", {
102
+ }, "\u590D\u5236\u51ED\u8BC1"), /*#__PURE__*/React.createElement(Button, {
103
+ type: "link",
104
+ onClick: function onClick() {
105
+ return copyUrl();
106
+ }
107
+ }, "\u590D\u5236\u94FE\u63A5")), /*#__PURE__*/React.createElement("canvas", {
82
108
  ref: canvasEl
83
109
  }));
84
110
  };
@@ -1,5 +1,5 @@
1
- import { ComponentInterface, PickOption, Record } from "../../type";
2
- import React from "react";
1
+ import { ComponentInterface, PickOption, Record } from '../../type';
2
+ import React from 'react';
3
3
  declare type Value = string[] | undefined;
4
4
  declare class BasicPicture implements ComponentInterface {
5
5
  name: string;
@@ -7,13 +7,13 @@ declare class BasicPicture implements ComponentInterface {
7
7
  sortField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface["componentConfig"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface["dataType"];
16
- currenEnv: ComponentInterface["platform"];
15
+ dataType: ComponentInterface['dataType'];
16
+ currenEnv: ComponentInterface['platform'];
17
17
  constructor(options: PickOption);
18
18
  formatPictures: (pictures: string) => string[];
19
19
  render: (value: Value) => React.JSX.Element | null;
@@ -6,13 +6,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
6
6
  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; }
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
- import React from "react";
10
- import { Image } from "antd";
11
- import { ApaasUploadAsync, ApaasUpload } from "@kmkf-fe-packages/basic-components";
12
- import { imgResize } from "@kmkf-fe-packages/kmkf-utils";
9
+ import React from 'react';
10
+ import { Image } from 'antd';
11
+ import { ApaasUploadAsync, ApaasUpload } from '@kmkf-fe-packages/basic-components';
12
+ import { imgResize } from '@kmkf-fe-packages/kmkf-utils';
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import ItemView from "../../commonComponents/ItemView";
15
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
15
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
16
16
  import { hostUrl } from "../../constant";
17
17
  var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
18
18
  var _this = this,
@@ -31,9 +31,9 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
31
31
  _defineProperty(this, "dataType", void 0);
32
32
  _defineProperty(this, "currenEnv", void 0);
33
33
  _defineProperty(this, "formatPictures", function (pictures) {
34
- pictures = pictures.replace(/[\[\]]/g, "");
35
- pictures = pictures.replace(/\s/g, "");
36
- return pictures ? pictures.split(",") : [];
34
+ pictures = pictures.replace(/[\[\]]/g, '');
35
+ pictures = pictures.replace(/\s/g, '');
36
+ return pictures ? pictures.split(',') : [];
37
37
  });
38
38
  _defineProperty(this, "render", function (value) {
39
39
  var _document;
@@ -41,20 +41,20 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
41
41
  return null;
42
42
  }
43
43
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Image.PreviewGroup, {
44
- preview: _this.currenEnv === "ks" ? {
45
- getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById("root")
44
+ preview: _this.currenEnv === 'ks' ? {
45
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
46
46
  } : true
47
47
  }, value === null || value === void 0 ? void 0 : value.map(function (pic) {
48
48
  return /*#__PURE__*/React.createElement("div", {
49
49
  style: {
50
- marginRight: "5px",
51
- display: "inline-block"
50
+ marginRight: '5px',
51
+ display: 'inline-block'
52
52
  }
53
53
  }, /*#__PURE__*/React.createElement(Image, {
54
54
  width: 32,
55
- src: imgResize(pic || ""),
55
+ src: imgResize(pic || ''),
56
56
  preview: {
57
- src: imgResize(pic || "", 0, 0)
57
+ src: imgResize(pic || '', 0, 0)
58
58
  }
59
59
  }));
60
60
  })));
@@ -64,13 +64,13 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
64
64
  return /*#__PURE__*/React.createElement("span", null, "--");
65
65
  }
66
66
  var finalPictures = _this.formatPictures(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_picture")]).map(function (item) {
67
- return item.startsWith("http") ? item : "".concat(hostUrl, "/").concat(item);
67
+ return item.startsWith('http') ? item : "".concat(hostUrl, "/").concat(item);
68
68
  });
69
69
  return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, finalPictures === null || finalPictures === void 0 ? void 0 : finalPictures.map(function (pic) {
70
70
  return /*#__PURE__*/React.createElement("div", {
71
71
  style: {
72
- marginRight: "5px",
73
- display: "inline-block"
72
+ marginRight: '5px',
73
+ display: 'inline-block'
74
74
  },
75
75
  onClick: function onClick(e) {
76
76
  return e.stopPropagation();
@@ -107,9 +107,9 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
107
107
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
108
108
  display: p === null || p === void 0 ? void 0 : p.display,
109
109
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
110
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
110
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
111
111
  component: (_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.isSingleShop ? /*#__PURE__*/React.createElement(ApaasUpload, _this.componentConfig) : /*#__PURE__*/React.createElement(ApaasUploadAsync, _extends({}, _this.componentConfig, {
112
- uniqueKey: _this.id,
112
+ uniqueKey: 'picture',
113
113
  hostUrl: hostUrl,
114
114
  platform: _this.currenEnv
115
115
  }))
@@ -131,7 +131,7 @@ var BasicPicture = /*#__PURE__*/_createClass(function BasicPicture(options) {
131
131
  this.isCombinationComponent = false;
132
132
  this.canSort = true;
133
133
  this.children = [];
134
- this.dataType = "string";
134
+ this.dataType = 'string';
135
135
  this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
136
136
  });
137
137
  export default BasicPicture;
@@ -1,6 +1,6 @@
1
- import { ComponentInterface, PickOption, Record } from "../../type";
2
- import React from "react";
3
- import "./index.less";
1
+ import { ComponentInterface, PickOption, Record } from '../../type';
2
+ import React from 'react';
3
+ import './index.less';
4
4
  declare type Value = {
5
5
  url: string;
6
6
  name: string;
@@ -11,15 +11,24 @@ declare class BasicPicturePro implements ComponentInterface {
11
11
  sortField: string;
12
12
  type: string;
13
13
  rules: any[];
14
- componentConfig: ComponentInterface["componentConfig"];
14
+ componentConfig: ComponentInterface['componentConfig'];
15
15
  isCombinationComponent: boolean;
16
16
  formField: string;
17
17
  canSort: boolean;
18
18
  children: ComponentInterface[];
19
- dataType: ComponentInterface["dataType"];
20
- currenEnv: ComponentInterface["platform"];
19
+ dataType: ComponentInterface['dataType'];
20
+ currenEnv: ComponentInterface['platform'];
21
+ sortChildField: {
22
+ name: string;
23
+ key: string;
24
+ dataType: string;
25
+ [key: string]: any;
26
+ }[];
27
+ exampleValue?: string;
28
+ standardDateType: ComponentInterface['standardDateType'];
21
29
  constructor(options: PickOption);
22
30
  formatPictures: (pictures: string) => string[];
31
+ getSortChildFields: () => any;
23
32
  render: (value: Value) => React.JSX.Element | null;
24
33
  renderPc: () => null;
25
34
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -8,17 +8,17 @@ 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 { ApaasUploadProAsync } from "@kmkf-fe-packages/basic-components";
11
+ import React from 'react';
12
+ import { ApaasUploadProAsync } from '@kmkf-fe-packages/basic-components';
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import ItemView from "../../commonComponents/ItemView";
15
15
  import PictureName from "./PictureName";
16
16
  import PictureUrl from "./PictureUrl";
17
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
18
18
  import "./index.less";
19
- import { Image, Tooltip, message } from "antd";
20
- import { DownloadOutlined, CopyOutlined } from "@ant-design/icons";
21
- import copy from "copy-to-clipboard";
19
+ import { Image, Tooltip, message } from 'antd';
20
+ import { DownloadOutlined, CopyOutlined } from '@ant-design/icons';
21
+ import copy from 'copy-to-clipboard';
22
22
  import { hostUrl } from "../../constant";
23
23
  var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options) {
24
24
  var _this = this,
@@ -36,10 +36,24 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
36
36
  _defineProperty(this, "children", void 0);
37
37
  _defineProperty(this, "dataType", void 0);
38
38
  _defineProperty(this, "currenEnv", void 0);
39
+ _defineProperty(this, "sortChildField", void 0);
40
+ _defineProperty(this, "exampleValue", void 0);
41
+ _defineProperty(this, "standardDateType", void 0);
39
42
  _defineProperty(this, "formatPictures", function (pictures) {
40
- pictures = pictures.replace(/[\[\]]/g, "");
41
- pictures = pictures.replace(/\s/g, "");
42
- return pictures ? pictures.split(",") : [];
43
+ pictures = pictures.replace(/[\[\]]/g, '');
44
+ pictures = pictures.replace(/\s/g, '');
45
+ return pictures ? pictures.split(',') : [];
46
+ });
47
+ _defineProperty(this, "getSortChildFields", function () {
48
+ return [{
49
+ name: '图片名称',
50
+ key: "".concat(_this.id, "_name"),
51
+ dataType: 'arrayObject'
52
+ }, {
53
+ name: '图片链接',
54
+ key: "".concat(_this.id, "_url"),
55
+ dataType: 'arrayObject'
56
+ }];
43
57
  });
44
58
  _defineProperty(this, "render", function (value) {
45
59
  var _document;
@@ -48,29 +62,29 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
48
62
  }
49
63
  var copyText = value.map(function (item) {
50
64
  return item.name;
51
- }).join(",");
65
+ }).join(',');
52
66
  var onCopy = function onCopy() {
53
67
  copy(copyText);
54
- message.success("图片名称复制成功");
68
+ message.success('图片名称复制成功');
55
69
  };
56
70
  return /*#__PURE__*/React.createElement("div", {
57
71
  className: "pictureProClient"
58
72
  }, /*#__PURE__*/React.createElement(Image.PreviewGroup, {
59
- preview: _this.currenEnv === "ks" ? {
60
- getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById("root")
73
+ preview: _this.currenEnv === 'ks' ? {
74
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
61
75
  } : true
62
76
  }, value.map(function (item) {
63
77
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(item.url) ? "".concat(hostUrl, "/").concat(item.url) : item.url, "?x-oss-process=image/resize,h_60,w_60");
64
78
  var showImage = /^pic\/[\s\S]*$/.test(item.url) ? "".concat(hostUrl, "/").concat(item.url) : item.url;
65
79
  var downloadHandle = function downloadHandle() {
66
- if (_this.currenEnv === "pc") {
80
+ if (_this.currenEnv === 'pc') {
67
81
  try {
68
82
  fetch("".concat(hostUrl, "/").concat(item.url)).then(function (res) {
69
83
  return res.blob();
70
84
  }).then(function (blob) {
71
- var a = document.createElement("a");
85
+ var a = document.createElement('a');
72
86
  document.body.appendChild(a);
73
- a.style.display = "none";
87
+ a.style.display = 'none';
74
88
  var url = window.URL.createObjectURL(blob);
75
89
  a.href = url;
76
90
  a.download = item.name;
@@ -83,7 +97,7 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
83
97
  }
84
98
  } else {
85
99
  copy("".concat(hostUrl, "/").concat(item.url));
86
- message.success("图片链接复制成功");
100
+ message.success('图片链接复制成功');
87
101
  }
88
102
  };
89
103
  return /*#__PURE__*/React.createElement("div", {
@@ -96,15 +110,15 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
96
110
  preview: {
97
111
  src: showImage
98
112
  },
99
- width: "100%",
100
- height: "100%"
113
+ width: '100%',
114
+ height: '100%'
101
115
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
102
116
  title: item.name
103
117
  }, /*#__PURE__*/React.createElement("div", {
104
118
  className: "pictureProText"
105
119
  }, item.name)), /*#__PURE__*/React.createElement("div", {
106
120
  className: "pictureProOperate"
107
- }, _this.currenEnv === "pc" ? /*#__PURE__*/React.createElement(DownloadOutlined, {
121
+ }, _this.currenEnv === 'pc' ? /*#__PURE__*/React.createElement(DownloadOutlined, {
108
122
  className: "downloadIcon",
109
123
  onClick: downloadHandle
110
124
  }) : /*#__PURE__*/React.createElement(CopyOutlined, {
@@ -142,9 +156,9 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
142
156
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
143
157
  display: p === null || p === void 0 ? void 0 : p.display,
144
158
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
145
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
159
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
146
160
  component: /*#__PURE__*/React.createElement(ApaasUploadProAsync, _extends({}, _this.componentConfig, {
147
- uniqueKey: _this.id,
161
+ uniqueKey: 'picturePro',
148
162
  hostUrl: hostUrl,
149
163
  platform: _this.currenEnv
150
164
  }))
@@ -166,15 +180,18 @@ var BasicPicturePro = /*#__PURE__*/_createClass(function BasicPicturePro(options
166
180
  this.isCombinationComponent = true;
167
181
  this.canSort = true;
168
182
  this.children = [new PictureName(_objectSpread(_objectSpread({}, options), {}, {
169
- name: "图片名称",
183
+ name: '图片名称',
170
184
  id: "".concat(options.id, "_pictureProList_name"),
171
185
  width: 250
172
186
  })), new PictureUrl(_objectSpread(_objectSpread({}, options), {}, {
173
- name: "图片详情",
187
+ name: '图片详情',
174
188
  id: "".concat(options.id, "_pictureProList_url"),
175
189
  width: 200
176
190
  }))];
177
- this.dataType = "object";
191
+ this.dataType = 'object';
178
192
  this.currenEnv = options === null || options === void 0 ? void 0 : (_options$effects = options.effects) === null || _options$effects === void 0 ? void 0 : _options$effects.env;
193
+ this.sortChildField = this.getSortChildFields();
194
+ this.exampleValue = '[{"name":"c.jpeg","url":"https://kefu.kuaimai.com/pic/c.jpeg"}]';
195
+ this.standardDateType = 'Array';
179
196
  });
180
197
  export default BasicPicturePro;
@@ -7,6 +7,7 @@ import District from "../BS/BsPosting/components//District";
7
7
  import Detail from "../BS/BsPosting/components//Detail";
8
8
  import ReceiverName from "../BS/BsPosting/components//ReceiverName";
9
9
  import ReceiverMobile from "../BS/BsPosting/components//ReceiverMobile";
10
+ declare type SortColumnsField = Array<string>;
10
11
  declare class BasicPosting implements ComponentInterface {
11
12
  name: string;
12
13
  id: string;
@@ -27,7 +28,11 @@ declare class BasicPosting implements ComponentInterface {
27
28
  receiverName: ReceiverName;
28
29
  receiverMobile: ReceiverMobile;
29
30
  isSplitColumns: boolean;
31
+ sortColumns: SortColumnsField;
32
+ headerProvince: boolean;
30
33
  constructor(options: PickOption);
34
+ getChildren: () => (Province | City | District | Detail | ReceiverName | ReceiverMobile | undefined)[];
35
+ getSortColumns: (sortColumns: string | undefined) => SortColumnsField;
31
36
  renderPc: (value: any, record: Record) => React.JSX.Element | null;
32
37
  renderLog: (r: Record) => React.JSX.Element | null;
33
38
  getComponentValue: (r: Record) => {
@@ -23,7 +23,7 @@ import { ApaasPosting } from "@kmkf-fe-packages/basic-components";
23
23
  import GetFormItem from "../GetFormItem";
24
24
  import ItemView from "../../commonComponents/ItemView";
25
25
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
26
- import { AddressData, BsAddressData, WdtAddressData, GyAddressData } from "@kmkf-fe-packages/kmkf-utils";
26
+ import { AddressData, BsAddressData, WdtAddressData, GyAddressData, JstAddressData } from "@kmkf-fe-packages/kmkf-utils";
27
27
  import Province from "../BS/BsPosting/components/Province";
28
28
  import City from "../BS/BsPosting/components//City";
29
29
  import District from "../BS/BsPosting/components//District";
@@ -35,6 +35,7 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
35
35
  var _this = this,
36
36
  _options$componentCon,
37
37
  _options$componentCon2,
38
+ _this$componentConfig6,
38
39
  _options$componentCon3;
39
40
  _classCallCheck(this, BasicPosting);
40
41
  _defineProperty(this, "name", void 0);
@@ -56,6 +57,26 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
56
57
  _defineProperty(this, "receiverName", void 0);
57
58
  _defineProperty(this, "receiverMobile", void 0);
58
59
  _defineProperty(this, "isSplitColumns", void 0);
60
+ _defineProperty(this, "sortColumns", void 0);
61
+ _defineProperty(this, "headerProvince", void 0);
62
+ _defineProperty(this, "getChildren", function () {
63
+ var _this$sortColumns;
64
+ if (!_this.isSplitColumns) return [];
65
+ return (_this$sortColumns = _this.sortColumns) === null || _this$sortColumns === void 0 ? void 0 : _this$sortColumns.map(function (filed) {
66
+ if (filed === 'province') return _this.province;
67
+ if (filed === 'city') return _this.city;
68
+ if (filed === 'district') return _this.district;
69
+ if (filed === 'detail') return _this.detail;
70
+ if (filed === 'name') return _this.receiverName;
71
+ if (filed === 'mobile') return _this.receiverMobile;
72
+ });
73
+ });
74
+ _defineProperty(this, "getSortColumns", function (sortColumns) {
75
+ var _sortColumns$split;
76
+ var defaultSortColumn = ['province', 'city', 'district', 'detail', 'name', 'mobile'];
77
+ if (!sortColumns) return defaultSortColumn;
78
+ return (_sortColumns$split = sortColumns === null || sortColumns === void 0 ? void 0 : sortColumns.split(',')) !== null && _sortColumns$split !== void 0 ? _sortColumns$split : [];
79
+ });
59
80
  _defineProperty(this, "renderPc", function (value, record) {
60
81
  var _ref;
61
82
  if (_this.isSplitColumns) {
@@ -73,20 +94,26 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
73
94
  var addressText = (_ref = [province, city, district]) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
74
95
  return _this.addressDateInstance.getNameByCode(suffix);
75
96
  }).join("");
97
+ var text = _this.headerProvince ? "".concat(addressText).concat(detail, " ").concat(name, " ").concat(mobile) : "".concat(name, " ").concat(mobile, " ").concat(addressText).concat(detail);
98
+ var firstContent = _this.headerProvince ? "".concat(addressText).concat(detail) : "".concat(name, " ").concat(mobile);
99
+ var secondContent = _this.headerProvince ? "".concat(name, " ").concat(mobile) : "".concat(addressText).concat(detail);
76
100
  return /*#__PURE__*/React.createElement(CopyText, {
77
- text: "".concat(addressText).concat(detail, " ").concat(name, " ").concat(mobile),
101
+ text: text,
78
102
  showText: /*#__PURE__*/React.createElement("div", {
79
103
  style: {
80
104
  maxHeight: "100px",
81
105
  overflowY: "auto"
82
106
  }
83
- }, "".concat(addressText).concat(detail), /*#__PURE__*/React.createElement("br", null), "".concat(name, " ").concat(mobile))
107
+ }, firstContent, /*#__PURE__*/React.createElement("br", null), secondContent)
84
108
  });
85
109
  });
86
110
  _defineProperty(this, "renderLog", function (r) {
87
111
  var _ref2;
88
112
  if (_this.isSplitColumns) {
89
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.province.renderLog(r), _this.city.renderLog(r), _this.district.renderLog(r), _this.detail.renderLog(r), "/", _this.receiverName.renderLog(r), _this.receiverMobile.renderLog(r));
113
+ var _this$children;
114
+ return /*#__PURE__*/React.createElement(React.Fragment, null, (_this$children = _this.children) === null || _this$children === void 0 ? void 0 : _this$children.map(function (instance) {
115
+ return instance.renderLog(r);
116
+ }));
90
117
  }
91
118
  var _this$getComponentVal = _this.getComponentValue(r),
92
119
  province = _this$getComponentVal.province,
@@ -101,7 +128,8 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
101
128
  var addressText = (_ref2 = [province, city, district]) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (suffix) {
102
129
  return _this.addressDateInstance.getNameByCode(suffix);
103
130
  }).join("");
104
- return /*#__PURE__*/React.createElement(React.Fragment, null, "".concat(addressText).concat(detail, " ").concat(name).concat(mobile));
131
+ var content = _this.headerProvince ? "".concat(addressText).concat(detail, " ").concat(name).concat(mobile) : "".concat(name).concat(mobile, " ").concat(addressText).concat(detail);
132
+ return /*#__PURE__*/React.createElement(React.Fragment, null, content);
105
133
  });
106
134
  _defineProperty(this, "getComponentValue", function (r) {
107
135
  if (_this.isSplitColumns) {
@@ -141,7 +169,8 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
141
169
  var addressText = (_ref3 = [province, city, district]) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (suffix) {
142
170
  return _this.addressDateInstance.getNameByCode(suffix);
143
171
  }).join("/");
144
- return "".concat(addressText, "/").concat(detail, "/ ").concat(name, "/").concat(mobile);
172
+ var content = _this.headerProvince ? "".concat(addressText, "/").concat(detail, "/ ").concat(name, "/").concat(mobile) : "".concat(name, "/").concat(mobile, "/ ").concat(addressText, "/").concat(detail);
173
+ return content;
145
174
  });
146
175
  _defineProperty(this, "renderClient", function (record) {
147
176
  var _ref4;
@@ -155,7 +184,9 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
155
184
  return _this.addressDateInstance.getNameByCode(suffix);
156
185
  }).join("");
157
186
  var hasValue = addressText || detail || name || mobile;
158
- var value = hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join("/"), /*#__PURE__*/React.createElement("br", null), [name, mobile].join("/")) : null;
187
+ var firstContent = _this.headerProvince ? [addressText, detail].join("/") : [name, mobile].join("/");
188
+ var secondContent = _this.headerProvince ? [name, mobile].join("/") : [addressText, detail].join("/");
189
+ var value = hasValue ? /*#__PURE__*/React.createElement("div", null, firstContent, /*#__PURE__*/React.createElement("br", null), secondContent) : null;
159
190
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
160
191
  id: _this.id,
161
192
  label: _this.name,
@@ -197,8 +228,11 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
197
228
  bs: BsAddressData,
198
229
  gy: GyAddressData,
199
230
  wdt: WdtAddressData,
231
+ jst: JstAddressData,
200
232
  workOrder: AddressData
201
233
  }[showField] || AddressData).getInstance();
234
+ this.sortColumns = this.getSortColumns((_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.sortColumns);
235
+ this.headerProvince = this.sortColumns[0] === 'province';
202
236
  this.province = new Province(_objectSpread(_objectSpread({}, options), {}, {
203
237
  id: "".concat(options.id, "_postingProvince"),
204
238
  name: "省",
@@ -229,7 +263,7 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
229
263
  parentName: this.name,
230
264
  name: "收件人电话"
231
265
  }));
232
- this.children = this.isSplitColumns ? [this.province, this.city, this.district, this.detail, this.receiverName, this.receiverMobile] : [];
266
+ this.children = this.getChildren();
233
267
  this.rules = [].concat(_toConsumableArray(options !== null && options !== void 0 && (_options$componentCon3 = options.componentConfig) !== null && _options$componentCon3 !== void 0 && _options$componentCon3.required ? [{
234
268
  validator: function validator(_, value) {
235
269
  var _options$componentCon4, _value$postingAddress, _value$postingAddress2;
@@ -1,14 +1,7 @@
1
1
  import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
2
  import React from "react";
3
3
  import CommonHeaderGoods from "../../CommonHeaderGood";
4
- declare const CONFIG_MAP: {
5
- JST_GOODS: {
6
- key: string;
7
- };
8
- KM_GOODS: {
9
- key: string;
10
- };
11
- };
4
+ declare const CONFIG_MAP: Record;
12
5
  declare class PublicGoods implements ComponentInterface {
13
6
  name: string;
14
7
  id: string;
@@ -23,7 +16,16 @@ declare class PublicGoods implements ComponentInterface {
23
16
  children: ComponentInterface[];
24
17
  dataType: ComponentInterface["dataType"];
25
18
  headers: CommonHeaderGoods;
19
+ exampleValue?: string;
20
+ standardDateType: ComponentInterface["standardDateType"];
21
+ sortChildField: {
22
+ name: string;
23
+ key: string;
24
+ dataType: string;
25
+ [key: string]: any;
26
+ }[];
26
27
  constructor(options: PickOption);
28
+ getSortChildFields: () => any;
27
29
  renderClient: (record: any) => React.JSX.Element | null;
28
30
  renderPc: () => null;
29
31
  renderLog: (r: Record) => React.JSX.Element | null;