@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.js
CHANGED
|
@@ -44,6 +44,387 @@ function _objectSpread2(target) {
|
|
|
44
44
|
return target;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function _regeneratorRuntime() {
|
|
48
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
49
|
+
|
|
50
|
+
_regeneratorRuntime = function () {
|
|
51
|
+
return exports;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var exports = {},
|
|
55
|
+
Op = Object.prototype,
|
|
56
|
+
hasOwn = Op.hasOwnProperty,
|
|
57
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
58
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
59
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
60
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
61
|
+
|
|
62
|
+
function define(obj, key, value) {
|
|
63
|
+
return Object.defineProperty(obj, key, {
|
|
64
|
+
value: value,
|
|
65
|
+
enumerable: !0,
|
|
66
|
+
configurable: !0,
|
|
67
|
+
writable: !0
|
|
68
|
+
}), obj[key];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
define({}, "");
|
|
73
|
+
} catch (err) {
|
|
74
|
+
define = function (obj, key, value) {
|
|
75
|
+
return obj[key] = value;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
80
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
81
|
+
generator = Object.create(protoGenerator.prototype),
|
|
82
|
+
context = new Context(tryLocsList || []);
|
|
83
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
84
|
+
var state = "suspendedStart";
|
|
85
|
+
return function (method, arg) {
|
|
86
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
87
|
+
|
|
88
|
+
if ("completed" === state) {
|
|
89
|
+
if ("throw" === method) throw arg;
|
|
90
|
+
return doneResult();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (context.method = method, context.arg = arg;;) {
|
|
94
|
+
var delegate = context.delegate;
|
|
95
|
+
|
|
96
|
+
if (delegate) {
|
|
97
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
98
|
+
|
|
99
|
+
if (delegateResult) {
|
|
100
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
101
|
+
return delegateResult;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
106
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
107
|
+
context.dispatchException(context.arg);
|
|
108
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
109
|
+
state = "executing";
|
|
110
|
+
var record = tryCatch(innerFn, self, context);
|
|
111
|
+
|
|
112
|
+
if ("normal" === record.type) {
|
|
113
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
114
|
+
return {
|
|
115
|
+
value: record.arg,
|
|
116
|
+
done: context.done
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}(innerFn, self, context), generator;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function tryCatch(fn, obj, arg) {
|
|
127
|
+
try {
|
|
128
|
+
return {
|
|
129
|
+
type: "normal",
|
|
130
|
+
arg: fn.call(obj, arg)
|
|
131
|
+
};
|
|
132
|
+
} catch (err) {
|
|
133
|
+
return {
|
|
134
|
+
type: "throw",
|
|
135
|
+
arg: err
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
exports.wrap = wrap;
|
|
141
|
+
var ContinueSentinel = {};
|
|
142
|
+
|
|
143
|
+
function Generator() {}
|
|
144
|
+
|
|
145
|
+
function GeneratorFunction() {}
|
|
146
|
+
|
|
147
|
+
function GeneratorFunctionPrototype() {}
|
|
148
|
+
|
|
149
|
+
var IteratorPrototype = {};
|
|
150
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
151
|
+
return this;
|
|
152
|
+
});
|
|
153
|
+
var getProto = Object.getPrototypeOf,
|
|
154
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
155
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
156
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
157
|
+
|
|
158
|
+
function defineIteratorMethods(prototype) {
|
|
159
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
160
|
+
define(prototype, method, function (arg) {
|
|
161
|
+
return this._invoke(method, arg);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
167
|
+
function invoke(method, arg, resolve, reject) {
|
|
168
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
169
|
+
|
|
170
|
+
if ("throw" !== record.type) {
|
|
171
|
+
var result = record.arg,
|
|
172
|
+
value = result.value;
|
|
173
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
174
|
+
invoke("next", value, resolve, reject);
|
|
175
|
+
}, function (err) {
|
|
176
|
+
invoke("throw", err, resolve, reject);
|
|
177
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
178
|
+
result.value = unwrapped, resolve(result);
|
|
179
|
+
}, function (error) {
|
|
180
|
+
return invoke("throw", error, resolve, reject);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
reject(record.arg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var previousPromise;
|
|
188
|
+
|
|
189
|
+
this._invoke = function (method, arg) {
|
|
190
|
+
function callInvokeWithMethodAndArg() {
|
|
191
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
192
|
+
invoke(method, arg, resolve, reject);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
201
|
+
var method = delegate.iterator[context.method];
|
|
202
|
+
|
|
203
|
+
if (undefined === method) {
|
|
204
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
205
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
206
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return ContinueSentinel;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
213
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
214
|
+
var info = record.arg;
|
|
215
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function pushTryEntry(locs) {
|
|
219
|
+
var entry = {
|
|
220
|
+
tryLoc: locs[0]
|
|
221
|
+
};
|
|
222
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function resetTryEntry(entry) {
|
|
226
|
+
var record = entry.completion || {};
|
|
227
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function Context(tryLocsList) {
|
|
231
|
+
this.tryEntries = [{
|
|
232
|
+
tryLoc: "root"
|
|
233
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function values(iterable) {
|
|
237
|
+
if (iterable) {
|
|
238
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
239
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
240
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
241
|
+
|
|
242
|
+
if (!isNaN(iterable.length)) {
|
|
243
|
+
var i = -1,
|
|
244
|
+
next = function next() {
|
|
245
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
246
|
+
|
|
247
|
+
return next.value = undefined, next.done = !0, next;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
return next.next = next;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
next: doneResult
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function doneResult() {
|
|
260
|
+
return {
|
|
261
|
+
value: undefined,
|
|
262
|
+
done: !0
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
267
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
268
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
269
|
+
}, exports.mark = function (genFun) {
|
|
270
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
271
|
+
}, exports.awrap = function (arg) {
|
|
272
|
+
return {
|
|
273
|
+
__await: arg
|
|
274
|
+
};
|
|
275
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
276
|
+
return this;
|
|
277
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
278
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
279
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
280
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
281
|
+
return result.done ? result.value : iter.next();
|
|
282
|
+
});
|
|
283
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
284
|
+
return this;
|
|
285
|
+
}), define(Gp, "toString", function () {
|
|
286
|
+
return "[object Generator]";
|
|
287
|
+
}), exports.keys = function (object) {
|
|
288
|
+
var keys = [];
|
|
289
|
+
|
|
290
|
+
for (var key in object) keys.push(key);
|
|
291
|
+
|
|
292
|
+
return keys.reverse(), function next() {
|
|
293
|
+
for (; keys.length;) {
|
|
294
|
+
var key = keys.pop();
|
|
295
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return next.done = !0, next;
|
|
299
|
+
};
|
|
300
|
+
}, exports.values = values, Context.prototype = {
|
|
301
|
+
constructor: Context,
|
|
302
|
+
reset: function (skipTempReset) {
|
|
303
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
304
|
+
},
|
|
305
|
+
stop: function () {
|
|
306
|
+
this.done = !0;
|
|
307
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
308
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
309
|
+
return this.rval;
|
|
310
|
+
},
|
|
311
|
+
dispatchException: function (exception) {
|
|
312
|
+
if (this.done) throw exception;
|
|
313
|
+
var context = this;
|
|
314
|
+
|
|
315
|
+
function handle(loc, caught) {
|
|
316
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
320
|
+
var entry = this.tryEntries[i],
|
|
321
|
+
record = entry.completion;
|
|
322
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
323
|
+
|
|
324
|
+
if (entry.tryLoc <= this.prev) {
|
|
325
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
326
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
327
|
+
|
|
328
|
+
if (hasCatch && hasFinally) {
|
|
329
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
330
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
331
|
+
} else if (hasCatch) {
|
|
332
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
333
|
+
} else {
|
|
334
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
335
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
abrupt: function (type, arg) {
|
|
341
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
342
|
+
var entry = this.tryEntries[i];
|
|
343
|
+
|
|
344
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
345
|
+
var finallyEntry = entry;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
351
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
352
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
353
|
+
},
|
|
354
|
+
complete: function (record, afterLoc) {
|
|
355
|
+
if ("throw" === record.type) throw record.arg;
|
|
356
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
357
|
+
},
|
|
358
|
+
finish: function (finallyLoc) {
|
|
359
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
360
|
+
var entry = this.tryEntries[i];
|
|
361
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
catch: function (tryLoc) {
|
|
365
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
366
|
+
var entry = this.tryEntries[i];
|
|
367
|
+
|
|
368
|
+
if (entry.tryLoc === tryLoc) {
|
|
369
|
+
var record = entry.completion;
|
|
370
|
+
|
|
371
|
+
if ("throw" === record.type) {
|
|
372
|
+
var thrown = record.arg;
|
|
373
|
+
resetTryEntry(entry);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return thrown;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
throw new Error("illegal catch attempt");
|
|
381
|
+
},
|
|
382
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
383
|
+
return this.delegate = {
|
|
384
|
+
iterator: values(iterable),
|
|
385
|
+
resultName: resultName,
|
|
386
|
+
nextLoc: nextLoc
|
|
387
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
388
|
+
}
|
|
389
|
+
}, exports;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
393
|
+
try {
|
|
394
|
+
var info = gen[key](arg);
|
|
395
|
+
var value = info.value;
|
|
396
|
+
} catch (error) {
|
|
397
|
+
reject(error);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (info.done) {
|
|
402
|
+
resolve(value);
|
|
403
|
+
} else {
|
|
404
|
+
Promise.resolve(value).then(_next, _throw);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function _asyncToGenerator(fn) {
|
|
409
|
+
return function () {
|
|
410
|
+
var self = this,
|
|
411
|
+
args = arguments;
|
|
412
|
+
return new Promise(function (resolve, reject) {
|
|
413
|
+
var gen = fn.apply(self, args);
|
|
414
|
+
|
|
415
|
+
function _next(value) {
|
|
416
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function _throw(err) {
|
|
420
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
_next(undefined);
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
47
428
|
function _classCallCheck(instance, Constructor) {
|
|
48
429
|
if (!(instance instanceof Constructor)) {
|
|
49
430
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -103,18 +484,17 @@ function _inherits(subClass, superClass) {
|
|
|
103
484
|
}
|
|
104
485
|
|
|
105
486
|
function _getPrototypeOf(o) {
|
|
106
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
487
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
107
488
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
108
489
|
};
|
|
109
490
|
return _getPrototypeOf(o);
|
|
110
491
|
}
|
|
111
492
|
|
|
112
493
|
function _setPrototypeOf(o, p) {
|
|
113
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
494
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
114
495
|
o.__proto__ = p;
|
|
115
496
|
return o;
|
|
116
497
|
};
|
|
117
|
-
|
|
118
498
|
return _setPrototypeOf(o, p);
|
|
119
499
|
}
|
|
120
500
|
|
|
@@ -3150,7 +3530,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3150
3530
|
} // 防抖函数 待定
|
|
3151
3531
|
|
|
3152
3532
|
|
|
3153
|
-
// 防抖函数 待定
|
|
3154
3533
|
getData(searchParams);
|
|
3155
3534
|
}, {
|
|
3156
3535
|
wait: 1000
|
|
@@ -4622,7 +5001,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4622
5001
|
}];
|
|
4623
5002
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4624
5003
|
pageSize: 5000,
|
|
4625
|
-
currentPage: 1
|
|
5004
|
+
currentPage: 1,
|
|
5005
|
+
'ctl-withAuth': true
|
|
4626
5006
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4627
5007
|
pageSize: 5000,
|
|
4628
5008
|
currentPage: 1
|
|
@@ -4784,7 +5164,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4784
5164
|
}];
|
|
4785
5165
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4786
5166
|
pageSize: 5000,
|
|
4787
|
-
currentPage: 1
|
|
5167
|
+
currentPage: 1,
|
|
5168
|
+
'ctl-withAuth': true
|
|
4788
5169
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4789
5170
|
pageSize: 5000,
|
|
4790
5171
|
currentPage: 1
|
|
@@ -5795,7 +6176,7 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
5795
6176
|
_props$columns = props.columns,
|
|
5796
6177
|
columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
|
|
5797
6178
|
_props$validDataUrl = props.validDataUrl,
|
|
5798
|
-
validDataUrl = _props$validDataUrl === void 0 ? "/
|
|
6179
|
+
validDataUrl = _props$validDataUrl === void 0 ? "/items/api/recordDetailImport/check" : _props$validDataUrl;
|
|
5799
6180
|
|
|
5800
6181
|
var _useState = React.useState({
|
|
5801
6182
|
maskClosable: false,
|
|
@@ -5918,6 +6299,321 @@ function getStorageVale(storageKeyString) {
|
|
|
5918
6299
|
return "";
|
|
5919
6300
|
}
|
|
5920
6301
|
|
|
6302
|
+
var TreeSearchSelect = function TreeSearchSelect(props) {
|
|
6303
|
+
var _useState = React.useState([]),
|
|
6304
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6305
|
+
treeData = _useState2[0],
|
|
6306
|
+
setTreeData = _useState2[1];
|
|
6307
|
+
|
|
6308
|
+
var ctx = props.ctx,
|
|
6309
|
+
value = props.value,
|
|
6310
|
+
valueName = props.valueName,
|
|
6311
|
+
onChange = props.onChange,
|
|
6312
|
+
onChangeName = props.onChangeName,
|
|
6313
|
+
placeholder = props.placeholder,
|
|
6314
|
+
remoteSource = props.remoteSource,
|
|
6315
|
+
initialValue = props.initialValue,
|
|
6316
|
+
_props$treeCheckable = props.treeCheckable,
|
|
6317
|
+
treeCheckable = _props$treeCheckable === void 0 ? false : _props$treeCheckable,
|
|
6318
|
+
_props$showSearch = props.showSearch,
|
|
6319
|
+
showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
|
|
6320
|
+
_props$maxTagCount = props.maxTagCount,
|
|
6321
|
+
maxTagCount = _props$maxTagCount === void 0 ? 1 : _props$maxTagCount,
|
|
6322
|
+
_props$multiple = props.multiple,
|
|
6323
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
6324
|
+
_props$isChoose = props.isChoose,
|
|
6325
|
+
isChoose = _props$isChoose === void 0 ? false : _props$isChoose,
|
|
6326
|
+
mode = props.mode,
|
|
6327
|
+
_getPopupContainer = props.getPopupContainer,
|
|
6328
|
+
_props$labelInValue = props.labelInValue,
|
|
6329
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
6330
|
+
_props$showArrow = props.showArrow,
|
|
6331
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
6332
|
+
_props$allowClear = props.allowClear,
|
|
6333
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
6334
|
+
_props$showCheckedStr = props.showCheckedStrategy,
|
|
6335
|
+
showCheckedStrategy = _props$showCheckedStr === void 0 ? antd.TreeSelect.SHOW_PARENT : _props$showCheckedStr,
|
|
6336
|
+
_props$style = props.style,
|
|
6337
|
+
style = _props$style === void 0 ? {
|
|
6338
|
+
width: '100%'
|
|
6339
|
+
} : _props$style,
|
|
6340
|
+
getTreeData = props.getTreeData;
|
|
6341
|
+
var url = remoteSource.url,
|
|
6342
|
+
_remoteSource$paramsK = remoteSource.paramsKey,
|
|
6343
|
+
paramsKey = _remoteSource$paramsK === void 0 ? 'qp-name-like' : _remoteSource$paramsK,
|
|
6344
|
+
_remoteSource$resKeyV = remoteSource.resKeyValue,
|
|
6345
|
+
resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
|
|
6346
|
+
_remoteSource$initial = remoteSource.initialParams,
|
|
6347
|
+
initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
|
|
6348
|
+
|
|
6349
|
+
var mapSearchTree = function mapSearchTree(treeDataItem) {
|
|
6350
|
+
var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
|
|
6351
|
+
return {
|
|
6352
|
+
title: treeDataItem[resKeyValue[1]],
|
|
6353
|
+
key: treeDataItem[resKeyValue[0]],
|
|
6354
|
+
value: treeDataItem[resKeyValue[0]],
|
|
6355
|
+
parentId: treeDataItem.parent,
|
|
6356
|
+
data: _objectSpread2({}, treeDataItem),
|
|
6357
|
+
isLeaf: !haveChildren,
|
|
6358
|
+
disabled: isDisabled(haveChildren),
|
|
6359
|
+
children: haveChildren ? treeDataItem.children.map(function (i) {
|
|
6360
|
+
return mapSearchTree(i);
|
|
6361
|
+
}) : []
|
|
6362
|
+
};
|
|
6363
|
+
};
|
|
6364
|
+
|
|
6365
|
+
var isDisabled = function isDisabled(children) {
|
|
6366
|
+
if (isChoose) {
|
|
6367
|
+
return false;
|
|
6368
|
+
}
|
|
6369
|
+
|
|
6370
|
+
return children;
|
|
6371
|
+
};
|
|
6372
|
+
/* 实时查询 但是目前用的直接是完整数据源, 所以没有使用 */
|
|
6373
|
+
|
|
6374
|
+
|
|
6375
|
+
var handleSearch = function handleSearch(q) {
|
|
6376
|
+
var paramsData = _objectSpread2(_defineProperty({}, "".concat(paramsKey), q), initialParams);
|
|
6377
|
+
|
|
6378
|
+
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(paramsData))).then( /*#__PURE__*/function () {
|
|
6379
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
6380
|
+
var _ctx$form;
|
|
6381
|
+
|
|
6382
|
+
var resData, coverData, data, dataList;
|
|
6383
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6384
|
+
while (1) {
|
|
6385
|
+
switch (_context.prev = _context.next) {
|
|
6386
|
+
case 0:
|
|
6387
|
+
resData = (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
6388
|
+
|
|
6389
|
+
if (!(resData.status === '0')) {
|
|
6390
|
+
_context.next = 13;
|
|
6391
|
+
break;
|
|
6392
|
+
}
|
|
6393
|
+
|
|
6394
|
+
data = resData.data;
|
|
6395
|
+
|
|
6396
|
+
if (!remoteSource.converter) {
|
|
6397
|
+
_context.next = 9;
|
|
6398
|
+
break;
|
|
6399
|
+
}
|
|
6400
|
+
|
|
6401
|
+
_context.next = 6;
|
|
6402
|
+
return remoteSource.converter({
|
|
6403
|
+
data: [data]
|
|
6404
|
+
});
|
|
6405
|
+
|
|
6406
|
+
case 6:
|
|
6407
|
+
coverData = _context.sent;
|
|
6408
|
+
_context.next = 11;
|
|
6409
|
+
break;
|
|
6410
|
+
|
|
6411
|
+
case 9:
|
|
6412
|
+
dataList = data && Array.isArray(data) ? data : data && [data] || [];
|
|
6413
|
+
coverData = dataList.length && dataList.map(function (ites) {
|
|
6414
|
+
return mapSearchTree(ites);
|
|
6415
|
+
}) || [];
|
|
6416
|
+
|
|
6417
|
+
case 11:
|
|
6418
|
+
_context.next = 14;
|
|
6419
|
+
break;
|
|
6420
|
+
|
|
6421
|
+
case 13:
|
|
6422
|
+
coverData = [];
|
|
6423
|
+
|
|
6424
|
+
case 14:
|
|
6425
|
+
setTreeData(coverData);
|
|
6426
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(ctx.name, coverData);
|
|
6427
|
+
|
|
6428
|
+
case 16:
|
|
6429
|
+
case "end":
|
|
6430
|
+
return _context.stop();
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
}, _callee);
|
|
6434
|
+
}));
|
|
6435
|
+
|
|
6436
|
+
return function (_x) {
|
|
6437
|
+
return _ref.apply(this, arguments);
|
|
6438
|
+
};
|
|
6439
|
+
}());
|
|
6440
|
+
};
|
|
6441
|
+
|
|
6442
|
+
var handleChange = function handleChange(data, dataName) {
|
|
6443
|
+
var _ctx$form2;
|
|
6444
|
+
|
|
6445
|
+
onChange(data);
|
|
6446
|
+
onChangeName && onChangeName(dataName);
|
|
6447
|
+
getTreeData && getTreeData(treeData); // 把树节点暴露出去
|
|
6448
|
+
|
|
6449
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
|
|
6450
|
+
};
|
|
6451
|
+
|
|
6452
|
+
React.useEffect(function () {
|
|
6453
|
+
handleSearch(initialValue);
|
|
6454
|
+
}, []);
|
|
6455
|
+
|
|
6456
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
6457
|
+
var _onClose = function onClose(e, item) {
|
|
6458
|
+
e.preventDefault();
|
|
6459
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
6460
|
+
return i.value !== item.value;
|
|
6461
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
6462
|
+
return i !== item.value;
|
|
6463
|
+
});
|
|
6464
|
+
var newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter(function (i) {
|
|
6465
|
+
return i !== item.label;
|
|
6466
|
+
});
|
|
6467
|
+
handleChange(newValue, newValueName);
|
|
6468
|
+
};
|
|
6469
|
+
|
|
6470
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
6471
|
+
title: selectedValues.map(function (i) {
|
|
6472
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tag, {
|
|
6473
|
+
closable: true,
|
|
6474
|
+
onClose: function onClose(e) {
|
|
6475
|
+
return _onClose(e, i);
|
|
6476
|
+
},
|
|
6477
|
+
style: {
|
|
6478
|
+
marginRight: 3,
|
|
6479
|
+
background: '#f5f5f5',
|
|
6480
|
+
height: '24px',
|
|
6481
|
+
border: '1px solid #f0f0f0'
|
|
6482
|
+
}
|
|
6483
|
+
}, i.label);
|
|
6484
|
+
})
|
|
6485
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
6486
|
+
};
|
|
6487
|
+
|
|
6488
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6489
|
+
className: 'tree_search_select'
|
|
6490
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, {
|
|
6491
|
+
treeCheckable: treeCheckable,
|
|
6492
|
+
maxTagCount: maxTagCount,
|
|
6493
|
+
showSearch: showSearch,
|
|
6494
|
+
style: style,
|
|
6495
|
+
value: value,
|
|
6496
|
+
dropdownStyle: {
|
|
6497
|
+
maxHeight: 400,
|
|
6498
|
+
maxWidth: 100,
|
|
6499
|
+
overflow: 'auto'
|
|
6500
|
+
},
|
|
6501
|
+
treeData: treeData,
|
|
6502
|
+
placeholder: placeholder,
|
|
6503
|
+
allowClear: allowClear,
|
|
6504
|
+
labelInValue: labelInValue,
|
|
6505
|
+
showArrow: showArrow,
|
|
6506
|
+
showCheckedStrategy: showCheckedStrategy,
|
|
6507
|
+
treeNodeFilterProp: 'title',
|
|
6508
|
+
treeDefaultExpandAll: true,
|
|
6509
|
+
multiple: multiple,
|
|
6510
|
+
maxTagPlaceholder: maxTagPlaceholder,
|
|
6511
|
+
onChange: handleChange,
|
|
6512
|
+
disabled: mode === 'view' || (ctx === null || ctx === void 0 ? void 0 : ctx.mode) === 'view',
|
|
6513
|
+
getPopupContainer: function getPopupContainer() {
|
|
6514
|
+
return _getPopupContainer && _getPopupContainer() || document.body;
|
|
6515
|
+
}
|
|
6516
|
+
}));
|
|
6517
|
+
};
|
|
6518
|
+
|
|
6519
|
+
var handleDefaultProps = function handleDefaultProps(type) {
|
|
6520
|
+
var result = {};
|
|
6521
|
+
|
|
6522
|
+
switch (type) {
|
|
6523
|
+
case 'department':
|
|
6524
|
+
result = {
|
|
6525
|
+
treeCheckable: true,
|
|
6526
|
+
isChoose: true,
|
|
6527
|
+
remoteSource: {
|
|
6528
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6529
|
+
initialParams: {
|
|
6530
|
+
'orgViewCode': 'administrative-organization-view'
|
|
6531
|
+
},
|
|
6532
|
+
resKeyValue: ['code', 'name']
|
|
6533
|
+
}
|
|
6534
|
+
};
|
|
6535
|
+
break;
|
|
6536
|
+
|
|
6537
|
+
case 'sales-organization':
|
|
6538
|
+
result = {
|
|
6539
|
+
isChoose: true,
|
|
6540
|
+
remoteSource: {
|
|
6541
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6542
|
+
initialParams: {
|
|
6543
|
+
'orgViewCode': 'sales-organizational-view'
|
|
6544
|
+
},
|
|
6545
|
+
resKeyValue: ['code', 'name']
|
|
6546
|
+
}
|
|
6547
|
+
};
|
|
6548
|
+
break;
|
|
6549
|
+
|
|
6550
|
+
case 'purchase-organization':
|
|
6551
|
+
result = {
|
|
6552
|
+
isChoose: true,
|
|
6553
|
+
remoteSource: {
|
|
6554
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6555
|
+
initialParams: {
|
|
6556
|
+
'orgViewCode': 'purchase-organizational-view'
|
|
6557
|
+
},
|
|
6558
|
+
resKeyValue: ['code', 'name']
|
|
6559
|
+
}
|
|
6560
|
+
};
|
|
6561
|
+
break;
|
|
6562
|
+
|
|
6563
|
+
case 'stock-organization':
|
|
6564
|
+
result = {
|
|
6565
|
+
isChoose: true,
|
|
6566
|
+
remoteSource: {
|
|
6567
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6568
|
+
initialParams: {
|
|
6569
|
+
'orgViewCode': 'stock-organizational-view'
|
|
6570
|
+
},
|
|
6571
|
+
resKeyValue: ['code', 'name']
|
|
6572
|
+
}
|
|
6573
|
+
};
|
|
6574
|
+
break;
|
|
6575
|
+
|
|
6576
|
+
default:
|
|
6577
|
+
result = {
|
|
6578
|
+
treeCheckable: true,
|
|
6579
|
+
isChoose: true,
|
|
6580
|
+
remoteSource: {
|
|
6581
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
6582
|
+
initialParams: {
|
|
6583
|
+
'orgViewCode': 'administrative-organization-view'
|
|
6584
|
+
},
|
|
6585
|
+
resKeyValue: ['code', 'name']
|
|
6586
|
+
}
|
|
6587
|
+
};
|
|
6588
|
+
break;
|
|
6589
|
+
}
|
|
6590
|
+
|
|
6591
|
+
return result;
|
|
6592
|
+
};
|
|
6593
|
+
|
|
6594
|
+
var MemoTreeSearchSelect = /*#__PURE__*/React__default['default'].memo(TreeSearchSelect);
|
|
6595
|
+
|
|
6596
|
+
var BusinessTreeSearchSelect = function BusinessTreeSearchSelect(props) {
|
|
6597
|
+
var businessType = (props === null || props === void 0 ? void 0 : props.businessType) || 'department';
|
|
6598
|
+
var handleBusinessProps = handleDefaultProps(businessType);
|
|
6599
|
+
var currentProps = React.useMemo(function () {
|
|
6600
|
+
return _objectSpread2(_objectSpread2({}, handleBusinessProps), props);
|
|
6601
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
6602
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(MemoTreeSearchSelect, _objectSpread2({}, currentProps)));
|
|
6603
|
+
};
|
|
6604
|
+
|
|
6605
|
+
var index$1 = /*#__PURE__*/React__default['default'].memo(BusinessTreeSearchSelect, function (props, nextProps) {
|
|
6606
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
6607
|
+
return false;
|
|
6608
|
+
}
|
|
6609
|
+
|
|
6610
|
+
if (props && props.value !== nextProps.value) {
|
|
6611
|
+
return false;
|
|
6612
|
+
}
|
|
6613
|
+
|
|
6614
|
+
return true;
|
|
6615
|
+
});
|
|
6616
|
+
|
|
5921
6617
|
/*
|
|
5922
6618
|
* @Description:
|
|
5923
6619
|
* @Author: rodchen
|
|
@@ -5930,10 +6626,17 @@ var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
|
5930
6626
|
axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
5931
6627
|
axios__default['default'].defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
|
|
5932
6628
|
|
|
6629
|
+
if (localStorage.getItem('x-user-auth-context')) {
|
|
6630
|
+
// @ts-ignore
|
|
6631
|
+
axios__default['default'].defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
6632
|
+
}
|
|
6633
|
+
|
|
5933
6634
|
exports.BusinessSearchSelect = BusinessSearchSelect$1;
|
|
6635
|
+
exports.BusinessTreeSearchSelect = index$1;
|
|
5934
6636
|
exports.CheckOneUser = index;
|
|
5935
6637
|
exports.CommodityEntry = CommodityEntry;
|
|
5936
6638
|
exports.DataImport = DataImport;
|
|
5937
6639
|
exports.DataValidation = DataValidation;
|
|
5938
6640
|
exports.QueryMutipleInput = QueryMutipleInput;
|
|
5939
6641
|
exports.SearchSelect = SearchSelect;
|
|
6642
|
+
exports.TreeSearchSelect = TreeSearchSelect;
|