@kmkf-fe-packages/services-components 1.7.0 → 1.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/esm/commonComponents/GlobalContext/index.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/index.js +1 -1
- package/dist/esm/components/Common/index.js +2 -2
- package/dist/esm/components/PaymentVoucherCode/Preview.d.ts +6 -0
- package/dist/esm/components/PaymentVoucherCode/Preview.js +86 -0
- package/dist/esm/components/PaymentVoucherCode/index.js +3 -4
- package/dist/esm/components/SubForm/index.d.ts +34 -0
- package/dist/esm/components/SubForm/index.js +184 -0
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +5 -4
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/type.d.ts +23 -14
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "
|
|
2
|
+
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryWdtLogisticsCompany" | "queryWdtSendData" | "queryLabel";
|
|
3
3
|
declare const Global: ({ children, requestList, repeatRequestList }: React.PropsWithChildren<{
|
|
4
4
|
requestList?: RequestType[] | undefined;
|
|
5
5
|
repeatRequestList?: Record<string, () => Promise<any>> | undefined;
|
|
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import React, { useEffect, useState } from "react";
|
|
17
17
|
import { Skeleton, Result, Button } from "antd";
|
|
18
|
-
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData,
|
|
18
|
+
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryWdtLogisticsCompany, queryWdtSendData, queryAllLogisticsCompany, queryLabel } from "../../service/api";
|
|
19
19
|
import { servers } from '@kmkf-fe-packages/kmkf-utils';
|
|
20
20
|
var Global = function Global(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
@@ -16,10 +16,10 @@ import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table, message, Ty
|
|
|
16
16
|
import React, { useState, useMemo } from "react";
|
|
17
17
|
import { ExpressData, WdtSendData } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
18
|
import { getAlipayBillReceipt } from "../../service/api";
|
|
19
|
-
import { CopyToClipboard } from
|
|
19
|
+
import { CopyToClipboard } from "react-copy-to-clipboard";
|
|
20
|
+
import CopyText from "../../commonComponents/CopyText";
|
|
20
21
|
import styles from "./index.module.less";
|
|
21
22
|
import defaultImg from "./img/default-img.png";
|
|
22
|
-
import CopyText from "../../commonComponents/CopyText";
|
|
23
23
|
var Paragraph = Typography.Paragraph;
|
|
24
24
|
export var getFormItem = function getFormItem(_ref) {
|
|
25
25
|
var name = _ref.name,
|
|
@@ -0,0 +1,86 @@
|
|
|
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 React, { useEffect, useState, useRef } from "react";
|
|
12
|
+
import { Button } from 'antd';
|
|
13
|
+
import { LoadingOutlined } from '@ant-design/icons';
|
|
14
|
+
import PDF from "react-pdf-js";
|
|
15
|
+
import { getAlipayBillReceipt } from "../../service/api";
|
|
16
|
+
var Preview = function Preview(_ref) {
|
|
17
|
+
var url = _ref.url;
|
|
18
|
+
var onDocumentComplete = function onDocumentComplete() {
|
|
19
|
+
console.log("文件加载完成");
|
|
20
|
+
};
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PDF, {
|
|
22
|
+
file: url,
|
|
23
|
+
onDocumentComplete: onDocumentComplete,
|
|
24
|
+
page: 1,
|
|
25
|
+
scale: 1
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
var OperatePreview = function OperatePreview(_ref2) {
|
|
29
|
+
var id = _ref2.id;
|
|
30
|
+
var _useState = useState(""),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
url = _useState2[0],
|
|
33
|
+
setUrl = _useState2[1];
|
|
34
|
+
var intervalRef = useRef();
|
|
35
|
+
var queryUrl = /*#__PURE__*/function () {
|
|
36
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
37
|
+
var res, data;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
if (id) {
|
|
42
|
+
_context.next = 2;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
return _context.abrupt("return");
|
|
46
|
+
case 2:
|
|
47
|
+
_context.next = 4;
|
|
48
|
+
return getAlipayBillReceipt({
|
|
49
|
+
alipayBillReceiptDetailId: id
|
|
50
|
+
});
|
|
51
|
+
case 4:
|
|
52
|
+
res = _context.sent;
|
|
53
|
+
data = res.data;
|
|
54
|
+
if (data) {
|
|
55
|
+
setUrl(data);
|
|
56
|
+
clearInterval(intervalRef.current);
|
|
57
|
+
}
|
|
58
|
+
case 7:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context.stop();
|
|
61
|
+
}
|
|
62
|
+
}, _callee);
|
|
63
|
+
}));
|
|
64
|
+
return function queryUrl(_x2) {
|
|
65
|
+
return _ref3.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
}();
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
queryUrl(id); // TODO: 先执行第一次, 后续5秒查一次
|
|
70
|
+
var timer = setInterval(function () {
|
|
71
|
+
return queryUrl(id);
|
|
72
|
+
}, 5 * 1000);
|
|
73
|
+
intervalRef.current = timer;
|
|
74
|
+
}, [id]);
|
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
style: {
|
|
77
|
+
maxHeight: '420px',
|
|
78
|
+
overflowY: 'hidden'
|
|
79
|
+
}
|
|
80
|
+
}, url ? /*#__PURE__*/React.createElement(Preview, {
|
|
81
|
+
url: url
|
|
82
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
type: "link"
|
|
84
|
+
}, " ", id, " "), /*#__PURE__*/React.createElement(LoadingOutlined, null)));
|
|
85
|
+
};
|
|
86
|
+
export default OperatePreview;
|
|
@@ -13,6 +13,7 @@ import ItemView from "../../commonComponents/ItemView";
|
|
|
13
13
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
14
|
import { SYMBOL } from "../../constant";
|
|
15
15
|
import { AlipayBill } from "../Common/index";
|
|
16
|
+
import OperatePreview from "./Preview";
|
|
16
17
|
var PaymentVoucherCode = /*#__PURE__*/_createClass(function PaymentVoucherCode(options) {
|
|
17
18
|
var _this = this;
|
|
18
19
|
_classCallCheck(this, PaymentVoucherCode);
|
|
@@ -54,13 +55,11 @@ var PaymentVoucherCode = /*#__PURE__*/_createClass(function PaymentVoucherCode(o
|
|
|
54
55
|
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_paymentVoucherCode")]) !== null && _record !== void 0 ? _record : "--";
|
|
55
56
|
});
|
|
56
57
|
_defineProperty(this, "renderClient", function (record) {
|
|
57
|
-
var _this$effects2;
|
|
58
58
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
59
59
|
id: _this.id,
|
|
60
60
|
label: _this.name,
|
|
61
|
-
value: /*#__PURE__*/React.createElement(
|
|
62
|
-
|
|
63
|
-
platform: (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.env
|
|
61
|
+
value: /*#__PURE__*/React.createElement(OperatePreview, {
|
|
62
|
+
id: record === null || record === void 0 ? void 0 : record[_this.id]
|
|
64
63
|
})
|
|
65
64
|
}) : null;
|
|
66
65
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class SubForm 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
|
+
dataType: ComponentInterface["dataType"];
|
|
15
|
+
templateId?: string;
|
|
16
|
+
workOrderUniqueKey?: string;
|
|
17
|
+
constructor(options: PickOption);
|
|
18
|
+
getNewTableHeader: () => any;
|
|
19
|
+
renderTabel: (list: any) => React.JSX.Element;
|
|
20
|
+
renderPc: () => null;
|
|
21
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
22
|
+
getComponentValue: (r: Record) => any;
|
|
23
|
+
renderExport: () => null;
|
|
24
|
+
renderClient: (record: Record) => React.JSX.Element | null;
|
|
25
|
+
editRender: (p: any) => React.JSX.Element;
|
|
26
|
+
filterConfig: (item: ColumnConfig) => {
|
|
27
|
+
searchDefaultConditions: "like";
|
|
28
|
+
type: string;
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
filterComponentType: "Input";
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export default SubForm;
|
|
@@ -0,0 +1,184 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { Table } from "antd";
|
|
18
|
+
import { SubForm as SubFormComponent } from "@kmkf-fe-packages/basic-components";
|
|
19
|
+
import BsHeaderChild from "../BS/common/BsHeaderChild";
|
|
20
|
+
import GetFormItem from "../GetFormItem";
|
|
21
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
22
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
23
|
+
import { SYMBOL } from "../../constant";
|
|
24
|
+
var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
25
|
+
var _this = this;
|
|
26
|
+
_classCallCheck(this, SubForm);
|
|
27
|
+
_defineProperty(this, "name", void 0);
|
|
28
|
+
_defineProperty(this, "id", void 0);
|
|
29
|
+
_defineProperty(this, "sortField", void 0);
|
|
30
|
+
_defineProperty(this, "type", void 0);
|
|
31
|
+
_defineProperty(this, "rules", void 0);
|
|
32
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
33
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
34
|
+
_defineProperty(this, "formField", void 0);
|
|
35
|
+
_defineProperty(this, "canSort", void 0);
|
|
36
|
+
_defineProperty(this, "children", void 0);
|
|
37
|
+
_defineProperty(this, "dataType", void 0);
|
|
38
|
+
_defineProperty(this, "templateId", void 0);
|
|
39
|
+
_defineProperty(this, "workOrderUniqueKey", void 0);
|
|
40
|
+
_defineProperty(this, "getNewTableHeader", function () {
|
|
41
|
+
var _this$componentConfig, _this$componentConfig2, _this$componentConfig3;
|
|
42
|
+
return (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.subConfig) === null || _this$componentConfig2 === void 0 ? void 0 : (_this$componentConfig3 = _this$componentConfig2.correlationList) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.reduce(function (prv, item) {
|
|
43
|
+
var _this$componentConfig4;
|
|
44
|
+
var t = ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tableHeader.find(function (v) {
|
|
45
|
+
return v.key === item.key;
|
|
46
|
+
})) || {
|
|
47
|
+
isShow: true,
|
|
48
|
+
isEdit: false,
|
|
49
|
+
isRequired: false,
|
|
50
|
+
isNumber: false,
|
|
51
|
+
precision: "nolimit",
|
|
52
|
+
width: 150
|
|
53
|
+
};
|
|
54
|
+
if (t.isShow) {
|
|
55
|
+
prv.push(_objectSpread(_objectSpread({}, item), t));
|
|
56
|
+
}
|
|
57
|
+
return prv;
|
|
58
|
+
}, []);
|
|
59
|
+
});
|
|
60
|
+
_defineProperty(this, "renderTabel", function (list) {
|
|
61
|
+
var _ref, _ref$filter;
|
|
62
|
+
var columns = [{
|
|
63
|
+
dataIndex: "",
|
|
64
|
+
title: "序号",
|
|
65
|
+
align: "center",
|
|
66
|
+
ellipsis: true,
|
|
67
|
+
width: 50,
|
|
68
|
+
render: function render(val, record, index) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
70
|
+
}
|
|
71
|
+
}].concat(_toConsumableArray(((_ref = _this.getNewTableHeader() || []) === null || _ref === void 0 ? void 0 : (_ref$filter = _ref.filter(function (t) {
|
|
72
|
+
return t.isShow;
|
|
73
|
+
})) === null || _ref$filter === void 0 ? void 0 : _ref$filter.map(function (item) {
|
|
74
|
+
return {
|
|
75
|
+
dataIndex: item.key,
|
|
76
|
+
title: item.name,
|
|
77
|
+
align: "center",
|
|
78
|
+
ellipsis: true,
|
|
79
|
+
width: item.width,
|
|
80
|
+
render: function render(val) {
|
|
81
|
+
return /*#__PURE__*/React.createElement("span", null, val);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
})) || []));
|
|
85
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
86
|
+
columns: columns,
|
|
87
|
+
dataSource: list,
|
|
88
|
+
rowKey: "uuid",
|
|
89
|
+
size: "small",
|
|
90
|
+
pagination: false,
|
|
91
|
+
scroll: {
|
|
92
|
+
x: "100%"
|
|
93
|
+
},
|
|
94
|
+
locale: {
|
|
95
|
+
emptyText: "暂无数据"
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
_defineProperty(this, "renderPc", function () {
|
|
100
|
+
return null;
|
|
101
|
+
});
|
|
102
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
103
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")])) return null;
|
|
104
|
+
return _this.renderTabel(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")]);
|
|
105
|
+
});
|
|
106
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
107
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_productList")];
|
|
108
|
+
});
|
|
109
|
+
_defineProperty(this, "renderExport", function () {
|
|
110
|
+
return null;
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
113
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
114
|
+
id: _this.id,
|
|
115
|
+
label: _this.name,
|
|
116
|
+
value: _this.renderTabel(record === null || record === void 0 ? void 0 : record["".concat(_this.id)])
|
|
117
|
+
}) : null;
|
|
118
|
+
});
|
|
119
|
+
_defineProperty(this, "editRender", function (p) {
|
|
120
|
+
var _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
|
|
121
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
122
|
+
title: _this.name,
|
|
123
|
+
name: _this.id,
|
|
124
|
+
rules: _this.rules,
|
|
125
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
126
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
127
|
+
required: (_this$componentConfig5 = (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required) !== null && _this$componentConfig5 !== void 0 ? _this$componentConfig5 : false,
|
|
128
|
+
tooltip: (_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.showTooltip ? (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.tooltip : "",
|
|
129
|
+
component: /*#__PURE__*/React.createElement(SubFormComponent, _this.componentConfig)
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
133
|
+
return [{
|
|
134
|
+
searchDefaultConditions: SYMBOL.like,
|
|
135
|
+
type: item.type,
|
|
136
|
+
id: "".concat(item.id, "_productList"),
|
|
137
|
+
// 过滤组件id
|
|
138
|
+
name: item.name,
|
|
139
|
+
// 过滤组件名称
|
|
140
|
+
filterComponentType: "Input"
|
|
141
|
+
}];
|
|
142
|
+
});
|
|
143
|
+
this.name = options.name;
|
|
144
|
+
this.id = options.id;
|
|
145
|
+
this.sortField = "".concat(options.id, "_productList");
|
|
146
|
+
this.formField = "".concat(options.id, "_productList");
|
|
147
|
+
this.type = options.type;
|
|
148
|
+
this.templateId = options.templateId;
|
|
149
|
+
this.componentConfig = options.componentConfig;
|
|
150
|
+
this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
|
|
151
|
+
this.rules = [{
|
|
152
|
+
validator: function validator(_, value) {
|
|
153
|
+
var _this$componentConfig9, _this$componentConfig10;
|
|
154
|
+
var result = (_this$componentConfig9 = _this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : (_this$componentConfig10 = _this$componentConfig9.tableHeader) === null || _this$componentConfig10 === void 0 ? void 0 : _this$componentConfig10.reduce(function (prv, next) {
|
|
155
|
+
if (next.isRequired && next.isShow && !next.isEdit) {
|
|
156
|
+
prv[next.key] = "".concat(next.name, "\u5FC5\u586B");
|
|
157
|
+
}
|
|
158
|
+
return prv;
|
|
159
|
+
}, {});
|
|
160
|
+
var msg = (value || []).reduce(function (prv, next) {
|
|
161
|
+
Object.keys(next).forEach(function (key) {
|
|
162
|
+
if (result[key] && !next[key]) {
|
|
163
|
+
prv = result[key];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return prv;
|
|
167
|
+
}, "");
|
|
168
|
+
if (msg) {
|
|
169
|
+
return Promise.reject(new Error(msg));
|
|
170
|
+
}
|
|
171
|
+
return Promise.resolve();
|
|
172
|
+
}
|
|
173
|
+
}];
|
|
174
|
+
this.isCombinationComponent = true;
|
|
175
|
+
this.canSort = false;
|
|
176
|
+
this.children = (this.getNewTableHeader() || []).map(function (item) {
|
|
177
|
+
return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
|
|
178
|
+
name: item.name,
|
|
179
|
+
id: "".concat(options.id, "_productList_").concat(item.key)
|
|
180
|
+
}));
|
|
181
|
+
});
|
|
182
|
+
this.dataType = "object";
|
|
183
|
+
});
|
|
184
|
+
export default SubForm;
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, 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, KmErpSendGood, AfterSalesOrderId } from "./index";
|
|
1
|
+
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, KmErpSendGood, AfterSalesOrderId } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AfterSalesOrderId | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonInput | CommonMultiStatus | CommonSystemOrder | BasicDataTime | ItemEnCode | ItemId | ItemSelect | TradeId | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ERemark | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | PaymentVoucherCode | Label | KmErpSendGood;
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | AfterSalesOrderId | AliPay | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonInput | CommonMultiStatus | CommonSystemOrder | BasicDataTime | ItemEnCode | ItemId | ItemSelect | TradeId | BasicInput | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | ShopName | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ERemark | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | PaymentVoucherCode | Label | KmErpSendGood;
|
package/dist/esm/factory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
1
|
+
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, 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
3
|
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, KmErpSendGood, AfterSalesOrderId } from "./index";
|
|
4
4
|
export var factory = function factory(type, options) {
|
|
@@ -48,6 +48,8 @@ export var factory = function factory(type, options) {
|
|
|
48
48
|
return new BasicFile(options);
|
|
49
49
|
case "POSTING":
|
|
50
50
|
return new BasicPosting(options);
|
|
51
|
+
case "SUBFORM":
|
|
52
|
+
return new SubForm(options);
|
|
51
53
|
case "SHOP_NAME_INPUT":
|
|
52
54
|
return new ShopName(options);
|
|
53
55
|
case "TRADE_ID_INPUT":
|
|
@@ -139,6 +141,8 @@ export var factory = function factory(type, options) {
|
|
|
139
141
|
return new BsPosting(options);
|
|
140
142
|
case "BS_GOODS":
|
|
141
143
|
return new BsGoods(options);
|
|
144
|
+
case "WDT_GOODS":
|
|
145
|
+
return new WdtGoods(options);
|
|
142
146
|
case "BS_EXCHANGE_GOODS":
|
|
143
147
|
return new BsExchange(options);
|
|
144
148
|
case "WDT_EXCHANGE_GOODS":
|
|
@@ -201,9 +205,6 @@ export var factory = function factory(type, options) {
|
|
|
201
205
|
return new CommonDataTime(options);
|
|
202
206
|
case "FLOW_UPDATE_DATETIME":
|
|
203
207
|
return new CommonDataTime(options);
|
|
204
|
-
case "WDT_GOODS":
|
|
205
|
-
// 万里牛商品
|
|
206
|
-
return new WdtGoods(options);
|
|
207
208
|
case "BUSINESS_ORDER_NO":
|
|
208
209
|
return new CommonInput(options);
|
|
209
210
|
case "PAYMENT_VOUCHER_CODE":
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as BasicGrade } from "./components/Grade";
|
|
|
12
12
|
export { default as BasicRate } from "./components/Rate";
|
|
13
13
|
export { default as BasicFile } from "./components/File";
|
|
14
14
|
export { default as BasicPosting } from "./components/PostIng";
|
|
15
|
+
export { default as SubForm } from "./components/SubForm";
|
|
15
16
|
export { default as CommonDataTime } from "./components/CommonDataTime";
|
|
16
17
|
export { default as TradeId } from "./components/TradeId";
|
|
17
18
|
export { default as ErpTradeId } from "./components/ErpTradeId";
|
package/dist/esm/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as BasicGrade } from "./components/Grade";
|
|
|
12
12
|
export { default as BasicRate } from "./components/Rate";
|
|
13
13
|
export { default as BasicFile } from "./components/File";
|
|
14
14
|
export { default as BasicPosting } from "./components/PostIng";
|
|
15
|
+
export { default as SubForm } from "./components/SubForm";
|
|
15
16
|
export { default as CommonDataTime } from "./components/CommonDataTime";
|
|
16
17
|
export { default as TradeId } from "./components/TradeId";
|
|
17
18
|
export { default as ErpTradeId } from "./components/ErpTradeId";
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FormInstance } from
|
|
3
|
-
import { SYMBOL } from
|
|
4
|
-
export declare type DataType =
|
|
5
|
-
export declare type ALignType =
|
|
2
|
+
import type { FormInstance } from "antd";
|
|
3
|
+
import { SYMBOL } from "./constant";
|
|
4
|
+
export declare type DataType = "string" | "number" | "array" | "dateArray" | "date" | "tradeId";
|
|
5
|
+
export declare type ALignType = "left" | "right" | "center";
|
|
6
6
|
export declare type QuerySymbol = keyof typeof SYMBOL;
|
|
7
7
|
export declare type Record = {
|
|
8
8
|
[props in string]: any;
|
|
@@ -27,7 +27,7 @@ export declare type FilterConfigType = {
|
|
|
27
27
|
filterFn?: (p: any) => (r: Record) => unknown;
|
|
28
28
|
formatFilterValue?: (p: any) => any;
|
|
29
29
|
};
|
|
30
|
-
export declare type FilterComponentType =
|
|
30
|
+
export declare type FilterComponentType = "MultipleSelect" | "Input" | "Date" | "Cascader" | "ShopList" | "Rate" | "SelectInput";
|
|
31
31
|
export interface ComponentInterface {
|
|
32
32
|
id: string;
|
|
33
33
|
sortField: string;
|
|
@@ -47,8 +47,8 @@ export interface ComponentInterface {
|
|
|
47
47
|
rules?: any[];
|
|
48
48
|
width?: number;
|
|
49
49
|
align?: ALignType;
|
|
50
|
-
dataType:
|
|
51
|
-
format?:
|
|
50
|
+
dataType: "string" | "number" | "boolean" | "array" | "range" | "object";
|
|
51
|
+
format?: "dateTime" | "date" | "time" | "cascader" | "shopInput" | "staffGroup";
|
|
52
52
|
options?: Array<any>;
|
|
53
53
|
templateId?: string;
|
|
54
54
|
flowTemplateKey?: string;
|
|
@@ -88,7 +88,7 @@ export interface ComponentInterface {
|
|
|
88
88
|
/**
|
|
89
89
|
* @description 显示字段名称
|
|
90
90
|
*/
|
|
91
|
-
showField?:
|
|
91
|
+
showField?: "EXPRESS_COMPANY" | "EXPRESS_WAYBILL_CODE" | "EXPRESS_SNAPSHOT" | "all" | "bs" | "workOrder" | "logisticsCompany" | "logisticsCode";
|
|
92
92
|
/**
|
|
93
93
|
* @description 是否选择SKU
|
|
94
94
|
*/
|
|
@@ -108,7 +108,7 @@ export interface ComponentInterface {
|
|
|
108
108
|
/**
|
|
109
109
|
* @description 备注状态
|
|
110
110
|
*/
|
|
111
|
-
associatedType?:
|
|
111
|
+
associatedType?: "APPEND";
|
|
112
112
|
isAssociated?: boolean;
|
|
113
113
|
isShowFlag?: boolean;
|
|
114
114
|
/**
|
|
@@ -149,7 +149,7 @@ export interface ComponentInterface {
|
|
|
149
149
|
* @description 时间初始值
|
|
150
150
|
*/
|
|
151
151
|
dateTime?: string;
|
|
152
|
-
dateType?:
|
|
152
|
+
dateType?: "DATE" | "DATE_TIME" | "DATE_RANGE" | "DATE_TIME_RANGE";
|
|
153
153
|
maxSize?: number;
|
|
154
154
|
basicGrade?: number;
|
|
155
155
|
range?: number;
|
|
@@ -177,6 +177,15 @@ export interface ComponentInterface {
|
|
|
177
177
|
rulesOptions?: Array<any>;
|
|
178
178
|
selectRules?: Array<string>;
|
|
179
179
|
logistics?: string;
|
|
180
|
+
subConfig?: {
|
|
181
|
+
correlationList?: any;
|
|
182
|
+
flowStatus?: string[];
|
|
183
|
+
flowTemplateKey?: any;
|
|
184
|
+
nodeId?: string;
|
|
185
|
+
workOrderTemplateId?: string;
|
|
186
|
+
};
|
|
187
|
+
needFilterShopByPermission?: boolean;
|
|
188
|
+
tableHeader?: any;
|
|
180
189
|
belongType?: string;
|
|
181
190
|
repeatConfig?: {
|
|
182
191
|
repeatRange: string;
|
|
@@ -255,13 +264,13 @@ export interface ComponentInterface {
|
|
|
255
264
|
getComponentValue: (r: Record) => any;
|
|
256
265
|
formDataTransform?: (r: any) => any;
|
|
257
266
|
}
|
|
258
|
-
export declare type PickOption = Pick<ComponentInterface,
|
|
267
|
+
export declare type PickOption = Pick<ComponentInterface, "name" | "id" | "type" | "componentConfig" | "effects" | "columnHeader" | "templateId" | "workOrderUniqueKey" | "platform" | "parentName" | "width" | "flowTemplateKey">;
|
|
259
268
|
export declare type ColumnConfig = {
|
|
260
269
|
id: string;
|
|
261
270
|
name: string;
|
|
262
271
|
type: string;
|
|
263
272
|
subKey?: string;
|
|
264
|
-
mode?:
|
|
265
|
-
config?: ComponentInterface[
|
|
266
|
-
templateConfig?: ComponentInterface[
|
|
273
|
+
mode?: "multiple";
|
|
274
|
+
config?: ComponentInterface["componentConfig"];
|
|
275
|
+
templateConfig?: ComponentInterface["componentConfig"];
|
|
267
276
|
};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-beta.1",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"sync": "yarn build && yalc push",
|
|
11
10
|
"build": "yarn run lint && father build",
|
|
12
11
|
"lint": "eslint '**/*.{ts,tsx}'",
|
|
13
|
-
"lint:fix": "eslint --fix '**/*.{ts,tsx}'"
|
|
12
|
+
"lint:fix": "eslint --fix '**/*.{ts,tsx}'",
|
|
13
|
+
"sync": "yarn build && yalc push"
|
|
14
14
|
},
|
|
15
15
|
"lint-staged": {
|
|
16
16
|
"*.{js,jsx,less,md,json}": [
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "1.
|
|
25
|
-
"@kmkf-fe-packages/kmkf-utils": "1.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "1.8.0-beta.1",
|
|
25
|
+
"@kmkf-fe-packages/kmkf-utils": "1.8.0-beta.0",
|
|
26
|
+
"react-pdf-js": "^5.1.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"publishConfig": {
|
|
39
40
|
"access": "public"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "eeed609c38bd96710fcad4d82eff819c0c52cb20",
|
|
42
43
|
"gitHooks": {
|
|
43
44
|
"pre-commit": "lint-staged"
|
|
44
45
|
}
|