@bit-sun/business-component 1.2.3 → 2.0.2

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 (30) hide show
  1. package/.umirc.ts +31 -16
  2. package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
  3. package/dist/components/Business/SearchSelect/common.d.ts +5 -1
  4. package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
  5. package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
  6. package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
  7. package/dist/components/Functional/AddSelect/index.d.ts +3 -0
  8. package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
  9. package/dist/index.d.ts +3 -0
  10. package/dist/index.esm.js +1876 -89
  11. package/dist/index.js +1877 -87
  12. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/src/components/Business/CommodityEntry/index.md +2 -2
  15. package/src/components/Business/CommodityEntry/index.tsx +1 -1
  16. package/src/components/Business/SearchSelect/BusinessUtils.ts +85 -6
  17. package/src/components/Business/SearchSelect/common.ts +20 -1
  18. package/src/components/Business/SearchSelect/index.md +60 -30
  19. package/src/components/Business/SearchSelect/index.tsx +2 -1
  20. package/src/components/Business/SearchSelect/utils.ts +27 -2
  21. package/src/components/Business/TreeSearchSelect/index.md +126 -0
  22. package/src/components/Business/TreeSearchSelect/index.tsx +34 -0
  23. package/src/components/Business/TreeSearchSelect/utils.ts +60 -0
  24. package/src/components/Functional/AddSelect/index.less +275 -0
  25. package/src/components/Functional/AddSelect/index.md +118 -0
  26. package/src/components/Functional/AddSelect/index.tsx +795 -0
  27. package/src/components/Functional/SearchSelect/index.tsx +24 -7
  28. package/src/components/Functional/TreeSearchSelect/index.md +47 -0
  29. package/src/components/Functional/TreeSearchSelect/index.tsx +148 -0
  30. package/src/index.ts +8 -0
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import React, { createContext, useContext, useEffect, forwardRef, createElement, useState, useMemo, useRef } from 'react';
3
- import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag } from 'antd';
3
+ import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, InputNumber } from 'antd';
4
4
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
5
5
  import classNames from 'classnames';
6
6
  import _ from 'loadsh';
@@ -33,6 +33,387 @@ function _objectSpread2(target) {
33
33
  return target;
34
34
  }
35
35
 
36
+ function _regeneratorRuntime() {
37
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
38
+
39
+ _regeneratorRuntime = function () {
40
+ return exports;
41
+ };
42
+
43
+ var exports = {},
44
+ Op = Object.prototype,
45
+ hasOwn = Op.hasOwnProperty,
46
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
47
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
48
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
49
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
50
+
51
+ function define(obj, key, value) {
52
+ return Object.defineProperty(obj, key, {
53
+ value: value,
54
+ enumerable: !0,
55
+ configurable: !0,
56
+ writable: !0
57
+ }), obj[key];
58
+ }
59
+
60
+ try {
61
+ define({}, "");
62
+ } catch (err) {
63
+ define = function (obj, key, value) {
64
+ return obj[key] = value;
65
+ };
66
+ }
67
+
68
+ function wrap(innerFn, outerFn, self, tryLocsList) {
69
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
70
+ generator = Object.create(protoGenerator.prototype),
71
+ context = new Context(tryLocsList || []);
72
+ return generator._invoke = function (innerFn, self, context) {
73
+ var state = "suspendedStart";
74
+ return function (method, arg) {
75
+ if ("executing" === state) throw new Error("Generator is already running");
76
+
77
+ if ("completed" === state) {
78
+ if ("throw" === method) throw arg;
79
+ return doneResult();
80
+ }
81
+
82
+ for (context.method = method, context.arg = arg;;) {
83
+ var delegate = context.delegate;
84
+
85
+ if (delegate) {
86
+ var delegateResult = maybeInvokeDelegate(delegate, context);
87
+
88
+ if (delegateResult) {
89
+ if (delegateResult === ContinueSentinel) continue;
90
+ return delegateResult;
91
+ }
92
+ }
93
+
94
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
95
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
96
+ context.dispatchException(context.arg);
97
+ } else "return" === context.method && context.abrupt("return", context.arg);
98
+ state = "executing";
99
+ var record = tryCatch(innerFn, self, context);
100
+
101
+ if ("normal" === record.type) {
102
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
103
+ return {
104
+ value: record.arg,
105
+ done: context.done
106
+ };
107
+ }
108
+
109
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
110
+ }
111
+ };
112
+ }(innerFn, self, context), generator;
113
+ }
114
+
115
+ function tryCatch(fn, obj, arg) {
116
+ try {
117
+ return {
118
+ type: "normal",
119
+ arg: fn.call(obj, arg)
120
+ };
121
+ } catch (err) {
122
+ return {
123
+ type: "throw",
124
+ arg: err
125
+ };
126
+ }
127
+ }
128
+
129
+ exports.wrap = wrap;
130
+ var ContinueSentinel = {};
131
+
132
+ function Generator() {}
133
+
134
+ function GeneratorFunction() {}
135
+
136
+ function GeneratorFunctionPrototype() {}
137
+
138
+ var IteratorPrototype = {};
139
+ define(IteratorPrototype, iteratorSymbol, function () {
140
+ return this;
141
+ });
142
+ var getProto = Object.getPrototypeOf,
143
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
144
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
145
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
146
+
147
+ function defineIteratorMethods(prototype) {
148
+ ["next", "throw", "return"].forEach(function (method) {
149
+ define(prototype, method, function (arg) {
150
+ return this._invoke(method, arg);
151
+ });
152
+ });
153
+ }
154
+
155
+ function AsyncIterator(generator, PromiseImpl) {
156
+ function invoke(method, arg, resolve, reject) {
157
+ var record = tryCatch(generator[method], generator, arg);
158
+
159
+ if ("throw" !== record.type) {
160
+ var result = record.arg,
161
+ value = result.value;
162
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
163
+ invoke("next", value, resolve, reject);
164
+ }, function (err) {
165
+ invoke("throw", err, resolve, reject);
166
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
167
+ result.value = unwrapped, resolve(result);
168
+ }, function (error) {
169
+ return invoke("throw", error, resolve, reject);
170
+ });
171
+ }
172
+
173
+ reject(record.arg);
174
+ }
175
+
176
+ var previousPromise;
177
+
178
+ this._invoke = function (method, arg) {
179
+ function callInvokeWithMethodAndArg() {
180
+ return new PromiseImpl(function (resolve, reject) {
181
+ invoke(method, arg, resolve, reject);
182
+ });
183
+ }
184
+
185
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
186
+ };
187
+ }
188
+
189
+ function maybeInvokeDelegate(delegate, context) {
190
+ var method = delegate.iterator[context.method];
191
+
192
+ if (undefined === method) {
193
+ if (context.delegate = null, "throw" === context.method) {
194
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
195
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
196
+ }
197
+
198
+ return ContinueSentinel;
199
+ }
200
+
201
+ var record = tryCatch(method, delegate.iterator, context.arg);
202
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
203
+ var info = record.arg;
204
+ 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);
205
+ }
206
+
207
+ function pushTryEntry(locs) {
208
+ var entry = {
209
+ tryLoc: locs[0]
210
+ };
211
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
212
+ }
213
+
214
+ function resetTryEntry(entry) {
215
+ var record = entry.completion || {};
216
+ record.type = "normal", delete record.arg, entry.completion = record;
217
+ }
218
+
219
+ function Context(tryLocsList) {
220
+ this.tryEntries = [{
221
+ tryLoc: "root"
222
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
223
+ }
224
+
225
+ function values(iterable) {
226
+ if (iterable) {
227
+ var iteratorMethod = iterable[iteratorSymbol];
228
+ if (iteratorMethod) return iteratorMethod.call(iterable);
229
+ if ("function" == typeof iterable.next) return iterable;
230
+
231
+ if (!isNaN(iterable.length)) {
232
+ var i = -1,
233
+ next = function next() {
234
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
235
+
236
+ return next.value = undefined, next.done = !0, next;
237
+ };
238
+
239
+ return next.next = next;
240
+ }
241
+ }
242
+
243
+ return {
244
+ next: doneResult
245
+ };
246
+ }
247
+
248
+ function doneResult() {
249
+ return {
250
+ value: undefined,
251
+ done: !0
252
+ };
253
+ }
254
+
255
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
256
+ var ctor = "function" == typeof genFun && genFun.constructor;
257
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
258
+ }, exports.mark = function (genFun) {
259
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
260
+ }, exports.awrap = function (arg) {
261
+ return {
262
+ __await: arg
263
+ };
264
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
265
+ return this;
266
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
267
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
268
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
269
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
270
+ return result.done ? result.value : iter.next();
271
+ });
272
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
273
+ return this;
274
+ }), define(Gp, "toString", function () {
275
+ return "[object Generator]";
276
+ }), exports.keys = function (object) {
277
+ var keys = [];
278
+
279
+ for (var key in object) keys.push(key);
280
+
281
+ return keys.reverse(), function next() {
282
+ for (; keys.length;) {
283
+ var key = keys.pop();
284
+ if (key in object) return next.value = key, next.done = !1, next;
285
+ }
286
+
287
+ return next.done = !0, next;
288
+ };
289
+ }, exports.values = values, Context.prototype = {
290
+ constructor: Context,
291
+ reset: function (skipTempReset) {
292
+ 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);
293
+ },
294
+ stop: function () {
295
+ this.done = !0;
296
+ var rootRecord = this.tryEntries[0].completion;
297
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
298
+ return this.rval;
299
+ },
300
+ dispatchException: function (exception) {
301
+ if (this.done) throw exception;
302
+ var context = this;
303
+
304
+ function handle(loc, caught) {
305
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
306
+ }
307
+
308
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
309
+ var entry = this.tryEntries[i],
310
+ record = entry.completion;
311
+ if ("root" === entry.tryLoc) return handle("end");
312
+
313
+ if (entry.tryLoc <= this.prev) {
314
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
315
+ hasFinally = hasOwn.call(entry, "finallyLoc");
316
+
317
+ if (hasCatch && hasFinally) {
318
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
319
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
320
+ } else if (hasCatch) {
321
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
322
+ } else {
323
+ if (!hasFinally) throw new Error("try statement without catch or finally");
324
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
325
+ }
326
+ }
327
+ }
328
+ },
329
+ abrupt: function (type, arg) {
330
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
331
+ var entry = this.tryEntries[i];
332
+
333
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
334
+ var finallyEntry = entry;
335
+ break;
336
+ }
337
+ }
338
+
339
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
340
+ var record = finallyEntry ? finallyEntry.completion : {};
341
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
342
+ },
343
+ complete: function (record, afterLoc) {
344
+ if ("throw" === record.type) throw record.arg;
345
+ 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;
346
+ },
347
+ finish: function (finallyLoc) {
348
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
349
+ var entry = this.tryEntries[i];
350
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
351
+ }
352
+ },
353
+ catch: function (tryLoc) {
354
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
355
+ var entry = this.tryEntries[i];
356
+
357
+ if (entry.tryLoc === tryLoc) {
358
+ var record = entry.completion;
359
+
360
+ if ("throw" === record.type) {
361
+ var thrown = record.arg;
362
+ resetTryEntry(entry);
363
+ }
364
+
365
+ return thrown;
366
+ }
367
+ }
368
+
369
+ throw new Error("illegal catch attempt");
370
+ },
371
+ delegateYield: function (iterable, resultName, nextLoc) {
372
+ return this.delegate = {
373
+ iterator: values(iterable),
374
+ resultName: resultName,
375
+ nextLoc: nextLoc
376
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
377
+ }
378
+ }, exports;
379
+ }
380
+
381
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
382
+ try {
383
+ var info = gen[key](arg);
384
+ var value = info.value;
385
+ } catch (error) {
386
+ reject(error);
387
+ return;
388
+ }
389
+
390
+ if (info.done) {
391
+ resolve(value);
392
+ } else {
393
+ Promise.resolve(value).then(_next, _throw);
394
+ }
395
+ }
396
+
397
+ function _asyncToGenerator(fn) {
398
+ return function () {
399
+ var self = this,
400
+ args = arguments;
401
+ return new Promise(function (resolve, reject) {
402
+ var gen = fn.apply(self, args);
403
+
404
+ function _next(value) {
405
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
406
+ }
407
+
408
+ function _throw(err) {
409
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
410
+ }
411
+
412
+ _next(undefined);
413
+ });
414
+ };
415
+ }
416
+
36
417
  function _classCallCheck(instance, Constructor) {
37
418
  if (!(instance instanceof Constructor)) {
38
419
  throw new TypeError("Cannot call a class as a function");
@@ -92,18 +473,17 @@ function _inherits(subClass, superClass) {
92
473
  }
93
474
 
94
475
  function _getPrototypeOf(o) {
95
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
476
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
96
477
  return o.__proto__ || Object.getPrototypeOf(o);
97
478
  };
98
479
  return _getPrototypeOf(o);
99
480
  }
100
481
 
101
482
  function _setPrototypeOf(o, p) {
102
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
483
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
103
484
  o.__proto__ = p;
104
485
  return o;
105
486
  };
106
-
107
487
  return _setPrototypeOf(o, p);
108
488
  }
109
489
 
@@ -1541,6 +1921,19 @@ var CaretLeftOutlined$1 = function CaretLeftOutlined$1(props, ref) {
1541
1921
  CaretLeftOutlined$1.displayName = 'CaretLeftOutlined';
1542
1922
  var CaretLeftOutlined$2 = /*#__PURE__*/forwardRef(CaretLeftOutlined$1);
1543
1923
 
1924
+ // This icon file is generated automatically.
1925
+ 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" };
1926
+
1927
+ var CloseCircleOutlined$1 = function CloseCircleOutlined$1(props, ref) {
1928
+ return /*#__PURE__*/createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
1929
+ ref: ref,
1930
+ icon: CloseCircleOutlined
1931
+ }));
1932
+ };
1933
+
1934
+ CloseCircleOutlined$1.displayName = 'CloseCircleOutlined';
1935
+ var CloseCircleOutlined$2 = /*#__PURE__*/forwardRef(CloseCircleOutlined$1);
1936
+
1544
1937
  // This icon file is generated automatically.
1545
1938
  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" };
1546
1939
 
@@ -3072,6 +3465,7 @@ var SearchSelect = function SearchSelect(props) {
3072
3465
 
3073
3466
  var currentPage = 1;
3074
3467
  var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
3468
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
3075
3469
 
3076
3470
  var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
3077
3471
  // 以下属性不可更改----设计配置项
@@ -3128,7 +3522,7 @@ var SearchSelect = function SearchSelect(props) {
3128
3522
  var searchParams = {};
3129
3523
 
3130
3524
  if (typeof selectParamsKey === 'string') {
3131
- searchParams = _defineProperty({}, selectParamsKey, v ? initVal : searchValue);
3525
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
3132
3526
  }
3133
3527
 
3134
3528
  if (Array.isArray(selectParamsKey)) {
@@ -3138,7 +3532,6 @@ var SearchSelect = function SearchSelect(props) {
3138
3532
  } // 防抖函数 待定
3139
3533
 
3140
3534
 
3141
- // 防抖函数 待定
3142
3535
  getData(searchParams);
3143
3536
  }, {
3144
3537
  wait: 1000
@@ -3323,10 +3716,12 @@ var SearchSelect = function SearchSelect(props) {
3323
3716
  }, otherParams), fixedParam), params);
3324
3717
 
3325
3718
  axios.get("".concat(url, "?").concat(stringify(queryParams))).then(function (result) {
3719
+ var _result, _result2;
3720
+
3326
3721
  setFetching(false);
3327
3722
  result = result.data;
3328
3723
 
3329
- if (result.status !== '0') {
3724
+ 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') {
3330
3725
  message.error(result.msg);
3331
3726
  return;
3332
3727
  }
@@ -3448,7 +3843,6 @@ var SearchSelect = function SearchSelect(props) {
3448
3843
  useEffect(function () {
3449
3844
  if (value) {
3450
3845
  setPopValue(value);
3451
- onChange(value);
3452
3846
  }
3453
3847
  }, [value]);
3454
3848
  useEffect(function () {
@@ -3517,9 +3911,9 @@ var SearchSelect = function SearchSelect(props) {
3517
3911
  if (labelInValue) {
3518
3912
  var formatResult = value.map(function (i) {
3519
3913
  return {
3520
- key: i.code,
3521
- label: i.name,
3522
- value: i.code
3914
+ key: i[mappingValueField],
3915
+ label: i[mappingTextField],
3916
+ value: i[mappingValueField]
3523
3917
  };
3524
3918
  });
3525
3919
  onChange(selectMode ? formatResult : formatResult[0]);
@@ -3698,6 +4092,11 @@ var SearchSelect = function SearchSelect(props) {
3698
4092
  selectedRowKeys: selectedRowKeys,
3699
4093
  onChange: function onChange(sks, srs) {
3700
4094
  onChangeSelectedKeys(sks, srs);
4095
+ },
4096
+ getCheckboxProps: function getCheckboxProps() {
4097
+ return {
4098
+ disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
4099
+ };
3701
4100
  }
3702
4101
  };
3703
4102
 
@@ -3718,7 +4117,7 @@ var SearchSelect = function SearchSelect(props) {
3718
4117
  var formItem = function formItem(list) {
3719
4118
  if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
3720
4119
  return list.map(function (i) {
3721
- var _i$field, _i$field3, _i$field5;
4120
+ var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
3722
4121
 
3723
4122
  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') {
3724
4123
  var _i$field2, _i$initialSource;
@@ -3755,12 +4154,24 @@ var SearchSelect = function SearchSelect(props) {
3755
4154
  }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
3756
4155
  }
3757
4156
 
3758
- if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect') {
4157
+ 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') {
3759
4158
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
3760
4159
  name: i.name,
3761
4160
  label: i.label,
3762
4161
  key: i.name
3763
4162
  }, /*#__PURE__*/React.createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
4163
+ }
4164
+
4165
+ 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') {
4166
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
4167
+ name: i.name,
4168
+ label: i.label,
4169
+ key: i.name
4170
+ }, /*#__PURE__*/React.createElement(QueryMutipleInput, {
4171
+ onValueChange: function onValueChange(value) {
4172
+ form.setFieldsValue(_defineProperty({}, i.name, value));
4173
+ }
4174
+ })));
3764
4175
  } // 默认type是input
3765
4176
 
3766
4177
 
@@ -3775,7 +4186,7 @@ var SearchSelect = function SearchSelect(props) {
3775
4186
  placeholder: "\u8BF7\u8F93\u5165",
3776
4187
  allowClear: true,
3777
4188
  maxLength: 100
3778
- }, i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.props)));
4189
+ }, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
3779
4190
  });
3780
4191
  } else {
3781
4192
  return null;
@@ -3970,88 +4381,1013 @@ var SearchSelect = function SearchSelect(props) {
3970
4381
  }, /*#__PURE__*/React.createElement(Checkbox, {
3971
4382
  indeterminate: indeterminate,
3972
4383
  checked: checkedAll,
3973
- onChange: onChangeCheckAll
4384
+ onChange: onChangeCheckAll,
4385
+ disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3974
4386
  }), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
3975
4387
  };
3976
4388
 
3977
- var shopFileType = [{
3978
- text: "线上",
3979
- value: 'online'
3980
- }, {
3981
- text: "线下",
3982
- value: 'offline'
3983
- }];
3984
- var arrivalPaySupportList = [{
3985
- text: "支持",
3986
- value: 1
3987
- }, {
3988
- text: "不支持",
3989
- value: 0
3990
- }];
3991
- var sharingType = [{
3992
- text: "共享",
3993
- value: '10'
3994
- }, {
3995
- text: "私有",
3996
- value: '20'
3997
- }];
3998
-
3999
- var getDicData = function getDicData(dicCode) {
4000
- var dicData = {};
4001
-
4002
- {
4003
- var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
4004
- dicData = storageDic[dicCode];
4005
- } // @ts-ignore
4389
+ 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-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: 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";
4390
+ styleInject(css_248z$4);
4006
4391
 
4392
+ var Option$1 = Select.Option;
4007
4393
 
4008
- if (!dicData || !dicData.length) ;
4394
+ var AddSelect = function AddSelect(props) {
4395
+ var value = props.value,
4396
+ onChange = props.onChange,
4397
+ _props$selectProps = props.selectProps,
4398
+ selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
4399
+ _props$modalTableProp = props.modalTableProps,
4400
+ modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
4401
+ _props$labelInValue = props.labelInValue,
4402
+ labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
4403
+ requestConfig = props.requestConfig,
4404
+ ctx = props.ctx,
4405
+ sourceName = props.sourceName,
4406
+ _props$needModalTable = props.needModalTable,
4407
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4408
+ _props$getPopupContai = props.getPopupContainer,
4409
+ onSaveCallback = props.onSaveCallback;
4009
4410
 
4010
- return dicData;
4011
- };
4411
+ var _ref = requestConfig || {},
4412
+ url = _ref.url,
4413
+ otherParams = _ref.otherParams,
4414
+ isMap = _ref.isMap,
4415
+ fixedparameter = _ref.fixedparameter,
4416
+ fieldValToParam = _ref.fieldValToParam,
4417
+ _ref$mappingTextField = _ref.mappingTextField,
4418
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
4419
+ mappingTextShowKeyField = _ref.mappingTextShowKeyField,
4420
+ _ref$mappingValueFiel = _ref.mappingValueField,
4421
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
4422
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
4012
4423
 
4013
- var getDictionarySource = function getDictionarySource(dicCode) {
4014
- var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4015
- var dicData = getDicData(dicCode);
4424
+ var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
4425
+ var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
4016
4426
 
4017
- try {
4018
- if (needConvertInterger) {
4019
- // @ts-ignore
4020
- dicData = dicData.map(function (item) {
4021
- return _objectSpread2(_objectSpread2({}, item), {}, {
4022
- value: parseFloat(item.value)
4023
- });
4024
- });
4025
- }
4026
- } catch (e) {}
4427
+ var initVal = value || (selectMode ? [] : null);
4428
+ var pageSize = 100; // 下拉框默认分页 条数
4027
4429
 
4028
- return dicData;
4029
- };
4430
+ var tableInitPageSize = 10; // 弹框默认分页 条数
4030
4431
 
4031
- var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
4032
- var dicData = getDicData(dicCode);
4033
- if (value === undefined) return ''; // @ts-ignore
4432
+ var currentPage = 1;
4433
+ var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
4434
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
4034
4435
 
4035
- var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
4036
- return item.value === value.toString();
4436
+ var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
4437
+ // 以下属性不可更改----设计配置项
4438
+ showSearch: false,
4439
+ filterOption: false,
4440
+ allowClear: true,
4441
+ listHeight: 160,
4442
+ optionLabelProp: "label",
4443
+ autoClearSearchValue: false
4037
4444
  });
4038
4445
 
4039
- if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
4040
- // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
4041
- return value;
4042
- }
4043
-
4044
- return dicItemArray[0].text;
4045
- };
4446
+ var _useState = useState([]),
4447
+ _useState2 = _slicedToArray(_useState, 2),
4448
+ items = _useState2[0],
4449
+ setItems = _useState2[1];
4450
+
4451
+ var _useState3 = useState(1),
4452
+ _useState4 = _slicedToArray(_useState3, 2),
4453
+ scrollPage = _useState4[0],
4454
+ setScrollPage = _useState4[1];
4455
+
4456
+ var _useState5 = useState(0),
4457
+ _useState6 = _slicedToArray(_useState5, 2),
4458
+ itemsTotal = _useState6[0],
4459
+ setItemsTotal = _useState6[1];
4460
+
4461
+ var _useState7 = useState(false),
4462
+ _useState8 = _slicedToArray(_useState7, 2),
4463
+ fetching = _useState8[0],
4464
+ setFetching = _useState8[1];
4465
+
4466
+ var _useState9 = useState(''),
4467
+ _useState10 = _slicedToArray(_useState9, 2),
4468
+ searchValue = _useState10[0],
4469
+ setSearchValue = _useState10[1];
4470
+
4471
+ var _useState11 = useState(false),
4472
+ _useState12 = _slicedToArray(_useState11, 2),
4473
+ isModalVisible = _useState12[0],
4474
+ setIsModalVisible = _useState12[1];
4475
+
4476
+ var _useState13 = useState(initVal),
4477
+ _useState14 = _slicedToArray(_useState13, 2),
4478
+ popvalue = _useState14[0],
4479
+ setPopValue = _useState14[1];
4480
+
4481
+ var _useState15 = useState(sourceName),
4482
+ _useState16 = _slicedToArray(_useState15, 2),
4483
+ uniqueValue = _useState16[0],
4484
+ setUniqueValue = _useState16[1];
4485
+
4486
+ var _useDebounceFn = useDebounceFn(function (v) {
4487
+ // 优化搜索参数 支持传多个
4488
+ var searchParams = {};
4489
+
4490
+ if (typeof selectParamsKey === 'string') {
4491
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
4492
+ }
4493
+
4494
+ if (Array.isArray(selectParamsKey)) {
4495
+ selectParamsKey.forEach(function (i) {
4496
+ searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
4497
+ });
4498
+ } // 防抖函数 待定
4499
+
4500
+
4501
+ getData(searchParams);
4502
+ }, {
4503
+ wait: 1000
4504
+ }),
4505
+ run = _useDebounceFn.run;
4506
+
4507
+ var _Form$useForm = Form.useForm(),
4508
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4509
+ form = _Form$useForm2[0];
4510
+
4511
+ var _useState17 = useState(true),
4512
+ _useState18 = _slicedToArray(_useState17, 2),
4513
+ caretLeftFlag = _useState18[0],
4514
+ setCaretLeftFlag = _useState18[1];
4515
+
4516
+ var _useState19 = useState([]),
4517
+ _useState20 = _slicedToArray(_useState19, 2),
4518
+ tableData = _useState20[0],
4519
+ setTableData = _useState20[1];
4520
+
4521
+ var _useState21 = useState({
4522
+ total: 0,
4523
+ size: "small",
4524
+ current: 1,
4525
+ pageSize: tableInitPageSize
4526
+ }),
4527
+ _useState22 = _slicedToArray(_useState21, 2),
4528
+ tablePagination = _useState22[0],
4529
+ setTablePagination = _useState22[1];
4530
+
4531
+ var _useState23 = useState([]),
4532
+ _useState24 = _slicedToArray(_useState23, 2),
4533
+ selectedRowKeys = _useState24[0],
4534
+ setSelectedRowKeys = _useState24[1];
4535
+
4536
+ var _useState25 = useState([]),
4537
+ _useState26 = _slicedToArray(_useState25, 2),
4538
+ doubleArr = _useState26[0],
4539
+ setDoubleArr = _useState26[1]; // 存放双数组的数组
4540
+
4541
+
4542
+ var _useState27 = useState(false),
4543
+ _useState28 = _slicedToArray(_useState27, 2),
4544
+ checkedAll = _useState28[0],
4545
+ setCheckedAll = _useState28[1];
4546
+
4547
+ var _useState29 = useState(false),
4548
+ _useState30 = _slicedToArray(_useState29, 2),
4549
+ indeterminate = _useState30[0],
4550
+ setIndeterminate = _useState30[1];
4551
+
4552
+ var _useState31 = useState({}),
4553
+ _useState32 = _slicedToArray(_useState31, 2),
4554
+ tableFormParams = _useState32[0],
4555
+ setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
4556
+
4557
+
4558
+ var getData = function getData() {
4559
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4560
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4561
+ if (!requestConfig) return;
4562
+ setFetching(true); // 处理dependence参数
4563
+
4564
+ var fixedParam = {};
4565
+
4566
+ if (fixedparameter && fieldValToParam && ctx) {
4567
+ fixedparameter.forEach(function (item, index) {
4568
+ var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
4569
+
4570
+ if (fixedParamVal) {
4571
+ fixedParam[item] = fixedParamVal;
4572
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
4573
+ }
4574
+ });
4575
+ } // 数组对象处理,对带有特殊标记的name进行处理
4576
+
4577
+
4578
+ for (var key in params) {
4579
+ if (Object.prototype.hasOwnProperty.call(params, key)) {
4580
+ (function () {
4581
+ var element = params[key];
4582
+
4583
+ if (element && key.indexOf('*number*') >= 0) {
4584
+ var dataParams = key.split('*number*');
4585
+ dataParams.forEach(function (value, index) {
4586
+ params[value] = element[index];
4587
+ });
4588
+ delete params[key];
4589
+ } else if (element && key.indexOf('*address*') >= 0) {
4590
+ var _dataParams = key.split('*address*');
4591
+
4592
+ _dataParams.forEach(function (value, index) {
4593
+ params[value] = element.PCDCode[index];
4594
+ });
4595
+
4596
+ delete params[key];
4597
+ } else if (element && key.indexOf('*costType*') >= 0) {
4598
+ var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
4599
+
4600
+
4601
+ params[_dataParams2[0]] = element[1];
4602
+ delete params[key];
4603
+ } else if (element && key.indexOf('*fullDate*') >= 0) {
4604
+ var _dataParams3 = key.split('*fullDate*');
4605
+
4606
+ _dataParams3.forEach(function (value, index) {
4607
+ if (index === 0) {
4608
+ params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
4609
+ } else {
4610
+ params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
4611
+ }
4612
+ });
4613
+
4614
+ delete params[key];
4615
+ } else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
4616
+ var _dataParams4 = key.split('*checkBox*');
4617
+
4618
+ if (element) {
4619
+ params[_dataParams4[0]] = 0;
4620
+ }
4621
+
4622
+ delete params[key];
4623
+ } else if (element && key.indexOf('*cascader*') >= 0) {
4624
+ var _dataParams5 = key.split('*cascader*');
4625
+
4626
+ params[_dataParams5[0]] = element[element.length - 1];
4627
+ delete params[key];
4628
+ } else if (element && key.indexOf('*date*') >= 0) {
4629
+ var _dataParams6 = key.split('*date*');
4630
+
4631
+ _dataParams6.forEach(function (value, index) {
4632
+ if (index === 0) {
4633
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4634
+ } else {
4635
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4636
+ }
4637
+ });
4638
+
4639
+ delete params[key];
4640
+ } else if (element && key.indexOf('*') >= 0) {
4641
+ var _dataParams7 = key.split('*');
4642
+
4643
+ _dataParams7.forEach(function (value, index) {
4644
+ params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
4645
+ });
4646
+
4647
+ delete params[key];
4648
+ } else if (element && key.indexOf('_selectNumberRange') >= 0) {
4649
+ // key = xxxxx_selectNumberRange qp-xxxxx-gt
4650
+ var _dataParams8 = key.split('_selectNumberRange')[0];
4651
+
4652
+ if (params[key][0] === 'range') {
4653
+ if (params[key][1][0]) {
4654
+ params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
4655
+ }
4656
+
4657
+ if (params[key][1][1]) {
4658
+ params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
4659
+ }
4660
+ } else {
4661
+ params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
4662
+ }
4663
+
4664
+ delete params[key];
4665
+ } else if (Array.isArray(element)) {
4666
+ params[key] = element.join(',');
4667
+ } else if (element == null || element === undefined || String(element).trim() === '') {
4668
+ delete params[key];
4669
+ }
4670
+ })();
4671
+ }
4672
+ }
4673
+
4674
+ var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
4675
+ pageSize: pageSize,
4676
+ currentPage: currentPage
4677
+ }, otherParams), fixedParam), params);
4678
+
4679
+ axios.get("".concat(url, "?").concat(stringify(queryParams))).then(function (result) {
4680
+ var _result, _result2;
4681
+
4682
+ setFetching(false);
4683
+ result = result.data;
4684
+
4685
+ 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') {
4686
+ message.error(result.msg);
4687
+ return;
4688
+ }
4689
+
4690
+ var res = result.data;
4691
+ var source = [];
4692
+
4693
+ if (isMap) {
4694
+ source = Object.keys(res).map(function (d, i) {
4695
+ return {
4696
+ text: Object.values(res)[i],
4697
+ value: d
4698
+ };
4699
+ });
4700
+ } else {
4701
+ var keys = res.list ? 'list' : 'items';
4702
+ source = res ? res[keys] ? res[keys].map(function (item) {
4703
+ var textShowText = item[mappingTextField];
4704
+
4705
+ if (mappingTextShowTextField) {
4706
+ textShowText = [];
4707
+
4708
+ if (Array.isArray(mappingTextShowTextField)) {
4709
+ mappingTextShowTextField.forEach(function (r) {
4710
+ textShowText.push(item[r]);
4711
+ });
4712
+ } else {
4713
+ textShowText = item[mappingTextShowTextField];
4714
+ }
4715
+ }
4716
+
4717
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4718
+ text: item[mappingTextField],
4719
+ textShowText: textShowText,
4720
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4721
+ value: item[mappingValueField]
4722
+ });
4723
+ }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
4724
+ var textShowText = item[mappingTextField];
4725
+
4726
+ if (mappingTextShowTextField) {
4727
+ textShowText = [];
4728
+
4729
+ if (Array.isArray(mappingTextShowTextField)) {
4730
+ mappingTextShowTextField.forEach(function (r) {
4731
+ textShowText.push(item[r]);
4732
+ });
4733
+ } else {
4734
+ textShowText = item[mappingTextShowTextField];
4735
+ }
4736
+ }
4737
+
4738
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4739
+ text: item[mappingTextField],
4740
+ textShowText: textShowText,
4741
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4742
+ value: item[mappingValueField]
4743
+ });
4744
+ })) : [];
4745
+ }
4746
+
4747
+ source = Array.isArray(source) ? source : [];
4748
+
4749
+ if (type === 1) {
4750
+ var _ctx$form;
4751
+
4752
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
4753
+ setItems(source);
4754
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
4755
+ } else {
4756
+ setTableData(source);
4757
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
4758
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
4759
+ 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),
4760
+ 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)
4761
+ }));
4762
+ }
4763
+ }).catch(function (err) {
4764
+ setFetching(false);
4765
+ });
4766
+ };
4767
+
4768
+ useEffect(function () {
4769
+ run('init');
4770
+ }, []);
4771
+ useEffect(function () {
4772
+ if (value) {
4773
+ setPopValue(value);
4774
+ }
4775
+ }, [value]);
4776
+ useEffect(function () {
4777
+ makeUniqueValue();
4778
+ }, [sourceName]);
4779
+
4780
+ var showModal = function showModal() {
4781
+ getData({
4782
+ pageSize: tableInitPageSize,
4783
+ currentPage: 1
4784
+ }, 2);
4785
+ setIsModalVisible(true); // 回显
4786
+
4787
+ if (value) {
4788
+ if (selectMode) {
4789
+ setSelectedRowKeys(labelInValue ? value.map(function (i) {
4790
+ return i.key;
4791
+ }) : value);
4792
+ setPopValue(labelInValue ? value.map(function (i) {
4793
+ return {
4794
+ value: i.key,
4795
+ text: i.label
4796
+ };
4797
+ }) : value.map(function (i) {
4798
+ return {
4799
+ value: i
4800
+ };
4801
+ }));
4802
+ setIndeterminate(!!value.length && value.length < itemsTotal);
4803
+ setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
4804
+
4805
+ if (!value.length) {
4806
+ setDoubleArr([]);
4807
+ }
4808
+ } else {
4809
+ setSelectedRowKeys(labelInValue ? [value.key] : [value]);
4810
+ setPopValue(labelInValue ? [{
4811
+ value: value.key,
4812
+ text: value.label
4813
+ }] : [{
4814
+ value: value
4815
+ }]);
4816
+ }
4817
+ }
4818
+ };
4819
+
4820
+ var handleOk = function handleOk(isContinue) {
4821
+ if (!popvalue.length) {
4822
+ message.warning('至少选中一条数据');
4823
+ return;
4824
+ } // handleSelectOver(popvalue)
4825
+
4826
+
4827
+ if (onSaveCallback) {
4828
+ onSaveCallback(popvalue).then(function (res) {
4829
+ {
4830
+ message.success('保存成功');
4831
+ deleteSelectRows();
4832
+ !isContinue && handleCancel();
4833
+ }
4834
+ }).catch(function (Error) {
4835
+ message.error(Error);
4836
+ });
4837
+ } else {
4838
+ !isContinue && handleCancel();
4839
+ }
4840
+ };
4841
+
4842
+ var handleCancel = function handleCancel() {
4843
+ form.resetFields();
4844
+ setTableFormParams({});
4845
+ setIsModalVisible(false);
4846
+
4847
+ if (selectMode) {
4848
+ run();
4849
+ }
4850
+ };
4851
+
4852
+ var onSearchTable = function onSearchTable() {
4853
+ var params = form.getFieldsValue();
4854
+ setTableFormParams(params);
4855
+ getData(_objectSpread2(_objectSpread2({}, params), {}, {
4856
+ pageSize: tableInitPageSize
4857
+ }), 2);
4858
+
4859
+ if (selectMode) {
4860
+ getData(params);
4861
+ }
4862
+ };
4863
+
4864
+ var onResetTable = function onResetTable() {
4865
+ form.resetFields();
4866
+ setTableFormParams({});
4867
+ getData({
4868
+ pageSize: tableInitPageSize,
4869
+ currentPage: 1
4870
+ }, 2);
4871
+ };
4872
+
4873
+ var handleTableChange = function handleTableChange(pagination) {
4874
+ getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
4875
+ pageSize: pagination.pageSize,
4876
+ currentPage: pagination.current
4877
+ }), 2);
4878
+ }; // 扁平化二维数组的方法
4879
+
4880
+ var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
4881
+ setPopValue(selectRows);
4882
+ setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
4883
+ // setCheckedAll(filterRows.length === tablePagination?.total);
4884
+ }; // 生成唯一值
4885
+
4886
+
4887
+ var makeUniqueValue = function makeUniqueValue() {
4888
+ var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
4889
+ setUniqueValue(generateUnitKey);
4890
+ return generateUnitKey;
4891
+ };
4892
+
4893
+ var rowSelection = {
4894
+ type: 'checkbox',
4895
+ selectedRowKeys: selectedRowKeys,
4896
+ preserveSelectedRowKeys: true,
4897
+ onChange: function onChange(sks, srs) {
4898
+ onChangeSelectedKeys(sks, srs);
4899
+ },
4900
+ getCheckboxProps: function getCheckboxProps() {
4901
+ return {
4902
+ disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
4903
+ };
4904
+ }
4905
+ };
4906
+
4907
+ var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
4908
+ if (!selectMode) {
4909
+ var srs = [JSON.parse(JSON.stringify(record))];
4910
+ var sks = srs.map(function (i) {
4911
+ return i.value;
4912
+ });
4913
+ onChangeSelectedKeys(sks, srs);
4914
+ }
4915
+ };
4916
+
4917
+ var themeColor = {
4918
+ color: '#005CFF'
4919
+ };
4920
+
4921
+ var formItem = function formItem(list) {
4922
+ if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
4923
+ return list.map(function (i, index) {
4924
+ var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
4925
+
4926
+ 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') {
4927
+ var _i$field2, _i$initialSource;
4928
+
4929
+ return /*#__PURE__*/React.createElement(Form.Item, {
4930
+ name: i.name,
4931
+ label: i.label,
4932
+ key: i.name
4933
+ }, /*#__PURE__*/React.createElement(Select, _objectSpread2({
4934
+ style: {
4935
+ width: '100%'
4936
+ },
4937
+ placeholder: "\u8BF7\u9009\u62E9"
4938
+ }, 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) {
4939
+ return /*#__PURE__*/React.createElement(Option$1, {
4940
+ value: m.value,
4941
+ key: m.value
4942
+ }, m.text);
4943
+ }))));
4944
+ }
4945
+
4946
+ 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') {
4947
+ var _i$field4;
4948
+
4949
+ return /*#__PURE__*/React.createElement(Form.Item, {
4950
+ name: i.name,
4951
+ label: i.label,
4952
+ key: i.name
4953
+ }, /*#__PURE__*/React.createElement(TreeSelect, _objectSpread2({
4954
+ style: {
4955
+ width: '100%'
4956
+ },
4957
+ placeholder: "\u8BF7\u9009\u62E9"
4958
+ }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
4959
+ }
4960
+
4961
+ 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') {
4962
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
4963
+ name: i.name,
4964
+ label: i.label,
4965
+ key: i.name
4966
+ }, /*#__PURE__*/React.createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
4967
+ }
4968
+
4969
+ 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') {
4970
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
4971
+ name: i.name,
4972
+ label: i.label,
4973
+ key: i.name
4974
+ }, /*#__PURE__*/React.createElement(QueryMutipleInput, {
4975
+ onValueChange: function onValueChange(value) {
4976
+ form.setFieldsValue(_defineProperty({}, i.name, value));
4977
+ }
4978
+ })));
4979
+ } // 默认type是input
4980
+
4981
+
4982
+ return /*#__PURE__*/React.createElement(Form.Item, {
4983
+ name: i.name,
4984
+ label: i.label,
4985
+ key: i.name
4986
+ }, /*#__PURE__*/React.createElement(Input, _objectSpread2({
4987
+ id: index === 0 ? "2345234242342" : 'index',
4988
+ style: {
4989
+ width: '100%'
4990
+ },
4991
+ placeholder: "\u8BF7\u8F93\u5165",
4992
+ allowClear: true,
4993
+ maxLength: 100
4994
+ }, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
4995
+ });
4996
+ } else {
4997
+ return null;
4998
+ }
4999
+ };
5000
+
5001
+ var deleteSelectRows = function deleteSelectRows() {
5002
+ setPopValue([]);
5003
+ setSelectedRowKeys([]);
5004
+ };
5005
+
5006
+ var deleteRecord = function deleteRecord(record) {
5007
+ setPopValue(popvalue.filter(function (item) {
5008
+ return item.skuCode !== record.skuCode;
5009
+ }));
5010
+ setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
5011
+ return item !== record.skuCode;
5012
+ })));
5013
+ };
5014
+
5015
+ var inputIndex = 0;
5016
+ var selectColumns = [].concat(_toConsumableArray(modalTableProps.selectColumn.map(function (item) {
5017
+ var inputLength = modalTableProps.selectColumn.filter(function (item) {
5018
+ return item.isInputItem;
5019
+ }).length;
5020
+ var currentIndex = inputIndex;
5021
+
5022
+ if (item.isInputItem) {
5023
+ inputIndex++;
5024
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5025
+ render: function render(text, record, index) {
5026
+ return /*#__PURE__*/React.createElement(InputNumber, {
5027
+ defaultValue: text || 0,
5028
+ min: 0,
5029
+ keyboard: false,
5030
+ onChange: function onChange(value) {
5031
+ record['count'] = value;
5032
+ },
5033
+ // onFocus={(e)=> {
5034
+ // let dom1 = e.currentTarget;
5035
+ // dom1.setSelectionRange(100, 0);
5036
+ // dom1.select(text);
5037
+ // }}
5038
+ onKeyDown: function onKeyDown(e) {
5039
+ if (e.keyCode === 13 && e.ctrlKey) {
5040
+ var _document$getElementB;
5041
+
5042
+ handleOk(true);
5043
+ (_document$getElementB = document.getElementById("2345234242342")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
5044
+ }
5045
+
5046
+ if (e.keyCode === 8 && e.ctrlKey) {
5047
+ var _e$nativeEvent$path$;
5048
+
5049
+ message.success('删除当前行');
5050
+ e.stopPropagation();
5051
+ e.preventDefault();
5052
+ 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];
5053
+
5054
+ if (dom) {
5055
+ dom.select();
5056
+ dom.focus();
5057
+ dom.scrollIntoView(false);
5058
+ }
5059
+
5060
+ dom = null;
5061
+ deleteRecord(record);
5062
+ }
5063
+
5064
+ if (e.keyCode === 37 && e.shiftKey) {
5065
+ var _e$nativeEvent$path$2;
5066
+
5067
+ // 左滑动
5068
+ e.stopPropagation();
5069
+ e.preventDefault();
5070
+
5071
+ 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];
5072
+
5073
+ if (_dom) {
5074
+ _dom.select();
5075
+
5076
+ _dom.focus();
5077
+
5078
+ _dom.scrollIntoView(false);
5079
+ }
5080
+
5081
+ _dom = null;
5082
+ }
5083
+
5084
+ if (e.keyCode === 39 && e.shiftKey) {
5085
+ var _e$nativeEvent$path$3;
5086
+
5087
+ // 右滑
5088
+ e.stopPropagation();
5089
+ e.preventDefault();
5090
+
5091
+ 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];
5092
+
5093
+ if (_dom2) {
5094
+ _dom2.select();
5095
+
5096
+ _dom2.focus();
5097
+
5098
+ _dom2.scrollIntoView(false);
5099
+ }
5100
+
5101
+ _dom2 = null;
5102
+ }
5103
+
5104
+ if (e.keyCode === 40) {
5105
+ var _e$nativeEvent$path$4;
5106
+
5107
+ e.stopPropagation();
5108
+ e.preventDefault();
5109
+
5110
+ 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];
5111
+
5112
+ if (_dom3) {
5113
+ _dom3.select();
5114
+
5115
+ _dom3.focus();
5116
+
5117
+ _dom3.scrollIntoView(false);
5118
+ }
5119
+
5120
+ _dom3 = null;
5121
+ } else if (e.keyCode === 38) {
5122
+ var _e$nativeEvent$path$5;
5123
+
5124
+ e.stopPropagation();
5125
+ e.preventDefault();
5126
+ 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];
5127
+
5128
+ if (dom1) {
5129
+ // dom1.value=""
5130
+ // dom1.setSelectionRange(100, 0);
5131
+ dom1.select();
5132
+ dom1.focus();
5133
+ dom1.scrollIntoViewIfNeeded(false); // dom1.value=record['count']
5134
+ }
5135
+
5136
+ dom1 = null;
5137
+ } else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
5138
+ e.stopPropagation();
5139
+ e.preventDefault();
5140
+ }
5141
+ }
5142
+ });
5143
+ }
5144
+ });
5145
+ }
5146
+
5147
+ return item;
5148
+ })), [{
5149
+ title: '操作',
5150
+ width: 150,
5151
+ fixed: 'right',
5152
+ render: function render(text, record, index) {
5153
+ return /*#__PURE__*/React.createElement(Button, {
5154
+ onClick: function onClick() {
5155
+ deleteRecord(record);
5156
+ },
5157
+ type: "link"
5158
+ }, "\u5220\u9664");
5159
+ }
5160
+ }]);
5161
+ return /*#__PURE__*/React.createElement("div", {
5162
+ className: 'add_select'
5163
+ }, /*#__PURE__*/React.createElement("div", {
5164
+ className: "add_select_show",
5165
+ id: "add_select_div_".concat(uniqueValue)
5166
+ }, /*#__PURE__*/React.createElement(Button, {
5167
+ onClick: showModal,
5168
+ type: "primary"
5169
+ }, "\u6DFB\u52A0")), needModalTable && isModalVisible && /*#__PURE__*/React.createElement(Modal, {
5170
+ width: '1200px',
5171
+ style: {
5172
+ top: 20
5173
+ },
5174
+ bodyStyle: {
5175
+ padding: '0px'
5176
+ },
5177
+ // title={modalTableProps?.modalTableTitle}
5178
+ visible: isModalVisible,
5179
+ onOk: handleOk,
5180
+ closable: false,
5181
+ onCancel: handleCancel,
5182
+ footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
5183
+ key: "back",
5184
+ onClick: handleCancel
5185
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
5186
+ key: "submit",
5187
+ style: {
5188
+ color: '#005CFF',
5189
+ borderColor: '#005CFF'
5190
+ },
5191
+ onClick: function onClick() {
5192
+ handleOk(true);
5193
+ },
5194
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5195
+ }, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React.createElement(Button, {
5196
+ key: "submit",
5197
+ type: "primary",
5198
+ onClick: function onClick() {
5199
+ handleOk(false);
5200
+ },
5201
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5202
+ }, "\u786E\u5B9A")] : null
5203
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
5204
+ className: 'add_select_header'
5205
+ }, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.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.createElement("span", {
5206
+ className: 'add_select_header_close'
5207
+ }, /*#__PURE__*/React.createElement(CloseCircleOutlined$2, {
5208
+ style: {
5209
+ fontSize: '20px'
5210
+ },
5211
+ onClick: handleCancel
5212
+ }))), /*#__PURE__*/React.createElement("div", {
5213
+ className: 'add_select_wrapper'
5214
+ }, /*#__PURE__*/React.createElement("div", {
5215
+ className: caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'
5216
+ }, /*#__PURE__*/React.createElement("div", {
5217
+ className: 'select_list_columns'
5218
+ }, /*#__PURE__*/React.createElement("div", {
5219
+ className: 'select_list_columns_formItems'
5220
+ }, /*#__PURE__*/React.createElement(Form, {
5221
+ form: form,
5222
+ layout: 'vertical',
5223
+ key: 'modalForm'
5224
+ }, formItem(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm)))), /*#__PURE__*/React.createElement("div", {
5225
+ className: 'select_list_searchButton'
5226
+ }, /*#__PURE__*/React.createElement(Button, {
5227
+ key: 'reset',
5228
+ className: 'select_list_button_space',
5229
+ onClick: onResetTable
5230
+ }, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
5231
+ key: 'search',
5232
+ type: "primary",
5233
+ onClick: onSearchTable
5234
+ }, "\u67E5\u8BE2"))), /*#__PURE__*/React.createElement("div", {
5235
+ className: caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'
5236
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
5237
+ className: 'select_list_selectTips'
5238
+ }, /*#__PURE__*/React.createElement("div", {
5239
+ style: {
5240
+ marginLeft: 8
5241
+ }
5242
+ }, "\u641C\u7D22\u7ED3\u679C\u5171\xA0", /*#__PURE__*/React.createElement("span", {
5243
+ style: themeColor
5244
+ }, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React.createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React.createElement("span", {
5245
+ style: themeColor
5246
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879") : '')), /*#__PURE__*/React.createElement(Table, {
5247
+ size: 'small',
5248
+ rowSelection: rowSelection,
5249
+ columns: _toConsumableArray(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns),
5250
+ dataSource: tableData,
5251
+ pagination: tablePagination,
5252
+ loading: fetching,
5253
+ onChange: handleTableChange,
5254
+ rowKey: mappingValueField,
5255
+ rowClassName: 'row-class',
5256
+ scroll: {
5257
+ y: 500
5258
+ }
5259
+ })))), /*#__PURE__*/React.createElement("div", {
5260
+ className: 'add_select_wrapper_select'
5261
+ }, /*#__PURE__*/React.createElement("div", {
5262
+ className: 'select_list_selectTips'
5263
+ }, /*#__PURE__*/React.createElement("div", {
5264
+ style: {
5265
+ marginLeft: 8
5266
+ }
5267
+ }, /*#__PURE__*/React.createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React.createElement("span", {
5268
+ style: themeColor
5269
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879")), /*#__PURE__*/React.createElement("div", {
5270
+ style: {
5271
+ marginRight: 8
5272
+ }
5273
+ }, /*#__PURE__*/React.createElement("span", {
5274
+ onClick: deleteSelectRows,
5275
+ style: _objectSpread2(_objectSpread2({}, themeColor), {}, {
5276
+ cursor: 'pointer'
5277
+ })
5278
+ }, "\u6E05\u7A7A\u6240\u9009\u5546\u54C1"))), /*#__PURE__*/React.createElement(Table, {
5279
+ size: 'small',
5280
+ // rowSelection={rowSelection}
5281
+ columns: selectColumns,
5282
+ dataSource: popvalue,
5283
+ pagination: false,
5284
+ // onChange={handleTableChange}
5285
+ rowKey: mappingValueField,
5286
+ rowClassName: 'row-class',
5287
+ scroll: {
5288
+ y: 500
5289
+ },
5290
+ onRow: function onRow(record) {
5291
+ return {
5292
+ onDoubleClick: function onDoubleClick(event) {
5293
+ return onDoubleClickSelect(event, record);
5294
+ }
5295
+ };
5296
+ }
5297
+ })))));
5298
+ };
5299
+
5300
+ var shopFileType = [{
5301
+ text: "线上",
5302
+ value: 'online'
5303
+ }, {
5304
+ text: "线下",
5305
+ value: 'offline'
5306
+ }];
5307
+ var shopFile2Type = [{
5308
+ text: "第三方线上",
5309
+ value: 'online'
5310
+ }, {
5311
+ text: "线下",
5312
+ value: 'offline'
5313
+ }, {
5314
+ text: "自营B2B",
5315
+ value: 'B2B'
5316
+ }, {
5317
+ text: "自营B2C",
5318
+ value: 'B2C'
5319
+ }];
5320
+ var arrivalPaySupportList = [{
5321
+ text: "支持",
5322
+ value: 1
5323
+ }, {
5324
+ text: "不支持",
5325
+ value: 0
5326
+ }];
5327
+ var sharingType = [{
5328
+ text: "共享",
5329
+ value: '10'
5330
+ }, {
5331
+ text: "私有",
5332
+ value: '20'
5333
+ }];
5334
+
5335
+ var getDicData = function getDicData(dicCode) {
5336
+ var dicData = {};
5337
+
5338
+ {
5339
+ var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
5340
+ dicData = storageDic[dicCode];
5341
+ } // @ts-ignore
5342
+
5343
+
5344
+ if (!dicData || !dicData.length) ;
5345
+
5346
+ return dicData;
5347
+ };
5348
+
5349
+ var getDictionarySource = function getDictionarySource(dicCode) {
5350
+ var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5351
+ var dicData = getDicData(dicCode);
5352
+
5353
+ try {
5354
+ if (needConvertInterger) {
5355
+ // @ts-ignore
5356
+ dicData = dicData.map(function (item) {
5357
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5358
+ value: parseFloat(item.value)
5359
+ });
5360
+ });
5361
+ }
5362
+ } catch (e) {}
5363
+
5364
+ return dicData;
5365
+ };
5366
+
5367
+ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
5368
+ var dicData = getDicData(dicCode);
5369
+ if (value === undefined) return ''; // @ts-ignore
5370
+
5371
+ var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
5372
+ return item.value === value.toString();
5373
+ });
5374
+
5375
+ if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
5376
+ // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
5377
+ return value;
5378
+ }
5379
+
5380
+ return dicItemArray[0].text;
5381
+ };
4046
5382
 
4047
5383
  var loadSelectSource = function loadSelectSource(url, params) {
4048
5384
  return new Promise(function (resolve, reject) {
4049
5385
  axios.get("".concat(url, "?").concat(stringify(params))).then(function (result) {
4050
- var _result;
5386
+ var _result, _result2;
4051
5387
 
4052
5388
  result = result.data;
4053
5389
 
4054
- if (result.status && result.status !== '0' || ((_result = result) === null || _result === void 0 ? void 0 : _result.code) && result.code !== '000000') {
5390
+ 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') {
4055
5391
  message.error(result.msg);
4056
5392
  return;
4057
5393
  }
@@ -4063,6 +5399,48 @@ var loadSelectSource = function loadSelectSource(url, params) {
4063
5399
  });
4064
5400
  };
4065
5401
 
5402
+ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
5403
+ var result;
5404
+
5405
+ switch (type) {
5406
+ case 'supplier2':
5407
+ case 'customer2':
5408
+ case 'shopFile2':
5409
+ result = '/channel-manage';
5410
+ break;
5411
+
5412
+ case 'skuCommodity':
5413
+ case 'skuPropertyValue':
5414
+ case 'spuCommodity':
5415
+ result = '/items';
5416
+ break;
5417
+
5418
+ case 'physicalWarehouse':
5419
+ case 'realWarehouse':
5420
+ case 'virtualWarehouse':
5421
+ case 'channelWarehouse':
5422
+ result = '/stock';
5423
+ break;
5424
+
5425
+ case 'inventoryOrg2':
5426
+ case 'purchaseOrg':
5427
+ case 'salesOrg':
5428
+ case 'employee2':
5429
+ result = '/user';
5430
+ break;
5431
+
5432
+ case 'deliveryMode':
5433
+ result = '/basic';
5434
+ break;
5435
+
5436
+ default:
5437
+ result = '/bop/api';
5438
+ break;
5439
+ }
5440
+
5441
+ return result;
5442
+ };
5443
+
4066
5444
  var _getDictionarySource;
4067
5445
  var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
4068
5446
  var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
@@ -4090,7 +5468,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4090
5468
 
4091
5469
  var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
4092
5470
  var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
4093
- var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || [];
5471
+ 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) || [];
4094
5472
  var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
4095
5473
  return {
4096
5474
  text: v[resKeyValue[1]],
@@ -4137,7 +5515,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4137
5515
  tableColumns: []
4138
5516
  }, modalTableBusProps);
4139
5517
 
4140
- var needModalTable = true; // 供应商选择器
5518
+ var needModalTable = (modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable) !== undefined ? modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable : true; // 供应商选择器
4141
5519
 
4142
5520
  if (type === 'supplier') {
4143
5521
  tableSearchForm = [{
@@ -4337,7 +5715,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4337
5715
  mappingTextShowTextField: ['name', 'propertyNameAndValue'],
4338
5716
  otherParams: {
4339
5717
  'qp-approveStatus-eq': 1,
4340
- 'qp-type-eq': 10,
5718
+ // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
4341
5719
  sorter: 'desc-id'
4342
5720
  },
4343
5721
  sourceName: 'skuCode'
@@ -4349,8 +5727,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4349
5727
  name: 'qp-name-like',
4350
5728
  label: 'SKU名称'
4351
5729
  }, {
4352
- name: 'qp-skuCode-like',
4353
- label: 'SKU编码'
5730
+ name: 'qp-skuCode-in',
5731
+ label: 'SKU编码',
5732
+ field: {
5733
+ type: 'multipleQueryInput',
5734
+ props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
5735
+ }
4354
5736
  }, requestConfig.url.includes('v2') ? {
4355
5737
  name: 'qp-code-like',
4356
5738
  label: '国际条码'
@@ -4450,8 +5832,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4450
5832
  name: 'qp-name-like',
4451
5833
  label: 'SKU名称'
4452
5834
  }, {
4453
- name: 'qp-skuCode-like',
4454
- label: 'SKU编码'
5835
+ name: 'qp-skuCode-in',
5836
+ label: 'SKU编码',
5837
+ field: {
5838
+ type: 'multipleQueryInput',
5839
+ props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
5840
+ }
4455
5841
  }, {
4456
5842
  name: 'qp-barCode-like',
4457
5843
  label: '国际条码'
@@ -4528,7 +5914,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4528
5914
  }];
4529
5915
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
4530
5916
  pageSize: 5000,
4531
- currentPage: 1
5917
+ currentPage: 1,
5918
+ 'ctl-withAuth': true
4532
5919
  }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
4533
5920
  pageSize: 5000,
4534
5921
  currentPage: 1
@@ -4690,7 +6077,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4690
6077
  }];
4691
6078
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
4692
6079
  pageSize: 5000,
4693
- currentPage: 1
6080
+ currentPage: 1,
6081
+ 'ctl-withAuth': true
4694
6082
  }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
4695
6083
  pageSize: 5000,
4696
6084
  currentPage: 1
@@ -4899,6 +6287,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4899
6287
  mappingTextField: 'name',
4900
6288
  mappingValueField: 'code',
4901
6289
  otherParams: {
6290
+ 'qp-status-eq': 10,
4902
6291
  sorter: 'desc-id'
4903
6292
  },
4904
6293
  sourceName: 'customCode'
@@ -5254,6 +6643,83 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5254
6643
  dataIndex: 'accountingName'
5255
6644
  }]
5256
6645
  }, modalTableBusProps);
6646
+ }
6647
+
6648
+ if (type === 'shopFile2') {
6649
+ var _JSON$parse, _JSON$parse$employeeR;
6650
+
6651
+ requestConfig = _objectSpread2({
6652
+ url: "".concat(prefixUrl.selectPrefix, "/store/page"),
6653
+ filter: 'qp-name,code-orGroup,like',
6654
+ mappingTextField: 'name',
6655
+ mappingValueField: 'code',
6656
+ otherParams: {
6657
+ sorter: 'desc-id'
6658
+ },
6659
+ sourceName: 'code'
6660
+ }, requestConfigProp);
6661
+ tableSearchForm = [{
6662
+ name: 'qp-name-like',
6663
+ label: '商店名称'
6664
+ }, {
6665
+ name: 'qp-code-like',
6666
+ label: '商店编码'
6667
+ }, {
6668
+ name: 'qp-type-in',
6669
+ type: 'select',
6670
+ label: '商店类型',
6671
+ initialSource: shopFile2Type
6672
+ }, {
6673
+ name: 'qp-orgCode-in',
6674
+ type: 'select',
6675
+ label: '所属销售组织',
6676
+ field: {
6677
+ type: 'select',
6678
+ props: {
6679
+ mode: 'multiple',
6680
+ notFoundContent: '暂无数据',
6681
+ allowClear: true,
6682
+ showSearch: true,
6683
+ showArrow: true,
6684
+ maxTagCount: 1,
6685
+ optionFilterProp: 'children',
6686
+ filterOption: function filterOption(input, option) {
6687
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
6688
+ }
6689
+ }
6690
+ }
6691
+ }];
6692
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
6693
+ '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,
6694
+ 'qp-realOrg-eq': true,
6695
+ 'qp-status-eq': 10
6696
+ })]).then(function (x) {
6697
+ formatSource(x, 0, 3, tableSearchForm);
6698
+ });
6699
+ modalTableProps = _objectSpread2({
6700
+ modalTableTitle: '选择商店',
6701
+ tableSearchForm: tableSearchForm,
6702
+ tableColumns: [{
6703
+ title: '商店编码',
6704
+ dataIndex: 'code'
6705
+ }, {
6706
+ title: '商店名称',
6707
+ dataIndex: 'name'
6708
+ }, {
6709
+ title: '商店类型',
6710
+ dataIndex: 'type',
6711
+ render: function render(text) {
6712
+ var _shopFile2Type$find;
6713
+
6714
+ return (_shopFile2Type$find = shopFile2Type.find(function (i) {
6715
+ return i.value === text;
6716
+ })) === null || _shopFile2Type$find === void 0 ? void 0 : _shopFile2Type$find.text;
6717
+ }
6718
+ }, {
6719
+ title: '所属销售组织',
6720
+ dataIndex: 'orgName'
6721
+ }]
6722
+ }, modalTableBusProps);
5257
6723
  } // 核算主体选择器(无弹窗)
5258
6724
 
5259
6725
 
@@ -5581,8 +7047,8 @@ var MemoSearchSelect = /*#__PURE__*/React.memo(SearchSelect);
5581
7047
  var BusinessSearchSelect = function BusinessSearchSelect(props) {
5582
7048
  var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
5583
7049
  var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
5584
- selectPrefix: '/bop/api',
5585
- formSelectFix: '/bop/api'
7050
+ selectPrefix: handleDefaultPrefixUrl(businessType),
7051
+ formSelectFix: handleDefaultPrefixUrl(businessType)
5586
7052
  };
5587
7053
 
5588
7054
  var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
@@ -5623,7 +7089,7 @@ var CommodityEntry = function CommodityEntry(props) {
5623
7089
  _props$columns = props.columns,
5624
7090
  columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
5625
7091
  _props$validDataUrl = props.validDataUrl,
5626
- validDataUrl = _props$validDataUrl === void 0 ? "/bop/api/recordDetailImport/check" : _props$validDataUrl;
7092
+ validDataUrl = _props$validDataUrl === void 0 ? "/items/api/recordDetailImport/check" : _props$validDataUrl;
5627
7093
 
5628
7094
  var _useState = useState({
5629
7095
  maskClosable: false,
@@ -5746,6 +7212,321 @@ function getStorageVale(storageKeyString) {
5746
7212
  return "";
5747
7213
  }
5748
7214
 
7215
+ var TreeSearchSelect = function TreeSearchSelect(props) {
7216
+ var _useState = useState([]),
7217
+ _useState2 = _slicedToArray(_useState, 2),
7218
+ treeData = _useState2[0],
7219
+ setTreeData = _useState2[1];
7220
+
7221
+ var ctx = props.ctx,
7222
+ value = props.value,
7223
+ valueName = props.valueName,
7224
+ onChange = props.onChange,
7225
+ onChangeName = props.onChangeName,
7226
+ placeholder = props.placeholder,
7227
+ remoteSource = props.remoteSource,
7228
+ initialValue = props.initialValue,
7229
+ _props$treeCheckable = props.treeCheckable,
7230
+ treeCheckable = _props$treeCheckable === void 0 ? false : _props$treeCheckable,
7231
+ _props$showSearch = props.showSearch,
7232
+ showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
7233
+ _props$maxTagCount = props.maxTagCount,
7234
+ maxTagCount = _props$maxTagCount === void 0 ? 1 : _props$maxTagCount,
7235
+ _props$multiple = props.multiple,
7236
+ multiple = _props$multiple === void 0 ? false : _props$multiple,
7237
+ _props$isChoose = props.isChoose,
7238
+ isChoose = _props$isChoose === void 0 ? false : _props$isChoose,
7239
+ mode = props.mode,
7240
+ _getPopupContainer = props.getPopupContainer,
7241
+ _props$labelInValue = props.labelInValue,
7242
+ labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
7243
+ _props$showArrow = props.showArrow,
7244
+ showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
7245
+ _props$allowClear = props.allowClear,
7246
+ allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
7247
+ _props$showCheckedStr = props.showCheckedStrategy,
7248
+ showCheckedStrategy = _props$showCheckedStr === void 0 ? TreeSelect.SHOW_PARENT : _props$showCheckedStr,
7249
+ _props$style = props.style,
7250
+ style = _props$style === void 0 ? {
7251
+ width: '100%'
7252
+ } : _props$style,
7253
+ getTreeData = props.getTreeData;
7254
+ var url = remoteSource.url,
7255
+ _remoteSource$paramsK = remoteSource.paramsKey,
7256
+ paramsKey = _remoteSource$paramsK === void 0 ? 'qp-name-like' : _remoteSource$paramsK,
7257
+ _remoteSource$resKeyV = remoteSource.resKeyValue,
7258
+ resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
7259
+ _remoteSource$initial = remoteSource.initialParams,
7260
+ initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
7261
+
7262
+ var mapSearchTree = function mapSearchTree(treeDataItem) {
7263
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
7264
+ return {
7265
+ title: treeDataItem[resKeyValue[1]],
7266
+ key: treeDataItem[resKeyValue[0]],
7267
+ value: treeDataItem[resKeyValue[0]],
7268
+ parentId: treeDataItem.parent,
7269
+ data: _objectSpread2({}, treeDataItem),
7270
+ isLeaf: !haveChildren,
7271
+ disabled: isDisabled(haveChildren),
7272
+ children: haveChildren ? treeDataItem.children.map(function (i) {
7273
+ return mapSearchTree(i);
7274
+ }) : []
7275
+ };
7276
+ };
7277
+
7278
+ var isDisabled = function isDisabled(children) {
7279
+ if (isChoose) {
7280
+ return false;
7281
+ }
7282
+
7283
+ return children;
7284
+ };
7285
+ /* 实时查询 但是目前用的直接是完整数据源, 所以没有使用 */
7286
+
7287
+
7288
+ var handleSearch = function handleSearch(q) {
7289
+ var paramsData = _objectSpread2(_defineProperty({}, "".concat(paramsKey), q), initialParams);
7290
+
7291
+ axios.get("".concat(url, "?").concat(stringify(paramsData))).then( /*#__PURE__*/function () {
7292
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
7293
+ var _ctx$form;
7294
+
7295
+ var resData, coverData, data, dataList;
7296
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7297
+ while (1) {
7298
+ switch (_context.prev = _context.next) {
7299
+ case 0:
7300
+ resData = (res === null || res === void 0 ? void 0 : res.data) || [];
7301
+
7302
+ if (!(resData.status === '0')) {
7303
+ _context.next = 13;
7304
+ break;
7305
+ }
7306
+
7307
+ data = resData.data;
7308
+
7309
+ if (!remoteSource.converter) {
7310
+ _context.next = 9;
7311
+ break;
7312
+ }
7313
+
7314
+ _context.next = 6;
7315
+ return remoteSource.converter({
7316
+ data: [data]
7317
+ });
7318
+
7319
+ case 6:
7320
+ coverData = _context.sent;
7321
+ _context.next = 11;
7322
+ break;
7323
+
7324
+ case 9:
7325
+ dataList = data && Array.isArray(data) ? data : data && [data] || [];
7326
+ coverData = dataList.length && dataList.map(function (ites) {
7327
+ return mapSearchTree(ites);
7328
+ }) || [];
7329
+
7330
+ case 11:
7331
+ _context.next = 14;
7332
+ break;
7333
+
7334
+ case 13:
7335
+ coverData = [];
7336
+
7337
+ case 14:
7338
+ setTreeData(coverData);
7339
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(ctx.name, coverData);
7340
+
7341
+ case 16:
7342
+ case "end":
7343
+ return _context.stop();
7344
+ }
7345
+ }
7346
+ }, _callee);
7347
+ }));
7348
+
7349
+ return function (_x) {
7350
+ return _ref.apply(this, arguments);
7351
+ };
7352
+ }());
7353
+ };
7354
+
7355
+ var handleChange = function handleChange(data, dataName) {
7356
+ var _ctx$form2;
7357
+
7358
+ onChange(data);
7359
+ onChangeName && onChangeName(dataName);
7360
+ getTreeData && getTreeData(treeData); // 把树节点暴露出去
7361
+
7362
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
7363
+ };
7364
+
7365
+ useEffect(function () {
7366
+ handleSearch(initialValue);
7367
+ }, []);
7368
+
7369
+ var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
7370
+ var _onClose = function onClose(e, item) {
7371
+ e.preventDefault();
7372
+ var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
7373
+ return i.value !== item.value;
7374
+ }) : JSON.parse(JSON.stringify(value)).filter(function (i) {
7375
+ return i !== item.value;
7376
+ });
7377
+ var newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter(function (i) {
7378
+ return i !== item.label;
7379
+ });
7380
+ handleChange(newValue, newValueName);
7381
+ };
7382
+
7383
+ return /*#__PURE__*/React.createElement(Tooltip, {
7384
+ title: selectedValues.map(function (i) {
7385
+ return /*#__PURE__*/React.createElement(Tag, {
7386
+ closable: true,
7387
+ onClose: function onClose(e) {
7388
+ return _onClose(e, i);
7389
+ },
7390
+ style: {
7391
+ marginRight: 3,
7392
+ background: '#f5f5f5',
7393
+ height: '24px',
7394
+ border: '1px solid #f0f0f0'
7395
+ }
7396
+ }, i.label);
7397
+ })
7398
+ }, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
7399
+ };
7400
+
7401
+ return /*#__PURE__*/React.createElement("div", {
7402
+ className: 'tree_search_select'
7403
+ }, /*#__PURE__*/React.createElement(TreeSelect, {
7404
+ treeCheckable: treeCheckable,
7405
+ maxTagCount: maxTagCount,
7406
+ showSearch: showSearch,
7407
+ style: style,
7408
+ value: value,
7409
+ dropdownStyle: {
7410
+ maxHeight: 400,
7411
+ maxWidth: 100,
7412
+ overflow: 'auto'
7413
+ },
7414
+ treeData: treeData,
7415
+ placeholder: placeholder,
7416
+ allowClear: allowClear,
7417
+ labelInValue: labelInValue,
7418
+ showArrow: showArrow,
7419
+ showCheckedStrategy: showCheckedStrategy,
7420
+ treeNodeFilterProp: 'title',
7421
+ treeDefaultExpandAll: true,
7422
+ multiple: multiple,
7423
+ maxTagPlaceholder: maxTagPlaceholder,
7424
+ onChange: handleChange,
7425
+ disabled: mode === 'view' || (ctx === null || ctx === void 0 ? void 0 : ctx.mode) === 'view',
7426
+ getPopupContainer: function getPopupContainer() {
7427
+ return _getPopupContainer && _getPopupContainer() || document.body;
7428
+ }
7429
+ }));
7430
+ };
7431
+
7432
+ var handleDefaultProps = function handleDefaultProps(type) {
7433
+ var result = {};
7434
+
7435
+ switch (type) {
7436
+ case 'department':
7437
+ result = {
7438
+ treeCheckable: true,
7439
+ isChoose: true,
7440
+ remoteSource: {
7441
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7442
+ initialParams: {
7443
+ 'orgViewCode': 'administrative-organization-view'
7444
+ },
7445
+ resKeyValue: ['code', 'name']
7446
+ }
7447
+ };
7448
+ break;
7449
+
7450
+ case 'sales-organization':
7451
+ result = {
7452
+ isChoose: true,
7453
+ remoteSource: {
7454
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7455
+ initialParams: {
7456
+ 'orgViewCode': 'sales-organizational-view'
7457
+ },
7458
+ resKeyValue: ['code', 'name']
7459
+ }
7460
+ };
7461
+ break;
7462
+
7463
+ case 'purchase-organization':
7464
+ result = {
7465
+ isChoose: true,
7466
+ remoteSource: {
7467
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7468
+ initialParams: {
7469
+ 'orgViewCode': 'purchase-organizational-view'
7470
+ },
7471
+ resKeyValue: ['code', 'name']
7472
+ }
7473
+ };
7474
+ break;
7475
+
7476
+ case 'stock-organization':
7477
+ result = {
7478
+ isChoose: true,
7479
+ remoteSource: {
7480
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7481
+ initialParams: {
7482
+ 'orgViewCode': 'stock-organizational-view'
7483
+ },
7484
+ resKeyValue: ['code', 'name']
7485
+ }
7486
+ };
7487
+ break;
7488
+
7489
+ default:
7490
+ result = {
7491
+ treeCheckable: true,
7492
+ isChoose: true,
7493
+ remoteSource: {
7494
+ url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
7495
+ initialParams: {
7496
+ 'orgViewCode': 'administrative-organization-view'
7497
+ },
7498
+ resKeyValue: ['code', 'name']
7499
+ }
7500
+ };
7501
+ break;
7502
+ }
7503
+
7504
+ return result;
7505
+ };
7506
+
7507
+ var MemoTreeSearchSelect = /*#__PURE__*/React.memo(TreeSearchSelect);
7508
+
7509
+ var BusinessTreeSearchSelect = function BusinessTreeSearchSelect(props) {
7510
+ var businessType = (props === null || props === void 0 ? void 0 : props.businessType) || 'department';
7511
+ var handleBusinessProps = handleDefaultProps(businessType);
7512
+ var currentProps = useMemo(function () {
7513
+ return _objectSpread2(_objectSpread2({}, handleBusinessProps), props);
7514
+ }, [props === null || props === void 0 ? void 0 : props.value]);
7515
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoTreeSearchSelect, _objectSpread2({}, currentProps)));
7516
+ };
7517
+
7518
+ var index$1 = /*#__PURE__*/React.memo(BusinessTreeSearchSelect, function (props, nextProps) {
7519
+ if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
7520
+ return false;
7521
+ }
7522
+
7523
+ if (props && props.value !== nextProps.value) {
7524
+ return false;
7525
+ }
7526
+
7527
+ return true;
7528
+ });
7529
+
5749
7530
  /*
5750
7531
  * @Description:
5751
7532
  * @Author: rodchen
@@ -5756,5 +7537,11 @@ function getStorageVale(storageKeyString) {
5756
7537
 
5757
7538
  var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
5758
7539
  axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
7540
+ axios.defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
7541
+
7542
+ if (localStorage.getItem('x-user-auth-context')) {
7543
+ // @ts-ignore
7544
+ axios.defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
7545
+ }
5759
7546
 
5760
- export { BusinessSearchSelect$1 as BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect };
7547
+ export { AddSelect, BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };