@kmkf-fe-packages/services-components 2.0.62 → 2.0.63
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.js +17 -3
- package/dist/esm/commonComponents/GlobalContext/orderQuery/constants.d.ts +5 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/constants.js +8 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetRequest.d.ts +3 -0
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetRequest.js +80 -0
- package/dist/esm/components/LogisticsInterception/index.js +16 -8
- package/dist/esm/components/LogisticsMoreInterception/index.js +26 -15
- package/dist/esm/components/WDT/WdtShopSelect/index.d.ts +40 -0
- package/dist/esm/components/WDT/WdtShopSelect/index.js +122 -0
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +3 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/type.d.ts +13 -13
- package/package.json +4 -4
|
@@ -20,6 +20,7 @@ import { servers, SendDataCenter } from "@kmkf-fe-packages/kmkf-utils";
|
|
|
20
20
|
import useGetErpLogisticsCompany from "./orderQuery/useGetErpLogisticsCompany";
|
|
21
21
|
import useGetErpSendData from "./orderQuery/useGetErpSendData";
|
|
22
22
|
import useGetErpAddressData from "./orderQuery/useGetErpAddressData";
|
|
23
|
+
import useGetRequest from "./orderQuery/useGetRequest";
|
|
23
24
|
/**
|
|
24
25
|
* 尽量不要直接使用redux,飞鸽项目redux并不会读取最近的store数据,使用redux会有问题,暂时使用从外部传入redux数据的方式
|
|
25
26
|
* **/
|
|
@@ -71,12 +72,17 @@ var Global = function Global(_ref) {
|
|
|
71
72
|
_useGetErpAddressData2 = _slicedToArray(_useGetErpAddressData, 2),
|
|
72
73
|
addressDataState = _useGetErpAddressData2[0],
|
|
73
74
|
reloadGetErpAddressData = _useGetErpAddressData2[1];
|
|
75
|
+
//获取Erp地址数据
|
|
76
|
+
var _useGetRequest = useGetRequest(reduxDataMap, notJudgedErp),
|
|
77
|
+
_useGetRequest2 = _slicedToArray(_useGetRequest, 2),
|
|
78
|
+
requestState = _useGetRequest2[0],
|
|
79
|
+
reloadGetRequest = _useGetRequest2[1];
|
|
74
80
|
var allState = useMemo(function () {
|
|
75
|
-
var allStateList = [globalState, logisticsCompanyState, sendDataState, addressDataState];
|
|
81
|
+
var allStateList = [globalState, logisticsCompanyState, sendDataState, addressDataState, requestState];
|
|
76
82
|
if (allStateList.includes("loading")) return "loading";
|
|
77
83
|
if (allStateList.includes("failed")) return "failed";
|
|
78
84
|
return "success";
|
|
79
|
-
}, [globalState, logisticsCompanyState, sendDataState, addressDataState]);
|
|
85
|
+
}, [globalState, logisticsCompanyState, sendDataState, addressDataState, requestState]);
|
|
80
86
|
var reloadData = /*#__PURE__*/function () {
|
|
81
87
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
82
88
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -115,9 +121,17 @@ var Global = function Global(_ref) {
|
|
|
115
121
|
_context.next = 17;
|
|
116
122
|
return reloadGetErpAddressData();
|
|
117
123
|
case 17:
|
|
124
|
+
_context.t4 = requestState === "failed";
|
|
125
|
+
if (!_context.t4) {
|
|
126
|
+
_context.next = 21;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
_context.next = 21;
|
|
130
|
+
return reloadGetRequest();
|
|
131
|
+
case 21:
|
|
118
132
|
setLoading(false);
|
|
119
133
|
message.success("刷新完成");
|
|
120
|
-
case
|
|
134
|
+
case 23:
|
|
121
135
|
case "end":
|
|
122
136
|
return _context.stop();
|
|
123
137
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { useEffect, useState } from "react";
|
|
12
|
+
import useGetHasErpData from "../hook/useGetHasErpData";
|
|
13
|
+
import { requestList, erpMap } from "./constants";
|
|
14
|
+
function useGetRequest(reduxData, notJudgedErp) {
|
|
15
|
+
var _useState = useState("loading"),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
globalState = _useState2[0],
|
|
18
|
+
setGlobalState = _useState2[1];
|
|
19
|
+
var hasErpData = useGetHasErpData(reduxData);
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
asyncQueryData(hasErpData, notJudgedErp);
|
|
22
|
+
}, [hasErpData, notJudgedErp]);
|
|
23
|
+
var asyncQueryData = /*#__PURE__*/function () {
|
|
24
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp, isReload) {
|
|
25
|
+
var promises;
|
|
26
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
if (!isReload) {
|
|
30
|
+
setGlobalState("loading");
|
|
31
|
+
}
|
|
32
|
+
_context.prev = 1;
|
|
33
|
+
promises = [];
|
|
34
|
+
requestList.map(function (item) {
|
|
35
|
+
if (hasErpData[erpMap[item.erp]] || notJudgedErp) {
|
|
36
|
+
promises.push(item.request);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
_context.next = 6;
|
|
40
|
+
return Promise.all(promises.map(function (promise) {
|
|
41
|
+
return promise();
|
|
42
|
+
}));
|
|
43
|
+
case 6:
|
|
44
|
+
setGlobalState("success");
|
|
45
|
+
_context.next = 12;
|
|
46
|
+
break;
|
|
47
|
+
case 9:
|
|
48
|
+
_context.prev = 9;
|
|
49
|
+
_context.t0 = _context["catch"](1);
|
|
50
|
+
setGlobalState("failed");
|
|
51
|
+
case 12:
|
|
52
|
+
case "end":
|
|
53
|
+
return _context.stop();
|
|
54
|
+
}
|
|
55
|
+
}, _callee, null, [[1, 9]]);
|
|
56
|
+
}));
|
|
57
|
+
return function asyncQueryData(_x2, _x3, _x4) {
|
|
58
|
+
return _ref.apply(this, arguments);
|
|
59
|
+
};
|
|
60
|
+
}();
|
|
61
|
+
var onReload = /*#__PURE__*/function () {
|
|
62
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
63
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
64
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
65
|
+
case 0:
|
|
66
|
+
_context2.next = 2;
|
|
67
|
+
return asyncQueryData(hasErpData, notJudgedErp, true);
|
|
68
|
+
case 2:
|
|
69
|
+
case "end":
|
|
70
|
+
return _context2.stop();
|
|
71
|
+
}
|
|
72
|
+
}, _callee2);
|
|
73
|
+
}));
|
|
74
|
+
return function onReload() {
|
|
75
|
+
return _ref2.apply(this, arguments);
|
|
76
|
+
};
|
|
77
|
+
}();
|
|
78
|
+
return [globalState, onReload];
|
|
79
|
+
}
|
|
80
|
+
export default useGetRequest;
|
|
@@ -159,7 +159,7 @@ function Logistics(options) {
|
|
|
159
159
|
|
|
160
160
|
this.rules = [{
|
|
161
161
|
validator: function validator(_, value) {
|
|
162
|
-
var _this$componentConfig5, _this$componentConfig6, _value$interceptAddre
|
|
162
|
+
var _this$componentConfig5, _this$componentConfig6, _value$interceptAddre;
|
|
163
163
|
if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && (!(value !== null && value !== void 0 && value.interceptCompany) || !value.interceptCode)) {
|
|
164
164
|
return Promise.reject(new Error("请填写物流信息"));
|
|
165
165
|
}
|
|
@@ -170,13 +170,21 @@ function Logistics(options) {
|
|
|
170
170
|
if (showAddress && (!(value !== null && value !== void 0 && (_value$interceptAddre = value.interceptAddress) !== null && _value$interceptAddre !== void 0 && _value$interceptAddre.length) || !(value !== null && value !== void 0 && value.interceptDetail) || !(value !== null && value !== void 0 && value.interceptReceiverName) || !(value !== null && value !== void 0 && value.interceptReceiverMobile))) {
|
|
171
171
|
return Promise.reject(new Error("请填写派送地址"));
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
|
|
174
|
+
// const showSender =
|
|
175
|
+
// this.expressInterceptData.getShowSenderMobileMap()[
|
|
176
|
+
// `${value?.interceptType}`
|
|
177
|
+
// ];
|
|
178
|
+
// if (showSender && !value?.interceptSenderMobile) {
|
|
179
|
+
// return Promise.reject(new Error("请填写发件人手机号"));
|
|
180
|
+
// }
|
|
181
|
+
// if (
|
|
182
|
+
// showSender &&
|
|
183
|
+
// value?.interceptSenderMobile &&
|
|
184
|
+
// !value?.interceptSenderMobile?.match(/^[1][0-9]{10}$/)
|
|
185
|
+
// ) {
|
|
186
|
+
// return Promise.reject(new Error("请填写正确的发件人手机号"));
|
|
187
|
+
// }
|
|
180
188
|
return Promise.resolve();
|
|
181
189
|
}
|
|
182
190
|
}];
|
|
@@ -188,21 +188,32 @@ function Logistics(options) {
|
|
|
188
188
|
if (hasNoAddress) {
|
|
189
189
|
return Promise.reject(new Error("\u8BF7\u586B\u5199\u6D3E\u9001\u5730\u5740"));
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
191
|
+
|
|
192
|
+
// const hasNoSender = value.some((t: any) => {
|
|
193
|
+
// const showSender =
|
|
194
|
+
// this.expressInterceptData.getShowSenderMobileMap()[
|
|
195
|
+
// `${t?.interceptType}`
|
|
196
|
+
// ];
|
|
197
|
+
// return showSender && !t?.interceptSenderMobile;
|
|
198
|
+
// });
|
|
199
|
+
// if (hasNoSender) {
|
|
200
|
+
// return Promise.reject(new Error(`请填写发件人手机号`));
|
|
201
|
+
// }
|
|
202
|
+
// const hasErrorSender = value.some((t: any) => {
|
|
203
|
+
// const showSender =
|
|
204
|
+
// this.expressInterceptData.getShowSenderMobileMap()[
|
|
205
|
+
// `${t?.interceptType}`
|
|
206
|
+
// ];
|
|
207
|
+
// return (
|
|
208
|
+
// showSender &&
|
|
209
|
+
// t?.interceptSenderMobile &&
|
|
210
|
+
// !t?.interceptSenderMobile?.match(/^[1][0-9]{10}$/)
|
|
211
|
+
// );
|
|
212
|
+
// });
|
|
213
|
+
// if (hasErrorSender) {
|
|
214
|
+
// return Promise.reject(new Error(`请填写正确的发件人手机号`));
|
|
215
|
+
// }
|
|
216
|
+
|
|
206
217
|
return Promise.resolve();
|
|
207
218
|
}
|
|
208
219
|
}] : [];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class WdtShopSelect implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
rules: any[];
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
+
isCombinationComponent: boolean;
|
|
11
|
+
formField: string;
|
|
12
|
+
canSort: boolean;
|
|
13
|
+
children: ComponentInterface[];
|
|
14
|
+
shopDateInstance: InstanceType<any>;
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
options: ComponentInterface["options"];
|
|
17
|
+
optionsMap: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
constructor(options: PickOption);
|
|
21
|
+
editRender: (p: any) => React.JSX.Element;
|
|
22
|
+
getLabel: (record: any) => string;
|
|
23
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
24
|
+
renderPc: (value: unknown, record: Record) => string;
|
|
25
|
+
renderLog: (r: Record) => string | null;
|
|
26
|
+
getComponentValue: (r: Record) => string;
|
|
27
|
+
renderExport: (value: string, record: Record) => string;
|
|
28
|
+
filterConfig: (item: ColumnConfig) => {
|
|
29
|
+
searchDefaultConditions: "in";
|
|
30
|
+
type: string;
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
filterComponentType: "MultipleSelect";
|
|
34
|
+
props: {
|
|
35
|
+
options: any[] | undefined;
|
|
36
|
+
};
|
|
37
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export default WdtShopSelect;
|
|
@@ -0,0 +1,122 @@
|
|
|
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import React from "react";
|
|
12
|
+
import GetFormItem from "../../GetFormItem";
|
|
13
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
14
|
+
import { isNull, filterFn as _filterFn, WdtShopDataCenter } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
import { SYMBOL } from "../../../constant";
|
|
16
|
+
import { Select } from "antd";
|
|
17
|
+
var WdtShopSelect = /*#__PURE__*/_createClass(function WdtShopSelect(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$options;
|
|
20
|
+
_classCallCheck(this, WdtShopSelect);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "sortField", void 0);
|
|
24
|
+
_defineProperty(this, "type", void 0);
|
|
25
|
+
_defineProperty(this, "rules", void 0);
|
|
26
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
27
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
28
|
+
_defineProperty(this, "formField", void 0);
|
|
29
|
+
_defineProperty(this, "canSort", void 0);
|
|
30
|
+
_defineProperty(this, "children", void 0);
|
|
31
|
+
_defineProperty(this, "shopDateInstance", void 0);
|
|
32
|
+
_defineProperty(this, "dataType", void 0);
|
|
33
|
+
_defineProperty(this, "options", void 0);
|
|
34
|
+
_defineProperty(this, "optionsMap", void 0);
|
|
35
|
+
_defineProperty(this, "editRender", function (p) {
|
|
36
|
+
var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
|
|
37
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
38
|
+
title: _this.name,
|
|
39
|
+
name: _this.id,
|
|
40
|
+
rules: _this.rules,
|
|
41
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
42
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
43
|
+
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,
|
|
44
|
+
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 : "",
|
|
45
|
+
component: /*#__PURE__*/React.createElement(Select, _extends({}, _this.componentConfig, {
|
|
46
|
+
style: {
|
|
47
|
+
width: 200
|
|
48
|
+
},
|
|
49
|
+
placeholder: "\u8BF7\u9009\u62E9".concat(_this.name),
|
|
50
|
+
options: _this.options,
|
|
51
|
+
showSearch: true,
|
|
52
|
+
filterOption: function filterOption(input, option) {
|
|
53
|
+
return option.label.includes(input);
|
|
54
|
+
}
|
|
55
|
+
}))
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
_defineProperty(this, "getLabel", function (record) {
|
|
59
|
+
var _this$optionsMap;
|
|
60
|
+
return (_this$optionsMap = _this.optionsMap) === null || _this$optionsMap === void 0 ? void 0 : _this$optionsMap[record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_shopCode")]];
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
63
|
+
return !isNull(_this.getLabel(record)) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
64
|
+
id: _this.id,
|
|
65
|
+
label: _this.name,
|
|
66
|
+
value: _this.getLabel(record)
|
|
67
|
+
}) : null;
|
|
68
|
+
});
|
|
69
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
70
|
+
return _this.getLabel(record) ? _this.getLabel(record) : "--";
|
|
71
|
+
});
|
|
72
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
73
|
+
if (isNull(_this.getLabel(r))) return null;
|
|
74
|
+
return _this.renderPc(undefined, r);
|
|
75
|
+
});
|
|
76
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
77
|
+
return _this.getLabel(r);
|
|
78
|
+
});
|
|
79
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
80
|
+
var _this$getLabel;
|
|
81
|
+
return (_this$getLabel = _this.getLabel(record)) !== null && _this$getLabel !== void 0 ? _this$getLabel : "--";
|
|
82
|
+
});
|
|
83
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
84
|
+
return {
|
|
85
|
+
searchDefaultConditions: SYMBOL.in,
|
|
86
|
+
type: item.type,
|
|
87
|
+
id: "".concat(item.id, "_shopCode"),
|
|
88
|
+
// 过滤组件id
|
|
89
|
+
name: item.name,
|
|
90
|
+
// 过滤组件名称
|
|
91
|
+
filterComponentType: "MultipleSelect",
|
|
92
|
+
props: {
|
|
93
|
+
options: _this.options
|
|
94
|
+
},
|
|
95
|
+
filterFn: function filterFn(value) {
|
|
96
|
+
return function (i) {
|
|
97
|
+
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, "shopCode"));
|
|
98
|
+
};
|
|
99
|
+
} // 第一个为选中值,第二个参数为表格行记录值
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
this.name = options.name;
|
|
103
|
+
this.id = options.id;
|
|
104
|
+
this.sortField = "".concat(options.id, "_shopCode");
|
|
105
|
+
this.formField = "".concat(options.id, "_shopCode");
|
|
106
|
+
this.type = options.type;
|
|
107
|
+
this.rules = [];
|
|
108
|
+
this.isCombinationComponent = false;
|
|
109
|
+
this.canSort = false;
|
|
110
|
+
this.children = [];
|
|
111
|
+
this.shopDateInstance = WdtShopDataCenter.getInstance();
|
|
112
|
+
this.options = this.shopDateInstance.getShopData();
|
|
113
|
+
this.optionsMap = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.reduce(function (acc, cur) {
|
|
114
|
+
acc[cur.value] = cur.label;
|
|
115
|
+
return acc;
|
|
116
|
+
}, {});
|
|
117
|
+
this.componentConfig = _objectSpread(_objectSpread({}, options.componentConfig), {}, {
|
|
118
|
+
options: this.options
|
|
119
|
+
});
|
|
120
|
+
this.dataType = "string";
|
|
121
|
+
});
|
|
122
|
+
export default WdtShopSelect;
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, 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, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect } from "./index";
|
|
1
|
+
import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, 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, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect } 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) => LogisticsInterception | LogisticsMoreInterception | WdtShopSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | 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 | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn | AsyncSelect;
|
package/dist/esm/factory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, 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,
|
|
2
2
|
// CommonTradeId,
|
|
3
|
-
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect } from "./index";
|
|
3
|
+
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn, AsyncSelect, WdtShopSelect } from "./index";
|
|
4
4
|
export var factory = function factory(type, options) {
|
|
5
5
|
var _options$componentCon;
|
|
6
6
|
switch (type) {
|
|
@@ -263,6 +263,8 @@ export var factory = function factory(type, options) {
|
|
|
263
263
|
return new AfterSalesOrderId(options);
|
|
264
264
|
case "MEMBER_LEVEL":
|
|
265
265
|
return new MemberLevel(options);
|
|
266
|
+
case "WDT_SHOP":
|
|
267
|
+
return new WdtShopSelect(options);
|
|
266
268
|
default:
|
|
267
269
|
return new BasicInput(options);
|
|
268
270
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export { default as WdtGoods } from "./components/WDT/WdtGoods";
|
|
|
84
84
|
export { default as WdtReissue } from "./components/WDT/WdtRessuie";
|
|
85
85
|
export { default as WdtReturn } from "./components/WDT/WdtReturn";
|
|
86
86
|
export { default as WdtExchange } from "./components/WDT/WdtExchange";
|
|
87
|
+
export { default as WdtShopSelect } from "./components/WDT/WdtShopSelect";
|
|
87
88
|
export { default as CommonInput } from "./components/CommonInput";
|
|
88
89
|
export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
|
|
89
90
|
export { default as Label } from "./components/Label";
|
package/dist/esm/index.js
CHANGED
|
@@ -84,6 +84,7 @@ export { default as WdtGoods } from "./components/WDT/WdtGoods";
|
|
|
84
84
|
export { default as WdtReissue } from "./components/WDT/WdtRessuie";
|
|
85
85
|
export { default as WdtReturn } from "./components/WDT/WdtReturn";
|
|
86
86
|
export { default as WdtExchange } from "./components/WDT/WdtExchange";
|
|
87
|
+
export { default as WdtShopSelect } from "./components/WDT/WdtShopSelect";
|
|
87
88
|
export { default as CommonInput } from "./components/CommonInput";
|
|
88
89
|
export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
|
|
89
90
|
export { default as Label } from "./components/Label";
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FormInstance } from
|
|
3
|
-
import { SYMBOL } from
|
|
2
|
+
import type { FormInstance } from "antd";
|
|
3
|
+
import { SYMBOL } from "./constant";
|
|
4
4
|
export declare type ShowHeaderObjType = {
|
|
5
5
|
title: string;
|
|
6
6
|
dataIndex: string;
|
|
7
7
|
show?: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare type DataType =
|
|
10
|
-
export declare type ALignType =
|
|
9
|
+
export declare type DataType = "string" | "number" | "array" | "dateArray" | "date" | "tradeId";
|
|
10
|
+
export declare type ALignType = "left" | "right" | "center";
|
|
11
11
|
export declare type QuerySymbol = keyof typeof SYMBOL;
|
|
12
12
|
export declare type Record = {
|
|
13
13
|
[props in string]: any;
|
|
@@ -53,8 +53,8 @@ export interface ComponentInterface {
|
|
|
53
53
|
rules?: any[];
|
|
54
54
|
width?: number;
|
|
55
55
|
align?: ALignType;
|
|
56
|
-
dataType:
|
|
57
|
-
format?:
|
|
56
|
+
dataType: "string" | "number" | "boolean" | "array" | "range" | "object" | "weakenArray" | "arrayObject";
|
|
57
|
+
format?: "dateTime" | "date" | "time" | "cascader" | "shopInput" | "staffGroup" | "object";
|
|
58
58
|
options?: Array<any>;
|
|
59
59
|
optionsMap?: Record;
|
|
60
60
|
templateId?: string;
|
|
@@ -99,7 +99,7 @@ export interface ComponentInterface {
|
|
|
99
99
|
/**
|
|
100
100
|
* @description 显示字段名称
|
|
101
101
|
*/
|
|
102
|
-
showField?:
|
|
102
|
+
showField?: "EXPRESS_COMPANY" | "EXPRESS_WAYBILL_CODE" | "EXPRESS_SNAPSHOT" | "all" | "bs" | "workOrder" | "logisticsCompany" | "logisticsCode" | string;
|
|
103
103
|
/**
|
|
104
104
|
* @description 是否选择SKU
|
|
105
105
|
*/
|
|
@@ -119,7 +119,7 @@ export interface ComponentInterface {
|
|
|
119
119
|
/**
|
|
120
120
|
* @description 备注状态
|
|
121
121
|
*/
|
|
122
|
-
associatedType?:
|
|
122
|
+
associatedType?: "APPEND";
|
|
123
123
|
isAssociated?: boolean;
|
|
124
124
|
isShowFlag?: boolean;
|
|
125
125
|
/**
|
|
@@ -160,7 +160,7 @@ export interface ComponentInterface {
|
|
|
160
160
|
* @description 时间初始值
|
|
161
161
|
*/
|
|
162
162
|
dateTime?: string;
|
|
163
|
-
dateType?:
|
|
163
|
+
dateType?: "DATE" | "DATE_TIME" | "DATE_RANGE" | "DATE_TIME_RANGE";
|
|
164
164
|
maxSize?: number;
|
|
165
165
|
basicGrade?: number;
|
|
166
166
|
range?: number;
|
|
@@ -275,13 +275,13 @@ export interface ComponentInterface {
|
|
|
275
275
|
getComponentValue: (r: Record) => any;
|
|
276
276
|
formDataTransform?: (r: any) => any;
|
|
277
277
|
}
|
|
278
|
-
export declare type PickOption = Pick<ComponentInterface,
|
|
278
|
+
export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey" | "platform" | "parentName" | "width" | "flowTemplateKey" | "transformValue" | "renderExport">;
|
|
279
279
|
export declare type ColumnConfig = {
|
|
280
280
|
id: string;
|
|
281
281
|
name: string;
|
|
282
282
|
type: string;
|
|
283
283
|
subKey?: string;
|
|
284
|
-
mode?:
|
|
285
|
-
config?: ComponentInterface[
|
|
286
|
-
templateConfig?: ComponentInterface[
|
|
284
|
+
mode?: "multiple";
|
|
285
|
+
config?: ComponentInterface["componentConfig"];
|
|
286
|
+
templateConfig?: ComponentInterface["componentConfig"];
|
|
287
287
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.63",
|
|
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": "2.0.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "2.0.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "2.0.63",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "2.0.63",
|
|
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": "a6618afd20337b47d38f8705307d746c73e07fdb",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|