@kmkf-fe-packages/services-components 1.22.1-beta.84 → 1.22.1-beta.86
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/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.d.ts +3 -0
- package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.js +24 -0
- package/dist/esm/commonComponents/GlobalContext/index.d.ts +3 -2
- package/dist/esm/commonComponents/GlobalContext/index.js +33 -12
- package/dist/esm/commonComponents/GlobalContext/orderQuery/type.d.ts +1 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/type.js +1 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.d.ts +6 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +67 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpLogisticsCompany.d.ts +3 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpLogisticsCompany.js +64 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpSendData.d.ts +3 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpSendData.js +59 -0
- package/dist/esm/components/BS/BsLogistics/index.js +22 -9
- package/dist/esm/components/BS/common/expressCode.js +3 -0
- package/dist/esm/components/BS/common/expressCompany.js +3 -0
- package/dist/esm/components/StatusSelect/index.d.ts +1 -1
- package/dist/esm/components/StatusSelect/index.js +1 -2
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/factory.js +1 -0
- package/dist/esm/service/api.d.ts +1 -1
- package/dist/esm/service/api.js +54 -66
- package/package.json +4 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useSelector } from "react-redux";
|
|
3
|
+
import { createSelector } from "@reduxjs/toolkit";
|
|
4
|
+
function useGetHasErpData() {
|
|
5
|
+
var _useSelector = useSelector(createSelector([function (state) {
|
|
6
|
+
return state.main || {};
|
|
7
|
+
}], function (state) {
|
|
8
|
+
return state.userInfo;
|
|
9
|
+
})),
|
|
10
|
+
companyUserConfig = _useSelector.companyUserConfig;
|
|
11
|
+
var hasErpData = useMemo(function () {
|
|
12
|
+
var _companyUserConfig$pl, _companyUserConfig$pl2, _companyUserConfig$pl3, _companyUserConfig$pl4, _companyUserConfig$pl5, _companyUserConfig$pl6, _companyUserConfig$pl7, _companyUserConfig$pl8, _companyUserConfig$pl9, _companyUserConfig$pl10, _companyUserConfig$pl11, _companyUserConfig$pl12, _companyUserConfig$pl13, _companyUserConfig$pl14, _companyUserConfig$pl15, _companyUserConfig$pl16, _companyUserConfig$pl17, _companyUserConfig$pl18;
|
|
13
|
+
return {
|
|
14
|
+
hasWln: (_companyUserConfig$pl = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl2 = companyUserConfig.plugins) === null || _companyUserConfig$pl2 === void 0 ? void 0 : (_companyUserConfig$pl3 = _companyUserConfig$pl2.wln) === null || _companyUserConfig$pl3 === void 0 ? void 0 : _companyUserConfig$pl3.show) !== null && _companyUserConfig$pl !== void 0 ? _companyUserConfig$pl : false,
|
|
15
|
+
hasWdt: (_companyUserConfig$pl4 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl5 = companyUserConfig.plugins) === null || _companyUserConfig$pl5 === void 0 ? void 0 : (_companyUserConfig$pl6 = _companyUserConfig$pl5.wdt) === null || _companyUserConfig$pl6 === void 0 ? void 0 : _companyUserConfig$pl6.show) !== null && _companyUserConfig$pl4 !== void 0 ? _companyUserConfig$pl4 : false,
|
|
16
|
+
hasBs: (_companyUserConfig$pl7 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl8 = companyUserConfig.plugins) === null || _companyUserConfig$pl8 === void 0 ? void 0 : (_companyUserConfig$pl9 = _companyUserConfig$pl8.bs) === null || _companyUserConfig$pl9 === void 0 ? void 0 : _companyUserConfig$pl9.show) !== null && _companyUserConfig$pl7 !== void 0 ? _companyUserConfig$pl7 : false,
|
|
17
|
+
hasE3: (_companyUserConfig$pl10 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl11 = companyUserConfig.plugins) === null || _companyUserConfig$pl11 === void 0 ? void 0 : (_companyUserConfig$pl12 = _companyUserConfig$pl11.bse3) === null || _companyUserConfig$pl12 === void 0 ? void 0 : _companyUserConfig$pl12.show) !== null && _companyUserConfig$pl10 !== void 0 ? _companyUserConfig$pl10 : false,
|
|
18
|
+
hasJst: (_companyUserConfig$pl13 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl14 = companyUserConfig.plugins) === null || _companyUserConfig$pl14 === void 0 ? void 0 : (_companyUserConfig$pl15 = _companyUserConfig$pl14.jst) === null || _companyUserConfig$pl15 === void 0 ? void 0 : _companyUserConfig$pl15.show) !== null && _companyUserConfig$pl13 !== void 0 ? _companyUserConfig$pl13 : false,
|
|
19
|
+
hasGy: (_companyUserConfig$pl16 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl17 = companyUserConfig.plugins) === null || _companyUserConfig$pl17 === void 0 ? void 0 : (_companyUserConfig$pl18 = _companyUserConfig$pl17.gy) === null || _companyUserConfig$pl18 === void 0 ? void 0 : _companyUserConfig$pl18.show) !== null && _companyUserConfig$pl16 !== void 0 ? _companyUserConfig$pl16 : false
|
|
20
|
+
};
|
|
21
|
+
}, [companyUserConfig]);
|
|
22
|
+
return hasErpData;
|
|
23
|
+
}
|
|
24
|
+
export default useGetHasErpData;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "
|
|
3
|
-
declare const Global: ({ children, requestList, repeatRequestList, }: React.PropsWithChildren<{
|
|
2
|
+
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryGyAddressData";
|
|
3
|
+
declare const Global: ({ children, requestList, repeatRequestList, notJudgedErp, }: React.PropsWithChildren<{
|
|
4
4
|
requestList?: RequestType[] | undefined;
|
|
5
5
|
repeatRequestList?: Record<string, () => Promise<any>> | undefined;
|
|
6
|
+
notJudgedErp?: boolean | undefined;
|
|
6
7
|
}>) => React.JSX.Element;
|
|
7
8
|
export default Global;
|
|
@@ -13,20 +13,46 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
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; }
|
|
14
14
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import React, { useEffect, useState } from "react";
|
|
16
|
+
import React, { useEffect, useState, useMemo } from "react";
|
|
17
17
|
import { Skeleton, Button, Alert, Space } from "antd";
|
|
18
|
-
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany
|
|
18
|
+
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany } from "../../service/api";
|
|
19
19
|
import { servers } from "@kmkf-fe-packages/kmkf-utils";
|
|
20
|
+
import useGetErpLogisticsCompany from "./orderQuery/useGetErpLogisticsCompany";
|
|
21
|
+
import useGetErpSendData from "./orderQuery/useGetErpSendData";
|
|
20
22
|
var Global = function Global(_ref) {
|
|
21
23
|
var children = _ref.children,
|
|
22
24
|
_ref$requestList = _ref.requestList,
|
|
23
25
|
requestList = _ref$requestList === void 0 ? [] : _ref$requestList,
|
|
24
26
|
_ref$repeatRequestLis = _ref.repeatRequestList,
|
|
25
|
-
repeatRequestList = _ref$repeatRequestLis === void 0 ? {} : _ref$repeatRequestLis
|
|
27
|
+
repeatRequestList = _ref$repeatRequestLis === void 0 ? {} : _ref$repeatRequestLis,
|
|
28
|
+
_ref$notJudgedErp = _ref.notJudgedErp,
|
|
29
|
+
notJudgedErp = _ref$notJudgedErp === void 0 ? false : _ref$notJudgedErp;
|
|
26
30
|
var _useState = useState("loading"),
|
|
27
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
32
|
globalState = _useState2[0],
|
|
29
33
|
setGlobalState = _useState2[1];
|
|
34
|
+
|
|
35
|
+
//获取Erp物流公司信息
|
|
36
|
+
var _useGetErpLogisticsCo = useGetErpLogisticsCompany(notJudgedErp),
|
|
37
|
+
_useGetErpLogisticsCo2 = _slicedToArray(_useGetErpLogisticsCo, 2),
|
|
38
|
+
logisticsCompanyState = _useGetErpLogisticsCo2[0],
|
|
39
|
+
reloadGetErpLogisticsCompany = _useGetErpLogisticsCo2[1];
|
|
40
|
+
//获取Erp发货仓下拉数据
|
|
41
|
+
var _useGetErpSendData = useGetErpSendData(notJudgedErp),
|
|
42
|
+
_useGetErpSendData2 = _slicedToArray(_useGetErpSendData, 2),
|
|
43
|
+
sendDataState = _useGetErpSendData2[0],
|
|
44
|
+
reloadGetErpSendData = _useGetErpSendData2[1];
|
|
45
|
+
var allState = useMemo(function () {
|
|
46
|
+
var allStateList = [globalState, logisticsCompanyState, sendDataState];
|
|
47
|
+
if (allStateList.includes("loading")) return "loading";
|
|
48
|
+
if (allStateList.includes("failed")) return "failed";
|
|
49
|
+
return "success";
|
|
50
|
+
}, [globalState, logisticsCompanyState, sendDataState]);
|
|
51
|
+
var reloadData = function reloadData() {
|
|
52
|
+
globalState === "failed" && initDataSource();
|
|
53
|
+
logisticsCompanyState === "failed" && reloadGetErpLogisticsCompany();
|
|
54
|
+
sendDataState === "failed" && reloadGetErpSendData();
|
|
55
|
+
};
|
|
30
56
|
var initDataSource = /*#__PURE__*/function () {
|
|
31
57
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
32
58
|
var mapping, mergeMapping, promises, _Object$keys, _Object$keys2, _Object$keys2$filter, _promises;
|
|
@@ -42,12 +68,7 @@ var Global = function Global(_ref) {
|
|
|
42
68
|
queryAllLogisticsCompany: queryAllLogisticsCompany,
|
|
43
69
|
queryLabel: queryLabel,
|
|
44
70
|
queryWdtAddressData: servers.queryWdtAddressData,
|
|
45
|
-
queryGyAddressData: servers.queryGyAddressData
|
|
46
|
-
queryWdtLogisticsCompany: queryWdtLogisticsCompany,
|
|
47
|
-
queryBsE3LogisticsCompany: queryBsE3LogisticsCompany,
|
|
48
|
-
querySendData: querySendData,
|
|
49
|
-
queryJSTLogisticsCompany: queryJSTLogisticsCompany,
|
|
50
|
-
queryWLNLogisticsCompany: queryWLNLogisticsCompany
|
|
71
|
+
queryGyAddressData: servers.queryGyAddressData
|
|
51
72
|
};
|
|
52
73
|
mergeMapping = _objectSpread(_objectSpread({}, mapping), repeatRequestList);
|
|
53
74
|
promises = [];
|
|
@@ -88,7 +109,7 @@ var Global = function Global(_ref) {
|
|
|
88
109
|
useEffect(function () {
|
|
89
110
|
initDataSource();
|
|
90
111
|
}, []);
|
|
91
|
-
if (
|
|
112
|
+
if (allState === "loading") {
|
|
92
113
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
93
114
|
active: true,
|
|
94
115
|
paragraph: {
|
|
@@ -96,14 +117,14 @@ var Global = function Global(_ref) {
|
|
|
96
117
|
}
|
|
97
118
|
});
|
|
98
119
|
}
|
|
99
|
-
if (
|
|
120
|
+
if (allState === "failed") {
|
|
100
121
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Alert, {
|
|
101
122
|
message: "\u6570\u636E\u52A0\u8F7D\u5F02\u5E38,\u53EF\u80FD\u5F71\u54CD\u90E8\u5206\u7EC4\u4EF6\u4F7F\u7528",
|
|
102
123
|
type: "warning",
|
|
103
124
|
action: /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
104
125
|
type: "primary",
|
|
105
126
|
key: "console",
|
|
106
|
-
onClick:
|
|
127
|
+
onClick: reloadData,
|
|
107
128
|
size: "small"
|
|
108
129
|
}, "\u5237\u65B0\u91CD\u8BD5")),
|
|
109
130
|
closable: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Status = "loading" | "success" | "failed";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import useGetHasErpData from "../hook/useGetHasErpData";
|
|
13
|
+
import { useUpdateEffect } from "ahooks";
|
|
14
|
+
import { servers } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 暂时不使用
|
|
18
|
+
* **/
|
|
19
|
+
function useGetErpAddressData(notJudgedErp) {
|
|
20
|
+
var _useState = useState("loading"),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
globalState = _useState2[0],
|
|
23
|
+
setGlobalState = _useState2[1];
|
|
24
|
+
var hasErpData = useGetHasErpData();
|
|
25
|
+
useUpdateEffect(function () {
|
|
26
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
27
|
+
}, [hasErpData, notJudgedErp]);
|
|
28
|
+
var asyncQueryData = /*#__PURE__*/function () {
|
|
29
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp) {
|
|
30
|
+
var hasBs, hasWdt, hasGy, promises;
|
|
31
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
|
|
35
|
+
promises = [];
|
|
36
|
+
if (hasBs || notJudgedErp) promises.push(servers.queryBsAddressData);
|
|
37
|
+
if (hasWdt || notJudgedErp) promises.push(servers.queryWdtAddressData);
|
|
38
|
+
if (hasGy || notJudgedErp) promises.push(servers.queryGyAddressData);
|
|
39
|
+
_context.prev = 5;
|
|
40
|
+
_context.next = 8;
|
|
41
|
+
return Promise.all(promises.map(function (promise) {
|
|
42
|
+
return promise();
|
|
43
|
+
}));
|
|
44
|
+
case 8:
|
|
45
|
+
setGlobalState("success");
|
|
46
|
+
_context.next = 14;
|
|
47
|
+
break;
|
|
48
|
+
case 11:
|
|
49
|
+
_context.prev = 11;
|
|
50
|
+
_context.t0 = _context["catch"](5);
|
|
51
|
+
setGlobalState("failed");
|
|
52
|
+
case 14:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee, null, [[5, 11]]);
|
|
57
|
+
}));
|
|
58
|
+
return function asyncQueryData(_x2, _x3) {
|
|
59
|
+
return _ref.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}();
|
|
62
|
+
var onReload = function onReload() {
|
|
63
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
64
|
+
};
|
|
65
|
+
return [globalState, onReload];
|
|
66
|
+
}
|
|
67
|
+
export default useGetErpAddressData;
|
|
@@ -0,0 +1,64 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import useGetHasErpData from "../hook/useGetHasErpData";
|
|
13
|
+
import { useUpdateEffect } from "ahooks";
|
|
14
|
+
import { queryWdtLogisticsCompany, queryBsE3LogisticsCompany, queryJSTLogisticsCompany, queryWLNLogisticsCompany, queryKMLogisticsCompany } from "../../../service/api";
|
|
15
|
+
function useGetErpLogisticsCompany(notJudgedErp) {
|
|
16
|
+
var _useState = useState("loading"),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
globalState = _useState2[0],
|
|
19
|
+
setGlobalState = _useState2[1];
|
|
20
|
+
var hasErpData = useGetHasErpData();
|
|
21
|
+
useUpdateEffect(function () {
|
|
22
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
23
|
+
}, [hasErpData, notJudgedErp]);
|
|
24
|
+
var asyncQueryData = /*#__PURE__*/function () {
|
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp) {
|
|
26
|
+
var hasWdt, hasE3, hasJst, hasWln, promises;
|
|
27
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
hasWdt = hasErpData.hasWdt, hasE3 = hasErpData.hasE3, hasJst = hasErpData.hasJst, hasWln = hasErpData.hasWln;
|
|
31
|
+
promises = [queryKMLogisticsCompany];
|
|
32
|
+
if (hasWdt || notJudgedErp) promises.push(queryWdtLogisticsCompany);
|
|
33
|
+
if (hasE3 || notJudgedErp) promises.push(queryBsE3LogisticsCompany);
|
|
34
|
+
if (hasJst || notJudgedErp) promises.push(queryJSTLogisticsCompany);
|
|
35
|
+
if (hasWln || notJudgedErp) promises.push(queryWLNLogisticsCompany);
|
|
36
|
+
_context.prev = 6;
|
|
37
|
+
_context.next = 9;
|
|
38
|
+
return Promise.all(promises.map(function (promise) {
|
|
39
|
+
return promise();
|
|
40
|
+
}));
|
|
41
|
+
case 9:
|
|
42
|
+
setGlobalState("success");
|
|
43
|
+
_context.next = 15;
|
|
44
|
+
break;
|
|
45
|
+
case 12:
|
|
46
|
+
_context.prev = 12;
|
|
47
|
+
_context.t0 = _context["catch"](6);
|
|
48
|
+
setGlobalState("failed");
|
|
49
|
+
case 15:
|
|
50
|
+
case "end":
|
|
51
|
+
return _context.stop();
|
|
52
|
+
}
|
|
53
|
+
}, _callee, null, [[6, 12]]);
|
|
54
|
+
}));
|
|
55
|
+
return function asyncQueryData(_x2, _x3) {
|
|
56
|
+
return _ref.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
}();
|
|
59
|
+
var onReload = function onReload() {
|
|
60
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
61
|
+
};
|
|
62
|
+
return [globalState, onReload];
|
|
63
|
+
}
|
|
64
|
+
export default useGetErpLogisticsCompany;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import useGetHasErpData from "../hook/useGetHasErpData";
|
|
13
|
+
import { useUpdateEffect } from "ahooks";
|
|
14
|
+
import { SendDataCenter } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
function useGetErpSendData(notJudgedErp) {
|
|
16
|
+
var _useState = useState("loading"),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
globalState = _useState2[0],
|
|
19
|
+
setGlobalState = _useState2[1];
|
|
20
|
+
var hasErpData = useGetHasErpData();
|
|
21
|
+
useUpdateEffect(function () {
|
|
22
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
23
|
+
}, [hasErpData, notJudgedErp]);
|
|
24
|
+
var asyncQueryData = /*#__PURE__*/function () {
|
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp) {
|
|
26
|
+
var promises;
|
|
27
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
_context.prev = 0;
|
|
31
|
+
promises = SendDataCenter.getPromises(hasErpData, notJudgedErp);
|
|
32
|
+
_context.next = 4;
|
|
33
|
+
return Promise.all(promises.map(function (promise) {
|
|
34
|
+
return promise();
|
|
35
|
+
}));
|
|
36
|
+
case 4:
|
|
37
|
+
setGlobalState("success");
|
|
38
|
+
_context.next = 10;
|
|
39
|
+
break;
|
|
40
|
+
case 7:
|
|
41
|
+
_context.prev = 7;
|
|
42
|
+
_context.t0 = _context["catch"](0);
|
|
43
|
+
setGlobalState("failed");
|
|
44
|
+
case 10:
|
|
45
|
+
case "end":
|
|
46
|
+
return _context.stop();
|
|
47
|
+
}
|
|
48
|
+
}, _callee, null, [[0, 7]]);
|
|
49
|
+
}));
|
|
50
|
+
return function asyncQueryData(_x2, _x3) {
|
|
51
|
+
return _ref.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
}();
|
|
54
|
+
var onReload = function onReload() {
|
|
55
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
56
|
+
};
|
|
57
|
+
return [globalState, onReload];
|
|
58
|
+
}
|
|
59
|
+
export default useGetErpSendData;
|
|
@@ -24,35 +24,48 @@ var typeMap = {
|
|
|
24
24
|
name: "bs",
|
|
25
25
|
company: "bsLogisticsCompany",
|
|
26
26
|
code: "bsLogisticsCode",
|
|
27
|
-
platformType: "default"
|
|
27
|
+
platformType: "default",
|
|
28
|
+
companyDataType: "arrayObject"
|
|
28
29
|
},
|
|
29
30
|
BS_E3_LOGISTICS: {
|
|
30
31
|
key: "bsE3LogisticsList",
|
|
31
32
|
name: "bsE3",
|
|
32
33
|
company: "bsE3LogisticsCompany",
|
|
33
34
|
code: "bsE3LogisticsCode",
|
|
34
|
-
platformType: "bsE3"
|
|
35
|
+
platformType: "bsE3",
|
|
36
|
+
companyDataType: "arrayObject"
|
|
35
37
|
},
|
|
36
38
|
WLN_LOGISTICS: {
|
|
37
39
|
key: "wlnLogisticsList",
|
|
38
40
|
name: "万里牛",
|
|
39
41
|
company: "wlnLogisticsCompany",
|
|
40
42
|
code: "wlnLogisticsCode",
|
|
41
|
-
platformType: "wln"
|
|
43
|
+
platformType: "wln",
|
|
44
|
+
companyDataType: "arrayObject"
|
|
42
45
|
},
|
|
43
46
|
WDT_LOGISTICS: {
|
|
44
47
|
key: "wdtLogisticsList",
|
|
45
48
|
name: "旺店通",
|
|
46
49
|
company: "wdtLogisticsCompany",
|
|
47
50
|
code: "wdtLogisticsCode",
|
|
48
|
-
platformType: "wdt"
|
|
51
|
+
platformType: "wdt",
|
|
52
|
+
companyDataType: "arrayObject"
|
|
49
53
|
},
|
|
50
54
|
JST_LOGISTICS: {
|
|
51
55
|
key: "jstItemList",
|
|
52
56
|
name: "聚水潭",
|
|
53
57
|
company: "logisticsCompany",
|
|
54
58
|
code: "logisticsCode",
|
|
55
|
-
platformType:
|
|
59
|
+
platformType: "jst",
|
|
60
|
+
companyDataType: "arrayObject"
|
|
61
|
+
},
|
|
62
|
+
KM_LOGISTICS: {
|
|
63
|
+
key: "kmLogisticsList",
|
|
64
|
+
name: "快麦",
|
|
65
|
+
company: "kmLogisticsCompany",
|
|
66
|
+
code: "kmLogisticsCode",
|
|
67
|
+
platformType: "km",
|
|
68
|
+
companyDataType: "weakenArray"
|
|
56
69
|
}
|
|
57
70
|
};
|
|
58
71
|
var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
|
|
@@ -103,13 +116,13 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
|
|
|
103
116
|
name: "物流公司",
|
|
104
117
|
key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.company),
|
|
105
118
|
options: _this.expressDateInstance.getExpressData(),
|
|
106
|
-
dataType:
|
|
107
|
-
disabled: type ===
|
|
119
|
+
dataType: typeMap[options.type].companyDataType,
|
|
120
|
+
disabled: type === "logisticsCode"
|
|
108
121
|
}, {
|
|
109
122
|
name: "物流单号",
|
|
110
123
|
key: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.code),
|
|
111
124
|
dataType: "arrayObject",
|
|
112
|
-
disabled: type ===
|
|
125
|
+
disabled: type === "logisticsCompany"
|
|
113
126
|
}];
|
|
114
127
|
});
|
|
115
128
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
@@ -148,7 +161,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
|
|
|
148
161
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
149
162
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
150
163
|
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,
|
|
151
|
-
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip :
|
|
164
|
+
tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
|
|
152
165
|
component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
|
|
153
166
|
type: 1,
|
|
154
167
|
platformType: _this.platformType,
|
|
@@ -19,7 +19,7 @@ declare class StatusSelect implements ComponentInterface {
|
|
|
19
19
|
renderPc: (value: any, record: Record) => React.JSX.Element | "--";
|
|
20
20
|
renderLog: (r: Record) => React.JSX.Element | "--" | null;
|
|
21
21
|
getComponentValue: (r: Record) => any;
|
|
22
|
-
renderExport: (value: any, record: Record) =>
|
|
22
|
+
renderExport: (value: any, record: Record) => string;
|
|
23
23
|
filterConfig: (item: ColumnConfig) => {
|
|
24
24
|
searchDefaultConditions: "in";
|
|
25
25
|
type: string;
|
|
@@ -128,8 +128,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
128
128
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)];
|
|
129
129
|
});
|
|
130
130
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
131
|
-
|
|
132
|
-
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]) !== null && _record !== void 0 ? _record : "--";
|
|
131
|
+
return record !== null && record !== void 0 && record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)] ? "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]).concat((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].info)]) || '') : '--';
|
|
133
132
|
});
|
|
134
133
|
_defineProperty(this, "filterConfig", function (item) {
|
|
135
134
|
return {
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, 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, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, GyGoods, BsE3Reissue, MemberLevel } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) =>
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => BsLogistics | JstSendGood | MsgStatus | StatusSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | BsE3Reissue | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue;
|
package/dist/esm/factory.js
CHANGED
|
@@ -177,6 +177,7 @@ export var factory = function factory(type, options) {
|
|
|
177
177
|
case "WLN_LOGISTICS":
|
|
178
178
|
case "WDT_LOGISTICS":
|
|
179
179
|
case "JST_LOGISTICS":
|
|
180
|
+
case "KM_LOGISTICS":
|
|
180
181
|
return new BsLogistics(options);
|
|
181
182
|
case "FLOW_WORK_ORDER_ID_INPUT":
|
|
182
183
|
return new FlowWorkOrderId(options);
|
|
@@ -10,7 +10,7 @@ export declare const queryWdtLogisticsCompany: () => Promise<void>;
|
|
|
10
10
|
export declare const queryBsE3LogisticsCompany: () => Promise<void>;
|
|
11
11
|
export declare const queryJSTLogisticsCompany: () => Promise<void>;
|
|
12
12
|
export declare const queryWLNLogisticsCompany: () => Promise<void>;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const queryKMLogisticsCompany: () => Promise<void>;
|
|
14
14
|
export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
|
|
15
15
|
export declare const queryLabel: () => Promise<any>;
|
|
16
16
|
export declare const queryWorkOrderDetail: (data: any) => Promise<any>;
|
package/dist/esm/service/api.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
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
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; }
|
|
6
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; }
|
|
7
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; }
|
|
@@ -13,40 +10,40 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
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; }
|
|
16
|
-
import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, LabelData,
|
|
17
|
-
import get from
|
|
13
|
+
import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, LabelData, servers } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
|
+
import get from "lodash/get";
|
|
18
15
|
import request from "./request";
|
|
19
16
|
// 重复校验
|
|
20
17
|
export var replaceCheck = function replaceCheck(data) {
|
|
21
18
|
return request({
|
|
22
|
-
url:
|
|
23
|
-
method:
|
|
19
|
+
url: "/qy/gdfw/workOrder/repeatCheck",
|
|
20
|
+
method: "post",
|
|
24
21
|
data: data
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
24
|
export var queryAddressData = function queryAddressData() {
|
|
28
25
|
return request({
|
|
29
|
-
url:
|
|
30
|
-
method:
|
|
26
|
+
url: "/qy/gdfw/template/queryAreas/noLogin",
|
|
27
|
+
method: "get",
|
|
31
28
|
data: {}
|
|
32
29
|
}).then(function (resp) {
|
|
33
30
|
var map = {};
|
|
34
31
|
var res = {};
|
|
35
32
|
var list = resp.data;
|
|
36
33
|
for (var i = 0; i < list.length; i++) {
|
|
37
|
-
res[list[i][
|
|
38
|
-
map[list[i][
|
|
34
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
35
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
39
36
|
}
|
|
40
37
|
var instance = AddressData.getInstance();
|
|
41
38
|
instance.addrData = res;
|
|
42
39
|
instance.addrNameMap = map;
|
|
43
|
-
instance.addressOptions = get(toTree(list, 0),
|
|
40
|
+
instance.addressOptions = get(toTree(list, 0), "0.children", []);
|
|
44
41
|
});
|
|
45
42
|
};
|
|
46
43
|
export var queryBsAddressData = function queryBsAddressData() {
|
|
47
44
|
return request({
|
|
48
|
-
url:
|
|
49
|
-
method:
|
|
45
|
+
url: "/qy/gdfw/template/queryBsAreas/noLogin",
|
|
46
|
+
method: "get",
|
|
50
47
|
data: {}
|
|
51
48
|
}).then(function (resp) {
|
|
52
49
|
var map = {};
|
|
@@ -54,8 +51,8 @@ export var queryBsAddressData = function queryBsAddressData() {
|
|
|
54
51
|
var _resp$data = resp.data,
|
|
55
52
|
list = _resp$data === void 0 ? [] : _resp$data;
|
|
56
53
|
for (var i = 0; i < list.length; i++) {
|
|
57
|
-
res[list[i][
|
|
58
|
-
map[list[i][
|
|
54
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
55
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
59
56
|
}
|
|
60
57
|
var instance = BsAddressData.getInstance();
|
|
61
58
|
instance.addrData = res;
|
|
@@ -65,8 +62,8 @@ export var queryBsAddressData = function queryBsAddressData() {
|
|
|
65
62
|
};
|
|
66
63
|
export var queryWdtAddressData = function queryWdtAddressData() {
|
|
67
64
|
return request({
|
|
68
|
-
url:
|
|
69
|
-
method:
|
|
65
|
+
url: "/qy/gdfw/template/queryWdtAreas/noLogin",
|
|
66
|
+
method: "get",
|
|
70
67
|
data: {}
|
|
71
68
|
}).then(function (resp) {
|
|
72
69
|
var map = {};
|
|
@@ -74,8 +71,8 @@ export var queryWdtAddressData = function queryWdtAddressData() {
|
|
|
74
71
|
var _resp$data2 = resp.data,
|
|
75
72
|
list = _resp$data2 === void 0 ? [] : _resp$data2;
|
|
76
73
|
for (var i = 0; i < list.length; i++) {
|
|
77
|
-
res[list[i][
|
|
78
|
-
map[list[i][
|
|
74
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
75
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
79
76
|
}
|
|
80
77
|
var instance = WdtAddressData.getInstance();
|
|
81
78
|
instance.addrData = res;
|
|
@@ -85,8 +82,8 @@ export var queryWdtAddressData = function queryWdtAddressData() {
|
|
|
85
82
|
};
|
|
86
83
|
export var queryPlatData = function queryPlatData() {
|
|
87
84
|
return request({
|
|
88
|
-
url:
|
|
89
|
-
method:
|
|
85
|
+
url: "/qy/platform/listPlatform/noLogin",
|
|
86
|
+
method: "get",
|
|
90
87
|
data: {}
|
|
91
88
|
}).then(function (res) {
|
|
92
89
|
if (res.success) {
|
|
@@ -113,8 +110,8 @@ export var queryPlatData = function queryPlatData() {
|
|
|
113
110
|
};
|
|
114
111
|
export var queryExpressInterceptData = function queryExpressInterceptData() {
|
|
115
112
|
return request({
|
|
116
|
-
url:
|
|
117
|
-
method:
|
|
113
|
+
url: "/qy/logistics/listLogisticsWithInterceptInfo/noLogin",
|
|
114
|
+
method: "get",
|
|
118
115
|
data: {
|
|
119
116
|
platformType: 118
|
|
120
117
|
}
|
|
@@ -122,10 +119,10 @@ export var queryExpressInterceptData = function queryExpressInterceptData() {
|
|
|
122
119
|
var data = res.data;
|
|
123
120
|
var instance = ExpressInterceptData.getInstance();
|
|
124
121
|
var companyTypeMap = {
|
|
125
|
-
SF:
|
|
126
|
-
ZTO:
|
|
127
|
-
JT:
|
|
128
|
-
DEFAULT:
|
|
122
|
+
SF: "顺丰",
|
|
123
|
+
ZTO: "中通",
|
|
124
|
+
JT: "极兔",
|
|
125
|
+
DEFAULT: ""
|
|
129
126
|
};
|
|
130
127
|
var expressList = data.map(function (item) {
|
|
131
128
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -190,26 +187,26 @@ export var queryExpressInterceptData = function queryExpressInterceptData() {
|
|
|
190
187
|
instance.typeOptions = Object.keys(typeObj).map(function (key) {
|
|
191
188
|
return {
|
|
192
189
|
label: key,
|
|
193
|
-
value: _toConsumableArray(typeObj[key]).join(
|
|
190
|
+
value: _toConsumableArray(typeObj[key]).join(",")
|
|
194
191
|
};
|
|
195
192
|
});
|
|
196
193
|
instance.typeConditionOptions = Object.keys(instance.typeNameMap).map(function (key) {
|
|
197
|
-
var type = key.split(
|
|
194
|
+
var type = key.split("|")[0];
|
|
198
195
|
return {
|
|
199
|
-
label: "".concat(companyTypeMap[type] ||
|
|
196
|
+
label: "".concat(companyTypeMap[type] || "").concat(instance.typeNameMap[key]),
|
|
200
197
|
value: key
|
|
201
198
|
};
|
|
202
199
|
});
|
|
203
200
|
instance.statusOptions = Object.keys(statusObj).map(function (key) {
|
|
204
201
|
return {
|
|
205
202
|
label: key,
|
|
206
|
-
value: _toConsumableArray(statusObj[key]).join(
|
|
203
|
+
value: _toConsumableArray(statusObj[key]).join(",")
|
|
207
204
|
};
|
|
208
205
|
});
|
|
209
206
|
var tempList = [];
|
|
210
207
|
var tempObj = {};
|
|
211
208
|
Object.keys(instance.statusNameMap).forEach(function (key) {
|
|
212
|
-
var type = key.split(
|
|
209
|
+
var type = key.split("|")[1];
|
|
213
210
|
if (!tempObj[type]) {
|
|
214
211
|
tempList.push({
|
|
215
212
|
label: instance.statusNameMap[key],
|
|
@@ -226,8 +223,8 @@ export var queryExpressInterceptData = function queryExpressInterceptData() {
|
|
|
226
223
|
};
|
|
227
224
|
export var queryLogisticsAddressData = function queryLogisticsAddressData() {
|
|
228
225
|
return request({
|
|
229
|
-
url:
|
|
230
|
-
method:
|
|
226
|
+
url: "/qy/userConfig/listLogisticsAddress",
|
|
227
|
+
method: "get",
|
|
231
228
|
data: {}
|
|
232
229
|
}).then(function (res) {
|
|
233
230
|
var data = res.data;
|
|
@@ -239,8 +236,8 @@ export var queryLogisticsAddressData = function queryLogisticsAddressData() {
|
|
|
239
236
|
};
|
|
240
237
|
export var queryAllLogisticsCompany = function queryAllLogisticsCompany() {
|
|
241
238
|
return request({
|
|
242
|
-
url:
|
|
243
|
-
method:
|
|
239
|
+
url: "/qy/logistics/company/getAllLogisticsCompany/noLogin",
|
|
240
|
+
method: "get",
|
|
244
241
|
data: {}
|
|
245
242
|
}).then(function (res) {
|
|
246
243
|
var data = res.data;
|
|
@@ -255,60 +252,51 @@ export var queryAllLogisticsCompany = function queryAllLogisticsCompany() {
|
|
|
255
252
|
});
|
|
256
253
|
};
|
|
257
254
|
export var queryWdtLogisticsCompany = function queryWdtLogisticsCompany() {
|
|
258
|
-
var instance = ExpressData.getInstance(
|
|
255
|
+
var instance = ExpressData.getInstance("wdt");
|
|
259
256
|
return servers.getWdtSellerLogisticsCompanyRelation().then(function (data) {
|
|
260
257
|
instance.expressData = data;
|
|
261
258
|
}).catch(console.log);
|
|
262
259
|
};
|
|
263
260
|
export var queryBsE3LogisticsCompany = function queryBsE3LogisticsCompany() {
|
|
264
|
-
var instance = ExpressData.getInstance(
|
|
261
|
+
var instance = ExpressData.getInstance("bsE3");
|
|
265
262
|
return servers.BSE3.getLogisticsDataAsync().then(function (data) {
|
|
266
263
|
instance.expressData = data;
|
|
267
264
|
}).catch(console.log);
|
|
268
265
|
};
|
|
269
266
|
export var queryJSTLogisticsCompany = function queryJSTLogisticsCompany() {
|
|
270
|
-
var instance = ExpressData.getInstance(
|
|
267
|
+
var instance = ExpressData.getInstance("jst");
|
|
271
268
|
return servers.JST.getLogisticsDataAsync().then(function (data) {
|
|
272
269
|
instance.expressData = data;
|
|
273
270
|
}).catch(console.log);
|
|
274
271
|
};
|
|
275
272
|
export var queryWLNLogisticsCompany = function queryWLNLogisticsCompany() {
|
|
276
|
-
var instance = ExpressData.getInstance(
|
|
273
|
+
var instance = ExpressData.getInstance("wln");
|
|
277
274
|
return servers.WLN.getLogisticsDataAsync().then(function (data) {
|
|
278
275
|
instance.expressData = data;
|
|
279
276
|
}).catch(console.log);
|
|
280
277
|
};
|
|
281
|
-
export var
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
case "end":
|
|
290
|
-
return _context.stop();
|
|
291
|
-
}
|
|
292
|
-
}, _callee);
|
|
293
|
-
}));
|
|
294
|
-
return function querySendData() {
|
|
295
|
-
return _ref.apply(this, arguments);
|
|
296
|
-
};
|
|
297
|
-
}();
|
|
278
|
+
export var queryKMLogisticsCompany = function queryKMLogisticsCompany() {
|
|
279
|
+
var instance = ExpressData.getInstance("km");
|
|
280
|
+
console.log("快麦---");
|
|
281
|
+
return servers.KM.getLogisticsDataAsync().then(function (data) {
|
|
282
|
+
instance.expressData = data;
|
|
283
|
+
console.log("快麦---", data);
|
|
284
|
+
}).catch(console.log);
|
|
285
|
+
};
|
|
298
286
|
// 获取支付宝电子回单
|
|
299
287
|
export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
|
|
300
288
|
return request({
|
|
301
|
-
url:
|
|
302
|
-
method:
|
|
289
|
+
url: "/qy/payment/paymentOrder/getAlipayBillReceipt",
|
|
290
|
+
method: "post",
|
|
303
291
|
data: data
|
|
304
292
|
});
|
|
305
293
|
};
|
|
306
294
|
export var queryLabel = function queryLabel() {
|
|
307
295
|
return request({
|
|
308
|
-
url:
|
|
309
|
-
method:
|
|
296
|
+
url: "/qy/diamond/getConfigInfo",
|
|
297
|
+
method: "get",
|
|
310
298
|
data: {
|
|
311
|
-
key:
|
|
299
|
+
key: "RISK_WARING_LABEL_LIST"
|
|
312
300
|
}
|
|
313
301
|
}).then(function (res) {
|
|
314
302
|
var data = res.data;
|
|
@@ -317,7 +305,7 @@ export var queryLabel = function queryLabel() {
|
|
|
317
305
|
var finalData = JSON.parse(data);
|
|
318
306
|
instance.labelData = finalData;
|
|
319
307
|
} catch (e) {
|
|
320
|
-
console.error(
|
|
308
|
+
console.error("转换标签数据数据异常");
|
|
321
309
|
instance.labelData = [];
|
|
322
310
|
}
|
|
323
311
|
});
|
|
@@ -326,8 +314,8 @@ export var queryLabel = function queryLabel() {
|
|
|
326
314
|
//查询工单
|
|
327
315
|
export var queryWorkOrderDetail = function queryWorkOrderDetail(data) {
|
|
328
316
|
return request({
|
|
329
|
-
url:
|
|
330
|
-
method:
|
|
317
|
+
url: "/qy/gdfw/workOrder/queryWorkOrderDetail",
|
|
318
|
+
method: "post",
|
|
331
319
|
data: data
|
|
332
320
|
});
|
|
333
321
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.22.1-beta.
|
|
3
|
+
"version": "1.22.1-beta.86",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "1.22.1-beta.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "1.22.1-beta.86",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.86",
|
|
26
26
|
"b64-to-blob": "^1.2.19",
|
|
27
27
|
"html2canvas": "^1.4.1",
|
|
28
28
|
"react-pdf-js": "^5.1.0"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "5af8ffd5ffced8c32dd5692bc9dc2e8ab1c2101e",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|