@kmkf-fe-packages/basic-components 0.1.3-alpha.4 → 0.2.2-alpha.0

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.
Files changed (46) hide show
  1. package/dist/apaas/ApaasAddress/index.d.ts +13 -0
  2. package/dist/apaas/ApaasCascader/index.d.ts +2 -0
  3. package/dist/apaas/ApaasCheckbox/index.d.ts +21 -0
  4. package/dist/apaas/ApaasDate/index.d.ts +8 -0
  5. package/dist/apaas/ApaasInput/index.d.ts +7 -0
  6. package/dist/apaas/ApaasInputNumber/index.d.ts +3 -0
  7. package/dist/apaas/ApaasMultipleSelect/index.d.ts +3 -0
  8. package/dist/apaas/ApaasRadio/index.d.ts +21 -0
  9. package/dist/apaas/ApaasRate/index.d.ts +17 -0
  10. package/dist/apaas/ApaasSelect/index.d.ts +12 -0
  11. package/dist/apaas/ApaasSlider/index.d.ts +9 -0
  12. package/dist/apaas/ApaasTextArea/index.d.ts +7 -0
  13. package/dist/apaas/ApaasUpload/index.d.ts +13 -0
  14. package/dist/apaas/ApaasUploadAsync/index.d.ts +16 -0
  15. package/dist/apaas/hoc/withFormItem.d.ts +12 -0
  16. package/dist/basics/FormItem/index.d.ts +2 -0
  17. package/dist/business/Address/index.d.ts +13 -0
  18. package/dist/business/AliPay/index.d.ts +13 -0
  19. package/dist/business/BuyerNick/index.d.ts +14 -0
  20. package/dist/business/ChooseBaby/index.d.ts +3 -0
  21. package/dist/business/ExpressLogistics/index.d.ts +3 -0
  22. package/dist/business/Invoice/index.d.ts +14 -0
  23. package/dist/business/LogisticsInterception/index.d.ts +21 -0
  24. package/dist/business/Payment/index.d.ts +14 -0
  25. package/dist/business/Remark/index.d.ts +12 -0
  26. package/dist/business/ShopName/index.d.ts +8 -0
  27. package/dist/business/Status/index.d.ts +16 -0
  28. package/dist/business/Supplier/index.d.ts +3 -0
  29. package/dist/business/TBGoodId/index.d.ts +3 -0
  30. package/dist/business/TBGoodSerial/index.d.ts +3 -0
  31. package/dist/business/TradeId/index.d.ts +10 -0
  32. package/dist/common/ExpressCompany/index.d.ts +7 -0
  33. package/dist/common/Goods/goodModel.d.ts +15 -0
  34. package/dist/common/Goods/index.d.ts +37 -0
  35. package/dist/common/GoodsTable/goodModel.d.ts +13 -0
  36. package/dist/common/GoodsTable/index.d.ts +14 -0
  37. package/dist/common/Logistics/index.d.ts +3 -0
  38. package/dist/common/Sku/index.d.ts +14 -0
  39. package/dist/common/request.d.ts +2 -0
  40. package/dist/config/utils.d.ts +3 -0
  41. package/dist/index.d.ts +35 -0
  42. package/dist/index.esm.js +3948 -0
  43. package/dist/index.js +3992 -0
  44. package/dist/jst/Goods/index.d.ts +10 -0
  45. package/dist/jst/ItemList/index.d.ts +19 -0
  46. package/package.json +2 -2
package/dist/index.js ADDED
@@ -0,0 +1,3992 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var antd = require('antd');
7
+ var icons = require('@ant-design/icons');
8
+ var request = require('umi-request');
9
+ var zhCN = require('antd/lib/locale/zh_CN');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+ var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
15
+ var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
16
+
17
+ function _iterableToArrayLimit(arr, i) {
18
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
19
+ if (null != _i) {
20
+ var _s,
21
+ _e,
22
+ _x,
23
+ _r,
24
+ _arr = [],
25
+ _n = !0,
26
+ _d = !1;
27
+ try {
28
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
29
+ if (Object(_i) !== _i) return;
30
+ _n = !1;
31
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
32
+ } catch (err) {
33
+ _d = !0, _e = err;
34
+ } finally {
35
+ try {
36
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
37
+ } finally {
38
+ if (_d) throw _e;
39
+ }
40
+ }
41
+ return _arr;
42
+ }
43
+ }
44
+ function ownKeys(object, enumerableOnly) {
45
+ var keys = Object.keys(object);
46
+ if (Object.getOwnPropertySymbols) {
47
+ var symbols = Object.getOwnPropertySymbols(object);
48
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
49
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
50
+ })), keys.push.apply(keys, symbols);
51
+ }
52
+ return keys;
53
+ }
54
+ function _objectSpread2(target) {
55
+ for (var i = 1; i < arguments.length; i++) {
56
+ var source = null != arguments[i] ? arguments[i] : {};
57
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
58
+ _defineProperty(target, key, source[key]);
59
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
60
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
61
+ });
62
+ }
63
+ return target;
64
+ }
65
+ function _regeneratorRuntime() {
66
+ _regeneratorRuntime = function () {
67
+ return exports;
68
+ };
69
+ var exports = {},
70
+ Op = Object.prototype,
71
+ hasOwn = Op.hasOwnProperty,
72
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
73
+ obj[key] = desc.value;
74
+ },
75
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
76
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
77
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
78
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
79
+ function define(obj, key, value) {
80
+ return Object.defineProperty(obj, key, {
81
+ value: value,
82
+ enumerable: !0,
83
+ configurable: !0,
84
+ writable: !0
85
+ }), obj[key];
86
+ }
87
+ try {
88
+ define({}, "");
89
+ } catch (err) {
90
+ define = function (obj, key, value) {
91
+ return obj[key] = value;
92
+ };
93
+ }
94
+ function wrap(innerFn, outerFn, self, tryLocsList) {
95
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
96
+ generator = Object.create(protoGenerator.prototype),
97
+ context = new Context(tryLocsList || []);
98
+ return defineProperty(generator, "_invoke", {
99
+ value: makeInvokeMethod(innerFn, self, context)
100
+ }), generator;
101
+ }
102
+ function tryCatch(fn, obj, arg) {
103
+ try {
104
+ return {
105
+ type: "normal",
106
+ arg: fn.call(obj, arg)
107
+ };
108
+ } catch (err) {
109
+ return {
110
+ type: "throw",
111
+ arg: err
112
+ };
113
+ }
114
+ }
115
+ exports.wrap = wrap;
116
+ var ContinueSentinel = {};
117
+ function Generator() {}
118
+ function GeneratorFunction() {}
119
+ function GeneratorFunctionPrototype() {}
120
+ var IteratorPrototype = {};
121
+ define(IteratorPrototype, iteratorSymbol, function () {
122
+ return this;
123
+ });
124
+ var getProto = Object.getPrototypeOf,
125
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
126
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
127
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
128
+ function defineIteratorMethods(prototype) {
129
+ ["next", "throw", "return"].forEach(function (method) {
130
+ define(prototype, method, function (arg) {
131
+ return this._invoke(method, arg);
132
+ });
133
+ });
134
+ }
135
+ function AsyncIterator(generator, PromiseImpl) {
136
+ function invoke(method, arg, resolve, reject) {
137
+ var record = tryCatch(generator[method], generator, arg);
138
+ if ("throw" !== record.type) {
139
+ var result = record.arg,
140
+ value = result.value;
141
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
142
+ invoke("next", value, resolve, reject);
143
+ }, function (err) {
144
+ invoke("throw", err, resolve, reject);
145
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
146
+ result.value = unwrapped, resolve(result);
147
+ }, function (error) {
148
+ return invoke("throw", error, resolve, reject);
149
+ });
150
+ }
151
+ reject(record.arg);
152
+ }
153
+ var previousPromise;
154
+ defineProperty(this, "_invoke", {
155
+ value: function (method, arg) {
156
+ function callInvokeWithMethodAndArg() {
157
+ return new PromiseImpl(function (resolve, reject) {
158
+ invoke(method, arg, resolve, reject);
159
+ });
160
+ }
161
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
162
+ }
163
+ });
164
+ }
165
+ function makeInvokeMethod(innerFn, self, context) {
166
+ var state = "suspendedStart";
167
+ return function (method, arg) {
168
+ if ("executing" === state) throw new Error("Generator is already running");
169
+ if ("completed" === state) {
170
+ if ("throw" === method) throw arg;
171
+ return doneResult();
172
+ }
173
+ for (context.method = method, context.arg = arg;;) {
174
+ var delegate = context.delegate;
175
+ if (delegate) {
176
+ var delegateResult = maybeInvokeDelegate(delegate, context);
177
+ if (delegateResult) {
178
+ if (delegateResult === ContinueSentinel) continue;
179
+ return delegateResult;
180
+ }
181
+ }
182
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
183
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
184
+ context.dispatchException(context.arg);
185
+ } else "return" === context.method && context.abrupt("return", context.arg);
186
+ state = "executing";
187
+ var record = tryCatch(innerFn, self, context);
188
+ if ("normal" === record.type) {
189
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
190
+ return {
191
+ value: record.arg,
192
+ done: context.done
193
+ };
194
+ }
195
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
196
+ }
197
+ };
198
+ }
199
+ function maybeInvokeDelegate(delegate, context) {
200
+ var methodName = context.method,
201
+ method = delegate.iterator[methodName];
202
+ 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;
203
+ var record = tryCatch(method, delegate.iterator, context.arg);
204
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
205
+ var info = record.arg;
206
+ 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);
207
+ }
208
+ function pushTryEntry(locs) {
209
+ var entry = {
210
+ tryLoc: locs[0]
211
+ };
212
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
213
+ }
214
+ function resetTryEntry(entry) {
215
+ var record = entry.completion || {};
216
+ record.type = "normal", delete record.arg, entry.completion = record;
217
+ }
218
+ function Context(tryLocsList) {
219
+ this.tryEntries = [{
220
+ tryLoc: "root"
221
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
222
+ }
223
+ function values(iterable) {
224
+ if (iterable) {
225
+ var iteratorMethod = iterable[iteratorSymbol];
226
+ if (iteratorMethod) return iteratorMethod.call(iterable);
227
+ if ("function" == typeof iterable.next) return iterable;
228
+ if (!isNaN(iterable.length)) {
229
+ var i = -1,
230
+ next = function next() {
231
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
232
+ return next.value = undefined, next.done = !0, next;
233
+ };
234
+ return next.next = next;
235
+ }
236
+ }
237
+ return {
238
+ next: doneResult
239
+ };
240
+ }
241
+ function doneResult() {
242
+ return {
243
+ value: undefined,
244
+ done: !0
245
+ };
246
+ }
247
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
248
+ value: GeneratorFunctionPrototype,
249
+ configurable: !0
250
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
251
+ value: GeneratorFunction,
252
+ configurable: !0
253
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
254
+ var ctor = "function" == typeof genFun && genFun.constructor;
255
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
256
+ }, exports.mark = function (genFun) {
257
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
258
+ }, exports.awrap = function (arg) {
259
+ return {
260
+ __await: arg
261
+ };
262
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
263
+ return this;
264
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
265
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
266
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
267
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
268
+ return result.done ? result.value : iter.next();
269
+ });
270
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
271
+ return this;
272
+ }), define(Gp, "toString", function () {
273
+ return "[object Generator]";
274
+ }), exports.keys = function (val) {
275
+ var object = Object(val),
276
+ keys = [];
277
+ for (var key in object) keys.push(key);
278
+ return keys.reverse(), function next() {
279
+ for (; keys.length;) {
280
+ var key = keys.pop();
281
+ if (key in object) return next.value = key, next.done = !1, next;
282
+ }
283
+ return next.done = !0, next;
284
+ };
285
+ }, exports.values = values, Context.prototype = {
286
+ constructor: Context,
287
+ reset: function (skipTempReset) {
288
+ 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);
289
+ },
290
+ stop: function () {
291
+ this.done = !0;
292
+ var rootRecord = this.tryEntries[0].completion;
293
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
294
+ return this.rval;
295
+ },
296
+ dispatchException: function (exception) {
297
+ if (this.done) throw exception;
298
+ var context = this;
299
+ function handle(loc, caught) {
300
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
301
+ }
302
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
303
+ var entry = this.tryEntries[i],
304
+ record = entry.completion;
305
+ if ("root" === entry.tryLoc) return handle("end");
306
+ if (entry.tryLoc <= this.prev) {
307
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
308
+ hasFinally = hasOwn.call(entry, "finallyLoc");
309
+ if (hasCatch && hasFinally) {
310
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
311
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
312
+ } else if (hasCatch) {
313
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
314
+ } else {
315
+ if (!hasFinally) throw new Error("try statement without catch or finally");
316
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
317
+ }
318
+ }
319
+ }
320
+ },
321
+ abrupt: function (type, arg) {
322
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
323
+ var entry = this.tryEntries[i];
324
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
325
+ var finallyEntry = entry;
326
+ break;
327
+ }
328
+ }
329
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
330
+ var record = finallyEntry ? finallyEntry.completion : {};
331
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
332
+ },
333
+ complete: function (record, afterLoc) {
334
+ if ("throw" === record.type) throw record.arg;
335
+ 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;
336
+ },
337
+ finish: function (finallyLoc) {
338
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
339
+ var entry = this.tryEntries[i];
340
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
341
+ }
342
+ },
343
+ catch: function (tryLoc) {
344
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
345
+ var entry = this.tryEntries[i];
346
+ if (entry.tryLoc === tryLoc) {
347
+ var record = entry.completion;
348
+ if ("throw" === record.type) {
349
+ var thrown = record.arg;
350
+ resetTryEntry(entry);
351
+ }
352
+ return thrown;
353
+ }
354
+ }
355
+ throw new Error("illegal catch attempt");
356
+ },
357
+ delegateYield: function (iterable, resultName, nextLoc) {
358
+ return this.delegate = {
359
+ iterator: values(iterable),
360
+ resultName: resultName,
361
+ nextLoc: nextLoc
362
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
363
+ }
364
+ }, exports;
365
+ }
366
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
367
+ try {
368
+ var info = gen[key](arg);
369
+ var value = info.value;
370
+ } catch (error) {
371
+ reject(error);
372
+ return;
373
+ }
374
+ if (info.done) {
375
+ resolve(value);
376
+ } else {
377
+ Promise.resolve(value).then(_next, _throw);
378
+ }
379
+ }
380
+ function _asyncToGenerator(fn) {
381
+ return function () {
382
+ var self = this,
383
+ args = arguments;
384
+ return new Promise(function (resolve, reject) {
385
+ var gen = fn.apply(self, args);
386
+ function _next(value) {
387
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
388
+ }
389
+ function _throw(err) {
390
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
391
+ }
392
+ _next(undefined);
393
+ });
394
+ };
395
+ }
396
+ function _defineProperty(obj, key, value) {
397
+ key = _toPropertyKey(key);
398
+ if (key in obj) {
399
+ Object.defineProperty(obj, key, {
400
+ value: value,
401
+ enumerable: true,
402
+ configurable: true,
403
+ writable: true
404
+ });
405
+ } else {
406
+ obj[key] = value;
407
+ }
408
+ return obj;
409
+ }
410
+ function _objectWithoutPropertiesLoose(source, excluded) {
411
+ if (source == null) return {};
412
+ var target = {};
413
+ var sourceKeys = Object.keys(source);
414
+ var key, i;
415
+ for (i = 0; i < sourceKeys.length; i++) {
416
+ key = sourceKeys[i];
417
+ if (excluded.indexOf(key) >= 0) continue;
418
+ target[key] = source[key];
419
+ }
420
+ return target;
421
+ }
422
+ function _objectWithoutProperties(source, excluded) {
423
+ if (source == null) return {};
424
+ var target = _objectWithoutPropertiesLoose(source, excluded);
425
+ var key, i;
426
+ if (Object.getOwnPropertySymbols) {
427
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
428
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
429
+ key = sourceSymbolKeys[i];
430
+ if (excluded.indexOf(key) >= 0) continue;
431
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
432
+ target[key] = source[key];
433
+ }
434
+ }
435
+ return target;
436
+ }
437
+ function _slicedToArray(arr, i) {
438
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
439
+ }
440
+ function _toConsumableArray(arr) {
441
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
442
+ }
443
+ function _arrayWithoutHoles(arr) {
444
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
445
+ }
446
+ function _arrayWithHoles(arr) {
447
+ if (Array.isArray(arr)) return arr;
448
+ }
449
+ function _iterableToArray(iter) {
450
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
451
+ }
452
+ function _unsupportedIterableToArray(o, minLen) {
453
+ if (!o) return;
454
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
455
+ var n = Object.prototype.toString.call(o).slice(8, -1);
456
+ if (n === "Object" && o.constructor) n = o.constructor.name;
457
+ if (n === "Map" || n === "Set") return Array.from(o);
458
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
459
+ }
460
+ function _arrayLikeToArray(arr, len) {
461
+ if (len == null || len > arr.length) len = arr.length;
462
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
463
+ return arr2;
464
+ }
465
+ function _nonIterableSpread() {
466
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
467
+ }
468
+ function _nonIterableRest() {
469
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
470
+ }
471
+ function _toPrimitive(input, hint) {
472
+ if (typeof input !== "object" || input === null) return input;
473
+ var prim = input[Symbol.toPrimitive];
474
+ if (prim !== undefined) {
475
+ var res = prim.call(input, hint || "default");
476
+ if (typeof res !== "object") return res;
477
+ throw new TypeError("@@toPrimitive must return a primitive value.");
478
+ }
479
+ return (hint === "string" ? String : Number)(input);
480
+ }
481
+ function _toPropertyKey(arg) {
482
+ var key = _toPrimitive(arg, "string");
483
+ return typeof key === "symbol" ? key : String(key);
484
+ }
485
+
486
+ function ApaasCascader(props) {
487
+ return /*#__PURE__*/React__default['default'].createElement(antd.Cascader, _objectSpread2({
488
+ placeholder: "\u8BF7\u9009\u62E9"
489
+ }, props));
490
+ }
491
+
492
+ var _excluded = ["dateType"];
493
+ var componentMap = {
494
+ "DATE": antd.DatePicker,
495
+ "DATE_TIME": antd.DatePicker,
496
+ "DATE_RANGE": antd.DatePicker.RangePicker,
497
+ "DATE_TIME_RANGE": antd.DatePicker.RangePicker
498
+ };
499
+ var ApaasDate = function ApaasDate(props) {
500
+ var _props$dateType = props.dateType,
501
+ dateType = _props$dateType === void 0 ? 'DATE' : _props$dateType,
502
+ otherProps = _objectWithoutProperties(props, _excluded);
503
+ var Component = componentMap[dateType];
504
+ return /*#__PURE__*/React__default['default'].createElement(Component, _objectSpread2({
505
+ showTime: ['DATE_TIME_RANGE', 'DATE_TIME'].includes(dateType)
506
+ }, otherProps));
507
+ };
508
+
509
+ var _excluded$1 = ["isNumber", "replaceWarn"];
510
+ function ApaasInput(props) {
511
+ var isNumber = props.isNumber,
512
+ replaceWarn = props.replaceWarn,
513
+ other = _objectWithoutProperties(props, _excluded$1);
514
+ return /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2({}, other));
515
+ }
516
+
517
+ function ApaasInputNumber(props) {
518
+ return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2({}, props));
519
+ }
520
+
521
+ var _excluded$2 = ["options", "basicMultSelect"];
522
+ function ApaasSelect(props) {
523
+ var _props$options = props.options,
524
+ options = _props$options === void 0 ? [] : _props$options,
525
+ basicMultSelect = props.basicMultSelect,
526
+ otherProps = _objectWithoutProperties(props, _excluded$2);
527
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
528
+ style: {
529
+ width: '100%'
530
+ }
531
+ }), options.map(function (item) {
532
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
533
+ value: item.value,
534
+ key: item.value
535
+ }, item.label);
536
+ }));
537
+ }
538
+
539
+ function ApaasMultipleSelect(props) {
540
+ return /*#__PURE__*/React__default['default'].createElement(ApaasSelect, _objectSpread2(_objectSpread2({}, props), {}, {
541
+ mode: 'multiple'
542
+ }));
543
+ }
544
+
545
+ var _excluded$3 = ["minRows", "maxRows"];
546
+ function ApaasTextArea(props) {
547
+ var _props$minRows = props.minRows,
548
+ minRows = _props$minRows === void 0 ? 2 : _props$minRows,
549
+ _props$maxRows = props.maxRows,
550
+ maxRows = _props$maxRows === void 0 ? 5 : _props$maxRows,
551
+ otherProps = _objectWithoutProperties(props, _excluded$3);
552
+ return /*#__PURE__*/React__default['default'].createElement(antd.Input.TextArea, _objectSpread2(_objectSpread2({}, otherProps), {}, {
553
+ autoSize: {
554
+ minRows: minRows,
555
+ maxRows: maxRows
556
+ }
557
+ }));
558
+ }
559
+
560
+ function styleInject(css, ref) {
561
+ if ( ref === void 0 ) ref = {};
562
+ var insertAt = ref.insertAt;
563
+
564
+ if (!css || typeof document === 'undefined') { return; }
565
+
566
+ var head = document.head || document.getElementsByTagName('head')[0];
567
+ var style = document.createElement('style');
568
+ style.type = 'text/css';
569
+
570
+ if (insertAt === 'top') {
571
+ if (head.firstChild) {
572
+ head.insertBefore(style, head.firstChild);
573
+ } else {
574
+ head.appendChild(style);
575
+ }
576
+ } else {
577
+ head.appendChild(style);
578
+ }
579
+
580
+ if (style.styleSheet) {
581
+ style.styleSheet.cssText = css;
582
+ } else {
583
+ style.appendChild(document.createTextNode(css));
584
+ }
585
+ }
586
+
587
+ var css_248z = ".index-module_imageBox__3tOEt {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__3tOEt .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__3tOEt .index-module_inputImage__3ExnT {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__3tOEt .index-module_imageShow__2MZ8c {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__3tOEt .index-module_imageWrap__3Gcy0 {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin: 0 8px 8px 0;\n}\n.index-module_imageBox__3tOEt .index-module_imageWrap__3Gcy0:hover {\n background: transparent;\n}\n.index-module_imageBox__3tOEt .index-module_imageWrap__3Gcy0:hover .index-module_mask__A9GJN:before {\n opacity: 1;\n}\n.index-module_imageBox__3tOEt .index-module_imageWrap__3Gcy0 img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__3tOEt .index-module_imageWrap__3Gcy0 .index-module_delete__3ent_ {\n position: absolute;\n right: 0px;\n top: 0px;\n}\n.index-module_imageBox__3tOEt .index-module_mask__A9GJN {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__3tOEt .index-module_mask__A9GJN::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__3tOEt .index-module_mask__A9GJN:hover .index-module_actions__1cQKz {\n opacity: 1;\n}\n.index-module_imageBox__3tOEt .index-module_mask__A9GJN .index-module_actions__1cQKz {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__3tOEt .index-module_mask__A9GJN .index-module_actions__1cQKz .index-module_icon__1QG8L {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__3tOEt .index-module_imagePaste__9NJaN {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__3tOEt .index-module_imagePaste__9NJaN .index-module_fakeBox__2NVan {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__3tOEt .index-module_imagePaste__9NJaN .index-module_fakeBox__2NVan .index-module_addBtn__2bSOl {\n color: #86909C;\n}\n.index-module_imageBox__3tOEt .index-module_upload__33q6T .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__3tOEt .index-module_upload__33q6T .ant-upload .index-module_addBtn__2bSOl {\n color: #86909C;\n}\n.index-module_tips__1uXeZ {\n color: #4E5969;\n font-size: 12px;\n}\n";
588
+ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-module_inputImage__3ExnT","imageShow":"index-module_imageShow__2MZ8c","imageWrap":"index-module_imageWrap__3Gcy0","-webkit-mask":"index-module_mask__A9GJN","mask":"index-module_mask__A9GJN","delete":"index-module_delete__3ent_","actions":"index-module_actions__1cQKz","icon":"index-module_icon__1QG8L","imagePaste":"index-module_imagePaste__9NJaN","fakeBox":"index-module_fakeBox__2NVan","addBtn":"index-module_addBtn__2bSOl","upload":"index-module_upload__33q6T","tips":"index-module_tips__1uXeZ"};
589
+ styleInject(css_248z);
590
+
591
+ var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
592
+ var fn = function fn(_ref) {
593
+ var _ref2 = _slicedToArray(_ref, 0);
594
+ };
595
+ var getBase64 = function getBase64(file) {
596
+ return new Promise(function (resolve, reject) {
597
+ var reader = new FileReader();
598
+ reader.readAsDataURL(file);
599
+ reader.onload = function () {
600
+ return resolve(reader.result);
601
+ };
602
+ reader.onerror = function (error) {
603
+ return reject(error);
604
+ };
605
+ });
606
+ };
607
+ var ApaasUpload = function ApaasUpload(_ref3) {
608
+ var _ref3$maxCount = _ref3.maxCount,
609
+ maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
610
+ _ref3$maxSize = _ref3.maxSize,
611
+ maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
612
+ _ref3$uploadText = _ref3.uploadText,
613
+ uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
614
+ _ref3$onChange = _ref3.onChange,
615
+ onChange = _ref3$onChange === void 0 ? fn : _ref3$onChange,
616
+ _ref3$value = _ref3.value,
617
+ value = _ref3$value === void 0 ? [] : _ref3$value,
618
+ _ref3$accept = _ref3.accept,
619
+ accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
620
+ _ref3$canPreview = _ref3.canPreview,
621
+ canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
622
+ _ref3$disabled = _ref3.disabled,
623
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
624
+ resetProps = _objectWithoutProperties(_ref3, _excluded$4);
625
+ var inputRef = React.useRef(null);
626
+ var valueRef = React.useRef(value);
627
+ var _useState = React.useState(false),
628
+ _useState2 = _slicedToArray(_useState, 2),
629
+ visible = _useState2[0],
630
+ setVisible = _useState2[1];
631
+ var _useState3 = React.useState(''),
632
+ _useState4 = _slicedToArray(_useState3, 2),
633
+ currentPreviewImg = _useState4[0],
634
+ setCurrentPreviewImg = _useState4[1];
635
+ var _useState5 = React.useState(true),
636
+ _useState6 = _slicedToArray(_useState5, 2),
637
+ pasteDefaultStates = _useState6[0],
638
+ setPasteDefaultStates = _useState6[1];
639
+ React.useEffect(function () {
640
+ valueRef.current = value;
641
+ }, [value]);
642
+ var imgReader = function imgReader(item) {
643
+ var blob = item.getAsFile(),
644
+ reader = new FileReader();
645
+ if (blob.size > maxSize * 1024 * 1024) {
646
+ antd.message.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E".concat(maxSize, "MB"));
647
+ return;
648
+ }
649
+ if (valueRef.current.length >= maxCount) {
650
+ antd.message.error("\u53EA\u80FD\u4E0A\u4F20".concat(maxCount, "\u5F20\u56FE\u7247"));
651
+ return;
652
+ }
653
+ reader.onload = function (e) {
654
+ var _e$target;
655
+ var result = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
656
+ handleChange([].concat(_toConsumableArray(valueRef.current), [result]));
657
+ };
658
+ reader.readAsDataURL(blob);
659
+ };
660
+ var handleChange = function handleChange(list) {
661
+ valueRef.current = list;
662
+ onChange(list);
663
+ };
664
+ var clipboardDataChange = function clipboardDataChange(e) {
665
+ var clipboardData = e.clipboardData || window.clipboardData,
666
+ i = 0,
667
+ items,
668
+ item,
669
+ types;
670
+ if (clipboardData) {
671
+ items = clipboardData.items;
672
+ if (!items) return;
673
+ item = items[0];
674
+ types = clipboardData.types || [];
675
+ for (; i < types.length; i++) {
676
+ if (types[i] === 'Files') {
677
+ item = items[i];
678
+ break;
679
+ }
680
+ }
681
+ if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
682
+ imgReader(item);
683
+ }
684
+ }
685
+ };
686
+ // 手动上传模式, 一直返回false
687
+ var beforeUpload = function beforeUpload(file) {
688
+ var size = file.size / 1024 / 1024 < maxSize;
689
+ if (value.length > maxCount) {
690
+ antd.message.error("\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u5F20\u56FE\u7247\uFF01"));
691
+ return antd.Upload.LIST_IGNORE;
692
+ }
693
+ if (!size) {
694
+ antd.message.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E".concat(maxSize, "MB"));
695
+ return antd.Upload.LIST_IGNORE;
696
+ }
697
+ getBase64(file).then(function (res) {
698
+ return handleChange([].concat(_toConsumableArray(valueRef.current), [res]));
699
+ });
700
+ return antd.Upload.LIST_IGNORE;
701
+ };
702
+ var handleDelete = function handleDelete(key) {
703
+ return function () {
704
+ if (disabled) return;
705
+ handleChange(value.filter(function (_, index) {
706
+ return key !== index;
707
+ }));
708
+ };
709
+ };
710
+ var handlePreview = function handlePreview(key) {
711
+ return function () {
712
+ setCurrentPreviewImg(value[key]);
713
+ setVisible(true);
714
+ };
715
+ };
716
+ var renderImages = function renderImages(images) {
717
+ return images.map(function (image, index) {
718
+ return /*#__PURE__*/React__default['default'].createElement("div", {
719
+ className: styles.imageWrap,
720
+ key: index
721
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
722
+ className: styles.mask
723
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
724
+ src: image
725
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
726
+ className: styles.actions
727
+ }, canPreview && /*#__PURE__*/React__default['default'].createElement(icons.EyeOutlined, {
728
+ style: {
729
+ fontSize: '16px',
730
+ color: '#FFF',
731
+ marginRight: '8px'
732
+ },
733
+ onClick: handlePreview(index)
734
+ }), /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
735
+ style: {
736
+ fontSize: '16px',
737
+ color: '#FFF'
738
+ },
739
+ onClick: handleDelete(index)
740
+ }))));
741
+ });
742
+ };
743
+ React.useEffect(function () {
744
+ var _inputRef$current2;
745
+ if (!pasteDefaultStates) {
746
+ var _inputRef$current;
747
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
748
+ }
749
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.addEventListener('paste', function (e) {
750
+ return clipboardDataChange(e);
751
+ });
752
+ return function () {
753
+ var _inputRef$current3;
754
+ (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.removeEventListener('paste', function (e) {
755
+ return clipboardDataChange(e);
756
+ });
757
+ };
758
+ }, [pasteDefaultStates]);
759
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
760
+ className: styles.tips
761
+ }, "\u5141\u8BB8\u4E0A\u4F20", maxCount, "\u5F20\u56FE\u7247"), /*#__PURE__*/React__default['default'].createElement("div", {
762
+ className: styles.imageBox
763
+ }, !disabled && /*#__PURE__*/React__default['default'].createElement("div", {
764
+ className: styles.imagePaste
765
+ }, pasteDefaultStates ? /*#__PURE__*/React__default['default'].createElement("div", {
766
+ className: styles.fakeBox,
767
+ onClick: function onClick() {
768
+ setPasteDefaultStates(false);
769
+ }
770
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
771
+ className: styles.addBtn
772
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("p", {
773
+ className: styles.text
774
+ }, "\u590D\u5236\u7C98\u8D34")) : /*#__PURE__*/React__default['default'].createElement("input", {
775
+ ref: inputRef,
776
+ className: styles.inputImage,
777
+ type: "text",
778
+ placeholder: "\u590D\u5236\u7C98\u8D34",
779
+ onBlur: function onBlur() {
780
+ setPasteDefaultStates(true);
781
+ },
782
+ value: ""
783
+ })), renderImages(value), /*#__PURE__*/React__default['default'].createElement(antd.Upload, _objectSpread2({
784
+ disabled: disabled,
785
+ accept: accept,
786
+ name: "file",
787
+ listType: "picture-card",
788
+ maxCount: maxCount,
789
+ className: styles.upload,
790
+ beforeUpload: beforeUpload
791
+ }, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("span", {
792
+ className: 'addBtn'
793
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("div", null, uploadText))), /*#__PURE__*/React__default['default'].createElement(antd.Image, {
794
+ width: 0,
795
+ style: {
796
+ display: visible ? '' : 'none'
797
+ },
798
+ src: currentPreviewImg,
799
+ preview: {
800
+ visible: visible,
801
+ src: currentPreviewImg,
802
+ onVisibleChange: function onVisibleChange(value) {
803
+ setCurrentPreviewImg('');
804
+ setVisible(value);
805
+ }
806
+ }
807
+ })));
808
+ };
809
+
810
+ var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
811
+ function ApaasRadio(props) {
812
+ var showOther = props.showOther,
813
+ _props$horizontal = props.horizontal,
814
+ horizontal = _props$horizontal === void 0 ? true : _props$horizontal,
815
+ _props$options = props.options,
816
+ options = _props$options === void 0 ? [] : _props$options,
817
+ _props$value = props.value,
818
+ value = _props$value === void 0 ? {} : _props$value,
819
+ onChange = props.onChange,
820
+ disabled = props.disabled,
821
+ otherProps = _objectWithoutProperties(props, _excluded$5);
822
+ var radioValue = value.value,
823
+ other = value.other;
824
+ var triggerChange = function triggerChange(changedValue) {
825
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), changedValue));
826
+ };
827
+ var onRadioChange = function onRadioChange(e) {
828
+ var radioValue = e.target.value;
829
+ triggerChange({
830
+ value: radioValue
831
+ });
832
+ };
833
+ var onOtherChange = function onOtherChange(e) {
834
+ var other = e.target.value;
835
+ triggerChange({
836
+ other: other
837
+ });
838
+ };
839
+ return /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, _objectSpread2({
840
+ value: radioValue,
841
+ onChange: onRadioChange
842
+ }, otherProps), /*#__PURE__*/React__default['default'].createElement(antd.Space, {
843
+ direction: horizontal ? 'horizontal' : 'vertical',
844
+ wrap: true
845
+ }, options.map(function (item) {
846
+ return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
847
+ value: item.value,
848
+ key: item.label,
849
+ disabled: disabled
850
+ }, item.label);
851
+ }), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
852
+ value: "\u5176\u4ED6",
853
+ disabled: disabled
854
+ }, "\u5176\u4ED6", /*#__PURE__*/React__default['default'].createElement(antd.Input, {
855
+ disabled: disabled,
856
+ value: other,
857
+ style: {
858
+ width: 120,
859
+ marginLeft: 10
860
+ },
861
+ onChange: onOtherChange
862
+ }))));
863
+ }
864
+
865
+ /*
866
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
867
+ * @Date: 2022-09-20 14:29:14
868
+ * @LastEditors: litian
869
+ * @LastEditTime: 2022-09-27 13:49:32
870
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/config/utils.ts
871
+ * @Description:
872
+ *
873
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
874
+ */
875
+ //组装地址
876
+ var toTree = function toTree() {
877
+ var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
878
+ var parId = arguments.length > 1 ? arguments[1] : undefined;
879
+ var len = list === null || list === void 0 ? void 0 : list.length;
880
+ function loop(parId) {
881
+ var res = [];
882
+ for (var i = 0; i < len; i++) {
883
+ var item = list[i];
884
+ if (item.parentId === Number(parId)) {
885
+ item.children = loop(item.id);
886
+ res.push(_objectSpread2(_objectSpread2({}, item), {}, {
887
+ label: item.name,
888
+ value: item.id
889
+ }));
890
+ }
891
+ }
892
+ return res;
893
+ }
894
+ return loop(parId);
895
+ };
896
+ var keepDecimals = function keepDecimals(value) {
897
+ value = value.replace(/[^\d.]/g, ''); //清除"数字"和"."以外的字符
898
+ value = value.replace(/^\./g, ''); //验证第一个字符是数字
899
+ value = value.replace(/\.{2,}/g, '.'); //只保留第一个, 清除多余的
900
+ value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //限制"10.5." 这种情况
901
+ value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
902
+ return value;
903
+ };
904
+ function dataURLtoFile(dataurl, filename) {
905
+ // 获取到base64编码
906
+ var arr = dataurl.split(',');
907
+ // 将base64编码转为字符串
908
+ var bstr = window.atob(arr[1]);
909
+ var n = bstr.length;
910
+ var u8arr = new Uint8Array(n); // 创建初始化为0的,包含length个元素的无符号整型数组
911
+ while (n--) {
912
+ u8arr[n] = bstr.charCodeAt(n);
913
+ }
914
+ return new File([u8arr], filename, {
915
+ type: 'image/jpeg'
916
+ });
917
+ }
918
+
919
+ var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__8zj7A .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__8zj7A .index-module_inputImage__3VrvC {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageShow__3wD4d {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover {\n background: transparent;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover .index-module_mask__3LUIn:before {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo .index-module_delete__2cFpf {\n position: absolute;\n right: 0px;\n top: 0px;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn:hover .index-module_actions__2tY_V {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V .index-module_icon__ZI-2P {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_tips__1ATcr {\n color: #4E5969;\n font-size: 12px;\n}\n";
920
+ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","delete":"index-module_delete__2cFpf","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
921
+ styleInject(css_248z$1);
922
+
923
+ var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
924
+ var fn$1 = function fn(_ref) {
925
+ var _ref2 = _slicedToArray(_ref, 0);
926
+ };
927
+ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
928
+ var _ref3$maxCount = _ref3.maxCount,
929
+ maxCount = _ref3$maxCount === void 0 ? 10 : _ref3$maxCount,
930
+ _ref3$maxSize = _ref3.maxSize,
931
+ maxSize = _ref3$maxSize === void 0 ? 10 : _ref3$maxSize,
932
+ _ref3$uploadText = _ref3.uploadText,
933
+ uploadText = _ref3$uploadText === void 0 ? '上传' : _ref3$uploadText,
934
+ _ref3$onChange = _ref3.onChange,
935
+ onChange = _ref3$onChange === void 0 ? fn$1 : _ref3$onChange,
936
+ _ref3$value = _ref3.value,
937
+ value = _ref3$value === void 0 ? [] : _ref3$value,
938
+ _ref3$accept = _ref3.accept,
939
+ accept = _ref3$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref3$accept,
940
+ _ref3$canPreview = _ref3.canPreview,
941
+ canPreview = _ref3$canPreview === void 0 ? false : _ref3$canPreview,
942
+ _ref3$disabled = _ref3.disabled,
943
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
944
+ uniqueKey = _ref3.uniqueKey,
945
+ _ref3$hostUrl = _ref3.hostUrl,
946
+ hostUrl = _ref3$hostUrl === void 0 ? '' : _ref3$hostUrl,
947
+ _ref3$actionUrl = _ref3.actionUrl,
948
+ actionUrl = _ref3$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref3$actionUrl,
949
+ resetProps = _objectWithoutProperties(_ref3, _excluded$6);
950
+ var inputRef = React.useRef(null);
951
+ var valueRef = React.useRef(value);
952
+ var _useState = React.useState(false),
953
+ _useState2 = _slicedToArray(_useState, 2),
954
+ uploading = _useState2[0],
955
+ setUploading = _useState2[1];
956
+ var _useState3 = React.useState(false),
957
+ _useState4 = _slicedToArray(_useState3, 2),
958
+ visible = _useState4[0],
959
+ setVisible = _useState4[1];
960
+ var _useState5 = React.useState(''),
961
+ _useState6 = _slicedToArray(_useState5, 2),
962
+ currentPreviewImg = _useState6[0],
963
+ setCurrentPreviewImg = _useState6[1];
964
+ var _useState7 = React.useState(true),
965
+ _useState8 = _slicedToArray(_useState7, 2),
966
+ pasteDefaultStates = _useState8[0],
967
+ setPasteDefaultStates = _useState8[1];
968
+ React.useEffect(function () {
969
+ valueRef.current = value;
970
+ }, [value]);
971
+ var asyncUpload = /*#__PURE__*/function () {
972
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
973
+ var _valueRef$current;
974
+ var formData, fileName, _yield$request, success, data;
975
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
976
+ while (1) switch (_context.prev = _context.next) {
977
+ case 0:
978
+ setUploading(true);
979
+ formData = new FormData();
980
+ formData.append('file', file);
981
+ fileName = "".concat(uniqueKey, "_").concat(((_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.length) + 1, "_").concat(new Date().getTime(), ".jpg");
982
+ formData.append('fileName', fileName);
983
+ _context.prev = 5;
984
+ _context.next = 8;
985
+ return request__default['default'](actionUrl, {
986
+ method: 'post',
987
+ body: formData
988
+ });
989
+ case 8:
990
+ _yield$request = _context.sent;
991
+ success = _yield$request.success;
992
+ data = _yield$request.data;
993
+ if (success) {
994
+ handleChange([].concat(_toConsumableArray(valueRef.current), [data]));
995
+ }
996
+ _context.next = 17;
997
+ break;
998
+ case 14:
999
+ _context.prev = 14;
1000
+ _context.t0 = _context["catch"](5);
1001
+ antd.message.error('图片上传失败');
1002
+ case 17:
1003
+ _context.prev = 17;
1004
+ setUploading(false);
1005
+ return _context.finish(17);
1006
+ case 20:
1007
+ case "end":
1008
+ return _context.stop();
1009
+ }
1010
+ }, _callee, null, [[5, 14, 17, 20]]);
1011
+ }));
1012
+ return function asyncUpload(_x) {
1013
+ return _ref4.apply(this, arguments);
1014
+ };
1015
+ }();
1016
+ var imgReader = function imgReader(item) {
1017
+ var blob = item.getAsFile(),
1018
+ reader = new FileReader();
1019
+ if (blob.size > maxSize * 1024 * 1024) {
1020
+ antd.message.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E".concat(maxSize, "MB"));
1021
+ return;
1022
+ }
1023
+ if (valueRef.current.length >= maxCount) {
1024
+ antd.message.error("\u53EA\u80FD\u4E0A\u4F20".concat(maxCount, "\u5F20\u56FE\u7247"));
1025
+ return;
1026
+ }
1027
+ reader.onload = /*#__PURE__*/function () {
1028
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
1029
+ var _e$target, _valueRef$current2;
1030
+ var result, fileName, file;
1031
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1032
+ while (1) switch (_context2.prev = _context2.next) {
1033
+ case 0:
1034
+ result = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
1035
+ fileName = "".concat(uniqueKey, "_").concat(((_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.length) + 1, "_").concat(new Date().getTime(), ".jpg");
1036
+ file = dataURLtoFile(result, fileName);
1037
+ asyncUpload(file);
1038
+ case 4:
1039
+ case "end":
1040
+ return _context2.stop();
1041
+ }
1042
+ }, _callee2);
1043
+ }));
1044
+ return function (_x2) {
1045
+ return _ref5.apply(this, arguments);
1046
+ };
1047
+ }();
1048
+ reader.readAsDataURL(blob);
1049
+ };
1050
+ var handleChange = function handleChange(list) {
1051
+ valueRef.current = list;
1052
+ onChange(list);
1053
+ };
1054
+ var clipboardDataChange = function clipboardDataChange(e) {
1055
+ var clipboardData = e.clipboardData || window.clipboardData,
1056
+ i = 0,
1057
+ items,
1058
+ item,
1059
+ types;
1060
+ if (clipboardData) {
1061
+ items = clipboardData.items;
1062
+ if (!items) return;
1063
+ item = items[0];
1064
+ types = clipboardData.types || [];
1065
+ for (; i < types.length; i++) {
1066
+ if (types[i] === 'Files') {
1067
+ item = items[i];
1068
+ break;
1069
+ }
1070
+ }
1071
+ if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
1072
+ imgReader(item);
1073
+ }
1074
+ }
1075
+ };
1076
+ // 手动上传模式, 一直返回false
1077
+ var beforeUpload = function beforeUpload(file) {
1078
+ var size = file.size / 1024 / 1024 < maxSize;
1079
+ if (value.length > maxCount) {
1080
+ antd.message.error("\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u5F20\u56FE\u7247\uFF01"));
1081
+ return antd.Upload.LIST_IGNORE;
1082
+ }
1083
+ if (!size) {
1084
+ antd.message.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E".concat(maxSize, "MB"));
1085
+ return antd.Upload.LIST_IGNORE;
1086
+ }
1087
+ asyncUpload(file);
1088
+ return antd.Upload.LIST_IGNORE;
1089
+ };
1090
+ var handleDelete = function handleDelete(key) {
1091
+ return function () {
1092
+ if (disabled) return;
1093
+ handleChange(value.filter(function (_, index) {
1094
+ return key !== index;
1095
+ }));
1096
+ };
1097
+ };
1098
+ var handlePreview = function handlePreview(imgUrl) {
1099
+ return function () {
1100
+ setCurrentPreviewImg(imgUrl);
1101
+ setVisible(true);
1102
+ };
1103
+ };
1104
+ var renderImages = function renderImages(images) {
1105
+ return images.map(function (image, index) {
1106
+ var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
1107
+ return /*#__PURE__*/React__default['default'].createElement("div", {
1108
+ className: styles$1.imageWrap,
1109
+ key: index
1110
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
1111
+ className: styles$1.mask
1112
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
1113
+ src: finalImage
1114
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
1115
+ className: styles$1.actions
1116
+ }, canPreview && /*#__PURE__*/React__default['default'].createElement(icons.EyeOutlined, {
1117
+ style: {
1118
+ fontSize: '16px',
1119
+ color: '#FFF',
1120
+ marginRight: '8px'
1121
+ },
1122
+ onClick: handlePreview(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image)
1123
+ }), /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
1124
+ style: {
1125
+ fontSize: '16px',
1126
+ color: '#FFF'
1127
+ },
1128
+ onClick: handleDelete(index)
1129
+ }))));
1130
+ });
1131
+ };
1132
+ React.useEffect(function () {
1133
+ var _inputRef$current2;
1134
+ if (!pasteDefaultStates) {
1135
+ var _inputRef$current;
1136
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
1137
+ }
1138
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.addEventListener('paste', function (e) {
1139
+ return clipboardDataChange(e);
1140
+ });
1141
+ return function () {
1142
+ var _inputRef$current3;
1143
+ (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.removeEventListener('paste', function (e) {
1144
+ return clipboardDataChange(e);
1145
+ });
1146
+ };
1147
+ }, [pasteDefaultStates]);
1148
+ return /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
1149
+ spinning: uploading
1150
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
1151
+ className: styles$1.tips
1152
+ }, "\u5141\u8BB8\u4E0A\u4F20", maxCount, "\u5F20\u56FE\u7247"), /*#__PURE__*/React__default['default'].createElement("div", {
1153
+ className: styles$1.imageBox
1154
+ }, !disabled && /*#__PURE__*/React__default['default'].createElement("div", {
1155
+ className: styles$1.imagePaste
1156
+ }, pasteDefaultStates ? /*#__PURE__*/React__default['default'].createElement("div", {
1157
+ className: styles$1.fakeBox,
1158
+ onClick: function onClick() {
1159
+ setPasteDefaultStates(false);
1160
+ }
1161
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
1162
+ className: styles$1.addBtn
1163
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("p", {
1164
+ className: styles$1.text
1165
+ }, "\u590D\u5236\u7C98\u8D34")) : /*#__PURE__*/React__default['default'].createElement("input", {
1166
+ ref: inputRef,
1167
+ className: styles$1.inputImage,
1168
+ type: "text",
1169
+ placeholder: "\u590D\u5236\u7C98\u8D34",
1170
+ onBlur: function onBlur() {
1171
+ setPasteDefaultStates(true);
1172
+ },
1173
+ value: ""
1174
+ })), renderImages(value), /*#__PURE__*/React__default['default'].createElement(antd.Upload, _objectSpread2({
1175
+ disabled: disabled,
1176
+ accept: accept,
1177
+ name: "file",
1178
+ listType: "picture-card",
1179
+ maxCount: maxCount,
1180
+ className: styles$1.upload,
1181
+ beforeUpload: beforeUpload
1182
+ }, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("span", {
1183
+ className: "addBtn"
1184
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("div", null, uploadText))), /*#__PURE__*/React__default['default'].createElement(antd.Image, {
1185
+ width: 0,
1186
+ style: {
1187
+ display: visible ? '' : 'none'
1188
+ },
1189
+ src: currentPreviewImg,
1190
+ preview: {
1191
+ visible: visible,
1192
+ src: "".concat(currentPreviewImg),
1193
+ onVisibleChange: function onVisibleChange(value) {
1194
+ setCurrentPreviewImg('');
1195
+ setVisible(value);
1196
+ }
1197
+ }
1198
+ })));
1199
+ };
1200
+
1201
+ var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "checkboxOther"];
1202
+ function ApaasCheckbox(props) {
1203
+ var showOther = props.showOther,
1204
+ _props$horizontal = props.horizontal,
1205
+ horizontal = _props$horizontal === void 0 ? true : _props$horizontal,
1206
+ _props$options = props.options,
1207
+ options = _props$options === void 0 ? [] : _props$options,
1208
+ _props$value = props.value,
1209
+ value = _props$value === void 0 ? {} : _props$value,
1210
+ onChange = props.onChange,
1211
+ disabled = props.disabled,
1212
+ checkboxOther = props.checkboxOther,
1213
+ otherProps = _objectWithoutProperties(props, _excluded$7);
1214
+ var checkboxValue = value.value,
1215
+ other = value.other;
1216
+ var triggerChange = function triggerChange(changedValue) {
1217
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), changedValue));
1218
+ };
1219
+ var onCheckboxChange = function onCheckboxChange(selectValues) {
1220
+ triggerChange({
1221
+ value: selectValues
1222
+ });
1223
+ };
1224
+ var onOtherChange = function onOtherChange(e) {
1225
+ var other = e.target.value;
1226
+ triggerChange({
1227
+ other: other
1228
+ });
1229
+ };
1230
+ return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
1231
+ value: checkboxValue
1232
+ }, otherProps), {}, {
1233
+ onChange: onCheckboxChange
1234
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Space, {
1235
+ direction: horizontal ? 'horizontal' : 'vertical',
1236
+ wrap: true
1237
+ }, options.map(function (item) {
1238
+ return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
1239
+ value: item.value,
1240
+ key: item.value,
1241
+ disabled: disabled
1242
+ }, item.label);
1243
+ }), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
1244
+ value: "\u5176\u4ED6",
1245
+ disabled: disabled
1246
+ }, "\u5176\u4ED6", /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1247
+ value: other,
1248
+ style: {
1249
+ width: 120,
1250
+ marginLeft: 10
1251
+ },
1252
+ onChange: onOtherChange,
1253
+ disabled: disabled
1254
+ }))));
1255
+ }
1256
+
1257
+ function ApaasSlider(props) {
1258
+ var value = props.value,
1259
+ onChange = props.onChange,
1260
+ _props$range = props.range,
1261
+ range = _props$range === void 0 ? 100 : _props$range,
1262
+ disabled = props.disabled;
1263
+ var marks = _defineProperty({
1264
+ 0: 0
1265
+ }, range, range);
1266
+ var limitDecimals = function limitDecimals(value) {
1267
+ if (value > range) {
1268
+ return range + '';
1269
+ } else if (value < 0) {
1270
+ return '0';
1271
+ }
1272
+ return String(value).replace(/[^\d]/g, '');
1273
+ };
1274
+ return /*#__PURE__*/React__default['default'].createElement(antd.Row, null, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
1275
+ span: 12
1276
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Slider, {
1277
+ disabled: disabled,
1278
+ marks: marks,
1279
+ min: 0,
1280
+ max: range,
1281
+ value: value,
1282
+ onChange: onChange
1283
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
1284
+ span: 12
1285
+ }, /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
1286
+ disabled: disabled,
1287
+ min: 0,
1288
+ max: range,
1289
+ formatter: limitDecimals,
1290
+ style: {
1291
+ margin: '0 16px'
1292
+ },
1293
+ value: value,
1294
+ placeholder: "\u8BF7\u8F93\u5165\u8BC4\u5206",
1295
+ onChange: onChange
1296
+ })));
1297
+ }
1298
+
1299
+ var css_248z$2 = ".index-module_rateLabel__3k-Xa {\n margin-right: 8px;\n}\n.index-module_rateText__A1GRy {\n margin-left: 8px;\n}\n";
1300
+ var styles$2 = {"rateLabel":"index-module_rateLabel__3k-Xa","rateText":"index-module_rateText__A1GRy"};
1301
+ styleInject(css_248z$2);
1302
+
1303
+ var _excluded$8 = ["value", "onChange", "options", "textStyle"];
1304
+ //状态文字映射
1305
+ var RATE_MAP = {
1306
+ 0: '',
1307
+ 0.5: '非常差',
1308
+ 1: '非常差',
1309
+ 1.5: '差',
1310
+ 2: '差',
1311
+ 2.5: '一般',
1312
+ 3: '一般',
1313
+ 3.5: '好',
1314
+ 4: '好',
1315
+ 4.5: '非常好',
1316
+ 5: '非常好'
1317
+ };
1318
+ function ApaasRate(props) {
1319
+ var _props$value = props.value,
1320
+ value = _props$value === void 0 ? [] : _props$value,
1321
+ onChange = props.onChange,
1322
+ _props$options = props.options,
1323
+ options = _props$options === void 0 ? [] : _props$options,
1324
+ textStyle = props.textStyle,
1325
+ other = _objectWithoutProperties(props, _excluded$8);
1326
+ var rateValues = React.useMemo(function () {
1327
+ return (value || []).reduce(function (prv, next) {
1328
+ prv[next.id || ''] = next.value;
1329
+ return prv;
1330
+ }, {});
1331
+ }, [value]);
1332
+ var changeHandle = function changeHandle(val, id) {
1333
+ var newValue = _toConsumableArray(value);
1334
+ var hasValue = newValue.some(function (item) {
1335
+ return item.id === id;
1336
+ });
1337
+ if (hasValue) {
1338
+ newValue.forEach(function (item) {
1339
+ if (item.id === id) {
1340
+ item.value = val;
1341
+ }
1342
+ });
1343
+ } else {
1344
+ var findValue = options.find(function (item) {
1345
+ return item.id === id;
1346
+ });
1347
+ if (findValue) {
1348
+ newValue.push(_objectSpread2(_objectSpread2({}, findValue), {}, {
1349
+ value: val
1350
+ }));
1351
+ }
1352
+ }
1353
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
1354
+ };
1355
+ return /*#__PURE__*/React__default['default'].createElement("div", null, options.map(function (item) {
1356
+ return /*#__PURE__*/React__default['default'].createElement(antd.Row, {
1357
+ key: item.id
1358
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
1359
+ span: 24
1360
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
1361
+ className: styles$2.rateLabel
1362
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default['default'].createElement(antd.Rate, _objectSpread2(_objectSpread2({}, other), {}, {
1363
+ value: rateValues[item.id] || 0,
1364
+ onChange: function onChange(val) {
1365
+ return changeHandle(val, item.id);
1366
+ }
1367
+ })), /*#__PURE__*/React__default['default'].createElement("span", {
1368
+ className: styles$2.rateText,
1369
+ style: textStyle
1370
+ }, RATE_MAP[rateValues[item.id]])));
1371
+ }));
1372
+ }
1373
+
1374
+ /*
1375
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
1376
+ * @Date: 2022-09-13 11:06:09
1377
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
1378
+ * @LastEditTime: 2022-11-04 15:55:10
1379
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
1380
+ * @Description:
1381
+ *
1382
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
1383
+ */
1384
+ var extendRequest = request.extend({});
1385
+
1386
+ var Province = function Province(props) {
1387
+ var _useState = React.useState([]),
1388
+ _useState2 = _slicedToArray(_useState, 2),
1389
+ option = _useState2[0],
1390
+ setOptions = _useState2[1];
1391
+ var isFirst = React.useRef(false);
1392
+ var initPageSource = /*#__PURE__*/function () {
1393
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1394
+ var apaasAddress, apaasSaveTime, isExpire, _yield$request, list, arr;
1395
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1396
+ while (1) switch (_context.prev = _context.next) {
1397
+ case 0:
1398
+ apaasAddress = window.localStorage.getItem('apaasAddress');
1399
+ apaasSaveTime = window.localStorage.getItem('apaasSaveTime'); //判断是否过期 缓存7天
1400
+ isExpire = apaasSaveTime ? Number(apaasSaveTime) + 7 * 3600 * 24 * 1000 < new Date().getTime() : true;
1401
+ if (!(apaasAddress && !isExpire)) {
1402
+ _context.next = 6;
1403
+ break;
1404
+ }
1405
+ setOptions(JSON.parse(apaasAddress));
1406
+ return _context.abrupt("return");
1407
+ case 6:
1408
+ _context.next = 8;
1409
+ return extendRequest('/qy/gdfw/template/queryAreas', {
1410
+ method: 'get',
1411
+ params: {
1412
+ apiName: 'queryAreas'
1413
+ }
1414
+ });
1415
+ case 8:
1416
+ _yield$request = _context.sent;
1417
+ list = _yield$request.data;
1418
+ arr = toTree(list, 0);
1419
+ setOptions(arr[0].children);
1420
+ window.localStorage.setItem('apaasAddress', JSON.stringify(arr[0].children));
1421
+ window.localStorage.setItem('apaasSaveTime', new Date().getTime().toString());
1422
+ case 14:
1423
+ case "end":
1424
+ return _context.stop();
1425
+ }
1426
+ }, _callee);
1427
+ }));
1428
+ return function initPageSource() {
1429
+ return _ref.apply(this, arguments);
1430
+ };
1431
+ }();
1432
+ React.useEffect(function () {
1433
+ if (!isFirst.current) {
1434
+ initPageSource();
1435
+ isFirst.current = true;
1436
+ }
1437
+ }, []);
1438
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
1439
+ options: option,
1440
+ placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A"
1441
+ })));
1442
+ };
1443
+
1444
+ var _excluded$9 = ["label", "name", "extra", "required", "rules", "initialValue"];
1445
+ function withFormItem(WrappedComponent) {
1446
+ return function (props) {
1447
+ var label = props.label,
1448
+ name = props.name,
1449
+ extra = props.extra,
1450
+ required = props.required,
1451
+ rules = props.rules,
1452
+ initialValue = props.initialValue,
1453
+ otherProps = _objectWithoutProperties(props, _excluded$9);
1454
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, _objectSpread2({}, {
1455
+ label: label,
1456
+ name: name,
1457
+ extra: extra,
1458
+ required: required,
1459
+ rules: rules,
1460
+ initialValue: initialValue
1461
+ }), /*#__PURE__*/React__default['default'].createElement(WrappedComponent, _objectSpread2({}, otherProps)));
1462
+ };
1463
+ }
1464
+
1465
+ var BuyerNick = function BuyerNick(props) {
1466
+ var _props$value = props.value,
1467
+ value = _props$value === void 0 ? {} : _props$value,
1468
+ onChange = props.onChange,
1469
+ shopId = props.shopId,
1470
+ shopList = props.shopList,
1471
+ disabled = props.disabled,
1472
+ _onBlur = props.onBlur;
1473
+ var changeValue = function changeValue(e, type) {
1474
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1475
+ };
1476
+ React.useEffect(function () {
1477
+ //淘宝平台和抖音平台需要展示买家id
1478
+ var platformList = ['TAOBAO', 'FXG'];
1479
+ var showBuyerId = (shopList || []).some(function (item) {
1480
+ return item.shopId == shopId && platformList.includes(item.shopSourceStr);
1481
+ });
1482
+ //如果不是淘宝店铺 旺旺id为空
1483
+ if (!showBuyerId) {
1484
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1485
+ buyerOpenUid: ''
1486
+ }));
1487
+ }
1488
+ }, [shopId, shopList]);
1489
+ return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1490
+ disabled: disabled,
1491
+ placeholder: "\u8BF7\u8F93\u5165\u4E70\u5BB6\u6635\u79F0",
1492
+ value: value === null || value === void 0 ? void 0 : value.buyerNick,
1493
+ onChange: function onChange(e) {
1494
+ changeValue(e, 'buyerNick');
1495
+ },
1496
+ onBlur: function onBlur(e) {
1497
+ _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, 'buyerNick');
1498
+ },
1499
+ style: {
1500
+ marginRight: '8px'
1501
+ }
1502
+ });
1503
+ };
1504
+
1505
+ function TradeId(props) {
1506
+ return /*#__PURE__*/React__default['default'].createElement("div", {
1507
+ style: {
1508
+ display: 'flex'
1509
+ }
1510
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2({}, props)));
1511
+ }
1512
+
1513
+ var Option = antd.Select.Option;
1514
+ var ShopNameSelect = function ShopNameSelect(props) {
1515
+ var value = props.value,
1516
+ onChange = props.onChange,
1517
+ disabled = props.disabled,
1518
+ style = props.style;
1519
+ var _useState = React.useState([]),
1520
+ _useState2 = _slicedToArray(_useState, 2),
1521
+ options = _useState2[0],
1522
+ setOptions = _useState2[1];
1523
+ var handleChange = function handleChange(value) {
1524
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
1525
+ };
1526
+ React.useEffect(function () {
1527
+ // initDataSource();
1528
+ }, []);
1529
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
1530
+ defaultValue: value,
1531
+ disabled: disabled,
1532
+ onChange: handleChange,
1533
+ style: _objectSpread2(_objectSpread2({}, style), {}, {
1534
+ width: '100%'
1535
+ }),
1536
+ showSearch: true,
1537
+ placeholder: "\u8BF7\u9009\u62E9\u5E97\u94FA\u540D\u79F0",
1538
+ filterOption: function filterOption(input, option) {
1539
+ return option['children'].toLowerCase().indexOf(input.toLowerCase()) >= 0;
1540
+ }
1541
+ }, options.map(function (option) {
1542
+ return /*#__PURE__*/React__default['default'].createElement(Option, {
1543
+ value: option.value,
1544
+ key: option.value
1545
+ }, option.label);
1546
+ }));
1547
+ };
1548
+
1549
+ function ApaasAddress(props) {
1550
+ var value = props.value,
1551
+ onChange = props.onChange,
1552
+ disabled = props.disabled;
1553
+ var changeCity = function changeCity(city, selectedOptions) {
1554
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1555
+ address: city
1556
+ }));
1557
+ };
1558
+ var changeDetail = function changeDetail(e) {
1559
+ onChange === null || onChange === void 0 ? void 0 : onChange({
1560
+ address: value === null || value === void 0 ? void 0 : value.address,
1561
+ detail: e.target.value
1562
+ });
1563
+ };
1564
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Province, {
1565
+ value: value === null || value === void 0 ? void 0 : value.address,
1566
+ onChange: changeCity,
1567
+ options: [],
1568
+ disabled: disabled
1569
+ }), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1570
+ disabled: disabled,
1571
+ value: value === null || value === void 0 ? void 0 : value.detail,
1572
+ placeholder: "\u8BE6\u7EC6\u5730\u5740",
1573
+ onChange: changeDetail
1574
+ }));
1575
+ }
1576
+
1577
+ var trade0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1MEQ1MkIyMjIzQUIxMUU0QjU5NjkwNDQxQkU4N0E1MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1MEQ1MkIyMzIzQUIxMUU0QjU5NjkwNDQxQkU4N0E1MiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjUwRDUyQjIwMjNBQjExRTRCNTk2OTA0NDFCRTg3QTUyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjUwRDUyQjIxMjNBQjExRTRCNTk2OTA0NDFCRTg3QTUyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+PFEh+QAAAPhJREFUeNqM0MFKAkEcx/FZNcwSihBBT3oRog4RBHnqoiA+SuAL7J73Fbz7Ah5DOiw5QcdOQUhECoL1BBpC0/eP/0URUf/wYWaH+c3Ofzzf97+NMR1kcY85BuiqLxSRD8PQppgk0MC7WdQBLpWPsWzGC+qy+QEVfMBpKB7lwBKOcBUEwZkEnnCoJ/+YZbkVUjncSOBZF8sr11qvOHQngRHecK3NSnkbSDWT1tq/KIrOtfFIr9aGxRRpnGhgmNLJI1qYyW95vt/4LjR6yiAHZvDqOedkscDHpzwdm2tmS0kPhk0TSeOWcG5nQKuHY1T3DfR1vNgW+BdgACxMP/P+iLA3AAAAAElFTkSuQmCC";
1578
+
1579
+ var trade1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFQ0NGNkNCNjIzQUExMUU0OTZDM0UxQUI1MEVCOUU2RSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpFQ0NGNkNCNzIzQUExMUU0OTZDM0UxQUI1MEVCOUU2RSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkVDQ0Y2Q0I0MjNBQTExRTQ5NkMzRTFBQjUwRUI5RTZFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkVDQ0Y2Q0I1MjNBQTExRTQ5NkMzRTFBQjUwRUI5RTZFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+WQ64bQAAAPVJREFUeNqM0M9KQkEUx/GZwUDNhYQItjKCQNyEEOSqVZtewHcQfIE2Posv0FIiWvQHLDeuBBEXUgTX3LmxRHH6njgXrnC5eODDzFzmNzPn2jdrZ8aYDnJoYo0x7tQUxyhebrcvlsCcRYARGma3NviSzegRuHZMujjDBF43hmMKZWRx/u7ckQSekMYBviOn+wipAi4k8KofT/RZcRWGriTwgSFq2qyUjSF142hko886xQJ93KKt/X1GbvpJ6eQBLfzKtRyyCnfQaJ6hggwGxntv+LUlLPEo6yTSg+HE4D/NlBMLJqFcZH6PQ9T3DTzrWE0K/AkwAPKxWrUjgeKsAAAAAElFTkSuQmCC";
1580
+
1581
+ var trade2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMkExMTUwNTIzQUIxMUU0OEE2MEE5M0YxQjVBOTRDMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMkExMTUwNjIzQUIxMUU0OEE2MEE5M0YxQjVBOTRDMyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAyQTExNTAzMjNBQjExRTQ4QTYwQTkzRjFCNUE5NEMzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyQTExNTA0MjNBQjExRTQ4QTYwQTkzRjFCNUE5NEMzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VBLygAAAAPZJREFUeNqM0M9KQkEUx/EzF4OsFiEi1KoQgsiFCEGt3BRIjxL0Ai263EfpBVpGtOoPCG5aBRERoQjaspVFwul7rse8hJgHPjNzh/nNnxv0TPoico4VHOMbz7hwb1hHSRK9yzGI0MCTjGoBFXeKbrpYpIlDW3yJLbxAPTTubcMNLKEqcShY4AaLvvO7TEozrIrYtcC9T25mrvW3xqG6Bdp4RM0faxWmsDqKePnQr1XGB1r+2Njf18mcNMj54Bon+LRj2eTrd0kcVmm3kcdDUFWbXOPjNf11iR7IjIrSNtGepbFHuPh/YFRXWMb+vIFb73dmBX4EGADWsDqrOlvMIgAAAABJRU5ErkJggg==";
1582
+
1583
+ var trade3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxNzZEMTM5MDIzQUIxMUU0QTYwNkU0NjgyODRCQkFFQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxNzZEMTM5MTIzQUIxMUU0QTYwNkU0NjgyODRCQkFFQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjE3NkQxMzhFMjNBQjExRTRBNjA2RTQ2ODI4NEJCQUVCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjE3NkQxMzhGMjNBQjExRTRBNjA2RTQ2ODI4NEJCQUVCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+RDIqWgAAAPhJREFUeNpi1JvJ+4KBgWEhEPMAcRYQ/wbim0C8DorvA7EUEItdTPt0iAXIYAJiDyC+zgABrECsA8VVQPwEpBiIjwGxK0jxNiBWA+LbQPwfqglGgwxUAGIuIDbQn8UnBNJwAIg5oCa/ZECA/0gYBESA2BSk4TBUUBHJWegApskepOEhEF8BYiOoZ0GAEQsGAS8moM//QJ2lDMQfgfgk1LP1UP89QrLpOwuUsQuIc4H4B8haoCE/YSqAHhUAUppAzAnE5xj///8PEpQEcu6Cgg6o2IUBDwD5gQGo6DlINxBbADWLENQABTuAmBuILYnVcBBKa+PTABBgAC90PqvqQj28AAAAAElFTkSuQmCC";
1584
+
1585
+ var trade4 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyRDAzQ0FGRTIzQUIxMUU0OEYzRkI0MzQxOTNCNjg5QiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyRDAzQ0FGRjIzQUIxMUU0OEYzRkI0MzQxOTNCNjg5QiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjJEMDNDQUZDMjNBQjExRTQ4RjNGQjQzNDE5M0I2ODlCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjJEMDNDQUZEMjNBQjExRTQ4RjNGQjQzNDE5M0I2ODlCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+z54Y5QAAAPhJREFUeNpi5Op4+IKBgWEhEPMAcRYQ/wbim0C8DorvA7EUEIt9LZc7xAJkMAGxBxBfZ4AAViDWgeIqIH4CUgzEx4DYFaR4GxCrAfFtIP4P1QSjQQYqADEXEBtwdz4SAmk4AMQcUJNfMiDAfyQMAiJAbArScBgqqIjkLHQA02QP0vAQiK8AsRHUsyDAiAWDgBcT0Od/oM5SBuKPQHwS6tl6qP8eIdn0nQXK2AXEuUD8A2Qt0JCfMBVAjwoAKU0g5gTic4z///8HCUoCOXdBQQdU7MKAB4D8wABU9BykG4gtgJpFCGqAgh0gFwCxJbEaDkJpbXwaAAIMAKG8PqsrBnEUAAAAAElFTkSuQmCC";
1586
+
1587
+ var trade5 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MUVBOUVCQjIzQUIxMUU0QUZCMkFCQ0QzMzVDM0ZDMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0MUVBOUVCQzIzQUIxMUU0QUZCMkFCQ0QzMzVDM0ZDMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjQxRUE5RUI5MjNBQjExRTRBRkIyQUJDRDMzNUMzRkMwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjQxRUE5RUJBMjNBQjExRTRBRkIyQUJDRDMzNUMzRkMwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+xU6hIgAAAPdJREFUeNqM0M9KAlEUx/E7MoF/WoiIoCslCyIXIgS5alMgvoJvIPgCbXwWobYuJVqVgeCmVSAyxGgE1dJVicH1e/AMDSLqgQ935nJ+d+4Z57bofxljOjhEEwuM0VU+csg0vHzf5SGCGkZmVQcoqRt8SDMGuJbmHk7gwWooWOXAPOIo3x1PUhJ4RFRP/jb/ZUOk0jiXwLNuFkLXWq8gdCmBKV5R0WGlnA2k6hEm/9NrHWGGoQ7b1vneQ1/6cfXhAS38ymc5ZB50MGiS5RQxvDjWWtnM8vImv47mK7OlZAZD06ekcUE4vTOgdY8EqvsGnnQ92xZYCjAAxxw+q99X1uIAAAAASUVORK5CYII=";
1588
+
1589
+ var TextArea = antd.Input.TextArea;
1590
+ var imgList = [trade0, trade1, trade2, trade3, trade4, trade5];
1591
+ var RemarkInput = function RemarkInput(props) {
1592
+ var isShowFlag = props.isShowFlag,
1593
+ value = props.value,
1594
+ onChange = props.onChange,
1595
+ disabled = props.disabled;
1596
+ var changeUrl = function changeUrl(e) {
1597
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
1598
+ flag: e.target.value
1599
+ });
1600
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
1601
+ };
1602
+ var changeRemark = function changeRemark(e) {
1603
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
1604
+ remark: e.target.value
1605
+ });
1606
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
1607
+ };
1608
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(TextArea, {
1609
+ disabled: disabled,
1610
+ rows: 4,
1611
+ value: value === null || value === void 0 ? void 0 : value.remark,
1612
+ placeholder: "\u8BF7\u8F93\u5165\u5907\u6CE8",
1613
+ key: "remark",
1614
+ onChange: changeRemark
1615
+ }), isShowFlag && /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, {
1616
+ style: {
1617
+ marginTop: '12px'
1618
+ },
1619
+ value: value === null || value === void 0 ? void 0 : value.flag,
1620
+ onChange: changeUrl
1621
+ }, imgList.map(function (item, index) {
1622
+ return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
1623
+ value: index,
1624
+ key: item,
1625
+ disabled: disabled
1626
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
1627
+ src: item
1628
+ }));
1629
+ })));
1630
+ };
1631
+
1632
+ var css_248z$3 = ".mb8 {\n margin-bottom: 8px;\n}\n";
1633
+ styleInject(css_248z$3);
1634
+
1635
+ var Logistics = function Logistics(props) {
1636
+ var options = props.options,
1637
+ isSingle = props.isSingle,
1638
+ showField = props.showField,
1639
+ _props$value = props.value,
1640
+ value = _props$value === void 0 ? {} : _props$value,
1641
+ disabled = props.disabled,
1642
+ onChange = props.onChange,
1643
+ _onBlur = props.onBlur;
1644
+ var handleInputChange = function handleInputChange(e) {
1645
+ var val = e.target.value;
1646
+ typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1647
+ order: val
1648
+ }));
1649
+ };
1650
+ var handelSelectChange = function handelSelectChange(val) {
1651
+ typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
1652
+ company: val
1653
+ }));
1654
+ };
1655
+ //物流公司
1656
+ var LogisticsCompany = function LogisticsCompany() {
1657
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
1658
+ disabled: disabled,
1659
+ placeholder: "\u7269\u6D41\u516C\u53F8",
1660
+ onChange: handelSelectChange,
1661
+ value: (value === null || value === void 0 ? void 0 : value.company) === '' ? undefined : value === null || value === void 0 ? void 0 : value.company,
1662
+ options: options,
1663
+ showSearch: true,
1664
+ style: {
1665
+ width: '100%'
1666
+ },
1667
+ filterOption: function filterOption(input, option) {
1668
+ return option.label.includes(input);
1669
+ }
1670
+ });
1671
+ };
1672
+ //物流单号
1673
+ var LogisticsCode = function LogisticsCode() {
1674
+ return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1675
+ disabled: disabled,
1676
+ placeholder: "\u7269\u6D41\u5355\u53F7",
1677
+ className: css_248z$3.logisticsInput,
1678
+ onChange: handleInputChange,
1679
+ value: value === null || value === void 0 ? void 0 : value.order,
1680
+ onBlur: function onBlur(e) {
1681
+ _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, 'expressLogisticsCode');
1682
+ }
1683
+ });
1684
+ };
1685
+ return /*#__PURE__*/React__default['default'].createElement("div", {
1686
+ className: css_248z$3.logistics
1687
+ }, isSingle ? showField === 'EXPRESS_COMPANY' ? LogisticsCompany() : null : LogisticsCompany(), isSingle ? showField === 'EXPRESS_WAYBILL_CODE' ? LogisticsCode() : null : LogisticsCode());
1688
+ };
1689
+
1690
+ var ExpressLogistics = function ExpressLogistics(props) {
1691
+ return /*#__PURE__*/React__default['default'].createElement(Logistics, _objectSpread2({}, props));
1692
+ };
1693
+
1694
+ var AliPay = function AliPay(props) {
1695
+ var value = props.value,
1696
+ onChange = props.onChange,
1697
+ isSingle = props.isSingle,
1698
+ disabled = props.disabled,
1699
+ _onBlur = props.onBlur;
1700
+ var changeValue = function changeValue(e, type) {
1701
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
1702
+ };
1703
+ React.useEffect(function () {}, []);
1704
+ return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1705
+ disabled: disabled,
1706
+ placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
1707
+ value: value === null || value === void 0 ? void 0 : value.name,
1708
+ onChange: function onChange(e) {
1709
+ changeValue(e, 'name');
1710
+ },
1711
+ style: {
1712
+ marginRight: '8px'
1713
+ }
1714
+ })) : null, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
1715
+ placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u8D26\u53F7",
1716
+ value: value === null || value === void 0 ? void 0 : value.user,
1717
+ onChange: function onChange(e) {
1718
+ changeValue(e, 'user');
1719
+ },
1720
+ onBlur: function onBlur(e) {
1721
+ _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, 'alipayAccount');
1722
+ },
1723
+ disabled: disabled,
1724
+ style: {
1725
+ marginRight: '8px'
1726
+ }
1727
+ })));
1728
+ };
1729
+
1730
+ var css_248z$4 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.goodsBox .right-context {\n font-size: 12px;\n}\n.goodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.goodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.goodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n.goods-imgBox .add-btn {\n color: #86909c;\n}\n.goods-imgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
1731
+ styleInject(css_248z$4);
1732
+
1733
+ var defaultImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAOKADAAQAAAABAAAAOAAAAAANV2hTAAACcklEQVRoBe1aa3OqMBBdlFatfVivnV7H29f//0md6XSc1hegKCCigE2c0YKtri7Rm3ayX0zCbjhnzyZEVBs53hx+seV+MbcFNUXwpyusFFQKSp4BVaKSC4TCUwqiKZLcQSkouUAoPKUgmiLJHZSCkguEwtNRjw0O8/kcTMuGWRhu8BAzfKLrUPtTAU3TSBOSCXqeD2bfJt1036BSqQjn5dK+YQt/8hoMo4h0Q0pQmKFKyAomgdZva1C5ukgOZW7bQwfaXTPzPEIIZkXBXnyBN/aBr7fq9SXkcuTC+gLlvxPkG5VhDVbAHHcMj/f1VT9rQ1yqiEj69jAVOQkC8CdBaixL5ygEB/YIhiM3C05y7EFLNGI7battgMvWF7d8Pv9lu69WrlIlWiwUoFQswHQ6I5NKBh6MIC+z93YPZrPPg0Cr04Onh8ZiM1mC4A/x09OT1CZDfagv50x+HoTgwHag2zNh/TeBKIoZaQMe/v1NnUzO2IP88qKcxCWsLXQNxnEMrY4BnW/ILRH7/mRVkvy4x/2fX5osxgLeF23CFAzYmnlv9SCYTlGMVn8IMVOTx4wZYW58IwrDCBr1m5S66GSIgxCCLjuXdg0L4nh3BQbspLJujutB8y2Cu8bt+iVyX0iJcmD7kNuGliv62mwD34FFmBAFRQBJzsHL3DDxUk/GbGoLUXDT5FnGdy/27XeRluB22LtfVQR3z5WcnmQFdXauPJbp7Hsi1ciRZfaOpFatHOWlU/msSOUHmvobCTl3cgSS16Ac8HEUiiCeI7k9lIJy64OjUwriOZLbQykotz44OqUgniO5PZSCcuuDo1MK4jmS2+MD4RXMNiaoge4AAAAASUVORK5CYII=";
1734
+
1735
+ var TabPane = antd.Tabs.TabPane;
1736
+ var Option$1 = antd.Select.Option;
1737
+ var Search = antd.Input.Search;
1738
+ var GoodsModal = function GoodsModal(props) {
1739
+ var onSubmit = props.onSubmit,
1740
+ _onCancel = props.onCancel,
1741
+ visible = props.visible,
1742
+ type = props.type,
1743
+ shopId = props.shopId,
1744
+ imgList = props.imgList,
1745
+ maxLength = props.maxLength,
1746
+ shopList = props.shopList,
1747
+ changeSku = props.changeSku,
1748
+ width = props.width;
1749
+ var _useState = React.useState([]),
1750
+ _useState2 = _slicedToArray(_useState, 2),
1751
+ selectList = _useState2[0],
1752
+ setSelect = _useState2[1];
1753
+ var _useState3 = React.useState([]),
1754
+ _useState4 = _slicedToArray(_useState3, 2),
1755
+ selectIds = _useState4[0],
1756
+ setSelectIds = _useState4[1];
1757
+ var _useState5 = React.useState([]),
1758
+ _useState6 = _slicedToArray(_useState5, 2),
1759
+ goodList = _useState6[0],
1760
+ setGoodList = _useState6[1];
1761
+ var _useState7 = React.useState(false),
1762
+ _useState8 = _slicedToArray(_useState7, 2),
1763
+ loading = _useState8[0],
1764
+ setLoading = _useState8[1];
1765
+ var _useState9 = React.useState({
1766
+ apiName: 'queryItems',
1767
+ desc: true,
1768
+ numIids: '',
1769
+ orderBy: 'list_time',
1770
+ pageNo: 1,
1771
+ pageSize: 10,
1772
+ shopId: shopId,
1773
+ type: 'onSale',
1774
+ cids: '',
1775
+ title: ''
1776
+ }),
1777
+ _useState10 = _slicedToArray(_useState9, 2),
1778
+ searchParams = _useState10[0],
1779
+ setSearch = _useState10[1];
1780
+ var _useState11 = React.useState(0),
1781
+ _useState12 = _slicedToArray(_useState11, 2),
1782
+ total = _useState12[0],
1783
+ setTotal = _useState12[1];
1784
+ var _useState13 = React.useState(''),
1785
+ _useState14 = _slicedToArray(_useState13, 2),
1786
+ platform = _useState14[0],
1787
+ setPlatform = _useState14[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
1788
+ var _useState15 = React.useState({}),
1789
+ _useState16 = _slicedToArray(_useState15, 2),
1790
+ shopInfo = _useState16[0],
1791
+ setShopInfo = _useState16[1]; //店铺信息
1792
+ var _useState17 = React.useState(true),
1793
+ _useState18 = _slicedToArray(_useState17, 2),
1794
+ canSearch = _useState18[0],
1795
+ setCanSearch = _useState18[1];
1796
+ var _useState19 = React.useState([null]),
1797
+ _useState20 = _slicedToArray(_useState19, 2),
1798
+ nextKeyList = _useState20[0],
1799
+ setNextKeyList = _useState20[1];
1800
+ var _useState21 = React.useState([{
1801
+ tab: '出售中',
1802
+ key: 'onSale'
1803
+ }, {
1804
+ tab: '仓库中',
1805
+ key: 'inventory'
1806
+ }, {
1807
+ tab: '已选择',
1808
+ key: 'select'
1809
+ }]),
1810
+ _useState22 = _slicedToArray(_useState21, 2),
1811
+ tabs = _useState22[0],
1812
+ setTabs = _useState22[1];
1813
+ var _useState23 = React.useState([{
1814
+ name: '上架时间',
1815
+ value: 'list_time'
1816
+ }, {
1817
+ name: '按库存',
1818
+ value: 'num'
1819
+ }, {
1820
+ name: '按价格',
1821
+ value: 'price'
1822
+ }]),
1823
+ _useState24 = _slicedToArray(_useState23, 1),
1824
+ goodSort = _useState24[0];
1825
+ //宝贝分类
1826
+ var _useState25 = React.useState([]),
1827
+ _useState26 = _slicedToArray(_useState25, 2),
1828
+ shell = _useState26[0],
1829
+ setShell = _useState26[1];
1830
+ var clickOrder = function clickOrder(sort) {
1831
+ if (sort.value === searchParams.orderBy) {
1832
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
1833
+ desc: !searchParams.desc
1834
+ }));
1835
+ } else {
1836
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
1837
+ orderBy: sort.value
1838
+ }));
1839
+ }
1840
+ };
1841
+ //选择页码
1842
+ var pageChange = function pageChange(page, pageSize) {
1843
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
1844
+ pageNo: page,
1845
+ pageSize: pageSize
1846
+ }));
1847
+ };
1848
+ /**
1849
+ * 选择商品
1850
+ * @param good
1851
+ * @returns
1852
+ */
1853
+ var changeItem = function changeItem(good) {
1854
+ if (searchParams.type === 'select') {
1855
+ var newSelect = selectList.filter(function (item) {
1856
+ return item.numIid !== good.numIid;
1857
+ });
1858
+ setSelect(_toConsumableArray(newSelect));
1859
+ var ids = newSelect.map(function (item) {
1860
+ return item.numIid;
1861
+ });
1862
+ setSelectIds(ids);
1863
+ } else {
1864
+ if (type === 4 || changeSku) {
1865
+ setSelect([good]);
1866
+ setSelectIds([good.numIid]);
1867
+ } else {
1868
+ if (selectList.length >= maxLength) {
1869
+ antd.message.error("\u6700\u591A\u6DFB\u52A0".concat(maxLength, "\u5F20"));
1870
+ return;
1871
+ }
1872
+ var hasGood = selectList.some(function (t) {
1873
+ return t.numIid === good.numIid;
1874
+ });
1875
+ if (hasGood) {
1876
+ var newSelectList = selectList.filter(function (item) {
1877
+ return item.numIid !== good.numIid;
1878
+ });
1879
+ setSelect(newSelectList);
1880
+ var _ids = newSelectList.map(function (item) {
1881
+ return item.numIid;
1882
+ });
1883
+ setSelectIds(_ids);
1884
+ } else {
1885
+ setSelect([].concat(_toConsumableArray(selectList), [good]));
1886
+ setSelectIds([].concat(_toConsumableArray(selectIds), [good.numIid]));
1887
+ }
1888
+ }
1889
+ }
1890
+ };
1891
+ /**
1892
+ * 获取分类列表
1893
+ */
1894
+ var querySellerCat = function querySellerCat() {
1895
+ extendRequest('/qy/gdfw/workOrder/querySellerCat', {
1896
+ method: 'get',
1897
+ params: {
1898
+ shopId: shopId || 257615501,
1899
+ apiName: 'querySellerCat'
1900
+ }
1901
+ }).then(function (res) {
1902
+ var arr = [{
1903
+ value: '',
1904
+ label: '所有分类'
1905
+ }];
1906
+ (res.data || []).forEach(function (item) {
1907
+ var category = item.category,
1908
+ _item$children = item.children,
1909
+ children = _item$children === void 0 ? [] : _item$children;
1910
+ arr.push({
1911
+ label: "| ".concat(category.name),
1912
+ value: [category.value].concat(_toConsumableArray(children.map(function (v) {
1913
+ return v.value;
1914
+ }))).join(',')
1915
+ });
1916
+ children.forEach(function (c) {
1917
+ arr.push({
1918
+ label: "|-- ".concat(c.name),
1919
+ value: c.value
1920
+ });
1921
+ });
1922
+ });
1923
+ setShell([].concat(arr));
1924
+ });
1925
+ };
1926
+ /**
1927
+ *
1928
+ * @returns 获取查询参数
1929
+ */
1930
+ var queryPd = function queryPd() {
1931
+ var params = {
1932
+ apiName: 'queryItems',
1933
+ desc: searchParams.desc,
1934
+ productIds: searchParams.numIids,
1935
+ orderBy: searchParams.orderBy,
1936
+ pageNo: searchParams.pageNo,
1937
+ pageSize: searchParams.pageSize,
1938
+ shopId: shopId,
1939
+ type: searchParams.type,
1940
+ title: searchParams.title,
1941
+ cids: searchParams.cids
1942
+ };
1943
+ if (platform === 'sph') {
1944
+ params.useNext = true;
1945
+ params.nextKey = nextKeyList[searchParams.pageNo - 1];
1946
+ }
1947
+ return params;
1948
+ };
1949
+ /**
1950
+ * 查询商品
1951
+ */
1952
+ var queryItems = /*#__PURE__*/function () {
1953
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
1954
+ var res, _ref2, items, totalCount, params, _res, _ref3, list, _total, nextKey, newList;
1955
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1956
+ while (1) switch (_context.prev = _context.next) {
1957
+ case 0:
1958
+ _context.prev = 0;
1959
+ setLoading(true);
1960
+ if (!(platform === 'taobao')) {
1961
+ _context.next = 12;
1962
+ break;
1963
+ }
1964
+ _context.next = 5;
1965
+ return extendRequest('/qy/gdfw/workOrder/queryItems', {
1966
+ method: 'post',
1967
+ data: queryPd()
1968
+ });
1969
+ case 5:
1970
+ res = _context.sent;
1971
+ _ref2 = res.data || {
1972
+ items: [],
1973
+ totalCount: 0
1974
+ }, items = _ref2.items, totalCount = _ref2.totalCount;
1975
+ items.forEach(function (item) {
1976
+ item.platform = platform;
1977
+ });
1978
+ setGoodList(_toConsumableArray(items));
1979
+ setTotal(totalCount);
1980
+ _context.next = 26;
1981
+ break;
1982
+ case 12:
1983
+ params = _objectSpread2({}, queryPd());
1984
+ params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
1985
+ params.platform = platform;
1986
+ params.status = params.type === 'onSale' ? 1 : 0;
1987
+ delete params.type;
1988
+ _context.next = 19;
1989
+ return extendRequest('/qy/gdfw/product/listProduct', {
1990
+ method: 'post',
1991
+ data: params
1992
+ });
1993
+ case 19:
1994
+ _res = _context.sent;
1995
+ _ref3 = _res.data || {
1996
+ result: [],
1997
+ total: 0
1998
+ }, list = _ref3.result, _total = _ref3.total, nextKey = _ref3.nextKey;
1999
+ newList = list || [];
2000
+ newList.forEach(function (item) {
2001
+ item.numIid = item.productId;
2002
+ item.outerId = item.outId;
2003
+ item.title = item.productName;
2004
+ item.platform = platform;
2005
+ });
2006
+ setGoodList(_toConsumableArray(newList));
2007
+ setTotal(_total);
2008
+ if (platform === 'sph' && nextKey && !nextKeyList.includes(nextKey)) {
2009
+ setNextKeyList([].concat(_toConsumableArray(nextKeyList), [nextKey]));
2010
+ }
2011
+ case 26:
2012
+ _context.prev = 26;
2013
+ setLoading(false);
2014
+ return _context.finish(26);
2015
+ case 29:
2016
+ case "end":
2017
+ return _context.stop();
2018
+ }
2019
+ }, _callee, null, [[0,, 26, 29]]);
2020
+ }));
2021
+ return function queryItems(_x) {
2022
+ return _ref.apply(this, arguments);
2023
+ };
2024
+ }();
2025
+ var getItem = function getItem(searchParams, platform) {
2026
+ if (searchParams.type === 'select') {
2027
+ setTotal(1);
2028
+ return;
2029
+ } else {
2030
+ queryItems(platform);
2031
+ }
2032
+ };
2033
+ /**
2034
+ * 获取平台
2035
+ */
2036
+ var setPlatformHandle = function setPlatformHandle(platform) {
2037
+ platform === 'taobao' && querySellerCat();
2038
+ };
2039
+ //视屏号平台游标查询
2040
+ var PaginationSph = function PaginationSph() {
2041
+ var changePageHandle = function changePageHandle(type) {
2042
+ var pageNo = searchParams.pageNo;
2043
+ type === 'next' ? pageNo++ : pageNo--;
2044
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2045
+ pageNo: pageNo
2046
+ }));
2047
+ };
2048
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2049
+ className: "sphPagination"
2050
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2051
+ className: "shpBtn ".concat(searchParams.pageNo <= 1 && 'unCursor'),
2052
+ onClick: function onClick() {
2053
+ if (searchParams.pageNo <= 1) return;
2054
+ changePageHandle('before');
2055
+ }
2056
+ }, "\u4E0A\u4E00\u9875"), /*#__PURE__*/React__default['default'].createElement("div", null, searchParams.pageNo, "/", Math.ceil(total / searchParams.pageSize) || 0), /*#__PURE__*/React__default['default'].createElement("div", {
2057
+ className: "shpBtn ".concat(searchParams.pageNo >= Math.ceil(total / searchParams.pageSize) && 'unCursor'),
2058
+ onClick: function onClick() {
2059
+ if (searchParams.pageNo >= Math.ceil(total / searchParams.pageSize)) return;
2060
+ changePageHandle('next');
2061
+ }
2062
+ }, "\u4E0B\u4E00\u9875"));
2063
+ };
2064
+ React.useEffect(function () {
2065
+ var shopInfo = shopList.find(function (item) {
2066
+ return shopId === item.shopId || shopId === item.shopName;
2067
+ });
2068
+ setShopInfo(shopInfo);
2069
+ var platform = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopSourceStr.toLowerCase();
2070
+ setPlatform(platform);
2071
+ var tab = platform === 'fxg' ? [{
2072
+ tab: '选商品',
2073
+ key: 'onSale'
2074
+ }, {
2075
+ tab: '已选择',
2076
+ key: 'select'
2077
+ }] : [{
2078
+ tab: '出售中',
2079
+ key: 'onSale'
2080
+ }, {
2081
+ tab: '仓库中',
2082
+ key: 'inventory'
2083
+ }, {
2084
+ tab: '已选择',
2085
+ key: 'select'
2086
+ }];
2087
+ setTabs(tab);
2088
+ }, []);
2089
+ React.useEffect(function () {
2090
+ setPlatformHandle(platform);
2091
+ if (imgList.length) {
2092
+ setSelect(imgList);
2093
+ var ids = imgList.map(function (item) {
2094
+ return item.numIid;
2095
+ });
2096
+ if (!(changeSku || type === 4)) {
2097
+ setSelectIds(ids);
2098
+ }
2099
+ }
2100
+ }, [platform]);
2101
+ React.useEffect(function () {
2102
+ platform && canSearch && getItem(searchParams, platform);
2103
+ }, [searchParams, platform]);
2104
+ return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
2105
+ title: '选择宝贝',
2106
+ okText: '确认',
2107
+ cancelText: '取消',
2108
+ visible: visible,
2109
+ width: width || 850,
2110
+ onCancel: function onCancel() {
2111
+ _onCancel();
2112
+ },
2113
+ onOk: function onOk() {
2114
+ onSubmit(selectList);
2115
+ },
2116
+ wrapClassName: "goodModal"
2117
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Tabs, {
2118
+ type: "card",
2119
+ activeKey: searchParams.type,
2120
+ onChange: function onChange(e) {
2121
+ var params = _objectSpread2(_objectSpread2({}, searchParams), {}, {
2122
+ type: e,
2123
+ pageNo: 1
2124
+ });
2125
+ setSearch(params);
2126
+ }
2127
+ }, tabs.map(function (tab) {
2128
+ return /*#__PURE__*/React__default['default'].createElement(TabPane, {
2129
+ tab: tab.tab + (tab.key === 'select' ? "(".concat(selectList.length, ")") : ''),
2130
+ key: tab.key
2131
+ });
2132
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
2133
+ className: "searchBox",
2134
+ style: {
2135
+ display: searchParams.type === 'select' ? 'none' : ''
2136
+ }
2137
+ }, platform === 'taobao' && /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, {
2138
+ value: searchParams.orderBy,
2139
+ onChange: function onChange(e) {
2140
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2141
+ pageNo: 1,
2142
+ orderBy: e.target.value
2143
+ }));
2144
+ }
2145
+ }, goodSort.map(function (sort) {
2146
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
2147
+ type: sort.value === searchParams.orderBy ? 'primary' : 'default',
2148
+ onClick: function onClick() {
2149
+ clickOrder(sort);
2150
+ },
2151
+ key: sort.value
2152
+ }, sort.name, sort.value === searchParams.orderBy ? searchParams.desc ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u21BE") : /*#__PURE__*/React__default['default'].createElement("span", null, "\u21C2") : /*#__PURE__*/React__default['default'].createElement("span", null, "\u21C5"));
2153
+ })), /*#__PURE__*/React__default['default'].createElement("div", null, platform === 'taobao' && /*#__PURE__*/React__default['default'].createElement(antd.Select, {
2154
+ className: "classify",
2155
+ value: searchParams.cids,
2156
+ onChange: function onChange(value) {
2157
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2158
+ pageNo: 1,
2159
+ cids: value
2160
+ }));
2161
+ }
2162
+ }, shell.map(function (item) {
2163
+ return /*#__PURE__*/React__default['default'].createElement(Option$1, {
2164
+ value: item.value,
2165
+ key: item.value
2166
+ }, item.label);
2167
+ })), /*#__PURE__*/React__default['default'].createElement(Search, {
2168
+ placeholder: platform === 'taobao' ? '宝贝链接,标题' : '商品ID',
2169
+ // enterButton="搜索"
2170
+ className: "search",
2171
+ value: platform === 'taobao' ? searchParams.title : searchParams.numIids,
2172
+ onChange: function onChange(e) {
2173
+ setCanSearch(false);
2174
+ platform === 'taobao' ? setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2175
+ pageNo: 1,
2176
+ title: e.target.value
2177
+ })) : setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2178
+ numIids: e.target.value
2179
+ }));
2180
+ },
2181
+ onSearch: function onSearch(val) {
2182
+ setCanSearch(true);
2183
+ platform === 'taobao' ? setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2184
+ pageNo: 1,
2185
+ title: val
2186
+ })) : setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
2187
+ pageNo: 1,
2188
+ numIids: val
2189
+ }));
2190
+ }
2191
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
2192
+ spinning: loading
2193
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2194
+ className: "goodsMain"
2195
+ }, (searchParams.type == 'select' ? selectList : goodList).map(function (good) {
2196
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2197
+ key: good.numIid,
2198
+ className: "goodItem ".concat(selectIds.includes(good.numIid) ? 'active' : ''),
2199
+ onClick: function onClick() {
2200
+ changeItem(good);
2201
+ }
2202
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2203
+ className: "goodImg"
2204
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
2205
+ src: good.picUrl || defaultImg,
2206
+ alt: "",
2207
+ className: "img"
2208
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
2209
+ className: "goodText"
2210
+ }, good.title), /*#__PURE__*/React__default['default'].createElement("div", {
2211
+ className: "goodPrice"
2212
+ }, "\xA5", good.price));
2213
+ }))), /*#__PURE__*/React__default['default'].createElement("footer", {
2214
+ className: "footer"
2215
+ }, platform !== 'sph' ? /*#__PURE__*/React__default['default'].createElement(antd.ConfigProvider, {
2216
+ locale: zhCN__default['default']
2217
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Pagination, {
2218
+ total: total,
2219
+ current: searchParams.pageNo,
2220
+ pageSize: searchParams.pageSize,
2221
+ onChange: pageChange
2222
+ })) : PaginationSph()));
2223
+ };
2224
+
2225
+ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
2226
+ var _useState = React.useState(false),
2227
+ _useState2 = _slicedToArray(_useState, 2),
2228
+ visible = _useState2[0],
2229
+ setVisible = _useState2[1];
2230
+ var _useState3 = React.useState(''),
2231
+ _useState4 = _slicedToArray(_useState3, 2),
2232
+ sku = _useState4[0],
2233
+ setSku = _useState4[1];
2234
+ var _useState5 = React.useState([]),
2235
+ _useState6 = _slicedToArray(_useState5, 2),
2236
+ options = _useState6[0],
2237
+ setOptions = _useState6[1];
2238
+ var _useState7 = React.useState(''),
2239
+ _useState8 = _slicedToArray(_useState7, 2),
2240
+ numIids = _useState8[0],
2241
+ setNumIids = _useState8[1];
2242
+ React.useImperativeHandle(ref, function () {
2243
+ return {
2244
+ open: function open(_ref) {
2245
+ var shopId = _ref.shopId,
2246
+ numIids = _ref.numIids,
2247
+ options = _ref.options;
2248
+ setVisible(true);
2249
+ setSku('');
2250
+ setNumIids(numIids);
2251
+ setOptions(options);
2252
+ },
2253
+ close: function close() {
2254
+ setVisible(false);
2255
+ }
2256
+ };
2257
+ });
2258
+ var handleSure = /*#__PURE__*/function () {
2259
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2260
+ var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _yield$request, _yield$request$data, data;
2261
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2262
+ while (1) switch (_context.prev = _context.next) {
2263
+ case 0:
2264
+ type = props.type;
2265
+ if (sku) {
2266
+ _context.next = 5;
2267
+ break;
2268
+ }
2269
+ props.handleOk({
2270
+ enableItemId: '',
2271
+ enableSupplierName: '',
2272
+ propertiesName: ''
2273
+ });
2274
+ _context.next = 16;
2275
+ break;
2276
+ case 5:
2277
+ SKU = options.find(function (item) {
2278
+ return item.value === sku;
2279
+ });
2280
+ if (!(type !== 4)) {
2281
+ _context.next = 10;
2282
+ break;
2283
+ }
2284
+ props.handleOk({
2285
+ enableItemId: '',
2286
+ enableSupplierName: '',
2287
+ propertiesName: ((_ref3 = SKU || {
2288
+ label: ''
2289
+ }) === null || _ref3 === void 0 ? void 0 : _ref3.label) || '',
2290
+ picUrl: (_ref4 = SKU || {
2291
+ picUrl: ''
2292
+ }) === null || _ref4 === void 0 ? void 0 : _ref4.picUrl,
2293
+ outerSkuId: (_ref5 = SKU || {
2294
+ outerSkuId: ''
2295
+ }) === null || _ref5 === void 0 ? void 0 : _ref5.outerSkuId
2296
+ });
2297
+ _context.next = 16;
2298
+ break;
2299
+ case 10:
2300
+ _context.next = 12;
2301
+ return extendRequest('/qy/gdfw/erp/getSupplierInfo', {
2302
+ method: 'get',
2303
+ params: {
2304
+ itemId: numIids,
2305
+ skuId: sku,
2306
+ userNick: props.userNick
2307
+ }
2308
+ });
2309
+ case 12:
2310
+ _yield$request = _context.sent;
2311
+ _yield$request$data = _yield$request.data;
2312
+ data = _yield$request$data === void 0 ? [] : _yield$request$data;
2313
+ props.handleOk({
2314
+ enableItemId: data.length > 0 ? data[0]['supplierItemOuterId'] : '',
2315
+ enableSupplierName: data.length > 0 ? data[0]['supplierName'] : '',
2316
+ propertiesName: ((_ref6 = SKU || {
2317
+ label: ''
2318
+ }) === null || _ref6 === void 0 ? void 0 : _ref6.label) || '',
2319
+ picUrl: (_ref7 = SKU || {
2320
+ picUrl: ''
2321
+ }) === null || _ref7 === void 0 ? void 0 : _ref7.picUrl
2322
+ });
2323
+ case 16:
2324
+ setVisible(false);
2325
+ case 17:
2326
+ case "end":
2327
+ return _context.stop();
2328
+ }
2329
+ }, _callee);
2330
+ }));
2331
+ return function handleSure() {
2332
+ return _ref2.apply(this, arguments);
2333
+ };
2334
+ }();
2335
+ return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
2336
+ title: "\u8BF7\u9009\u62E9\u5BF9\u5E94\u7684SKU",
2337
+ visible: visible,
2338
+ onCancel: function onCancel() {
2339
+ return setVisible(false);
2340
+ },
2341
+ onOk: handleSure,
2342
+ okText: "\u786E\u5B9A",
2343
+ cancelText: "\u53D6\u6D88"
2344
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
2345
+ options: options,
2346
+ value: sku,
2347
+ onChange: function onChange(val) {
2348
+ return setSku(val);
2349
+ },
2350
+ style: {
2351
+ width: '300px'
2352
+ }
2353
+ }));
2354
+ });
2355
+
2356
+ var iconDelete = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAcZJREFUOI2NlDty01AUhr//mtDinUTswKGhYsasAHswbpnbMXYRU8SUgjaYSVgBZKhosHbgmx0kO3CdDDoUeiBbV3FOJZ3Hp/PQOaJDlulqKKdjMxsASakOkjKRhw/v313F4rSvOEvPE8ldNCBdEszy8dxPQ1PpdmFfF5LbPAIGkEhu8+nLt9NohgVMp+24R4jJz/zbzzWwLHPz34HvQII4jgO4BgLiTa2y/PncT4MrqO6yTtm4mvnJ6I7eoAxswe7oDWZ+MpJRD6bsO1qmqyHiRyNka5afzP00LNKL/lP+ZnWmJWzhx9uyqjXQb3zstTNsfwB9ya3P0vNk4cfbOtNDMMCwxAkGkS61oIdgResYaJmutohnEehO+VAPLwqr/F2Hoarh9p6jm+r1nqMbjNsH/OXAQodxp2etnsaDgjPIDsEkt44OqhVG5oTCIRhFz+LTb4hQEMAyXYXGVmzN8hOAjgHE7cb1zE+SJ8VzPhL16vVLRyKwTruRj6C8NnM/DWb2sRnUAYvbTb76tXqV7s/vX9mLl68kafAAqC2NSwNdBxZ32XlpahDXRj7aP7AtYCXLdDU0LClWU+W+WzDIhMLMT37G4v4ByZT7Ht1YoCYAAAAASUVORK5CYII=";
2357
+
2358
+ var imgListConstant = [];
2359
+ var Goods = function Goods(props) {
2360
+ var _props$value = props.value,
2361
+ value = _props$value === void 0 ? {
2362
+ shopId: '',
2363
+ imgList: []
2364
+ } : _props$value,
2365
+ _props$maxLength = props.maxLength,
2366
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
2367
+ onChange = props.onChange,
2368
+ _props$type = props.type,
2369
+ type = _props$type === void 0 ? 2 : _props$type,
2370
+ _props$shopList = props.shopList,
2371
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
2372
+ enableItemId = props.enableItemId,
2373
+ enableSupplierName = props.enableSupplierName,
2374
+ userNick = props.userNick,
2375
+ disabled = props.disabled,
2376
+ changeSku = props.changeSku,
2377
+ width = props.width;
2378
+ var shopId = value.shopId,
2379
+ imgList = value.imgList;
2380
+ console.log(props);
2381
+ // 目前当type == 3 时需要讲item项水平排列
2382
+ var goodsBoxClassName = 'goodsBox-item-horizontal--box';
2383
+ var _useState = React.useState(false),
2384
+ _useState2 = _slicedToArray(_useState, 2),
2385
+ visible = _useState2[0],
2386
+ setVisible = _useState2[1];
2387
+ var _useState3 = React.useState(''),
2388
+ _useState4 = _slicedToArray(_useState3, 2),
2389
+ editState = _useState4[0],
2390
+ setEditState = _useState4[1];
2391
+ var _useState5 = React.useState(0),
2392
+ _useState6 = _slicedToArray(_useState5, 2),
2393
+ uploadImageCount = _useState6[0],
2394
+ setUploadImageCount = _useState6[1];
2395
+ var skuRef = React.useRef();
2396
+ var _useState7 = React.useState(false),
2397
+ _useState8 = _slicedToArray(_useState7, 2),
2398
+ editVisible = _useState8[0],
2399
+ setEditVisible = _useState8[1];
2400
+ // onChange事件会修改imgList里的字段,所以保存初始化的imglist值
2401
+ if (!imgListConstant.length) {
2402
+ imgListConstant = JSON.parse(JSON.stringify(imgList));
2403
+ }
2404
+ React.useEffect(function () {
2405
+ return function () {
2406
+ setEditVisible(false);
2407
+ imgListConstant = [];
2408
+ };
2409
+ }, []);
2410
+ //是否是淘宝店铺
2411
+ var isTaobaoPlat = React.useMemo(function () {
2412
+ return shopList.some(function (item) {
2413
+ return item.shopId === shopId && item.shopSourceStr === 'TAOBAO';
2414
+ });
2415
+ }, [shopId]);
2416
+ // 查询SKU
2417
+ var querySkus = /*#__PURE__*/function () {
2418
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
2419
+ var shopId, numIids;
2420
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2421
+ while (1) switch (_context.prev = _context.next) {
2422
+ case 0:
2423
+ shopId = _ref.shopId, numIids = _ref.numIids;
2424
+ return _context.abrupt("return", extendRequest('/qy/gdfw/workOrder/queryItemSkus', {
2425
+ method: 'post',
2426
+ data: {
2427
+ shopId: shopId,
2428
+ numIids: numIids
2429
+ }
2430
+ }));
2431
+ case 2:
2432
+ case "end":
2433
+ return _context.stop();
2434
+ }
2435
+ }, _callee);
2436
+ }));
2437
+ return function querySkus(_x) {
2438
+ return _ref2.apply(this, arguments);
2439
+ };
2440
+ }();
2441
+ //删除图片
2442
+ var deleteImg = function deleteImg(index) {
2443
+ var newSelect = imgList.filter(function (_, i) {
2444
+ return index !== i;
2445
+ });
2446
+ var newValue = {
2447
+ shopId: shopId,
2448
+ imgList: _toConsumableArray(newSelect)
2449
+ };
2450
+ setEditVisible(false);
2451
+ setUploadImageCount(newSelect.length);
2452
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
2453
+ imgListConstant = [];
2454
+ };
2455
+ //选择sku
2456
+ var handleSelectSku = function handleSelectSku(_ref3) {
2457
+ var enableItemId = _ref3.enableItemId,
2458
+ enableSupplierName = _ref3.enableSupplierName,
2459
+ propertiesName = _ref3.propertiesName,
2460
+ picUrl = _ref3.picUrl,
2461
+ outerSkuId = _ref3.outerSkuId;
2462
+ var newList = JSON.parse(JSON.stringify(imgList));
2463
+ if (type === 4) {
2464
+ newList[newList.length - 1].itemId = enableItemId;
2465
+ newList[newList.length - 1].supplierName = enableSupplierName;
2466
+ } else {
2467
+ newList[newList.length - 1].propertiesName = propertiesName;
2468
+ }
2469
+ if (type === 1 && outerSkuId) {
2470
+ newList[newList.length - 1].outerId = outerSkuId;
2471
+ }
2472
+ //替换成sku的图片
2473
+ picUrl && (newList[newList.length - 1].picUrl = picUrl);
2474
+ var newValue = {
2475
+ shopId: shopId,
2476
+ imgList: newList
2477
+ };
2478
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2479
+ };
2480
+ //选择回调
2481
+ var onSubmit = /*#__PURE__*/function () {
2482
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
2483
+ var newList, newImgList, newValue, _yield$querySkus, data, _skuRef$current, options;
2484
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2485
+ while (1) switch (_context2.prev = _context2.next) {
2486
+ case 0:
2487
+ newList = list.map(function (item) {
2488
+ //过滤属性 只保存需要的字段
2489
+ var params = {
2490
+ numIid: item.numIid,
2491
+ picUrl: item.picUrl,
2492
+ platform: item.platform,
2493
+ title: item.title,
2494
+ price: item.price //价格
2495
+ };
2496
+
2497
+ if (type === 1) {
2498
+ params.outerId = item.outerId; //编码
2499
+ }
2500
+
2501
+ if (changeSku) {
2502
+ params.propertiesName = '';
2503
+ }
2504
+ if (type === 4) {
2505
+ if (enableItemId) {
2506
+ params.itemId = '';
2507
+ }
2508
+ if (enableSupplierName) {
2509
+ params.supplierName = '';
2510
+ }
2511
+ }
2512
+ return params;
2513
+ });
2514
+ newImgList = changeSku || type === 4 ? [].concat(_toConsumableArray(imgList), _toConsumableArray(newList)) : _toConsumableArray(newList);
2515
+ newValue = {
2516
+ shopId: shopId,
2517
+ imgList: newImgList
2518
+ };
2519
+ setUploadImageCount(newImgList.length);
2520
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2521
+ setVisible(false);
2522
+ //供应上编码组件 || 商品组件且可以选择sku
2523
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
2524
+ _context2.next = 12;
2525
+ break;
2526
+ }
2527
+ _context2.next = 9;
2528
+ return querySkus({
2529
+ shopId: shopId,
2530
+ numIids: list[0].numIid
2531
+ });
2532
+ case 9:
2533
+ _yield$querySkus = _context2.sent;
2534
+ data = _yield$querySkus.data;
2535
+ if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
2536
+ options = data[0]['skus'].map(function (item) {
2537
+ return {
2538
+ label: item.propertiesName.split(';').map(function (i) {
2539
+ return i.split(':').slice(2);
2540
+ }).join(';'),
2541
+ value: item.skuId,
2542
+ picUrl: item.picUrl,
2543
+ outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId
2544
+ };
2545
+ });
2546
+ (_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
2547
+ shopId: shopId,
2548
+ numIids: list[0].numIid,
2549
+ options: options
2550
+ });
2551
+ }
2552
+ case 12:
2553
+ case "end":
2554
+ return _context2.stop();
2555
+ }
2556
+ }, _callee2);
2557
+ }));
2558
+ return function onSubmit(_x2) {
2559
+ return _ref4.apply(this, arguments);
2560
+ };
2561
+ }();
2562
+ //修改参数
2563
+ var handleChangeValue = function handleChangeValue(key, index) {
2564
+ return function (e) {
2565
+ var _e$target;
2566
+ var newImgList = _toConsumableArray(imgList);
2567
+ newImgList[index][key] = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
2568
+ var newValue = {
2569
+ shopId: shopId,
2570
+ imgList: newImgList
2571
+ };
2572
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2573
+ };
2574
+ };
2575
+ // console.log(enableSupplierName, imgListConstant)
2576
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, uploadImageCount === 0 ? /*#__PURE__*/React__default['default'].createElement("p", {
2577
+ className: "goods-title"
2578
+ }, "\u6700\u591A\u6DFB\u52A0", maxLength, "\u4E2A\u5B9D\u8D1D") : /*#__PURE__*/React__default['default'].createElement("p", {
2579
+ className: "goods-uploaded-state"
2580
+ }, "\u5DF2\u6DFB\u52A0", /*#__PURE__*/React__default['default'].createElement("span", {
2581
+ className: "goods-uploaded-count"
2582
+ }, uploadImageCount), "/", maxLength, "\u4E2A\u5B9D\u8D1D"), /*#__PURE__*/React__default['default'].createElement("div", {
2583
+ className: "goodsBox ".concat(goodsBoxClassName)
2584
+ }, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
2585
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2586
+ className: "goodBox-Img"
2587
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2588
+ className: "goods-imgBox",
2589
+ key: img.picUrl + '-goods'
2590
+ }, img.platform !== 'taobao' ? /*#__PURE__*/React__default['default'].createElement("img", {
2591
+ src: img.picUrl || defaultImg,
2592
+ className: "img",
2593
+ alt: ""
2594
+ }) : /*#__PURE__*/React__default['default'].createElement("a", {
2595
+ href: "https://item.taobao.com/item.htm?id=".concat(img.numIid),
2596
+ target: "_blank"
2597
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
2598
+ src: img.picUrl || defaultImg,
2599
+ className: "img",
2600
+ alt: ""
2601
+ })), !disabled && /*#__PURE__*/React__default['default'].createElement("img", {
2602
+ src: iconDelete,
2603
+ alt: "",
2604
+ className: "icon-close",
2605
+ onClick: function onClick() {
2606
+ deleteImg(index);
2607
+ }
2608
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
2609
+ className: "right-context",
2610
+ key: img.picUrl + '-context'
2611
+ }, type === 1 ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2612
+ placeholder: "\u8BF7\u8F93\u5165\u7F16\u7801",
2613
+ title: String((img === null || img === void 0 ? void 0 : img.outerId) || ''),
2614
+ value: img.outerId,
2615
+ disabled: disabled,
2616
+ style: {
2617
+ width: '80px'
2618
+ },
2619
+ onChange: handleChangeValue('outerId', index)
2620
+ })) : null, type === 2 ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2621
+ placeholder: "\u8BF7\u8F93\u5165\u5B9D\u8D1Did",
2622
+ value: img.numIid,
2623
+ title: String((img === null || img === void 0 ? void 0 : img.numIid) || ''),
2624
+ style: {
2625
+ width: '80px'
2626
+ },
2627
+ disabled: disabled,
2628
+ onChange: handleChangeValue('numIid', index)
2629
+ })) : null, type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2630
+ placeholder: "\u8BF7\u8F93\u5165\u5B9D\u8D1D\u89C4\u683C",
2631
+ value: img.propertiesName,
2632
+ title: String((img === null || img === void 0 ? void 0 : img.propertiesName) || ''),
2633
+ style: {
2634
+ width: '80px',
2635
+ marginTop: '8px'
2636
+ },
2637
+ disabled: disabled,
2638
+ onChange: handleChangeValue('propertiesName', index)
2639
+ })) : null, type === 4 && enableItemId ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2640
+ placeholder: "\u8BF7\u8F93\u5165\u7F16\u7801",
2641
+ value: img.itemId || (img === null || img === void 0 ? void 0 : img.supplierItemOuterId),
2642
+ title: String((img === null || img === void 0 ? void 0 : img.itemId) || (img === null || img === void 0 ? void 0 : img.supplierItemOuterId) || ''),
2643
+ disabled: disabled,
2644
+ style: {
2645
+ width: '80px',
2646
+ marginBottom: '8px'
2647
+ },
2648
+ onChange: handleChangeValue('itemId', index)
2649
+ })) : null, type === 4 && enableSupplierName ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2650
+ placeholder: "\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u540D\u79F0",
2651
+ title: String((img === null || img === void 0 ? void 0 : img.supplierName) || ''),
2652
+ disabled: disabled,
2653
+ value: img.supplierName,
2654
+ onChange: handleChangeValue('supplierName', index)
2655
+ })) : null));
2656
+ }), imgList.length < maxLength && !disabled ? /*#__PURE__*/React__default['default'].createElement("div", {
2657
+ className: "goods-imgBox",
2658
+ onClick: function onClick() {
2659
+ if (!shopId) {
2660
+ antd.message.error('请选择店铺');
2661
+ return;
2662
+ }
2663
+ setVisible(true);
2664
+ }
2665
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2666
+ className: "add-btn",
2667
+ style: {
2668
+ marginTop: '15px'
2669
+ }
2670
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("div", {
2671
+ className: "text"
2672
+ }, "\u6DFB\u52A0")) : null, visible ? /*#__PURE__*/React__default['default'].createElement(GoodsModal, {
2673
+ visible: visible,
2674
+ onSubmit: onSubmit,
2675
+ width: width,
2676
+ type: type,
2677
+ imgList: imgList,
2678
+ shopList: shopList,
2679
+ shopId: shopId,
2680
+ maxLength: maxLength,
2681
+ changeSku: changeSku,
2682
+ onCancel: function onCancel() {
2683
+ setVisible(false);
2684
+ }
2685
+ }) : null, /*#__PURE__*/React__default['default'].createElement(Sku, {
2686
+ handleOk: handleSelectSku,
2687
+ ref: skuRef,
2688
+ userNick: userNick,
2689
+ type: type
2690
+ })));
2691
+ };
2692
+
2693
+ var TBGoodId = function TBGoodId(props) {
2694
+ return /*#__PURE__*/React__default['default'].createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
2695
+ type: 2
2696
+ }));
2697
+ };
2698
+
2699
+ var ChooseBaby = function ChooseBaby(props) {
2700
+ return /*#__PURE__*/React__default['default'].createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
2701
+ type: 3
2702
+ }));
2703
+ };
2704
+
2705
+ var TBGoodSerial = function TBGoodSerial(props) {
2706
+ return /*#__PURE__*/React__default['default'].createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
2707
+ type: 1
2708
+ }));
2709
+ };
2710
+
2711
+ var Supplier = function Supplier(props) {
2712
+ return /*#__PURE__*/React__default['default'].createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
2713
+ type: 4
2714
+ }));
2715
+ };
2716
+
2717
+ var css_248z$5 = ".cardBox {\n position: absolute;\n z-index: 1;\n border: 1px solid #e6e6e6;\n background-color: #fff;\n color: #303133;\n border-radius: 4px;\n overflow: auto;\n height: 200px;\n cursor: pointer;\n}\n.cardBox .cardli {\n padding: 7px 13px;\n width: 332px;\n}\n.cardBox .cardli:hover {\n background-color: #f5f7fa;\n}\n.cardBox .cardText {\n font-size: 14px;\n color: #333;\n margin: 0;\n padding: 0;\n line-height: 26px;\n}\n.cardBox .c-f60 {\n color: #f60;\n}\n.btn-discern {\n margin-left: 10px;\n height: 24px;\n font-size: 12px;\n color: #1B5BF3;\n border-color: #1B5BF3;\n padding: 0;\n}\n";
2718
+ styleInject(css_248z$5);
2719
+
2720
+ var Invoice = function Invoice(props) {
2721
+ var _props$value = props.value,
2722
+ value = _props$value === void 0 ? {
2723
+ ordinaryTaitou: '',
2724
+ ordinarySerial: '',
2725
+ ordinaryMoney: ''
2726
+ } : _props$value,
2727
+ required = props.required,
2728
+ disabled = props.disabled,
2729
+ onChange = props.onChange;
2730
+ var _useState = React.useState(false),
2731
+ _useState2 = _slicedToArray(_useState, 2),
2732
+ visible = _useState2[0],
2733
+ setVisible = _useState2[1];
2734
+ var _useState3 = React.useState([]),
2735
+ _useState4 = _slicedToArray(_useState3, 2),
2736
+ list = _useState4[0],
2737
+ setList = _useState4[1];
2738
+ var _useRef = React.useRef({
2739
+ timer: null
2740
+ }),
2741
+ current = _useRef.current;
2742
+ var handleInputChange = function handleInputChange(e) {
2743
+ var ordinaryTaitou = e.target.value;
2744
+ setVisible(false);
2745
+ setList([]);
2746
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
2747
+ ordinaryTaitou: ordinaryTaitou
2748
+ });
2749
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2750
+ if (current.timer) {
2751
+ clearTimeout(current.timer);
2752
+ }
2753
+ current.timer = setTimeout(function () {
2754
+ handleChange(ordinaryTaitou);
2755
+ }, 1000);
2756
+ };
2757
+ var handleButtonClick = function handleButtonClick() {
2758
+ var ordinaryTaitou = value === null || value === void 0 ? void 0 : value.ordinaryTaitou;
2759
+ if (!ordinaryTaitou) {
2760
+ antd.message.error('请输入发票抬头');
2761
+ return;
2762
+ }
2763
+ handleChange(ordinaryTaitou);
2764
+ };
2765
+ var handleValueClick = function handleValueClick(e) {
2766
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
2767
+ ordinarySerial: e.target.value
2768
+ });
2769
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2770
+ };
2771
+ var handleMoneyClick = function handleMoneyClick(e) {
2772
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
2773
+ ordinaryMoney: keepDecimals(e.target.value)
2774
+ });
2775
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2776
+ };
2777
+ var autoFillCompanyInfo = /*#__PURE__*/function () {
2778
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
2779
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2780
+ while (1) switch (_context.prev = _context.next) {
2781
+ case 0:
2782
+ _context.next = 2;
2783
+ return extendRequest('/qy/gdfw/workOrder/companyinfo', {
2784
+ method: 'post',
2785
+ data: _objectSpread2({}, data)
2786
+ });
2787
+ case 2:
2788
+ return _context.abrupt("return", _context.sent);
2789
+ case 3:
2790
+ case "end":
2791
+ return _context.stop();
2792
+ }
2793
+ }, _callee);
2794
+ }));
2795
+ return function autoFillCompanyInfo(_x) {
2796
+ return _ref.apply(this, arguments);
2797
+ };
2798
+ }();
2799
+ /**
2800
+ * 智能识别
2801
+ * @returns
2802
+ */
2803
+ var handleChange = /*#__PURE__*/function () {
2804
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
2805
+ var data, list, newList, index, element, kpName, idx;
2806
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2807
+ while (1) switch (_context2.prev = _context2.next) {
2808
+ case 0:
2809
+ ordinaryTaitou = ordinaryTaitou || (value === null || value === void 0 ? void 0 : value.ordinaryTaitou);
2810
+ if (ordinaryTaitou) {
2811
+ _context2.next = 3;
2812
+ break;
2813
+ }
2814
+ return _context2.abrupt("return");
2815
+ case 3:
2816
+ _context2.next = 5;
2817
+ return autoFillCompanyInfo({
2818
+ companyName: ordinaryTaitou
2819
+ });
2820
+ case 5:
2821
+ data = _context2.sent;
2822
+ if (!data.success) {
2823
+ _context2.next = 16;
2824
+ break;
2825
+ }
2826
+ list = data.data ? data.data.info || [] : [];
2827
+ if (list.length) {
2828
+ _context2.next = 10;
2829
+ break;
2830
+ }
2831
+ return _context2.abrupt("return");
2832
+ case 10:
2833
+ newList = [];
2834
+ for (index = 0; index < list.length; index++) {
2835
+ element = list[index];
2836
+ kpName = element.kpName;
2837
+ idx = kpName.indexOf(ordinaryTaitou);
2838
+ element.kpName1 = kpName.substring(0, idx);
2839
+ element.kpName2 = ordinaryTaitou;
2840
+ element.kpName3 = kpName.substring(idx + ordinaryTaitou.length);
2841
+ newList.push(element);
2842
+ }
2843
+ setVisible(true);
2844
+ setList(newList);
2845
+ _context2.next = 16;
2846
+ break;
2847
+ case 16:
2848
+ case "end":
2849
+ return _context2.stop();
2850
+ }
2851
+ }, _callee2);
2852
+ }));
2853
+ return function handleChange(_x2) {
2854
+ return _ref2.apply(this, arguments);
2855
+ };
2856
+ }();
2857
+ /**
2858
+ * 选择公司
2859
+ * @param {*} item
2860
+ */
2861
+ var handleChangeOrdinary = function handleChangeOrdinary(item) {
2862
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, {
2863
+ ordinaryTaitou: item.kpName,
2864
+ ordinarySerial: item.kpCode
2865
+ });
2866
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
2867
+ setVisible(false);
2868
+ };
2869
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
2870
+ label: "\u53D1\u7968\u91D1\u989D",
2871
+ required: required,
2872
+ className: "invoice-title--basic"
2873
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2874
+ disabled: disabled,
2875
+ value: value === null || value === void 0 ? void 0 : value.ordinaryMoney,
2876
+ min: "0",
2877
+ placeholder: "\u8BF7\u8F93\u5165\u5F00\u7968\u91D1\u989D,\u6700\u59272\u4F4D\u5C0F\u6570",
2878
+ onChange: handleMoneyClick
2879
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
2880
+ label: "\u53D1\u7968\u62AC\u5934",
2881
+ required: required,
2882
+ className: "invoice-title--basic"
2883
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
2884
+ style: {
2885
+ display: 'flex',
2886
+ alignItems: 'center'
2887
+ }
2888
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2889
+ disabled: disabled,
2890
+ value: value === null || value === void 0 ? void 0 : value.ordinaryTaitou,
2891
+ placeholder: "\u8BF7\u8F93\u5165\u53D1\u7968\u62AC\u5934",
2892
+ onChange: handleInputChange
2893
+ }), !disabled && /*#__PURE__*/React__default['default'].createElement(antd.Button, {
2894
+ onClick: handleButtonClick,
2895
+ className: "btn-discern"
2896
+ }, "\u667A\u80FD\u8BC6\u522B")), visible ? /*#__PURE__*/React__default['default'].createElement("div", {
2897
+ className: "cardBox"
2898
+ }, list.map(function (item) {
2899
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2900
+ className: "cardli",
2901
+ key: item.kpCode,
2902
+ onClick: function onClick() {
2903
+ handleChangeOrdinary(item);
2904
+ }
2905
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
2906
+ className: "cardText"
2907
+ }, item.kpName1, /*#__PURE__*/React__default['default'].createElement("span", {
2908
+ className: "c-f60"
2909
+ }, item.kpName2), item.kpName3), /*#__PURE__*/React__default['default'].createElement("p", {
2910
+ className: "cardText"
2911
+ }, item.kpCode));
2912
+ })) : null)), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
2913
+ label: "\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
2914
+ required: required,
2915
+ className: "invoice-title--basic"
2916
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
2917
+ disabled: disabled,
2918
+ // style={{ width: 250 }}
2919
+ placeholder: "\u8BF7\u8F93\u5165\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
2920
+ value: value === null || value === void 0 ? void 0 : value.ordinarySerial,
2921
+ onChange: handleValueClick
2922
+ })));
2923
+ };
2924
+
2925
+ var RadioGroup = antd.Radio.Group;
2926
+ var Status = function Status(props) {
2927
+ var customStatusText = props.customStatusText,
2928
+ isSelectStyle = props.isSelectStyle,
2929
+ isUseCustomStatus = props.isUseCustomStatus,
2930
+ _props$value = props.value,
2931
+ value = _props$value === void 0 ? {
2932
+ status: '',
2933
+ customerService: []
2934
+ } : _props$value,
2935
+ shopId = props.shopId,
2936
+ disabled = props.disabled,
2937
+ isEditing = props.isEditing,
2938
+ onChange = props.onChange,
2939
+ required = props.required,
2940
+ originCustomer = props.originCustomer;
2941
+ var _useState = React.useState([]),
2942
+ _useState2 = _slicedToArray(_useState, 2),
2943
+ dataSource = _useState2[0],
2944
+ setDataSource = _useState2[1];
2945
+ React.useEffect(function () {
2946
+ if (shopId) {
2947
+ extendRequest('/qy/gdfw/template/querySubUsers', {
2948
+ method: 'get',
2949
+ params: {
2950
+ shopId: shopId
2951
+ }
2952
+ }).then(function (res) {
2953
+ var dataList = (res === null || res === void 0 ? void 0 : res.data) || [];
2954
+ dataList.length && setDataSource(dataList);
2955
+ });
2956
+ }
2957
+ }, [shopId]);
2958
+ var getOptions = function getOptions() {
2959
+ var text = '处理';
2960
+ if (isUseCustomStatus) {
2961
+ text = customStatusText;
2962
+ }
2963
+ return [{
2964
+ label: "\u672A".concat(text),
2965
+ value: '0'
2966
+ }, {
2967
+ label: "\u5DF2".concat(text),
2968
+ value: '1'
2969
+ }];
2970
+ };
2971
+ var handleSelectChangeStatus = function handleSelectChangeStatus(val) {
2972
+ if (isEditing && val === '1') {
2973
+ onChange({
2974
+ status: val,
2975
+ customerService: originCustomer
2976
+ });
2977
+ return;
2978
+ }
2979
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
2980
+ status: val
2981
+ }));
2982
+ };
2983
+ var handleChangeStatus = function handleChangeStatus(e) {
2984
+ if (isEditing && e.target.value === '1') {
2985
+ onChange({
2986
+ status: e.target.value,
2987
+ customerService: originCustomer
2988
+ });
2989
+ return;
2990
+ }
2991
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
2992
+ status: e.target.value
2993
+ }));
2994
+ };
2995
+ var handleChangeCustomerService = function handleChangeCustomerService(val) {
2996
+ return onChange(_objectSpread2(_objectSpread2({}, value), {}, {
2997
+ customerService: val
2998
+ }));
2999
+ };
3000
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
3001
+ className: 'status-payment--basic'
3002
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
3003
+ label: "\u5DE5\u5355\u72B6\u6001",
3004
+ required: required
3005
+ }, isSelectStyle ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3006
+ disabled: disabled,
3007
+ value: value === null || value === void 0 ? void 0 : value.status,
3008
+ onChange: handleSelectChangeStatus,
3009
+ style: {
3010
+ width: '100px'
3011
+ }
3012
+ }, getOptions().map(function (item) {
3013
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
3014
+ value: item.value,
3015
+ key: item.value
3016
+ }, item.label);
3017
+ })) : /*#__PURE__*/React__default['default'].createElement(RadioGroup, {
3018
+ value: value === null || value === void 0 ? void 0 : value.status,
3019
+ onChange: handleChangeStatus
3020
+ }, getOptions().map(function (item) {
3021
+ return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
3022
+ value: item.value,
3023
+ key: item.value,
3024
+ disabled: disabled
3025
+ }, item.label);
3026
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
3027
+ label: "\u5904\u7406\u5BA2\u670D",
3028
+ required: required
3029
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3030
+ mode: "multiple",
3031
+ showSearch: true,
3032
+ placeholder: "\u8BF7\u9009\u62E9",
3033
+ allowClear: true,
3034
+ disabled: disabled || isEditing && (value === null || value === void 0 ? void 0 : value.status) === '1',
3035
+ style: {
3036
+ width: '340px',
3037
+ marginTop: '8px'
3038
+ },
3039
+ value: value === null || value === void 0 ? void 0 : value.customerService,
3040
+ onChange: handleChangeCustomerService
3041
+ }, dataSource.map(function (data) {
3042
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
3043
+ value: data.subUserName,
3044
+ key: data.subUserName
3045
+ }, data.subUserName);
3046
+ })))));
3047
+ };
3048
+
3049
+ var Payment = function Payment(props) {
3050
+ var value = props.value,
3051
+ disabled = props.disabled,
3052
+ _props$id = props.id,
3053
+ id = _props$id === void 0 ? '' : _props$id,
3054
+ required = props.required,
3055
+ zhiFubaoRequired = props.zhiFubaoRequired,
3056
+ shopId = props.shopId,
3057
+ shopList = props.shopList,
3058
+ onChange = props.onChange,
3059
+ onSearch = props.onSearch,
3060
+ _onBlur = props.onBlur;
3061
+ React.useEffect(function () {
3062
+ var platformList = ['TAOBAO', 'FXG'];
3063
+ var showBuyerId = (shopList || []).some(function (item) {
3064
+ return item.shopId == shopId && platformList.includes(item.shopSourceStr);
3065
+ });
3066
+ //如果不是淘宝店铺 旺旺id为空
3067
+ if (!showBuyerId) {
3068
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3069
+ enterprisePaymentBuyerOpenUid: ''
3070
+ }));
3071
+ }
3072
+ }, [shopId, shopList]);
3073
+ var changeValue = function changeValue(e, type) {
3074
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value));
3075
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
3076
+ type === 'enterprisePaymentTid' && (onSearch === null || onSearch === void 0 ? void 0 : onSearch(e));
3077
+ };
3078
+ var PaymentList = [{
3079
+ label: '订单编号',
3080
+ name: 'enterprisePaymentTid',
3081
+ placeholder: '请输入订单编号',
3082
+ required: required,
3083
+ show: true
3084
+ }, {
3085
+ label: '打款金额',
3086
+ name: 'enterprisePaymentRefundFee',
3087
+ placeholder: '请输入打款金额',
3088
+ required: required,
3089
+ show: true
3090
+ }, {
3091
+ label: '买家昵称',
3092
+ name: 'enterprisePaymentBuyerNick',
3093
+ placeholder: '请输入买家昵称',
3094
+ required: false,
3095
+ show: true
3096
+ }, {
3097
+ label: '支付宝名称',
3098
+ name: 'enterprisePaymentAlipayNick',
3099
+ placeholder: '请输入支付宝名称',
3100
+ required: zhiFubaoRequired,
3101
+ show: true
3102
+ }, {
3103
+ label: '支付宝账号',
3104
+ name: 'enterprisePaymentAlipayNo',
3105
+ placeholder: '请输入支付宝账号',
3106
+ required: zhiFubaoRequired,
3107
+ show: true
3108
+ }];
3109
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, PaymentList.map(function (item) {
3110
+ return item.show && /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
3111
+ label: item.label,
3112
+ name: [id, item.name],
3113
+ key: item.name,
3114
+ required: item.required
3115
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3116
+ disabled: disabled,
3117
+ placeholder: item.placeholder,
3118
+ value: value === null || value === void 0 ? void 0 : value[item.name],
3119
+ onChange: function onChange(e) {
3120
+ return changeValue(e, item.name);
3121
+ },
3122
+ onBlur: function onBlur(e) {
3123
+ return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
3124
+ }
3125
+ }));
3126
+ }));
3127
+ };
3128
+
3129
+ var Item = antd.Form.Item;
3130
+ var LogisticsInterception = function LogisticsInterception(props) {
3131
+ var _props$value = props.value,
3132
+ value = _props$value === void 0 ? {} : _props$value,
3133
+ _props$logisticsOptio = props.logisticsOptions,
3134
+ logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
3135
+ required = props.required,
3136
+ onChange = props.onChange,
3137
+ disabled = props.disabled;
3138
+ var _useState = React.useState([]),
3139
+ _useState2 = _slicedToArray(_useState, 2),
3140
+ typeOptions = _useState2[0],
3141
+ setTypeOptions = _useState2[1];
3142
+ var _useState3 = React.useState([]),
3143
+ _useState4 = _slicedToArray(_useState3, 2),
3144
+ statusOptions = _useState4[0],
3145
+ setStatusOptions = _useState4[1];
3146
+ var _useState5 = React.useState(true),
3147
+ _useState6 = _slicedToArray(_useState5, 2),
3148
+ isInterface = _useState6[0],
3149
+ setIsInterface = _useState6[1];
3150
+ React.useEffect(function () {
3151
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3152
+ interceptType: undefined,
3153
+ interceptAddress: [],
3154
+ interceptDetail: '',
3155
+ interceptReceiverName: '',
3156
+ interceptReceiverMobile: '',
3157
+ interceptStatus: '',
3158
+ interceptOther: ''
3159
+ }));
3160
+ if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
3161
+ setTypeOptions([]);
3162
+ setStatusOptions([]);
3163
+ setIsInterface(true);
3164
+ return;
3165
+ }
3166
+ var interceptCompany = logisticsOptions.find(function (item) {
3167
+ return item.expressCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
3168
+ });
3169
+ setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
3170
+ setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
3171
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
3172
+ var showNewAddress = React.useMemo(function () {
3173
+ var _find, _find$config;
3174
+ return (_find = (typeOptions || []).find(function (item) {
3175
+ return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
3176
+ })) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
3177
+ }, [value === null || value === void 0 ? void 0 : value.interceptType]);
3178
+ var changeHandle = function changeHandle(val, type) {
3179
+ var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
3180
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
3181
+ };
3182
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Item, {
3183
+ label: '物流信息',
3184
+ required: required,
3185
+ key: 'logistics'
3186
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3187
+ disabled: disabled,
3188
+ fieldNames: {
3189
+ label: 'expressName',
3190
+ value: 'expressCode'
3191
+ },
3192
+ placeholder: "\u7269\u6D41\u516C\u53F8",
3193
+ style: {
3194
+ width: '200px'
3195
+ },
3196
+ onChange: function onChange(val) {
3197
+ return changeHandle(val, 'interceptCompany');
3198
+ },
3199
+ value: (value === null || value === void 0 ? void 0 : value.interceptCompany) === '' ? undefined : value === null || value === void 0 ? void 0 : value.interceptCompany,
3200
+ options: logisticsOptions,
3201
+ showSearch: true,
3202
+ filterOption: function filterOption(input, option) {
3203
+ return option.label.includes(input);
3204
+ }
3205
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3206
+ disabled: disabled,
3207
+ placeholder: "\u7269\u6D41\u5355\u53F7",
3208
+ onChange: function onChange(e) {
3209
+ return changeHandle(e.target.value, 'interceptCode');
3210
+ },
3211
+ value: value === null || value === void 0 ? void 0 : value.interceptCode
3212
+ }))), /*#__PURE__*/React__default['default'].createElement(Item, {
3213
+ label: '拦截类型',
3214
+ required: required,
3215
+ key: 'interceptType'
3216
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3217
+ disabled: disabled,
3218
+ style: {
3219
+ width: '200px'
3220
+ },
3221
+ options: typeOptions,
3222
+ onChange: function onChange(val) {
3223
+ return changeHandle(val, 'interceptType');
3224
+ },
3225
+ value: value === null || value === void 0 ? void 0 : value.interceptType,
3226
+ placeholder: "\u62E6\u622A\u7C7B\u578B",
3227
+ showSearch: true,
3228
+ filterOption: function filterOption(input, option) {
3229
+ return option.label.includes(input);
3230
+ }
3231
+ })), /*#__PURE__*/React__default['default'].createElement(Item, {
3232
+ label: '新派送地',
3233
+ required: required,
3234
+ key: 'newAddress',
3235
+ hidden: isInterface && showNewAddress
3236
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
3237
+ value: value === null || value === void 0 ? void 0 : value.interceptAddress,
3238
+ onChange: function onChange(val) {
3239
+ return changeHandle(val, 'interceptAddress');
3240
+ },
3241
+ options: [],
3242
+ disabled: disabled
3243
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3244
+ disabled: disabled,
3245
+ placeholder: "\u8BE6\u7EC6\u5730\u5740",
3246
+ onChange: function onChange(e) {
3247
+ return changeHandle(e.target.value, 'interceptDetail');
3248
+ }
3249
+ })), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3250
+ disabled: disabled,
3251
+ style: {
3252
+ width: '200px'
3253
+ },
3254
+ placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
3255
+ onChange: function onChange(e) {
3256
+ return changeHandle(e.target.value, 'interceptReceiverName');
3257
+ }
3258
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3259
+ disabled: disabled,
3260
+ placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
3261
+ onChange: function onChange(e) {
3262
+ return changeHandle(e.target.value, 'interceptReceiverMobile');
3263
+ }
3264
+ }))), /*#__PURE__*/React__default['default'].createElement(Item, {
3265
+ label: '拦截状态',
3266
+ key: 'interceptStatus'
3267
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3268
+ disabled: disabled || isInterface,
3269
+ style: {
3270
+ width: '200px'
3271
+ },
3272
+ options: statusOptions,
3273
+ onChange: function onChange(val) {
3274
+ return changeHandle(val, 'interceptStatus');
3275
+ },
3276
+ value: value === null || value === void 0 ? void 0 : value.interceptStatus,
3277
+ placeholder: "\u62E6\u622A\u72B6\u6001",
3278
+ showSearch: true,
3279
+ filterOption: function filterOption(input, option) {
3280
+ return option.label.includes(input);
3281
+ }
3282
+ }), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3283
+ style: {
3284
+ width: '200px'
3285
+ },
3286
+ placeholder: "\u5176\u4ED6",
3287
+ onChange: function onChange(e) {
3288
+ return changeHandle(e.target.value, 'interceptOther');
3289
+ }
3290
+ })));
3291
+ };
3292
+
3293
+ var jstGoods = function jstGoods(props) {
3294
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
3295
+ var _props$value = props.value,
3296
+ value = _props$value === void 0 ? [] : _props$value,
3297
+ _props$options = props.options,
3298
+ options = _props$options === void 0 ? [] : _props$options,
3299
+ onChange = props.onChange,
3300
+ disabled = props.disabled,
3301
+ _props$type = props.type,
3302
+ type = _props$type === void 0 ? 1 : _props$type,
3303
+ _props$showField = props.showField,
3304
+ showField = _props$showField === void 0 ? 'all' : _props$showField;
3305
+ var _useState = React.useState(0),
3306
+ _useState2 = _slicedToArray(_useState, 2),
3307
+ changeIndex = _useState2[0],
3308
+ setChangeIndex = _useState2[1]; //选中的包裹
3309
+ React.useEffect(function () {
3310
+ setChangeIndex(0);
3311
+ }, []);
3312
+ var content = function content(item, index) {
3313
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
3314
+ style: {
3315
+ textAlign: 'center'
3316
+ }
3317
+ }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
3318
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3319
+ key: index
3320
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Image, {
3321
+ width: 100,
3322
+ src: t.picUrl,
3323
+ fallback: defaultImg
3324
+ }), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", null, t.title), /*#__PURE__*/React__default['default'].createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
3325
+ }));
3326
+ };
3327
+ var changeInputHandle = function changeInputHandle(val, type) {
3328
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
3329
+ changeOrderInfo[type] = val;
3330
+ var newList = _toConsumableArray(value);
3331
+ newList[changeIndex] = changeOrderInfo;
3332
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
3333
+ };
3334
+ //判断是否是单个且没有商品数据
3335
+ var isSingle = React.useMemo(function () {
3336
+ var _value$, _value$$items;
3337
+ return value && value.length === 1 && !((_value$ = value[0]) === null || _value$ === void 0 ? void 0 : (_value$$items = _value$.items) === null || _value$$items === void 0 ? void 0 : _value$$items.length);
3338
+ }, [value]);
3339
+ return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
3340
+ wrap: true
3341
+ }, (value || []).map(function (item, index) {
3342
+ return /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
3343
+ content: content(item, index),
3344
+ key: index
3345
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
3346
+ style: {
3347
+ color: changeIndex === index ? '#4569d4' : 'black',
3348
+ cursor: 'pointer'
3349
+ },
3350
+ onClick: function onClick() {
3351
+ return setChangeIndex(index);
3352
+ }
3353
+ }, "\u5305\u88F9".concat(index + 1)));
3354
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3355
+ disabled: disabled,
3356
+ placeholder: "\u7269\u6D41\u516C\u53F8",
3357
+ onChange: function onChange(val) {
3358
+ return changeInputHandle(val, 'logisticsCompany');
3359
+ },
3360
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.logisticsCompany,
3361
+ options: options,
3362
+ showSearch: true,
3363
+ filterOption: function filterOption(input, option) {
3364
+ return option.label.includes(input);
3365
+ },
3366
+ style: {
3367
+ minWidth: '100px'
3368
+ }
3369
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3370
+ disabled: disabled,
3371
+ placeholder: "\u7269\u6D41\u5355\u53F7",
3372
+ onChange: function onChange(e) {
3373
+ return changeInputHandle(e.target.value, 'logisticsCode');
3374
+ },
3375
+ value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.logisticsCode
3376
+ })) : null, type === 2 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3377
+ disabled: disabled,
3378
+ placeholder: "\u8BF7\u8F93\u5165\u4F9B\u9500\u5546\u7F16\u7801",
3379
+ onChange: function onChange(e) {
3380
+ return changeInputHandle(e.target.value, 'supplyId');
3381
+ },
3382
+ value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.supplyId
3383
+ }), ['supplyName', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3384
+ disabled: disabled,
3385
+ placeholder: "\u8BF7\u8F93\u5165\u4F9B\u9500\u5546\u540D\u79F0",
3386
+ onChange: function onChange(e) {
3387
+ return changeInputHandle(e.target.value, 'supplyName');
3388
+ },
3389
+ value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.supplyName
3390
+ })) : null, type === 3 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, ['sendId', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3391
+ disabled: disabled,
3392
+ placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u7F16\u7801",
3393
+ onChange: function onChange(e) {
3394
+ return changeInputHandle(e.target.value, 'sendId');
3395
+ },
3396
+ value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
3397
+ }), ['sendName', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3398
+ disabled: disabled,
3399
+ placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
3400
+ onChange: function onChange(e) {
3401
+ return changeInputHandle(e.target.value, 'sendName');
3402
+ },
3403
+ value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
3404
+ })) : null) : null);
3405
+ };
3406
+
3407
+ var css_248z$6 = ".jstGoodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.jstGoodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.jstGoodsBox .right-context {\n font-size: 12px;\n}\n.jstGoodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.jstGoodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.jstGoodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.jstimgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n display: flex;\n justify-items: center;\n align-items: center;\n}\n.jstimgBox .add-btn {\n color: #86909c;\n}\n.jstimgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
3408
+ styleInject(css_248z$6);
3409
+
3410
+ var ItemList = function ItemList(props) {
3411
+ var _props$value = props.value,
3412
+ value = _props$value === void 0 ? [] : _props$value,
3413
+ onChange = props.onChange,
3414
+ enableItemId = props.enableItemId,
3415
+ enableSupplierName = props.enableSupplierName,
3416
+ disabled = props.disabled;
3417
+ //删除图片
3418
+ var deleteImg = function deleteImg(index) {
3419
+ var newList = value.filter(function (_, i) {
3420
+ return index !== i;
3421
+ });
3422
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
3423
+ };
3424
+ //修改参数
3425
+ var handleChangeValue = function handleChangeValue(key, index) {
3426
+ return function (e) {
3427
+ var _e$target;
3428
+ var newImgList = _toConsumableArray(value);
3429
+ var changeValue = _objectSpread2({}, value[index]);
3430
+ changeValue[key] = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
3431
+ newImgList[index] = changeValue;
3432
+ onChange === null || onChange === void 0 ? void 0 : onChange(newImgList);
3433
+ };
3434
+ };
3435
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3436
+ className: "jstGoodsBox"
3437
+ }, value === null || value === void 0 ? void 0 : value.map(function (img, index) {
3438
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3439
+ className: "goodBox-Img",
3440
+ key: index
3441
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
3442
+ className: "goods-imgBox"
3443
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
3444
+ src: img.picUrl || defaultImg,
3445
+ className: "img",
3446
+ alt: ""
3447
+ }), !disabled && /*#__PURE__*/React__default['default'].createElement("img", {
3448
+ src: iconDelete,
3449
+ alt: "",
3450
+ className: "icon-close",
3451
+ onClick: function onClick() {
3452
+ deleteImg(index);
3453
+ }
3454
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
3455
+ className: "right-context",
3456
+ key: img.picUrl + '-context'
3457
+ }, enableItemId ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3458
+ placeholder: "\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u7F16\u7801",
3459
+ value: img.itemId,
3460
+ title: String((img === null || img === void 0 ? void 0 : img.itemId) || ''),
3461
+ disabled: disabled,
3462
+ style: {
3463
+ width: '80px',
3464
+ marginBottom: '8px'
3465
+ },
3466
+ onChange: handleChangeValue('itemId', index)
3467
+ })) : null, enableSupplierName ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
3468
+ placeholder: "\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u540D\u79F0",
3469
+ title: String((img === null || img === void 0 ? void 0 : img.supplierName) || ''),
3470
+ disabled: disabled,
3471
+ value: img.supplierName,
3472
+ onChange: handleChangeValue('supplierName', index)
3473
+ })) : null));
3474
+ }), !value.length && !disabled ? /*#__PURE__*/React__default['default'].createElement("div", {
3475
+ className: "jstimgBox"
3476
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
3477
+ className: "text"
3478
+ }, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
3479
+ };
3480
+
3481
+ var css_248z$7 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
3482
+ styleInject(css_248z$7);
3483
+
3484
+ var TabPane$1 = antd.Tabs.TabPane;
3485
+ var Option$2 = antd.Select.Option;
3486
+ var Search$1 = antd.Input.Search;
3487
+ var GoodsModal$1 = function GoodsModal(props) {
3488
+ var onSubmit = props.onSubmit,
3489
+ _onCancel = props.onCancel,
3490
+ visible = props.visible,
3491
+ type = props.type,
3492
+ shopId = props.shopId,
3493
+ imgList = props.imgList,
3494
+ maxLength = props.maxLength,
3495
+ shopList = props.shopList;
3496
+ var _useState = React.useState([]),
3497
+ _useState2 = _slicedToArray(_useState, 2),
3498
+ selectList = _useState2[0],
3499
+ setSelect = _useState2[1];
3500
+ var _useState3 = React.useState([]),
3501
+ _useState4 = _slicedToArray(_useState3, 2),
3502
+ selectIds = _useState4[0],
3503
+ setSelectIds = _useState4[1];
3504
+ var _useState5 = React.useState([]),
3505
+ _useState6 = _slicedToArray(_useState5, 2),
3506
+ goodList = _useState6[0],
3507
+ setGoodList = _useState6[1];
3508
+ var _useState7 = React.useState(false),
3509
+ _useState8 = _slicedToArray(_useState7, 2),
3510
+ loading = _useState8[0],
3511
+ setLoading = _useState8[1];
3512
+ var _useState9 = React.useState({
3513
+ apiName: 'queryItems',
3514
+ desc: true,
3515
+ numIids: '',
3516
+ orderBy: 'list_time',
3517
+ pageNo: 1,
3518
+ pageSize: 8,
3519
+ shopId: shopId,
3520
+ type: 'onSale',
3521
+ cids: ''
3522
+ }),
3523
+ _useState10 = _slicedToArray(_useState9, 2),
3524
+ searchParams = _useState10[0],
3525
+ setSearch = _useState10[1];
3526
+ var _useState11 = React.useState(0),
3527
+ _useState12 = _slicedToArray(_useState11, 2),
3528
+ total = _useState12[0],
3529
+ setTotal = _useState12[1];
3530
+ var _useState13 = React.useState(''),
3531
+ _useState14 = _slicedToArray(_useState13, 2),
3532
+ platform = _useState14[0],
3533
+ setPlatform = _useState14[1]; //平台
3534
+ var _useState15 = React.useState({}),
3535
+ _useState16 = _slicedToArray(_useState15, 2),
3536
+ shopInfo = _useState16[0],
3537
+ setShopInfo = _useState16[1]; //店铺信息
3538
+ var _useState17 = React.useState([{
3539
+ tab: '出售中',
3540
+ key: 'onSale'
3541
+ }, {
3542
+ tab: '仓库中',
3543
+ key: 'inventory'
3544
+ }, {
3545
+ tab: '已选择',
3546
+ key: 'all'
3547
+ }]),
3548
+ _useState18 = _slicedToArray(_useState17, 2),
3549
+ tabs = _useState18[0],
3550
+ setTabs = _useState18[1];
3551
+ var _useState19 = React.useState([{
3552
+ name: '上架时间',
3553
+ value: 'list_time'
3554
+ }, {
3555
+ name: '按库存',
3556
+ value: 'num'
3557
+ }, {
3558
+ name: '按价格',
3559
+ value: 'price'
3560
+ }]),
3561
+ _useState20 = _slicedToArray(_useState19, 1),
3562
+ goodSort = _useState20[0];
3563
+ var _useState21 = React.useState([]),
3564
+ _useState22 = _slicedToArray(_useState21, 2),
3565
+ shell = _useState22[0],
3566
+ setShell = _useState22[1];
3567
+ var clickOrder = function clickOrder(sort) {
3568
+ if (sort.value === searchParams.orderBy) {
3569
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3570
+ desc: !searchParams.desc
3571
+ }));
3572
+ } else {
3573
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3574
+ orderBy: sort.value
3575
+ }));
3576
+ }
3577
+ };
3578
+ var pageChange = function pageChange(page) {
3579
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3580
+ pageNo: page
3581
+ }));
3582
+ };
3583
+ /**
3584
+ * 选择商品
3585
+ * @param good
3586
+ * @returns
3587
+ */
3588
+ var changeItem = function changeItem(good) {
3589
+ if (searchParams.type === 'all') {
3590
+ var newSelect = selectList.filter(function (item) {
3591
+ return item.numIid !== good.numIid;
3592
+ });
3593
+ setSelect(_toConsumableArray(newSelect));
3594
+ var ids = newSelect.map(function (item) {
3595
+ return item.numIid;
3596
+ });
3597
+ setSelectIds(ids);
3598
+ } else {
3599
+ if (type !== 3) {
3600
+ setSelect([good]);
3601
+ setSelectIds([good.numIid]);
3602
+ } else {
3603
+ if (selectList.length >= maxLength) {
3604
+ antd.message.error("\u6700\u591A\u6DFB\u52A0".concat(maxLength, "\u5F20"));
3605
+ return;
3606
+ }
3607
+ var hasGood = selectList.some(function (t) {
3608
+ return t.numIid === good.numIid;
3609
+ });
3610
+ if (hasGood) {
3611
+ var newSelectList = selectList.filter(function (item) {
3612
+ return item.numIid !== good.numIid;
3613
+ });
3614
+ setSelect(newSelectList);
3615
+ var _ids = newSelectList.map(function (item) {
3616
+ return item.numIid;
3617
+ });
3618
+ setSelectIds(_ids);
3619
+ } else {
3620
+ setSelect([].concat(_toConsumableArray(selectList), [good]));
3621
+ setSelectIds([].concat(_toConsumableArray(selectIds), [good.numIid]));
3622
+ }
3623
+ }
3624
+ }
3625
+ };
3626
+ /**
3627
+ * 获取分类列表
3628
+ */
3629
+ var querySellerCat = function querySellerCat() {
3630
+ extendRequest('/qy/gdfw/workOrder/querySellerCat', {
3631
+ method: 'get',
3632
+ params: {
3633
+ shopId: shopId || 257615501,
3634
+ apiName: 'querySellerCat'
3635
+ }
3636
+ }).then(function (res) {
3637
+ var arr = [{
3638
+ value: '',
3639
+ label: '所有分类'
3640
+ }];
3641
+ (res.data || []).forEach(function (item) {
3642
+ var category = item.category,
3643
+ _item$children = item.children,
3644
+ children = _item$children === void 0 ? [] : _item$children;
3645
+ arr.push({
3646
+ label: "| ".concat(category.name),
3647
+ value: [category.value].concat(_toConsumableArray(children.map(function (v) {
3648
+ return v.value;
3649
+ }))).join(',')
3650
+ });
3651
+ children.forEach(function (c) {
3652
+ arr.push({
3653
+ label: "|-- ".concat(c.name),
3654
+ value: c.value
3655
+ });
3656
+ });
3657
+ });
3658
+ setShell([].concat(arr));
3659
+ });
3660
+ };
3661
+ /**
3662
+ *
3663
+ * @returns 获取查询参数
3664
+ */
3665
+ var queryPd = function queryPd() {
3666
+ return {
3667
+ apiName: 'queryItems',
3668
+ desc: searchParams.desc,
3669
+ productIds: searchParams.numIids,
3670
+ orderBy: searchParams.orderBy,
3671
+ pageNo: searchParams.pageNo,
3672
+ pageSize: searchParams.pageSize,
3673
+ shopId: shopId,
3674
+ type: searchParams.type
3675
+ };
3676
+ };
3677
+ /**
3678
+ * 查询商品
3679
+ */
3680
+ var queryItems = /*#__PURE__*/function () {
3681
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
3682
+ var res, _ref2, items, totalCount, params, _res, _ref3, list, _total;
3683
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3684
+ while (1) switch (_context.prev = _context.next) {
3685
+ case 0:
3686
+ _context.prev = 0;
3687
+ setLoading(true);
3688
+ if (!(platform === 'taobao')) {
3689
+ _context.next = 11;
3690
+ break;
3691
+ }
3692
+ _context.next = 5;
3693
+ return extendRequest('/qy/gdfw/workOrder/queryItems', {
3694
+ method: 'post',
3695
+ data: queryPd()
3696
+ });
3697
+ case 5:
3698
+ res = _context.sent;
3699
+ _ref2 = res.data || {
3700
+ items: [],
3701
+ totalCount: 0
3702
+ }, items = _ref2.items, totalCount = _ref2.totalCount;
3703
+ setGoodList(_toConsumableArray(items));
3704
+ setTotal(totalCount);
3705
+ _context.next = 23;
3706
+ break;
3707
+ case 11:
3708
+ params = _objectSpread2({}, queryPd());
3709
+ params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
3710
+ params.platform = platform;
3711
+ params.status = params.type === 'onSale' ? 1 : 0;
3712
+ delete params.type;
3713
+ _context.next = 18;
3714
+ return extendRequest('/qy/gdfw/product/listProduct', {
3715
+ method: 'post',
3716
+ data: params
3717
+ });
3718
+ case 18:
3719
+ _res = _context.sent;
3720
+ _ref3 = _res.data || {
3721
+ result: [],
3722
+ total: 0
3723
+ }, list = _ref3.result, _total = _ref3.total;
3724
+ list.forEach(function (item) {
3725
+ item.numIid = item.productId;
3726
+ item.outerId = item.outId;
3727
+ item.title = item.productName;
3728
+ item.platform = platform;
3729
+ });
3730
+ setGoodList(_toConsumableArray(list));
3731
+ setTotal(_total);
3732
+ case 23:
3733
+ _context.prev = 23;
3734
+ setLoading(false);
3735
+ return _context.finish(23);
3736
+ case 26:
3737
+ case "end":
3738
+ return _context.stop();
3739
+ }
3740
+ }, _callee, null, [[0,, 23, 26]]);
3741
+ }));
3742
+ return function queryItems(_x) {
3743
+ return _ref.apply(this, arguments);
3744
+ };
3745
+ }();
3746
+ var getItem = function getItem(searchParams, platform) {
3747
+ if (searchParams.type === 'all') {
3748
+ return;
3749
+ } else {
3750
+ queryItems(platform);
3751
+ }
3752
+ };
3753
+ /**
3754
+ * 获取平台
3755
+ */
3756
+ var setPlatformHandle = function setPlatformHandle(platform) {
3757
+ platform === 'taobao' && querySellerCat();
3758
+ };
3759
+ React.useEffect(function () {
3760
+ var shopInfo = shopList.find(function (item) {
3761
+ return shopId === item.shopId || shopId === item.shopName;
3762
+ });
3763
+ setShopInfo(shopInfo);
3764
+ var platform = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopSourceStr.toLowerCase();
3765
+ setPlatform(platform);
3766
+ }, [shopId, shopList]);
3767
+ React.useEffect(function () {
3768
+ setPlatformHandle(platform);
3769
+ if (imgList.length) {
3770
+ setSelect(imgList);
3771
+ var ids = imgList.map(function (item) {
3772
+ return item.numIid;
3773
+ });
3774
+ setSelectIds(ids);
3775
+ }
3776
+ }, [platform]);
3777
+ React.useEffect(function () {
3778
+ getItem(searchParams, platform);
3779
+ }, [searchParams, platform]);
3780
+ return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
3781
+ title: '选择宝贝',
3782
+ okText: '确认',
3783
+ cancelText: '取消',
3784
+ visible: visible,
3785
+ width: 730,
3786
+ onCancel: function onCancel() {
3787
+ _onCancel();
3788
+ },
3789
+ onOk: function onOk() {
3790
+ onSubmit(selectList);
3791
+ }
3792
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Tabs, {
3793
+ type: "card",
3794
+ activeKey: searchParams.type,
3795
+ onChange: function onChange(e) {
3796
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3797
+ type: e
3798
+ }));
3799
+ }
3800
+ }, tabs.map(function (tab) {
3801
+ return /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
3802
+ tab: tab.tab + (tab.key === 'all' ? "(".concat(selectList.length, ")") : ''),
3803
+ key: tab.key
3804
+ });
3805
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
3806
+ className: "searchBox"
3807
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, {
3808
+ value: searchParams.orderBy,
3809
+ onChange: function onChange(e) {
3810
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3811
+ orderBy: e.target.value
3812
+ }));
3813
+ }
3814
+ }, goodSort.map(function (sort) {
3815
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
3816
+ type: sort.value === searchParams.orderBy ? 'primary' : 'default',
3817
+ onClick: function onClick() {
3818
+ clickOrder(sort);
3819
+ },
3820
+ key: sort.value
3821
+ }, sort.name, sort.value === searchParams.orderBy ? searchParams.desc ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u21BE") :
3822
+ /*#__PURE__*/
3823
+ // <SwapLeftOutlined className="deg90" />
3824
+ React__default['default'].createElement("span", null, "\u21C2")
3825
+ // <SwapRightOutlined className="deg90" />
3826
+ : /*#__PURE__*/React__default['default'].createElement("span", null, "\u21C5"));
3827
+ })), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
3828
+ style: {
3829
+ width: '150px'
3830
+ },
3831
+ value: searchParams.cids,
3832
+ onSelect: function onSelect(value) {
3833
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3834
+ cids: value
3835
+ }));
3836
+ }
3837
+ }, shell.map(function (item) {
3838
+ return /*#__PURE__*/React__default['default'].createElement(Option$2, {
3839
+ value: item.value,
3840
+ key: item.value
3841
+ }, item.label);
3842
+ })), /*#__PURE__*/React__default['default'].createElement(Search$1, {
3843
+ placeholder: "\u5B9D\u8D1D\u94FE\u63A5\uFF0C\u6807\u9898",
3844
+ allowClear: true,
3845
+ enterButton: "\u641C\u7D22",
3846
+ style: {
3847
+ width: '200px'
3848
+ },
3849
+ value: searchParams.title,
3850
+ onSearch: function onSearch(e) {
3851
+ setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
3852
+ title: e
3853
+ }));
3854
+ }
3855
+ }))), /*#__PURE__*/React__default['default'].createElement("div", {
3856
+ className: "goodMain"
3857
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
3858
+ spinning: loading
3859
+ }, (searchParams.type == 'all' ? selectList : goodList).map(function (good) {
3860
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3861
+ key: good.numIid,
3862
+ className: "goodItem ".concat(selectIds.includes(good.numIid) ? 'active' : ''),
3863
+ onClick: function onClick() {
3864
+ changeItem(good);
3865
+ }
3866
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
3867
+ className: "goodImg"
3868
+ }, /*#__PURE__*/React__default['default'].createElement("img", {
3869
+ src: good.picUrl,
3870
+ alt: "",
3871
+ className: "img"
3872
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
3873
+ className: "goodText"
3874
+ }, good.title), /*#__PURE__*/React__default['default'].createElement("div", null, "\xA5", good.price));
3875
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Pagination, {
3876
+ total: total,
3877
+ current: searchParams.pageNo,
3878
+ pageSize: searchParams.pageSize,
3879
+ onChange: pageChange
3880
+ }));
3881
+ };
3882
+
3883
+ var Goods$1 = function Goods(props, ref) {
3884
+ var _props$value = props.value,
3885
+ shopId = _props$value.shopId,
3886
+ _props$value$imgList = _props$value.imgList,
3887
+ imgList = _props$value$imgList === void 0 ? [] : _props$value$imgList,
3888
+ maxLength = props.maxLength,
3889
+ onChange = props.onChange,
3890
+ type = props.type,
3891
+ shopList = props.shopList,
3892
+ enableItemId = props.enableItemId,
3893
+ enableSupplierName = props.enableSupplierName,
3894
+ userNick = props.userNick;
3895
+ var _useState = React.useState(false),
3896
+ _useState2 = _slicedToArray(_useState, 2),
3897
+ visible = _useState2[0],
3898
+ setVisible = _useState2[1];
3899
+ var skuRef = React.useRef();
3900
+ React.useImperativeHandle(ref, function () {
3901
+ return {
3902
+ open: function open() {
3903
+ return setVisible(true);
3904
+ },
3905
+ close: function close() {
3906
+ return setVisible(false);
3907
+ }
3908
+ };
3909
+ }, []);
3910
+ var handleSelectSku = function handleSelectSku(_ref) {
3911
+ var enableItemId = _ref.enableItemId,
3912
+ enableSupplierName = _ref.enableSupplierName;
3913
+ var newValue = {
3914
+ shopId: shopId,
3915
+ imgList: [_objectSpread2(_objectSpread2({}, imgList[0]), {}, {
3916
+ supplierItemOuterId: enableItemId,
3917
+ supplierName: enableSupplierName
3918
+ })]
3919
+ };
3920
+ onChange(_objectSpread2({}, newValue));
3921
+ };
3922
+ var onSubmit = function onSubmit(list) {
3923
+ var newValue = {
3924
+ shopId: shopId,
3925
+ imgList: _toConsumableArray(list)
3926
+ };
3927
+ onChange(_objectSpread2({}, newValue));
3928
+ setVisible(false);
3929
+ if (type === 4 && (enableItemId || enableSupplierName) && list.length > 0) {
3930
+ var _skuRef$current;
3931
+ (_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
3932
+ shopId: shopId,
3933
+ numIids: list[0].numIid
3934
+ });
3935
+ }
3936
+ };
3937
+ return /*#__PURE__*/React__default['default'].createElement("div", {
3938
+ className: "goodsBox"
3939
+ }, /*#__PURE__*/React__default['default'].createElement(GoodsModal$1, {
3940
+ visible: visible,
3941
+ onSubmit: onSubmit,
3942
+ type: type,
3943
+ imgList: imgList,
3944
+ shopList: shopList,
3945
+ shopId: shopId,
3946
+ maxLength: maxLength,
3947
+ onCancel: function onCancel() {
3948
+ setVisible(false);
3949
+ }
3950
+ }), /*#__PURE__*/React__default['default'].createElement(Sku, {
3951
+ handleOk: handleSelectSku,
3952
+ ref: skuRef,
3953
+ userNick: userNick
3954
+ }));
3955
+ };
3956
+ var index = /*#__PURE__*/React.forwardRef(Goods$1);
3957
+
3958
+ exports.Address = ApaasAddress;
3959
+ exports.AliPay = AliPay;
3960
+ exports.ApaasAddress = Province;
3961
+ exports.ApaasCascader = ApaasCascader;
3962
+ exports.ApaasCheckbox = ApaasCheckbox;
3963
+ exports.ApaasDate = ApaasDate;
3964
+ exports.ApaasHoc = withFormItem;
3965
+ exports.ApaasInput = ApaasInput;
3966
+ exports.ApaasInputNumber = ApaasInputNumber;
3967
+ exports.ApaasMultipleSelect = ApaasMultipleSelect;
3968
+ exports.ApaasRadio = ApaasRadio;
3969
+ exports.ApaasRate = ApaasRate;
3970
+ exports.ApaasSelect = ApaasSelect;
3971
+ exports.ApaasSlider = ApaasSlider;
3972
+ exports.ApaasTextArea = ApaasTextArea;
3973
+ exports.ApaasUpload = ApaasUpload;
3974
+ exports.ApaasUploadAsync = ApaasUploadAsync;
3975
+ exports.BuyerNick = BuyerNick;
3976
+ exports.ChooseBaby = ChooseBaby;
3977
+ exports.ExpressLogistics = ExpressLogistics;
3978
+ exports.Goods = Goods;
3979
+ exports.GoodsTable = index;
3980
+ exports.Invoice = Invoice;
3981
+ exports.JstGoods = jstGoods;
3982
+ exports.JstItemList = ItemList;
3983
+ exports.LogisticsInterception = LogisticsInterception;
3984
+ exports.Payment = Payment;
3985
+ exports.Remark = RemarkInput;
3986
+ exports.ReturnLogistics = ExpressLogistics;
3987
+ exports.ShopName = ShopNameSelect;
3988
+ exports.Status = Status;
3989
+ exports.Supplier = Supplier;
3990
+ exports.TBGoodId = TBGoodId;
3991
+ exports.TBGoodSerial = TBGoodSerial;
3992
+ exports.TradeId = TradeId;