@kmkf-fe-packages/services-components 0.26.1-beta.1 → 0.26.1-beta.11
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/index.d.ts +7 -0
- package/dist/esm/commonComponents/GlobalContext/index.js +104 -0
- package/dist/esm/components/LogisticsMoreInterception/InterceptAddress.js +2 -1
- package/dist/esm/components/LogisticsMoreInterception/InterceptStatus.js +5 -3
- package/dist/esm/components/LogisticsMoreTrajectory/index.js +2 -2
- package/dist/esm/components/MultSelect/index.d.ts +4 -4
- package/dist/esm/components/MultSelect/index.js +13 -13
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/service/api.d.ts +7 -0
- package/dist/esm/service/api.js +241 -0
- package/dist/esm/service/request.js +9 -1
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany";
|
|
3
|
+
declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
|
|
4
|
+
requestList?: RequestType[] | undefined;
|
|
5
|
+
repeatRequestList?: Record<string, Promise<any>> | undefined;
|
|
6
|
+
}>) => React.JSX.Element;
|
|
7
|
+
export default Global;
|
|
@@ -0,0 +1,104 @@
|
|
|
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 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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
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); } }
|
|
9
|
+
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); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
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
|
+
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
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import React, { useEffect, useState } from "react";
|
|
17
|
+
import { Skeleton, Result, Button } from "antd";
|
|
18
|
+
import { queryAddressData, queryBsAddressData, queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryWdtAddressData, queryAllLogisticsCompany } from "../../service/api";
|
|
19
|
+
var Global = function Global(_ref) {
|
|
20
|
+
var children = _ref.children,
|
|
21
|
+
_ref$requestList = _ref.requestList,
|
|
22
|
+
requestList = _ref$requestList === void 0 ? [] : _ref$requestList,
|
|
23
|
+
_ref$repeatRequestLis = _ref.repeatRequestList,
|
|
24
|
+
repeatRequestList = _ref$repeatRequestLis === void 0 ? {} : _ref$repeatRequestLis;
|
|
25
|
+
var _useState = useState("loading"),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
globalState = _useState2[0],
|
|
28
|
+
setGlobalState = _useState2[1];
|
|
29
|
+
var initDataSource = /*#__PURE__*/function () {
|
|
30
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
31
|
+
var mapping, mergeMapping, promises, _Object$keys, _Object$keys2, _Object$keys2$filter, _promises;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
mapping = {
|
|
36
|
+
queryAddressData: queryAddressData,
|
|
37
|
+
queryBsAddressData: queryBsAddressData,
|
|
38
|
+
queryExpressInterceptData: queryExpressInterceptData,
|
|
39
|
+
queryLogisticsAddressData: queryLogisticsAddressData,
|
|
40
|
+
queryPlatData: queryPlatData,
|
|
41
|
+
queryWdtAddressData: queryWdtAddressData,
|
|
42
|
+
queryAllLogisticsCompany: queryAllLogisticsCompany
|
|
43
|
+
};
|
|
44
|
+
mergeMapping = _objectSpread(_objectSpread({}, mapping), repeatRequestList);
|
|
45
|
+
promises = [];
|
|
46
|
+
if ((requestList === null || requestList === void 0 ? void 0 : requestList.length) === 0) {
|
|
47
|
+
promises = (_Object$keys = Object.keys(mergeMapping)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(function (item) {
|
|
48
|
+
return mergeMapping[item];
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
promises = (_Object$keys2 = Object.keys(mergeMapping)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$filter = _Object$keys2.filter(function (item) {
|
|
52
|
+
return requestList === null || requestList === void 0 ? void 0 : requestList.includes(item);
|
|
53
|
+
})) === null || _Object$keys2$filter === void 0 ? void 0 : _Object$keys2$filter.map(function (item) {
|
|
54
|
+
return mergeMapping[item];
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_context.prev = 4;
|
|
58
|
+
_context.next = 7;
|
|
59
|
+
return Promise.all((_promises = promises) === null || _promises === void 0 ? void 0 : _promises.map(function (promise) {
|
|
60
|
+
return promise();
|
|
61
|
+
}));
|
|
62
|
+
case 7:
|
|
63
|
+
setGlobalState("success");
|
|
64
|
+
_context.next = 13;
|
|
65
|
+
break;
|
|
66
|
+
case 10:
|
|
67
|
+
_context.prev = 10;
|
|
68
|
+
_context.t0 = _context["catch"](4);
|
|
69
|
+
setGlobalState("failed");
|
|
70
|
+
case 13:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context.stop();
|
|
73
|
+
}
|
|
74
|
+
}, _callee, null, [[4, 10]]);
|
|
75
|
+
}));
|
|
76
|
+
return function initDataSource() {
|
|
77
|
+
return _ref2.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
}();
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
initDataSource();
|
|
82
|
+
}, []);
|
|
83
|
+
if (globalState === "loading") {
|
|
84
|
+
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
85
|
+
active: true,
|
|
86
|
+
paragraph: {
|
|
87
|
+
rows: 8
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (globalState === "failed") {
|
|
92
|
+
return /*#__PURE__*/React.createElement(Result, {
|
|
93
|
+
status: "error",
|
|
94
|
+
title: "\u6570\u636E\u52A0\u8F7D\u5F02\u5E38,\u8BF7\u5237\u65B0\u91CD\u8BD5",
|
|
95
|
+
extra: /*#__PURE__*/React.createElement(Button, {
|
|
96
|
+
type: "primary",
|
|
97
|
+
key: "console",
|
|
98
|
+
onClick: initDataSource
|
|
99
|
+
}, "\u5237\u65B0\u91CD\u8BD5")
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
103
|
+
};
|
|
104
|
+
export default Global;
|
|
@@ -52,12 +52,13 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
|
|
|
52
52
|
});
|
|
53
53
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
54
54
|
var logisticsInterceptList = record["".concat(_this.originId, "_logisticsInterceptList")] || [];
|
|
55
|
+
console.log('renderExport', record["".concat(_this.originId, "_logisticsInterceptList")]);
|
|
55
56
|
return logisticsInterceptList.reduce(function (prv, item) {
|
|
56
57
|
var _item$interceptAddres2;
|
|
57
58
|
var addressText = (_item$interceptAddres2 = item.interceptAddress) === null || _item$interceptAddres2 === void 0 ? void 0 : _item$interceptAddres2.map(function (suffix) {
|
|
58
59
|
return _this.addressDateInstance.getNameByCode(suffix);
|
|
59
60
|
}).join('');
|
|
60
|
-
prv.push("".concat(addressText).concat(item.interceptDetail, "\n ").concat(item.interceptReceiverName, "\n ").concat(item.interceptReceiverMobile));
|
|
61
|
+
prv.push("".concat(addressText).concat(item.interceptDetail || '', "\n ").concat((item === null || item === void 0 ? void 0 : item.interceptReceiverName) || '', "\n ").concat((item === null || item === void 0 ? void 0 : item.interceptReceiverMobile) || ''));
|
|
61
62
|
return prv;
|
|
62
63
|
}, []).join(',');
|
|
63
64
|
});
|
|
@@ -38,19 +38,21 @@ var InterceptStatus = /*#__PURE__*/_createClass(function InterceptStatus(options
|
|
|
38
38
|
});
|
|
39
39
|
_defineProperty(this, "renderStatus", function (record) {
|
|
40
40
|
var w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
41
|
-
var statusList = record[_this.
|
|
41
|
+
var statusList = record["".concat(_this.parentId, "_logisticsInterceptList")] || [];
|
|
42
42
|
if (isNull(statusList)) return '--';
|
|
43
43
|
return /*#__PURE__*/React.createElement("div", null, statusList.map(function (item, index) {
|
|
44
|
+
var _this$expressIntercep;
|
|
45
|
+
var value = (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus];
|
|
44
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
45
47
|
onClick: function onClick(e) {
|
|
46
48
|
return e.stopPropagation();
|
|
47
49
|
}
|
|
48
|
-
}, "\u5305\u88F9".concat(index + 1, ":"), /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
|
|
50
|
+
}, "\u5305\u88F9".concat(index + 1, ":"), value ? /*#__PURE__*/React.createElement(React.Fragment, null, value, /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
|
|
49
51
|
modelWidth: w,
|
|
50
52
|
interceptCompany: item.interceptCompany,
|
|
51
53
|
interceptCode: item.interceptCode,
|
|
52
54
|
interceptSenderMobile: item.interceptSenderMobile
|
|
53
|
-
}));
|
|
55
|
+
})) : '--');
|
|
54
56
|
}));
|
|
55
57
|
});
|
|
56
58
|
_defineProperty(this, "renderClient", function () {
|
|
@@ -107,10 +107,10 @@ var LogisticsMoreTrajectory = /*#__PURE__*/_createClass(function LogisticsMoreTr
|
|
|
107
107
|
var hasNoCode = value.some(function (item) {
|
|
108
108
|
return !item.trajectoryCode;
|
|
109
109
|
});
|
|
110
|
-
if (
|
|
110
|
+
if (hasNoCompany) {
|
|
111
111
|
return Promise.reject(new Error("请选择物流公司"));
|
|
112
112
|
}
|
|
113
|
-
if (
|
|
113
|
+
if (hasNoCode) {
|
|
114
114
|
return Promise.reject(new Error("请输入物流单号"));
|
|
115
115
|
}
|
|
116
116
|
return Promise.resolve();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
3
|
declare class BasicMultSelect implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -11,8 +11,8 @@ declare class BasicMultSelect implements ComponentInterface {
|
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
13
13
|
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface[
|
|
15
|
-
options: ComponentInterface[
|
|
14
|
+
dataType: ComponentInterface["dataType"];
|
|
15
|
+
options: ComponentInterface["options"];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
17
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -6,12 +6,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
6
6
|
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; }
|
|
7
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
-
import React from
|
|
10
|
-
import intersection from
|
|
11
|
-
import { ApaasMultipleSelect } from
|
|
9
|
+
import React from "react";
|
|
10
|
+
import intersection from "lodash/intersection";
|
|
11
|
+
import { ApaasMultipleSelect } from "@kmkf-fe-packages/basic-components";
|
|
12
12
|
import GetFormItem from "../GetFormItem";
|
|
13
13
|
import ItemView from "../../commonComponents/ItemView";
|
|
14
|
-
import { isNull, filterFn as _filterFn } from
|
|
14
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
15
|
import { SYMBOL } from "../../constant";
|
|
16
16
|
var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options) {
|
|
17
17
|
var _this = this,
|
|
@@ -34,15 +34,15 @@ var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options
|
|
|
34
34
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
35
35
|
id: _this.id,
|
|
36
36
|
label: _this.name,
|
|
37
|
-
value: record === null || record === void 0 ? void 0 : (_record$_this$id = record[_this.id]) === null || _record$_this$id === void 0 ? void 0 : _record$_this$id.join(
|
|
37
|
+
value: record === null || record === void 0 ? void 0 : (_record$_this$id = record[_this.id]) === null || _record$_this$id === void 0 ? void 0 : _record$_this$id.join(",")
|
|
38
38
|
}) : null;
|
|
39
39
|
});
|
|
40
40
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
41
41
|
var _record;
|
|
42
|
-
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")])
|
|
42
|
+
if (isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")])) {
|
|
43
43
|
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
44
44
|
}
|
|
45
|
-
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_basicMultSelect")]) === null || _record === void 0 ? void 0 : _record.join(
|
|
45
|
+
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_basicMultSelect")]) === null || _record === void 0 ? void 0 : _record.join(","));
|
|
46
46
|
});
|
|
47
47
|
_defineProperty(this, "renderLog", function (r) {
|
|
48
48
|
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_basicMultSelect")])) return null;
|
|
@@ -53,10 +53,10 @@ var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options
|
|
|
53
53
|
});
|
|
54
54
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
55
55
|
var _record2;
|
|
56
|
-
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")])
|
|
57
|
-
return
|
|
56
|
+
if (isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_basicMultSelect")])) {
|
|
57
|
+
return "--";
|
|
58
58
|
}
|
|
59
|
-
return record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id, "_basicMultSelect")]) === null || _record2 === void 0 ? void 0 : _record2.join(
|
|
59
|
+
return record === null || record === void 0 ? void 0 : (_record2 = record["".concat(_this.id, "_basicMultSelect")]) === null || _record2 === void 0 ? void 0 : _record2.join(",");
|
|
60
60
|
});
|
|
61
61
|
_defineProperty(this, "editRender", function (p) {
|
|
62
62
|
var _this$componentConfig, _this$componentConfig2;
|
|
@@ -81,13 +81,13 @@ var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options
|
|
|
81
81
|
// 过滤组件id
|
|
82
82
|
name: item.name,
|
|
83
83
|
// 过滤组件名称
|
|
84
|
-
filterComponentType:
|
|
84
|
+
filterComponentType: "MultipleSelect",
|
|
85
85
|
props: {
|
|
86
86
|
options: (item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.options) || []
|
|
87
87
|
},
|
|
88
88
|
filterFn: function filterFn(value) {
|
|
89
89
|
return function (i) {
|
|
90
|
-
return intersection(value, _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
90
|
+
return intersection(value, _filterFn.filterTableListItemColumnValue(i, item.id, "basicMultSelect")).length > 0;
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
};
|
|
@@ -102,7 +102,7 @@ var BasicMultSelect = /*#__PURE__*/_createClass(function BasicMultSelect(options
|
|
|
102
102
|
this.isCombinationComponent = false;
|
|
103
103
|
this.canSort = true;
|
|
104
104
|
this.children = [];
|
|
105
|
-
this.dataType =
|
|
105
|
+
this.dataType = "array";
|
|
106
106
|
this.options = ((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.options) || [];
|
|
107
107
|
});
|
|
108
108
|
export default BasicMultSelect;
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, 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, WdtGoods, CommonInput, PaymentVoucherCode } 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) => BuyerNick | CommonInput | LogisticsMoreInterception | LogisticsMoreTrajectory | BasicMultSelect | PaymentVoucherCode | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | MsgStatus | WdtGoods;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -81,3 +81,4 @@ export { default as PlatBuyer } from "./commonComponents/PlatBuyer";
|
|
|
81
81
|
export { default as ShopList } from "./commonComponents/ShopList";
|
|
82
82
|
export { default as OperationLog } from "./commonComponents/OperationLog";
|
|
83
83
|
export { default as GetFormItem } from "./components/GetFormItem";
|
|
84
|
+
export { default as Global } from "./commonComponents/GlobalContext";
|
package/dist/esm/index.js
CHANGED
|
@@ -80,4 +80,5 @@ export { default as SelectMark } from "./commonComponents/SelectMark";
|
|
|
80
80
|
export { default as PlatBuyer } from "./commonComponents/PlatBuyer";
|
|
81
81
|
export { default as ShopList } from "./commonComponents/ShopList";
|
|
82
82
|
export { default as OperationLog } from "./commonComponents/OperationLog";
|
|
83
|
-
export { default as GetFormItem } from "./components/GetFormItem";
|
|
83
|
+
export { default as GetFormItem } from "./components/GetFormItem";
|
|
84
|
+
export { default as Global } from "./commonComponents/GlobalContext";
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export declare const replaceCheck: (data: any) => Promise<any>;
|
|
2
2
|
export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
|
|
3
|
+
export declare const queryAddressData: () => Promise<void>;
|
|
4
|
+
export declare const queryBsAddressData: () => Promise<void>;
|
|
5
|
+
export declare const queryWdtAddressData: () => Promise<void>;
|
|
6
|
+
export declare const queryPlatData: () => Promise<void>;
|
|
7
|
+
export declare const queryExpressInterceptData: () => Promise<void>;
|
|
8
|
+
export declare const queryLogisticsAddressData: () => Promise<void>;
|
|
9
|
+
export declare const queryAllLogisticsCompany: () => Promise<void>;
|
package/dist/esm/service/api.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
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); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
14
|
+
import get from 'lodash/get';
|
|
1
15
|
import request from "./request";
|
|
2
16
|
// 重复校验
|
|
3
17
|
export var replaceCheck = function replaceCheck(data) {
|
|
@@ -14,4 +28,231 @@ export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
|
|
|
14
28
|
method: 'post',
|
|
15
29
|
data: data
|
|
16
30
|
});
|
|
31
|
+
};
|
|
32
|
+
export var queryAddressData = function queryAddressData() {
|
|
33
|
+
return request({
|
|
34
|
+
url: "/qy/gdfw/template/queryAreas/noLogin",
|
|
35
|
+
method: "get",
|
|
36
|
+
data: {}
|
|
37
|
+
}).then(function (resp) {
|
|
38
|
+
var map = {};
|
|
39
|
+
var res = {};
|
|
40
|
+
var list = resp.data;
|
|
41
|
+
for (var i = 0; i < list.length; i++) {
|
|
42
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
43
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
44
|
+
}
|
|
45
|
+
var instance = AddressData.getInstance();
|
|
46
|
+
instance.addrData = res;
|
|
47
|
+
instance.addrNameMap = map;
|
|
48
|
+
instance.addressOptions = get(toTree(list, 0), '0.children', []);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export var queryBsAddressData = function queryBsAddressData() {
|
|
52
|
+
return request({
|
|
53
|
+
url: "/qy/gdfw/template/queryBsAreas/noLogin",
|
|
54
|
+
method: "get",
|
|
55
|
+
data: {}
|
|
56
|
+
}).then(function (resp) {
|
|
57
|
+
var map = {};
|
|
58
|
+
var res = {};
|
|
59
|
+
var _resp$data = resp.data,
|
|
60
|
+
list = _resp$data === void 0 ? [] : _resp$data;
|
|
61
|
+
for (var i = 0; i < list.length; i++) {
|
|
62
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
63
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
64
|
+
}
|
|
65
|
+
var instance = BsAddressData.getInstance();
|
|
66
|
+
instance.addrData = res;
|
|
67
|
+
instance.addrNameMap = map;
|
|
68
|
+
instance.addressOptions = toTree(list, 1);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export var queryWdtAddressData = function queryWdtAddressData() {
|
|
72
|
+
return request({
|
|
73
|
+
url: "/qy/gdfw/template/queryWdtAreas/noLogin",
|
|
74
|
+
method: "get",
|
|
75
|
+
data: {}
|
|
76
|
+
}).then(function (resp) {
|
|
77
|
+
var map = {};
|
|
78
|
+
var res = {};
|
|
79
|
+
var _resp$data2 = resp.data,
|
|
80
|
+
list = _resp$data2 === void 0 ? [] : _resp$data2;
|
|
81
|
+
for (var i = 0; i < list.length; i++) {
|
|
82
|
+
res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
|
|
83
|
+
map[list[i]["name"]] = list[i]["id"];
|
|
84
|
+
}
|
|
85
|
+
var instance = WdtAddressData.getInstance();
|
|
86
|
+
instance.addrData = res;
|
|
87
|
+
instance.addrNameMap = map;
|
|
88
|
+
instance.addressOptions = toTree(list, 1);
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
export var queryPlatData = function queryPlatData() {
|
|
92
|
+
return request({
|
|
93
|
+
url: "/qy/platform/listPlatform/noLogin",
|
|
94
|
+
method: "get",
|
|
95
|
+
data: {}
|
|
96
|
+
}).then(function (res) {
|
|
97
|
+
if (res.success) {
|
|
98
|
+
var platType = res.data || {};
|
|
99
|
+
platType.alreadyJoinedList = platType.alreadyJoinedList || [];
|
|
100
|
+
platType.notJoinList = platType.notJoinList || [];
|
|
101
|
+
var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
|
|
102
|
+
var instance = PlatData.getInstance();
|
|
103
|
+
instance.platTypeList = list;
|
|
104
|
+
var platMap = list === null || list === void 0 ? void 0 : list.reduce(function (cur, nxt) {
|
|
105
|
+
cur[nxt.platformType] = nxt.platformName;
|
|
106
|
+
return cur;
|
|
107
|
+
}, {});
|
|
108
|
+
instance.platMap = platMap;
|
|
109
|
+
var platSelectList = list.map(function (p) {
|
|
110
|
+
return {
|
|
111
|
+
label: p.platformName,
|
|
112
|
+
value: p.platformType
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
instance.platSelectList = platSelectList;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export var queryExpressInterceptData = function queryExpressInterceptData() {
|
|
120
|
+
return request({
|
|
121
|
+
url: '/qy/logistics/listLogisticsWithInterceptInfo/noLogin',
|
|
122
|
+
method: 'get',
|
|
123
|
+
data: {
|
|
124
|
+
platformType: 118
|
|
125
|
+
}
|
|
126
|
+
}).then(function (res) {
|
|
127
|
+
var data = res.data;
|
|
128
|
+
var instance = ExpressInterceptData.getInstance();
|
|
129
|
+
var companyTypeMap = {
|
|
130
|
+
SF: '顺丰',
|
|
131
|
+
ZTO: '中通',
|
|
132
|
+
JT: '极兔',
|
|
133
|
+
DEFAULT: ''
|
|
134
|
+
};
|
|
135
|
+
var expressList = data.map(function (item) {
|
|
136
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
137
|
+
label: item.name,
|
|
138
|
+
value: item.cpCode
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
instance.expressData = expressList;
|
|
142
|
+
var showBtn = {},
|
|
143
|
+
showSender = {},
|
|
144
|
+
showAddress = {},
|
|
145
|
+
showReturnAddress = {},
|
|
146
|
+
typeMap = {},
|
|
147
|
+
statusMap = {},
|
|
148
|
+
typeObj = {},
|
|
149
|
+
statusObj = {};
|
|
150
|
+
expressList.forEach(function (item) {
|
|
151
|
+
var _item$logisticsStatus, _item$interceptionTyp;
|
|
152
|
+
if (item !== null && item !== void 0 && (_item$logisticsStatus = item.logisticsStatusList) !== null && _item$logisticsStatus !== void 0 && _item$logisticsStatus.length) {
|
|
153
|
+
item.logisticsStatusList.forEach(function (t) {
|
|
154
|
+
statusMap["".concat(t.value)] = t.label;
|
|
155
|
+
if (statusObj[t.label]) {
|
|
156
|
+
statusObj[t.label] = statusObj[t.label].add(t.value);
|
|
157
|
+
} else {
|
|
158
|
+
statusObj[t.label] = new Set([t.value]);
|
|
159
|
+
}
|
|
160
|
+
//todo 取消拦截按钮
|
|
161
|
+
if (t !== null && t !== void 0 && t.showInterceptionBtn) {
|
|
162
|
+
showBtn["".concat(t.value)] = true;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (item !== null && item !== void 0 && (_item$interceptionTyp = item.interceptionTypeList) !== null && _item$interceptionTyp !== void 0 && _item$interceptionTyp.length) {
|
|
167
|
+
item.interceptionTypeList.forEach(function (t) {
|
|
168
|
+
var _t$config, _t$config2, _t$config3;
|
|
169
|
+
typeMap["".concat(t.value)] = t.label;
|
|
170
|
+
if (typeObj[t.label]) {
|
|
171
|
+
typeObj[t.label] = typeObj[t.label].add(t.value);
|
|
172
|
+
} else {
|
|
173
|
+
typeObj[t.label] = new Set([t.value]);
|
|
174
|
+
}
|
|
175
|
+
if (t !== null && t !== void 0 && (_t$config = t.config) !== null && _t$config !== void 0 && _t$config.showAddress) {
|
|
176
|
+
showAddress["".concat(t.value)] = true;
|
|
177
|
+
}
|
|
178
|
+
if (t !== null && t !== void 0 && (_t$config2 = t.config) !== null && _t$config2 !== void 0 && _t$config2.showAddressSelect) {
|
|
179
|
+
showReturnAddress["".concat(t.value)] = true;
|
|
180
|
+
}
|
|
181
|
+
if (t !== null && t !== void 0 && (_t$config3 = t.config) !== null && _t$config3 !== void 0 && _t$config3.showSenderMobile) {
|
|
182
|
+
showSender["".concat(t.value)] = true;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
instance.showInterceptionMap = showBtn;
|
|
188
|
+
instance.typeNameMap = typeMap;
|
|
189
|
+
instance.statusNameMap = statusMap;
|
|
190
|
+
instance.showNewAddressMap = showAddress;
|
|
191
|
+
instance.showReturnAddressMap = showReturnAddress;
|
|
192
|
+
instance.showSenderMobileMap = showSender;
|
|
193
|
+
instance.typeOptions = Object.keys(typeObj).map(function (key) {
|
|
194
|
+
return {
|
|
195
|
+
label: key,
|
|
196
|
+
value: _toConsumableArray(typeObj[key]).join(',')
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
instance.typeConditionOptions = Object.keys(instance.typeNameMap).map(function (key) {
|
|
200
|
+
var type = key.split('|')[0];
|
|
201
|
+
return {
|
|
202
|
+
label: "".concat(companyTypeMap[type] || '').concat(instance.typeNameMap[key]),
|
|
203
|
+
value: key
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
instance.statusOptions = Object.keys(statusObj).map(function (key) {
|
|
207
|
+
return {
|
|
208
|
+
label: key,
|
|
209
|
+
value: _toConsumableArray(statusObj[key]).join(',')
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
var tempList = [];
|
|
213
|
+
var tempObj = {};
|
|
214
|
+
Object.keys(instance.statusNameMap).forEach(function (key) {
|
|
215
|
+
var type = key.split('|')[1];
|
|
216
|
+
if (!tempObj[type]) {
|
|
217
|
+
tempList.push({
|
|
218
|
+
label: instance.statusNameMap[key],
|
|
219
|
+
value: type
|
|
220
|
+
});
|
|
221
|
+
tempObj[type] = instance.statusNameMap[key];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
instance.statusConditionOptions = tempList;
|
|
225
|
+
}).catch(function (e) {
|
|
226
|
+
console.log(e);
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
export var queryLogisticsAddressData = function queryLogisticsAddressData() {
|
|
230
|
+
return request({
|
|
231
|
+
url: "/qy/userConfig/listLogisticsAddress",
|
|
232
|
+
method: "get",
|
|
233
|
+
data: {}
|
|
234
|
+
}).then(function (res) {
|
|
235
|
+
var data = res.data;
|
|
236
|
+
var instance = LogisticsAddressData.getInstance();
|
|
237
|
+
instance.addressData = data;
|
|
238
|
+
}).catch(function (e) {
|
|
239
|
+
console.log(e);
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
export var queryAllLogisticsCompany = function queryAllLogisticsCompany() {
|
|
243
|
+
return request({
|
|
244
|
+
url: "/qy/logistics/company/getAllLogisticsCompany/noLogin",
|
|
245
|
+
method: "get",
|
|
246
|
+
data: {}
|
|
247
|
+
}).then(function (res) {
|
|
248
|
+
var data = res.data;
|
|
249
|
+
var instance = ExpressData.getInstance();
|
|
250
|
+
var expressList = data.logisticsCompanyDtoList.map(function (item) {
|
|
251
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
252
|
+
label: item.name,
|
|
253
|
+
value: item.cpCode
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
instance.expressData = expressList;
|
|
257
|
+
});
|
|
17
258
|
};
|
|
@@ -13,7 +13,15 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
13
13
|
*/
|
|
14
14
|
import { extend } from 'umi-request';
|
|
15
15
|
import { message } from 'antd';
|
|
16
|
-
var request = extend({
|
|
16
|
+
var request = extend({
|
|
17
|
+
useCache: true,
|
|
18
|
+
ttl: 24 * 3600 * 1000,
|
|
19
|
+
// 缓存1天
|
|
20
|
+
validateCache: function validateCache(url, options) {
|
|
21
|
+
var _options$method;
|
|
22
|
+
return (options === null || options === void 0 ? void 0 : (_options$method = options.method) === null || _options$method === void 0 ? void 0 : _options$method.toLowerCase()) === 'get';
|
|
23
|
+
}
|
|
24
|
+
});
|
|
17
25
|
var requestApi = function requestApi(_ref) {
|
|
18
26
|
var url = _ref.url,
|
|
19
27
|
method = _ref.method,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.26.1-beta.
|
|
3
|
+
"version": "0.26.1-beta.11",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/basic-components": "^0.26.1-beta.
|
|
24
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.26.1-beta.
|
|
23
|
+
"@kmkf-fe-packages/basic-components": "^0.26.1-beta.11",
|
|
24
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.26.1-beta.11"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "16d58155a74ffcd52ad2e65535cf1f63e4ff789c",
|
|
41
41
|
"gitHooks": {
|
|
42
42
|
"pre-commit": "lint-staged"
|
|
43
43
|
}
|