@kmkf-fe-packages/services-components 2.2.35 → 2.2.37

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.
@@ -22,36 +22,37 @@ function useGetErpAddressData(reduxData, notJudgedErp) {
22
22
  }, [hasErpData, notJudgedErp]);
23
23
  var asyncQueryData = /*#__PURE__*/function () {
24
24
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp, isReload) {
25
- var hasBs, hasWdt, hasGy, promises;
25
+ var hasBs, hasWdt, hasGy, hasJst, promises;
26
26
  return _regeneratorRuntime().wrap(function _callee$(_context) {
27
27
  while (1) switch (_context.prev = _context.next) {
28
28
  case 0:
29
29
  if (!isReload) {
30
30
  setGlobalState("loading");
31
31
  }
32
- hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
32
+ hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy, hasJst = hasErpData.hasJst;
33
33
  promises = [];
34
34
  if (hasBs || notJudgedErp) promises.push(servers.queryBsAddressData);
35
35
  if (hasWdt || notJudgedErp) promises.push(servers.queryWdtAddressData);
36
36
  if (hasGy || notJudgedErp) promises.push(servers.queryGyAddressData);
37
- _context.prev = 6;
38
- _context.next = 9;
37
+ if (hasJst || notJudgedErp) promises.push(servers.queryJstAddressData);
38
+ _context.prev = 7;
39
+ _context.next = 10;
39
40
  return Promise.all(promises.map(function (promise) {
40
41
  return promise();
41
42
  }));
42
- case 9:
43
+ case 10:
43
44
  setGlobalState("success");
44
- _context.next = 15;
45
+ _context.next = 16;
45
46
  break;
46
- case 12:
47
- _context.prev = 12;
48
- _context.t0 = _context["catch"](6);
47
+ case 13:
48
+ _context.prev = 13;
49
+ _context.t0 = _context["catch"](7);
49
50
  setGlobalState("failed");
50
- case 15:
51
+ case 16:
51
52
  case "end":
52
53
  return _context.stop();
53
54
  }
54
- }, _callee, null, [[6, 12]]);
55
+ }, _callee, null, [[7, 13]]);
55
56
  }));
56
57
  return function asyncQueryData(_x2, _x3, _x4) {
57
58
  return _ref.apply(this, arguments);
@@ -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,3 +1,3 @@
1
1
  import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption, OrderSubForm, FlowOverallStatusSelect } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsE3Reissue | BasicFile | BasicPicture | BasicPicturePro | PublicGoods | PublicReissueGoods | BasicSelect | WdtReissue | BasicInput | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelectOption | BasicRadio | BasicTextArea | BasicMultSelect | BasicGrade | BasicRate | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicExchange | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn | AsyncSelect | SkxIdInputSelect | SkxGoods | OrderSubForm | FlowOverallStatusSelect;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | CommonInput | BasicInput | JstSendGood | MsgStatus | StatusSelect | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicSelectOption | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn | AsyncSelect | SkxIdInputSelect | SkxGoods | OrderSubForm | FlowOverallStatusSelect;
@@ -2,6 +2,7 @@ export declare const replaceCheck: (data: any) => Promise<any>;
2
2
  export declare const queryAddressData: () => Promise<void>;
3
3
  export declare const queryBsAddressData: () => Promise<void>;
4
4
  export declare const queryWdtAddressData: () => Promise<void>;
5
+ export declare const queryJstAddressData: () => Promise<void>;
5
6
  export declare const queryPlatData: () => Promise<void>;
6
7
  export declare const queryExpressInterceptData: () => Promise<void>;
7
8
  export declare const queryLogisticsAddressData: () => Promise<void>;
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
11
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
12
  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; }
13
- import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, LabelData, servers } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, LabelData, servers, JstAddressData } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import get from "lodash/get";
15
15
  import request from "./request";
16
16
  // 重复校验
@@ -80,6 +80,26 @@ export var queryWdtAddressData = function queryWdtAddressData() {
80
80
  instance.addressOptions = toTree(list, 1);
81
81
  });
82
82
  };
83
+ export var queryJstAddressData = function queryJstAddressData() {
84
+ return request({
85
+ url: "/qy/gdfw/template/queryJstAreas/noLogin",
86
+ method: "get",
87
+ data: {}
88
+ }).then(function (resp) {
89
+ var map = {};
90
+ var res = {};
91
+ var _resp$data3 = resp.data,
92
+ list = _resp$data3 === void 0 ? [] : _resp$data3;
93
+ for (var i = 0; i < list.length; i++) {
94
+ res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
95
+ map[list[i]["name"]] = list[i]["id"];
96
+ }
97
+ var instance = JstAddressData.getInstance();
98
+ instance.addrData = res;
99
+ instance.addrNameMap = map;
100
+ instance.addressOptions = toTree(list, 1);
101
+ });
102
+ };
83
103
  export var queryPlatData = function queryPlatData() {
84
104
  return request({
85
105
  url: "/qy/platform/listPlatform/noLogin",
@@ -240,6 +240,7 @@ export interface ComponentInterface {
240
240
  repeatRange: string;
241
241
  repeatComponents: any[];
242
242
  };
243
+ sortColumns?: string;
243
244
  };
244
245
  effects?: {
245
246
  queryWorkOrderDetail?: (r: Record) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.2.35",
3
+ "version": "2.2.37",
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": "2.2.35",
25
- "@kmkf-fe-packages/kmkf-utils": "2.2.35",
24
+ "@kmkf-fe-packages/basic-components": "2.2.37",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.2.36",
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": "18010e2d8395d8b3082e9e7e0a2afedddbc753c2",
44
+ "gitHead": "5684ca99a2a01a6a5fdf180d864f27c9b47d32b6",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }