@kmkf-fe-packages/kmkf-work-order-service-component 0.8.9-alpha.9 → 0.8.9

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.
@@ -103,7 +103,7 @@ var CurrentNode = function CurrentNode(props) {
103
103
  nodeName: nodeName,
104
104
  showEdit: false,
105
105
  showLook: false,
106
- handler: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : (_currentNodeDetail$wo8 = _currentNodeDetail$wo7.handlerList) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : (_currentNodeDetail$wo9 = _currentNodeDetail$wo8[0]) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.account
106
+ handler: tag === 'artificial' ? currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : (_currentNodeDetail$wo8 = _currentNodeDetail$wo7.handlerList) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : (_currentNodeDetail$wo9 = _currentNodeDetail$wo8[0]) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.account : ''
107
107
  }), /*#__PURE__*/React.createElement("div", {
108
108
  className: styles.formRenderContainer
109
109
  }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no8 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no8 === void 0 ? void 0 : _currentNodeDetail$no8.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED ? /*#__PURE__*/React.createElement(RenderDetail, {
@@ -19,6 +19,7 @@ declare type FormRenderProps = {
19
19
  name: string;
20
20
  flowTemplateConfig: any;
21
21
  preNodeComponentDtoList: any;
22
+ componentTemplateConfigVos: any;
22
23
  };
23
24
  form: FormInstance;
24
25
  onOpenWangWang?: (nick: string, id: string) => void;
@@ -1,32 +1,32 @@
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
1
  var _excluded = ["displayConfig", "disabled"];
3
2
  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); }
4
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ 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); }
6
+ 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; }
7
+ 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); } }
8
+ 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); }); }; }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ 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."); }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
13
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
14
  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."); }
15
+ 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
16
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
17
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
- 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; }
11
- 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); } }
12
- 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); }); }; }
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
19
  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; }
14
20
  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; }
15
21
  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; }
16
22
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
23
  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); }
18
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
- 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."); }
20
- 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); }
21
- 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; }
22
- 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; } }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
24
  import React, { useState, useRef, useEffect, useMemo } from 'react';
25
25
  import { ConfigProvider, Form } from 'antd';
26
26
  import zhCN from 'antd/es/locale/zh_CN';
27
27
  import { get, some, set, every, cloneDeep, isEmpty } from 'lodash';
28
28
  import 'moment/locale/zh-cn';
29
- import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME } from "../../../common/utils/tools";
29
+ import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, reversalFormValues } from "../../../common/utils/tools";
30
30
  import { replaceCheck } from "../../../model/servers/api";
31
31
  import { factory } from '@kmkf-fe-packages/services-components';
32
32
  import { AddressData, ExpressData, ExpressInterceptData, PlatData, LogisticsAddressData, getExpression, formatDisplayConfig } from '@kmkf-fe-packages/kmkf-utils';
@@ -40,6 +40,12 @@ var hasComponent = function hasComponent(componentDtoList, workOrderComponentTyp
40
40
  return item.workOrderComponentType === workOrderComponentType;
41
41
  })) === null || _componentDtoList$fin === void 0 ? void 0 : _componentDtoList$fin.uniqueKey;
42
42
  };
43
+
44
+ // PS: 放在外面, 要求实时更新
45
+ var finallyMappdingHideComponents = [];
46
+ // 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
47
+ // TODO: 用useState会有bug, 不确定是哪里导致的
48
+ var hideByXYComponents = [];
43
49
  var FormRender = function FormRender(props) {
44
50
  var shopList = props.shopList,
45
51
  look = props.look,
@@ -54,20 +60,92 @@ var FormRender = function FormRender(props) {
54
60
  handleChangeTradeId = props.handleChangeTradeId,
55
61
  canModifyPayment = props.canModifyPayment,
56
62
  flowAllShowHideRules = props.flowAllShowHideRules;
63
+ var shopIdKeyMap = useMemo(function () {
64
+ var json = {};
65
+ shopList.forEach(function (shop) {
66
+ json[shop.shopId] = shop.uniqueKey;
67
+ });
68
+ return json;
69
+ }, [shopList]);
70
+ var mappingConfig = useMemo(function () {
71
+ var readonlyComponents = {};
72
+ var hideComponents = [];
73
+ var config = {};
74
+ var componentTemplateConfigVos = templateDetail.componentTemplateConfigVos;
75
+ var preList = (templateDetail.preNodeComponentDtoList || []).map(function (item) {
76
+ var _componentTemplateCon, _newItem$componentCon, _newItem$componentCon2, _newItem$componentCon3;
77
+ var nodeId = item.uniqueKey.split('-')[0];
78
+ var newItem = cloneDeep(item);
79
+ newItem.componentConfig = _objectSpread(_objectSpread({}, newItem.componentConfig), ((_componentTemplateCon = componentTemplateConfigVos.find(function (i) {
80
+ return i.componentUniqueKey === item.uniqueKey;
81
+ })) === null || _componentTemplateCon === void 0 ? void 0 : _componentTemplateCon.config) || {});
82
+ if ((_newItem$componentCon = newItem.componentConfig.mapping) !== null && _newItem$componentCon !== void 0 && _newItem$componentCon.triggerComponentKey && newItem.componentConfig.mapping.triggerComponentKey !== 'SHOP_SELECT_MAPPING' && (_newItem$componentCon2 = newItem.componentConfig.mapping) !== null && _newItem$componentCon2 !== void 0 && (_newItem$componentCon3 = _newItem$componentCon2.rules) !== null && _newItem$componentCon3 !== void 0 && _newItem$componentCon3.length) {
83
+ // PS: 直接修改triggerComponentKey会报错
84
+ // Cannot assign to read only property 'triggerComponentKey' of object '#<Object>'
85
+ // 所以修改整个mapping
86
+ // newItem.componentConfig.mapping.triggerComponentKey = `${nodeId}-${newItem.componentConfig.mapping.triggerComponentKey}`
87
+ newItem.componentConfig.mapping = _objectSpread(_objectSpread({}, newItem.componentConfig.mapping), {}, {
88
+ triggerComponentKey: "".concat(nodeId, "-").concat(newItem.componentConfig.mapping.triggerComponentKey)
89
+ });
90
+ }
91
+ newItem._isPreItem = true;
92
+ return newItem;
93
+ });
94
+ [].concat(_toConsumableArray(templateDetail.componentDtoList), _toConsumableArray(preList)).forEach(function (componentDto) {
95
+ var _mapping$rules;
96
+ var mapping = componentDto.componentConfig.mapping || {};
97
+ if ((_mapping$rules = mapping.rules) !== null && _mapping$rules !== void 0 && _mapping$rules.length && mapping.triggerComponentKey) {
98
+ readonlyComponents[componentDto.uniqueKey] = {
99
+ auth: mapping.auth
100
+ };
101
+ if (mapping.auth === 'single') {
102
+ hideComponents.push(componentDto.uniqueKey);
103
+ }
104
+ if (componentDto._isPreItem) {
105
+ return;
106
+ }
107
+ var rules = {};
108
+ mapping.rules.forEach(function (rule) {
109
+ if (!rules[rule.triggerValue]) {
110
+ rules[rule.triggerValue] = {};
111
+ }
112
+ rules[rule.triggerValue][componentDto.uniqueKey] = componentDto.workOrderComponentType === 'RADIO' ? {
113
+ value: rule.currentValue,
114
+ other: ''
115
+ } : rule.currentValue;
116
+ });
117
+ config[mapping.triggerComponentKey] = rules;
118
+ }
119
+ });
120
+ return {
121
+ config: config,
122
+ readonlyComponents: readonlyComponents,
123
+ hideComponents: hideComponents
124
+ };
125
+ }, [templateDetail]);
126
+ var _useState = useState(mappingConfig.hideComponents),
127
+ _useState2 = _slicedToArray(_useState, 2),
128
+ mappdingHideComponents = _useState2[0],
129
+ setMappdingHideComponents = _useState2[1];
130
+ // // 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
131
+ // const [hideByXYComponents, setHideByXYComponents] = useState<string[]>([])
132
+
133
+ // console.log('************* mappingConfig **************', { mappingConfig, mappdingHideComponents, templateDetail })
134
+
57
135
  var orderNo = plat.orderNo,
58
136
  buyerId = plat.buyerId,
59
137
  buyerNick = plat.buyerNick,
60
138
  platform = plat.platform,
61
139
  companyKey = plat.companyKey;
62
140
  var workOrderId = record === null || record === void 0 ? void 0 : record.id;
63
- var _useState = useState({}),
64
- _useState2 = _slicedToArray(_useState, 2),
65
- replaceValue = _useState2[0],
66
- setReplaceValue = _useState2[1]; //字段重复校验
67
- var _useState3 = useState(currentShopId),
141
+ var _useState3 = useState({}),
68
142
  _useState4 = _slicedToArray(_useState3, 2),
69
- shopId = _useState4[0],
70
- setShopId = _useState4[1];
143
+ replaceValue = _useState4[0],
144
+ setReplaceValue = _useState4[1]; //字段重复校验
145
+ var _useState5 = useState(currentShopId),
146
+ _useState6 = _slicedToArray(_useState5, 2),
147
+ shopId = _useState6[0],
148
+ setShopId = _useState6[1];
71
149
  AddressData.getInstance();
72
150
  ExpressData.getInstance();
73
151
  ExpressInterceptData.getInstance();
@@ -88,6 +166,7 @@ var FormRender = function FormRender(props) {
88
166
  if (!isEmpty(record)) {
89
167
  var transData = calcWorkOrderList([record], (templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []);
90
168
  preNodeForm.setFieldsValue(_objectSpread({}, get(transData, '0', {})));
169
+ fillByShopId(get(transData, '0', {}).shopId);
91
170
  }
92
171
  }, [record]);
93
172
 
@@ -195,8 +274,20 @@ var FormRender = function FormRender(props) {
195
274
  var _record$jsonMap;
196
275
  // 先初始化端上内容
197
276
  var newRecord = cloneDeep(record);
198
- newRecord.jsonMap = _objectSpread(_objectSpread({}, jsonMap), newRecord.jsonMap);
277
+ var jsonMapOrderId = Object.keys(newRecord.jsonMap).reduce(function (prv, next) {
278
+ var arrText = next.split('_');
279
+ if (arrText[arrText.length - 1] === 'tradeId') {
280
+ prv = newRecord.jsonMap[next];
281
+ }
282
+ return prv;
283
+ }, '');
284
+ //获取保存时的订单缓存数据,解决用户显隐组件不展示二次编辑没有订单信息的问题
285
+ var getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
286
+ var newFormValues = _objectSpread({}, getCacheInfo[jsonMapOrderId] || {});
287
+ newFormValues = reversalFormValues(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, newFormValues);
288
+ newRecord.jsonMap = _objectSpread(_objectSpread(_objectSpread({}, newFormValues), jsonMap), newRecord.jsonMap);
199
289
  var transData = calcWorkOrderList([newRecord], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])));
290
+ console.log(newRecord.jsonMap, newFormValues, transData);
200
291
  form.setFieldsValue(_objectSpread(_objectSpread({}, get(transData, '0', {})), {}, {
201
292
  shopId: shopId,
202
293
  shopName: newRecord.shopName,
@@ -223,10 +314,16 @@ var FormRender = function FormRender(props) {
223
314
  var _transData = calcWorkOrderList([{
224
315
  jsonMap: jsonMap
225
316
  }], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
226
- form.setFieldsValue(_objectSpread(_objectSpread({}, get(_transData, '0', {})), {}, {
317
+ var initialValues = get(_transData, '0', {});
318
+ form.setFieldsValue(_objectSpread(_objectSpread({}, initialValues), {}, {
227
319
  shopId: shopId
228
320
  }));
321
+ // 默认值触发映射
322
+ for (var _key in initialValues) {
323
+ fillByMapping(_key, initialValues[_key]);
324
+ }
229
325
  //如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
326
+
230
327
  if (orderNo && shopId) {
231
328
  orderBack({
232
329
  order_no: orderNo,
@@ -242,6 +339,7 @@ var FormRender = function FormRender(props) {
242
339
 
243
340
  var antFormEl = document.getElementsByClassName('ant-form');
244
341
  (antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
342
+ resetMappdingHideComponents();
245
343
  };
246
344
  useEffect(function () {
247
345
  queryDetail({
@@ -255,6 +353,70 @@ var FormRender = function FormRender(props) {
255
353
  });
256
354
  }, [workOrderId, record, shopId]);
257
355
 
356
+ // 重置映射隐藏的组件, 目前只有单选、下拉组件可能会因为映射关系隐藏
357
+ var resetMappdingHideComponents = function resetMappdingHideComponents() {
358
+ var hideComponents = mappingConfig.hideComponents.filter(function (key) {
359
+ var value = form.getFieldValue(key);
360
+ return _typeof(value) === 'object' ? !value.value : !value;
361
+ });
362
+ var noChange = hideComponents.length === finallyMappdingHideComponents.length && hideComponents.every(function (k) {
363
+ return finallyMappdingHideComponents.includes(k);
364
+ });
365
+ if (!noChange) {
366
+ finallyMappdingHideComponents = _toConsumableArray(hideComponents);
367
+ setMappdingHideComponents(hideComponents);
368
+ }
369
+ };
370
+
371
+ // 商品组件映射
372
+ var fillByShopId = function fillByShopId(shopId) {
373
+ // PS: 增加setTimeout 为了让后续的items渲染,然后触发对应的映射
374
+ setTimeout(function () {
375
+ var shopUniqueKey = shopId ? shopIdKeyMap[shopId] : '';
376
+ shopUniqueKey && fillByMapping('SHOP_SELECT_MAPPING', shopUniqueKey);
377
+ }, 0);
378
+ };
379
+
380
+ // 组件映射
381
+ var fillByMapping = function fillByMapping(triggerUniqueKey, value) {
382
+ var _mappingConfig$config;
383
+ var triggerValue = _typeof(value) === 'object' ? value.value : value;
384
+ // 如果有映射关系,则修改对应组件的值
385
+ var mapping = (_mappingConfig$config = mappingConfig.config) === null || _mappingConfig$config === void 0 ? void 0 : _mappingConfig$config[triggerUniqueKey];
386
+ if (mapping !== null && mapping !== void 0 && mapping[triggerValue]) {
387
+ form.setFieldsValue(mapping === null || mapping === void 0 ? void 0 : mapping[triggerValue]);
388
+ } else {
389
+ var resetSet = new Set();
390
+ for (var _key2 in mapping) {
391
+ for (var uniqueKey in mapping[_key2]) {
392
+ resetSet.add(uniqueKey);
393
+ }
394
+ }
395
+ form.resetFields(_toConsumableArray(resetSet));
396
+ }
397
+ resetMappdingHideComponents();
398
+ };
399
+ var checkFillMapping = function checkFillMapping(show, uniqueKey, workOrderComponentType) {
400
+ if (['RADIO', 'SELECT'].includes(workOrderComponentType)) {
401
+ if (!show && !hideByXYComponents.includes(uniqueKey)) {
402
+ hideByXYComponents = [uniqueKey].concat(_toConsumableArray(hideByXYComponents));
403
+ // setHideByXYComponents([uniqueKey, ...hideByXYComponents])
404
+ fillByMapping(uniqueKey, '');
405
+ }
406
+ if (show && hideByXYComponents.includes(uniqueKey)) {
407
+ var newHideByXYComponents = hideByXYComponents.filter(function (k) {
408
+ return k !== uniqueKey;
409
+ });
410
+ hideByXYComponents = newHideByXYComponents;
411
+ // setHideByXYComponents(newHideByXYComponents)
412
+ fillByMapping(uniqueKey, form.getFieldValue(uniqueKey).value);
413
+ }
414
+ }
415
+ };
416
+ useEffect(function () {
417
+ fillByShopId(shopId);
418
+ }, [shopId]);
419
+
258
420
  //订单返填
259
421
  var changeHandle = function changeHandle(order_no) {
260
422
  if (!order_no) return;
@@ -269,6 +431,13 @@ var FormRender = function FormRender(props) {
269
431
  fromQNCreateWorkOrderByOrderNo: false
270
432
  });
271
433
  };
434
+ // 组件值变化
435
+ var componentOnValueChange = function componentOnValueChange(uniqueKey, value) {
436
+ if (mappingConfig.config[uniqueKey]) {
437
+ // PS: 目前只有string 和 { value: string, other: ''}这两种类型,后面其他组件如果需要在调整
438
+ fillByMapping(uniqueKey, typeof value === 'string' ? value : value === null || value === void 0 ? void 0 : value.value);
439
+ }
440
+ };
272
441
  //组件失焦事件
273
442
  var componentOnBlur = /*#__PURE__*/function () {
274
443
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value, type) {
@@ -422,6 +591,18 @@ var FormRender = function FormRender(props) {
422
591
  if (workOrderComponentType === 'ENTERPRISE_PAYMENT') {
423
592
  newComponentConfig['disabled'] = disabled || !canModifyPayment;
424
593
  }
594
+ if (['RADIO', 'SELECT'].includes(workOrderComponentType)) {
595
+ var _mappingConfig$readon, _mappingConfig$readon2;
596
+ if (((_mappingConfig$readon = mappingConfig.readonlyComponents[uniqueKey]) === null || _mappingConfig$readon === void 0 ? void 0 : _mappingConfig$readon.auth) === 'all') {
597
+ newComponentConfig[workOrderComponentType === 'SELECT' ? 'readonly' : 'disabled'] = true;
598
+ } else if (((_mappingConfig$readon2 = mappingConfig.readonlyComponents[uniqueKey]) === null || _mappingConfig$readon2 === void 0 ? void 0 : _mappingConfig$readon2.auth) === 'single') {
599
+ newComponentConfig.disabled = true;
600
+ if (workOrderComponentType === 'RADIO') {
601
+ // 隐藏未选中组件
602
+ newComponentConfig.hideUnselectedItem = true;
603
+ }
604
+ }
605
+ }
425
606
  var idConditionListMap = formatDisplayConfig(displayConfig);
426
607
  var instance = factory(workOrderComponentType, {
427
608
  id: uniqueKey,
@@ -494,18 +675,28 @@ var FormRender = function FormRender(props) {
494
675
  });
495
676
  }, false);
496
677
  currentComponentDisplayStatus.current[instance === null || instance === void 0 ? void 0 : instance.id] = show;
678
+ checkFillMapping(show, uniqueKey, workOrderComponentType);
497
679
  return instance.editRender({
498
680
  onBlur: componentOnBlur,
499
- hidden: !show
681
+ onChange: function onChange(value) {
682
+ return componentOnValueChange(uniqueKey, value);
683
+ },
684
+ hidden: !show || mappdingHideComponents.includes(uniqueKey)
500
685
  });
501
686
  });
502
687
  }
503
688
  return instance.editRender({
504
- onBlur: componentOnBlur
689
+ onBlur: componentOnBlur,
690
+ onChange: function onChange(value) {
691
+ return componentOnValueChange(uniqueKey, value);
692
+ },
693
+ hidden: mappdingHideComponents.includes(uniqueKey)
505
694
  });
506
695
  };
507
696
  };
508
697
  var finalFormItems = useMemo(function () {
698
+ // 重置显示隐藏记录的组件
699
+ hideByXYComponents = [];
509
700
  // TODO: 这里是正常的表单显隐逻辑
510
701
  var otherItems = get(templateDetail, 'componentDtoList', []).map(newRenderColumnItem({
511
702
  form: form,
@@ -537,7 +728,10 @@ var FormRender = function FormRender(props) {
537
728
  return [].concat(_toConsumableArray(hiddenPreNode), [ShopName], _toConsumableArray(otherItems));
538
729
  }
539
730
  return [].concat(_toConsumableArray(hiddenPreNode), _toConsumableArray(otherItems));
540
- }, [templateDetail, shopList, shopId, record, currentShopId, look, handleChangeTradeId]);
731
+ }, [templateDetail, shopList, shopId, record, mappdingHideComponents, currentShopId, look, handleChangeTradeId]);
732
+
733
+ // const renderFinalFormItems = finalFormItems.filter(item => !mappdingHideComponents.includes(item.props?.name))
734
+
541
735
  var preNodeFormItems = useMemo(function () {
542
736
  var _get, _groupByPreNode;
543
737
  var configVosPrams = get(templateDetail, 'componentTemplateConfigVos', []).reduce(function (prv, next) {
@@ -552,7 +746,6 @@ var FormRender = function FormRender(props) {
552
746
  var preNodeItems = [];
553
747
  (_groupByPreNode = groupByPreNode(preNodeComponentDtoList)) === null || _groupByPreNode === void 0 ? void 0 : _groupByPreNode.forEach(function (item, key) {
554
748
  var displayConfig = getCurrentNodeModifiedShowHideRule(flowAllShowHideRules === null || flowAllShowHideRules === void 0 ? void 0 : flowAllShowHideRules.allShowHideRules, key);
555
- console.log('displayConfig', displayConfig, flowAllShowHideRules === null || flowAllShowHideRules === void 0 ? void 0 : flowAllShowHideRules.allShowHideRules, key);
556
749
  preNodeItems.push(item === null || item === void 0 ? void 0 : item.map(newRenderColumnItem({
557
750
  form: form,
558
751
  shopList: shopList,
@@ -578,7 +771,10 @@ var FormRender = function FormRender(props) {
578
771
  // }),
579
772
  // );
580
773
  // return preNodeItems;
581
- }, [templateDetail, shopList, shopId, record, currentShopId, look, handleChangeTradeId]);
774
+ }, [templateDetail, shopList, shopId, record, mappdingHideComponents, currentShopId, look, handleChangeTradeId]);
775
+ // const renderPreNodeFormItems = preNodeFormItems.map(items => {
776
+ // return items.filter((item: any) => !mappdingHideComponents.includes(item.props?.name))
777
+ // })
582
778
  return /*#__PURE__*/React.createElement(ConfigProvider, {
583
779
  locale: zhCN
584
780
  }, /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Button, Spin } from 'antd';
2
+ import { Button, Spin, Tooltip } from 'antd';
3
3
  import { NODE_TYPE } from "../../../common/constant";
4
4
  import styles from "./index.module.less";
5
5
  var Header = function Header(props) {
@@ -23,11 +23,13 @@ var Header = function Header(props) {
23
23
  className: styles.wrap
24
24
  }, (NODE_TYPE === null || NODE_TYPE === void 0 ? void 0 : NODE_TYPE[tag]) && /*#__PURE__*/React.createElement("div", {
25
25
  className: "".concat(styles.tag, " ").concat(styles === null || styles === void 0 ? void 0 : styles[NODE_TYPE === null || NODE_TYPE === void 0 ? void 0 : (_NODE_TYPE$tag = NODE_TYPE[tag]) === null || _NODE_TYPE$tag === void 0 ? void 0 : _NODE_TYPE$tag.className])
26
- }, NODE_TYPE === null || NODE_TYPE === void 0 ? void 0 : (_NODE_TYPE$tag2 = NODE_TYPE[tag]) === null || _NODE_TYPE$tag2 === void 0 ? void 0 : _NODE_TYPE$tag2.label), /*#__PURE__*/React.createElement("span", {
26
+ }, NODE_TYPE === null || NODE_TYPE === void 0 ? void 0 : (_NODE_TYPE$tag2 = NODE_TYPE[tag]) === null || _NODE_TYPE$tag2 === void 0 ? void 0 : _NODE_TYPE$tag2.label), /*#__PURE__*/React.createElement(Tooltip, {
27
+ title: "".concat(nodeName, " ").concat(handler ? "(\u5904\u7406\u4EBA: ".concat(handler, ")") : '')
28
+ }, /*#__PURE__*/React.createElement("span", {
27
29
  className: styles.nodeName
28
- }, nodeName, handler && /*#__PURE__*/React.createElement("span", {
30
+ }, /*#__PURE__*/React.createElement("span", null, nodeName), handler && /*#__PURE__*/React.createElement("span", {
29
31
  className: styles.handler
30
- }, "(\u5904\u7406\u4EBA: ".concat(handler, ")"))), /*#__PURE__*/React.createElement("div", {
32
+ }, "(\u5904\u7406\u4EBA: ".concat(handler, ")")))), /*#__PURE__*/React.createElement("div", {
31
33
  className: styles.loadingWrap
32
34
  }, /*#__PURE__*/React.createElement(Spin, {
33
35
  spinning: loading,
@@ -156,7 +156,7 @@ var NodeItem = function NodeItem(props) {
156
156
  handleSave: handleSave,
157
157
  handlePackUp: handlePackUp,
158
158
  loading: loading,
159
- handler: handler
159
+ handler: isArtificialNode ? handler : ''
160
160
  }), /*#__PURE__*/React.createElement("div", {
161
161
  style: {
162
162
  display: open ? 'block' : 'none',
@@ -1,7 +1,10 @@
1
1
  .preNodeContainer {
2
2
  background: rgba(0, 0, 0, 0.1);
3
- padding: 8px;
3
+ padding: 0 8px;
4
4
  border-radius: 4px;
5
+ > div {
6
+ padding: 4px 0px;
7
+ }
5
8
  }
6
9
 
7
10
  .currentNodeContainer {
@@ -21,7 +21,7 @@ import { useDispatch, useSelector, Provider } from 'react-redux';
21
21
  import store from "../model/store";
22
22
  import zhCN from 'antd/es/locale/zh_CN';
23
23
  import { AddressData, ExpressData, ExpressInterceptData, PlatData } from '@kmkf-fe-packages/kmkf-utils';
24
- import { calcWorkOrderList } from "../common/utils/tools";
24
+ import { calcWorkOrderList, deleteCacheOrder } from "../common/utils/tools";
25
25
  import { setPlat, fetchPanelInfo, fetchAllFlowOperateRecord, setAction, setVisibleRemarkList, setAddRemarkVisible, setLoading, setClearStore } from "../model/flowTemplateDetail";
26
26
  import { selectFlowRecordList, selectRemarkRecordList, selectCurrentNodeDetail, selectOperateParams, selectFlowStatus, selectCurrentTradeIdWOrkOrderNumber, selectFlowTemplateId, selectLoading } from "../model/flowTemplateDetail/selector";
27
27
  import NodeItem from "./components/Item";
@@ -130,6 +130,8 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
130
130
  res = _context.sent;
131
131
  if (res.success) {
132
132
  message.success('保存成功');
133
+ //保存
134
+
133
135
  handleSuccessCallBack('save');
134
136
  if (res.data !== flowWorkOrderIdState) {
135
137
  setFlowWorkOrderIdState(res.data || '');
@@ -209,7 +211,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
209
211
  // 提交
210
212
  var handleSubmit = /*#__PURE__*/function () {
211
213
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
212
- var _currentNodeDetail$wo3, _currentNodeDetail$wo4, formData, result, params, res;
214
+ var _currentNodeDetail$wo3, _currentNodeDetail$wo4, formData, result, params, res, _currentNodeDetail$wo5;
213
215
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
214
216
  while (1) switch (_context3.prev = _context3.next) {
215
217
  case 0:
@@ -259,6 +261,8 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
259
261
  flowWorkOrderId: flowWorkOrderIdState
260
262
  }));
261
263
  message.success('提交成功');
264
+ //删除缓存的订单信息
265
+ deleteCacheOrder(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo5 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo5 === void 0 ? void 0 : _currentNodeDetail$wo5.componentDtoList, formData);
262
266
  }
263
267
  _context3.next = 22;
264
268
  break;
@@ -344,7 +348,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
344
348
  // 暂停工单
345
349
  var handleStop = /*#__PURE__*/function () {
346
350
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(formData) {
347
- var _currentNodeDetail$no3, _currentNodeDetail$wo5, _res$data3, _res$data3$failList, res, _res$data4, _res$data4$failList, _res$data4$failList$;
351
+ var _currentNodeDetail$no3, _currentNodeDetail$wo6, _res$data3, _res$data3$failList, res, _res$data4, _res$data4$failList, _res$data4$failList$;
348
352
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
349
353
  while (1) switch (_context5.prev = _context5.next) {
350
354
  case 0:
@@ -355,7 +359,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
355
359
  nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no3 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no3 === void 0 ? void 0 : _currentNodeDetail$no3.id,
356
360
  flowWorkOrderId: flowWorkOrderIdState,
357
361
  flowTemplateId: flowTemplateId,
358
- workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo5 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo5 === void 0 ? void 0 : _currentNodeDetail$wo5.id
362
+ workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo6 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo6 === void 0 ? void 0 : _currentNodeDetail$wo6.id
359
363
  })
360
364
  }));
361
365
  case 3:
@@ -395,19 +399,19 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
395
399
  // 关闭工单
396
400
  var handleClose = /*#__PURE__*/function () {
397
401
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(formData) {
398
- var _currentNodeDetail$wo6, _currentNodeDetail$no4, _currentNodeDetail$wo7, _res$data5, _res$data5$failList, res, _res$data6, _res$data6$failList, _res$data6$failList$;
402
+ var _currentNodeDetail$wo7, _currentNodeDetail$no4, _currentNodeDetail$wo8, _res$data5, _res$data5$failList, res, _res$data6, _res$data6$failList, _res$data6$failList$;
399
403
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
400
404
  while (1) switch (_context6.prev = _context6.next) {
401
405
  case 0:
402
406
  _context6.prev = 0;
403
407
  _context6.next = 3;
404
408
  return closeWorkOrder(_objectSpread(_objectSpread({}, formData), {}, {
405
- workOrderFlowStatus: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo6 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo6 === void 0 ? void 0 : _currentNodeDetail$wo6.flowStatus,
409
+ workOrderFlowStatus: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : _currentNodeDetail$wo7.flowStatus,
406
410
  operateParams: _objectSpread(_objectSpread({}, operateParams), {}, {
407
411
  nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no4 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no4 === void 0 ? void 0 : _currentNodeDetail$no4.id,
408
412
  flowWorkOrderId: flowWorkOrderIdState,
409
413
  flowTemplateId: flowTemplateId,
410
- workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : _currentNodeDetail$wo7.id
414
+ workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo8 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : _currentNodeDetail$wo8.id
411
415
  })
412
416
  }));
413
417
  case 3:
@@ -442,7 +446,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
442
446
  // 转交处理人
443
447
  var handleForWard = /*#__PURE__*/function () {
444
448
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(formData) {
445
- var _currentNodeDetail$no5, _currentNodeDetail$wo8, _res$data7, _res$data7$failList, res, _res$data8, _res$data8$failList, _res$data8$failList$;
449
+ var _currentNodeDetail$no5, _currentNodeDetail$wo9, _res$data7, _res$data7$failList, res, _res$data8, _res$data8$failList, _res$data8$failList$;
446
450
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
447
451
  while (1) switch (_context7.prev = _context7.next) {
448
452
  case 0:
@@ -453,7 +457,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
453
457
  nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no5 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no5 === void 0 ? void 0 : _currentNodeDetail$no5.id,
454
458
  flowWorkOrderId: flowWorkOrderIdState,
455
459
  flowTemplateId: flowTemplateId,
456
- workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo8 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : _currentNodeDetail$wo8.id
460
+ workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo9 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.id
457
461
  })
458
462
  }));
459
463
  case 3:
@@ -488,7 +492,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
488
492
  // 驳回
489
493
  var handleReturnWorkOrder = /*#__PURE__*/function () {
490
494
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(formData) {
491
- var _currentNodeDetail$no6, _currentNodeDetail$wo9, _res$data9, _res$data9$failList, res, _res$data10, _res$data10$failList, _res$data10$failList$;
495
+ var _currentNodeDetail$no6, _currentNodeDetail$wo10, _res$data9, _res$data9$failList, res, _res$data10, _res$data10$failList, _res$data10$failList$;
492
496
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
493
497
  while (1) switch (_context8.prev = _context8.next) {
494
498
  case 0:
@@ -499,7 +503,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
499
503
  nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no6 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no6 === void 0 ? void 0 : _currentNodeDetail$no6.id,
500
504
  flowWorkOrderId: flowWorkOrderIdState,
501
505
  flowTemplateId: flowTemplateId,
502
- workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo9 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.id
506
+ workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.id
503
507
  })
504
508
  }));
505
509
  case 3:
@@ -533,8 +537,8 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
533
537
  }();
534
538
  // 填充表单
535
539
  var handleFillWorkOrder = function handleFillWorkOrder() {
536
- var _currentNodeDetail$wo10;
537
- var transData = calcWorkOrderList([currentTradeIdLinkWorkOrderId === null || currentTradeIdLinkWorkOrderId === void 0 ? void 0 : currentTradeIdLinkWorkOrderId.lastWorkOrderDetail], (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.componentDtoList) || []);
540
+ var _currentNodeDetail$wo11;
541
+ var transData = calcWorkOrderList([currentTradeIdLinkWorkOrderId === null || currentTradeIdLinkWorkOrderId === void 0 ? void 0 : currentTradeIdLinkWorkOrderId.lastWorkOrderDetail], (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.componentDtoList) || []);
538
542
  var formData = form.getFieldsValue();
539
543
  form.setFieldsValue(_objectSpread(_objectSpread({}, formData), get(transData, '0', {})));
540
544
  };
@@ -568,17 +572,17 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
568
572
  initHandle();
569
573
  }, []);
570
574
  var isCurrentNodeHandler = useMemo(function () {
571
- var _currentNodeDetail$no7, _currentNodeDetail$no8, _currentNodeDetail$no9, _currentNodeDetail$no10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15;
575
+ var _currentNodeDetail$no7, _currentNodeDetail$no8, _currentNodeDetail$no9, _currentNodeDetail$no10, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16;
572
576
  var groupCanOperate = (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no7 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no7 === void 0 ? void 0 : (_currentNodeDetail$no8 = _currentNodeDetail$no7.assistants) === null || _currentNodeDetail$no8 === void 0 ? void 0 : _currentNodeDetail$no8.operateDataPermission) === 'HANDLE_ALL';
573
577
  var staffs = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no9 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no9 === void 0 ? void 0 : (_currentNodeDetail$no10 = _currentNodeDetail$no9.assistants) === null || _currentNodeDetail$no10 === void 0 ? void 0 : _currentNodeDetail$no10.staffIds;
574
- if (Array.isArray(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.handlerList) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : (_currentNodeDetail$wo13 = _currentNodeDetail$wo12.handlerList) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : _currentNodeDetail$wo13.length) === 0) {
578
+ if (Array.isArray(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : _currentNodeDetail$wo12.handlerList) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo13 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : (_currentNodeDetail$wo14 = _currentNodeDetail$wo13.handlerList) === null || _currentNodeDetail$wo14 === void 0 ? void 0 : _currentNodeDetail$wo14.length) === 0) {
575
579
  return true;
576
580
  }
577
581
  if (groupCanOperate) {
578
582
  var _currentNodeDetail$no11, _currentNodeDetail$no12;
579
583
  return (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no11 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no11 === void 0 ? void 0 : (_currentNodeDetail$no12 = _currentNodeDetail$no11.assistants) === null || _currentNodeDetail$no12 === void 0 ? void 0 : _currentNodeDetail$no12.isAllStaff) || (staffs === null || staffs === void 0 ? void 0 : staffs.includes(plat.userKey));
580
584
  }
581
- return !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo14 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo14 !== void 0 && (_currentNodeDetail$wo15 = _currentNodeDetail$wo14.handlerList) !== null && _currentNodeDetail$wo15 !== void 0 && _currentNodeDetail$wo15.find(function (item) {
585
+ return !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo15 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo15 !== void 0 && (_currentNodeDetail$wo16 = _currentNodeDetail$wo15.handlerList) !== null && _currentNodeDetail$wo16 !== void 0 && _currentNodeDetail$wo16.find(function (item) {
582
586
  return item.account === plat.accountName;
583
587
  }));
584
588
  }, [currentNodeDetail, plat]);
@@ -90,4 +90,6 @@ export declare const verifyHandle: (data: any, componentDtoList: Array<any>) =>
90
90
  success: boolean;
91
91
  message: string;
92
92
  };
93
+ export declare const reversalFormValues: (templateList: any[] | undefined, values: any) => any;
94
+ export declare const deleteCacheOrder: (templateList: any[], values: any) => void;
93
95
  export {};
@@ -17,7 +17,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
17
17
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
18
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
19
  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; }
20
- import { get, every, maxBy } from 'lodash';
20
+ import { get, every, maxBy, isObject, isArray } from 'lodash';
21
21
  import V from 'voca';
22
22
  import { orderDetail, jstOrderDetail, bsOrderDetail } from "../../model/servers/api";
23
23
  import moment from 'moment';
@@ -961,7 +961,10 @@ var transDataSource = function transDataSource(templateColumns) {
961
961
  logisticsCompany: null,
962
962
  logisticsCode: null
963
963
  }]);
964
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList2));
964
+ return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList2 !== null && _itemList2 !== void 0 && _itemList2.length ? _itemList2 : [{
965
+ logisticsCompany: null,
966
+ logisticsCode: null
967
+ }]));
965
968
  } else if (nex.workOrderComponentType === 'JST_ITEM_SELECT_THIRD') {
966
969
  var _itemList3 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], []);
967
970
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList3));
@@ -969,13 +972,18 @@ var transDataSource = function transDataSource(templateColumns) {
969
972
  var _itemList4 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
970
973
  supplyId: null
971
974
  }]);
972
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList4));
975
+ return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList4 !== null && _itemList4 !== void 0 && _itemList4.length ? _itemList4 : [{
976
+ supplyId: null
977
+ }]));
973
978
  } else if (nex.workOrderComponentType === 'JST_SEND_GOOD') {
974
979
  var _itemList5 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
975
980
  sendName: '',
976
981
  sendId: ''
977
982
  }]);
978
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList5));
983
+ return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList5 !== null && _itemList5 !== void 0 && _itemList5.length ? _itemList5 : [{
984
+ sendName: '',
985
+ sendId: ''
986
+ }]));
979
987
  } else if (nex.workOrderComponentType === 'BS_SIGNING_TIME') {
980
988
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_bsSigningTime")]));
981
989
  } else if (nex.workOrderComponentType === 'BS_SEND_TIME') {
@@ -998,13 +1006,19 @@ var transDataSource = function transDataSource(templateColumns) {
998
1006
  logisticsCompany: null,
999
1007
  logisticsCode: null
1000
1008
  }]);
1001
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList6));
1009
+ return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList6 !== null && _itemList6 !== void 0 && _itemList6.length ? _itemList6 : [{
1010
+ logisticsCompany: null,
1011
+ logisticsCode: null
1012
+ }]));
1002
1013
  } else if (nex.workOrderComponentType === 'BS_SEND_GOOD') {
1003
1014
  var _itemList7 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSendGood")], [{
1004
1015
  sendName: '',
1005
1016
  sendId: ''
1006
1017
  }]);
1007
- return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList7));
1018
+ return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList7 !== null && _itemList7 !== void 0 && _itemList7.length ? _itemList7 : [{
1019
+ sendName: '',
1020
+ sendId: ''
1021
+ }]));
1008
1022
  } else if (nex.workOrderComponentType === 'BS_POSTING') {
1009
1023
  var BsAddress = [transTextToNumber(item.jsonMap["".concat(nex.uniqueKey, "_bsPostingProvince")]), transTextToNumber(item.jsonMap["".concat(nex.uniqueKey, "_bsPostingCity")])];
1010
1024
  //兼容地址是只有省市的
@@ -1147,7 +1161,7 @@ var taobaoGoodHandle = /*#__PURE__*/function () {
1147
1161
  //订单返填
1148
1162
  export var orderBack = /*#__PURE__*/function () {
1149
1163
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
1150
- var order_no, form, shopId, shopList, templateDetail, _ref2$type, type, callback, fromQNCreateWorkOrderByOrderNo, JOIN_SHOP, hasBs, _ref4, shopSourceStr, _ref4$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, bsOrder, orderInfo, jstInfo, bsInfo, formValue, detail, hasSelectItem, erpPromiseList, list, promises, _detail$itemList, values, _templateDetail$compo, paymentUniqueKey;
1164
+ var order_no, form, shopId, shopList, templateDetail, _ref2$type, type, callback, fromQNCreateWorkOrderByOrderNo, JOIN_SHOP, hasBs, _ref4, shopSourceStr, _ref4$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, bsOrder, orderInfo, jstInfo, bsInfo, formValue, detail, hasSelectItem, erpPromiseList, list, promises, _detail$itemList, values, _templateDetail$compo, paymentUniqueKey, cacheOrderInfo;
1151
1165
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1152
1166
  while (1) switch (_context2.prev = _context2.next) {
1153
1167
  case 0:
@@ -1287,6 +1301,9 @@ export var orderBack = /*#__PURE__*/function () {
1287
1301
  enterprisePaymentTid: order_no
1288
1302
  });
1289
1303
  }
1304
+ //缓存订单返填的信息,用来解决用户保存显隐返填组件,二次编辑订单信息丢失
1305
+ cacheOrderInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
1306
+ sessionStorage.setItem('cacheOrderInfo', JSON.stringify(_objectSpread(_objectSpread({}, cacheOrderInfo), {}, _defineProperty({}, order_no, values))));
1290
1307
  }
1291
1308
  form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
1292
1309
  callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
@@ -1429,6 +1446,7 @@ export var platformMap = {
1429
1446
  xiaozhi: '小智',
1430
1447
  pc: '客服工作台'
1431
1448
  };
1449
+ //获取表单提交参数
1432
1450
  export var submitParams = function submitParams(_ref5) {
1433
1451
  var _currentNodeDetail$no;
1434
1452
  var update = _ref5.update,
@@ -1531,6 +1549,7 @@ export var submitParams = function submitParams(_ref5) {
1531
1549
  }
1532
1550
  return params;
1533
1551
  };
1552
+ //表单提交校验
1534
1553
  export var verifyHandle = function verifyHandle(data, componentDtoList) {
1535
1554
  var _componentDtoList$fin, _componentDtoList$fin2, _data$paymentUniqueKe, _data$paymentUniqueKe2;
1536
1555
  var res = {
@@ -1548,4 +1567,87 @@ export var verifyHandle = function verifyHandle(data, componentDtoList) {
1548
1567
  res.message = '订单组件和打款组件的订单号必须一致';
1549
1568
  }
1550
1569
  return res;
1570
+ };
1571
+ //将表单字段转回提交字段的格式
1572
+ export var reversalFormValues = function reversalFormValues() {
1573
+ var templateList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1574
+ var values = arguments.length > 1 ? arguments[1] : undefined;
1575
+ console.log(templateList, values);
1576
+ return templateList.reduce(function (prv, next) {
1577
+ var _values$next$uniqueKe, _values$next$uniqueKe2, _values$next$uniqueKe3, _values$next$uniqueKe4, _values$next$uniqueKe5, _values$next$uniqueKe6;
1578
+ if (!(values !== null && values !== void 0 && values[next.uniqueKey])) {
1579
+ return prv;
1580
+ }
1581
+ switch (next.workOrderComponentType) {
1582
+ case 'BS_SIGNING_TIME':
1583
+ prv["".concat(next.uniqueKey, "_bsSigningTime")] = values[next.uniqueKey];
1584
+ break;
1585
+ case 'BS_SEND_TIME':
1586
+ prv["".concat(next.uniqueKey, "_bsSendTime")] = values[next.uniqueKey];
1587
+ break;
1588
+ case 'BS_TRADE_PAYMENT_TIME':
1589
+ prv["".concat(next.uniqueKey, "_bsTradePaymentTime")] = values[next.uniqueKey];
1590
+ break;
1591
+ case 'BS_NET_RECEIPTS':
1592
+ prv["".concat(next.uniqueKey, "_bsNetReceipts")] = values[next.uniqueKey];
1593
+ break;
1594
+ case 'BS_PACKAGE_WEIGHT':
1595
+ prv["".concat(next.uniqueKey, "_bsPackageWeight")] = values[next.uniqueKey];
1596
+ break;
1597
+ case 'BS_DEPOSIT':
1598
+ prv["".concat(next.uniqueKey, "_bsDeposit")] = values[next.uniqueKey];
1599
+ break;
1600
+ case 'BS_LOGISTICS':
1601
+ prv["".concat(next.uniqueKey, "_bsLogisticsList")] = JSON.stringify(values[next.uniqueKey] || []);
1602
+ break;
1603
+ case 'BS_SEND_GOOD':
1604
+ prv["".concat(next.uniqueKey, "_bsSendGood")] = JSON.stringify(values[next.uniqueKey] || []);
1605
+ break;
1606
+ case 'BS_POSTING':
1607
+ prv["".concat(next.uniqueKey, "_bsPostingProvince")] = (_values$next$uniqueKe = values[next.uniqueKey]) === null || _values$next$uniqueKe === void 0 ? void 0 : (_values$next$uniqueKe2 = _values$next$uniqueKe['postingAddress']) === null || _values$next$uniqueKe2 === void 0 ? void 0 : _values$next$uniqueKe2[0];
1608
+ prv["".concat(next.uniqueKey, "_bsPostingCity")] = (_values$next$uniqueKe3 = values[next.uniqueKey]) === null || _values$next$uniqueKe3 === void 0 ? void 0 : (_values$next$uniqueKe4 = _values$next$uniqueKe3['postingAddress']) === null || _values$next$uniqueKe4 === void 0 ? void 0 : _values$next$uniqueKe4[1];
1609
+ prv["".concat(next.uniqueKey, "_bsPostingDistrict")] = (_values$next$uniqueKe5 = values[next.uniqueKey]) === null || _values$next$uniqueKe5 === void 0 ? void 0 : (_values$next$uniqueKe6 = _values$next$uniqueKe5['postingAddress']) === null || _values$next$uniqueKe6 === void 0 ? void 0 : _values$next$uniqueKe6[2];
1610
+ prv["".concat(next.uniqueKey, "_bsPostingDetail")] = values[next.uniqueKey]['postingDetail'];
1611
+ prv["".concat(next.uniqueKey, "_bsPostingReceiverName")] = values[next.uniqueKey]['postingReceiverName'];
1612
+ prv["".concat(next.uniqueKey, "_bsPostingReceiverMobile")] = values[next.uniqueKey]['postingReceiverMobile'];
1613
+ break;
1614
+ case 'BS_GOODS':
1615
+ prv["".concat(next.uniqueKey, "_bsGoods")] = JSON.stringify(values[next.uniqueKey]['bsGoods']);
1616
+ prv["".concat(next.uniqueKey, "_shopCode")] = values[next.uniqueKey]['shopCode'];
1617
+ break;
1618
+ case 'BS_REISSUE_GOODS':
1619
+ prv["".concat(next.uniqueKey, "_shopCode")] = values[next.uniqueKey]['shopCode'];
1620
+ break;
1621
+ case 'BS_EXCHANGE_GOODS':
1622
+ prv["".concat(next.uniqueKey, "_shopCode")] = values[next.uniqueKey]['shopCode'];
1623
+ break;
1624
+ }
1625
+ return prv;
1626
+ }, {});
1627
+ return Object.keys(values).reduce(function (prv, next) {
1628
+ if (isObject(values[next])) {
1629
+ Object.keys(values[next]).forEach(function (key) {
1630
+ prv["".concat(next, "_").concat(key)] = isArray(values[next][key]) ? JSON.stringify(values[next][key]) : values[next][key];
1631
+ });
1632
+ } else {
1633
+ if (templateKeysMap[next]) {
1634
+ prv["".concat(next, "_").concat(templateKeysMap[next])] = values[next];
1635
+ }
1636
+ }
1637
+ return prv;
1638
+ }, {});
1639
+ };
1640
+
1641
+ //删除缓存数据
1642
+ export var deleteCacheOrder = function deleteCacheOrder(templateList, values) {
1643
+ var _templateList$find;
1644
+ var tradeIdUniqueKey = (_templateList$find = templateList.find(function (item) {
1645
+ return item.workOrderComponentType === 'TRADE_ID_INPUT';
1646
+ })) === null || _templateList$find === void 0 ? void 0 : _templateList$find.uniqueKey;
1647
+ if (tradeIdUniqueKey) {
1648
+ var tradeId = values[tradeIdUniqueKey];
1649
+ var getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
1650
+ delete getCacheInfo[tradeId];
1651
+ sessionStorage.setItem('cacheOrderInfo', JSON.stringify(getCacheInfo));
1652
+ }
1551
1653
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "0.8.9-alpha.9",
3
+ "version": "0.8.9",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "^0.8.9-alpha.9",
36
- "@kmkf-fe-packages/kmkf-utils": "^0.8.9-alpha.9",
37
- "@kmkf-fe-packages/services-components": "^0.8.9-alpha.9",
35
+ "@kmkf-fe-packages/basic-components": "^0.8.9",
36
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.9",
37
+ "@kmkf-fe-packages/services-components": "^0.8.9",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -75,5 +75,5 @@
75
75
  "gitHooks": {
76
76
  "pre-commit": "lint-staged"
77
77
  },
78
- "gitHead": "a124d8ebee858486ada1ce09bc0601de9c5e2962"
78
+ "gitHead": "8e9ebe4b588b4e9921e42e34594319fba0c9995e"
79
79
  }