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