@kmkf-fe-packages/kmkf-utils 2.10.9-beta.12 → 2.10.9-beta.14

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.
package/README.md CHANGED
@@ -1 +1 @@
1
- 1123111111
1
+ 112311111111
@@ -9,6 +9,9 @@ interface OptionsItem {
9
9
  mobile: string;
10
10
  userKCode?: string;
11
11
  userSecretKey?: string;
12
+ customerCode?: string;
13
+ customerCodeType?: "K" | "EBU";
14
+ remark?: string;
12
15
  }
13
16
  export default class logisticsAddressData {
14
17
  private static instance;
@@ -14,8 +14,8 @@ export declare const DXD_SYSTEM_ORDER_CONFIG: {
14
14
  dataIndex: string;
15
15
  title: string;
16
16
  width: number;
17
- render: (val: boolean) => "" | "";
18
- renderExport: (val: boolean) => "" | "";
17
+ render: (val: boolean) => "" | "";
18
+ renderExport: (val: boolean) => "" | "";
19
19
  conditionOptionsSetting: {
20
20
  dataType: string;
21
21
  getOptions: () => {
@@ -27,8 +27,8 @@ export declare const DXD_SYSTEM_ORDER_CONFIG: {
27
27
  dataIndex: string;
28
28
  title: string;
29
29
  width: number;
30
- render: (val: boolean) => "" | "";
31
- renderExport: (val: boolean) => "" | "";
30
+ render: (val: boolean) => "" | "";
31
+ renderExport: (val: boolean) => "" | "";
32
32
  conditionOptionsSetting?: undefined;
33
33
  })[];
34
34
  };
@@ -31,3 +31,4 @@ export * as tree from "./multidimensionalFindChild";
31
31
  export { default as unTransField } from "./unTransField";
32
32
  export { fetchAll } from "./FetchAll";
33
33
  export { default as getSystemShowHead } from "./getSystemShowHead";
34
+ export * from "./logisticsInterceptionCustomerCode";
@@ -34,4 +34,5 @@ import * as _tree from "./multidimensionalFindChild";
34
34
  export { _tree as tree };
35
35
  export { default as unTransField } from "./unTransField";
36
36
  export { fetchAll } from "./FetchAll";
37
- export { default as getSystemShowHead } from "./getSystemShowHead";
37
+ export { default as getSystemShowHead } from "./getSystemShowHead";
38
+ export * from "./logisticsInterceptionCustomerCode";
@@ -12,8 +12,8 @@ export declare const JKY_SYSTEM_ORDER_CONFIG: {
12
12
  dataIndex: string;
13
13
  title: string;
14
14
  width: number;
15
- render: (val: number) => "" | "";
16
- renderExport: (val: number) => "" | "";
15
+ render: (val: number) => "" | "";
16
+ renderExport: (val: number) => "" | "";
17
17
  })[];
18
18
  };
19
19
  export declare const JKY_ORDER_FROM_MAP: {
@@ -0,0 +1,15 @@
1
+ export declare type LogisticsCustomerCodeType = "K" | "EBU";
2
+ export interface LogisticsCustomerCodeRecord {
3
+ cpCode?: string;
4
+ customerCode?: string;
5
+ customerCodeType?: LogisticsCustomerCodeType | string;
6
+ remark?: string;
7
+ }
8
+ export interface LogisticsCustomerCodeOption extends LogisticsCustomerCodeRecord {
9
+ label: string;
10
+ value: string;
11
+ }
12
+ export declare const JD_LOGISTICS_COMPANY_CODES: readonly ["JD", "JDKY"];
13
+ export declare const isJdLogisticsCompany: (company?: string) => boolean;
14
+ export declare const getJdCustomerCodeType: (company?: string) => LogisticsCustomerCodeType | undefined;
15
+ export declare const getJdCustomerCodeOptions: (records?: LogisticsCustomerCodeRecord[], company?: string) => LogisticsCustomerCodeOption[];
@@ -0,0 +1,29 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ export var JD_LOGISTICS_COMPANY_CODES = ["JD", "JDKY"];
8
+ export var isJdLogisticsCompany = function isJdLogisticsCompany(company) {
9
+ return JD_LOGISTICS_COMPANY_CODES.includes(company);
10
+ };
11
+ export var getJdCustomerCodeType = function getJdCustomerCodeType(company) {
12
+ if (company === "JD") return "K";
13
+ if (company === "JDKY") return "EBU";
14
+ return undefined;
15
+ };
16
+ export var getJdCustomerCodeOptions = function getJdCustomerCodeOptions() {
17
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
18
+ var company = arguments.length > 1 ? arguments[1] : undefined;
19
+ var customerCodeType = getJdCustomerCodeType(company);
20
+ if (!customerCodeType) return [];
21
+ return records.filter(function (item) {
22
+ return item.cpCode === "JD" && item.customerCodeType === customerCodeType && !!item.customerCode;
23
+ }).map(function (item) {
24
+ return _objectSpread(_objectSpread({}, item), {}, {
25
+ label: item.remark ? "".concat(item.customerCode, "\uFF08").concat(item.remark, "\uFF09") : "".concat(item.customerCode),
26
+ value: item.customerCode
27
+ });
28
+ });
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.10.9-beta.12",
3
+ "version": "2.10.9-beta.14",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "5a0d12c8caf0912d82e12ed94e64afd3ff746c65",
44
+ "gitHead": "5d3cdbfbc69828ca860a175154f18f17c1165cf1",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }