@kmkf-fe-packages/services-components 1.17.5-beta.8 → 1.17.6-rc.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.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryWdtLogisticsCompany" | "queryWdtSendData";
3
- declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
3
+ declare const Global: ({ children, requestList, repeatRequestList, }: React.PropsWithChildren<{
4
4
  requestList?: RequestType[] | undefined;
5
5
  repeatRequestList?: Record<string, () => Promise<any>> | undefined;
6
6
  }>) => React.JSX.Element;
@@ -14,9 +14,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import React, { useEffect, useState } from "react";
17
- import { Skeleton, Result, Button } from "antd";
17
+ import { Skeleton, Button, Alert, Space } from "antd";
18
18
  import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryWdtLogisticsCompany, queryWdtSendData } from "../../service/api";
19
- import { servers } from '@kmkf-fe-packages/kmkf-utils';
19
+ import { servers } from "@kmkf-fe-packages/kmkf-utils";
20
20
  var Global = function Global(_ref) {
21
21
  var children = _ref.children,
22
22
  _ref$requestList = _ref.requestList,
@@ -93,15 +93,17 @@ var Global = function Global(_ref) {
93
93
  });
94
94
  }
95
95
  if (globalState === "failed") {
96
- return /*#__PURE__*/React.createElement(Result, {
97
- status: "error",
98
- title: "\u6570\u636E\u52A0\u8F7D\u5F02\u5E38,\u8BF7\u5237\u65B0\u91CD\u8BD5",
99
- extra: /*#__PURE__*/React.createElement(Button, {
96
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Alert, {
97
+ message: "\u6570\u636E\u52A0\u8F7D\u5F02\u5E38,\u53EF\u80FD\u5F71\u54CD\u90E8\u5206\u7EC4\u4EF6\u4F7F\u7528",
98
+ type: "warning",
99
+ action: /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
100
100
  type: "primary",
101
101
  key: "console",
102
- onClick: initDataSource
103
- }, "\u5237\u65B0\u91CD\u8BD5")
104
- });
102
+ onClick: initDataSource,
103
+ size: "small"
104
+ }, "\u5237\u65B0\u91CD\u8BD5")),
105
+ closable: true
106
+ }), children);
105
107
  }
106
108
  return /*#__PURE__*/React.createElement(React.Fragment, null, children);
107
109
  };
@@ -20,7 +20,7 @@ declare class JstSendGood implements ComponentInterface {
20
20
  children: ComponentInterface[];
21
21
  dataType: ComponentInterface["dataType"];
22
22
  constructor(options: PickOption);
23
- getSortChildFields: (type: string, options: PickOption) => any;
23
+ getSortChildFields: (type: string, options: PickOption, fieldType?: string) => any;
24
24
  renderClient: (record: Record) => React.JSX.Element | null;
25
25
  renderPc: (value: any, record: Record) => React.JSX.Element;
26
26
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -60,34 +60,29 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
60
60
  _defineProperty(this, "canSort", void 0);
61
61
  _defineProperty(this, "children", void 0);
62
62
  _defineProperty(this, "dataType", void 0);
63
- _defineProperty(this, "getSortChildFields", function (type, options) {
63
+ _defineProperty(this, "getSortChildFields", function (type, options, fieldType) {
64
+ var _typeMap$options$type, _typeMap$options$type2;
65
+ var sendName = {
66
+ name: "发货仓名称",
67
+ key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.sendName),
68
+ dataType: "string"
69
+ };
70
+ var sendId = {
71
+ name: "发货仓编码",
72
+ key: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.sendId),
73
+ dataType: "string"
74
+ };
75
+ if (fieldType === 'WDT_SEND_GOOD') {
76
+ sendName.options = WdtSendData.getInstance().getWdtSendData() || [];
77
+ }
64
78
  if (type === 'all') {
65
- var _typeMap$options$type, _typeMap$options$type2;
66
- return [{
67
- name: "发货仓名称",
68
- key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.sendName),
69
- dataType: "string"
70
- }, {
71
- name: "发货仓编码",
72
- key: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.sendId),
73
- dataType: "string"
74
- }];
79
+ return [sendName, sendId];
75
80
  }
76
81
  if (type === 'sendName') {
77
- var _typeMap$options$type3;
78
- return [{
79
- name: "发货仓名称",
80
- key: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.sendName),
81
- dataType: "string"
82
- }];
82
+ return [sendName];
83
83
  }
84
84
  if (type === 'sendId') {
85
- var _typeMap$options$type4;
86
- return [{
87
- name: "发货仓编码",
88
- key: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.sendId),
89
- dataType: "string"
90
- }];
85
+ return [sendId];
91
86
  }
92
87
  return [];
93
88
  });
@@ -212,7 +207,7 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
212
207
  this.sortField = "".concat(_options.id, "_").concat((_typeMap$_options$typ = typeMap[_options.type]) === null || _typeMap$_options$typ === void 0 ? void 0 : _typeMap$_options$typ.key);
213
208
  this.formField = "".concat(_options.id, "_").concat((_typeMap$_options$typ2 = typeMap[_options.type]) === null || _typeMap$_options$typ2 === void 0 ? void 0 : _typeMap$_options$typ2.key);
214
209
  this.componentConfig = _options.componentConfig;
215
- this.sortChildField = this.getSortChildFields(((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || '', _options);
210
+ this.sortChildField = this.getSortChildFields(((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || '', _options, _options.type);
216
211
  this.type = _options.type;
217
212
  this.dataType = "object";
218
213
  this.rules = (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
@@ -22,7 +22,7 @@ declare class InterceptApiStatus implements ComponentInterface {
22
22
  renderClient: (r: any) => React.JSX.Element | null;
23
23
  renderPc: (value: any, r: Record) => React.JSX.Element | "--";
24
24
  renderLog: (r: Record) => React.JSX.Element | "--" | null;
25
- renderExport: (value: any, r: Record) => any;
25
+ renderExport: (value: any, r: Record) => string;
26
26
  editRender: () => null;
27
27
  filterConfig: (item: ColumnConfig) => {
28
28
  searchDefaultConditions: "in";
@@ -29,51 +29,42 @@ var InterceptApiStatus = /*#__PURE__*/_createClass(function InterceptApiStatus(o
29
29
  _defineProperty(this, "dataType", void 0);
30
30
  _defineProperty(this, "options", void 0);
31
31
  _defineProperty(this, "getComponentValue", function (r) {
32
- var _record$interceptLogi;
33
- var record = r[_this.parentId];
34
- return record === null || record === void 0 ? void 0 : (_record$interceptLogi = record.interceptLogisticsApiStatus) === null || _record$interceptLogi === void 0 ? void 0 : _record$interceptLogi.status;
32
+ var record = r[_this.id];
33
+ return record === null || record === void 0 ? void 0 : record.status;
35
34
  });
36
35
  _defineProperty(this, "renderClient", function (r) {
37
- var _record$interceptLogi2, _record$interceptLogi3, _record$interceptLogi4, _record$interceptLogi5, _record$interceptLogi6;
36
+ var _record$interceptLogi, _record$interceptLogi2, _record$interceptLogi3, _record$interceptLogi4, _record$interceptLogi5;
38
37
  var record = r[_this.parentId];
39
- var status = record === null || record === void 0 ? void 0 : (_record$interceptLogi2 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi2 === void 0 ? void 0 : _record$interceptLogi2.status;
38
+ var status = record === null || record === void 0 ? void 0 : (_record$interceptLogi = record.interceptLogisticsApiStatus) === null || _record$interceptLogi === void 0 ? void 0 : _record$interceptLogi.status;
40
39
  var statusColor = status === "成功" ? "#52c41a" : "#ff4d4f";
41
- return !isNull(record === null || record === void 0 ? void 0 : (_record$interceptLogi3 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi3 === void 0 ? void 0 : _record$interceptLogi3.status) ? /*#__PURE__*/React.createElement(ItemView, {
40
+ return !isNull(record === null || record === void 0 ? void 0 : (_record$interceptLogi2 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi2 === void 0 ? void 0 : _record$interceptLogi2.status) ? /*#__PURE__*/React.createElement(ItemView, {
42
41
  id: _this.id,
43
42
  label: _this.name,
44
43
  value: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
45
44
  style: {
46
45
  color: statusColor
47
46
  }
48
- }, record === null || record === void 0 ? void 0 : (_record$interceptLogi4 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi4 === void 0 ? void 0 : _record$interceptLogi4.status, record !== null && record !== void 0 && (_record$interceptLogi5 = record.interceptLogisticsApiStatus) !== null && _record$interceptLogi5 !== void 0 && _record$interceptLogi5.reason ? /*#__PURE__*/React.createElement("span", {
49
- className: "c-red"
50
- }, ",", (record === null || record === void 0 ? void 0 : (_record$interceptLogi6 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi6 === void 0 ? void 0 : _record$interceptLogi6.reason) || "") : null))
47
+ }, record === null || record === void 0 ? void 0 : (_record$interceptLogi3 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi3 === void 0 ? void 0 : _record$interceptLogi3.status, record !== null && record !== void 0 && (_record$interceptLogi4 = record.interceptLogisticsApiStatus) !== null && _record$interceptLogi4 !== void 0 && _record$interceptLogi4.reason ? /*#__PURE__*/React.createElement("span", null, "\uFF0C", (record === null || record === void 0 ? void 0 : (_record$interceptLogi5 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi5 === void 0 ? void 0 : _record$interceptLogi5.reason) || "") : null))
51
48
  }) : null;
52
49
  });
53
50
  _defineProperty(this, "renderPc", function (value, r) {
54
- var _record$interceptLogi7, _record$interceptLogi8, _record$interceptLogi9, _record$interceptLogi10;
55
- var record = r[_this.parentId];
56
- var status = record === null || record === void 0 ? void 0 : (_record$interceptLogi7 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi7 === void 0 ? void 0 : _record$interceptLogi7.status;
51
+ var record = r[_this.id];
52
+ var status = record === null || record === void 0 ? void 0 : record.status;
57
53
  var statusColor = status === "成功" ? "#52c41a" : "#ff4d4f";
58
54
  return !isNull(status) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
59
55
  style: {
60
56
  color: statusColor
61
57
  }
62
- }, record === null || record === void 0 ? void 0 : (_record$interceptLogi8 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi8 === void 0 ? void 0 : _record$interceptLogi8.status, record !== null && record !== void 0 && (_record$interceptLogi9 = record.interceptLogisticsApiStatus) !== null && _record$interceptLogi9 !== void 0 && _record$interceptLogi9.reason ? /*#__PURE__*/React.createElement("span", {
63
- className: "c-red"
64
- }, ",", (record === null || record === void 0 ? void 0 : (_record$interceptLogi10 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi10 === void 0 ? void 0 : _record$interceptLogi10.reason) || "") : null)) : "--";
58
+ }, record === null || record === void 0 ? void 0 : record.status, record !== null && record !== void 0 && record.reason ? /*#__PURE__*/React.createElement("span", null, "\uFF0C", (record === null || record === void 0 ? void 0 : record.reason) || "") : null)) : "--";
65
59
  });
66
60
  _defineProperty(this, "renderLog", function (r) {
67
- var _record$interceptLogi11;
68
- var record = r[_this.parentId];
69
- if (isNull(record === null || record === void 0 ? void 0 : (_record$interceptLogi11 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi11 === void 0 ? void 0 : _record$interceptLogi11.status)) return null;
61
+ var record = r[_this.id];
62
+ if (isNull(record === null || record === void 0 ? void 0 : record.status)) return null;
70
63
  return _this.renderPc(undefined, r);
71
64
  });
72
65
  _defineProperty(this, "renderExport", function (value, r) {
73
- var _record$interceptLogi12, _record$interceptLogi13;
74
- var record = r[_this.parentId];
75
- console.log("renderExport", record);
76
- return (_record$interceptLogi12 = record === null || record === void 0 ? void 0 : (_record$interceptLogi13 = record.interceptLogisticsApiStatus) === null || _record$interceptLogi13 === void 0 ? void 0 : _record$interceptLogi13.status) !== null && _record$interceptLogi12 !== void 0 ? _record$interceptLogi12 : "--";
66
+ var record = r[_this.id];
67
+ return record !== null && record !== void 0 && record.status ? "".concat(record === null || record === void 0 ? void 0 : record.status).concat(record.reason ? "\uFF0C".concat(record.reason) : "") : "--";
77
68
  });
78
69
  _defineProperty(this, "editRender", function () {
79
70
  return null;
@@ -28,20 +28,24 @@ var InterceptApiStatus = /*#__PURE__*/_createClass(function InterceptApiStatus(o
28
28
  _defineProperty(this, "dataType", void 0);
29
29
  _defineProperty(this, "options", void 0);
30
30
  _defineProperty(this, "getComponentValue", function (r) {
31
- return ((r === null || r === void 0 ? void 0 : r[_this.id]) || []).map(function (item) {
32
- return item === null || item === void 0 ? void 0 : item.status;
33
- }).join(",");
31
+ var _ref;
32
+ return (_ref = (r === null || r === void 0 ? void 0 : r[_this.id]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
33
+ return "".concat(item === null || item === void 0 ? void 0 : item.status).concat(item !== null && item !== void 0 && item.reason ? ",".concat(item === null || item === void 0 ? void 0 : item.reason) : "");
34
+ }).join(";");
34
35
  });
35
36
  _defineProperty(this, "renderStatus", function (record) {
36
37
  var w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
37
- var statusList = record["".concat(_this.parentId, "_logisticsInterceptApiStatusList")] || [];
38
+ var statusList = (record === null || record === void 0 ? void 0 : record[_this.id]) || [];
38
39
  if (isNull(statusList)) return "--";
39
40
  return /*#__PURE__*/React.createElement("div", null, statusList.map(function (item, index) {
40
41
  var status = item === null || item === void 0 ? void 0 : item.status;
41
42
  var reason = item === null || item === void 0 ? void 0 : item.reason;
42
- return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), status ? /*#__PURE__*/React.createElement(React.Fragment, null, status, " ", reason ? /*#__PURE__*/React.createElement("span", {
43
- className: "c-red"
44
- }, "\u5931\u8D25\u539F\u56E0:", reason) : null) : "--");
43
+ var statusColor = reason ? "#ff4d4f" : "#52c41a";
44
+ return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), /*#__PURE__*/React.createElement("span", {
45
+ style: {
46
+ color: statusColor
47
+ }
48
+ }, status ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, status), reason ? /*#__PURE__*/React.createElement("span", null, "\uFF0C", reason) : null) : "--"));
45
49
  }));
46
50
  });
47
51
  _defineProperty(this, "renderClient", function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.17.5-beta.8",
3
+ "version": "1.17.6-rc.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "1.17.5-beta.8",
25
- "@kmkf-fe-packages/kmkf-utils": "1.17.5-beta.8",
24
+ "@kmkf-fe-packages/basic-components": "1.17.6-rc.0",
25
+ "@kmkf-fe-packages/kmkf-utils": "1.17.6-rc.0",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "6bea58785e9f071f4b7ef646744bbd1cf7387fc0",
44
+ "gitHead": "ee5c4c76948c6c95e1a5ddd6704a7bd6753e956e",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }