@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.
- package/.umirc.ts +31 -16
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
- package/dist/components/Business/SearchSelect/common.d.ts +5 -1
- package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
- package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
- package/dist/components/Functional/AddSelect/index.d.ts +3 -0
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +1876 -89
- package/dist/index.js +1877 -87
- 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 +85 -6
- package/src/components/Business/SearchSelect/common.ts +20 -1
- package/src/components/Business/SearchSelect/index.md +60 -30
- package/src/components/Business/SearchSelect/index.tsx +2 -1
- package/src/components/Business/SearchSelect/utils.ts +27 -2
- 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/AddSelect/index.less +275 -0
- package/src/components/Functional/AddSelect/index.md +118 -0
- package/src/components/Functional/AddSelect/index.tsx +795 -0
- package/src/components/Functional/SearchSelect/index.tsx +24 -7
- package/src/components/Functional/TreeSearchSelect/index.md +47 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +148 -0
- package/src/index.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -44,6 +44,387 @@ function _objectSpread2(target) {
|
|
|
44
44
|
return target;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function _regeneratorRuntime() {
|
|
48
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
49
|
+
|
|
50
|
+
_regeneratorRuntime = function () {
|
|
51
|
+
return exports;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var exports = {},
|
|
55
|
+
Op = Object.prototype,
|
|
56
|
+
hasOwn = Op.hasOwnProperty,
|
|
57
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
58
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
59
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
60
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
61
|
+
|
|
62
|
+
function define(obj, key, value) {
|
|
63
|
+
return Object.defineProperty(obj, key, {
|
|
64
|
+
value: value,
|
|
65
|
+
enumerable: !0,
|
|
66
|
+
configurable: !0,
|
|
67
|
+
writable: !0
|
|
68
|
+
}), obj[key];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
define({}, "");
|
|
73
|
+
} catch (err) {
|
|
74
|
+
define = function (obj, key, value) {
|
|
75
|
+
return obj[key] = value;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
80
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
81
|
+
generator = Object.create(protoGenerator.prototype),
|
|
82
|
+
context = new Context(tryLocsList || []);
|
|
83
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
84
|
+
var state = "suspendedStart";
|
|
85
|
+
return function (method, arg) {
|
|
86
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
87
|
+
|
|
88
|
+
if ("completed" === state) {
|
|
89
|
+
if ("throw" === method) throw arg;
|
|
90
|
+
return doneResult();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (context.method = method, context.arg = arg;;) {
|
|
94
|
+
var delegate = context.delegate;
|
|
95
|
+
|
|
96
|
+
if (delegate) {
|
|
97
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
98
|
+
|
|
99
|
+
if (delegateResult) {
|
|
100
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
101
|
+
return delegateResult;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
106
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
107
|
+
context.dispatchException(context.arg);
|
|
108
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
109
|
+
state = "executing";
|
|
110
|
+
var record = tryCatch(innerFn, self, context);
|
|
111
|
+
|
|
112
|
+
if ("normal" === record.type) {
|
|
113
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
114
|
+
return {
|
|
115
|
+
value: record.arg,
|
|
116
|
+
done: context.done
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}(innerFn, self, context), generator;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function tryCatch(fn, obj, arg) {
|
|
127
|
+
try {
|
|
128
|
+
return {
|
|
129
|
+
type: "normal",
|
|
130
|
+
arg: fn.call(obj, arg)
|
|
131
|
+
};
|
|
132
|
+
} catch (err) {
|
|
133
|
+
return {
|
|
134
|
+
type: "throw",
|
|
135
|
+
arg: err
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
exports.wrap = wrap;
|
|
141
|
+
var ContinueSentinel = {};
|
|
142
|
+
|
|
143
|
+
function Generator() {}
|
|
144
|
+
|
|
145
|
+
function GeneratorFunction() {}
|
|
146
|
+
|
|
147
|
+
function GeneratorFunctionPrototype() {}
|
|
148
|
+
|
|
149
|
+
var IteratorPrototype = {};
|
|
150
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
151
|
+
return this;
|
|
152
|
+
});
|
|
153
|
+
var getProto = Object.getPrototypeOf,
|
|
154
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
155
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
156
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
157
|
+
|
|
158
|
+
function defineIteratorMethods(prototype) {
|
|
159
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
160
|
+
define(prototype, method, function (arg) {
|
|
161
|
+
return this._invoke(method, arg);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
167
|
+
function invoke(method, arg, resolve, reject) {
|
|
168
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
169
|
+
|
|
170
|
+
if ("throw" !== record.type) {
|
|
171
|
+
var result = record.arg,
|
|
172
|
+
value = result.value;
|
|
173
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
174
|
+
invoke("next", value, resolve, reject);
|
|
175
|
+
}, function (err) {
|
|
176
|
+
invoke("throw", err, resolve, reject);
|
|
177
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
178
|
+
result.value = unwrapped, resolve(result);
|
|
179
|
+
}, function (error) {
|
|
180
|
+
return invoke("throw", error, resolve, reject);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
reject(record.arg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var previousPromise;
|
|
188
|
+
|
|
189
|
+
this._invoke = function (method, arg) {
|
|
190
|
+
function callInvokeWithMethodAndArg() {
|
|
191
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
192
|
+
invoke(method, arg, resolve, reject);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
201
|
+
var method = delegate.iterator[context.method];
|
|
202
|
+
|
|
203
|
+
if (undefined === method) {
|
|
204
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
205
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
206
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return ContinueSentinel;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
213
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
214
|
+
var info = record.arg;
|
|
215
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function pushTryEntry(locs) {
|
|
219
|
+
var entry = {
|
|
220
|
+
tryLoc: locs[0]
|
|
221
|
+
};
|
|
222
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function resetTryEntry(entry) {
|
|
226
|
+
var record = entry.completion || {};
|
|
227
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function Context(tryLocsList) {
|
|
231
|
+
this.tryEntries = [{
|
|
232
|
+
tryLoc: "root"
|
|
233
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function values(iterable) {
|
|
237
|
+
if (iterable) {
|
|
238
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
239
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
240
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
241
|
+
|
|
242
|
+
if (!isNaN(iterable.length)) {
|
|
243
|
+
var i = -1,
|
|
244
|
+
next = function next() {
|
|
245
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
246
|
+
|
|
247
|
+
return next.value = undefined, next.done = !0, next;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
return next.next = next;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
next: doneResult
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function doneResult() {
|
|
260
|
+
return {
|
|
261
|
+
value: undefined,
|
|
262
|
+
done: !0
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
267
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
268
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
269
|
+
}, exports.mark = function (genFun) {
|
|
270
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
271
|
+
}, exports.awrap = function (arg) {
|
|
272
|
+
return {
|
|
273
|
+
__await: arg
|
|
274
|
+
};
|
|
275
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
276
|
+
return this;
|
|
277
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
278
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
279
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
280
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
281
|
+
return result.done ? result.value : iter.next();
|
|
282
|
+
});
|
|
283
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
284
|
+
return this;
|
|
285
|
+
}), define(Gp, "toString", function () {
|
|
286
|
+
return "[object Generator]";
|
|
287
|
+
}), exports.keys = function (object) {
|
|
288
|
+
var keys = [];
|
|
289
|
+
|
|
290
|
+
for (var key in object) keys.push(key);
|
|
291
|
+
|
|
292
|
+
return keys.reverse(), function next() {
|
|
293
|
+
for (; keys.length;) {
|
|
294
|
+
var key = keys.pop();
|
|
295
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return next.done = !0, next;
|
|
299
|
+
};
|
|
300
|
+
}, exports.values = values, Context.prototype = {
|
|
301
|
+
constructor: Context,
|
|
302
|
+
reset: function (skipTempReset) {
|
|
303
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
304
|
+
},
|
|
305
|
+
stop: function () {
|
|
306
|
+
this.done = !0;
|
|
307
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
308
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
309
|
+
return this.rval;
|
|
310
|
+
},
|
|
311
|
+
dispatchException: function (exception) {
|
|
312
|
+
if (this.done) throw exception;
|
|
313
|
+
var context = this;
|
|
314
|
+
|
|
315
|
+
function handle(loc, caught) {
|
|
316
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
320
|
+
var entry = this.tryEntries[i],
|
|
321
|
+
record = entry.completion;
|
|
322
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
323
|
+
|
|
324
|
+
if (entry.tryLoc <= this.prev) {
|
|
325
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
326
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
327
|
+
|
|
328
|
+
if (hasCatch && hasFinally) {
|
|
329
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
330
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
331
|
+
} else if (hasCatch) {
|
|
332
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
333
|
+
} else {
|
|
334
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
335
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
abrupt: function (type, arg) {
|
|
341
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
342
|
+
var entry = this.tryEntries[i];
|
|
343
|
+
|
|
344
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
345
|
+
var finallyEntry = entry;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
351
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
352
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
353
|
+
},
|
|
354
|
+
complete: function (record, afterLoc) {
|
|
355
|
+
if ("throw" === record.type) throw record.arg;
|
|
356
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
357
|
+
},
|
|
358
|
+
finish: function (finallyLoc) {
|
|
359
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
360
|
+
var entry = this.tryEntries[i];
|
|
361
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
catch: function (tryLoc) {
|
|
365
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
366
|
+
var entry = this.tryEntries[i];
|
|
367
|
+
|
|
368
|
+
if (entry.tryLoc === tryLoc) {
|
|
369
|
+
var record = entry.completion;
|
|
370
|
+
|
|
371
|
+
if ("throw" === record.type) {
|
|
372
|
+
var thrown = record.arg;
|
|
373
|
+
resetTryEntry(entry);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return thrown;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
throw new Error("illegal catch attempt");
|
|
381
|
+
},
|
|
382
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
383
|
+
return this.delegate = {
|
|
384
|
+
iterator: values(iterable),
|
|
385
|
+
resultName: resultName,
|
|
386
|
+
nextLoc: nextLoc
|
|
387
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
388
|
+
}
|
|
389
|
+
}, exports;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
393
|
+
try {
|
|
394
|
+
var info = gen[key](arg);
|
|
395
|
+
var value = info.value;
|
|
396
|
+
} catch (error) {
|
|
397
|
+
reject(error);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (info.done) {
|
|
402
|
+
resolve(value);
|
|
403
|
+
} else {
|
|
404
|
+
Promise.resolve(value).then(_next, _throw);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function _asyncToGenerator(fn) {
|
|
409
|
+
return function () {
|
|
410
|
+
var self = this,
|
|
411
|
+
args = arguments;
|
|
412
|
+
return new Promise(function (resolve, reject) {
|
|
413
|
+
var gen = fn.apply(self, args);
|
|
414
|
+
|
|
415
|
+
function _next(value) {
|
|
416
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function _throw(err) {
|
|
420
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
_next(undefined);
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
47
428
|
function _classCallCheck(instance, Constructor) {
|
|
48
429
|
if (!(instance instanceof Constructor)) {
|
|
49
430
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -103,18 +484,17 @@ function _inherits(subClass, superClass) {
|
|
|
103
484
|
}
|
|
104
485
|
|
|
105
486
|
function _getPrototypeOf(o) {
|
|
106
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
487
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
107
488
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
108
489
|
};
|
|
109
490
|
return _getPrototypeOf(o);
|
|
110
491
|
}
|
|
111
492
|
|
|
112
493
|
function _setPrototypeOf(o, p) {
|
|
113
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
494
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
114
495
|
o.__proto__ = p;
|
|
115
496
|
return o;
|
|
116
497
|
};
|
|
117
|
-
|
|
118
498
|
return _setPrototypeOf(o, p);
|
|
119
499
|
}
|
|
120
500
|
|
|
@@ -1552,6 +1932,19 @@ var CaretLeftOutlined$1 = function CaretLeftOutlined$1(props, ref) {
|
|
|
1552
1932
|
CaretLeftOutlined$1.displayName = 'CaretLeftOutlined';
|
|
1553
1933
|
var CaretLeftOutlined$2 = /*#__PURE__*/React.forwardRef(CaretLeftOutlined$1);
|
|
1554
1934
|
|
|
1935
|
+
// This icon file is generated automatically.
|
|
1936
|
+
var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { "tag": "path", "attrs": { "d": "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "close-circle", "theme": "outlined" };
|
|
1937
|
+
|
|
1938
|
+
var CloseCircleOutlined$1 = function CloseCircleOutlined$1(props, ref) {
|
|
1939
|
+
return /*#__PURE__*/React.createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
1940
|
+
ref: ref,
|
|
1941
|
+
icon: CloseCircleOutlined
|
|
1942
|
+
}));
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
CloseCircleOutlined$1.displayName = 'CloseCircleOutlined';
|
|
1946
|
+
var CloseCircleOutlined$2 = /*#__PURE__*/React.forwardRef(CloseCircleOutlined$1);
|
|
1947
|
+
|
|
1555
1948
|
// This icon file is generated automatically.
|
|
1556
1949
|
var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
|
|
1557
1950
|
|
|
@@ -3083,6 +3476,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3083
3476
|
|
|
3084
3477
|
var currentPage = 1;
|
|
3085
3478
|
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
3479
|
+
var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
|
|
3086
3480
|
|
|
3087
3481
|
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
3088
3482
|
// 以下属性不可更改----设计配置项
|
|
@@ -3139,7 +3533,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3139
3533
|
var searchParams = {};
|
|
3140
3534
|
|
|
3141
3535
|
if (typeof selectParamsKey === 'string') {
|
|
3142
|
-
searchParams = _defineProperty({},
|
|
3536
|
+
searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
|
|
3143
3537
|
}
|
|
3144
3538
|
|
|
3145
3539
|
if (Array.isArray(selectParamsKey)) {
|
|
@@ -3149,7 +3543,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3149
3543
|
} // 防抖函数 待定
|
|
3150
3544
|
|
|
3151
3545
|
|
|
3152
|
-
// 防抖函数 待定
|
|
3153
3546
|
getData(searchParams);
|
|
3154
3547
|
}, {
|
|
3155
3548
|
wait: 1000
|
|
@@ -3334,10 +3727,12 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3334
3727
|
}, otherParams), fixedParam), params);
|
|
3335
3728
|
|
|
3336
3729
|
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
|
|
3730
|
+
var _result, _result2;
|
|
3731
|
+
|
|
3337
3732
|
setFetching(false);
|
|
3338
3733
|
result = result.data;
|
|
3339
3734
|
|
|
3340
|
-
if (result.status !== '0') {
|
|
3735
|
+
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') {
|
|
3341
3736
|
antd.message.error(result.msg);
|
|
3342
3737
|
return;
|
|
3343
3738
|
}
|
|
@@ -3459,7 +3854,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3459
3854
|
React.useEffect(function () {
|
|
3460
3855
|
if (value) {
|
|
3461
3856
|
setPopValue(value);
|
|
3462
|
-
onChange(value);
|
|
3463
3857
|
}
|
|
3464
3858
|
}, [value]);
|
|
3465
3859
|
React.useEffect(function () {
|
|
@@ -3528,9 +3922,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3528
3922
|
if (labelInValue) {
|
|
3529
3923
|
var formatResult = value.map(function (i) {
|
|
3530
3924
|
return {
|
|
3531
|
-
key: i
|
|
3532
|
-
label: i
|
|
3533
|
-
value: i
|
|
3925
|
+
key: i[mappingValueField],
|
|
3926
|
+
label: i[mappingTextField],
|
|
3927
|
+
value: i[mappingValueField]
|
|
3534
3928
|
};
|
|
3535
3929
|
});
|
|
3536
3930
|
onChange(selectMode ? formatResult : formatResult[0]);
|
|
@@ -3709,6 +4103,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3709
4103
|
selectedRowKeys: selectedRowKeys,
|
|
3710
4104
|
onChange: function onChange(sks, srs) {
|
|
3711
4105
|
onChangeSelectedKeys(sks, srs);
|
|
4106
|
+
},
|
|
4107
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
4108
|
+
return {
|
|
4109
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4110
|
+
};
|
|
3712
4111
|
}
|
|
3713
4112
|
};
|
|
3714
4113
|
|
|
@@ -3729,7 +4128,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3729
4128
|
var formItem = function formItem(list) {
|
|
3730
4129
|
if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
3731
4130
|
return list.map(function (i) {
|
|
3732
|
-
var _i$field, _i$field3, _i$field5;
|
|
4131
|
+
var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
|
|
3733
4132
|
|
|
3734
4133
|
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') {
|
|
3735
4134
|
var _i$field2, _i$initialSource;
|
|
@@ -3766,12 +4165,24 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3766
4165
|
}, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
|
|
3767
4166
|
}
|
|
3768
4167
|
|
|
3769
|
-
if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect') {
|
|
4168
|
+
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') {
|
|
3770
4169
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
3771
4170
|
name: i.name,
|
|
3772
4171
|
label: i.label,
|
|
3773
4172
|
key: i.name
|
|
3774
4173
|
}, /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
|
|
4174
|
+
}
|
|
4175
|
+
|
|
4176
|
+
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') {
|
|
4177
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4178
|
+
name: i.name,
|
|
4179
|
+
label: i.label,
|
|
4180
|
+
key: i.name
|
|
4181
|
+
}, /*#__PURE__*/React__default['default'].createElement(QueryMutipleInput, {
|
|
4182
|
+
onValueChange: function onValueChange(value) {
|
|
4183
|
+
form.setFieldsValue(_defineProperty({}, i.name, value));
|
|
4184
|
+
}
|
|
4185
|
+
})));
|
|
3775
4186
|
} // 默认type是input
|
|
3776
4187
|
|
|
3777
4188
|
|
|
@@ -3786,7 +4197,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3786
4197
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
3787
4198
|
allowClear: true,
|
|
3788
4199
|
maxLength: 100
|
|
3789
|
-
}, i === null || i === void 0 ? void 0 : (_i$
|
|
4200
|
+
}, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
|
|
3790
4201
|
});
|
|
3791
4202
|
} else {
|
|
3792
4203
|
return null;
|
|
@@ -3981,88 +4392,1013 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3981
4392
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
3982
4393
|
indeterminate: indeterminate,
|
|
3983
4394
|
checked: checkedAll,
|
|
3984
|
-
onChange: onChangeCheckAll
|
|
4395
|
+
onChange: onChangeCheckAll,
|
|
4396
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3985
4397
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
3986
4398
|
};
|
|
3987
4399
|
|
|
3988
|
-
var
|
|
3989
|
-
|
|
3990
|
-
value: 'online'
|
|
3991
|
-
}, {
|
|
3992
|
-
text: "线下",
|
|
3993
|
-
value: 'offline'
|
|
3994
|
-
}];
|
|
3995
|
-
var arrivalPaySupportList = [{
|
|
3996
|
-
text: "支持",
|
|
3997
|
-
value: 1
|
|
3998
|
-
}, {
|
|
3999
|
-
text: "不支持",
|
|
4000
|
-
value: 0
|
|
4001
|
-
}];
|
|
4002
|
-
var sharingType = [{
|
|
4003
|
-
text: "共享",
|
|
4004
|
-
value: '10'
|
|
4005
|
-
}, {
|
|
4006
|
-
text: "私有",
|
|
4007
|
-
value: '20'
|
|
4008
|
-
}];
|
|
4009
|
-
|
|
4010
|
-
var getDicData = function getDicData(dicCode) {
|
|
4011
|
-
var dicData = {};
|
|
4012
|
-
|
|
4013
|
-
{
|
|
4014
|
-
var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
|
|
4015
|
-
dicData = storageDic[dicCode];
|
|
4016
|
-
} // @ts-ignore
|
|
4400
|
+
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";
|
|
4401
|
+
styleInject(css_248z$4);
|
|
4017
4402
|
|
|
4403
|
+
var Option$1 = antd.Select.Option;
|
|
4018
4404
|
|
|
4019
|
-
|
|
4405
|
+
var AddSelect = function AddSelect(props) {
|
|
4406
|
+
var value = props.value,
|
|
4407
|
+
onChange = props.onChange,
|
|
4408
|
+
_props$selectProps = props.selectProps,
|
|
4409
|
+
selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
|
|
4410
|
+
_props$modalTableProp = props.modalTableProps,
|
|
4411
|
+
modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
|
|
4412
|
+
_props$labelInValue = props.labelInValue,
|
|
4413
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
4414
|
+
requestConfig = props.requestConfig,
|
|
4415
|
+
ctx = props.ctx,
|
|
4416
|
+
sourceName = props.sourceName,
|
|
4417
|
+
_props$needModalTable = props.needModalTable,
|
|
4418
|
+
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
|
|
4419
|
+
_props$getPopupContai = props.getPopupContainer,
|
|
4420
|
+
onSaveCallback = props.onSaveCallback;
|
|
4020
4421
|
|
|
4021
|
-
|
|
4022
|
-
|
|
4422
|
+
var _ref = requestConfig || {},
|
|
4423
|
+
url = _ref.url,
|
|
4424
|
+
otherParams = _ref.otherParams,
|
|
4425
|
+
isMap = _ref.isMap,
|
|
4426
|
+
fixedparameter = _ref.fixedparameter,
|
|
4427
|
+
fieldValToParam = _ref.fieldValToParam,
|
|
4428
|
+
_ref$mappingTextField = _ref.mappingTextField,
|
|
4429
|
+
mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
|
|
4430
|
+
mappingTextShowKeyField = _ref.mappingTextShowKeyField,
|
|
4431
|
+
_ref$mappingValueFiel = _ref.mappingValueField,
|
|
4432
|
+
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
|
|
4433
|
+
mappingTextShowTextField = _ref.mappingTextShowTextField;
|
|
4023
4434
|
|
|
4024
|
-
var
|
|
4025
|
-
var
|
|
4026
|
-
var dicData = getDicData(dicCode);
|
|
4435
|
+
var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
|
|
4436
|
+
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
4027
4437
|
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
// @ts-ignore
|
|
4031
|
-
dicData = dicData.map(function (item) {
|
|
4032
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
4033
|
-
value: parseFloat(item.value)
|
|
4034
|
-
});
|
|
4035
|
-
});
|
|
4036
|
-
}
|
|
4037
|
-
} catch (e) {}
|
|
4438
|
+
var initVal = value || (selectMode ? [] : null);
|
|
4439
|
+
var pageSize = 100; // 下拉框默认分页 条数
|
|
4038
4440
|
|
|
4039
|
-
|
|
4040
|
-
};
|
|
4441
|
+
var tableInitPageSize = 10; // 弹框默认分页 条数
|
|
4041
4442
|
|
|
4042
|
-
var
|
|
4043
|
-
var
|
|
4044
|
-
|
|
4443
|
+
var currentPage = 1;
|
|
4444
|
+
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
4445
|
+
var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
|
|
4045
4446
|
|
|
4046
|
-
var
|
|
4047
|
-
|
|
4447
|
+
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
4448
|
+
// 以下属性不可更改----设计配置项
|
|
4449
|
+
showSearch: false,
|
|
4450
|
+
filterOption: false,
|
|
4451
|
+
allowClear: true,
|
|
4452
|
+
listHeight: 160,
|
|
4453
|
+
optionLabelProp: "label",
|
|
4454
|
+
autoClearSearchValue: false
|
|
4048
4455
|
});
|
|
4049
4456
|
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4457
|
+
var _useState = React.useState([]),
|
|
4458
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4459
|
+
items = _useState2[0],
|
|
4460
|
+
setItems = _useState2[1];
|
|
4461
|
+
|
|
4462
|
+
var _useState3 = React.useState(1),
|
|
4463
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4464
|
+
scrollPage = _useState4[0],
|
|
4465
|
+
setScrollPage = _useState4[1];
|
|
4466
|
+
|
|
4467
|
+
var _useState5 = React.useState(0),
|
|
4468
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4469
|
+
itemsTotal = _useState6[0],
|
|
4470
|
+
setItemsTotal = _useState6[1];
|
|
4471
|
+
|
|
4472
|
+
var _useState7 = React.useState(false),
|
|
4473
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
4474
|
+
fetching = _useState8[0],
|
|
4475
|
+
setFetching = _useState8[1];
|
|
4476
|
+
|
|
4477
|
+
var _useState9 = React.useState(''),
|
|
4478
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
4479
|
+
searchValue = _useState10[0],
|
|
4480
|
+
setSearchValue = _useState10[1];
|
|
4481
|
+
|
|
4482
|
+
var _useState11 = React.useState(false),
|
|
4483
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
4484
|
+
isModalVisible = _useState12[0],
|
|
4485
|
+
setIsModalVisible = _useState12[1];
|
|
4486
|
+
|
|
4487
|
+
var _useState13 = React.useState(initVal),
|
|
4488
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
4489
|
+
popvalue = _useState14[0],
|
|
4490
|
+
setPopValue = _useState14[1];
|
|
4491
|
+
|
|
4492
|
+
var _useState15 = React.useState(sourceName),
|
|
4493
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
4494
|
+
uniqueValue = _useState16[0],
|
|
4495
|
+
setUniqueValue = _useState16[1];
|
|
4496
|
+
|
|
4497
|
+
var _useDebounceFn = ahooks.useDebounceFn(function (v) {
|
|
4498
|
+
// 优化搜索参数 支持传多个
|
|
4499
|
+
var searchParams = {};
|
|
4500
|
+
|
|
4501
|
+
if (typeof selectParamsKey === 'string') {
|
|
4502
|
+
searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
if (Array.isArray(selectParamsKey)) {
|
|
4506
|
+
selectParamsKey.forEach(function (i) {
|
|
4507
|
+
searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
|
|
4508
|
+
});
|
|
4509
|
+
} // 防抖函数 待定
|
|
4510
|
+
|
|
4511
|
+
|
|
4512
|
+
getData(searchParams);
|
|
4513
|
+
}, {
|
|
4514
|
+
wait: 1000
|
|
4515
|
+
}),
|
|
4516
|
+
run = _useDebounceFn.run;
|
|
4517
|
+
|
|
4518
|
+
var _Form$useForm = antd.Form.useForm(),
|
|
4519
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
4520
|
+
form = _Form$useForm2[0];
|
|
4521
|
+
|
|
4522
|
+
var _useState17 = React.useState(true),
|
|
4523
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
4524
|
+
caretLeftFlag = _useState18[0],
|
|
4525
|
+
setCaretLeftFlag = _useState18[1];
|
|
4526
|
+
|
|
4527
|
+
var _useState19 = React.useState([]),
|
|
4528
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4529
|
+
tableData = _useState20[0],
|
|
4530
|
+
setTableData = _useState20[1];
|
|
4531
|
+
|
|
4532
|
+
var _useState21 = React.useState({
|
|
4533
|
+
total: 0,
|
|
4534
|
+
size: "small",
|
|
4535
|
+
current: 1,
|
|
4536
|
+
pageSize: tableInitPageSize
|
|
4537
|
+
}),
|
|
4538
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
4539
|
+
tablePagination = _useState22[0],
|
|
4540
|
+
setTablePagination = _useState22[1];
|
|
4541
|
+
|
|
4542
|
+
var _useState23 = React.useState([]),
|
|
4543
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
4544
|
+
selectedRowKeys = _useState24[0],
|
|
4545
|
+
setSelectedRowKeys = _useState24[1];
|
|
4546
|
+
|
|
4547
|
+
var _useState25 = React.useState([]),
|
|
4548
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
4549
|
+
doubleArr = _useState26[0],
|
|
4550
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
4551
|
+
|
|
4552
|
+
|
|
4553
|
+
var _useState27 = React.useState(false),
|
|
4554
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
4555
|
+
checkedAll = _useState28[0],
|
|
4556
|
+
setCheckedAll = _useState28[1];
|
|
4557
|
+
|
|
4558
|
+
var _useState29 = React.useState(false),
|
|
4559
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
4560
|
+
indeterminate = _useState30[0],
|
|
4561
|
+
setIndeterminate = _useState30[1];
|
|
4562
|
+
|
|
4563
|
+
var _useState31 = React.useState({}),
|
|
4564
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
4565
|
+
tableFormParams = _useState32[0],
|
|
4566
|
+
setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
4567
|
+
|
|
4568
|
+
|
|
4569
|
+
var getData = function getData() {
|
|
4570
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4571
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
4572
|
+
if (!requestConfig) return;
|
|
4573
|
+
setFetching(true); // 处理dependence参数
|
|
4574
|
+
|
|
4575
|
+
var fixedParam = {};
|
|
4576
|
+
|
|
4577
|
+
if (fixedparameter && fieldValToParam && ctx) {
|
|
4578
|
+
fixedparameter.forEach(function (item, index) {
|
|
4579
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4580
|
+
|
|
4581
|
+
if (fixedParamVal) {
|
|
4582
|
+
fixedParam[item] = fixedParamVal;
|
|
4583
|
+
form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
|
|
4584
|
+
}
|
|
4585
|
+
});
|
|
4586
|
+
} // 数组对象处理,对带有特殊标记的name进行处理
|
|
4587
|
+
|
|
4588
|
+
|
|
4589
|
+
for (var key in params) {
|
|
4590
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
4591
|
+
(function () {
|
|
4592
|
+
var element = params[key];
|
|
4593
|
+
|
|
4594
|
+
if (element && key.indexOf('*number*') >= 0) {
|
|
4595
|
+
var dataParams = key.split('*number*');
|
|
4596
|
+
dataParams.forEach(function (value, index) {
|
|
4597
|
+
params[value] = element[index];
|
|
4598
|
+
});
|
|
4599
|
+
delete params[key];
|
|
4600
|
+
} else if (element && key.indexOf('*address*') >= 0) {
|
|
4601
|
+
var _dataParams = key.split('*address*');
|
|
4602
|
+
|
|
4603
|
+
_dataParams.forEach(function (value, index) {
|
|
4604
|
+
params[value] = element.PCDCode[index];
|
|
4605
|
+
});
|
|
4606
|
+
|
|
4607
|
+
delete params[key];
|
|
4608
|
+
} else if (element && key.indexOf('*costType*') >= 0) {
|
|
4609
|
+
var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
|
|
4610
|
+
|
|
4611
|
+
|
|
4612
|
+
params[_dataParams2[0]] = element[1];
|
|
4613
|
+
delete params[key];
|
|
4614
|
+
} else if (element && key.indexOf('*fullDate*') >= 0) {
|
|
4615
|
+
var _dataParams3 = key.split('*fullDate*');
|
|
4616
|
+
|
|
4617
|
+
_dataParams3.forEach(function (value, index) {
|
|
4618
|
+
if (index === 0) {
|
|
4619
|
+
params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
|
|
4620
|
+
} else {
|
|
4621
|
+
params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
|
|
4622
|
+
}
|
|
4623
|
+
});
|
|
4624
|
+
|
|
4625
|
+
delete params[key];
|
|
4626
|
+
} else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
|
|
4627
|
+
var _dataParams4 = key.split('*checkBox*');
|
|
4628
|
+
|
|
4629
|
+
if (element) {
|
|
4630
|
+
params[_dataParams4[0]] = 0;
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
delete params[key];
|
|
4634
|
+
} else if (element && key.indexOf('*cascader*') >= 0) {
|
|
4635
|
+
var _dataParams5 = key.split('*cascader*');
|
|
4636
|
+
|
|
4637
|
+
params[_dataParams5[0]] = element[element.length - 1];
|
|
4638
|
+
delete params[key];
|
|
4639
|
+
} else if (element && key.indexOf('*date*') >= 0) {
|
|
4640
|
+
var _dataParams6 = key.split('*date*');
|
|
4641
|
+
|
|
4642
|
+
_dataParams6.forEach(function (value, index) {
|
|
4643
|
+
if (index === 0) {
|
|
4644
|
+
params[value] = moment(element[index]).format('YYYY-MM-DD');
|
|
4645
|
+
} else {
|
|
4646
|
+
params[value] = moment(element[index]).format('YYYY-MM-DD');
|
|
4647
|
+
}
|
|
4648
|
+
});
|
|
4649
|
+
|
|
4650
|
+
delete params[key];
|
|
4651
|
+
} else if (element && key.indexOf('*') >= 0) {
|
|
4652
|
+
var _dataParams7 = key.split('*');
|
|
4653
|
+
|
|
4654
|
+
_dataParams7.forEach(function (value, index) {
|
|
4655
|
+
params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
|
|
4656
|
+
});
|
|
4657
|
+
|
|
4658
|
+
delete params[key];
|
|
4659
|
+
} else if (element && key.indexOf('_selectNumberRange') >= 0) {
|
|
4660
|
+
// key = xxxxx_selectNumberRange qp-xxxxx-gt
|
|
4661
|
+
var _dataParams8 = key.split('_selectNumberRange')[0];
|
|
4662
|
+
|
|
4663
|
+
if (params[key][0] === 'range') {
|
|
4664
|
+
if (params[key][1][0]) {
|
|
4665
|
+
params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
|
|
4666
|
+
}
|
|
4667
|
+
|
|
4668
|
+
if (params[key][1][1]) {
|
|
4669
|
+
params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
|
|
4670
|
+
}
|
|
4671
|
+
} else {
|
|
4672
|
+
params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4675
|
+
delete params[key];
|
|
4676
|
+
} else if (Array.isArray(element)) {
|
|
4677
|
+
params[key] = element.join(',');
|
|
4678
|
+
} else if (element == null || element === undefined || String(element).trim() === '') {
|
|
4679
|
+
delete params[key];
|
|
4680
|
+
}
|
|
4681
|
+
})();
|
|
4682
|
+
}
|
|
4683
|
+
}
|
|
4684
|
+
|
|
4685
|
+
var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
4686
|
+
pageSize: pageSize,
|
|
4687
|
+
currentPage: currentPage
|
|
4688
|
+
}, otherParams), fixedParam), params);
|
|
4689
|
+
|
|
4690
|
+
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
|
|
4691
|
+
var _result, _result2;
|
|
4692
|
+
|
|
4693
|
+
setFetching(false);
|
|
4694
|
+
result = result.data;
|
|
4695
|
+
|
|
4696
|
+
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') {
|
|
4697
|
+
antd.message.error(result.msg);
|
|
4698
|
+
return;
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4701
|
+
var res = result.data;
|
|
4702
|
+
var source = [];
|
|
4703
|
+
|
|
4704
|
+
if (isMap) {
|
|
4705
|
+
source = Object.keys(res).map(function (d, i) {
|
|
4706
|
+
return {
|
|
4707
|
+
text: Object.values(res)[i],
|
|
4708
|
+
value: d
|
|
4709
|
+
};
|
|
4710
|
+
});
|
|
4711
|
+
} else {
|
|
4712
|
+
var keys = res.list ? 'list' : 'items';
|
|
4713
|
+
source = res ? res[keys] ? res[keys].map(function (item) {
|
|
4714
|
+
var textShowText = item[mappingTextField];
|
|
4715
|
+
|
|
4716
|
+
if (mappingTextShowTextField) {
|
|
4717
|
+
textShowText = [];
|
|
4718
|
+
|
|
4719
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
4720
|
+
mappingTextShowTextField.forEach(function (r) {
|
|
4721
|
+
textShowText.push(item[r]);
|
|
4722
|
+
});
|
|
4723
|
+
} else {
|
|
4724
|
+
textShowText = item[mappingTextShowTextField];
|
|
4725
|
+
}
|
|
4726
|
+
}
|
|
4727
|
+
|
|
4728
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
4729
|
+
text: item[mappingTextField],
|
|
4730
|
+
textShowText: textShowText,
|
|
4731
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
4732
|
+
value: item[mappingValueField]
|
|
4733
|
+
});
|
|
4734
|
+
}) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
|
|
4735
|
+
var textShowText = item[mappingTextField];
|
|
4736
|
+
|
|
4737
|
+
if (mappingTextShowTextField) {
|
|
4738
|
+
textShowText = [];
|
|
4739
|
+
|
|
4740
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
4741
|
+
mappingTextShowTextField.forEach(function (r) {
|
|
4742
|
+
textShowText.push(item[r]);
|
|
4743
|
+
});
|
|
4744
|
+
} else {
|
|
4745
|
+
textShowText = item[mappingTextShowTextField];
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
|
|
4749
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
4750
|
+
text: item[mappingTextField],
|
|
4751
|
+
textShowText: textShowText,
|
|
4752
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
4753
|
+
value: item[mappingValueField]
|
|
4754
|
+
});
|
|
4755
|
+
})) : [];
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4758
|
+
source = Array.isArray(source) ? source : [];
|
|
4759
|
+
|
|
4760
|
+
if (type === 1) {
|
|
4761
|
+
var _ctx$form;
|
|
4762
|
+
|
|
4763
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
|
|
4764
|
+
setItems(source);
|
|
4765
|
+
setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
|
|
4766
|
+
} else {
|
|
4767
|
+
setTableData(source);
|
|
4768
|
+
setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
|
|
4769
|
+
total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
|
|
4770
|
+
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),
|
|
4771
|
+
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)
|
|
4772
|
+
}));
|
|
4773
|
+
}
|
|
4774
|
+
}).catch(function (err) {
|
|
4775
|
+
setFetching(false);
|
|
4776
|
+
});
|
|
4777
|
+
};
|
|
4778
|
+
|
|
4779
|
+
React.useEffect(function () {
|
|
4780
|
+
run('init');
|
|
4781
|
+
}, []);
|
|
4782
|
+
React.useEffect(function () {
|
|
4783
|
+
if (value) {
|
|
4784
|
+
setPopValue(value);
|
|
4785
|
+
}
|
|
4786
|
+
}, [value]);
|
|
4787
|
+
React.useEffect(function () {
|
|
4788
|
+
makeUniqueValue();
|
|
4789
|
+
}, [sourceName]);
|
|
4790
|
+
|
|
4791
|
+
var showModal = function showModal() {
|
|
4792
|
+
getData({
|
|
4793
|
+
pageSize: tableInitPageSize,
|
|
4794
|
+
currentPage: 1
|
|
4795
|
+
}, 2);
|
|
4796
|
+
setIsModalVisible(true); // 回显
|
|
4797
|
+
|
|
4798
|
+
if (value) {
|
|
4799
|
+
if (selectMode) {
|
|
4800
|
+
setSelectedRowKeys(labelInValue ? value.map(function (i) {
|
|
4801
|
+
return i.key;
|
|
4802
|
+
}) : value);
|
|
4803
|
+
setPopValue(labelInValue ? value.map(function (i) {
|
|
4804
|
+
return {
|
|
4805
|
+
value: i.key,
|
|
4806
|
+
text: i.label
|
|
4807
|
+
};
|
|
4808
|
+
}) : value.map(function (i) {
|
|
4809
|
+
return {
|
|
4810
|
+
value: i
|
|
4811
|
+
};
|
|
4812
|
+
}));
|
|
4813
|
+
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
4814
|
+
setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
|
|
4815
|
+
|
|
4816
|
+
if (!value.length) {
|
|
4817
|
+
setDoubleArr([]);
|
|
4818
|
+
}
|
|
4819
|
+
} else {
|
|
4820
|
+
setSelectedRowKeys(labelInValue ? [value.key] : [value]);
|
|
4821
|
+
setPopValue(labelInValue ? [{
|
|
4822
|
+
value: value.key,
|
|
4823
|
+
text: value.label
|
|
4824
|
+
}] : [{
|
|
4825
|
+
value: value
|
|
4826
|
+
}]);
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
};
|
|
4830
|
+
|
|
4831
|
+
var handleOk = function handleOk(isContinue) {
|
|
4832
|
+
if (!popvalue.length) {
|
|
4833
|
+
antd.message.warning('至少选中一条数据');
|
|
4834
|
+
return;
|
|
4835
|
+
} // handleSelectOver(popvalue)
|
|
4836
|
+
|
|
4837
|
+
|
|
4838
|
+
if (onSaveCallback) {
|
|
4839
|
+
onSaveCallback(popvalue).then(function (res) {
|
|
4840
|
+
{
|
|
4841
|
+
antd.message.success('保存成功');
|
|
4842
|
+
deleteSelectRows();
|
|
4843
|
+
!isContinue && handleCancel();
|
|
4844
|
+
}
|
|
4845
|
+
}).catch(function (Error) {
|
|
4846
|
+
antd.message.error(Error);
|
|
4847
|
+
});
|
|
4848
|
+
} else {
|
|
4849
|
+
!isContinue && handleCancel();
|
|
4850
|
+
}
|
|
4851
|
+
};
|
|
4852
|
+
|
|
4853
|
+
var handleCancel = function handleCancel() {
|
|
4854
|
+
form.resetFields();
|
|
4855
|
+
setTableFormParams({});
|
|
4856
|
+
setIsModalVisible(false);
|
|
4857
|
+
|
|
4858
|
+
if (selectMode) {
|
|
4859
|
+
run();
|
|
4860
|
+
}
|
|
4861
|
+
};
|
|
4862
|
+
|
|
4863
|
+
var onSearchTable = function onSearchTable() {
|
|
4864
|
+
var params = form.getFieldsValue();
|
|
4865
|
+
setTableFormParams(params);
|
|
4866
|
+
getData(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
4867
|
+
pageSize: tableInitPageSize
|
|
4868
|
+
}), 2);
|
|
4869
|
+
|
|
4870
|
+
if (selectMode) {
|
|
4871
|
+
getData(params);
|
|
4872
|
+
}
|
|
4873
|
+
};
|
|
4874
|
+
|
|
4875
|
+
var onResetTable = function onResetTable() {
|
|
4876
|
+
form.resetFields();
|
|
4877
|
+
setTableFormParams({});
|
|
4878
|
+
getData({
|
|
4879
|
+
pageSize: tableInitPageSize,
|
|
4880
|
+
currentPage: 1
|
|
4881
|
+
}, 2);
|
|
4882
|
+
};
|
|
4883
|
+
|
|
4884
|
+
var handleTableChange = function handleTableChange(pagination) {
|
|
4885
|
+
getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
|
|
4886
|
+
pageSize: pagination.pageSize,
|
|
4887
|
+
currentPage: pagination.current
|
|
4888
|
+
}), 2);
|
|
4889
|
+
}; // 扁平化二维数组的方法
|
|
4890
|
+
|
|
4891
|
+
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
|
|
4892
|
+
setPopValue(selectRows);
|
|
4893
|
+
setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
|
|
4894
|
+
// setCheckedAll(filterRows.length === tablePagination?.total);
|
|
4895
|
+
}; // 生成唯一值
|
|
4896
|
+
|
|
4897
|
+
|
|
4898
|
+
var makeUniqueValue = function makeUniqueValue() {
|
|
4899
|
+
var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
|
|
4900
|
+
setUniqueValue(generateUnitKey);
|
|
4901
|
+
return generateUnitKey;
|
|
4902
|
+
};
|
|
4903
|
+
|
|
4904
|
+
var rowSelection = {
|
|
4905
|
+
type: 'checkbox',
|
|
4906
|
+
selectedRowKeys: selectedRowKeys,
|
|
4907
|
+
preserveSelectedRowKeys: true,
|
|
4908
|
+
onChange: function onChange(sks, srs) {
|
|
4909
|
+
onChangeSelectedKeys(sks, srs);
|
|
4910
|
+
},
|
|
4911
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
4912
|
+
return {
|
|
4913
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4914
|
+
};
|
|
4915
|
+
}
|
|
4916
|
+
};
|
|
4917
|
+
|
|
4918
|
+
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
4919
|
+
if (!selectMode) {
|
|
4920
|
+
var srs = [JSON.parse(JSON.stringify(record))];
|
|
4921
|
+
var sks = srs.map(function (i) {
|
|
4922
|
+
return i.value;
|
|
4923
|
+
});
|
|
4924
|
+
onChangeSelectedKeys(sks, srs);
|
|
4925
|
+
}
|
|
4926
|
+
};
|
|
4927
|
+
|
|
4928
|
+
var themeColor = {
|
|
4929
|
+
color: '#005CFF'
|
|
4930
|
+
};
|
|
4931
|
+
|
|
4932
|
+
var formItem = function formItem(list) {
|
|
4933
|
+
if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
4934
|
+
return list.map(function (i, index) {
|
|
4935
|
+
var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
|
|
4936
|
+
|
|
4937
|
+
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') {
|
|
4938
|
+
var _i$field2, _i$initialSource;
|
|
4939
|
+
|
|
4940
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4941
|
+
name: i.name,
|
|
4942
|
+
label: i.label,
|
|
4943
|
+
key: i.name
|
|
4944
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2({
|
|
4945
|
+
style: {
|
|
4946
|
+
width: '100%'
|
|
4947
|
+
},
|
|
4948
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
4949
|
+
}, 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) {
|
|
4950
|
+
return /*#__PURE__*/React__default['default'].createElement(Option$1, {
|
|
4951
|
+
value: m.value,
|
|
4952
|
+
key: m.value
|
|
4953
|
+
}, m.text);
|
|
4954
|
+
}))));
|
|
4955
|
+
}
|
|
4956
|
+
|
|
4957
|
+
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') {
|
|
4958
|
+
var _i$field4;
|
|
4959
|
+
|
|
4960
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4961
|
+
name: i.name,
|
|
4962
|
+
label: i.label,
|
|
4963
|
+
key: i.name
|
|
4964
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, _objectSpread2({
|
|
4965
|
+
style: {
|
|
4966
|
+
width: '100%'
|
|
4967
|
+
},
|
|
4968
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
4969
|
+
}, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
|
|
4970
|
+
}
|
|
4971
|
+
|
|
4972
|
+
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') {
|
|
4973
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4974
|
+
name: i.name,
|
|
4975
|
+
label: i.label,
|
|
4976
|
+
key: i.name
|
|
4977
|
+
}, /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
|
|
4978
|
+
}
|
|
4979
|
+
|
|
4980
|
+
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') {
|
|
4981
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4982
|
+
name: i.name,
|
|
4983
|
+
label: i.label,
|
|
4984
|
+
key: i.name
|
|
4985
|
+
}, /*#__PURE__*/React__default['default'].createElement(QueryMutipleInput, {
|
|
4986
|
+
onValueChange: function onValueChange(value) {
|
|
4987
|
+
form.setFieldsValue(_defineProperty({}, i.name, value));
|
|
4988
|
+
}
|
|
4989
|
+
})));
|
|
4990
|
+
} // 默认type是input
|
|
4991
|
+
|
|
4992
|
+
|
|
4993
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
4994
|
+
name: i.name,
|
|
4995
|
+
label: i.label,
|
|
4996
|
+
key: i.name
|
|
4997
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2({
|
|
4998
|
+
id: index === 0 ? "2345234242342" : 'index',
|
|
4999
|
+
style: {
|
|
5000
|
+
width: '100%'
|
|
5001
|
+
},
|
|
5002
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
5003
|
+
allowClear: true,
|
|
5004
|
+
maxLength: 100
|
|
5005
|
+
}, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
|
|
5006
|
+
});
|
|
5007
|
+
} else {
|
|
5008
|
+
return null;
|
|
5009
|
+
}
|
|
5010
|
+
};
|
|
5011
|
+
|
|
5012
|
+
var deleteSelectRows = function deleteSelectRows() {
|
|
5013
|
+
setPopValue([]);
|
|
5014
|
+
setSelectedRowKeys([]);
|
|
5015
|
+
};
|
|
5016
|
+
|
|
5017
|
+
var deleteRecord = function deleteRecord(record) {
|
|
5018
|
+
setPopValue(popvalue.filter(function (item) {
|
|
5019
|
+
return item.skuCode !== record.skuCode;
|
|
5020
|
+
}));
|
|
5021
|
+
setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
|
|
5022
|
+
return item !== record.skuCode;
|
|
5023
|
+
})));
|
|
5024
|
+
};
|
|
5025
|
+
|
|
5026
|
+
var inputIndex = 0;
|
|
5027
|
+
var selectColumns = [].concat(_toConsumableArray(modalTableProps.selectColumn.map(function (item) {
|
|
5028
|
+
var inputLength = modalTableProps.selectColumn.filter(function (item) {
|
|
5029
|
+
return item.isInputItem;
|
|
5030
|
+
}).length;
|
|
5031
|
+
var currentIndex = inputIndex;
|
|
5032
|
+
|
|
5033
|
+
if (item.isInputItem) {
|
|
5034
|
+
inputIndex++;
|
|
5035
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
5036
|
+
render: function render(text, record, index) {
|
|
5037
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
5038
|
+
defaultValue: text || 0,
|
|
5039
|
+
min: 0,
|
|
5040
|
+
keyboard: false,
|
|
5041
|
+
onChange: function onChange(value) {
|
|
5042
|
+
record['count'] = value;
|
|
5043
|
+
},
|
|
5044
|
+
// onFocus={(e)=> {
|
|
5045
|
+
// let dom1 = e.currentTarget;
|
|
5046
|
+
// dom1.setSelectionRange(100, 0);
|
|
5047
|
+
// dom1.select(text);
|
|
5048
|
+
// }}
|
|
5049
|
+
onKeyDown: function onKeyDown(e) {
|
|
5050
|
+
if (e.keyCode === 13 && e.ctrlKey) {
|
|
5051
|
+
var _document$getElementB;
|
|
5052
|
+
|
|
5053
|
+
handleOk(true);
|
|
5054
|
+
(_document$getElementB = document.getElementById("2345234242342")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
|
|
5055
|
+
}
|
|
5056
|
+
|
|
5057
|
+
if (e.keyCode === 8 && e.ctrlKey) {
|
|
5058
|
+
var _e$nativeEvent$path$;
|
|
5059
|
+
|
|
5060
|
+
antd.message.success('删除当前行');
|
|
5061
|
+
e.stopPropagation();
|
|
5062
|
+
e.preventDefault();
|
|
5063
|
+
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];
|
|
5064
|
+
|
|
5065
|
+
if (dom) {
|
|
5066
|
+
dom.select();
|
|
5067
|
+
dom.focus();
|
|
5068
|
+
dom.scrollIntoView(false);
|
|
5069
|
+
}
|
|
5070
|
+
|
|
5071
|
+
dom = null;
|
|
5072
|
+
deleteRecord(record);
|
|
5073
|
+
}
|
|
5074
|
+
|
|
5075
|
+
if (e.keyCode === 37 && e.shiftKey) {
|
|
5076
|
+
var _e$nativeEvent$path$2;
|
|
5077
|
+
|
|
5078
|
+
// 左滑动
|
|
5079
|
+
e.stopPropagation();
|
|
5080
|
+
e.preventDefault();
|
|
5081
|
+
|
|
5082
|
+
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];
|
|
5083
|
+
|
|
5084
|
+
if (_dom) {
|
|
5085
|
+
_dom.select();
|
|
5086
|
+
|
|
5087
|
+
_dom.focus();
|
|
5088
|
+
|
|
5089
|
+
_dom.scrollIntoView(false);
|
|
5090
|
+
}
|
|
5091
|
+
|
|
5092
|
+
_dom = null;
|
|
5093
|
+
}
|
|
5094
|
+
|
|
5095
|
+
if (e.keyCode === 39 && e.shiftKey) {
|
|
5096
|
+
var _e$nativeEvent$path$3;
|
|
5097
|
+
|
|
5098
|
+
// 右滑
|
|
5099
|
+
e.stopPropagation();
|
|
5100
|
+
e.preventDefault();
|
|
5101
|
+
|
|
5102
|
+
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];
|
|
5103
|
+
|
|
5104
|
+
if (_dom2) {
|
|
5105
|
+
_dom2.select();
|
|
5106
|
+
|
|
5107
|
+
_dom2.focus();
|
|
5108
|
+
|
|
5109
|
+
_dom2.scrollIntoView(false);
|
|
5110
|
+
}
|
|
5111
|
+
|
|
5112
|
+
_dom2 = null;
|
|
5113
|
+
}
|
|
5114
|
+
|
|
5115
|
+
if (e.keyCode === 40) {
|
|
5116
|
+
var _e$nativeEvent$path$4;
|
|
5117
|
+
|
|
5118
|
+
e.stopPropagation();
|
|
5119
|
+
e.preventDefault();
|
|
5120
|
+
|
|
5121
|
+
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];
|
|
5122
|
+
|
|
5123
|
+
if (_dom3) {
|
|
5124
|
+
_dom3.select();
|
|
5125
|
+
|
|
5126
|
+
_dom3.focus();
|
|
5127
|
+
|
|
5128
|
+
_dom3.scrollIntoView(false);
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
_dom3 = null;
|
|
5132
|
+
} else if (e.keyCode === 38) {
|
|
5133
|
+
var _e$nativeEvent$path$5;
|
|
5134
|
+
|
|
5135
|
+
e.stopPropagation();
|
|
5136
|
+
e.preventDefault();
|
|
5137
|
+
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];
|
|
5138
|
+
|
|
5139
|
+
if (dom1) {
|
|
5140
|
+
// dom1.value=""
|
|
5141
|
+
// dom1.setSelectionRange(100, 0);
|
|
5142
|
+
dom1.select();
|
|
5143
|
+
dom1.focus();
|
|
5144
|
+
dom1.scrollIntoViewIfNeeded(false); // dom1.value=record['count']
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
dom1 = null;
|
|
5148
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
5149
|
+
e.stopPropagation();
|
|
5150
|
+
e.preventDefault();
|
|
5151
|
+
}
|
|
5152
|
+
}
|
|
5153
|
+
});
|
|
5154
|
+
}
|
|
5155
|
+
});
|
|
5156
|
+
}
|
|
5157
|
+
|
|
5158
|
+
return item;
|
|
5159
|
+
})), [{
|
|
5160
|
+
title: '操作',
|
|
5161
|
+
width: 150,
|
|
5162
|
+
fixed: 'right',
|
|
5163
|
+
render: function render(text, record, index) {
|
|
5164
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5165
|
+
onClick: function onClick() {
|
|
5166
|
+
deleteRecord(record);
|
|
5167
|
+
},
|
|
5168
|
+
type: "link"
|
|
5169
|
+
}, "\u5220\u9664");
|
|
5170
|
+
}
|
|
5171
|
+
}]);
|
|
5172
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5173
|
+
className: 'add_select'
|
|
5174
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5175
|
+
className: "add_select_show",
|
|
5176
|
+
id: "add_select_div_".concat(uniqueValue)
|
|
5177
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5178
|
+
onClick: showModal,
|
|
5179
|
+
type: "primary"
|
|
5180
|
+
}, "\u6DFB\u52A0")), needModalTable && isModalVisible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
5181
|
+
width: '1200px',
|
|
5182
|
+
style: {
|
|
5183
|
+
top: 20
|
|
5184
|
+
},
|
|
5185
|
+
bodyStyle: {
|
|
5186
|
+
padding: '0px'
|
|
5187
|
+
},
|
|
5188
|
+
// title={modalTableProps?.modalTableTitle}
|
|
5189
|
+
visible: isModalVisible,
|
|
5190
|
+
onOk: handleOk,
|
|
5191
|
+
closable: false,
|
|
5192
|
+
onCancel: handleCancel,
|
|
5193
|
+
footer: selectMode ? [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5194
|
+
key: "back",
|
|
5195
|
+
onClick: handleCancel
|
|
5196
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5197
|
+
key: "submit",
|
|
5198
|
+
style: {
|
|
5199
|
+
color: '#005CFF',
|
|
5200
|
+
borderColor: '#005CFF'
|
|
5201
|
+
},
|
|
5202
|
+
onClick: function onClick() {
|
|
5203
|
+
handleOk(true);
|
|
5204
|
+
},
|
|
5205
|
+
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5206
|
+
}, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5207
|
+
key: "submit",
|
|
5208
|
+
type: "primary",
|
|
5209
|
+
onClick: function onClick() {
|
|
5210
|
+
handleOk(false);
|
|
5211
|
+
},
|
|
5212
|
+
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5213
|
+
}, "\u786E\u5B9A")] : null
|
|
5214
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5215
|
+
className: 'add_select_header'
|
|
5216
|
+
}, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle, /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("span", null, "*"), " \xA0\u5FEB\u6377\u952E\uFF1A\u3010Tab\u3011-\u8DF3\u683C\u5207\u6362\uFF1B\u3010Shift+\u2190\u3001\u2192\u3011-\u5F53\u524D\u884C\u5DE6\u3001\u53F3\u79FB\u52A8\uFF1B\u3010 \u2191\u3001\u2193\u3011-\u5F53\u524D\u5217\u4E0A\u3001\u4E0B\u79FB\u52A8\uFF1B\u3010ctrl+Enter\u3011-\u4FDD\u5B58\u5E76\u7EE7\u7EED\uFF1B\u3010ctrl+Delete\u3011-\u5220\u9664\u5F53\u524D\u884C\uFF1B"), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
5217
|
+
className: 'add_select_header_close'
|
|
5218
|
+
}, /*#__PURE__*/React__default['default'].createElement(CloseCircleOutlined$2, {
|
|
5219
|
+
style: {
|
|
5220
|
+
fontSize: '20px'
|
|
5221
|
+
},
|
|
5222
|
+
onClick: handleCancel
|
|
5223
|
+
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5224
|
+
className: 'add_select_wrapper'
|
|
5225
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5226
|
+
className: caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'
|
|
5227
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5228
|
+
className: 'select_list_columns'
|
|
5229
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5230
|
+
className: 'select_list_columns_formItems'
|
|
5231
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
5232
|
+
form: form,
|
|
5233
|
+
layout: 'vertical',
|
|
5234
|
+
key: 'modalForm'
|
|
5235
|
+
}, formItem(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm)))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5236
|
+
className: 'select_list_searchButton'
|
|
5237
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5238
|
+
key: 'reset',
|
|
5239
|
+
className: 'select_list_button_space',
|
|
5240
|
+
onClick: onResetTable
|
|
5241
|
+
}, "\u91CD\u7F6E"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
5242
|
+
key: 'search',
|
|
5243
|
+
type: "primary",
|
|
5244
|
+
onClick: onSearchTable
|
|
5245
|
+
}, "\u67E5\u8BE2"))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5246
|
+
className: caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'
|
|
5247
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5248
|
+
className: 'select_list_selectTips'
|
|
5249
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5250
|
+
style: {
|
|
5251
|
+
marginLeft: 8
|
|
5252
|
+
}
|
|
5253
|
+
}, "\u641C\u7D22\u7ED3\u679C\u5171\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
5254
|
+
style: themeColor
|
|
5255
|
+
}, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
5256
|
+
style: themeColor
|
|
5257
|
+
}, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879") : '')), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
5258
|
+
size: 'small',
|
|
5259
|
+
rowSelection: rowSelection,
|
|
5260
|
+
columns: _toConsumableArray(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns),
|
|
5261
|
+
dataSource: tableData,
|
|
5262
|
+
pagination: tablePagination,
|
|
5263
|
+
loading: fetching,
|
|
5264
|
+
onChange: handleTableChange,
|
|
5265
|
+
rowKey: mappingValueField,
|
|
5266
|
+
rowClassName: 'row-class',
|
|
5267
|
+
scroll: {
|
|
5268
|
+
y: 500
|
|
5269
|
+
}
|
|
5270
|
+
})))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5271
|
+
className: 'add_select_wrapper_select'
|
|
5272
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5273
|
+
className: 'select_list_selectTips'
|
|
5274
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5275
|
+
style: {
|
|
5276
|
+
marginLeft: 8
|
|
5277
|
+
}
|
|
5278
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
5279
|
+
style: themeColor
|
|
5280
|
+
}, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5281
|
+
style: {
|
|
5282
|
+
marginRight: 8
|
|
5283
|
+
}
|
|
5284
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
5285
|
+
onClick: deleteSelectRows,
|
|
5286
|
+
style: _objectSpread2(_objectSpread2({}, themeColor), {}, {
|
|
5287
|
+
cursor: 'pointer'
|
|
5288
|
+
})
|
|
5289
|
+
}, "\u6E05\u7A7A\u6240\u9009\u5546\u54C1"))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
5290
|
+
size: 'small',
|
|
5291
|
+
// rowSelection={rowSelection}
|
|
5292
|
+
columns: selectColumns,
|
|
5293
|
+
dataSource: popvalue,
|
|
5294
|
+
pagination: false,
|
|
5295
|
+
// onChange={handleTableChange}
|
|
5296
|
+
rowKey: mappingValueField,
|
|
5297
|
+
rowClassName: 'row-class',
|
|
5298
|
+
scroll: {
|
|
5299
|
+
y: 500
|
|
5300
|
+
},
|
|
5301
|
+
onRow: function onRow(record) {
|
|
5302
|
+
return {
|
|
5303
|
+
onDoubleClick: function onDoubleClick(event) {
|
|
5304
|
+
return onDoubleClickSelect(event, record);
|
|
5305
|
+
}
|
|
5306
|
+
};
|
|
5307
|
+
}
|
|
5308
|
+
})))));
|
|
5309
|
+
};
|
|
5310
|
+
|
|
5311
|
+
var shopFileType = [{
|
|
5312
|
+
text: "线上",
|
|
5313
|
+
value: 'online'
|
|
5314
|
+
}, {
|
|
5315
|
+
text: "线下",
|
|
5316
|
+
value: 'offline'
|
|
5317
|
+
}];
|
|
5318
|
+
var shopFile2Type = [{
|
|
5319
|
+
text: "第三方线上",
|
|
5320
|
+
value: 'online'
|
|
5321
|
+
}, {
|
|
5322
|
+
text: "线下",
|
|
5323
|
+
value: 'offline'
|
|
5324
|
+
}, {
|
|
5325
|
+
text: "自营B2B",
|
|
5326
|
+
value: 'B2B'
|
|
5327
|
+
}, {
|
|
5328
|
+
text: "自营B2C",
|
|
5329
|
+
value: 'B2C'
|
|
5330
|
+
}];
|
|
5331
|
+
var arrivalPaySupportList = [{
|
|
5332
|
+
text: "支持",
|
|
5333
|
+
value: 1
|
|
5334
|
+
}, {
|
|
5335
|
+
text: "不支持",
|
|
5336
|
+
value: 0
|
|
5337
|
+
}];
|
|
5338
|
+
var sharingType = [{
|
|
5339
|
+
text: "共享",
|
|
5340
|
+
value: '10'
|
|
5341
|
+
}, {
|
|
5342
|
+
text: "私有",
|
|
5343
|
+
value: '20'
|
|
5344
|
+
}];
|
|
5345
|
+
|
|
5346
|
+
var getDicData = function getDicData(dicCode) {
|
|
5347
|
+
var dicData = {};
|
|
5348
|
+
|
|
5349
|
+
{
|
|
5350
|
+
var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
|
|
5351
|
+
dicData = storageDic[dicCode];
|
|
5352
|
+
} // @ts-ignore
|
|
5353
|
+
|
|
5354
|
+
|
|
5355
|
+
if (!dicData || !dicData.length) ;
|
|
5356
|
+
|
|
5357
|
+
return dicData;
|
|
5358
|
+
};
|
|
5359
|
+
|
|
5360
|
+
var getDictionarySource = function getDictionarySource(dicCode) {
|
|
5361
|
+
var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
5362
|
+
var dicData = getDicData(dicCode);
|
|
5363
|
+
|
|
5364
|
+
try {
|
|
5365
|
+
if (needConvertInterger) {
|
|
5366
|
+
// @ts-ignore
|
|
5367
|
+
dicData = dicData.map(function (item) {
|
|
5368
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
5369
|
+
value: parseFloat(item.value)
|
|
5370
|
+
});
|
|
5371
|
+
});
|
|
5372
|
+
}
|
|
5373
|
+
} catch (e) {}
|
|
5374
|
+
|
|
5375
|
+
return dicData;
|
|
5376
|
+
};
|
|
5377
|
+
|
|
5378
|
+
var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
|
|
5379
|
+
var dicData = getDicData(dicCode);
|
|
5380
|
+
if (value === undefined) return ''; // @ts-ignore
|
|
5381
|
+
|
|
5382
|
+
var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
|
|
5383
|
+
return item.value === value.toString();
|
|
5384
|
+
});
|
|
5385
|
+
|
|
5386
|
+
if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
|
|
5387
|
+
// throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
|
|
5388
|
+
return value;
|
|
5389
|
+
}
|
|
5390
|
+
|
|
5391
|
+
return dicItemArray[0].text;
|
|
5392
|
+
};
|
|
4057
5393
|
|
|
4058
5394
|
var loadSelectSource = function loadSelectSource(url, params) {
|
|
4059
5395
|
return new Promise(function (resolve, reject) {
|
|
4060
5396
|
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(params))).then(function (result) {
|
|
4061
|
-
var _result;
|
|
5397
|
+
var _result, _result2;
|
|
4062
5398
|
|
|
4063
5399
|
result = result.data;
|
|
4064
5400
|
|
|
4065
|
-
if (result.status && result.status !== '0' || ((
|
|
5401
|
+
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') {
|
|
4066
5402
|
antd.message.error(result.msg);
|
|
4067
5403
|
return;
|
|
4068
5404
|
}
|
|
@@ -4074,6 +5410,48 @@ var loadSelectSource = function loadSelectSource(url, params) {
|
|
|
4074
5410
|
});
|
|
4075
5411
|
};
|
|
4076
5412
|
|
|
5413
|
+
var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
5414
|
+
var result;
|
|
5415
|
+
|
|
5416
|
+
switch (type) {
|
|
5417
|
+
case 'supplier2':
|
|
5418
|
+
case 'customer2':
|
|
5419
|
+
case 'shopFile2':
|
|
5420
|
+
result = '/channel-manage';
|
|
5421
|
+
break;
|
|
5422
|
+
|
|
5423
|
+
case 'skuCommodity':
|
|
5424
|
+
case 'skuPropertyValue':
|
|
5425
|
+
case 'spuCommodity':
|
|
5426
|
+
result = '/items';
|
|
5427
|
+
break;
|
|
5428
|
+
|
|
5429
|
+
case 'physicalWarehouse':
|
|
5430
|
+
case 'realWarehouse':
|
|
5431
|
+
case 'virtualWarehouse':
|
|
5432
|
+
case 'channelWarehouse':
|
|
5433
|
+
result = '/stock';
|
|
5434
|
+
break;
|
|
5435
|
+
|
|
5436
|
+
case 'inventoryOrg2':
|
|
5437
|
+
case 'purchaseOrg':
|
|
5438
|
+
case 'salesOrg':
|
|
5439
|
+
case 'employee2':
|
|
5440
|
+
result = '/user';
|
|
5441
|
+
break;
|
|
5442
|
+
|
|
5443
|
+
case 'deliveryMode':
|
|
5444
|
+
result = '/basic';
|
|
5445
|
+
break;
|
|
5446
|
+
|
|
5447
|
+
default:
|
|
5448
|
+
result = '/bop/api';
|
|
5449
|
+
break;
|
|
5450
|
+
}
|
|
5451
|
+
|
|
5452
|
+
return result;
|
|
5453
|
+
};
|
|
5454
|
+
|
|
4077
5455
|
var _getDictionarySource;
|
|
4078
5456
|
var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
|
|
4079
5457
|
var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
|
|
@@ -4101,7 +5479,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4101
5479
|
|
|
4102
5480
|
var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
|
|
4103
5481
|
var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
|
|
4104
|
-
var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
5482
|
+
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) || [];
|
|
4105
5483
|
var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
|
|
4106
5484
|
return {
|
|
4107
5485
|
text: v[resKeyValue[1]],
|
|
@@ -4148,7 +5526,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4148
5526
|
tableColumns: []
|
|
4149
5527
|
}, modalTableBusProps);
|
|
4150
5528
|
|
|
4151
|
-
var needModalTable = true; // 供应商选择器
|
|
5529
|
+
var needModalTable = (modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable) !== undefined ? modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable : true; // 供应商选择器
|
|
4152
5530
|
|
|
4153
5531
|
if (type === 'supplier') {
|
|
4154
5532
|
tableSearchForm = [{
|
|
@@ -4348,7 +5726,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4348
5726
|
mappingTextShowTextField: ['name', 'propertyNameAndValue'],
|
|
4349
5727
|
otherParams: {
|
|
4350
5728
|
'qp-approveStatus-eq': 1,
|
|
4351
|
-
'qp-type-eq': 10,
|
|
5729
|
+
// 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
|
|
4352
5730
|
sorter: 'desc-id'
|
|
4353
5731
|
},
|
|
4354
5732
|
sourceName: 'skuCode'
|
|
@@ -4360,8 +5738,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4360
5738
|
name: 'qp-name-like',
|
|
4361
5739
|
label: 'SKU名称'
|
|
4362
5740
|
}, {
|
|
4363
|
-
name: 'qp-skuCode-
|
|
4364
|
-
label: 'SKU编码'
|
|
5741
|
+
name: 'qp-skuCode-in',
|
|
5742
|
+
label: 'SKU编码',
|
|
5743
|
+
field: {
|
|
5744
|
+
type: 'multipleQueryInput',
|
|
5745
|
+
props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
|
|
5746
|
+
}
|
|
4365
5747
|
}, requestConfig.url.includes('v2') ? {
|
|
4366
5748
|
name: 'qp-code-like',
|
|
4367
5749
|
label: '国际条码'
|
|
@@ -4461,8 +5843,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4461
5843
|
name: 'qp-name-like',
|
|
4462
5844
|
label: 'SKU名称'
|
|
4463
5845
|
}, {
|
|
4464
|
-
name: 'qp-skuCode-
|
|
4465
|
-
label: 'SKU编码'
|
|
5846
|
+
name: 'qp-skuCode-in',
|
|
5847
|
+
label: 'SKU编码',
|
|
5848
|
+
field: {
|
|
5849
|
+
type: 'multipleQueryInput',
|
|
5850
|
+
props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
|
|
5851
|
+
}
|
|
4466
5852
|
}, {
|
|
4467
5853
|
name: 'qp-barCode-like',
|
|
4468
5854
|
label: '国际条码'
|
|
@@ -4539,7 +5925,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4539
5925
|
}];
|
|
4540
5926
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4541
5927
|
pageSize: 5000,
|
|
4542
|
-
currentPage: 1
|
|
5928
|
+
currentPage: 1,
|
|
5929
|
+
'ctl-withAuth': true
|
|
4543
5930
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4544
5931
|
pageSize: 5000,
|
|
4545
5932
|
currentPage: 1
|
|
@@ -4701,7 +6088,8 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4701
6088
|
}];
|
|
4702
6089
|
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
4703
6090
|
pageSize: 5000,
|
|
4704
|
-
currentPage: 1
|
|
6091
|
+
currentPage: 1,
|
|
6092
|
+
'ctl-withAuth': true
|
|
4705
6093
|
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
4706
6094
|
pageSize: 5000,
|
|
4707
6095
|
currentPage: 1
|
|
@@ -4910,6 +6298,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4910
6298
|
mappingTextField: 'name',
|
|
4911
6299
|
mappingValueField: 'code',
|
|
4912
6300
|
otherParams: {
|
|
6301
|
+
'qp-status-eq': 10,
|
|
4913
6302
|
sorter: 'desc-id'
|
|
4914
6303
|
},
|
|
4915
6304
|
sourceName: 'customCode'
|
|
@@ -5265,6 +6654,83 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
5265
6654
|
dataIndex: 'accountingName'
|
|
5266
6655
|
}]
|
|
5267
6656
|
}, modalTableBusProps);
|
|
6657
|
+
}
|
|
6658
|
+
|
|
6659
|
+
if (type === 'shopFile2') {
|
|
6660
|
+
var _JSON$parse, _JSON$parse$employeeR;
|
|
6661
|
+
|
|
6662
|
+
requestConfig = _objectSpread2({
|
|
6663
|
+
url: "".concat(prefixUrl.selectPrefix, "/store/page"),
|
|
6664
|
+
filter: 'qp-name,code-orGroup,like',
|
|
6665
|
+
mappingTextField: 'name',
|
|
6666
|
+
mappingValueField: 'code',
|
|
6667
|
+
otherParams: {
|
|
6668
|
+
sorter: 'desc-id'
|
|
6669
|
+
},
|
|
6670
|
+
sourceName: 'code'
|
|
6671
|
+
}, requestConfigProp);
|
|
6672
|
+
tableSearchForm = [{
|
|
6673
|
+
name: 'qp-name-like',
|
|
6674
|
+
label: '商店名称'
|
|
6675
|
+
}, {
|
|
6676
|
+
name: 'qp-code-like',
|
|
6677
|
+
label: '商店编码'
|
|
6678
|
+
}, {
|
|
6679
|
+
name: 'qp-type-in',
|
|
6680
|
+
type: 'select',
|
|
6681
|
+
label: '商店类型',
|
|
6682
|
+
initialSource: shopFile2Type
|
|
6683
|
+
}, {
|
|
6684
|
+
name: 'qp-orgCode-in',
|
|
6685
|
+
type: 'select',
|
|
6686
|
+
label: '所属销售组织',
|
|
6687
|
+
field: {
|
|
6688
|
+
type: 'select',
|
|
6689
|
+
props: {
|
|
6690
|
+
mode: 'multiple',
|
|
6691
|
+
notFoundContent: '暂无数据',
|
|
6692
|
+
allowClear: true,
|
|
6693
|
+
showSearch: true,
|
|
6694
|
+
showArrow: true,
|
|
6695
|
+
maxTagCount: 1,
|
|
6696
|
+
optionFilterProp: 'children',
|
|
6697
|
+
filterOption: function filterOption(input, option) {
|
|
6698
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
}
|
|
6702
|
+
}];
|
|
6703
|
+
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
|
|
6704
|
+
'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,
|
|
6705
|
+
'qp-realOrg-eq': true,
|
|
6706
|
+
'qp-status-eq': 10
|
|
6707
|
+
})]).then(function (x) {
|
|
6708
|
+
formatSource(x, 0, 3, tableSearchForm);
|
|
6709
|
+
});
|
|
6710
|
+
modalTableProps = _objectSpread2({
|
|
6711
|
+
modalTableTitle: '选择商店',
|
|
6712
|
+
tableSearchForm: tableSearchForm,
|
|
6713
|
+
tableColumns: [{
|
|
6714
|
+
title: '商店编码',
|
|
6715
|
+
dataIndex: 'code'
|
|
6716
|
+
}, {
|
|
6717
|
+
title: '商店名称',
|
|
6718
|
+
dataIndex: 'name'
|
|
6719
|
+
}, {
|
|
6720
|
+
title: '商店类型',
|
|
6721
|
+
dataIndex: 'type',
|
|
6722
|
+
render: function render(text) {
|
|
6723
|
+
var _shopFile2Type$find;
|
|
6724
|
+
|
|
6725
|
+
return (_shopFile2Type$find = shopFile2Type.find(function (i) {
|
|
6726
|
+
return i.value === text;
|
|
6727
|
+
})) === null || _shopFile2Type$find === void 0 ? void 0 : _shopFile2Type$find.text;
|
|
6728
|
+
}
|
|
6729
|
+
}, {
|
|
6730
|
+
title: '所属销售组织',
|
|
6731
|
+
dataIndex: 'orgName'
|
|
6732
|
+
}]
|
|
6733
|
+
}, modalTableBusProps);
|
|
5268
6734
|
} // 核算主体选择器(无弹窗)
|
|
5269
6735
|
|
|
5270
6736
|
|
|
@@ -5592,8 +7058,8 @@ var MemoSearchSelect = /*#__PURE__*/React__default['default'].memo(SearchSelect)
|
|
|
5592
7058
|
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
5593
7059
|
var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
|
|
5594
7060
|
var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
5595
|
-
selectPrefix:
|
|
5596
|
-
formSelectFix:
|
|
7061
|
+
selectPrefix: handleDefaultPrefixUrl(businessType),
|
|
7062
|
+
formSelectFix: handleDefaultPrefixUrl(businessType)
|
|
5597
7063
|
};
|
|
5598
7064
|
|
|
5599
7065
|
var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
|
|
@@ -5634,7 +7100,7 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
5634
7100
|
_props$columns = props.columns,
|
|
5635
7101
|
columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
|
|
5636
7102
|
_props$validDataUrl = props.validDataUrl,
|
|
5637
|
-
validDataUrl = _props$validDataUrl === void 0 ? "/
|
|
7103
|
+
validDataUrl = _props$validDataUrl === void 0 ? "/items/api/recordDetailImport/check" : _props$validDataUrl;
|
|
5638
7104
|
|
|
5639
7105
|
var _useState = React.useState({
|
|
5640
7106
|
maskClosable: false,
|
|
@@ -5757,6 +7223,321 @@ function getStorageVale(storageKeyString) {
|
|
|
5757
7223
|
return "";
|
|
5758
7224
|
}
|
|
5759
7225
|
|
|
7226
|
+
var TreeSearchSelect = function TreeSearchSelect(props) {
|
|
7227
|
+
var _useState = React.useState([]),
|
|
7228
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7229
|
+
treeData = _useState2[0],
|
|
7230
|
+
setTreeData = _useState2[1];
|
|
7231
|
+
|
|
7232
|
+
var ctx = props.ctx,
|
|
7233
|
+
value = props.value,
|
|
7234
|
+
valueName = props.valueName,
|
|
7235
|
+
onChange = props.onChange,
|
|
7236
|
+
onChangeName = props.onChangeName,
|
|
7237
|
+
placeholder = props.placeholder,
|
|
7238
|
+
remoteSource = props.remoteSource,
|
|
7239
|
+
initialValue = props.initialValue,
|
|
7240
|
+
_props$treeCheckable = props.treeCheckable,
|
|
7241
|
+
treeCheckable = _props$treeCheckable === void 0 ? false : _props$treeCheckable,
|
|
7242
|
+
_props$showSearch = props.showSearch,
|
|
7243
|
+
showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
|
|
7244
|
+
_props$maxTagCount = props.maxTagCount,
|
|
7245
|
+
maxTagCount = _props$maxTagCount === void 0 ? 1 : _props$maxTagCount,
|
|
7246
|
+
_props$multiple = props.multiple,
|
|
7247
|
+
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
7248
|
+
_props$isChoose = props.isChoose,
|
|
7249
|
+
isChoose = _props$isChoose === void 0 ? false : _props$isChoose,
|
|
7250
|
+
mode = props.mode,
|
|
7251
|
+
_getPopupContainer = props.getPopupContainer,
|
|
7252
|
+
_props$labelInValue = props.labelInValue,
|
|
7253
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
7254
|
+
_props$showArrow = props.showArrow,
|
|
7255
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
7256
|
+
_props$allowClear = props.allowClear,
|
|
7257
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
7258
|
+
_props$showCheckedStr = props.showCheckedStrategy,
|
|
7259
|
+
showCheckedStrategy = _props$showCheckedStr === void 0 ? antd.TreeSelect.SHOW_PARENT : _props$showCheckedStr,
|
|
7260
|
+
_props$style = props.style,
|
|
7261
|
+
style = _props$style === void 0 ? {
|
|
7262
|
+
width: '100%'
|
|
7263
|
+
} : _props$style,
|
|
7264
|
+
getTreeData = props.getTreeData;
|
|
7265
|
+
var url = remoteSource.url,
|
|
7266
|
+
_remoteSource$paramsK = remoteSource.paramsKey,
|
|
7267
|
+
paramsKey = _remoteSource$paramsK === void 0 ? 'qp-name-like' : _remoteSource$paramsK,
|
|
7268
|
+
_remoteSource$resKeyV = remoteSource.resKeyValue,
|
|
7269
|
+
resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
|
|
7270
|
+
_remoteSource$initial = remoteSource.initialParams,
|
|
7271
|
+
initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
|
|
7272
|
+
|
|
7273
|
+
var mapSearchTree = function mapSearchTree(treeDataItem) {
|
|
7274
|
+
var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
|
|
7275
|
+
return {
|
|
7276
|
+
title: treeDataItem[resKeyValue[1]],
|
|
7277
|
+
key: treeDataItem[resKeyValue[0]],
|
|
7278
|
+
value: treeDataItem[resKeyValue[0]],
|
|
7279
|
+
parentId: treeDataItem.parent,
|
|
7280
|
+
data: _objectSpread2({}, treeDataItem),
|
|
7281
|
+
isLeaf: !haveChildren,
|
|
7282
|
+
disabled: isDisabled(haveChildren),
|
|
7283
|
+
children: haveChildren ? treeDataItem.children.map(function (i) {
|
|
7284
|
+
return mapSearchTree(i);
|
|
7285
|
+
}) : []
|
|
7286
|
+
};
|
|
7287
|
+
};
|
|
7288
|
+
|
|
7289
|
+
var isDisabled = function isDisabled(children) {
|
|
7290
|
+
if (isChoose) {
|
|
7291
|
+
return false;
|
|
7292
|
+
}
|
|
7293
|
+
|
|
7294
|
+
return children;
|
|
7295
|
+
};
|
|
7296
|
+
/* 实时查询 但是目前用的直接是完整数据源, 所以没有使用 */
|
|
7297
|
+
|
|
7298
|
+
|
|
7299
|
+
var handleSearch = function handleSearch(q) {
|
|
7300
|
+
var paramsData = _objectSpread2(_defineProperty({}, "".concat(paramsKey), q), initialParams);
|
|
7301
|
+
|
|
7302
|
+
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(paramsData))).then( /*#__PURE__*/function () {
|
|
7303
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
7304
|
+
var _ctx$form;
|
|
7305
|
+
|
|
7306
|
+
var resData, coverData, data, dataList;
|
|
7307
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7308
|
+
while (1) {
|
|
7309
|
+
switch (_context.prev = _context.next) {
|
|
7310
|
+
case 0:
|
|
7311
|
+
resData = (res === null || res === void 0 ? void 0 : res.data) || [];
|
|
7312
|
+
|
|
7313
|
+
if (!(resData.status === '0')) {
|
|
7314
|
+
_context.next = 13;
|
|
7315
|
+
break;
|
|
7316
|
+
}
|
|
7317
|
+
|
|
7318
|
+
data = resData.data;
|
|
7319
|
+
|
|
7320
|
+
if (!remoteSource.converter) {
|
|
7321
|
+
_context.next = 9;
|
|
7322
|
+
break;
|
|
7323
|
+
}
|
|
7324
|
+
|
|
7325
|
+
_context.next = 6;
|
|
7326
|
+
return remoteSource.converter({
|
|
7327
|
+
data: [data]
|
|
7328
|
+
});
|
|
7329
|
+
|
|
7330
|
+
case 6:
|
|
7331
|
+
coverData = _context.sent;
|
|
7332
|
+
_context.next = 11;
|
|
7333
|
+
break;
|
|
7334
|
+
|
|
7335
|
+
case 9:
|
|
7336
|
+
dataList = data && Array.isArray(data) ? data : data && [data] || [];
|
|
7337
|
+
coverData = dataList.length && dataList.map(function (ites) {
|
|
7338
|
+
return mapSearchTree(ites);
|
|
7339
|
+
}) || [];
|
|
7340
|
+
|
|
7341
|
+
case 11:
|
|
7342
|
+
_context.next = 14;
|
|
7343
|
+
break;
|
|
7344
|
+
|
|
7345
|
+
case 13:
|
|
7346
|
+
coverData = [];
|
|
7347
|
+
|
|
7348
|
+
case 14:
|
|
7349
|
+
setTreeData(coverData);
|
|
7350
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(ctx.name, coverData);
|
|
7351
|
+
|
|
7352
|
+
case 16:
|
|
7353
|
+
case "end":
|
|
7354
|
+
return _context.stop();
|
|
7355
|
+
}
|
|
7356
|
+
}
|
|
7357
|
+
}, _callee);
|
|
7358
|
+
}));
|
|
7359
|
+
|
|
7360
|
+
return function (_x) {
|
|
7361
|
+
return _ref.apply(this, arguments);
|
|
7362
|
+
};
|
|
7363
|
+
}());
|
|
7364
|
+
};
|
|
7365
|
+
|
|
7366
|
+
var handleChange = function handleChange(data, dataName) {
|
|
7367
|
+
var _ctx$form2;
|
|
7368
|
+
|
|
7369
|
+
onChange(data);
|
|
7370
|
+
onChangeName && onChangeName(dataName);
|
|
7371
|
+
getTreeData && getTreeData(treeData); // 把树节点暴露出去
|
|
7372
|
+
|
|
7373
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
|
|
7374
|
+
};
|
|
7375
|
+
|
|
7376
|
+
React.useEffect(function () {
|
|
7377
|
+
handleSearch(initialValue);
|
|
7378
|
+
}, []);
|
|
7379
|
+
|
|
7380
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
7381
|
+
var _onClose = function onClose(e, item) {
|
|
7382
|
+
e.preventDefault();
|
|
7383
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
7384
|
+
return i.value !== item.value;
|
|
7385
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
7386
|
+
return i !== item.value;
|
|
7387
|
+
});
|
|
7388
|
+
var newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter(function (i) {
|
|
7389
|
+
return i !== item.label;
|
|
7390
|
+
});
|
|
7391
|
+
handleChange(newValue, newValueName);
|
|
7392
|
+
};
|
|
7393
|
+
|
|
7394
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
7395
|
+
title: selectedValues.map(function (i) {
|
|
7396
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tag, {
|
|
7397
|
+
closable: true,
|
|
7398
|
+
onClose: function onClose(e) {
|
|
7399
|
+
return _onClose(e, i);
|
|
7400
|
+
},
|
|
7401
|
+
style: {
|
|
7402
|
+
marginRight: 3,
|
|
7403
|
+
background: '#f5f5f5',
|
|
7404
|
+
height: '24px',
|
|
7405
|
+
border: '1px solid #f0f0f0'
|
|
7406
|
+
}
|
|
7407
|
+
}, i.label);
|
|
7408
|
+
})
|
|
7409
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
7410
|
+
};
|
|
7411
|
+
|
|
7412
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7413
|
+
className: 'tree_search_select'
|
|
7414
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, {
|
|
7415
|
+
treeCheckable: treeCheckable,
|
|
7416
|
+
maxTagCount: maxTagCount,
|
|
7417
|
+
showSearch: showSearch,
|
|
7418
|
+
style: style,
|
|
7419
|
+
value: value,
|
|
7420
|
+
dropdownStyle: {
|
|
7421
|
+
maxHeight: 400,
|
|
7422
|
+
maxWidth: 100,
|
|
7423
|
+
overflow: 'auto'
|
|
7424
|
+
},
|
|
7425
|
+
treeData: treeData,
|
|
7426
|
+
placeholder: placeholder,
|
|
7427
|
+
allowClear: allowClear,
|
|
7428
|
+
labelInValue: labelInValue,
|
|
7429
|
+
showArrow: showArrow,
|
|
7430
|
+
showCheckedStrategy: showCheckedStrategy,
|
|
7431
|
+
treeNodeFilterProp: 'title',
|
|
7432
|
+
treeDefaultExpandAll: true,
|
|
7433
|
+
multiple: multiple,
|
|
7434
|
+
maxTagPlaceholder: maxTagPlaceholder,
|
|
7435
|
+
onChange: handleChange,
|
|
7436
|
+
disabled: mode === 'view' || (ctx === null || ctx === void 0 ? void 0 : ctx.mode) === 'view',
|
|
7437
|
+
getPopupContainer: function getPopupContainer() {
|
|
7438
|
+
return _getPopupContainer && _getPopupContainer() || document.body;
|
|
7439
|
+
}
|
|
7440
|
+
}));
|
|
7441
|
+
};
|
|
7442
|
+
|
|
7443
|
+
var handleDefaultProps = function handleDefaultProps(type) {
|
|
7444
|
+
var result = {};
|
|
7445
|
+
|
|
7446
|
+
switch (type) {
|
|
7447
|
+
case 'department':
|
|
7448
|
+
result = {
|
|
7449
|
+
treeCheckable: true,
|
|
7450
|
+
isChoose: true,
|
|
7451
|
+
remoteSource: {
|
|
7452
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
7453
|
+
initialParams: {
|
|
7454
|
+
'orgViewCode': 'administrative-organization-view'
|
|
7455
|
+
},
|
|
7456
|
+
resKeyValue: ['code', 'name']
|
|
7457
|
+
}
|
|
7458
|
+
};
|
|
7459
|
+
break;
|
|
7460
|
+
|
|
7461
|
+
case 'sales-organization':
|
|
7462
|
+
result = {
|
|
7463
|
+
isChoose: true,
|
|
7464
|
+
remoteSource: {
|
|
7465
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
7466
|
+
initialParams: {
|
|
7467
|
+
'orgViewCode': 'sales-organizational-view'
|
|
7468
|
+
},
|
|
7469
|
+
resKeyValue: ['code', 'name']
|
|
7470
|
+
}
|
|
7471
|
+
};
|
|
7472
|
+
break;
|
|
7473
|
+
|
|
7474
|
+
case 'purchase-organization':
|
|
7475
|
+
result = {
|
|
7476
|
+
isChoose: true,
|
|
7477
|
+
remoteSource: {
|
|
7478
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
7479
|
+
initialParams: {
|
|
7480
|
+
'orgViewCode': 'purchase-organizational-view'
|
|
7481
|
+
},
|
|
7482
|
+
resKeyValue: ['code', 'name']
|
|
7483
|
+
}
|
|
7484
|
+
};
|
|
7485
|
+
break;
|
|
7486
|
+
|
|
7487
|
+
case 'stock-organization':
|
|
7488
|
+
result = {
|
|
7489
|
+
isChoose: true,
|
|
7490
|
+
remoteSource: {
|
|
7491
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
7492
|
+
initialParams: {
|
|
7493
|
+
'orgViewCode': 'stock-organizational-view'
|
|
7494
|
+
},
|
|
7495
|
+
resKeyValue: ['code', 'name']
|
|
7496
|
+
}
|
|
7497
|
+
};
|
|
7498
|
+
break;
|
|
7499
|
+
|
|
7500
|
+
default:
|
|
7501
|
+
result = {
|
|
7502
|
+
treeCheckable: true,
|
|
7503
|
+
isChoose: true,
|
|
7504
|
+
remoteSource: {
|
|
7505
|
+
url: "/user/orgViewNode/common/getTreeForOrgViewAndTenant",
|
|
7506
|
+
initialParams: {
|
|
7507
|
+
'orgViewCode': 'administrative-organization-view'
|
|
7508
|
+
},
|
|
7509
|
+
resKeyValue: ['code', 'name']
|
|
7510
|
+
}
|
|
7511
|
+
};
|
|
7512
|
+
break;
|
|
7513
|
+
}
|
|
7514
|
+
|
|
7515
|
+
return result;
|
|
7516
|
+
};
|
|
7517
|
+
|
|
7518
|
+
var MemoTreeSearchSelect = /*#__PURE__*/React__default['default'].memo(TreeSearchSelect);
|
|
7519
|
+
|
|
7520
|
+
var BusinessTreeSearchSelect = function BusinessTreeSearchSelect(props) {
|
|
7521
|
+
var businessType = (props === null || props === void 0 ? void 0 : props.businessType) || 'department';
|
|
7522
|
+
var handleBusinessProps = handleDefaultProps(businessType);
|
|
7523
|
+
var currentProps = React.useMemo(function () {
|
|
7524
|
+
return _objectSpread2(_objectSpread2({}, handleBusinessProps), props);
|
|
7525
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
7526
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(MemoTreeSearchSelect, _objectSpread2({}, currentProps)));
|
|
7527
|
+
};
|
|
7528
|
+
|
|
7529
|
+
var index$1 = /*#__PURE__*/React__default['default'].memo(BusinessTreeSearchSelect, function (props, nextProps) {
|
|
7530
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
7531
|
+
return false;
|
|
7532
|
+
}
|
|
7533
|
+
|
|
7534
|
+
if (props && props.value !== nextProps.value) {
|
|
7535
|
+
return false;
|
|
7536
|
+
}
|
|
7537
|
+
|
|
7538
|
+
return true;
|
|
7539
|
+
});
|
|
7540
|
+
|
|
5760
7541
|
/*
|
|
5761
7542
|
* @Description:
|
|
5762
7543
|
* @Author: rodchen
|
|
@@ -5767,11 +7548,20 @@ function getStorageVale(storageKeyString) {
|
|
|
5767
7548
|
|
|
5768
7549
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
5769
7550
|
axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
7551
|
+
axios__default['default'].defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
|
|
7552
|
+
|
|
7553
|
+
if (localStorage.getItem('x-user-auth-context')) {
|
|
7554
|
+
// @ts-ignore
|
|
7555
|
+
axios__default['default'].defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
7556
|
+
}
|
|
5770
7557
|
|
|
7558
|
+
exports.AddSelect = AddSelect;
|
|
5771
7559
|
exports.BusinessSearchSelect = BusinessSearchSelect$1;
|
|
7560
|
+
exports.BusinessTreeSearchSelect = index$1;
|
|
5772
7561
|
exports.CheckOneUser = index;
|
|
5773
7562
|
exports.CommodityEntry = CommodityEntry;
|
|
5774
7563
|
exports.DataImport = DataImport;
|
|
5775
7564
|
exports.DataValidation = DataValidation;
|
|
5776
7565
|
exports.QueryMutipleInput = QueryMutipleInput;
|
|
5777
7566
|
exports.SearchSelect = SearchSelect;
|
|
7567
|
+
exports.TreeSearchSelect = TreeSearchSelect;
|