@kmkf-fe-packages/services-components 0.27.1-test.7 → 0.27.1-test.9

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 = [];
@@ -204,7 +204,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
204
204
  return Promise.resolve();
205
205
  }
206
206
  }] : [];
207
- this.expressDateInstance = ExpressData.getInstance();
207
+ this.expressDateInstance = ExpressData.getInstance(this.type === 'WDT_LOGISTICS' ? 'wdt' : 'default');
208
208
  this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "", _options);
209
209
  });
210
210
  export default BsLogistics;
@@ -61,7 +61,8 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
61
61
  }
62
62
  return /*#__PURE__*/React.createElement(BsExpressRender, {
63
63
  list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)],
64
- showField: "company"
64
+ showField: "company",
65
+ componentType: _this.type
65
66
  });
66
67
  });
67
68
  _defineProperty(this, "renderLog", function (r) {
@@ -108,7 +109,7 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
108
109
  this.componentConfig = options.componentConfig;
109
110
  this.rules = [];
110
111
  this.align = "left";
111
- this.expressDateInstance = ExpressData.getInstance();
112
+ this.expressDateInstance = ExpressData.getInstance(options.type === 'WDT_LOGISTICS' ? 'wdt' : 'default');
112
113
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
113
114
  this.isCombinationComponent = false;
114
115
  this.canSort = false;
@@ -16,7 +16,7 @@ export declare const showImage: ({ item, type, index, showHeader, }: {
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
18
  export declare const JstGoodImage: ({ list, type, componentType }: any) => any;
19
- export declare const BsExpressRender: ({ list, showField }: any) => any;
19
+ export declare const BsExpressRender: ({ list, showField, componentType }: any) => any;
20
20
  export declare const CommonOrderContent: ({ list, valueKey, failValue, options, }: any) => any;
21
21
  export declare const BsGoodImage: ({ item, index }: {
22
22
  item: any;
@@ -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, useSendData, useLogisticsData } 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";
@@ -259,11 +259,9 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
259
259
  componentType = _ref6$componentType === void 0 ? '' : _ref6$componentType;
260
260
  var _useSendData = useSendData(componentType === 'WDT_SEND_GOOD' ? 'wdt' : ''),
261
261
  getSendNameByCode = _useSendData.getSendNameByCode;
262
- var _useLogisticsData = useLogisticsData(componentType === 'WDT_LOGISTICS' ? 'wdt' : ''),
263
- getNameByCode = _useLogisticsData.getNameByCode;
264
262
  return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
265
263
  var logisticsCompany = item.logisticsCompany;
266
- var company = componentType === 'WDT_LOGISTICS' ? getNameByCode(logisticsCompany) : ExpressData.getInstance().getExpressNameByCode(logisticsCompany);
264
+ var company = ExpressData.getInstance(componentType === 'WDT_LOGISTICS' ? 'wdt' : 'default').getExpressNameByCode(logisticsCompany);
267
265
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Popover, {
268
266
  content: content(item, index),
269
267
  overlayStyle: {
@@ -282,10 +280,12 @@ export var BsExpressRender = function BsExpressRender(_ref7) {
282
280
  var _ref7$list = _ref7.list,
283
281
  list = _ref7$list === void 0 ? [] : _ref7$list,
284
282
  _ref7$showField = _ref7.showField,
285
- showField = _ref7$showField === void 0 ? "" : _ref7$showField;
283
+ showField = _ref7$showField === void 0 ? "" : _ref7$showField,
284
+ _ref7$componentType = _ref7.componentType,
285
+ componentType = _ref7$componentType === void 0 ? "" : _ref7$componentType;
286
286
  return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
287
287
  var logisticsCompany = item.logisticsCompany;
288
- var company = ExpressData.getInstance().getExpressNameByCode(logisticsCompany);
288
+ var company = ExpressData.getInstance(componentType === 'WDT_LOGISTICS' ? 'wdt' : 'default').getExpressNameByCode(logisticsCompany);
289
289
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Popover, {
290
290
  content: content(item, index),
291
291
  overlayStyle: {
@@ -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.7",
3
+ "version": "0.27.1-test.9",
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.7",
24
- "@kmkf-fe-packages/kmkf-utils": "^0.27.1-test.7"
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": "8d75e5eeca6c2b783dd065d893e62731da836488",
40
+ "gitHead": "d384ca51fb9fe193ce70de7bab03257242dc4377",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }