@kmkf-fe-packages/services-components 0.27.1-test.7 → 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 = [];
@@ -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;
@@ -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;
@@ -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: {
@@ -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.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.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": "79152b18e9f8e50a947afa54628538a09b70b900",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }