@kmkf-fe-packages/services-components 0.27.1-test.4 → 0.27.1-test.8

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,5 +1,5 @@
1
1
  import React from "react";
2
- declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany";
2
+ declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryWdtLogisticsCompany";
3
3
  declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
4
4
  requestList?: RequestType[] | undefined;
5
5
  repeatRequestList?: Record<string, () => Promise<any>> | undefined;
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import React, { useEffect, useState } from "react";
17
17
  import { Skeleton, Result, Button } from "antd";
18
- import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryAllLogisticsCompany } from "../../service/api";
18
+ import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryAllLogisticsCompany, queryWdtLogisticsCompany } from "../../service/api";
19
19
  import { servers } from '@kmkf-fe-packages/kmkf-utils';
20
20
  var Global = function Global(_ref) {
21
21
  var children = _ref.children,
@@ -40,7 +40,8 @@ var Global = function Global(_ref) {
40
40
  queryLogisticsAddressData: queryLogisticsAddressData,
41
41
  queryPlatData: queryPlatData,
42
42
  queryWdtAddressData: servers.queryWdtAddressData,
43
- queryAllLogisticsCompany: queryAllLogisticsCompany
43
+ queryAllLogisticsCompany: queryAllLogisticsCompany,
44
+ queryWdtLogisticsCompany: queryWdtLogisticsCompany
44
45
  };
45
46
  mergeMapping = _objectSpread(_objectSpread({}, mapping), repeatRequestList);
46
47
  promises = [];
@@ -73,7 +73,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
73
73
  label: _this.name,
74
74
  value: /*#__PURE__*/React.createElement(JstGoodImage, {
75
75
  list: record === null || record === void 0 ? void 0 : record[_this.id],
76
- type: 1
76
+ type: 1,
77
+ componentType: _this.type
77
78
  })
78
79
  }) : null;
79
80
  });
@@ -120,7 +121,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
120
121
  }
121
122
  }, /*#__PURE__*/React.createElement(JstGoodImage, {
122
123
  list: list,
123
- type: 1
124
+ type: 1,
125
+ componentType: _this.type
124
126
  }));
125
127
  });
126
128
  _defineProperty(this, "renderLog", function (r) {
@@ -147,6 +149,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
147
149
  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,
148
150
  component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
149
151
  type: 1,
152
+ componentType: _this.type,
150
153
  options: _this.expressDateInstance.getExpressData(),
151
154
  onChange: p === null || p === void 0 ? void 0 : p.onChange
152
155
  }))
@@ -201,7 +204,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
201
204
  return Promise.resolve();
202
205
  }
203
206
  }] : [];
204
- this.expressDateInstance = ExpressData.getInstance();
207
+ this.expressDateInstance = ExpressData.getInstance(this.type === 'WDT_LOGISTICS' ? 'wdt' : 'default');
205
208
  this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "", _options);
206
209
  });
207
210
  export default BsLogistics;
@@ -108,7 +108,7 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
108
108
  this.componentConfig = options.componentConfig;
109
109
  this.rules = [];
110
110
  this.align = "left";
111
- this.expressDateInstance = ExpressData.getInstance();
111
+ this.expressDateInstance = ExpressData.getInstance(options.type === 'WDT_LOGISTICS' ? 'wdt' : 'default');
112
112
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
113
113
  this.isCombinationComponent = false;
114
114
  this.canSort = false;
@@ -15,7 +15,7 @@ export declare const showImage: ({ item, type, index, showHeader, }: {
15
15
  }) => React.JSX.Element;
16
16
  export declare const ShowTotalImage: ({ total, allImage, type, showHeader, }: any) => React.JSX.Element;
17
17
  export declare const GoodImage: ({ list, type, showHeader }: any) => React.JSX.Element | null;
18
- export declare const JstGoodImage: ({ list, type }: any) => any;
18
+ export declare const JstGoodImage: ({ list, type, componentType }: any) => any;
19
19
  export declare const BsExpressRender: ({ list, showField }: any) => any;
20
20
  export declare const CommonOrderContent: ({ list, valueKey, failValue, options, }: any) => any;
21
21
  export declare const BsGoodImage: ({ item, index }: {
@@ -14,7 +14,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message, Typography } from "antd";
16
16
  import React, { useState, useMemo } from "react";
17
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { ExpressData, useSendData } from "@kmkf-fe-packages/kmkf-utils";
18
18
  import { getAlipayBillReceipt } from "../../service/api";
19
19
  import { CopyToClipboard } from "react-copy-to-clipboard";
20
20
  import styles from "./index.module.less";
@@ -254,10 +254,14 @@ var content = function content(item, index) {
254
254
  export var JstGoodImage = function JstGoodImage(_ref6) {
255
255
  var _ref6$list = _ref6.list,
256
256
  list = _ref6$list === void 0 ? [] : _ref6$list,
257
- type = _ref6.type;
257
+ type = _ref6.type,
258
+ _ref6$componentType = _ref6.componentType,
259
+ componentType = _ref6$componentType === void 0 ? '' : _ref6$componentType;
260
+ var _useSendData = useSendData(componentType === 'WDT_SEND_GOOD' ? 'wdt' : ''),
261
+ getSendNameByCode = _useSendData.getSendNameByCode;
258
262
  return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
259
263
  var logisticsCompany = item.logisticsCompany;
260
- var company = ExpressData.getInstance().getExpressNameByCode(logisticsCompany);
264
+ var company = ExpressData.getInstance(componentType === 'WDT_LOGISTICS' ? 'wdt' : 'default').getExpressNameByCode(logisticsCompany);
261
265
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Popover, {
262
266
  content: content(item, index),
263
267
  overlayStyle: {
@@ -269,7 +273,7 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
269
273
  color: "#1890ff",
270
274
  cursor: "pointer"
271
275
  }
272
- }, "\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, type === 4 ? /*#__PURE__*/React.createElement("span", null, (item === null || item === void 0 ? void 0 : item.deliveryNo) || "") : null));
276
+ }, "\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, componentType === 'WDT_SEND_GOOD' ? getSendNameByCode(item.sendName) : item.sendName].join("/") : item.sendId ? item.sendId : componentType === 'WDT_SEND_GOOD' ? getSendNameByCode(item.sendName) : item.sendName) : null, type === 4 ? /*#__PURE__*/React.createElement("span", null, (item === null || item === void 0 ? void 0 : item.deliveryNo) || "") : null));
273
277
  }) : null;
274
278
  };
275
279
  export var BsExpressRender = function BsExpressRender(_ref7) {
@@ -100,7 +100,8 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
100
100
  label: _this.name,
101
101
  value: /*#__PURE__*/React.createElement(JstGoodImage, {
102
102
  list: record === null || record === void 0 ? void 0 : record[_this.id],
103
- type: 3
103
+ type: 3,
104
+ componentType: _this.type
104
105
  })
105
106
  }) : null;
106
107
  });
@@ -114,7 +115,8 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
114
115
  }
115
116
  }, /*#__PURE__*/React.createElement(JstGoodImage, {
116
117
  list: list,
117
- type: 3
118
+ type: 3,
119
+ componentType: _this.type
118
120
  }));
119
121
  });
120
122
  _defineProperty(this, "renderLog", function (r) {
@@ -1,3 +1,3 @@
1
1
  import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, 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, CommonInput, PaymentVoucherCode, WdtReissue } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsReissue | BuyerNick | CommonInput | JstSendGood | LogisticsMoreTrajectory | LogisticsTrajectory | PaymentVoucherCode | BasicSelect | WdtReissue | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | BsReissue | BuyerNick | CommonInput | JstSendGood | PaymentVoucherCode | BasicSelect | WdtReissue | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReturn | 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;
@@ -6,4 +6,5 @@ export declare const queryPlatData: () => Promise<void>;
6
6
  export declare const queryExpressInterceptData: () => Promise<void>;
7
7
  export declare const queryLogisticsAddressData: () => Promise<void>;
8
8
  export declare const queryAllLogisticsCompany: () => Promise<void>;
9
+ export declare const queryWdtLogisticsCompany: () => Promise<void>;
9
10
  export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
@@ -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 } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, servers } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import get from "lodash/get";
15
15
  import request from "./request";
16
16
  // 重复校验
@@ -248,6 +248,12 @@ export var queryAllLogisticsCompany = function queryAllLogisticsCompany() {
248
248
  instance.expressData = expressList;
249
249
  });
250
250
  };
251
+ export var queryWdtLogisticsCompany = function queryWdtLogisticsCompany() {
252
+ var instance = ExpressData.getInstance('wdt');
253
+ return servers.getWdtSellerLogisticsCompanyRelation().then(function (data) {
254
+ instance.expressData = data;
255
+ }).catch(console.log);
256
+ };
251
257
  // 获取支付宝电子回单
252
258
  export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
253
259
  return request({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.27.1-test.4",
3
+ "version": "0.27.1-test.8",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/basic-components": "^0.27.1-test.4",
24
- "@kmkf-fe-packages/kmkf-utils": "^0.27.1-test.4"
23
+ "@kmkf-fe-packages/basic-components": "^0.27.1-test.8",
24
+ "@kmkf-fe-packages/kmkf-utils": "^0.27.1-test.8"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^5.59.2",
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "156d314130701c3e3fd39a375bea1456b569591e",
40
+ "gitHead": "79152b18e9f8e50a947afa54628538a09b70b900",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }