@kmkf-fe-packages/basic-components 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -8,378 +8,365 @@ import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
10
10
  import pubsub from 'pubsub-js';
11
-
12
- function _iterableToArrayLimit(r, l) {
13
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
14
- if (null != t) {
15
- var e,
16
- n,
17
- i,
18
- u,
19
- a = [],
20
- f = !0,
21
- o = !1;
11
+ import BigNumber from 'bignumber.js';
12
+
13
+ function _iterableToArrayLimit(arr, i) {
14
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
15
+ if (null != _i) {
16
+ var _s,
17
+ _e,
18
+ _x,
19
+ _r,
20
+ _arr = [],
21
+ _n = !0,
22
+ _d = !1;
22
23
  try {
23
- if (i = (t = t.call(r)).next, 0 === l) {
24
- if (Object(t) !== t) return;
25
- f = !1;
26
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
27
- } catch (r) {
28
- o = !0, n = r;
24
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
25
+ if (Object(_i) !== _i) return;
26
+ _n = !1;
27
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
28
+ } catch (err) {
29
+ _d = !0, _e = err;
29
30
  } finally {
30
31
  try {
31
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
32
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
32
33
  } finally {
33
- if (o) throw n;
34
+ if (_d) throw _e;
34
35
  }
35
36
  }
36
- return a;
37
+ return _arr;
37
38
  }
38
39
  }
39
- function ownKeys(e, r) {
40
- var t = Object.keys(e);
40
+ function ownKeys(object, enumerableOnly) {
41
+ var keys = Object.keys(object);
41
42
  if (Object.getOwnPropertySymbols) {
42
- var o = Object.getOwnPropertySymbols(e);
43
- r && (o = o.filter(function (r) {
44
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
45
- })), t.push.apply(t, o);
43
+ var symbols = Object.getOwnPropertySymbols(object);
44
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
45
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
46
+ })), keys.push.apply(keys, symbols);
46
47
  }
47
- return t;
48
- }
49
- function _objectSpread2(e) {
50
- for (var r = 1; r < arguments.length; r++) {
51
- var t = null != arguments[r] ? arguments[r] : {};
52
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
53
- _defineProperty(e, r, t[r]);
54
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
55
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
48
+ return keys;
49
+ }
50
+ function _objectSpread2(target) {
51
+ for (var i = 1; i < arguments.length; i++) {
52
+ var source = null != arguments[i] ? arguments[i] : {};
53
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
54
+ _defineProperty(target, key, source[key]);
55
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
56
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
56
57
  });
57
58
  }
58
- return e;
59
+ return target;
59
60
  }
60
61
  function _regeneratorRuntime() {
61
62
  _regeneratorRuntime = function () {
62
- return e;
63
- };
64
- var t,
65
- e = {},
66
- r = Object.prototype,
67
- n = r.hasOwnProperty,
68
- o = Object.defineProperty || function (t, e, r) {
69
- t[e] = r.value;
63
+ return exports;
64
+ };
65
+ var exports = {},
66
+ Op = Object.prototype,
67
+ hasOwn = Op.hasOwnProperty,
68
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
69
+ obj[key] = desc.value;
70
70
  },
71
- i = "function" == typeof Symbol ? Symbol : {},
72
- a = i.iterator || "@@iterator",
73
- c = i.asyncIterator || "@@asyncIterator",
74
- u = i.toStringTag || "@@toStringTag";
75
- function define(t, e, r) {
76
- return Object.defineProperty(t, e, {
77
- value: r,
71
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
72
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
73
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
74
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
75
+ function define(obj, key, value) {
76
+ return Object.defineProperty(obj, key, {
77
+ value: value,
78
78
  enumerable: !0,
79
79
  configurable: !0,
80
80
  writable: !0
81
- }), t[e];
81
+ }), obj[key];
82
82
  }
83
83
  try {
84
84
  define({}, "");
85
- } catch (t) {
86
- define = function (t, e, r) {
87
- return t[e] = r;
85
+ } catch (err) {
86
+ define = function (obj, key, value) {
87
+ return obj[key] = value;
88
88
  };
89
89
  }
90
- function wrap(t, e, r, n) {
91
- var i = e && e.prototype instanceof Generator ? e : Generator,
92
- a = Object.create(i.prototype),
93
- c = new Context(n || []);
94
- return o(a, "_invoke", {
95
- value: makeInvokeMethod(t, r, c)
96
- }), a;
90
+ function wrap(innerFn, outerFn, self, tryLocsList) {
91
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
92
+ generator = Object.create(protoGenerator.prototype),
93
+ context = new Context(tryLocsList || []);
94
+ return defineProperty(generator, "_invoke", {
95
+ value: makeInvokeMethod(innerFn, self, context)
96
+ }), generator;
97
97
  }
98
- function tryCatch(t, e, r) {
98
+ function tryCatch(fn, obj, arg) {
99
99
  try {
100
100
  return {
101
101
  type: "normal",
102
- arg: t.call(e, r)
102
+ arg: fn.call(obj, arg)
103
103
  };
104
- } catch (t) {
104
+ } catch (err) {
105
105
  return {
106
106
  type: "throw",
107
- arg: t
107
+ arg: err
108
108
  };
109
109
  }
110
110
  }
111
- e.wrap = wrap;
112
- var h = "suspendedStart",
113
- l = "suspendedYield",
114
- f = "executing",
115
- s = "completed",
116
- y = {};
111
+ exports.wrap = wrap;
112
+ var ContinueSentinel = {};
117
113
  function Generator() {}
118
114
  function GeneratorFunction() {}
119
115
  function GeneratorFunctionPrototype() {}
120
- var p = {};
121
- define(p, a, function () {
116
+ var IteratorPrototype = {};
117
+ define(IteratorPrototype, iteratorSymbol, function () {
122
118
  return this;
123
119
  });
124
- var d = Object.getPrototypeOf,
125
- v = d && d(d(values([])));
126
- v && v !== r && n.call(v, a) && (p = v);
127
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
128
- function defineIteratorMethods(t) {
129
- ["next", "throw", "return"].forEach(function (e) {
130
- define(t, e, function (t) {
131
- return this._invoke(e, t);
120
+ var getProto = Object.getPrototypeOf,
121
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
122
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
123
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
124
+ function defineIteratorMethods(prototype) {
125
+ ["next", "throw", "return"].forEach(function (method) {
126
+ define(prototype, method, function (arg) {
127
+ return this._invoke(method, arg);
132
128
  });
133
129
  });
134
130
  }
135
- function AsyncIterator(t, e) {
136
- function invoke(r, o, i, a) {
137
- var c = tryCatch(t[r], t, o);
138
- if ("throw" !== c.type) {
139
- var u = c.arg,
140
- h = u.value;
141
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
142
- invoke("next", t, i, a);
143
- }, function (t) {
144
- invoke("throw", t, i, a);
145
- }) : e.resolve(h).then(function (t) {
146
- u.value = t, i(u);
147
- }, function (t) {
148
- return invoke("throw", t, i, a);
131
+ function AsyncIterator(generator, PromiseImpl) {
132
+ function invoke(method, arg, resolve, reject) {
133
+ var record = tryCatch(generator[method], generator, arg);
134
+ if ("throw" !== record.type) {
135
+ var result = record.arg,
136
+ value = result.value;
137
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
138
+ invoke("next", value, resolve, reject);
139
+ }, function (err) {
140
+ invoke("throw", err, resolve, reject);
141
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
142
+ result.value = unwrapped, resolve(result);
143
+ }, function (error) {
144
+ return invoke("throw", error, resolve, reject);
149
145
  });
150
146
  }
151
- a(c.arg);
147
+ reject(record.arg);
152
148
  }
153
- var r;
154
- o(this, "_invoke", {
155
- value: function (t, n) {
149
+ var previousPromise;
150
+ defineProperty(this, "_invoke", {
151
+ value: function (method, arg) {
156
152
  function callInvokeWithMethodAndArg() {
157
- return new e(function (e, r) {
158
- invoke(t, n, e, r);
153
+ return new PromiseImpl(function (resolve, reject) {
154
+ invoke(method, arg, resolve, reject);
159
155
  });
160
156
  }
161
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
157
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
162
158
  }
163
159
  });
164
160
  }
165
- function makeInvokeMethod(e, r, n) {
166
- var o = h;
167
- return function (i, a) {
168
- if (o === f) throw new Error("Generator is already running");
169
- if (o === s) {
170
- if ("throw" === i) throw a;
171
- return {
172
- value: t,
173
- done: !0
174
- };
161
+ function makeInvokeMethod(innerFn, self, context) {
162
+ var state = "suspendedStart";
163
+ return function (method, arg) {
164
+ if ("executing" === state) throw new Error("Generator is already running");
165
+ if ("completed" === state) {
166
+ if ("throw" === method) throw arg;
167
+ return doneResult();
175
168
  }
176
- for (n.method = i, n.arg = a;;) {
177
- var c = n.delegate;
178
- if (c) {
179
- var u = maybeInvokeDelegate(c, n);
180
- if (u) {
181
- if (u === y) continue;
182
- return u;
169
+ for (context.method = method, context.arg = arg;;) {
170
+ var delegate = context.delegate;
171
+ if (delegate) {
172
+ var delegateResult = maybeInvokeDelegate(delegate, context);
173
+ if (delegateResult) {
174
+ if (delegateResult === ContinueSentinel) continue;
175
+ return delegateResult;
183
176
  }
184
177
  }
185
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
186
- if (o === h) throw o = s, n.arg;
187
- n.dispatchException(n.arg);
188
- } else "return" === n.method && n.abrupt("return", n.arg);
189
- o = f;
190
- var p = tryCatch(e, r, n);
191
- if ("normal" === p.type) {
192
- if (o = n.done ? s : l, p.arg === y) continue;
178
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
179
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
180
+ context.dispatchException(context.arg);
181
+ } else "return" === context.method && context.abrupt("return", context.arg);
182
+ state = "executing";
183
+ var record = tryCatch(innerFn, self, context);
184
+ if ("normal" === record.type) {
185
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
193
186
  return {
194
- value: p.arg,
195
- done: n.done
187
+ value: record.arg,
188
+ done: context.done
196
189
  };
197
190
  }
198
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
191
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
199
192
  }
200
193
  };
201
194
  }
202
- function maybeInvokeDelegate(e, r) {
203
- var n = r.method,
204
- o = e.iterator[n];
205
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
206
- var i = tryCatch(o, e.iterator, r.arg);
207
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
208
- var a = i.arg;
209
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
195
+ function maybeInvokeDelegate(delegate, context) {
196
+ var methodName = context.method,
197
+ method = delegate.iterator[methodName];
198
+ 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;
199
+ var record = tryCatch(method, delegate.iterator, context.arg);
200
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
201
+ var info = record.arg;
202
+ 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);
210
203
  }
211
- function pushTryEntry(t) {
212
- var e = {
213
- tryLoc: t[0]
204
+ function pushTryEntry(locs) {
205
+ var entry = {
206
+ tryLoc: locs[0]
214
207
  };
215
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
208
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
216
209
  }
217
- function resetTryEntry(t) {
218
- var e = t.completion || {};
219
- e.type = "normal", delete e.arg, t.completion = e;
210
+ function resetTryEntry(entry) {
211
+ var record = entry.completion || {};
212
+ record.type = "normal", delete record.arg, entry.completion = record;
220
213
  }
221
- function Context(t) {
214
+ function Context(tryLocsList) {
222
215
  this.tryEntries = [{
223
216
  tryLoc: "root"
224
- }], t.forEach(pushTryEntry, this), this.reset(!0);
217
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
225
218
  }
226
- function values(e) {
227
- if (e || "" === e) {
228
- var r = e[a];
229
- if (r) return r.call(e);
230
- if ("function" == typeof e.next) return e;
231
- if (!isNaN(e.length)) {
232
- var o = -1,
233
- i = function next() {
234
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
235
- return next.value = t, next.done = !0, next;
219
+ function values(iterable) {
220
+ if (iterable) {
221
+ var iteratorMethod = iterable[iteratorSymbol];
222
+ if (iteratorMethod) return iteratorMethod.call(iterable);
223
+ if ("function" == typeof iterable.next) return iterable;
224
+ if (!isNaN(iterable.length)) {
225
+ var i = -1,
226
+ next = function next() {
227
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
228
+ return next.value = undefined, next.done = !0, next;
236
229
  };
237
- return i.next = i;
230
+ return next.next = next;
238
231
  }
239
232
  }
240
- throw new TypeError(typeof e + " is not iterable");
233
+ return {
234
+ next: doneResult
235
+ };
241
236
  }
242
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
237
+ function doneResult() {
238
+ return {
239
+ value: undefined,
240
+ done: !0
241
+ };
242
+ }
243
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
243
244
  value: GeneratorFunctionPrototype,
244
245
  configurable: !0
245
- }), o(GeneratorFunctionPrototype, "constructor", {
246
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
246
247
  value: GeneratorFunction,
247
248
  configurable: !0
248
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
249
- var e = "function" == typeof t && t.constructor;
250
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
251
- }, e.mark = function (t) {
252
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
253
- }, e.awrap = function (t) {
249
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
250
+ var ctor = "function" == typeof genFun && genFun.constructor;
251
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
252
+ }, exports.mark = function (genFun) {
253
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
254
+ }, exports.awrap = function (arg) {
254
255
  return {
255
- __await: t
256
+ __await: arg
256
257
  };
257
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
258
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
258
259
  return this;
259
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
260
- void 0 === i && (i = Promise);
261
- var a = new AsyncIterator(wrap(t, r, n, o), i);
262
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
263
- return t.done ? t.value : a.next();
260
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
261
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
262
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
263
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
264
+ return result.done ? result.value : iter.next();
264
265
  });
265
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
266
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
266
267
  return this;
267
- }), define(g, "toString", function () {
268
+ }), define(Gp, "toString", function () {
268
269
  return "[object Generator]";
269
- }), e.keys = function (t) {
270
- var e = Object(t),
271
- r = [];
272
- for (var n in e) r.push(n);
273
- return r.reverse(), function next() {
274
- for (; r.length;) {
275
- var t = r.pop();
276
- if (t in e) return next.value = t, next.done = !1, next;
270
+ }), exports.keys = function (val) {
271
+ var object = Object(val),
272
+ keys = [];
273
+ for (var key in object) keys.push(key);
274
+ return keys.reverse(), function next() {
275
+ for (; keys.length;) {
276
+ var key = keys.pop();
277
+ if (key in object) return next.value = key, next.done = !1, next;
277
278
  }
278
279
  return next.done = !0, next;
279
280
  };
280
- }, e.values = values, Context.prototype = {
281
+ }, exports.values = values, Context.prototype = {
281
282
  constructor: Context,
282
- reset: function (e) {
283
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
283
+ reset: function (skipTempReset) {
284
+ 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);
284
285
  },
285
286
  stop: function () {
286
287
  this.done = !0;
287
- var t = this.tryEntries[0].completion;
288
- if ("throw" === t.type) throw t.arg;
288
+ var rootRecord = this.tryEntries[0].completion;
289
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
289
290
  return this.rval;
290
291
  },
291
- dispatchException: function (e) {
292
- if (this.done) throw e;
293
- var r = this;
294
- function handle(n, o) {
295
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
292
+ dispatchException: function (exception) {
293
+ if (this.done) throw exception;
294
+ var context = this;
295
+ function handle(loc, caught) {
296
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
296
297
  }
297
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
298
- var i = this.tryEntries[o],
299
- a = i.completion;
300
- if ("root" === i.tryLoc) return handle("end");
301
- if (i.tryLoc <= this.prev) {
302
- var c = n.call(i, "catchLoc"),
303
- u = n.call(i, "finallyLoc");
304
- if (c && u) {
305
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
306
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
307
- } else if (c) {
308
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
298
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
299
+ var entry = this.tryEntries[i],
300
+ record = entry.completion;
301
+ if ("root" === entry.tryLoc) return handle("end");
302
+ if (entry.tryLoc <= this.prev) {
303
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
304
+ hasFinally = hasOwn.call(entry, "finallyLoc");
305
+ if (hasCatch && hasFinally) {
306
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
307
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
308
+ } else if (hasCatch) {
309
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
309
310
  } else {
310
- if (!u) throw new Error("try statement without catch or finally");
311
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
311
+ if (!hasFinally) throw new Error("try statement without catch or finally");
312
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
312
313
  }
313
314
  }
314
315
  }
315
316
  },
316
- abrupt: function (t, e) {
317
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
318
- var o = this.tryEntries[r];
319
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
320
- var i = o;
317
+ abrupt: function (type, arg) {
318
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
319
+ var entry = this.tryEntries[i];
320
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
321
+ var finallyEntry = entry;
321
322
  break;
322
323
  }
323
324
  }
324
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
325
- var a = i ? i.completion : {};
326
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
325
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
326
+ var record = finallyEntry ? finallyEntry.completion : {};
327
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
327
328
  },
328
- complete: function (t, e) {
329
- if ("throw" === t.type) throw t.arg;
330
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
329
+ complete: function (record, afterLoc) {
330
+ if ("throw" === record.type) throw record.arg;
331
+ 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;
331
332
  },
332
- finish: function (t) {
333
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
334
- var r = this.tryEntries[e];
335
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
333
+ finish: function (finallyLoc) {
334
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
335
+ var entry = this.tryEntries[i];
336
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
336
337
  }
337
338
  },
338
- catch: function (t) {
339
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
340
- var r = this.tryEntries[e];
341
- if (r.tryLoc === t) {
342
- var n = r.completion;
343
- if ("throw" === n.type) {
344
- var o = n.arg;
345
- resetTryEntry(r);
339
+ catch: function (tryLoc) {
340
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
341
+ var entry = this.tryEntries[i];
342
+ if (entry.tryLoc === tryLoc) {
343
+ var record = entry.completion;
344
+ if ("throw" === record.type) {
345
+ var thrown = record.arg;
346
+ resetTryEntry(entry);
346
347
  }
347
- return o;
348
+ return thrown;
348
349
  }
349
350
  }
350
351
  throw new Error("illegal catch attempt");
351
352
  },
352
- delegateYield: function (e, r, n) {
353
+ delegateYield: function (iterable, resultName, nextLoc) {
353
354
  return this.delegate = {
354
- iterator: values(e),
355
- resultName: r,
356
- nextLoc: n
357
- }, "next" === this.method && (this.arg = t), y;
358
- }
359
- }, e;
360
- }
361
- function _toPrimitive(t, r) {
362
- if ("object" != typeof t || !t) return t;
363
- var e = t[Symbol.toPrimitive];
364
- if (void 0 !== e) {
365
- var i = e.call(t, r || "default");
366
- if ("object" != typeof i) return i;
367
- throw new TypeError("@@toPrimitive must return a primitive value.");
368
- }
369
- return ("string" === r ? String : Number)(t);
370
- }
371
- function _toPropertyKey(t) {
372
- var i = _toPrimitive(t, "string");
373
- return "symbol" == typeof i ? i : String(i);
355
+ iterator: values(iterable),
356
+ resultName: resultName,
357
+ nextLoc: nextLoc
358
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
359
+ }
360
+ }, exports;
374
361
  }
375
- function _typeof(o) {
362
+ function _typeof(obj) {
376
363
  "@babel/helpers - typeof";
377
364
 
378
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
379
- return typeof o;
380
- } : function (o) {
381
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
382
- }, _typeof(o);
365
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
366
+ return typeof obj;
367
+ } : function (obj) {
368
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
369
+ }, _typeof(obj);
383
370
  }
384
371
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
385
372
  try {
@@ -486,6 +473,20 @@ function _nonIterableSpread() {
486
473
  function _nonIterableRest() {
487
474
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
488
475
  }
476
+ function _toPrimitive(input, hint) {
477
+ if (typeof input !== "object" || input === null) return input;
478
+ var prim = input[Symbol.toPrimitive];
479
+ if (prim !== undefined) {
480
+ var res = prim.call(input, hint || "default");
481
+ if (typeof res !== "object") return res;
482
+ throw new TypeError("@@toPrimitive must return a primitive value.");
483
+ }
484
+ return (hint === "string" ? String : Number)(input);
485
+ }
486
+ function _toPropertyKey(arg) {
487
+ var key = _toPrimitive(arg, "string");
488
+ return typeof key === "symbol" ? key : String(key);
489
+ }
489
490
 
490
491
  function ApaasCascader(props) {
491
492
  return /*#__PURE__*/React.createElement(Cascader, _objectSpread2({
@@ -10442,7 +10443,7 @@ var jstGoods = function jstGoods(props) {
10442
10443
  var wdtSendOptions = WdtSendData.getInstance().wdtSendData || [];
10443
10444
  useEffect(function () {
10444
10445
  //没有值塞个默认值
10445
- if (!(value === null || value === void 0 ? void 0 : value.length)) {
10446
+ if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
10446
10447
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10447
10448
  }
10448
10449
  }, [value, type]);
@@ -10505,7 +10506,7 @@ var jstGoods = function jstGoods(props) {
10505
10506
  return setChangeIndex(index);
10506
10507
  }
10507
10508
  }, "\u5305\u88F9".concat(index + 1)));
10508
- }))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React.createElement(ApaasLogistics, {
10509
+ }))) : null, value.length || type === 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React.createElement(ApaasLogistics, {
10509
10510
  disabled: disabled,
10510
10511
  placeholder: "\u7269\u6D41\u516C\u53F8",
10511
10512
  onChange: function onChange(val) {
@@ -11662,9 +11663,34 @@ var GoodItem$1 = function GoodItem(props) {
11662
11663
  useEffect(function () {
11663
11664
  setSelectedRowKeys([]);
11664
11665
  }, [tableSelect, selectType]);
11665
- var updateHandle = function updateHandle(val, index, type) {
11666
+ var updateHandle = function updateHandle(val, index, columnType) {
11666
11667
  if (value === null || value === void 0 ? void 0 : value.length) {
11667
- value[index][type] = val;
11668
+ value[index][columnType] = val;
11669
+ if (type === 'WDT_RETURN_GOODS') {
11670
+ if (['sharePrice', 'num'].includes(columnType)) {
11671
+ var totalMoney = null;
11672
+ if (columnType === 'num') {
11673
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
11674
+ } else {
11675
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
11676
+ }
11677
+ if (totalMoney !== null) {
11678
+ value[index]['returnPrice'] = totalMoney.toString();
11679
+ }
11680
+ }
11681
+ } else if (type === 'WDT_EXCHANGE_GOODS') {
11682
+ if (['price', 'num'].includes(columnType)) {
11683
+ var _totalMoney = null;
11684
+ if (columnType === 'num') {
11685
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
11686
+ } else {
11687
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
11688
+ }
11689
+ if (_totalMoney !== null) {
11690
+ value[index]['exchangePrice'] = _totalMoney.toString();
11691
+ }
11692
+ }
11693
+ }
11668
11694
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11669
11695
  }
11670
11696
  };
@@ -11770,6 +11796,260 @@ var GoodItem$1 = function GoodItem(props) {
11770
11796
  }
11771
11797
  }];
11772
11798
  break;
11799
+ case 'WDT_RETURN_GOODS':
11800
+ {
11801
+ columns = [{
11802
+ dataIndex: 'goodId',
11803
+ title: "SPUID",
11804
+ align: 'center',
11805
+ ellipsis: true,
11806
+ width: 70
11807
+ }, {
11808
+ dataIndex: 'goodNo',
11809
+ title: "\u5546\u54C1SPU\u7F16\u7801",
11810
+ align: 'center',
11811
+ ellipsis: true,
11812
+ width: 180
11813
+ }, {
11814
+ dataIndex: 'goodName',
11815
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11816
+ align: 'center',
11817
+ ellipsis: true,
11818
+ width: 250
11819
+ }, {
11820
+ dataIndex: 'specId',
11821
+ title: "".concat(text, "SKUID"),
11822
+ align: 'center',
11823
+ ellipsis: true,
11824
+ width: 100
11825
+ }, {
11826
+ dataIndex: 'specNo',
11827
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11828
+ align: 'center',
11829
+ ellipsis: true,
11830
+ width: 180
11831
+ }, {
11832
+ dataIndex: 'specName',
11833
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11834
+ align: 'center',
11835
+ ellipsis: true,
11836
+ width: 250
11837
+ }, {
11838
+ dataIndex: 'num',
11839
+ title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
11840
+ align: 'center',
11841
+ ellipsis: true,
11842
+ width: 100,
11843
+ render: function render(val, record, index) {
11844
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11845
+ style: {
11846
+ width: 70
11847
+ },
11848
+ value: val,
11849
+ min: 1,
11850
+ precision: 0,
11851
+ onChange: function onChange(num) {
11852
+ return updateHandle(num, index, 'num');
11853
+ }
11854
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11855
+ }
11856
+ }, {
11857
+ dataIndex: 'sharePrice',
11858
+ title: "\u5206\u644A\u4EF7",
11859
+ align: 'center',
11860
+ ellipsis: true,
11861
+ width: 80,
11862
+ render: function render(val, record, index) {
11863
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11864
+ style: {
11865
+ width: 70
11866
+ },
11867
+ value: val,
11868
+ min: 0,
11869
+ onChange: function onChange(value) {
11870
+ return updateHandle(value, index, 'sharePrice');
11871
+ }
11872
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11873
+ }
11874
+ }, {
11875
+ dataIndex: 'returnPrice',
11876
+ title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
11877
+ align: 'center',
11878
+ ellipsis: true,
11879
+ width: 100
11880
+ }, {
11881
+ dataIndex: 'giftType',
11882
+ title: "\u8D60\u54C1\u65B9\u5F0F",
11883
+ align: 'center',
11884
+ ellipsis: true,
11885
+ width: 100,
11886
+ render: function render(val) {
11887
+ var giftTypeMap = {
11888
+ 0: '非赠品',
11889
+ 1: '自动赠送',
11890
+ 2: '手工赠送',
11891
+ 3: '回购自动送赠品',
11892
+ 4: '前N有礼送赠品',
11893
+ 6: '天猫优仓赠品',
11894
+ 7: '淘宝CRM会员送赠'
11895
+ };
11896
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
11897
+ }
11898
+ }, {
11899
+ dataIndex: 'type',
11900
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
11901
+ align: 'center',
11902
+ ellipsis: true,
11903
+ width: 100,
11904
+ render: function render(val, record, index) {
11905
+ var options = [{
11906
+ label: '单品',
11907
+ value: '1'
11908
+ }, {
11909
+ label: '组合装',
11910
+ value: '2'
11911
+ }];
11912
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
11913
+ style: {
11914
+ width: 70
11915
+ },
11916
+ options: options,
11917
+ value: val,
11918
+ onChange: function onChange(value) {
11919
+ return updateHandle(value, index, 'type');
11920
+ }
11921
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11922
+ }
11923
+ }];
11924
+ }
11925
+ break;
11926
+ case 'WDT_EXCHANGE_GOODS':
11927
+ {
11928
+ columns = [{
11929
+ dataIndex: 'goodId',
11930
+ title: "SPUID",
11931
+ align: 'center',
11932
+ ellipsis: true,
11933
+ width: 70
11934
+ }, {
11935
+ dataIndex: 'goodNo',
11936
+ title: "\u5546\u54C1SPU\u7F16\u7801",
11937
+ align: 'center',
11938
+ ellipsis: true,
11939
+ width: 180
11940
+ }, {
11941
+ dataIndex: 'goodName',
11942
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11943
+ align: 'center',
11944
+ ellipsis: true,
11945
+ width: 250
11946
+ }, {
11947
+ dataIndex: 'specId',
11948
+ title: "".concat(text, "SKUID"),
11949
+ align: 'center',
11950
+ ellipsis: true,
11951
+ width: 100
11952
+ }, {
11953
+ dataIndex: 'specNo',
11954
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11955
+ align: 'center',
11956
+ ellipsis: true,
11957
+ width: 180
11958
+ }, {
11959
+ dataIndex: 'specName',
11960
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11961
+ align: 'center',
11962
+ ellipsis: true,
11963
+ width: 250
11964
+ }, {
11965
+ dataIndex: 'num',
11966
+ title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
11967
+ align: 'center',
11968
+ ellipsis: true,
11969
+ width: 100,
11970
+ render: function render(val, record, index) {
11971
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11972
+ style: {
11973
+ width: 70
11974
+ },
11975
+ value: val,
11976
+ min: 1,
11977
+ precision: 0,
11978
+ onChange: function onChange(num) {
11979
+ return updateHandle(num, index, 'num');
11980
+ }
11981
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11982
+ }
11983
+ }, {
11984
+ dataIndex: 'price',
11985
+ title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
11986
+ align: 'center',
11987
+ ellipsis: true,
11988
+ width: 100,
11989
+ render: function render(val, record, index) {
11990
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11991
+ style: {
11992
+ width: 70
11993
+ },
11994
+ value: val,
11995
+ min: 0,
11996
+ onChange: function onChange(value) {
11997
+ return updateHandle(value, index, 'price');
11998
+ }
11999
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12000
+ }
12001
+ }, {
12002
+ dataIndex: 'exchangePrice',
12003
+ title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
12004
+ align: 'center',
12005
+ ellipsis: true,
12006
+ width: 100
12007
+ }, {
12008
+ dataIndex: 'giftType',
12009
+ title: "\u8D60\u54C1\u65B9\u5F0F",
12010
+ align: 'center',
12011
+ ellipsis: true,
12012
+ width: 100,
12013
+ render: function render(val) {
12014
+ var giftTypeMap = {
12015
+ 0: '非赠品',
12016
+ 1: '自动赠送',
12017
+ 2: '手工赠送',
12018
+ 3: '回购自动送赠品',
12019
+ 4: '前N有礼送赠品',
12020
+ 6: '天猫优仓赠品',
12021
+ 7: '淘宝CRM会员送赠'
12022
+ };
12023
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12024
+ }
12025
+ }, {
12026
+ dataIndex: 'type',
12027
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12028
+ align: 'center',
12029
+ ellipsis: true,
12030
+ width: 100,
12031
+ render: function render(val, record, index) {
12032
+ var options = [{
12033
+ label: '单品',
12034
+ value: '1'
12035
+ }, {
12036
+ label: '组合装',
12037
+ value: '2'
12038
+ }];
12039
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
12040
+ style: {
12041
+ width: 70
12042
+ },
12043
+ options: options,
12044
+ value: val,
12045
+ onChange: function onChange(value) {
12046
+ return updateHandle(value, index, 'type');
12047
+ }
12048
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12049
+ }
12050
+ }];
12051
+ }
12052
+ break;
11773
12053
  default:
11774
12054
  columns = [{
11775
12055
  dataIndex: 'mark',
@@ -11911,7 +12191,7 @@ var GoodItem$1 = function GoodItem(props) {
11911
12191
  }, [showHeader, value, disabled]);
11912
12192
  var onSubmit = function onSubmit(list) {
11913
12193
  var newList = [];
11914
- if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
12194
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
11915
12195
  newList = list.map(function (item) {
11916
12196
  item.uuid = uuid();
11917
12197
  item.canDelete = true;
@@ -11919,6 +12199,10 @@ var GoodItem$1 = function GoodItem(props) {
11919
12199
  item.orderPrice = 0;
11920
12200
  item.sharePrice = 0;
11921
12201
  item.canUpdateNumber = canUpdateNumber;
12202
+ if (type === 'WDT_EXCHANGE_GOODS') {
12203
+ item.price = item.retailPrice;
12204
+ item.type = '1';
12205
+ }
11922
12206
  return item;
11923
12207
  });
11924
12208
  } else {
@@ -11989,7 +12273,7 @@ var GoodItem$1 = function GoodItem(props) {
11989
12273
  locale: {
11990
12274
  emptyText: '暂无数据'
11991
12275
  }
11992
- })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
12276
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11993
12277
  ref: refModal,
11994
12278
  onSubmit: onSubmit,
11995
12279
  width: width,
@@ -12859,8 +13143,10 @@ var componentMap$1 = {
12859
13143
  reissueType: 'wdtReissueType',
12860
13144
  returnType: 'wdtReturnType',
12861
13145
  returnSelectListReturn: 'wdtReturnSelectListReturn',
13146
+ returnSelectList: 'wdtReturnSelectList',
12862
13147
  deleteGood: 'wdtDeleteGood',
12863
- returnDeleteGood: 'wdtReturnDeleteGood'
13148
+ returnDeleteGood: 'wdtReturnDeleteGood',
13149
+ exchangeDeleteGood: 'wdtExchangeDeleteGood'
12864
13150
  }
12865
13151
  }
12866
13152
  };
@@ -12927,7 +13213,7 @@ var CommonGoods = function CommonGoods(props) {
12927
13213
  setTableSelect(['2', '4'].includes(data.val));
12928
13214
  if (['1', '3'].includes(data.val)) {
12929
13215
  var _valueRef$current5, _valueRef$current6;
12930
- pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
13216
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnSelectListReturn, {
12931
13217
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5[componentMap$1[compType].key]) || []),
12932
13218
  shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12933
13219
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
@@ -12945,15 +13231,15 @@ var CommonGoods = function CommonGoods(props) {
12945
13231
  };
12946
13232
  }, [disabled]);
12947
13233
  var _onSelect = function onSelect(list) {
12948
- var _withInfo$current, _withInfo$current2, _valueRef$current7;
13234
+ var _typeMap, _withInfo$current, _withInfo$current2, _valueRef$current7;
12949
13235
  if (disabled) return;
12950
13236
  var newList = cloneDeep(list);
12951
- var typeMap = _defineProperty({
13237
+ var typeMap = (_typeMap = {
12952
13238
  // type: componentMap[compType].eventNameMap.selectList,
12953
13239
  // returnType: componentMap[compType].eventNameMap.returnSelectList,
12954
13240
  // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
12955
13241
  type: componentMap$1[compType].eventNameMap.selectList
12956
- }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
13242
+ }, _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList), _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReturnType"), componentMap$1[compType].eventNameMap.returnSelectList), _typeMap);
12957
13243
  var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12958
13244
  // console.log('onSelect', type, withInfo.current, newList);
12959
13245
  pubsub.publish(type, {
@@ -12971,6 +13257,7 @@ var CommonGoods = function CommonGoods(props) {
12971
13257
  pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12972
13258
  pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12973
13259
  pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
13260
+ pubsub.publish(componentMap$1[compType].eventNameMap.exchangeDeleteGood, deleteId);
12974
13261
  };
12975
13262
  var changeHandle = function changeHandle(list) {
12976
13263
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
@@ -12995,6 +13282,263 @@ var CommonGoods = function CommonGoods(props) {
12995
13282
  }));
12996
13283
  };
12997
13284
 
13285
+ var componentMap$2 = {
13286
+ 'WDT_RETURN_GOODS': {
13287
+ type: 'wdt',
13288
+ valueKey: 'wdtReturnGoods',
13289
+ returnTypeKey: 'wdtReturnType',
13290
+ name: '旺店通',
13291
+ eventNameMap: {
13292
+ changeShopCode: 'wdtChangeShopCode',
13293
+ returnType: 'wdtReturnType',
13294
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
13295
+ returnDeleteGood: 'wdtReturnDeleteGood',
13296
+ returnSelectList: 'wdtReturnSelectList',
13297
+ exchangeCopyGood: 'wdtExchangeCopyGood',
13298
+ exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13299
+ }
13300
+ }
13301
+ };
13302
+ var CommonReturnGoods = function CommonReturnGoods(props) {
13303
+ var value = props.value,
13304
+ onChange = props.onChange,
13305
+ _props$reasonList = props.reasonList,
13306
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13307
+ disabled = props.disabled,
13308
+ compType = props.type;
13309
+ var valueRef = useRef({});
13310
+ useEffect(function () {
13311
+ var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.exchangeCopyGood, function () {
13312
+ var _valueRef$current, _valueRef$current2;
13313
+ pubsub.publish(componentMap$2[compType].eventNameMap.exchangeBackCopyGood, {
13314
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[componentMap$2[compType].valueKey]) || []),
13315
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode
13316
+ });
13317
+ });
13318
+ return function () {
13319
+ pubsub.unsubscribe(subscription);
13320
+ };
13321
+ }, []);
13322
+ useEffect(function () {
13323
+ var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.returnSelectList, function (_, data) {
13324
+ if (disabled) return;
13325
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13326
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13327
+ });
13328
+ if (compType === 'WDT_RETURN_GOODS') {
13329
+ newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13330
+ if (typeof item.type === 'undefined') {
13331
+ item.type = '1';
13332
+ }
13333
+ if (typeof item.returnPrice === 'undefined') {
13334
+ item.returnPrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.sharePrice)).toString();
13335
+ }
13336
+ if (item.srcOid) {
13337
+ item.oid = item.srcOid;
13338
+ }
13339
+ return item;
13340
+ });
13341
+ } else {
13342
+ newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13343
+ }
13344
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13345
+ });
13346
+ return function () {
13347
+ pubsub.unsubscribe(subscription);
13348
+ };
13349
+ }, []);
13350
+ useEffect(function () {
13351
+ var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.returnSelectListReturn, function (_, data) {
13352
+ if (disabled) return;
13353
+ var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13354
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13355
+ });
13356
+ if (compType === 'WDT_RETURN_GOODS') {
13357
+ newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13358
+ if (typeof item.type === 'undefined') {
13359
+ item.type = '1';
13360
+ }
13361
+ if (typeof item.returnPrice === 'undefined') {
13362
+ item.returnPrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.sharePrice)).toString();
13363
+ }
13364
+ if (item.srcOid) {
13365
+ item.oid = item.srcOid;
13366
+ }
13367
+ return item;
13368
+ });
13369
+ } else {
13370
+ newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13371
+ }
13372
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13373
+ });
13374
+ return function () {
13375
+ pubsub.unsubscribe(subscription);
13376
+ };
13377
+ }, []);
13378
+ useEffect(function () {
13379
+ valueRef.current = value;
13380
+ pubsub.subscribeOnce(componentMap$2[compType].eventNameMap.returnDeleteGood, function (_, data) {
13381
+ if (disabled) return;
13382
+ if (value) {
13383
+ var newValue = _objectSpread2({}, value);
13384
+ newValue[componentMap$2[compType].valueKey] = newValue[componentMap$2[compType].valueKey].filter(function (item) {
13385
+ return item.sku !== data;
13386
+ });
13387
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13388
+ }
13389
+ });
13390
+ pubsub.subscribeOnce(componentMap$2[compType].eventNameMap.changeShopCode, function (type, data) {
13391
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13392
+ shopCode: data.shopCode
13393
+ }));
13394
+ });
13395
+ }, [value, disabled]);
13396
+ var changeTypeHandle = function changeTypeHandle(val) {
13397
+ var newValue = _objectSpread2({}, value);
13398
+ newValue[componentMap$2[compType].returnTypeKey] = val;
13399
+ newValue[componentMap$2[compType].valueKey] = [];
13400
+ if (['2'].includes(val[0])) {
13401
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13402
+ valueRef.current = newValue;
13403
+ }
13404
+ pubsub.publish(componentMap$2[compType].eventNameMap.returnType, {
13405
+ val: val[0],
13406
+ goodValue: newValue
13407
+ });
13408
+ };
13409
+ var changeGoodHandle = function changeGoodHandle(val) {
13410
+ var newValue = _objectSpread2({}, value);
13411
+ newValue[componentMap$2[compType].valueKey] = val;
13412
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13413
+ };
13414
+ //显示选择商品按钮 原单换不显示选择商品
13415
+ // const showChangeBtn = useMemo(() => {
13416
+ // return ['2'].includes(value?.[componentMap[compType].returnTypeKey]?.[0]);
13417
+ // }, [value?.[componentMap[compType].returnTypeKey]]);
13418
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
13419
+ style: {
13420
+ marginBottom: '8px'
13421
+ },
13422
+ disabled: disabled,
13423
+ allowClear: false,
13424
+ options: reasonList,
13425
+ value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].returnTypeKey],
13426
+ onChange: function onChange(val) {
13427
+ return changeTypeHandle(val);
13428
+ }
13429
+ }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13430
+ key: componentMap$2[compType].type
13431
+ }, props), {}, {
13432
+ disabled: disabled,
13433
+ canUpdateNumber: true,
13434
+ showChangeBtn: false,
13435
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13436
+ value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].valueKey],
13437
+ onChange: function onChange(val) {
13438
+ return changeGoodHandle(val);
13439
+ }
13440
+ })));
13441
+ };
13442
+
13443
+ var componentMap$3 = {
13444
+ 'WDT_EXCHANGE_GOODS': {
13445
+ type: 'wdt',
13446
+ valueKey: 'wdtExchangeGoods',
13447
+ returnTypeKey: 'wdtExchangeType',
13448
+ name: '旺店通',
13449
+ eventNameMap: {
13450
+ changeShopCode: 'wdtChangeShopCode',
13451
+ exchangeDeleteGood: 'wdtExchangeDeleteGood',
13452
+ exchangeCopyGood: 'wdtExchangeCopyGood',
13453
+ exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13454
+ }
13455
+ }
13456
+ };
13457
+ var CommonExchangeGoods = function CommonExchangeGoods(props) {
13458
+ var value = props.value,
13459
+ onChange = props.onChange,
13460
+ disabled = props.disabled,
13461
+ compType = props.type;
13462
+ var valueRef = useRef({});
13463
+ useEffect(function () {
13464
+ var subscription = pubsub.subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
13465
+ if (disabled) return;
13466
+ var newValue = {
13467
+ shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13468
+ };
13469
+ if (compType === 'WDT_EXCHANGE_GOODS') {
13470
+ newValue[componentMap$3[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13471
+ if (typeof item.type === 'undefined') {
13472
+ item.type = '1';
13473
+ }
13474
+ item.price = item.sharePrice;
13475
+ if (typeof item.exchangePrice === 'undefined') {
13476
+ item.exchangePrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.price)).toString();
13477
+ }
13478
+ return item;
13479
+ });
13480
+ } else {
13481
+ newValue[componentMap$3[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13482
+ }
13483
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13484
+ });
13485
+ return function () {
13486
+ pubsub.unsubscribe(subscription);
13487
+ };
13488
+ });
13489
+ useEffect(function () {
13490
+ valueRef.current = value;
13491
+ pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.exchangeDeleteGood, function (_, data) {
13492
+ if (disabled) return;
13493
+ if (value) {
13494
+ var newValue = _objectSpread2({}, value);
13495
+ newValue[componentMap$3[compType].valueKey] = newValue[componentMap$3[compType].valueKey].filter(function (item) {
13496
+ return item.sku !== data;
13497
+ });
13498
+ onChange(newValue);
13499
+ }
13500
+ });
13501
+ pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.changeShopCode, function (type, data) {
13502
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13503
+ shopCode: data.shopCode
13504
+ }));
13505
+ });
13506
+ }, [value]);
13507
+ var changeGoodHandle = function changeGoodHandle(val) {
13508
+ var newValue = _objectSpread2({}, value);
13509
+ if (compType === 'WDT_EXCHANGE_GOODS') {
13510
+ val = val.map(function (item) {
13511
+ item.exchangePrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.price)).toString();
13512
+ return item;
13513
+ });
13514
+ }
13515
+ newValue[componentMap$3[compType].valueKey] = val;
13516
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13517
+ };
13518
+ var copyGoods = function copyGoods() {
13519
+ var copyHandle = function copyHandle() {
13520
+ pubsub.publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, 'WDT_EXCHANGE_GOODS');
13521
+ };
13522
+ return /*#__PURE__*/React.createElement(Button, {
13523
+ type: "link",
13524
+ onClick: copyHandle
13525
+ }, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
13526
+ };
13527
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13528
+ key: componentMap$3[compType].type
13529
+ }, props), {}, {
13530
+ disabled: disabled,
13531
+ canUpdateNumber: true,
13532
+ showChangeBtn: true,
13533
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13534
+ value: value === null || value === void 0 ? void 0 : value[componentMap$3[compType].valueKey],
13535
+ otherOperations: copyGoods(),
13536
+ onChange: function onChange(val) {
13537
+ return changeGoodHandle(val);
13538
+ }
13539
+ })));
13540
+ };
13541
+
12998
13542
  var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
12999
13543
  var typeMap$1 = {
13000
13544
  WDT_REISSUE_GOODS: {
@@ -13783,7 +14327,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13783
14327
  changeIndex = _useState2[0],
13784
14328
  setChangeIndex = _useState2[1]; //选中的包裹
13785
14329
  useEffect(function () {
13786
- if (!(value === null || value === void 0 ? void 0 : value.length)) {
14330
+ if (!(value === null || value === void 0 ? void 0 : value.length) && type === 1) {
13787
14331
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap$1[type].initValue);
13788
14332
  }
13789
14333
  }, [value, type]);
@@ -13822,7 +14366,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13822
14366
  return setChangeIndex(index);
13823
14367
  }
13824
14368
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
13825
- }))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
14369
+ }))) : null, value.length || type !== 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
13826
14370
  disabled: disabled,
13827
14371
  placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
13828
14372
  onChange: function onChange(e) {
@@ -13837,12 +14381,18 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13837
14381
  },
13838
14382
  value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
13839
14383
  })) : null, type === 3 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
13840
- disabled: true,
14384
+ disabled: disabled,
13841
14385
  placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
14386
+ onChange: function onChange(e) {
14387
+ return changeInputHandle(e.target.value, 'billNo');
14388
+ },
13842
14389
  value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
13843
14390
  })) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
13844
- disabled: true,
14391
+ disabled: disabled,
13845
14392
  placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
14393
+ onChange: function onChange(e) {
14394
+ return changeInputHandle(e.target.value, 'billNo');
14395
+ },
13846
14396
  value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
13847
14397
  })) : null) : null);
13848
14398
  };
@@ -13904,7 +14454,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13904
14454
  return setChangeIndex(index);
13905
14455
  }
13906
14456
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
13907
- }))) : null, value.length && type === 1 || type === 2 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
14457
+ }))) : null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
13908
14458
  showSearch: true,
13909
14459
  value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
13910
14460
  filterOption: function filterOption(input, option) {
@@ -13920,7 +14470,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13920
14470
  }
13921
14471
  }))), ((_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.reason) ? /*#__PURE__*/React.createElement("div", {
13922
14472
  className: "c-red"
13923
- }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
14473
+ }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null));
13924
14474
  };
13925
14475
 
13926
14476
  var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
@@ -14008,4 +14558,4 @@ var CalculationInput = function CalculationInput(props) {
14008
14558
  }, config === null || config === void 0 ? void 0 : config.unit));
14009
14559
  };
14010
14560
 
14011
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
14561
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };