@bit-sun/business-component 2.0.0 → 2.0.3

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 (26) hide show
  1. package/dist/components/Business/AddSelectBusiness/index.d.ts +1 -0
  2. package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
  3. package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
  4. package/dist/components/Functional/AddSelect/index.d.ts +3 -0
  5. package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.esm.js +2189 -140
  8. package/dist/index.js +2191 -138
  9. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  10. package/package.json +1 -1
  11. package/src/components/Business/AddSelectBusiness/index.md +37 -0
  12. package/src/components/Business/AddSelectBusiness/index.tsx +295 -0
  13. package/src/components/Business/CommodityEntry/index.md +2 -2
  14. package/src/components/Business/CommodityEntry/index.tsx +5 -2
  15. package/src/components/Business/SearchSelect/BusinessUtils.ts +2 -0
  16. package/src/components/Business/TreeSearchSelect/index.md +126 -0
  17. package/src/components/Business/TreeSearchSelect/index.tsx +34 -0
  18. package/src/components/Business/TreeSearchSelect/utils.ts +60 -0
  19. package/src/components/Functional/AddSelect/index.less +284 -0
  20. package/src/components/Functional/AddSelect/index.md +118 -0
  21. package/src/components/Functional/AddSelect/index.tsx +882 -0
  22. package/src/components/Functional/DataImport/index.tsx +0 -1
  23. package/src/components/Functional/DataValidation/index.tsx +8 -1
  24. package/src/components/Functional/TreeSearchSelect/index.md +47 -0
  25. package/src/components/Functional/TreeSearchSelect/index.tsx +148 -0
  26. package/src/index.ts +8 -0
package/dist/index.js CHANGED
@@ -44,6 +44,387 @@ function _objectSpread2(target) {
44
44
  return target;
45
45
  }
46
46
 
47
+ function _regeneratorRuntime() {
48
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
49
+
50
+ _regeneratorRuntime = function () {
51
+ return exports;
52
+ };
53
+
54
+ var exports = {},
55
+ Op = Object.prototype,
56
+ hasOwn = Op.hasOwnProperty,
57
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
58
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
59
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
60
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
61
+
62
+ function define(obj, key, value) {
63
+ return Object.defineProperty(obj, key, {
64
+ value: value,
65
+ enumerable: !0,
66
+ configurable: !0,
67
+ writable: !0
68
+ }), obj[key];
69
+ }
70
+
71
+ try {
72
+ define({}, "");
73
+ } catch (err) {
74
+ define = function (obj, key, value) {
75
+ return obj[key] = value;
76
+ };
77
+ }
78
+
79
+ function wrap(innerFn, outerFn, self, tryLocsList) {
80
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
81
+ generator = Object.create(protoGenerator.prototype),
82
+ context = new Context(tryLocsList || []);
83
+ return generator._invoke = function (innerFn, self, context) {
84
+ var state = "suspendedStart";
85
+ return function (method, arg) {
86
+ if ("executing" === state) throw new Error("Generator is already running");
87
+
88
+ if ("completed" === state) {
89
+ if ("throw" === method) throw arg;
90
+ return doneResult();
91
+ }
92
+
93
+ for (context.method = method, context.arg = arg;;) {
94
+ var delegate = context.delegate;
95
+
96
+ if (delegate) {
97
+ var delegateResult = maybeInvokeDelegate(delegate, context);
98
+
99
+ if (delegateResult) {
100
+ if (delegateResult === ContinueSentinel) continue;
101
+ return delegateResult;
102
+ }
103
+ }
104
+
105
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
106
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
107
+ context.dispatchException(context.arg);
108
+ } else "return" === context.method && context.abrupt("return", context.arg);
109
+ state = "executing";
110
+ var record = tryCatch(innerFn, self, context);
111
+
112
+ if ("normal" === record.type) {
113
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
114
+ return {
115
+ value: record.arg,
116
+ done: context.done
117
+ };
118
+ }
119
+
120
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
121
+ }
122
+ };
123
+ }(innerFn, self, context), generator;
124
+ }
125
+
126
+ function tryCatch(fn, obj, arg) {
127
+ try {
128
+ return {
129
+ type: "normal",
130
+ arg: fn.call(obj, arg)
131
+ };
132
+ } catch (err) {
133
+ return {
134
+ type: "throw",
135
+ arg: err
136
+ };
137
+ }
138
+ }
139
+
140
+ exports.wrap = wrap;
141
+ var ContinueSentinel = {};
142
+
143
+ function Generator() {}
144
+
145
+ function GeneratorFunction() {}
146
+
147
+ function GeneratorFunctionPrototype() {}
148
+
149
+ var IteratorPrototype = {};
150
+ define(IteratorPrototype, iteratorSymbol, function () {
151
+ return this;
152
+ });
153
+ var getProto = Object.getPrototypeOf,
154
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
155
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
156
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
157
+
158
+ function defineIteratorMethods(prototype) {
159
+ ["next", "throw", "return"].forEach(function (method) {
160
+ define(prototype, method, function (arg) {
161
+ return this._invoke(method, arg);
162
+ });
163
+ });
164
+ }
165
+
166
+ function AsyncIterator(generator, PromiseImpl) {
167
+ function invoke(method, arg, resolve, reject) {
168
+ var record = tryCatch(generator[method], generator, arg);
169
+
170
+ if ("throw" !== record.type) {
171
+ var result = record.arg,
172
+ value = result.value;
173
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
174
+ invoke("next", value, resolve, reject);
175
+ }, function (err) {
176
+ invoke("throw", err, resolve, reject);
177
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
178
+ result.value = unwrapped, resolve(result);
179
+ }, function (error) {
180
+ return invoke("throw", error, resolve, reject);
181
+ });
182
+ }
183
+
184
+ reject(record.arg);
185
+ }
186
+
187
+ var previousPromise;
188
+
189
+ this._invoke = function (method, arg) {
190
+ function callInvokeWithMethodAndArg() {
191
+ return new PromiseImpl(function (resolve, reject) {
192
+ invoke(method, arg, resolve, reject);
193
+ });
194
+ }
195
+
196
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
197
+ };
198
+ }
199
+
200
+ function maybeInvokeDelegate(delegate, context) {
201
+ var method = delegate.iterator[context.method];
202
+
203
+ if (undefined === method) {
204
+ if (context.delegate = null, "throw" === context.method) {
205
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
206
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
207
+ }
208
+
209
+ return ContinueSentinel;
210
+ }
211
+
212
+ var record = tryCatch(method, delegate.iterator, context.arg);
213
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
214
+ var info = record.arg;
215
+ 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);
216
+ }
217
+
218
+ function pushTryEntry(locs) {
219
+ var entry = {
220
+ tryLoc: locs[0]
221
+ };
222
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
223
+ }
224
+
225
+ function resetTryEntry(entry) {
226
+ var record = entry.completion || {};
227
+ record.type = "normal", delete record.arg, entry.completion = record;
228
+ }
229
+
230
+ function Context(tryLocsList) {
231
+ this.tryEntries = [{
232
+ tryLoc: "root"
233
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
234
+ }
235
+
236
+ function values(iterable) {
237
+ if (iterable) {
238
+ var iteratorMethod = iterable[iteratorSymbol];
239
+ if (iteratorMethod) return iteratorMethod.call(iterable);
240
+ if ("function" == typeof iterable.next) return iterable;
241
+
242
+ if (!isNaN(iterable.length)) {
243
+ var i = -1,
244
+ next = function next() {
245
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
246
+
247
+ return next.value = undefined, next.done = !0, next;
248
+ };
249
+
250
+ return next.next = next;
251
+ }
252
+ }
253
+
254
+ return {
255
+ next: doneResult
256
+ };
257
+ }
258
+
259
+ function doneResult() {
260
+ return {
261
+ value: undefined,
262
+ done: !0
263
+ };
264
+ }
265
+
266
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
267
+ var ctor = "function" == typeof genFun && genFun.constructor;
268
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
269
+ }, exports.mark = function (genFun) {
270
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
271
+ }, exports.awrap = function (arg) {
272
+ return {
273
+ __await: arg
274
+ };
275
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
276
+ return this;
277
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
278
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
279
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
280
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
281
+ return result.done ? result.value : iter.next();
282
+ });
283
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
284
+ return this;
285
+ }), define(Gp, "toString", function () {
286
+ return "[object Generator]";
287
+ }), exports.keys = function (object) {
288
+ var keys = [];
289
+
290
+ for (var key in object) keys.push(key);
291
+
292
+ return keys.reverse(), function next() {
293
+ for (; keys.length;) {
294
+ var key = keys.pop();
295
+ if (key in object) return next.value = key, next.done = !1, next;
296
+ }
297
+
298
+ return next.done = !0, next;
299
+ };
300
+ }, exports.values = values, Context.prototype = {
301
+ constructor: Context,
302
+ reset: function (skipTempReset) {
303
+ 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);
304
+ },
305
+ stop: function () {
306
+ this.done = !0;
307
+ var rootRecord = this.tryEntries[0].completion;
308
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
309
+ return this.rval;
310
+ },
311
+ dispatchException: function (exception) {
312
+ if (this.done) throw exception;
313
+ var context = this;
314
+
315
+ function handle(loc, caught) {
316
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
317
+ }
318
+
319
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
320
+ var entry = this.tryEntries[i],
321
+ record = entry.completion;
322
+ if ("root" === entry.tryLoc) return handle("end");
323
+
324
+ if (entry.tryLoc <= this.prev) {
325
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
326
+ hasFinally = hasOwn.call(entry, "finallyLoc");
327
+
328
+ if (hasCatch && hasFinally) {
329
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
330
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
331
+ } else if (hasCatch) {
332
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
333
+ } else {
334
+ if (!hasFinally) throw new Error("try statement without catch or finally");
335
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
336
+ }
337
+ }
338
+ }
339
+ },
340
+ abrupt: function (type, arg) {
341
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
342
+ var entry = this.tryEntries[i];
343
+
344
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
345
+ var finallyEntry = entry;
346
+ break;
347
+ }
348
+ }
349
+
350
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
351
+ var record = finallyEntry ? finallyEntry.completion : {};
352
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
353
+ },
354
+ complete: function (record, afterLoc) {
355
+ if ("throw" === record.type) throw record.arg;
356
+ 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;
357
+ },
358
+ finish: function (finallyLoc) {
359
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
360
+ var entry = this.tryEntries[i];
361
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
362
+ }
363
+ },
364
+ catch: function (tryLoc) {
365
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
366
+ var entry = this.tryEntries[i];
367
+
368
+ if (entry.tryLoc === tryLoc) {
369
+ var record = entry.completion;
370
+
371
+ if ("throw" === record.type) {
372
+ var thrown = record.arg;
373
+ resetTryEntry(entry);
374
+ }
375
+
376
+ return thrown;
377
+ }
378
+ }
379
+
380
+ throw new Error("illegal catch attempt");
381
+ },
382
+ delegateYield: function (iterable, resultName, nextLoc) {
383
+ return this.delegate = {
384
+ iterator: values(iterable),
385
+ resultName: resultName,
386
+ nextLoc: nextLoc
387
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
388
+ }
389
+ }, exports;
390
+ }
391
+
392
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
393
+ try {
394
+ var info = gen[key](arg);
395
+ var value = info.value;
396
+ } catch (error) {
397
+ reject(error);
398
+ return;
399
+ }
400
+
401
+ if (info.done) {
402
+ resolve(value);
403
+ } else {
404
+ Promise.resolve(value).then(_next, _throw);
405
+ }
406
+ }
407
+
408
+ function _asyncToGenerator(fn) {
409
+ return function () {
410
+ var self = this,
411
+ args = arguments;
412
+ return new Promise(function (resolve, reject) {
413
+ var gen = fn.apply(self, args);
414
+
415
+ function _next(value) {
416
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
417
+ }
418
+
419
+ function _throw(err) {
420
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
421
+ }
422
+
423
+ _next(undefined);
424
+ });
425
+ };
426
+ }
427
+
47
428
  function _classCallCheck(instance, Constructor) {
48
429
  if (!(instance instanceof Constructor)) {
49
430
  throw new TypeError("Cannot call a class as a function");
@@ -103,18 +484,17 @@ function _inherits(subClass, superClass) {
103
484
  }
104
485
 
105
486
  function _getPrototypeOf(o) {
106
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
487
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
107
488
  return o.__proto__ || Object.getPrototypeOf(o);
108
489
  };
109
490
  return _getPrototypeOf(o);
110
491
  }
111
492
 
112
493
  function _setPrototypeOf(o, p) {
113
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
494
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
114
495
  o.__proto__ = p;
115
496
  return o;
116
497
  };
117
-
118
498
  return _setPrototypeOf(o, p);
119
499
  }
120
500
 
@@ -1552,6 +1932,19 @@ var CaretLeftOutlined$1 = function CaretLeftOutlined$1(props, ref) {
1552
1932
  CaretLeftOutlined$1.displayName = 'CaretLeftOutlined';
1553
1933
  var CaretLeftOutlined$2 = /*#__PURE__*/React.forwardRef(CaretLeftOutlined$1);
1554
1934
 
1935
+ // This icon file is generated automatically.
1936
+ var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { "tag": "path", "attrs": { "d": "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "close-circle", "theme": "outlined" };
1937
+
1938
+ var CloseCircleOutlined$1 = function CloseCircleOutlined$1(props, ref) {
1939
+ return /*#__PURE__*/React.createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
1940
+ ref: ref,
1941
+ icon: CloseCircleOutlined
1942
+ }));
1943
+ };
1944
+
1945
+ CloseCircleOutlined$1.displayName = 'CloseCircleOutlined';
1946
+ var CloseCircleOutlined$2 = /*#__PURE__*/React.forwardRef(CloseCircleOutlined$1);
1947
+
1555
1948
  // This icon file is generated automatically.
1556
1949
  var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
1557
1950
 
@@ -1981,16 +2374,26 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1981
2374
  var _this$props = _this.props,
1982
2375
  validDataUrl = _this$props.validDataUrl,
1983
2376
  updateData = _this$props.updateData,
1984
- columns = _this$props.columns;
2377
+ columns = _this$props.columns,
2378
+ isBrandAuth = _this$props.isBrandAuth;
1985
2379
 
1986
2380
  var resultData = _this.getData().filter(function (d) {
1987
2381
  return ___default['default'].compact(Object.values(d)).length;
1988
- });
2382
+ }); // 处理业务参数
1989
2383
 
1990
- axios__default['default'].post(validDataUrl, {
2384
+
2385
+ var otherParams = {};
2386
+
2387
+ if (isBrandAuth) {
2388
+ otherParams = {
2389
+ brandAuth: 'ctl-withAuth'
2390
+ };
2391
+ }
2392
+
2393
+ axios__default['default'].post(validDataUrl, _objectSpread2(_objectSpread2({}, otherParams), {}, {
1991
2394
  columns: columns,
1992
2395
  data: resultData
1993
- }).then(function (result) {
2396
+ })).then(function (result) {
1994
2397
  result = result.data;
1995
2398
 
1996
2399
  if (result.status !== '0') {
@@ -2580,7 +2983,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2580
2983
  console.time();
2581
2984
  var sheetData = luckysheet$1.getSheetData();
2582
2985
  var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
2583
- debugger;
2584
2986
  return item[0];
2585
2987
  }).map(function (item) {
2586
2988
  var obj = {};
@@ -3150,7 +3552,6 @@ var SearchSelect = function SearchSelect(props) {
3150
3552
  } // 防抖函数 待定
3151
3553
 
3152
3554
 
3153
- // 防抖函数 待定
3154
3555
  getData(searchParams);
3155
3556
  }, {
3156
3557
  wait: 1000
@@ -4005,88 +4406,8 @@ var SearchSelect = function SearchSelect(props) {
4005
4406
  }), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
4006
4407
  };
4007
4408
 
4008
- var shopFileType = [{
4009
- text: "线上",
4010
- value: 'online'
4011
- }, {
4012
- text: "线下",
4013
- value: 'offline'
4014
- }];
4015
- var shopFile2Type = [{
4016
- text: "第三方线上",
4017
- value: 'online'
4018
- }, {
4019
- text: "线下",
4020
- value: 'offline'
4021
- }, {
4022
- text: "自营B2B",
4023
- value: 'B2B'
4024
- }, {
4025
- text: "自营B2C",
4026
- value: 'B2C'
4027
- }];
4028
- var arrivalPaySupportList = [{
4029
- text: "支持",
4030
- value: 1
4031
- }, {
4032
- text: "不支持",
4033
- value: 0
4034
- }];
4035
- var sharingType = [{
4036
- text: "共享",
4037
- value: '10'
4038
- }, {
4039
- text: "私有",
4040
- value: '20'
4041
- }];
4042
-
4043
- var getDicData = function getDicData(dicCode) {
4044
- var dicData = {};
4045
-
4046
- {
4047
- var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
4048
- dicData = storageDic[dicCode];
4049
- } // @ts-ignore
4050
-
4051
-
4052
- if (!dicData || !dicData.length) ;
4053
-
4054
- return dicData;
4055
- };
4056
-
4057
- var getDictionarySource = function getDictionarySource(dicCode) {
4058
- var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4059
- var dicData = getDicData(dicCode);
4060
-
4061
- try {
4062
- if (needConvertInterger) {
4063
- // @ts-ignore
4064
- dicData = dicData.map(function (item) {
4065
- return _objectSpread2(_objectSpread2({}, item), {}, {
4066
- value: parseFloat(item.value)
4067
- });
4068
- });
4069
- }
4070
- } catch (e) {}
4071
-
4072
- return dicData;
4073
- };
4074
-
4075
- var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
4076
- var dicData = getDicData(dicCode);
4077
- if (value === undefined) return ''; // @ts-ignore
4078
-
4079
- var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
4080
- return item.value === value.toString();
4081
- });
4082
-
4083
- if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
4084
- // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
4085
- return value;
4086
- }
4087
-
4088
- return dicItemArray[0].text;
4089
- };
4409
+ var css_248z$4 = ".add_select_show {\n display: flex;\n}\n.add_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.add_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.add_select_header {\n border-bottom: 1px solid #D9D9D9;\n height: 24px;\n height: 40px;\n font-family: PingFangSC-Medium;\n font-weight: 500;\n font-size: 18px;\n color: #000000;\n letter-spacing: 0;\n line-height: 40px;\n margin-bottom: 10px;\n padding-left: 10px;\n}\n.add_select_header > span {\n margin-left: 20px;\n font-weight: 400;\n font-size: 12px;\n color: #666666;\n letter-spacing: 0;\n line-height: 40px;\n}\n.add_select_header > span > span {\n color: #ff0000;\n}\n.add_select_header_close span {\n position: absolute;\n color: black !important;\n right: 10px;\n top: 10px;\n}\n.add_select_wrapper {\n position: relative;\n display: flex;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n margin: 5px 10px;\n}\n.add_select_wrapper .ant-table-pagination.ant-pagination {\n margin: 5px;\n padding-right: 5px;\n}\n.add_select_wrapper .ant-checkbox-wrapper {\n justify-content: center;\n}\n.add_select_wrapper .ant-form-item-label {\n padding: 0PX;\n line-height: 23px !important;\n}\n.add_select_wrapper .ant-form-item-label > label {\n font-size: 12px;\n}\n.add_select_wrapper .ant-table-thead th {\n height: 20px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper .row-class {\n height: 24px;\n}\n.add_select_wrapper .row-class td {\n font-size: 12px !important;\n height: 24px !important;\n padding: 0px 8px !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-table-body {\n height: 240px;\n overflow-y: auto !important;\n}\n.add_select_wrapper .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.add_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_left {\n flex-basis: 298px;\n width: 298px;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-right: 10px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.add_select_wrapper_right {\n width: 872px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_right1 {\n width: 100%;\n margin-left: 10px;\n}\n.add_select_wrapper_right,\n.add_select_wrapper_right1 {\n overflow-x: auto;\n}\n.add_select_wrapper .select_list_columns {\n height: 272px;\n overflow-y: auto;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.add_select_wrapper .select_list_columns_formItems {\n padding: 7px 10px;\n}\n.add_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px;\n justify-content: flex-end;\n}\n.add_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.add_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 5px;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n.add_select_wrapper_select {\n margin-top: 4px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n margin: 5px 10px;\n}\n.add_select_wrapper_select .ant-table-pagination.ant-pagination {\n margin: 9px;\n padding-right: 5px;\n}\n.add_select_wrapper_select .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper_select .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper_select .ant-table-thead th {\n height: 23px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 23px !important;\n}\n.add_select_wrapper_select .ant-modal-close-x {\n height: 30px;\n}\n.add_select_wrapper_select .row-class {\n height: 30px;\n}\n.add_select_wrapper_select .row-class td {\n font-size: 12px !important;\n height: 30px !important;\n padding: 4px 8px !important;\n}\n.add_select_wrapper_select .ant-table-body {\n height: 200px;\n overflow-y: auto !important;\n}\n.add_select_wrapper_select .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_select .ant-input-number-input {\n height: auto;\n}\n.add_select_wrapper_select .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 3px;\n border-bottom: 1px solid #D9D9D9;\n}\n";
4410
+ styleInject(css_248z$4);
4090
4411
 
4091
4412
  var loadSelectSource = function loadSelectSource(url, params) {
4092
4413
  return new Promise(function (resolve, reject) {
@@ -4107,26 +4428,1124 @@ var loadSelectSource = function loadSelectSource(url, params) {
4107
4428
  });
4108
4429
  };
4109
4430
 
4110
- var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
4111
- var result;
4431
+ var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
4432
+ var _reData$position;
4112
4433
 
4113
- switch (type) {
4114
- case 'supplier2':
4115
- case 'customer2':
4116
- case 'shopFile2':
4117
- result = '/channel-manage';
4118
- break;
4434
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
4435
+ var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
4436
+ var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || (data === null || data === void 0 ? void 0 : data.children) || [];
4437
+ var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
4438
+ return {
4439
+ text: v[resKeyValue[1]],
4440
+ value: v[resKeyValue[0]]
4441
+ };
4442
+ }) : [];
4443
+ changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
4444
+ initialSource: formatData
4445
+ });
4446
+ }; // 格式化树选择器数据源
4119
4447
 
4120
- case 'skuCommodity':
4121
- case 'skuPropertyValue':
4122
- case 'spuCommodity':
4123
- result = '/items';
4124
- break;
4125
4448
 
4126
- case 'physicalWarehouse':
4127
- case 'realWarehouse':
4128
- case 'virtualWarehouse':
4129
- case 'channelWarehouse':
4449
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
4450
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
4451
+ return {
4452
+ title: treeDataItem[resKeyValue[1]],
4453
+ value: treeDataItem[resKeyValue[0]],
4454
+ parentId: treeDataItem.parent,
4455
+ data: _objectSpread2({}, treeDataItem),
4456
+ isLeaf: !haveChildren,
4457
+ disabled: haveChildren,
4458
+ children: haveChildren ? treeDataItem.children.map(function (i) {
4459
+ return mapSearchTree(i, resKeyValue);
4460
+ }) : []
4461
+ };
4462
+ };
4463
+
4464
+ var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
4465
+ var _reData$position2;
4466
+
4467
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
4468
+ var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
4469
+ var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
4470
+ return mapSearchTree(ites, resKeyValue);
4471
+ }) || [];
4472
+ changeSearchForm[changePosition].field.props.treeData = formatData;
4473
+ };
4474
+
4475
+ var Option$1 = antd.Select.Option;
4476
+
4477
+ var AddSelect = function AddSelect(props) {
4478
+ var value = props.value,
4479
+ onChange = props.onChange,
4480
+ _props$selectProps = props.selectProps,
4481
+ selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
4482
+ _props$modalTableProp = props.modalTableProps,
4483
+ modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
4484
+ _props$labelInValue = props.labelInValue,
4485
+ labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
4486
+ requestConfig = props.requestConfig,
4487
+ ctx = props.ctx,
4488
+ sourceName = props.sourceName,
4489
+ _props$needModalTable = props.needModalTable,
4490
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4491
+ _props$getPopupContai = props.getPopupContainer,
4492
+ onSaveCallback = props.onSaveCallback,
4493
+ _props$buttonText = props.buttonText,
4494
+ buttonText = _props$buttonText === void 0 ? '添加' : _props$buttonText;
4495
+
4496
+ var _ref = requestConfig || {},
4497
+ url = _ref.url,
4498
+ otherParams = _ref.otherParams,
4499
+ isMap = _ref.isMap,
4500
+ fixedparameter = _ref.fixedparameter,
4501
+ fieldValToParam = _ref.fieldValToParam,
4502
+ _ref$mappingTextField = _ref.mappingTextField,
4503
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
4504
+ mappingTextShowKeyField = _ref.mappingTextShowKeyField,
4505
+ _ref$mappingValueFiel = _ref.mappingValueField,
4506
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
4507
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
4508
+
4509
+ var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
4510
+ var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
4511
+
4512
+ var initVal = value || (selectMode ? [] : null);
4513
+ var pageSize = 100; // 下拉框默认分页 条数
4514
+
4515
+ var tableInitPageSize = 10; // 弹框默认分页 条数
4516
+
4517
+ var currentPage = 1;
4518
+ var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
4519
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
4520
+
4521
+ var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
4522
+ // 以下属性不可更改----设计配置项
4523
+ showSearch: false,
4524
+ filterOption: false,
4525
+ allowClear: true,
4526
+ listHeight: 160,
4527
+ optionLabelProp: "label",
4528
+ autoClearSearchValue: false
4529
+ });
4530
+
4531
+ var _useState = React.useState([]),
4532
+ _useState2 = _slicedToArray(_useState, 2),
4533
+ items = _useState2[0],
4534
+ setItems = _useState2[1];
4535
+
4536
+ var _useState3 = React.useState(1),
4537
+ _useState4 = _slicedToArray(_useState3, 2),
4538
+ scrollPage = _useState4[0],
4539
+ setScrollPage = _useState4[1];
4540
+
4541
+ var _useState5 = React.useState(0),
4542
+ _useState6 = _slicedToArray(_useState5, 2),
4543
+ itemsTotal = _useState6[0],
4544
+ setItemsTotal = _useState6[1];
4545
+
4546
+ var _useState7 = React.useState(false),
4547
+ _useState8 = _slicedToArray(_useState7, 2),
4548
+ fetching = _useState8[0],
4549
+ setFetching = _useState8[1];
4550
+
4551
+ var _useState9 = React.useState(''),
4552
+ _useState10 = _slicedToArray(_useState9, 2),
4553
+ searchValue = _useState10[0],
4554
+ setSearchValue = _useState10[1];
4555
+
4556
+ var _useState11 = React.useState(false),
4557
+ _useState12 = _slicedToArray(_useState11, 2),
4558
+ isModalVisible = _useState12[0],
4559
+ setIsModalVisible = _useState12[1];
4560
+
4561
+ var _useState13 = React.useState(initVal),
4562
+ _useState14 = _slicedToArray(_useState13, 2),
4563
+ popvalue = _useState14[0],
4564
+ setPopValue = _useState14[1];
4565
+
4566
+ var _useState15 = React.useState(sourceName),
4567
+ _useState16 = _slicedToArray(_useState15, 2),
4568
+ uniqueValue = _useState16[0],
4569
+ setUniqueValue = _useState16[1];
4570
+
4571
+ var _useDebounceFn = ahooks.useDebounceFn(function (v) {
4572
+ // 优化搜索参数 支持传多个
4573
+ var searchParams = {};
4574
+
4575
+ if (typeof selectParamsKey === 'string') {
4576
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
4577
+ }
4578
+
4579
+ if (Array.isArray(selectParamsKey)) {
4580
+ selectParamsKey.forEach(function (i) {
4581
+ searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
4582
+ });
4583
+ } // 防抖函数 待定
4584
+
4585
+
4586
+ getData(searchParams);
4587
+ }, {
4588
+ wait: 1000
4589
+ }),
4590
+ run = _useDebounceFn.run;
4591
+
4592
+ var _Form$useForm = antd.Form.useForm(),
4593
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4594
+ form = _Form$useForm2[0];
4595
+
4596
+ var _useState17 = React.useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4597
+ _useState18 = _slicedToArray(_useState17, 2),
4598
+ tableSearchForm = _useState18[0],
4599
+ setTableSearchForm = _useState18[1];
4600
+
4601
+ var _useState19 = React.useState(true),
4602
+ _useState20 = _slicedToArray(_useState19, 2),
4603
+ caretLeftFlag = _useState20[0],
4604
+ setCaretLeftFlag = _useState20[1];
4605
+
4606
+ var _useState21 = React.useState([]),
4607
+ _useState22 = _slicedToArray(_useState21, 2),
4608
+ tableData = _useState22[0],
4609
+ setTableData = _useState22[1];
4610
+
4611
+ var _useState23 = React.useState({
4612
+ total: 0,
4613
+ size: "small",
4614
+ current: 1,
4615
+ pageSize: tableInitPageSize
4616
+ }),
4617
+ _useState24 = _slicedToArray(_useState23, 2),
4618
+ tablePagination = _useState24[0],
4619
+ setTablePagination = _useState24[1];
4620
+
4621
+ var _useState25 = React.useState([]),
4622
+ _useState26 = _slicedToArray(_useState25, 2),
4623
+ selectedRowKeys = _useState26[0],
4624
+ setSelectedRowKeys = _useState26[1];
4625
+
4626
+ var _useState27 = React.useState([]),
4627
+ _useState28 = _slicedToArray(_useState27, 2),
4628
+ doubleArr = _useState28[0],
4629
+ setDoubleArr = _useState28[1]; // 存放双数组的数组
4630
+
4631
+
4632
+ var _useState29 = React.useState(false),
4633
+ _useState30 = _slicedToArray(_useState29, 2),
4634
+ checkedAll = _useState30[0],
4635
+ setCheckedAll = _useState30[1];
4636
+
4637
+ var _useState31 = React.useState(false),
4638
+ _useState32 = _slicedToArray(_useState31, 2),
4639
+ indeterminate = _useState32[0],
4640
+ setIndeterminate = _useState32[1];
4641
+
4642
+ var _useState33 = React.useState({}),
4643
+ _useState34 = _slicedToArray(_useState33, 2),
4644
+ tableFormParams = _useState34[0],
4645
+ setTableFormParams = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
4646
+
4647
+
4648
+ var getData = function getData() {
4649
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4650
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4651
+ if (!requestConfig) return;
4652
+ setFetching(true); // 处理dependence参数
4653
+
4654
+ var fixedParam = {};
4655
+
4656
+ if (fixedparameter && fieldValToParam && ctx) {
4657
+ fixedparameter.forEach(function (item, index) {
4658
+ var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
4659
+
4660
+ if (fixedParamVal) {
4661
+ fixedParam[item] = fixedParamVal;
4662
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
4663
+ }
4664
+ });
4665
+ } // 数组对象处理,对带有特殊标记的name进行处理
4666
+
4667
+
4668
+ for (var key in params) {
4669
+ if (Object.prototype.hasOwnProperty.call(params, key)) {
4670
+ (function () {
4671
+ var element = params[key];
4672
+
4673
+ if (element && key.indexOf('*number*') >= 0) {
4674
+ var dataParams = key.split('*number*');
4675
+ dataParams.forEach(function (value, index) {
4676
+ params[value] = element[index];
4677
+ });
4678
+ delete params[key];
4679
+ } else if (element && key.indexOf('*address*') >= 0) {
4680
+ var _dataParams = key.split('*address*');
4681
+
4682
+ _dataParams.forEach(function (value, index) {
4683
+ params[value] = element.PCDCode[index];
4684
+ });
4685
+
4686
+ delete params[key];
4687
+ } else if (element && key.indexOf('*costType*') >= 0) {
4688
+ var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
4689
+
4690
+
4691
+ params[_dataParams2[0]] = element[1];
4692
+ delete params[key];
4693
+ } else if (element && key.indexOf('*fullDate*') >= 0) {
4694
+ var _dataParams3 = key.split('*fullDate*');
4695
+
4696
+ _dataParams3.forEach(function (value, index) {
4697
+ if (index === 0) {
4698
+ params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
4699
+ } else {
4700
+ params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
4701
+ }
4702
+ });
4703
+
4704
+ delete params[key];
4705
+ } else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
4706
+ var _dataParams4 = key.split('*checkBox*');
4707
+
4708
+ if (element) {
4709
+ params[_dataParams4[0]] = 0;
4710
+ }
4711
+
4712
+ delete params[key];
4713
+ } else if (element && key.indexOf('*cascader*') >= 0) {
4714
+ var _dataParams5 = key.split('*cascader*');
4715
+
4716
+ params[_dataParams5[0]] = element[element.length - 1];
4717
+ delete params[key];
4718
+ } else if (element && key.indexOf('*date*') >= 0) {
4719
+ var _dataParams6 = key.split('*date*');
4720
+
4721
+ _dataParams6.forEach(function (value, index) {
4722
+ if (index === 0) {
4723
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4724
+ } else {
4725
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4726
+ }
4727
+ });
4728
+
4729
+ delete params[key];
4730
+ } else if (element && key.indexOf('*') >= 0) {
4731
+ var _dataParams7 = key.split('*');
4732
+
4733
+ _dataParams7.forEach(function (value, index) {
4734
+ params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
4735
+ });
4736
+
4737
+ delete params[key];
4738
+ } else if (element && key.indexOf('_selectNumberRange') >= 0) {
4739
+ // key = xxxxx_selectNumberRange qp-xxxxx-gt
4740
+ var _dataParams8 = key.split('_selectNumberRange')[0];
4741
+
4742
+ if (params[key][0] === 'range') {
4743
+ if (params[key][1][0]) {
4744
+ params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
4745
+ }
4746
+
4747
+ if (params[key][1][1]) {
4748
+ params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
4749
+ }
4750
+ } else {
4751
+ params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
4752
+ }
4753
+
4754
+ delete params[key];
4755
+ } else if (Array.isArray(element)) {
4756
+ params[key] = element.join(',');
4757
+ } else if (element == null || element === undefined || String(element).trim() === '') {
4758
+ delete params[key];
4759
+ }
4760
+ })();
4761
+ }
4762
+ }
4763
+
4764
+ var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
4765
+ pageSize: pageSize,
4766
+ currentPage: currentPage
4767
+ }, otherParams), fixedParam), params);
4768
+
4769
+ axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
4770
+ var _result3, _result4;
4771
+
4772
+ setFetching(false);
4773
+ result = result.data;
4774
+
4775
+ if (((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.status) && result.status !== '0' || ((_result4 = result) === null || _result4 === void 0 ? void 0 : _result4.code) && result.code !== '000000') {
4776
+ antd.message.error(result.msg);
4777
+ return;
4778
+ }
4779
+
4780
+ var res = result.data;
4781
+ var source = [];
4782
+
4783
+ if (isMap) {
4784
+ source = Object.keys(res).map(function (d, i) {
4785
+ return {
4786
+ text: Object.values(res)[i],
4787
+ value: d
4788
+ };
4789
+ });
4790
+ } else {
4791
+ var keys = res.list ? 'list' : 'items';
4792
+ source = res ? res[keys] ? res[keys].map(function (item) {
4793
+ var textShowText = item[mappingTextField];
4794
+
4795
+ if (mappingTextShowTextField) {
4796
+ textShowText = [];
4797
+
4798
+ if (Array.isArray(mappingTextShowTextField)) {
4799
+ mappingTextShowTextField.forEach(function (r) {
4800
+ textShowText.push(item[r]);
4801
+ });
4802
+ } else {
4803
+ textShowText = item[mappingTextShowTextField];
4804
+ }
4805
+ }
4806
+
4807
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4808
+ text: item[mappingTextField],
4809
+ textShowText: textShowText,
4810
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4811
+ value: item[mappingValueField]
4812
+ });
4813
+ }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
4814
+ var textShowText = item[mappingTextField];
4815
+
4816
+ if (mappingTextShowTextField) {
4817
+ textShowText = [];
4818
+
4819
+ if (Array.isArray(mappingTextShowTextField)) {
4820
+ mappingTextShowTextField.forEach(function (r) {
4821
+ textShowText.push(item[r]);
4822
+ });
4823
+ } else {
4824
+ textShowText = item[mappingTextShowTextField];
4825
+ }
4826
+ }
4827
+
4828
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4829
+ text: item[mappingTextField],
4830
+ textShowText: textShowText,
4831
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4832
+ value: item[mappingValueField]
4833
+ });
4834
+ })) : [];
4835
+ }
4836
+
4837
+ source = Array.isArray(source) ? source : [];
4838
+
4839
+ if (type === 1) {
4840
+ var _ctx$form;
4841
+
4842
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
4843
+ setItems(source);
4844
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
4845
+ } else {
4846
+ setTableData(source);
4847
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
4848
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
4849
+ pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
4850
+ current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
4851
+ }));
4852
+ }
4853
+ }).catch(function (err) {
4854
+ setFetching(false);
4855
+ });
4856
+ };
4857
+
4858
+ React.useEffect(function () {
4859
+ // run('init')
4860
+ Promise.all([loadSelectSource("/items/brand/queryBrandList", {
4861
+ pageSize: 5000,
4862
+ currentPage: 1,
4863
+ 'ctl-withAuth': true
4864
+ }), loadSelectSource("/items/category/queryCategoryTree", {
4865
+ pageSize: 5000,
4866
+ currentPage: 1
4867
+ })]).then(function (x) {
4868
+ formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
4869
+ formatTreeDataSource(x, 1, 3, tableSearchForm);
4870
+ });
4871
+ }, []);
4872
+ React.useEffect(function () {
4873
+ if (value) {
4874
+ setPopValue(value);
4875
+ }
4876
+ }, [value]);
4877
+ React.useEffect(function () {
4878
+ makeUniqueValue();
4879
+ }, [sourceName]);
4880
+
4881
+ var showModal = function showModal() {
4882
+ // getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
4883
+ setIsModalVisible(true); // 回显
4884
+
4885
+ if (value) {
4886
+ if (selectMode) {
4887
+ setSelectedRowKeys(labelInValue ? value.map(function (i) {
4888
+ return i.key;
4889
+ }) : value);
4890
+ setPopValue(labelInValue ? value.map(function (i) {
4891
+ return {
4892
+ value: i.key,
4893
+ text: i.label
4894
+ };
4895
+ }) : value.map(function (i) {
4896
+ return {
4897
+ value: i
4898
+ };
4899
+ }));
4900
+ setIndeterminate(!!value.length && value.length < itemsTotal);
4901
+ setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
4902
+
4903
+ if (!value.length) {
4904
+ setDoubleArr([]);
4905
+ }
4906
+ } else {
4907
+ setSelectedRowKeys(labelInValue ? [value.key] : [value]);
4908
+ setPopValue(labelInValue ? [{
4909
+ value: value.key,
4910
+ text: value.label
4911
+ }] : [{
4912
+ value: value
4913
+ }]);
4914
+ }
4915
+ }
4916
+
4917
+ setTimeout(function () {
4918
+ var _document$getElementB;
4919
+
4920
+ (_document$getElementB = document.getElementById("first-query")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
4921
+ }, 50);
4922
+ };
4923
+
4924
+ var handleOk = function handleOk(isContinue) {
4925
+ if (!popvalue.length) {
4926
+ antd.message.warning('至少选中一条数据');
4927
+ return;
4928
+ } // handleSelectOver(popvalue)
4929
+
4930
+
4931
+ if (onSaveCallback) {
4932
+ onSaveCallback(popvalue).then(function (res) {
4933
+ {
4934
+ var _document$getElementB2;
4935
+
4936
+ antd.message.success('保存成功');
4937
+ deleteSelectRows();
4938
+ (_document$getElementB2 = document.getElementById('first-query')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
4939
+ !isContinue && handleCancel();
4940
+ }
4941
+ }).catch(function (Error) {
4942
+ antd.message.error(Error);
4943
+ });
4944
+ } else {
4945
+ !isContinue && handleCancel();
4946
+ }
4947
+ };
4948
+
4949
+ var handleCancel = function handleCancel() {
4950
+ form.resetFields();
4951
+ setTableFormParams({});
4952
+ setIsModalVisible(false);
4953
+ setTableData([]); // if (selectMode) {
4954
+ // run();
4955
+ // }
4956
+ };
4957
+
4958
+ var onSearchTable = function onSearchTable() {
4959
+ var params = form.getFieldsValue();
4960
+ setTableFormParams(params);
4961
+ getData(_objectSpread2(_objectSpread2({}, params), {}, {
4962
+ pageSize: tableInitPageSize
4963
+ }), 2);
4964
+
4965
+ if (selectMode) {
4966
+ getData(params);
4967
+ }
4968
+ };
4969
+
4970
+ var onResetTable = function onResetTable() {
4971
+ form.resetFields();
4972
+ setTableFormParams({});
4973
+ getData({
4974
+ pageSize: tableInitPageSize,
4975
+ currentPage: 1
4976
+ }, 2);
4977
+ };
4978
+
4979
+ var handleTableChange = function handleTableChange(pagination) {
4980
+ getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
4981
+ pageSize: pagination.pageSize,
4982
+ currentPage: pagination.current
4983
+ }), 2);
4984
+ }; // 扁平化二维数组的方法
4985
+
4986
+ var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
4987
+ if (selectKeys.length - selectedRowKeys.length > 0) {
4988
+ if (selectKeys.length - selectedRowKeys.length === 1) {
4989
+ selectRows[selectRows.length - 1]['needFocus'] = true;
4990
+ } else {
4991
+ selectRows[selectedRowKeys.length]['needFocus'] = true;
4992
+ }
4993
+ }
4994
+
4995
+ setPopValue(selectRows);
4996
+ setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
4997
+ // setCheckedAll(filterRows.length === tablePagination?.total);
4998
+ }; // 生成唯一值
4999
+
5000
+
5001
+ var makeUniqueValue = function makeUniqueValue() {
5002
+ var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
5003
+ setUniqueValue(generateUnitKey);
5004
+ return generateUnitKey;
5005
+ };
5006
+
5007
+ var rowSelection = {
5008
+ type: 'checkbox',
5009
+ selectedRowKeys: selectedRowKeys,
5010
+ preserveSelectedRowKeys: true,
5011
+ onChange: function onChange(sks, srs) {
5012
+ onChangeSelectedKeys(sks, srs);
5013
+ },
5014
+ getCheckboxProps: function getCheckboxProps() {
5015
+ return {
5016
+ disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5017
+ };
5018
+ }
5019
+ };
5020
+
5021
+ var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
5022
+ if (!selectMode) {
5023
+ var srs = [JSON.parse(JSON.stringify(record))];
5024
+ var sks = srs.map(function (i) {
5025
+ return i.value;
5026
+ });
5027
+ onChangeSelectedKeys(sks, srs);
5028
+ }
5029
+ };
5030
+
5031
+ var themeColor = {
5032
+ color: '#005CFF'
5033
+ };
5034
+
5035
+ var formItem = function formItem(list) {
5036
+ if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
5037
+ return list.map(function (i, index) {
5038
+ var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
5039
+
5040
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
5041
+ var _i$field2, _i$initialSource;
5042
+
5043
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5044
+ name: i.name,
5045
+ label: i.label,
5046
+ key: i.name
5047
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2({
5048
+ style: {
5049
+ width: '100%'
5050
+ },
5051
+ placeholder: "\u8BF7\u9009\u62E9"
5052
+ }, i === null || i === void 0 ? void 0 : (_i$field2 = i.field) === null || _i$field2 === void 0 ? void 0 : _i$field2.props), (i === null || i === void 0 ? void 0 : (_i$initialSource = i.initialSource) === null || _i$initialSource === void 0 ? void 0 : _i$initialSource.length) && (i === null || i === void 0 ? void 0 : i.initialSource.map(function (m) {
5053
+ return /*#__PURE__*/React__default['default'].createElement(Option$1, {
5054
+ value: m.value,
5055
+ key: m.value
5056
+ }, m.text);
5057
+ }))));
5058
+ }
5059
+
5060
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'treeSelect' || (i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.type) === 'treeSelect') {
5061
+ var _i$field4;
5062
+
5063
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5064
+ name: i.name,
5065
+ label: i.label,
5066
+ key: i.name
5067
+ }, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, _objectSpread2({
5068
+ style: {
5069
+ width: '100%'
5070
+ },
5071
+ placeholder: "\u8BF7\u9009\u62E9"
5072
+ }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
5073
+ }
5074
+
5075
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'BusinessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'BusinessSearchSelect') {
5076
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5077
+ name: i.name,
5078
+ label: i.label,
5079
+ key: i.name
5080
+ }, /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
5081
+ }
5082
+
5083
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
5084
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5085
+ name: i.name,
5086
+ label: i.label,
5087
+ key: i.name
5088
+ }, /*#__PURE__*/React__default['default'].createElement(QueryMutipleInput, {
5089
+ onValueChange: function onValueChange(value) {
5090
+ form.setFieldsValue(_defineProperty({}, i.name, value));
5091
+ }
5092
+ })));
5093
+ } // 默认type是input
5094
+
5095
+
5096
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5097
+ name: i.name,
5098
+ label: i.label,
5099
+ key: i.name
5100
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2({
5101
+ id: index === 0 ? "first-query" : 'index',
5102
+ style: {
5103
+ width: '100%'
5104
+ },
5105
+ onKeyDown: function onKeyDown(e) {
5106
+ if (e.keyCode === 13) {
5107
+ onSearchTable();
5108
+ }
5109
+ },
5110
+ placeholder: "\u8BF7\u8F93\u5165",
5111
+ allowClear: true,
5112
+ maxLength: 100
5113
+ }, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
5114
+ });
5115
+ } else {
5116
+ return null;
5117
+ }
5118
+ };
5119
+
5120
+ var deleteSelectRows = function deleteSelectRows() {
5121
+ setPopValue([]);
5122
+ setSelectedRowKeys([]);
5123
+ };
5124
+
5125
+ var deleteRecord = function deleteRecord(record) {
5126
+ setPopValue(popvalue.filter(function (item) {
5127
+ return item.skuCode !== record.skuCode;
5128
+ }));
5129
+ setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
5130
+ return item !== record.skuCode;
5131
+ })));
5132
+ };
5133
+
5134
+ var inputIndex = 0;
5135
+ var selectColumns = [].concat(_toConsumableArray(modalTableProps.selectColumn.map(function (item) {
5136
+ var inputLength = modalTableProps.selectColumn.filter(function (item) {
5137
+ return item.isInputItem;
5138
+ }).length;
5139
+ var currentIndex = inputIndex;
5140
+
5141
+ if (item.isInputItem) {
5142
+ inputIndex++;
5143
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5144
+ render: function render(text, record, index) {
5145
+ // let
5146
+ if (record.needFocus === true && currentIndex === 0) ;
5147
+
5148
+ return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
5149
+ defaultValue: text || 0,
5150
+ min: 0,
5151
+ autoFocus: record.needFocus,
5152
+ keyboard: false,
5153
+ onChange: function onChange(value) {
5154
+ record[item.dataIndex] = value;
5155
+ },
5156
+ // onFocus={(e)=> {
5157
+ // let dom1 = e.currentTarget;
5158
+ // dom1.setSelectionRange(100, 0);
5159
+ // dom1.select(text);
5160
+ // }}
5161
+ onKeyDown: function onKeyDown(e) {
5162
+ if (e.keyCode === 13 && e.ctrlKey) {
5163
+ var _document$getElementB3;
5164
+
5165
+ handleOk(true);
5166
+ (_document$getElementB3 = document.getElementById("first-query")) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.focus();
5167
+ }
5168
+
5169
+ if (e.keyCode === 8 && e.ctrlKey) {
5170
+ var _e$nativeEvent$path$;
5171
+
5172
+ antd.message.success('删除当前行');
5173
+ e.stopPropagation();
5174
+ e.preventDefault();
5175
+ var dom = (_e$nativeEvent$path$ = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$ === void 0 ? void 0 : _e$nativeEvent$path$.getElementsByTagName('input')[currentIndex];
5176
+
5177
+ if (dom) {
5178
+ dom.select();
5179
+ dom.focus();
5180
+ dom.scrollIntoView(false);
5181
+ }
5182
+
5183
+ dom = null;
5184
+ deleteRecord(record);
5185
+ }
5186
+
5187
+ if (e.keyCode === 37 && e.shiftKey) {
5188
+ var _e$nativeEvent$path$2;
5189
+
5190
+ // 左滑动
5191
+ e.stopPropagation();
5192
+ e.preventDefault();
5193
+
5194
+ var _dom = (_e$nativeEvent$path$2 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$2 === void 0 ? void 0 : _e$nativeEvent$path$2.getElementsByTagName('input')[currentIndex - 1];
5195
+
5196
+ if (_dom) {
5197
+ _dom.select();
5198
+
5199
+ _dom.focus();
5200
+
5201
+ _dom.scrollIntoView(false);
5202
+ }
5203
+
5204
+ _dom = null;
5205
+ }
5206
+
5207
+ if (e.keyCode === 39 && e.shiftKey) {
5208
+ var _e$nativeEvent$path$3;
5209
+
5210
+ // 右滑
5211
+ e.stopPropagation();
5212
+ e.preventDefault();
5213
+
5214
+ var _dom2 = (_e$nativeEvent$path$3 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$3 === void 0 ? void 0 : _e$nativeEvent$path$3.getElementsByTagName('input')[currentIndex + 1];
5215
+
5216
+ if (_dom2) {
5217
+ _dom2.select();
5218
+
5219
+ _dom2.focus();
5220
+
5221
+ _dom2.scrollIntoView(false);
5222
+ }
5223
+
5224
+ _dom2 = null;
5225
+ }
5226
+
5227
+ if (e.keyCode === 40) {
5228
+ var _e$nativeEvent$path$4;
5229
+
5230
+ e.stopPropagation();
5231
+ e.preventDefault();
5232
+
5233
+ var _dom3 = (_e$nativeEvent$path$4 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$4 === void 0 ? void 0 : _e$nativeEvent$path$4.getElementsByTagName('input')[currentIndex];
5234
+
5235
+ if (_dom3) {
5236
+ _dom3.select();
5237
+
5238
+ _dom3.focus();
5239
+
5240
+ _dom3.scrollIntoView(false);
5241
+ }
5242
+
5243
+ _dom3 = null;
5244
+ } else if (e.keyCode === 38) {
5245
+ var _e$nativeEvent$path$5;
5246
+
5247
+ e.stopPropagation();
5248
+ e.preventDefault();
5249
+ var dom1 = (_e$nativeEvent$path$5 = e.nativeEvent.path[5].children[index]) === null || _e$nativeEvent$path$5 === void 0 ? void 0 : _e$nativeEvent$path$5.getElementsByTagName('input')[currentIndex];
5250
+
5251
+ if (dom1) {
5252
+ // dom1.value=""
5253
+ // dom1.setSelectionRange(100, 0);
5254
+ dom1.select();
5255
+ dom1.focus();
5256
+ dom1.scrollIntoViewIfNeeded(false); // dom1.value=record['count']
5257
+ }
5258
+
5259
+ dom1 = null;
5260
+ } else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
5261
+ e.stopPropagation();
5262
+ e.preventDefault();
5263
+ }
5264
+ }
5265
+ });
5266
+ }
5267
+ });
5268
+ }
5269
+
5270
+ return item;
5271
+ })), [{
5272
+ title: '操作',
5273
+ width: 50,
5274
+ fixed: 'right',
5275
+ render: function render(text, record, index) {
5276
+ return /*#__PURE__*/React__default['default'].createElement("span", {
5277
+ style: {
5278
+ cursor: 'pointer',
5279
+ color: '#005CFF'
5280
+ },
5281
+ onClick: function onClick() {
5282
+ deleteRecord(record);
5283
+ },
5284
+ type: "text"
5285
+ }, "\u5220\u9664");
5286
+ }
5287
+ }]);
5288
+ return /*#__PURE__*/React__default['default'].createElement("div", {
5289
+ className: 'add_select'
5290
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5291
+ className: "add_select_show",
5292
+ id: "add_select_div_".concat(uniqueValue)
5293
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5294
+ onClick: showModal,
5295
+ type: "primary"
5296
+ }, buttonText)), needModalTable && isModalVisible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
5297
+ width: '1200px',
5298
+ style: {
5299
+ top: 20
5300
+ },
5301
+ bodyStyle: {
5302
+ padding: '0px'
5303
+ },
5304
+ // title={modalTableProps?.modalTableTitle}
5305
+ visible: isModalVisible,
5306
+ onOk: handleOk,
5307
+ closable: false,
5308
+ onCancel: handleCancel,
5309
+ footer: selectMode ? [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
5310
+ key: "back",
5311
+ onClick: handleCancel
5312
+ }, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5313
+ key: "submit",
5314
+ style: {
5315
+ color: '#005CFF',
5316
+ borderColor: '#005CFF'
5317
+ },
5318
+ onClick: function onClick() {
5319
+ handleOk(true);
5320
+ },
5321
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5322
+ }, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5323
+ key: "submit",
5324
+ type: "primary",
5325
+ onClick: function onClick() {
5326
+ handleOk(false);
5327
+ },
5328
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5329
+ }, "\u786E\u5B9A")] : null
5330
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
5331
+ className: 'add_select_header'
5332
+ }, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle, /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("span", null, "*"), " \xA0\u5FEB\u6377\u952E\uFF1A\u3010Tab\u3011-\u8DF3\u683C\u5207\u6362\uFF1B\u3010Shift+\u2190\u3001\u2192\u3011-\u5F53\u524D\u884C\u5DE6\u3001\u53F3\u79FB\u52A8\uFF1B\u3010 \u2191\u3001\u2193\u3011-\u5F53\u524D\u5217\u4E0A\u3001\u4E0B\u79FB\u52A8\uFF1B\u3010ctrl+Enter\u3011-\u4FDD\u5B58\u5E76\u7EE7\u7EED\uFF1B\u3010ctrl+Delete\u3011-\u5220\u9664\u5F53\u524D\u884C\uFF1B"), /*#__PURE__*/React__default['default'].createElement("span", {
5333
+ className: 'add_select_header_close'
5334
+ }, /*#__PURE__*/React__default['default'].createElement(CloseCircleOutlined$2, {
5335
+ style: {
5336
+ fontSize: '20px'
5337
+ },
5338
+ onClick: handleCancel
5339
+ }))), /*#__PURE__*/React__default['default'].createElement("div", {
5340
+ className: 'add_select_wrapper'
5341
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5342
+ className: caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'
5343
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5344
+ className: 'select_list_columns'
5345
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5346
+ className: 'select_list_columns_formItems'
5347
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
5348
+ form: form,
5349
+ layout: 'vertical',
5350
+ key: 'modalForm'
5351
+ }, formItem(tableSearchForm)))), /*#__PURE__*/React__default['default'].createElement("div", {
5352
+ className: 'select_list_searchButton'
5353
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5354
+ key: 'reset',
5355
+ className: 'select_list_button_space',
5356
+ onClick: onResetTable
5357
+ }, "\u91CD\u7F6E"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5358
+ key: 'search',
5359
+ type: "primary",
5360
+ onClick: onSearchTable
5361
+ }, "\u67E5\u8BE2"))), /*#__PURE__*/React__default['default'].createElement("div", {
5362
+ className: caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'
5363
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
5364
+ className: 'select_list_selectTips'
5365
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5366
+ style: {
5367
+ marginLeft: 8
5368
+ }
5369
+ }, "\u641C\u7D22\u7ED3\u679C\u5171\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5370
+ style: themeColor
5371
+ }, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5372
+ style: themeColor
5373
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879") : '')), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
5374
+ size: 'small',
5375
+ rowSelection: rowSelection,
5376
+ columns: _toConsumableArray(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns),
5377
+ dataSource: tableData,
5378
+ pagination: tablePagination,
5379
+ loading: fetching,
5380
+ onChange: handleTableChange,
5381
+ rowKey: mappingValueField,
5382
+ rowClassName: 'row-class',
5383
+ scroll: {
5384
+ y: 500
5385
+ }
5386
+ })))), /*#__PURE__*/React__default['default'].createElement("div", {
5387
+ className: 'add_select_wrapper_select'
5388
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5389
+ className: 'select_list_selectTips'
5390
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5391
+ style: {
5392
+ marginLeft: 8
5393
+ }
5394
+ }, /*#__PURE__*/React__default['default'].createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5395
+ style: themeColor
5396
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879")), /*#__PURE__*/React__default['default'].createElement("div", {
5397
+ style: {
5398
+ marginRight: 8
5399
+ }
5400
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
5401
+ onClick: deleteSelectRows,
5402
+ style: _objectSpread2(_objectSpread2({}, themeColor), {}, {
5403
+ cursor: 'pointer'
5404
+ })
5405
+ }, "\u6E05\u7A7A\u6240\u9009\u5546\u54C1"))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
5406
+ size: 'small',
5407
+ // rowSelection={rowSelection}
5408
+ columns: selectColumns,
5409
+ dataSource: popvalue,
5410
+ pagination: false,
5411
+ // onChange={handleTableChange}
5412
+ rowKey: mappingValueField,
5413
+ rowClassName: 'row-class',
5414
+ scroll: {
5415
+ y: 500
5416
+ },
5417
+ onRow: function onRow(record) {
5418
+ return {
5419
+ onDoubleClick: function onDoubleClick(event) {
5420
+ return onDoubleClickSelect(event, record);
5421
+ }
5422
+ };
5423
+ }
5424
+ })))));
5425
+ };
5426
+
5427
+ var shopFileType = [{
5428
+ text: "线上",
5429
+ value: 'online'
5430
+ }, {
5431
+ text: "线下",
5432
+ value: 'offline'
5433
+ }];
5434
+ var shopFile2Type = [{
5435
+ text: "第三方线上",
5436
+ value: 'online'
5437
+ }, {
5438
+ text: "线下",
5439
+ value: 'offline'
5440
+ }, {
5441
+ text: "自营B2B",
5442
+ value: 'B2B'
5443
+ }, {
5444
+ text: "自营B2C",
5445
+ value: 'B2C'
5446
+ }];
5447
+ var arrivalPaySupportList = [{
5448
+ text: "支持",
5449
+ value: 1
5450
+ }, {
5451
+ text: "不支持",
5452
+ value: 0
5453
+ }];
5454
+ var sharingType = [{
5455
+ text: "共享",
5456
+ value: '10'
5457
+ }, {
5458
+ text: "私有",
5459
+ value: '20'
5460
+ }];
5461
+
5462
+ var getDicData = function getDicData(dicCode) {
5463
+ var dicData = {};
5464
+
5465
+ {
5466
+ var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
5467
+ dicData = storageDic[dicCode];
5468
+ } // @ts-ignore
5469
+
5470
+
5471
+ if (!dicData || !dicData.length) ;
5472
+
5473
+ return dicData;
5474
+ };
5475
+
5476
+ var getDictionarySource = function getDictionarySource(dicCode) {
5477
+ var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5478
+ var dicData = getDicData(dicCode);
5479
+
5480
+ try {
5481
+ if (needConvertInterger) {
5482
+ // @ts-ignore
5483
+ dicData = dicData.map(function (item) {
5484
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5485
+ value: parseFloat(item.value)
5486
+ });
5487
+ });
5488
+ }
5489
+ } catch (e) {}
5490
+
5491
+ return dicData;
5492
+ };
5493
+
5494
+ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
5495
+ var dicData = getDicData(dicCode);
5496
+ if (value === undefined) return ''; // @ts-ignore
5497
+
5498
+ var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
5499
+ return item.value === value.toString();
5500
+ });
5501
+
5502
+ if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
5503
+ // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
5504
+ return value;
5505
+ }
5506
+
5507
+ return dicItemArray[0].text;
5508
+ };
5509
+
5510
+ var loadSelectSource$1 = function loadSelectSource(url, params) {
5511
+ return new Promise(function (resolve, reject) {
5512
+ axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(params))).then(function (result) {
5513
+ var _result, _result2;
5514
+
5515
+ result = result.data;
5516
+
5517
+ if (((_result = result) === null || _result === void 0 ? void 0 : _result.status) && result.status !== '0' || ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.code) && result.code !== '000000') {
5518
+ antd.message.error(result.msg);
5519
+ return;
5520
+ }
5521
+
5522
+ resolve(result);
5523
+ }).catch(function (err) {
5524
+ reject(err);
5525
+ });
5526
+ });
5527
+ };
5528
+
5529
+ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
5530
+ var result;
5531
+
5532
+ switch (type) {
5533
+ case 'supplier2':
5534
+ case 'customer2':
5535
+ case 'shopFile2':
5536
+ result = '/channel-manage';
5537
+ break;
5538
+
5539
+ case 'skuCommodity':
5540
+ case 'skuPropertyValue':
5541
+ case 'spuCommodity':
5542
+ result = '/items';
5543
+ break;
5544
+
5545
+ case 'physicalWarehouse':
5546
+ case 'realWarehouse':
5547
+ case 'virtualWarehouse':
5548
+ case 'channelWarehouse':
4130
5549
  result = '/stock';
4131
5550
  break;
4132
5551
 
@@ -4295,14 +5714,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4295
5714
  label: '共享类型',
4296
5715
  initialSource: sharingTypeDataList
4297
5716
  }];
4298
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
5717
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
4299
5718
  pageSize: 5000,
4300
5719
  currentPage: 1,
4301
5720
  'qp-companyType-eq': '30'
4302
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5721
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
4303
5722
  pageSize: 5000,
4304
5723
  currentPage: 1
4305
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
5724
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
4306
5725
  pageSize: 5000,
4307
5726
  currentPage: 1,
4308
5727
  'qp-companyType-eq': '20'
@@ -4390,7 +5809,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4390
5809
  }
4391
5810
  }
4392
5811
  }];
4393
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5812
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
4394
5813
  formatSource(x, 0, 2, tableSearchForm);
4395
5814
  formatSource(x, 1, 3, tableSearchForm);
4396
5815
  });
@@ -4620,13 +6039,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4620
6039
  }
4621
6040
  }
4622
6041
  }];
4623
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
6042
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
4624
6043
  pageSize: 5000,
4625
- currentPage: 1
4626
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
6044
+ currentPage: 1,
6045
+ 'ctl-withAuth': true
6046
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
4627
6047
  pageSize: 5000,
4628
6048
  currentPage: 1
4629
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
6049
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
4630
6050
  pageSize: 5000,
4631
6051
  currentPage: 1
4632
6052
  })]).then(function (x) {
@@ -4782,13 +6202,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4782
6202
  }
4783
6203
  }
4784
6204
  }];
4785
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
6205
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
4786
6206
  pageSize: 5000,
4787
- currentPage: 1
4788
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
6207
+ currentPage: 1,
6208
+ 'ctl-withAuth': true
6209
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
4789
6210
  pageSize: 5000,
4790
6211
  currentPage: 1
4791
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
6212
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
4792
6213
  pageSize: 5000,
4793
6214
  currentPage: 1
4794
6215
  })]).then(function (x) {
@@ -4879,7 +6300,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4879
6300
  }
4880
6301
  }
4881
6302
  }];
4882
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6303
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
4883
6304
  pageSize: 5000,
4884
6305
  currentPage: 1,
4885
6306
  'qp-companyType-eq': 20
@@ -5067,14 +6488,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5067
6488
  label: '共享类型',
5068
6489
  initialSource: sharingTypeDataList
5069
6490
  }];
5070
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6491
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5071
6492
  pageSize: 5000,
5072
6493
  currentPage: 1,
5073
6494
  'qp-companyType-eq': '30'
5074
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
6495
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5075
6496
  pageSize: 5000,
5076
6497
  currentPage: 1
5077
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6498
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5078
6499
  pageSize: 5000,
5079
6500
  currentPage: 1,
5080
6501
  'qp-companyType-eq': '20'
@@ -5172,7 +6593,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5172
6593
  }
5173
6594
  }
5174
6595
  }];
5175
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
6596
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5176
6597
  formatSource(x, 0, 2, tableSearchForm);
5177
6598
  formatSource(x, 1, 3, tableSearchForm);
5178
6599
  });
@@ -5295,19 +6716,19 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5295
6716
  }
5296
6717
  }
5297
6718
  }];
5298
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6719
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5299
6720
  pageSize: 5000,
5300
6721
  currentPage: 1,
5301
6722
  'qp-companyType-eq': '30'
5302
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6723
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5303
6724
  pageSize: 5000,
5304
6725
  currentPage: 1,
5305
6726
  'qp-companyType-eq': '20'
5306
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
6727
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
5307
6728
  // pageSize: 5000,
5308
6729
  // currentPage: 1,
5309
6730
  'qp-status-eq': '1'
5310
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
6731
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5311
6732
  pageSize: 5000,
5312
6733
  currentPage: 1
5313
6734
  })]).then(function (x) {
@@ -5395,7 +6816,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5395
6816
  }
5396
6817
  }
5397
6818
  }];
5398
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
6819
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
5399
6820
  'qp-employeeCode-eq': (_JSON$parse = JSON.parse(localStorage.getItem('userInfo') || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$employeeR = _JSON$parse.employeeResVo) === null || _JSON$parse$employeeR === void 0 ? void 0 : _JSON$parse$employeeR.employeeNumber,
5400
6821
  'qp-realOrg-eq': true,
5401
6822
  'qp-status-eq': 10
@@ -5522,7 +6943,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5522
6943
  name: 'qp-officeTelephone-like',
5523
6944
  label: '手机号'
5524
6945
  }];
5525
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6946
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5526
6947
  pageSize: 5000,
5527
6948
  currentPage: 1,
5528
6949
  'qp-companyType-eq': 20
@@ -5597,7 +7018,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5597
7018
  name: 'qp-officeTelephone-like',
5598
7019
  label: '手机号'
5599
7020
  }];
5600
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
7021
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5601
7022
  formatSource(x, 0, 2, tableSearchForm);
5602
7023
  });
5603
7024
  modalTableProps = _objectSpread2({
@@ -5693,10 +7114,10 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5693
7114
  name: 'qp-remark-like',
5694
7115
  label: '备注'
5695
7116
  }];
5696
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
7117
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
5697
7118
  pageSize: 5000,
5698
7119
  currentPage: 1
5699
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
7120
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
5700
7121
  pageSize: 5000,
5701
7122
  currentPage: 1
5702
7123
  })]).then(function (x) {
@@ -5784,18 +7205,325 @@ var BusinessSearchSelect$1 = /*#__PURE__*/React__default['default'].memo(Busines
5784
7205
  return true;
5785
7206
  });
5786
7207
 
7208
+ var AddSkuSelect = function AddSkuSelect(parProps) {
7209
+ var selectProps = {
7210
+ mode: 'multiple'
7211
+ };
7212
+
7213
+ var _useState = React.useState((selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) ? [] : null),
7214
+ _useState2 = _slicedToArray(_useState, 2),
7215
+ value = _useState2[0],
7216
+ setValue = _useState2[1];
7217
+
7218
+ var props = {
7219
+ buttonText: parProps.buttonText || '新增',
7220
+ value: value,
7221
+ // labelInValue: true, // 非必填 默认为false
7222
+ requestConfig: {
7223
+ url: "/items/sku/pager/v2",
7224
+ filter: 'qp-name-like',
7225
+ otherParams: {},
7226
+ mappingTextField: 'name',
7227
+ mappingValueField: 'skuCode'
7228
+ },
7229
+ selectProps: selectProps,
7230
+ onChange: function onChange(value) {
7231
+ console.log(value);
7232
+ setValue(value);
7233
+ },
7234
+ onSaveCallback: parProps.onSaveCallback // onSaveCallback: (rows) => {
7235
+ // console.log('save call', rows);
7236
+ // // return Promise.resolve(true);
7237
+ // // return Promise.reject('FAILE')
7238
+ // }
7239
+
7240
+ };
7241
+ var modalTableProps = {
7242
+ modalTableTitle: '选择商品',
7243
+ tableSearchForm: [{
7244
+ name: 'qp-skuCode-like',
7245
+ label: 'SKU编码'
7246
+ }, {
7247
+ name: 'qp-skuName-like',
7248
+ label: 'SKU名称'
7249
+ }, {
7250
+ name: 'qp-brandId-in',
7251
+ type: 'select',
7252
+ label: '品牌',
7253
+ field: {
7254
+ type: 'select',
7255
+ props: {
7256
+ mode: 'multiple',
7257
+ notFoundContent: '暂无数据',
7258
+ allowClear: true,
7259
+ showSearch: true,
7260
+ showArrow: true,
7261
+ maxTagCount: 1,
7262
+ optionFilterProp: 'children',
7263
+ filterOption: function filterOption(input, option) {
7264
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
7265
+ }
7266
+ }
7267
+ }
7268
+ }, {
7269
+ name: 'qp-categoryId-in',
7270
+ type: 'treeSelect',
7271
+ label: '类目',
7272
+ field: {
7273
+ type: 'treeSelect',
7274
+ props: {
7275
+ treeData: [],
7276
+ treeCheckable: true,
7277
+ showSearch: true,
7278
+ allowClear: true,
7279
+ showArrow: true,
7280
+ treeNodeFilterProp: 'title',
7281
+ treeDefaultExpandAll: true,
7282
+ maxTagCount: 1,
7283
+ placeholder: '请选择',
7284
+ style: {
7285
+ width: '100%'
7286
+ },
7287
+ dropdownStyle: {
7288
+ maxHeight: 400,
7289
+ maxWidth: 100,
7290
+ overflow: 'auto'
7291
+ }
7292
+ }
7293
+ }
7294
+ }],
7295
+ tableColumns: [{
7296
+ title: 'SKU编码',
7297
+ width: 150,
7298
+ dataIndex: 'skuCode'
7299
+ }, {
7300
+ title: 'SKU名称',
7301
+ width: 200,
7302
+ ellipsis: {
7303
+ showTitle: false
7304
+ },
7305
+ render: function render(text) {
7306
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7307
+ placement: "topLeft",
7308
+ title: text
7309
+ }, text);
7310
+ },
7311
+ dataIndex: 'name'
7312
+ }, {
7313
+ title: '国际条码',
7314
+ width: 100,
7315
+ ellipsis: {
7316
+ showTitle: false
7317
+ },
7318
+ dataIndex: 'barCode',
7319
+ render: function render(text) {
7320
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7321
+ placement: "topLeft",
7322
+ title: text
7323
+ }, text);
7324
+ }
7325
+ }, {
7326
+ title: '所属SPU名称',
7327
+ width: 100,
7328
+ ellipsis: {
7329
+ showTitle: false
7330
+ },
7331
+ dataIndex: 'itemName',
7332
+ render: function render(text) {
7333
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7334
+ placement: "topLeft",
7335
+ title: text
7336
+ }, text);
7337
+ }
7338
+ }, {
7339
+ title: '所属SPU编码',
7340
+ width: 100,
7341
+ ellipsis: {
7342
+ showTitle: false
7343
+ },
7344
+ dataIndex: 'itemCode',
7345
+ render: function render(text) {
7346
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7347
+ placement: "topLeft",
7348
+ title: text
7349
+ }, text);
7350
+ }
7351
+ }, {
7352
+ title: '外部编码',
7353
+ width: 100,
7354
+ ellipsis: {
7355
+ showTitle: false
7356
+ },
7357
+ render: function render(text) {
7358
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7359
+ placement: "topLeft",
7360
+ title: text
7361
+ }, text);
7362
+ },
7363
+ dataIndex: 'externalCode'
7364
+ }, {
7365
+ title: '规格',
7366
+ width: 100,
7367
+ ellipsis: {
7368
+ showTitle: false
7369
+ },
7370
+ render: function render(text) {
7371
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7372
+ placement: "topLeft",
7373
+ title: text
7374
+ }, text);
7375
+ },
7376
+ dataIndex: 'propertyNameAndValue'
7377
+ }, {
7378
+ title: '类目',
7379
+ width: 100,
7380
+ ellipsis: {
7381
+ showTitle: false
7382
+ },
7383
+ render: function render(text) {
7384
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7385
+ placement: "topLeft",
7386
+ title: text
7387
+ }, text);
7388
+ },
7389
+ dataIndex: 'categoryName'
7390
+ }, {
7391
+ title: '品类',
7392
+ width: 100,
7393
+ ellipsis: {
7394
+ showTitle: false
7395
+ },
7396
+ render: function render(text) {
7397
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7398
+ placement: "topLeft",
7399
+ title: text
7400
+ }, text);
7401
+ },
7402
+ dataIndex: 'className'
7403
+ }, {
7404
+ title: '品牌',
7405
+ width: 100,
7406
+ ellipsis: {
7407
+ showTitle: false
7408
+ },
7409
+ render: function render(text) {
7410
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7411
+ placement: "topLeft",
7412
+ title: text
7413
+ }, text);
7414
+ },
7415
+ dataIndex: 'brandName'
7416
+ }],
7417
+ selectColumn: [{
7418
+ title: 'SKU编码',
7419
+ width: 150,
7420
+ dataIndex: 'skuCode'
7421
+ }, {
7422
+ title: 'SKU名称',
7423
+ width: 200,
7424
+ ellipsis: {
7425
+ showTitle: false
7426
+ },
7427
+ render: function render(text) {
7428
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7429
+ placement: "topLeft",
7430
+ title: text
7431
+ }, text);
7432
+ },
7433
+ dataIndex: 'name'
7434
+ }, {
7435
+ title: '数量',
7436
+ width: 100,
7437
+ isInputItem: true,
7438
+ dataIndex: 'count'
7439
+ }, {
7440
+ title: '单位',
7441
+ dataIndex: 'selectUnitCode',
7442
+ width: 80,
7443
+ ellipsis: {
7444
+ showTitle: false
7445
+ },
7446
+ render: function render(text, record) {
7447
+ var baseUnitCode = '';
7448
+
7449
+ if (record === null || record === void 0 ? void 0 : record.packingUnitList) {
7450
+ var base = record.packingUnitList.filter(function (item) {
7451
+ return item.unitCode;
7452
+ });
7453
+
7454
+ if (base.length) {
7455
+ baseUnitCode = base[0].unitCode;
7456
+ record.selectUnitCode = base[0].unitCode;
7457
+ }
7458
+ }
7459
+
7460
+ if (baseUnitCode) {
7461
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
7462
+ defaultValue: baseUnitCode,
7463
+ onChange: function onChange(value) {
7464
+ record.selectUnitCode = value;
7465
+ },
7466
+ style: {
7467
+ width: '60px'
7468
+ }
7469
+ }, record.packingUnitList && record.packingUnitList.map(function (item) {
7470
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
7471
+ value: item.unitCode
7472
+ }, item.name);
7473
+ })));
7474
+ }
7475
+
7476
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
7477
+ }
7478
+ }, {
7479
+ title: '所属SPU编码',
7480
+ width: 150,
7481
+ ellipsis: {
7482
+ showTitle: false
7483
+ },
7484
+ dataIndex: 'itemCode',
7485
+ render: function render(text) {
7486
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7487
+ placement: "topLeft",
7488
+ title: text
7489
+ }, text);
7490
+ }
7491
+ }, {
7492
+ title: '规格',
7493
+ width: 200,
7494
+ ellipsis: {
7495
+ showTitle: false
7496
+ },
7497
+ render: function render(text) {
7498
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7499
+ placement: "topLeft",
7500
+ title: text
7501
+ }, text);
7502
+ },
7503
+ dataIndex: 'propertyNameAndValue'
7504
+ }]
7505
+ };
7506
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
7507
+ modalTableProps: modalTableProps
7508
+ })));
7509
+ };
7510
+
5787
7511
  var CommodityEntry = function CommodityEntry(props) {
5788
7512
  var dataValidationRef = React.useRef();
5789
7513
  var _props$buttonName = props.buttonName,
5790
7514
  buttonName = _props$buttonName === void 0 ? ' + 录入商品' : _props$buttonName,
5791
7515
  _props$modalTitle = props.modalTitle,
5792
7516
  modalTitle = _props$modalTitle === void 0 ? '录入商品' : _props$modalTitle,
7517
+ _props$buttonProps = props.buttonProps,
7518
+ buttonProps = _props$buttonProps === void 0 ? {} : _props$buttonProps,
5793
7519
  callbackHideModal = props.callbackHideModal,
5794
7520
  callbackHandleOk = props.callbackHandleOk,
5795
7521
  _props$columns = props.columns,
5796
7522
  columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
5797
7523
  _props$validDataUrl = props.validDataUrl,
5798
- validDataUrl = _props$validDataUrl === void 0 ? "/bop/api/recordDetailImport/check" : _props$validDataUrl;
7524
+ validDataUrl = _props$validDataUrl === void 0 ? "/items/sku/import/check" : _props$validDataUrl,
7525
+ _props$isBrandAuth = props.isBrandAuth,
7526
+ isBrandAuth = _props$isBrandAuth === void 0 ? true : _props$isBrandAuth;
5799
7527
 
5800
7528
  var _useState = React.useState({
5801
7529
  maskClosable: false,
@@ -5846,9 +7574,9 @@ var CommodityEntry = function CommodityEntry(props) {
5846
7574
  modalProps.hideModal();
5847
7575
  };
5848
7576
 
5849
- return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7577
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Button, _objectSpread2({
5850
7578
  onClick: handleShowModal
5851
- }, buttonName), modalProps.visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
7579
+ }, buttonProps), buttonName), modalProps.visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
5852
7580
  onOk: handleOk,
5853
7581
  onCancel: handleCancel,
5854
7582
  destroyOnClose: true,
@@ -5858,7 +7586,8 @@ var CommodityEntry = function CommodityEntry(props) {
5858
7586
  dataValidationRef = ref;
5859
7587
  },
5860
7588
  columns: columns,
5861
- validDataUrl: validDataUrl
7589
+ validDataUrl: validDataUrl,
7590
+ isBrandAuth: isBrandAuth
5862
7591
  })) || '');
5863
7592
  };
5864
7593
 
@@ -5918,6 +7647,321 @@ function getStorageVale(storageKeyString) {
5918
7647
  return "";
5919
7648
  }
5920
7649
 
7650
+ var TreeSearchSelect = function TreeSearchSelect(props) {
7651
+ var _useState = React.useState([]),
7652
+ _useState2 = _slicedToArray(_useState, 2),
7653
+ treeData = _useState2[0],
7654
+ setTreeData = _useState2[1];
7655
+
7656
+ var ctx = props.ctx,
7657
+ value = props.value,
7658
+ valueName = props.valueName,
7659
+ onChange = props.onChange,
7660
+ onChangeName = props.onChangeName,
7661
+ placeholder = props.placeholder,
7662
+ remoteSource = props.remoteSource,
7663
+ initialValue = props.initialValue,
7664
+ _props$treeCheckable = props.treeCheckable,
7665
+ treeCheckable = _props$treeCheckable === void 0 ? false : _props$treeCheckable,
7666
+ _props$showSearch = props.showSearch,
7667
+ showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
7668
+ _props$maxTagCount = props.maxTagCount,
7669
+ maxTagCount = _props$maxTagCount === void 0 ? 1 : _props$maxTagCount,
7670
+ _props$multiple = props.multiple,
7671
+ multiple = _props$multiple === void 0 ? false : _props$multiple,
7672
+ _props$isChoose = props.isChoose,
7673
+ isChoose = _props$isChoose === void 0 ? false : _props$isChoose,
7674
+ mode = props.mode,
7675
+ _getPopupContainer = props.getPopupContainer,
7676
+ _props$labelInValue = props.labelInValue,
7677
+ labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
7678
+ _props$showArrow = props.showArrow,
7679
+ showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
7680
+ _props$allowClear = props.allowClear,
7681
+ allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
7682
+ _props$showCheckedStr = props.showCheckedStrategy,
7683
+ showCheckedStrategy = _props$showCheckedStr === void 0 ? antd.TreeSelect.SHOW_PARENT : _props$showCheckedStr,
7684
+ _props$style = props.style,
7685
+ style = _props$style === void 0 ? {
7686
+ width: '100%'
7687
+ } : _props$style,
7688
+ getTreeData = props.getTreeData;
7689
+ var url = remoteSource.url,
7690
+ _remoteSource$paramsK = remoteSource.paramsKey,
7691
+ paramsKey = _remoteSource$paramsK === void 0 ? 'qp-name-like' : _remoteSource$paramsK,
7692
+ _remoteSource$resKeyV = remoteSource.resKeyValue,
7693
+ resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
7694
+ _remoteSource$initial = remoteSource.initialParams,
7695
+ initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
7696
+
7697
+ var mapSearchTree = function mapSearchTree(treeDataItem) {
7698
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
7699
+ return {
7700
+ title: treeDataItem[resKeyValue[1]],
7701
+ key: treeDataItem[resKeyValue[0]],
7702
+ value: treeDataItem[resKeyValue[0]],
7703
+ parentId: treeDataItem.parent,
7704
+ data: _objectSpread2({}, treeDataItem),
7705
+ isLeaf: !haveChildren,
7706
+ disabled: isDisabled(haveChildren),
7707
+ children: haveChildren ? treeDataItem.children.map(function (i) {
7708
+ return mapSearchTree(i);
7709
+ }) : []
7710
+ };
7711
+ };
7712
+
7713
+ var isDisabled = function isDisabled(children) {
7714
+ if (isChoose) {
7715
+ return false;
7716
+ }
7717
+
7718
+ return children;
7719
+ };
7720
+ /* 实时查询 但是目前用的直接是完整数据源, 所以没有使用 */
7721
+
7722
+
7723
+ var handleSearch = function handleSearch(q) {
7724
+ var paramsData = _objectSpread2(_defineProperty({}, "".concat(paramsKey), q), initialParams);
7725
+
7726
+ axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(paramsData))).then( /*#__PURE__*/function () {
7727
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
7728
+ var _ctx$form;
7729
+
7730
+ var resData, coverData, data, dataList;
7731
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7732
+ while (1) {
7733
+ switch (_context.prev = _context.next) {
7734
+ case 0:
7735
+ resData = (res === null || res === void 0 ? void 0 : res.data) || [];
7736
+
7737
+ if (!(resData.status === '0')) {
7738
+ _context.next = 13;
7739
+ break;
7740
+ }
7741
+
7742
+ data = resData.data;
7743
+
7744
+ if (!remoteSource.converter) {
7745
+ _context.next = 9;
7746
+ break;
7747
+ }
7748
+
7749
+ _context.next = 6;
7750
+ return remoteSource.converter({
7751
+ data: [data]
7752
+ });
7753
+
7754
+ case 6:
7755
+ coverData = _context.sent;
7756
+ _context.next = 11;
7757
+ break;
7758
+
7759
+ case 9:
7760
+ dataList = data && Array.isArray(data) ? data : data && [data] || [];
7761
+ coverData = dataList.length && dataList.map(function (ites) {
7762
+ return mapSearchTree(ites);
7763
+ }) || [];
7764
+
7765
+ case 11:
7766
+ _context.next = 14;
7767
+ break;
7768
+
7769
+ case 13:
7770
+ coverData = [];
7771
+
7772
+ case 14:
7773
+ setTreeData(coverData);
7774
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(ctx.name, coverData);
7775
+
7776
+ case 16:
7777
+ case "end":
7778
+ return _context.stop();
7779
+ }
7780
+ }
7781
+ }, _callee);
7782
+ }));
7783
+
7784
+ return function (_x) {
7785
+ return _ref.apply(this, arguments);
7786
+ };
7787
+ }());
7788
+ };
7789
+
7790
+ var handleChange = function handleChange(data, dataName) {
7791
+ var _ctx$form2;
7792
+
7793
+ onChange(data);
7794
+ onChangeName && onChangeName(dataName);
7795
+ getTreeData && getTreeData(treeData); // 把树节点暴露出去
7796
+
7797
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
7798
+ };
7799
+
7800
+ React.useEffect(function () {
7801
+ handleSearch(initialValue);
7802
+ }, []);
7803
+
7804
+ var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
7805
+ var _onClose = function onClose(e, item) {
7806
+ e.preventDefault();
7807
+ var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
7808
+ return i.value !== item.value;
7809
+ }) : JSON.parse(JSON.stringify(value)).filter(function (i) {
7810
+ return i !== item.value;
7811
+ });
7812
+ var newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter(function (i) {
7813
+ return i !== item.label;
7814
+ });
7815
+ handleChange(newValue, newValueName);
7816
+ };
7817
+
7818
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7819
+ title: selectedValues.map(function (i) {
7820
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tag, {
7821
+ closable: true,
7822
+ onClose: function onClose(e) {
7823
+ return _onClose(e, i);
7824
+ },
7825
+ style: {
7826
+ marginRight: 3,
7827
+ background: '#f5f5f5',
7828
+ height: '24px',
7829
+ border: '1px solid #f0f0f0'
7830
+ }
7831
+ }, i.label);
7832
+ })
7833
+ }, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
7834
+ };
7835
+
7836
+ return /*#__PURE__*/React__default['default'].createElement("div", {
7837
+ className: 'tree_search_select'
7838
+ }, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, {
7839
+ treeCheckable: treeCheckable,
7840
+ maxTagCount: maxTagCount,
7841
+ showSearch: showSearch,
7842
+ style: style,
7843
+ value: value,
7844
+ dropdownStyle: {
7845
+ maxHeight: 400,
7846
+ maxWidth: 100,
7847
+ overflow: 'auto'
7848
+ },
7849
+ treeData: treeData,
7850
+ placeholder: placeholder,
7851
+ allowClear: allowClear,
7852
+ labelInValue: labelInValue,
7853
+ showArrow: showArrow,
7854
+ showCheckedStrategy: showCheckedStrategy,
7855
+ treeNodeFilterProp: 'title',
7856
+ treeDefaultExpandAll: true,
7857
+ multiple: multiple,
7858
+ maxTagPlaceholder: maxTagPlaceholder,
7859
+ onChange: handleChange,
7860
+ disabled: mode === 'view' || (ctx === null || ctx === void 0 ? void 0 : ctx.mode) === 'view',
7861
+ getPopupContainer: function getPopupContainer() {
7862
+ return _getPopupContainer && _getPopupContainer() || document.body;
7863
+ }
7864
+ }));
7865
+ };
7866
+
7867
+ var handleDefaultProps = function handleDefaultProps(type) {
7868
+ var result = {};
7869
+
7870
+ switch (type) {
7871
+ case 'department':
7872
+ result = {
7873
+ treeCheckable: true,
7874
+ isChoose: true,
7875
+ remoteSource: {
7876
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7877
+ initialParams: {
7878
+ 'orgViewCode': 'administrative-organization-view'
7879
+ },
7880
+ resKeyValue: ['code', 'name']
7881
+ }
7882
+ };
7883
+ break;
7884
+
7885
+ case 'sales-organization':
7886
+ result = {
7887
+ isChoose: true,
7888
+ remoteSource: {
7889
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7890
+ initialParams: {
7891
+ 'orgViewCode': 'sales-organizational-view'
7892
+ },
7893
+ resKeyValue: ['code', 'name']
7894
+ }
7895
+ };
7896
+ break;
7897
+
7898
+ case 'purchase-organization':
7899
+ result = {
7900
+ isChoose: true,
7901
+ remoteSource: {
7902
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7903
+ initialParams: {
7904
+ 'orgViewCode': 'purchase-organizational-view'
7905
+ },
7906
+ resKeyValue: ['code', 'name']
7907
+ }
7908
+ };
7909
+ break;
7910
+
7911
+ case 'stock-organization':
7912
+ result = {
7913
+ isChoose: true,
7914
+ remoteSource: {
7915
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7916
+ initialParams: {
7917
+ 'orgViewCode': 'stock-organizational-view'
7918
+ },
7919
+ resKeyValue: ['code', 'name']
7920
+ }
7921
+ };
7922
+ break;
7923
+
7924
+ default:
7925
+ result = {
7926
+ treeCheckable: true,
7927
+ isChoose: true,
7928
+ remoteSource: {
7929
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7930
+ initialParams: {
7931
+ 'orgViewCode': 'administrative-organization-view'
7932
+ },
7933
+ resKeyValue: ['code', 'name']
7934
+ }
7935
+ };
7936
+ break;
7937
+ }
7938
+
7939
+ return result;
7940
+ };
7941
+
7942
+ var MemoTreeSearchSelect = /*#__PURE__*/React__default['default'].memo(TreeSearchSelect);
7943
+
7944
+ var BusinessTreeSearchSelect = function BusinessTreeSearchSelect(props) {
7945
+ var businessType = (props === null || props === void 0 ? void 0 : props.businessType) || 'department';
7946
+ var handleBusinessProps = handleDefaultProps(businessType);
7947
+ var currentProps = React.useMemo(function () {
7948
+ return _objectSpread2(_objectSpread2({}, handleBusinessProps), props);
7949
+ }, [props === null || props === void 0 ? void 0 : props.value]);
7950
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(MemoTreeSearchSelect, _objectSpread2({}, currentProps)));
7951
+ };
7952
+
7953
+ var index$1 = /*#__PURE__*/React__default['default'].memo(BusinessTreeSearchSelect, function (props, nextProps) {
7954
+ if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
7955
+ return false;
7956
+ }
7957
+
7958
+ if (props && props.value !== nextProps.value) {
7959
+ return false;
7960
+ }
7961
+
7962
+ return true;
7963
+ });
7964
+
5921
7965
  /*
5922
7966
  * @Description:
5923
7967
  * @Author: rodchen
@@ -5930,10 +7974,19 @@ var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
5930
7974
  axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
5931
7975
  axios__default['default'].defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
5932
7976
 
7977
+ if (localStorage.getItem('x-user-auth-context')) {
7978
+ // @ts-ignore
7979
+ axios__default['default'].defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
7980
+ }
7981
+
7982
+ exports.AddSelect = AddSelect;
7983
+ exports.AddSkuSelect = AddSkuSelect;
5933
7984
  exports.BusinessSearchSelect = BusinessSearchSelect$1;
7985
+ exports.BusinessTreeSearchSelect = index$1;
5934
7986
  exports.CheckOneUser = index;
5935
7987
  exports.CommodityEntry = CommodityEntry;
5936
7988
  exports.DataImport = DataImport;
5937
7989
  exports.DataValidation = DataValidation;
5938
7990
  exports.QueryMutipleInput = QueryMutipleInput;
5939
7991
  exports.SearchSelect = SearchSelect;
7992
+ exports.TreeSearchSelect = TreeSearchSelect;