@bit-sun/business-component 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +709 -8
- package/dist/index.js +710 -7
- package/dist/utils/CheckOneUser/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Business/CommodityEntry/index.md +2 -2
- package/src/components/Business/CommodityEntry/index.tsx +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +2 -0
- package/src/components/Business/TreeSearchSelect/index.md +126 -0
- package/src/components/Business/TreeSearchSelect/index.tsx +34 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +60 -0
- package/src/components/Functional/TreeSearchSelect/index.md +47 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +148 -0
- package/src/index.ts +6 -0
package/dist/index.esm.js
CHANGED
|
@@ -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
|
|
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
|
|
|
@@ -3139,7 +3519,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3139
3519
|
} // 防抖函数 待定
|
|
3140
3520
|
|
|
3141
3521
|
|
|
3142
|
-
// 防抖函数 待定
|
|
3143
3522
|
getData(searchParams);
|
|
3144
3523
|
}, {
|
|
3145
3524
|
wait: 1000
|
|
@@ -4611,7 +4990,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4611
4990
|
}];
|
|
4612
4991
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4613
4992
|
pageSize: 5000,
|
|
4614
|
-
currentPage: 1
|
|
4993
|
+
currentPage: 1,
|
|
4994
|
+
'ctl-withAuth': true
|
|
4615
4995
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4616
4996
|
pageSize: 5000,
|
|
4617
4997
|
currentPage: 1
|
|
@@ -4773,7 +5153,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4773
5153
|
}];
|
|
4774
5154
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4775
5155
|
pageSize: 5000,
|
|
4776
|
-
currentPage: 1
|
|
5156
|
+
currentPage: 1,
|
|
5157
|
+
'ctl-withAuth': true
|
|
4777
5158
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4778
5159
|
pageSize: 5000,
|
|
4779
5160
|
currentPage: 1
|
|
@@ -5784,7 +6165,7 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
5784
6165
|
_props$columns = props.columns,
|
|
5785
6166
|
columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
|
|
5786
6167
|
_props$validDataUrl = props.validDataUrl,
|
|
5787
|
-
validDataUrl = _props$validDataUrl === void 0 ? "/
|
|
6168
|
+
validDataUrl = _props$validDataUrl === void 0 ? "/items/api/recordDetailImport/check" : _props$validDataUrl;
|
|
5788
6169
|
|
|
5789
6170
|
var _useState = useState({
|
|
5790
6171
|
maskClosable: false,
|
|
@@ -5907,6 +6288,321 @@ function getStorageVale(storageKeyString) {
|
|
|
5907
6288
|
return "";
|
|
5908
6289
|
}
|
|
5909
6290
|
|
|
6291
|
+
var TreeSearchSelect = function TreeSearchSelect(props) {
|
|
6292
|
+
var _useState = useState([]),
|
|
6293
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6294
|
+
treeData = _useState2[0],
|
|
6295
|
+
setTreeData = _useState2[1];
|
|
6296
|
+
|
|
6297
|
+
var ctx = props.ctx,
|
|
6298
|
+
value = props.value,
|
|
6299
|
+
valueName = props.valueName,
|
|
6300
|
+
onChange = props.onChange,
|
|
6301
|
+
onChangeName = props.onChangeName,
|
|
6302
|
+
placeholder = props.placeholder,
|
|
6303
|
+
remoteSource = props.remoteSource,
|
|
6304
|
+
initialValue = props.initialValue,
|
|
6305
|
+
_props$treeCheckable = props.treeCheckable,
|
|
6306
|
+
treeCheckable = _props$treeCheckable === void 0 ? false : _props$treeCheckable,
|
|
6307
|
+
_props$showSearch = props.showSearch,
|
|
6308
|
+
showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
|
|
6309
|
+
_props$maxTagCount = props.maxTagCount,
|
|
6310
|
+
maxTagCount = _props$maxTagCount === void 0 ? 1 : _props$maxTagCount,
|
|
6311
|
+
_props$multiple = props.multiple,
|
|
6312
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
6313
|
+
_props$isChoose = props.isChoose,
|
|
6314
|
+
isChoose = _props$isChoose === void 0 ? false : _props$isChoose,
|
|
6315
|
+
mode = props.mode,
|
|
6316
|
+
_getPopupContainer = props.getPopupContainer,
|
|
6317
|
+
_props$labelInValue = props.labelInValue,
|
|
6318
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
6319
|
+
_props$showArrow = props.showArrow,
|
|
6320
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
6321
|
+
_props$allowClear = props.allowClear,
|
|
6322
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
6323
|
+
_props$showCheckedStr = props.showCheckedStrategy,
|
|
6324
|
+
showCheckedStrategy = _props$showCheckedStr === void 0 ? TreeSelect.SHOW_PARENT : _props$showCheckedStr,
|
|
6325
|
+
_props$style = props.style,
|
|
6326
|
+
style = _props$style === void 0 ? {
|
|
6327
|
+
width: '100%'
|
|
6328
|
+
} : _props$style,
|
|
6329
|
+
getTreeData = props.getTreeData;
|
|
6330
|
+
var url = remoteSource.url,
|
|
6331
|
+
_remoteSource$paramsK = remoteSource.paramsKey,
|
|
6332
|
+
paramsKey = _remoteSource$paramsK === void 0 ? 'qp-name-like' : _remoteSource$paramsK,
|
|
6333
|
+
_remoteSource$resKeyV = remoteSource.resKeyValue,
|
|
6334
|
+
resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
|
|
6335
|
+
_remoteSource$initial = remoteSource.initialParams,
|
|
6336
|
+
initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
|
|
6337
|
+
|
|
6338
|
+
var mapSearchTree = function mapSearchTree(treeDataItem) {
|
|
6339
|
+
var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
|
|
6340
|
+
return {
|
|
6341
|
+
title: treeDataItem[resKeyValue[1]],
|
|
6342
|
+
key: treeDataItem[resKeyValue[0]],
|
|
6343
|
+
value: treeDataItem[resKeyValue[0]],
|
|
6344
|
+
parentId: treeDataItem.parent,
|
|
6345
|
+
data: _objectSpread2({}, treeDataItem),
|
|
6346
|
+
isLeaf: !haveChildren,
|
|
6347
|
+
disabled: isDisabled(haveChildren),
|
|
6348
|
+
children: haveChildren ? treeDataItem.children.map(function (i) {
|
|
6349
|
+
return mapSearchTree(i);
|
|
6350
|
+
}) : []
|
|
6351
|
+
};
|
|
6352
|
+
};
|
|
6353
|
+
|
|
6354
|
+
var isDisabled = function isDisabled(children) {
|
|
6355
|
+
if (isChoose) {
|
|
6356
|
+
return false;
|
|
6357
|
+
}
|
|
6358
|
+
|
|
6359
|
+
return children;
|
|
6360
|
+
};
|
|
6361
|
+
/* 实时查询 但是目前用的直接是完整数据源, 所以没有使用 */
|
|
6362
|
+
|
|
6363
|
+
|
|
6364
|
+
var handleSearch = function handleSearch(q) {
|
|
6365
|
+
var paramsData = _objectSpread2(_defineProperty({}, "".concat(paramsKey), q), initialParams);
|
|
6366
|
+
|
|
6367
|
+
axios.get("".concat(url, "?").concat(stringify(paramsData))).then( /*#__PURE__*/function () {
|
|
6368
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
6369
|
+
var _ctx$form;
|
|
6370
|
+
|
|
6371
|
+
var resData, coverData, data, dataList;
|
|
6372
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6373
|
+
while (1) {
|
|
6374
|
+
switch (_context.prev = _context.next) {
|
|
6375
|
+
case 0:
|
|
6376
|
+
resData = (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
6377
|
+
|
|
6378
|
+
if (!(resData.status === '0')) {
|
|
6379
|
+
_context.next = 13;
|
|
6380
|
+
break;
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
data = resData.data;
|
|
6384
|
+
|
|
6385
|
+
if (!remoteSource.converter) {
|
|
6386
|
+
_context.next = 9;
|
|
6387
|
+
break;
|
|
6388
|
+
}
|
|
6389
|
+
|
|
6390
|
+
_context.next = 6;
|
|
6391
|
+
return remoteSource.converter({
|
|
6392
|
+
data: [data]
|
|
6393
|
+
});
|
|
6394
|
+
|
|
6395
|
+
case 6:
|
|
6396
|
+
coverData = _context.sent;
|
|
6397
|
+
_context.next = 11;
|
|
6398
|
+
break;
|
|
6399
|
+
|
|
6400
|
+
case 9:
|
|
6401
|
+
dataList = data && Array.isArray(data) ? data : data && [data] || [];
|
|
6402
|
+
coverData = dataList.length && dataList.map(function (ites) {
|
|
6403
|
+
return mapSearchTree(ites);
|
|
6404
|
+
}) || [];
|
|
6405
|
+
|
|
6406
|
+
case 11:
|
|
6407
|
+
_context.next = 14;
|
|
6408
|
+
break;
|
|
6409
|
+
|
|
6410
|
+
case 13:
|
|
6411
|
+
coverData = [];
|
|
6412
|
+
|
|
6413
|
+
case 14:
|
|
6414
|
+
setTreeData(coverData);
|
|
6415
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(ctx.name, coverData);
|
|
6416
|
+
|
|
6417
|
+
case 16:
|
|
6418
|
+
case "end":
|
|
6419
|
+
return _context.stop();
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
}, _callee);
|
|
6423
|
+
}));
|
|
6424
|
+
|
|
6425
|
+
return function (_x) {
|
|
6426
|
+
return _ref.apply(this, arguments);
|
|
6427
|
+
};
|
|
6428
|
+
}());
|
|
6429
|
+
};
|
|
6430
|
+
|
|
6431
|
+
var handleChange = function handleChange(data, dataName) {
|
|
6432
|
+
var _ctx$form2;
|
|
6433
|
+
|
|
6434
|
+
onChange(data);
|
|
6435
|
+
onChangeName && onChangeName(dataName);
|
|
6436
|
+
getTreeData && getTreeData(treeData); // 把树节点暴露出去
|
|
6437
|
+
|
|
6438
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
|
|
6439
|
+
};
|
|
6440
|
+
|
|
6441
|
+
useEffect(function () {
|
|
6442
|
+
handleSearch(initialValue);
|
|
6443
|
+
}, []);
|
|
6444
|
+
|
|
6445
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
6446
|
+
var _onClose = function onClose(e, item) {
|
|
6447
|
+
e.preventDefault();
|
|
6448
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
6449
|
+
return i.value !== item.value;
|
|
6450
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
6451
|
+
return i !== item.value;
|
|
6452
|
+
});
|
|
6453
|
+
var newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter(function (i) {
|
|
6454
|
+
return i !== item.label;
|
|
6455
|
+
});
|
|
6456
|
+
handleChange(newValue, newValueName);
|
|
6457
|
+
};
|
|
6458
|
+
|
|
6459
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
6460
|
+
title: selectedValues.map(function (i) {
|
|
6461
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
6462
|
+
closable: true,
|
|
6463
|
+
onClose: function onClose(e) {
|
|
6464
|
+
return _onClose(e, i);
|
|
6465
|
+
},
|
|
6466
|
+
style: {
|
|
6467
|
+
marginRight: 3,
|
|
6468
|
+
background: '#f5f5f5',
|
|
6469
|
+
height: '24px',
|
|
6470
|
+
border: '1px solid #f0f0f0'
|
|
6471
|
+
}
|
|
6472
|
+
}, i.label);
|
|
6473
|
+
})
|
|
6474
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
6475
|
+
};
|
|
6476
|
+
|
|
6477
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6478
|
+
className: 'tree_search_select'
|
|
6479
|
+
}, /*#__PURE__*/React.createElement(TreeSelect, {
|
|
6480
|
+
treeCheckable: treeCheckable,
|
|
6481
|
+
maxTagCount: maxTagCount,
|
|
6482
|
+
showSearch: showSearch,
|
|
6483
|
+
style: style,
|
|
6484
|
+
value: value,
|
|
6485
|
+
dropdownStyle: {
|
|
6486
|
+
maxHeight: 400,
|
|
6487
|
+
maxWidth: 100,
|
|
6488
|
+
overflow: 'auto'
|
|
6489
|
+
},
|
|
6490
|
+
treeData: treeData,
|
|
6491
|
+
placeholder: placeholder,
|
|
6492
|
+
allowClear: allowClear,
|
|
6493
|
+
labelInValue: labelInValue,
|
|
6494
|
+
showArrow: showArrow,
|
|
6495
|
+
showCheckedStrategy: showCheckedStrategy,
|
|
6496
|
+
treeNodeFilterProp: 'title',
|
|
6497
|
+
treeDefaultExpandAll: true,
|
|
6498
|
+
multiple: multiple,
|
|
6499
|
+
maxTagPlaceholder: maxTagPlaceholder,
|
|
6500
|
+
onChange: handleChange,
|
|
6501
|
+
disabled: mode === 'view' || (ctx === null || ctx === void 0 ? void 0 : ctx.mode) === 'view',
|
|
6502
|
+
getPopupContainer: function getPopupContainer() {
|
|
6503
|
+
return _getPopupContainer && _getPopupContainer() || document.body;
|
|
6504
|
+
}
|
|
6505
|
+
}));
|
|
6506
|
+
};
|
|
6507
|
+
|
|
6508
|
+
var handleDefaultProps = function handleDefaultProps(type) {
|
|
6509
|
+
var result = {};
|
|
6510
|
+
|
|
6511
|
+
switch (type) {
|
|
6512
|
+
case 'department':
|
|
6513
|
+
result = {
|
|
6514
|
+
treeCheckable: true,
|
|
6515
|
+
isChoose: true,
|
|
6516
|
+
remoteSource: {
|
|
6517
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6518
|
+
initialParams: {
|
|
6519
|
+
'orgViewCode': 'administrative-organization-view'
|
|
6520
|
+
},
|
|
6521
|
+
resKeyValue: ['code', 'name']
|
|
6522
|
+
}
|
|
6523
|
+
};
|
|
6524
|
+
break;
|
|
6525
|
+
|
|
6526
|
+
case 'sales-organization':
|
|
6527
|
+
result = {
|
|
6528
|
+
isChoose: true,
|
|
6529
|
+
remoteSource: {
|
|
6530
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6531
|
+
initialParams: {
|
|
6532
|
+
'orgViewCode': 'sales-organizational-view'
|
|
6533
|
+
},
|
|
6534
|
+
resKeyValue: ['code', 'name']
|
|
6535
|
+
}
|
|
6536
|
+
};
|
|
6537
|
+
break;
|
|
6538
|
+
|
|
6539
|
+
case 'purchase-organization':
|
|
6540
|
+
result = {
|
|
6541
|
+
isChoose: true,
|
|
6542
|
+
remoteSource: {
|
|
6543
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6544
|
+
initialParams: {
|
|
6545
|
+
'orgViewCode': 'purchase-organizational-view'
|
|
6546
|
+
},
|
|
6547
|
+
resKeyValue: ['code', 'name']
|
|
6548
|
+
}
|
|
6549
|
+
};
|
|
6550
|
+
break;
|
|
6551
|
+
|
|
6552
|
+
case 'stock-organization':
|
|
6553
|
+
result = {
|
|
6554
|
+
isChoose: true,
|
|
6555
|
+
remoteSource: {
|
|
6556
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6557
|
+
initialParams: {
|
|
6558
|
+
'orgViewCode': 'stock-organizational-view'
|
|
6559
|
+
},
|
|
6560
|
+
resKeyValue: ['code', 'name']
|
|
6561
|
+
}
|
|
6562
|
+
};
|
|
6563
|
+
break;
|
|
6564
|
+
|
|
6565
|
+
default:
|
|
6566
|
+
result = {
|
|
6567
|
+
treeCheckable: true,
|
|
6568
|
+
isChoose: true,
|
|
6569
|
+
remoteSource: {
|
|
6570
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6571
|
+
initialParams: {
|
|
6572
|
+
'orgViewCode': 'administrative-organization-view'
|
|
6573
|
+
},
|
|
6574
|
+
resKeyValue: ['code', 'name']
|
|
6575
|
+
}
|
|
6576
|
+
};
|
|
6577
|
+
break;
|
|
6578
|
+
}
|
|
6579
|
+
|
|
6580
|
+
return result;
|
|
6581
|
+
};
|
|
6582
|
+
|
|
6583
|
+
var MemoTreeSearchSelect = /*#__PURE__*/React.memo(TreeSearchSelect);
|
|
6584
|
+
|
|
6585
|
+
var BusinessTreeSearchSelect = function BusinessTreeSearchSelect(props) {
|
|
6586
|
+
var businessType = (props === null || props === void 0 ? void 0 : props.businessType) || 'department';
|
|
6587
|
+
var handleBusinessProps = handleDefaultProps(businessType);
|
|
6588
|
+
var currentProps = useMemo(function () {
|
|
6589
|
+
return _objectSpread2(_objectSpread2({}, handleBusinessProps), props);
|
|
6590
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
6591
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoTreeSearchSelect, _objectSpread2({}, currentProps)));
|
|
6592
|
+
};
|
|
6593
|
+
|
|
6594
|
+
var index$1 = /*#__PURE__*/React.memo(BusinessTreeSearchSelect, function (props, nextProps) {
|
|
6595
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
6596
|
+
return false;
|
|
6597
|
+
}
|
|
6598
|
+
|
|
6599
|
+
if (props && props.value !== nextProps.value) {
|
|
6600
|
+
return false;
|
|
6601
|
+
}
|
|
6602
|
+
|
|
6603
|
+
return true;
|
|
6604
|
+
});
|
|
6605
|
+
|
|
5910
6606
|
/*
|
|
5911
6607
|
* @Description:
|
|
5912
6608
|
* @Author: rodchen
|
|
@@ -5919,4 +6615,9 @@ var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
|
5919
6615
|
axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
5920
6616
|
axios.defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
|
|
5921
6617
|
|
|
5922
|
-
|
|
6618
|
+
if (localStorage.getItem('x-user-auth-context')) {
|
|
6619
|
+
// @ts-ignore
|
|
6620
|
+
axios.defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
6621
|
+
}
|
|
6622
|
+
|
|
6623
|
+
export { BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };
|