@kmkf-fe-packages/kmkf-utils 1.20.1 → 1.20.2-beta.3
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 +1 -1
- package/dist/esm/global.d.ts +2 -0
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +2 -4
- package/dist/esm/servers/BSE3/index.d.ts +2 -0
- package/dist/esm/servers/BSE3/index.js +2 -0
- package/dist/esm/servers/BSE3/logisticsData.d.ts +7 -0
- package/dist/esm/servers/BSE3/logisticsData.js +32 -0
- package/dist/esm/{wdt/warehouseData/index.d.ts → servers/BSE3/warehouseData.d.ts} +2 -1
- package/dist/esm/servers/BSE3/warehouseData.js +32 -0
- package/dist/esm/servers/WDT/index.d.ts +1 -0
- package/dist/esm/servers/WDT/index.js +1 -0
- package/dist/esm/servers/WDT/warehouseData.d.ts +7 -0
- package/dist/esm/servers/WDT/warehouseData.js +32 -0
- package/dist/esm/servers/index.d.ts +3 -1
- package/dist/esm/servers/index.js +5 -1
- package/dist/esm/utils/FetchAll.d.ts +9 -0
- package/dist/esm/utils/FetchAll.js +42 -0
- package/dist/esm/utils/SendData.d.ts +22 -0
- package/dist/esm/utils/SendData.js +83 -0
- package/dist/esm/utils/bsE3OrderBackFormValues.js +51 -33
- package/dist/esm/utils/getExpression.js +6 -6
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/orderBackFormValues.js +3 -0
- package/dist/esm/utils/transMultSelectOptions.d.ts +1 -1
- package/dist/esm/utils/transMultSelectOptions.js +18 -5
- package/package.json +2 -2
- package/dist/esm/wdt/index.d.ts +0 -2
- package/dist/esm/wdt/index.js +0 -2
- package/dist/esm/wdt/warehouseData/index.js +0 -41
- package/dist/esm/wdtSendData/index.d.ts +0 -14
- package/dist/esm/wdtSendData/index.js +0 -46
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11122344
|
|
1
|
+
11122344
|
package/dist/esm/global.d.ts
CHANGED
|
@@ -69,6 +69,8 @@ declare enum TComponentType {
|
|
|
69
69
|
BS_TRADE_PAYMENT_TIME = "BS_TRADE_PAYMENT_TIME",
|
|
70
70
|
BS_NET_RECEIPTS = "BS_NET_RECEIPTS",
|
|
71
71
|
BS_PACKAGE_WEIGHT = "BS_PACKAGE_WEIGHT",
|
|
72
|
+
BS_E3_LOGISTICS = "BS_E3_LOGISTICS",
|
|
73
|
+
BS_E3_SEND_GOOD = "BS_E3_SEND_GOOD",
|
|
72
74
|
BUYER_MESSAGE_NOTICE = "BUYER_MESSAGE_NOTICE",
|
|
73
75
|
WLN_SYSTEM_ORDER = "WLN_SYSTEM_ORDER",
|
|
74
76
|
WLN_GOODS = "WLN_GOODS",
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ export { default as WdtAddressData } from "./wdtAddressData";
|
|
|
6
6
|
export { default as PlatData } from "./platData";
|
|
7
7
|
export { default as LogisticsAddressData } from "./logisticsAddressData";
|
|
8
8
|
export { default as LabelData } from "./labelData";
|
|
9
|
-
export { default as WdtSendData } from "./wdtSendData";
|
|
10
9
|
export { default as request } from "./request";
|
|
11
|
-
export * as WDT from "./wdt";
|
|
12
10
|
export * as servers from "./servers";
|
|
13
11
|
export * from "./utils";
|
|
12
|
+
export { SendDataCenter } from "./utils/SendData";
|
package/dist/esm/index.js
CHANGED
|
@@ -6,10 +6,8 @@ export { default as WdtAddressData } from "./wdtAddressData";
|
|
|
6
6
|
export { default as PlatData } from "./platData";
|
|
7
7
|
export { default as LogisticsAddressData } from "./logisticsAddressData";
|
|
8
8
|
export { default as LabelData } from "./labelData";
|
|
9
|
-
export { default as WdtSendData } from "./wdtSendData";
|
|
10
9
|
export { default as request } from "./request";
|
|
11
|
-
import * as _WDT from "./wdt";
|
|
12
|
-
export { _WDT as WDT };
|
|
13
10
|
import * as _servers from "./servers";
|
|
14
11
|
export { _servers as servers };
|
|
15
|
-
export * from "./utils";
|
|
12
|
+
export * from "./utils";
|
|
13
|
+
export { SendDataCenter } from "./utils/SendData";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fetchAll } from "../../utils";
|
|
2
|
+
import request from "../../request";
|
|
3
|
+
var queryBsE3LogisticsList = function queryBsE3LogisticsList(_ref) {
|
|
4
|
+
var pageNo = _ref.pageNo,
|
|
5
|
+
pageSize = _ref.pageSize;
|
|
6
|
+
return request({
|
|
7
|
+
url: "/qy/gdfw/bse3/erp/logistics/list",
|
|
8
|
+
method: "post",
|
|
9
|
+
data: {
|
|
10
|
+
pageNo: pageNo,
|
|
11
|
+
pageSize: pageSize
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export var getLogisticsDataAsync = function getLogisticsDataAsync() {
|
|
16
|
+
return fetchAll("BS_E3_LOGISTICS_DATA", queryBsE3LogisticsList, function (data) {
|
|
17
|
+
var list = [];
|
|
18
|
+
var logisticsList = (data === null || data === void 0 ? void 0 : data.logisticsList) || [];
|
|
19
|
+
logisticsList.map(function (item) {
|
|
20
|
+
list.push({
|
|
21
|
+
label: item.logisticsName,
|
|
22
|
+
value: item.logisticsNo,
|
|
23
|
+
disabled: false
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
return list;
|
|
27
|
+
}, {
|
|
28
|
+
pageNo: 1,
|
|
29
|
+
pageSize: 100
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default getLogisticsDataAsync;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare type WarehouseType = {
|
|
2
|
+
disabled: boolean;
|
|
2
3
|
label: string;
|
|
3
4
|
value: string;
|
|
4
5
|
};
|
|
5
|
-
declare const getWarehouseDataAsync: () => Promise<WarehouseType[]>;
|
|
6
|
+
export declare const getWarehouseDataAsync: () => Promise<WarehouseType[]>;
|
|
6
7
|
export default getWarehouseDataAsync;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fetchAll } from "../../utils";
|
|
2
|
+
import request from "../../request";
|
|
3
|
+
var queryBsE3WarehouseList = function queryBsE3WarehouseList(_ref) {
|
|
4
|
+
var pageNo = _ref.pageNo,
|
|
5
|
+
pageSize = _ref.pageSize;
|
|
6
|
+
return request({
|
|
7
|
+
url: "/qy/gdfw/bse3/erp/warehouse/list",
|
|
8
|
+
method: "post",
|
|
9
|
+
data: {
|
|
10
|
+
pageNo: pageNo,
|
|
11
|
+
pageSize: pageSize
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export var getWarehouseDataAsync = function getWarehouseDataAsync() {
|
|
16
|
+
return fetchAll("BS_E3_WAREHOUSE_DATA", queryBsE3WarehouseList, function (data) {
|
|
17
|
+
var list = [];
|
|
18
|
+
var warehouses = (data === null || data === void 0 ? void 0 : data.warehouseList) || [];
|
|
19
|
+
warehouses.map(function (item) {
|
|
20
|
+
list.push({
|
|
21
|
+
label: item.warehouseName,
|
|
22
|
+
value: item.warehouseNo,
|
|
23
|
+
disabled: !!(item.isDisabled || item.isDelete)
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
return list;
|
|
27
|
+
}, {
|
|
28
|
+
pageNo: 1,
|
|
29
|
+
pageSize: 100
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default getWarehouseDataAsync;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './warehouseData';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./warehouseData";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { fetchAll } from "../../utils";
|
|
2
|
+
import request from "../../request";
|
|
3
|
+
var queryBsE3WarehouseList = function queryBsE3WarehouseList(_ref) {
|
|
4
|
+
var pageNo = _ref.pageNo,
|
|
5
|
+
pageSize = _ref.pageSize;
|
|
6
|
+
return request({
|
|
7
|
+
url: "/qy/gdfw/wdt/erp/warehouse/list",
|
|
8
|
+
method: "post",
|
|
9
|
+
data: {
|
|
10
|
+
pageNo: pageNo,
|
|
11
|
+
pageSize: pageSize
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export var getWarehouseDataAsync = function getWarehouseDataAsync() {
|
|
16
|
+
return fetchAll("WDT_WAREHOUSE_DATA", queryBsE3WarehouseList, function (data) {
|
|
17
|
+
var list = [];
|
|
18
|
+
var warehouses = (data === null || data === void 0 ? void 0 : data.warehouses) || [];
|
|
19
|
+
warehouses.map(function (_ref2) {
|
|
20
|
+
var warehouseNo = _ref2.warehouseNo,
|
|
21
|
+
name = _ref2.name,
|
|
22
|
+
isDisabled = _ref2.isDisabled;
|
|
23
|
+
list.push({
|
|
24
|
+
label: name,
|
|
25
|
+
value: warehouseNo,
|
|
26
|
+
disabled: isDisabled
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return list;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default getWarehouseDataAsync;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import WdtAddressData from "../wdtAddressData";
|
|
2
2
|
import AddressData from "../addressData";
|
|
3
3
|
import BsAddressData from "../bsAddressData";
|
|
4
|
+
export * as BSE3 from './BSE3';
|
|
5
|
+
export * as WDT from './WDT';
|
|
4
6
|
export declare const queryWdtAddressData: (instance?: WdtAddressData) => Promise<void>;
|
|
5
7
|
export declare const queryAddressData: (instance?: AddressData) => Promise<void>;
|
|
6
8
|
export declare const queryBsAddressData: (instance?: BsAddressData) => Promise<void>;
|
|
@@ -15,5 +17,5 @@ export declare const queryWdtWarehouseList: (pageNo: number, pageSize: number) =
|
|
|
15
17
|
export declare const getWdtSellerLogisticsCompanyRelation: () => Promise<{
|
|
16
18
|
label: string;
|
|
17
19
|
value: string;
|
|
18
|
-
disabled:
|
|
20
|
+
disabled: boolean;
|
|
19
21
|
}[]>;
|
|
@@ -4,6 +4,10 @@ import AddressData from "../addressData";
|
|
|
4
4
|
import BsAddressData from "../bsAddressData";
|
|
5
5
|
import toTree from "../utils/toTree";
|
|
6
6
|
import request from "../request/index";
|
|
7
|
+
import * as _BSE from "./BSE3";
|
|
8
|
+
export { _BSE as BSE3 };
|
|
9
|
+
import * as _WDT from "./WDT";
|
|
10
|
+
export { _WDT as WDT };
|
|
7
11
|
var transformData = function transformData(list) {
|
|
8
12
|
var map = {};
|
|
9
13
|
var res = {};
|
|
@@ -86,7 +90,7 @@ export var getWdtSellerLogisticsCompanyRelation = function getWdtSellerLogistics
|
|
|
86
90
|
return {
|
|
87
91
|
label: item.logisticsName,
|
|
88
92
|
value: item.logisticsNo,
|
|
89
|
-
disabled: item.
|
|
93
|
+
disabled: item.isDisabled
|
|
90
94
|
};
|
|
91
95
|
}).filter(function (item) {
|
|
92
96
|
return item.value;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function fetchAll<T = any, D = any>(key: string, fetchAction: (params: {
|
|
2
|
+
pageNo: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
data?: D;
|
|
6
|
+
}>, getList: (data: D) => T[], { pageNo, pageSize }?: {
|
|
7
|
+
pageNo?: number | undefined;
|
|
8
|
+
pageSize?: number | undefined;
|
|
9
|
+
}): Promise<T[]>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
var singletonPromiseMap = new Map();
|
|
8
|
+
export function fetchAll(key, fetchAction, getList) {
|
|
9
|
+
var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
10
|
+
_ref$pageNo = _ref.pageNo,
|
|
11
|
+
pageNo = _ref$pageNo === void 0 ? 0 : _ref$pageNo,
|
|
12
|
+
_ref$pageSize = _ref.pageSize,
|
|
13
|
+
pageSize = _ref$pageSize === void 0 ? 100 : _ref$pageSize;
|
|
14
|
+
if (!singletonPromiseMap.has(key)) {
|
|
15
|
+
singletonPromiseMap.set(key, new Promise(function (resolve, reject) {
|
|
16
|
+
var list = [];
|
|
17
|
+
var pagePointer = pageNo;
|
|
18
|
+
function fetchList() {
|
|
19
|
+
fetchAction({
|
|
20
|
+
pageNo: pagePointer,
|
|
21
|
+
pageSize: pageSize
|
|
22
|
+
}).then(function (res) {
|
|
23
|
+
if (res.data) {
|
|
24
|
+
var newList = getList(res.data);
|
|
25
|
+
list.push.apply(list, _toConsumableArray(newList));
|
|
26
|
+
if (pageSize === newList.length) {
|
|
27
|
+
pagePointer++;
|
|
28
|
+
fetchList();
|
|
29
|
+
} else {
|
|
30
|
+
resolve(list);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}).catch(function (e) {
|
|
34
|
+
singletonPromiseMap.delete(key);
|
|
35
|
+
reject(e);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
fetchList();
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
return singletonPromiseMap.get(key);
|
|
42
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface OptionsItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
declare type SendGoodPlatform = string;
|
|
6
|
+
declare class SendData {
|
|
7
|
+
private platform;
|
|
8
|
+
private sendData;
|
|
9
|
+
private service?;
|
|
10
|
+
constructor(platform: SendGoodPlatform);
|
|
11
|
+
fetchData: () => Promise<void>;
|
|
12
|
+
getSendData: () => OptionsItem[];
|
|
13
|
+
setSendData: (val: OptionsItem[]) => OptionsItem[];
|
|
14
|
+
getSendNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
|
|
15
|
+
getSendCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
|
|
16
|
+
}
|
|
17
|
+
export declare class SendDataCenter {
|
|
18
|
+
static instanceMap: Map<SendGoodPlatform, SendData>;
|
|
19
|
+
static getInstance(platform: SendGoodPlatform): SendData;
|
|
20
|
+
static fetchData(): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
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); }
|
|
11
|
+
import { BSE3, WDT } from "../servers/index";
|
|
12
|
+
var SendData = /*#__PURE__*/_createClass(function SendData(platform) {
|
|
13
|
+
var _this = this;
|
|
14
|
+
_classCallCheck(this, SendData);
|
|
15
|
+
_defineProperty(this, "platform", void 0);
|
|
16
|
+
_defineProperty(this, "sendData", []);
|
|
17
|
+
_defineProperty(this, "service", void 0);
|
|
18
|
+
_defineProperty(this, "fetchData", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
19
|
+
var _this$service;
|
|
20
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
_context.next = 2;
|
|
24
|
+
return (_this$service = _this.service) === null || _this$service === void 0 ? void 0 : _this$service.getWarehouseDataAsync().then(function (list) {
|
|
25
|
+
_this.sendData = list;
|
|
26
|
+
});
|
|
27
|
+
case 2:
|
|
28
|
+
case "end":
|
|
29
|
+
return _context.stop();
|
|
30
|
+
}
|
|
31
|
+
}, _callee);
|
|
32
|
+
})));
|
|
33
|
+
_defineProperty(this, "getSendData", function () {
|
|
34
|
+
return _this.sendData;
|
|
35
|
+
});
|
|
36
|
+
_defineProperty(this, "setSendData", function (val) {
|
|
37
|
+
return _this.sendData = val;
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(this, "getSendNameByCode", function (code) {
|
|
40
|
+
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
41
|
+
var item = (_this.sendData || []).filter(function (item) {
|
|
42
|
+
return item.value === code;
|
|
43
|
+
});
|
|
44
|
+
return item.length ? item[0].label : returnCurrentValue ? code : "";
|
|
45
|
+
});
|
|
46
|
+
_defineProperty(this, "getSendCodeByName", function (name) {
|
|
47
|
+
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
48
|
+
var item = (_this.sendData || []).filter(function (item) {
|
|
49
|
+
return item.label === name;
|
|
50
|
+
});
|
|
51
|
+
return item.length ? item[0].value : returnCurrentValue ? name : "";
|
|
52
|
+
});
|
|
53
|
+
this.platform = platform;
|
|
54
|
+
this.service = {
|
|
55
|
+
bsE3: BSE3,
|
|
56
|
+
wdt: WDT
|
|
57
|
+
}[this.platform];
|
|
58
|
+
});
|
|
59
|
+
export var SendDataCenter = /*#__PURE__*/function () {
|
|
60
|
+
function SendDataCenter() {
|
|
61
|
+
_classCallCheck(this, SendDataCenter);
|
|
62
|
+
}
|
|
63
|
+
_createClass(SendDataCenter, null, [{
|
|
64
|
+
key: "getInstance",
|
|
65
|
+
value: function getInstance(platform) {
|
|
66
|
+
if (!platform) throw new Error("获取实例需要传入平台类型");
|
|
67
|
+
if (platform === "WDT_SEND_GOOD") platform = "wdt";
|
|
68
|
+
if (platform === "BS_E3_SEND_GOOD") platform = "bsE3";
|
|
69
|
+
if (!this.instanceMap.has(platform)) {
|
|
70
|
+
this.instanceMap.set(platform, new SendData(platform));
|
|
71
|
+
}
|
|
72
|
+
return this.instanceMap.get(platform);
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "fetchData",
|
|
76
|
+
value: function fetchData() {
|
|
77
|
+
this.getInstance("wdt").fetchData();
|
|
78
|
+
this.getInstance("bsE3").fetchData();
|
|
79
|
+
}
|
|
80
|
+
}]);
|
|
81
|
+
return SendDataCenter;
|
|
82
|
+
}();
|
|
83
|
+
_defineProperty(SendDataCenter, "instanceMap", new Map());
|
|
@@ -10,7 +10,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
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; }
|
|
11
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
12
|
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); }
|
|
13
|
-
import ExpressData from "../expressData";
|
|
14
13
|
import uuid from "./getUUid";
|
|
15
14
|
export var BS_E3_BOOLEAN_STATUS_MAP = {
|
|
16
15
|
0: "否",
|
|
@@ -45,8 +44,39 @@ export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
|
|
|
45
44
|
}
|
|
46
45
|
return list;
|
|
47
46
|
};
|
|
48
|
-
var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type) {
|
|
47
|
+
var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type, comList, form) {
|
|
49
48
|
var _newList;
|
|
49
|
+
if (type === "logistics") {
|
|
50
|
+
var _comList$find, _currentCom$component;
|
|
51
|
+
var currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find = comList.find) === null || _comList$find === void 0 ? void 0 : _comList$find.call(comList, function (item) {
|
|
52
|
+
return item.workOrderComponentType === 'BS_E3_LOGISTICS';
|
|
53
|
+
});
|
|
54
|
+
var notOrderBack = (currentCom === null || currentCom === void 0 ? void 0 : (_currentCom$component = currentCom.componentConfig) === null || _currentCom$component === void 0 ? void 0 : _currentCom$component.notOrderBack) || false;
|
|
55
|
+
if (notOrderBack) {
|
|
56
|
+
var _currentValue;
|
|
57
|
+
var currentValue = form.getFieldValue(currentCom.uniqueKey);
|
|
58
|
+
currentValue = (_currentValue = currentValue) !== null && _currentValue !== void 0 && _currentValue.length ? currentValue : [{
|
|
59
|
+
logisticsCode: "",
|
|
60
|
+
logisticsCompany: ""
|
|
61
|
+
}];
|
|
62
|
+
return currentValue;
|
|
63
|
+
}
|
|
64
|
+
} else if (type === "send") {
|
|
65
|
+
var _comList$find2, _currentCom$component2;
|
|
66
|
+
var _currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find2 = comList.find) === null || _comList$find2 === void 0 ? void 0 : _comList$find2.call(comList, function (item) {
|
|
67
|
+
return item.workOrderComponentType === 'BS_E3_SEND_GOOD';
|
|
68
|
+
});
|
|
69
|
+
var _notOrderBack = (_currentCom === null || _currentCom === void 0 ? void 0 : (_currentCom$component2 = _currentCom.componentConfig) === null || _currentCom$component2 === void 0 ? void 0 : _currentCom$component2.notOrderBack) || false;
|
|
70
|
+
if (_notOrderBack) {
|
|
71
|
+
var _currentValue3;
|
|
72
|
+
var _currentValue2 = form.getFieldValue(_currentCom.uniqueKey);
|
|
73
|
+
_currentValue2 = (_currentValue3 = _currentValue2) !== null && _currentValue3 !== void 0 && _currentValue3.length ? _currentValue2 : [{
|
|
74
|
+
sendId: "",
|
|
75
|
+
sendName: ""
|
|
76
|
+
}];
|
|
77
|
+
return _currentValue2;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
50
80
|
var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
|
|
51
81
|
var items = ((next === null || next === void 0 ? void 0 : next.orderDetailGets) || []).map(function (t) {
|
|
52
82
|
return {
|
|
@@ -56,20 +86,17 @@ var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type) {
|
|
|
56
86
|
skuId: (t === null || t === void 0 ? void 0 : t.goodsSn) || ""
|
|
57
87
|
};
|
|
58
88
|
});
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return params;
|
|
71
|
-
});
|
|
72
|
-
prv.push.apply(prv, _toConsumableArray(advList));
|
|
89
|
+
var params = {
|
|
90
|
+
items: items
|
|
91
|
+
};
|
|
92
|
+
if (type === "logistics") {
|
|
93
|
+
params.logisticsCompany = next === null || next === void 0 ? void 0 : next.shippingCode;
|
|
94
|
+
params.logisticsCode = next === null || next === void 0 ? void 0 : next.shippingSn;
|
|
95
|
+
} else if (type === "send") {
|
|
96
|
+
params.sendId = next === null || next === void 0 ? void 0 : next.fhck;
|
|
97
|
+
params.sendName = next === null || next === void 0 ? void 0 : next.fhck;
|
|
98
|
+
}
|
|
99
|
+
prv.push(params);
|
|
73
100
|
return prv;
|
|
74
101
|
}, []);
|
|
75
102
|
if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
|
|
@@ -182,21 +209,12 @@ export var bsE3OrderBackFormValues = function bsE3OrderBackFormValues() {
|
|
|
182
209
|
// case "BS_RETURN_GOODS":
|
|
183
210
|
// prv[uniqueKey] = detail?.bsReturnGoods;
|
|
184
211
|
// break;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
// break;
|
|
192
|
-
// case "BS_SEND_GOOD":
|
|
193
|
-
// prv[uniqueKey] = updateBsE3ItemListByConfigHandle(
|
|
194
|
-
// detail?.bsSendGood,
|
|
195
|
-
// "send",
|
|
196
|
-
// config
|
|
197
|
-
// );
|
|
198
|
-
|
|
199
|
-
// break;
|
|
212
|
+
case "BS_E3_LOGISTICS":
|
|
213
|
+
prv[uniqueKey] = updateBsE3ItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.bsE3Logistics, "logistics", config);
|
|
214
|
+
break;
|
|
215
|
+
case "BS_E3_SEND_GOOD":
|
|
216
|
+
prv[uniqueKey] = updateBsE3ItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.bsE3SendGood, "send", config);
|
|
217
|
+
break;
|
|
200
218
|
// case "BS_DELIVERY_NO":
|
|
201
219
|
// prv[uniqueKey] = detail?.bsDeliveryNo;
|
|
202
220
|
// break;
|
|
@@ -293,8 +311,8 @@ export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
|
|
|
293
311
|
return !isStrict || !orderNo || good.originalDealCode === orderNo;
|
|
294
312
|
})
|
|
295
313
|
},
|
|
296
|
-
bsE3Logistics: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics"),
|
|
297
|
-
bsE3SendGood: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send")
|
|
314
|
+
bsE3Logistics: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
|
|
315
|
+
bsE3SendGood: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
|
|
298
316
|
};
|
|
299
317
|
};
|
|
300
318
|
// WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
|
|
@@ -52,15 +52,15 @@ var getExpression = function getExpression(condition, l, r) {
|
|
|
52
52
|
var _intersection3, _intersection4;
|
|
53
53
|
return Array.isArray(l) ? ((_intersection3 = intersection(r, l)) === null || _intersection3 === void 0 ? void 0 : _intersection3.length) > 0 : ((_intersection4 = intersection(r, [l])) === null || _intersection4 === void 0 ? void 0 : _intersection4.length) > 0;
|
|
54
54
|
}
|
|
55
|
+
if (condition === 'ARRAY_OBJECT_INCLUDE') {
|
|
56
|
+
var _intersection5;
|
|
57
|
+
return ((_intersection5 = intersection(extractPrimitiveValues(l), r)) === null || _intersection5 === void 0 ? void 0 : _intersection5.length) > 0;
|
|
58
|
+
}
|
|
55
59
|
if (condition === 'NINCLUDE') {
|
|
56
|
-
var
|
|
57
|
-
var _include = Array.isArray(l) ? ((
|
|
60
|
+
var _intersection6, _intersection7;
|
|
61
|
+
var _include = Array.isArray(l) ? ((_intersection6 = intersection(r, l)) === null || _intersection6 === void 0 ? void 0 : _intersection6.length) > 0 : ((_intersection7 = intersection(r, [l])) === null || _intersection7 === void 0 ? void 0 : _intersection7.length) > 0;
|
|
58
62
|
return !_include;
|
|
59
63
|
}
|
|
60
|
-
if (condition === 'ARRAY_OBJECT_INCLUDE') {
|
|
61
|
-
var _intersection7;
|
|
62
|
-
return ((_intersection7 = intersection(extractPrimitiveValues(l), r)) === null || _intersection7 === void 0 ? void 0 : _intersection7.length) > 0;
|
|
63
|
-
}
|
|
64
64
|
return false;
|
|
65
65
|
};
|
|
66
66
|
export default getExpression;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -18,4 +18,5 @@ import * as _templateFn from "./template";
|
|
|
18
18
|
export { _templateFn as templateFn };
|
|
19
19
|
import * as _tree from "./multidimensionalFindChild";
|
|
20
20
|
export { _tree as tree };
|
|
21
|
-
export { default as unTransField } from "./unTransField";
|
|
21
|
+
export { default as unTransField } from "./unTransField";
|
|
22
|
+
export { fetchAll } from "./FetchAll";
|
|
@@ -118,6 +118,9 @@ export default (function (_ref) {
|
|
|
118
118
|
case "ACTUAL_PAYMENT":
|
|
119
119
|
prv[uniqueKey] = detail["actualPayment"];
|
|
120
120
|
break;
|
|
121
|
+
case "ACTUAL_RECEIPT_PAYMENT":
|
|
122
|
+
prv[uniqueKey] = detail["actualReceiptPayment"];
|
|
123
|
+
break;
|
|
121
124
|
case "EXPRESS_LOGISTICS_SELECT":
|
|
122
125
|
prv[uniqueKey] = {
|
|
123
126
|
company: config.isSingle && config.showField === "EXPRESS_COMPANY" || !config.isSingle ? ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]) : "",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (sourceOptions: any[]) => any;
|
|
1
|
+
declare const _default: (sourceOptions: any[], isFilterHide?: boolean) => any;
|
|
2
2
|
export default _default;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import get from "lodash/get";
|
|
2
2
|
var findNodeById = function findNodeById(tree) {
|
|
3
3
|
var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
4
|
+
var isFilterHide = arguments.length > 2 ? arguments[2] : undefined;
|
|
4
5
|
for (var i = 0; i < tree.length; i++) {
|
|
5
6
|
if (tree[i].actived == actived) {
|
|
6
|
-
return tree[i];
|
|
7
|
+
return isFilterHide ? tree[i].hide ? null : tree[i] : tree[i];
|
|
7
8
|
}
|
|
8
9
|
if (tree[i].children) {
|
|
9
|
-
var
|
|
10
|
+
var newTree = isFilterHide ? tree[i].children.filter(function (t) {
|
|
11
|
+
return !t.hide;
|
|
12
|
+
}) : tree[i].children;
|
|
13
|
+
var result = findNodeById(newTree, actived, isFilterHide);
|
|
10
14
|
if (result) {
|
|
11
15
|
return result;
|
|
12
16
|
}
|
|
@@ -14,16 +18,25 @@ var findNodeById = function findNodeById(tree) {
|
|
|
14
18
|
}
|
|
15
19
|
};
|
|
16
20
|
export default (function (sourceOptions) {
|
|
21
|
+
var isFilterHide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
17
22
|
var tree = [];
|
|
18
23
|
var newOptions = JSON.parse(JSON.stringify(sourceOptions));
|
|
19
24
|
newOptions.map(function (item) {
|
|
20
25
|
if (tree.length === 0) {
|
|
21
|
-
|
|
26
|
+
var list = get(item, "list.1", []);
|
|
27
|
+
if (isFilterHide) {
|
|
28
|
+
list = list.filter(function (t) {
|
|
29
|
+
return !t.hide;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return tree = tree.concat(list);
|
|
22
33
|
}
|
|
23
34
|
Object.keys(item.list).map(function (l) {
|
|
24
35
|
// 在树中找到l对应的节点,将当前数组放到children里面
|
|
25
|
-
var result = findNodeById(tree, l);
|
|
26
|
-
result && (result.children = item.list[l])
|
|
36
|
+
var result = findNodeById(tree, l, isFilterHide);
|
|
37
|
+
result && (result.children = isFilterHide ? item.list[l].filter(function (t) {
|
|
38
|
+
return !t.hide;
|
|
39
|
+
}) : item.list[l]);
|
|
27
40
|
});
|
|
28
41
|
});
|
|
29
42
|
return tree;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2-beta.3",
|
|
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": "
|
|
44
|
+
"gitHead": "2d0488e9a1a8d010aa6877a5dcc803e9171e5709",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|
package/dist/esm/wdt/index.d.ts
DELETED
package/dist/esm/wdt/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { queryWdtWarehouseList } from "../../servers/index";
|
|
2
|
-
var singletonPromise;
|
|
3
|
-
var getWarehouseDataAsync = function getWarehouseDataAsync() {
|
|
4
|
-
if (!singletonPromise) {
|
|
5
|
-
singletonPromise = new Promise(function (resolve, reject) {
|
|
6
|
-
var list = [];
|
|
7
|
-
// PS: 接口最大支持100
|
|
8
|
-
var pageSize = 100;
|
|
9
|
-
var pageNo = 0;
|
|
10
|
-
function fetchList() {
|
|
11
|
-
queryWdtWarehouseList(pageNo, pageSize).then(function (res) {
|
|
12
|
-
var data = res.data;
|
|
13
|
-
var warehouses = (data === null || data === void 0 ? void 0 : data.warehouses) || [];
|
|
14
|
-
warehouses.map(function (_ref) {
|
|
15
|
-
var warehouseNo = _ref.warehouseNo,
|
|
16
|
-
name = _ref.name,
|
|
17
|
-
is_disabled = _ref.is_disabled;
|
|
18
|
-
if (!is_disabled) {
|
|
19
|
-
list.push({
|
|
20
|
-
label: name,
|
|
21
|
-
value: warehouseNo
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
pageNo++;
|
|
26
|
-
if (pageSize === warehouses.length) {
|
|
27
|
-
fetchList();
|
|
28
|
-
} else {
|
|
29
|
-
resolve(list);
|
|
30
|
-
}
|
|
31
|
-
}).catch(function (e) {
|
|
32
|
-
singletonPromise = null;
|
|
33
|
-
reject(e);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
fetchList();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return singletonPromise;
|
|
40
|
-
};
|
|
41
|
-
export default getWarehouseDataAsync;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface OptionsItem {
|
|
2
|
-
label: string;
|
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
|
-
export default class WdtSendData {
|
|
6
|
-
private static instance;
|
|
7
|
-
wdtSendData: OptionsItem[];
|
|
8
|
-
getWdtSendData: () => OptionsItem[];
|
|
9
|
-
setWdtSendData: (val: OptionsItem[]) => OptionsItem[];
|
|
10
|
-
getWdtSendNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
|
|
11
|
-
getWdtSendCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
|
|
12
|
-
static getInstance(): WdtSendData;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
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; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
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); }
|
|
8
|
-
var WdtSendData = /*#__PURE__*/function () {
|
|
9
|
-
function WdtSendData() {
|
|
10
|
-
var _this = this;
|
|
11
|
-
_classCallCheck(this, WdtSendData);
|
|
12
|
-
_defineProperty(this, "wdtSendData", []);
|
|
13
|
-
_defineProperty(this, "getWdtSendData", function () {
|
|
14
|
-
return _this.wdtSendData;
|
|
15
|
-
});
|
|
16
|
-
_defineProperty(this, "setWdtSendData", function (val) {
|
|
17
|
-
return _this.wdtSendData = val;
|
|
18
|
-
});
|
|
19
|
-
_defineProperty(this, "getWdtSendNameByCode", function (code) {
|
|
20
|
-
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
21
|
-
var item = (_this.wdtSendData || []).filter(function (item) {
|
|
22
|
-
return item.value === code;
|
|
23
|
-
});
|
|
24
|
-
return item.length ? item[0].label : returnCurrentValue ? code : "";
|
|
25
|
-
});
|
|
26
|
-
_defineProperty(this, "getWdtSendCodeByName", function (name) {
|
|
27
|
-
var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
28
|
-
var item = (_this.wdtSendData || []).filter(function (item) {
|
|
29
|
-
return item.label === name;
|
|
30
|
-
});
|
|
31
|
-
return item.length ? item[0].value : returnCurrentValue ? name : "";
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
_createClass(WdtSendData, null, [{
|
|
35
|
-
key: "getInstance",
|
|
36
|
-
value: function getInstance() {
|
|
37
|
-
if (!WdtSendData.instance) {
|
|
38
|
-
WdtSendData.instance = new WdtSendData();
|
|
39
|
-
}
|
|
40
|
-
return WdtSendData.instance;
|
|
41
|
-
}
|
|
42
|
-
}]);
|
|
43
|
-
return WdtSendData;
|
|
44
|
-
}();
|
|
45
|
-
_defineProperty(WdtSendData, "instance", void 0);
|
|
46
|
-
export { WdtSendData as default };
|