@kmkf-fe-packages/basic-components 1.5.0 → 1.6.0-beta.10
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/index.esm.js +660 -281
- package/dist/index.js +657 -277
- package/dist/src/apaas/ApaasInput/index.d.ts +1 -0
- package/dist/src/apaas/SubForm/index.d.ts +29 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,386 +1,372 @@
|
|
|
1
|
-
import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
2
|
-
import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form,
|
|
1
|
+
import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';
|
|
2
|
+
import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Popover, Table, Tabs, ConfigProvider, Pagination } from 'antd';
|
|
3
3
|
import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
|
|
4
4
|
import request, { extend as extend$1 } from 'umi-request';
|
|
5
5
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
6
6
|
import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, WdtSendData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
|
|
7
|
+
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith } from 'lodash';
|
|
8
|
+
import { useUpdateEffect, useDebounceEffect } from 'ahooks';
|
|
7
9
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
8
|
-
import { cloneDeep, difference, differenceWith } from 'lodash';
|
|
9
|
-
import { useDebounceEffect } from 'ahooks';
|
|
10
10
|
import pubsub from 'pubsub-js';
|
|
11
11
|
import BigNumber from 'bignumber.js';
|
|
12
12
|
|
|
13
|
-
function _iterableToArrayLimit(
|
|
14
|
-
var
|
|
15
|
-
if (null !=
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
function _iterableToArrayLimit(arr, i) {
|
|
14
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
15
|
+
if (null != _i) {
|
|
16
|
+
var _s,
|
|
17
|
+
_e,
|
|
18
|
+
_x,
|
|
19
|
+
_r,
|
|
20
|
+
_arr = [],
|
|
21
|
+
_n = !0,
|
|
22
|
+
_d = !1;
|
|
23
23
|
try {
|
|
24
|
-
if (
|
|
25
|
-
if (Object(
|
|
26
|
-
|
|
27
|
-
} else for (; !(
|
|
28
|
-
} catch (
|
|
29
|
-
|
|
24
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
25
|
+
if (Object(_i) !== _i) return;
|
|
26
|
+
_n = !1;
|
|
27
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
_d = !0, _e = err;
|
|
30
30
|
} finally {
|
|
31
31
|
try {
|
|
32
|
-
if (!
|
|
32
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
33
33
|
} finally {
|
|
34
|
-
if (
|
|
34
|
+
if (_d) throw _e;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return _arr;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function ownKeys(
|
|
41
|
-
var
|
|
40
|
+
function ownKeys(object, enumerableOnly) {
|
|
41
|
+
var keys = Object.keys(object);
|
|
42
42
|
if (Object.getOwnPropertySymbols) {
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
return Object.getOwnPropertyDescriptor(
|
|
46
|
-
})),
|
|
43
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
44
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
46
|
+
})), keys.push.apply(keys, symbols);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
function _objectSpread2(
|
|
51
|
-
for (var
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
_defineProperty(
|
|
55
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
56
|
-
Object.defineProperty(
|
|
48
|
+
return keys;
|
|
49
|
+
}
|
|
50
|
+
function _objectSpread2(target) {
|
|
51
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
52
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
53
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
54
|
+
_defineProperty(target, key, source[key]);
|
|
55
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
56
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return target;
|
|
60
60
|
}
|
|
61
61
|
function _regeneratorRuntime() {
|
|
62
62
|
_regeneratorRuntime = function () {
|
|
63
|
-
return
|
|
64
|
-
};
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
t[e] = r.value;
|
|
63
|
+
return exports;
|
|
64
|
+
};
|
|
65
|
+
var exports = {},
|
|
66
|
+
Op = Object.prototype,
|
|
67
|
+
hasOwn = Op.hasOwnProperty,
|
|
68
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
69
|
+
obj[key] = desc.value;
|
|
71
70
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
function define(
|
|
77
|
-
return Object.defineProperty(
|
|
78
|
-
value:
|
|
71
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
72
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
73
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
74
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
75
|
+
function define(obj, key, value) {
|
|
76
|
+
return Object.defineProperty(obj, key, {
|
|
77
|
+
value: value,
|
|
79
78
|
enumerable: !0,
|
|
80
79
|
configurable: !0,
|
|
81
80
|
writable: !0
|
|
82
|
-
}),
|
|
81
|
+
}), obj[key];
|
|
83
82
|
}
|
|
84
83
|
try {
|
|
85
84
|
define({}, "");
|
|
86
|
-
} catch (
|
|
87
|
-
define = function (
|
|
88
|
-
return
|
|
85
|
+
} catch (err) {
|
|
86
|
+
define = function (obj, key, value) {
|
|
87
|
+
return obj[key] = value;
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
|
-
function wrap(
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return
|
|
96
|
-
value: makeInvokeMethod(
|
|
97
|
-
}),
|
|
90
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
91
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
92
|
+
generator = Object.create(protoGenerator.prototype),
|
|
93
|
+
context = new Context(tryLocsList || []);
|
|
94
|
+
return defineProperty(generator, "_invoke", {
|
|
95
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
96
|
+
}), generator;
|
|
98
97
|
}
|
|
99
|
-
function tryCatch(
|
|
98
|
+
function tryCatch(fn, obj, arg) {
|
|
100
99
|
try {
|
|
101
100
|
return {
|
|
102
101
|
type: "normal",
|
|
103
|
-
arg:
|
|
102
|
+
arg: fn.call(obj, arg)
|
|
104
103
|
};
|
|
105
|
-
} catch (
|
|
104
|
+
} catch (err) {
|
|
106
105
|
return {
|
|
107
106
|
type: "throw",
|
|
108
|
-
arg:
|
|
107
|
+
arg: err
|
|
109
108
|
};
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
l = "suspendedYield",
|
|
115
|
-
f = "executing",
|
|
116
|
-
s = "completed",
|
|
117
|
-
y = {};
|
|
111
|
+
exports.wrap = wrap;
|
|
112
|
+
var ContinueSentinel = {};
|
|
118
113
|
function Generator() {}
|
|
119
114
|
function GeneratorFunction() {}
|
|
120
115
|
function GeneratorFunctionPrototype() {}
|
|
121
|
-
var
|
|
122
|
-
define(
|
|
116
|
+
var IteratorPrototype = {};
|
|
117
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
123
118
|
return this;
|
|
124
119
|
});
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var
|
|
129
|
-
function defineIteratorMethods(
|
|
130
|
-
["next", "throw", "return"].forEach(function (
|
|
131
|
-
define(
|
|
132
|
-
return this._invoke(
|
|
120
|
+
var getProto = Object.getPrototypeOf,
|
|
121
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
122
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
123
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
124
|
+
function defineIteratorMethods(prototype) {
|
|
125
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
126
|
+
define(prototype, method, function (arg) {
|
|
127
|
+
return this._invoke(method, arg);
|
|
133
128
|
});
|
|
134
129
|
});
|
|
135
130
|
}
|
|
136
|
-
function AsyncIterator(
|
|
137
|
-
function invoke(
|
|
138
|
-
var
|
|
139
|
-
if ("throw" !==
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
return
|
|
143
|
-
invoke("next",
|
|
144
|
-
}, function (
|
|
145
|
-
invoke("throw",
|
|
146
|
-
}) :
|
|
147
|
-
|
|
148
|
-
}, function (
|
|
149
|
-
return invoke("throw",
|
|
131
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
132
|
+
function invoke(method, arg, resolve, reject) {
|
|
133
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
134
|
+
if ("throw" !== record.type) {
|
|
135
|
+
var result = record.arg,
|
|
136
|
+
value = result.value;
|
|
137
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
138
|
+
invoke("next", value, resolve, reject);
|
|
139
|
+
}, function (err) {
|
|
140
|
+
invoke("throw", err, resolve, reject);
|
|
141
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
142
|
+
result.value = unwrapped, resolve(result);
|
|
143
|
+
}, function (error) {
|
|
144
|
+
return invoke("throw", error, resolve, reject);
|
|
150
145
|
});
|
|
151
146
|
}
|
|
152
|
-
|
|
147
|
+
reject(record.arg);
|
|
153
148
|
}
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
value: function (
|
|
149
|
+
var previousPromise;
|
|
150
|
+
defineProperty(this, "_invoke", {
|
|
151
|
+
value: function (method, arg) {
|
|
157
152
|
function callInvokeWithMethodAndArg() {
|
|
158
|
-
return new
|
|
159
|
-
invoke(
|
|
153
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
154
|
+
invoke(method, arg, resolve, reject);
|
|
160
155
|
});
|
|
161
156
|
}
|
|
162
|
-
return
|
|
157
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
163
158
|
}
|
|
164
159
|
});
|
|
165
160
|
}
|
|
166
|
-
function makeInvokeMethod(
|
|
167
|
-
var
|
|
168
|
-
return function (
|
|
169
|
-
if (
|
|
170
|
-
if (
|
|
171
|
-
if ("throw" ===
|
|
172
|
-
return
|
|
173
|
-
value: t,
|
|
174
|
-
done: !0
|
|
175
|
-
};
|
|
161
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
162
|
+
var state = "suspendedStart";
|
|
163
|
+
return function (method, arg) {
|
|
164
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
165
|
+
if ("completed" === state) {
|
|
166
|
+
if ("throw" === method) throw arg;
|
|
167
|
+
return doneResult();
|
|
176
168
|
}
|
|
177
|
-
for (
|
|
178
|
-
var
|
|
179
|
-
if (
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
return
|
|
169
|
+
for (context.method = method, context.arg = arg;;) {
|
|
170
|
+
var delegate = context.delegate;
|
|
171
|
+
if (delegate) {
|
|
172
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
173
|
+
if (delegateResult) {
|
|
174
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
175
|
+
return delegateResult;
|
|
184
176
|
}
|
|
185
177
|
}
|
|
186
|
-
if ("next" ===
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
} else "return" ===
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
if ("normal" ===
|
|
193
|
-
if (
|
|
178
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
179
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
180
|
+
context.dispatchException(context.arg);
|
|
181
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
182
|
+
state = "executing";
|
|
183
|
+
var record = tryCatch(innerFn, self, context);
|
|
184
|
+
if ("normal" === record.type) {
|
|
185
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
194
186
|
return {
|
|
195
|
-
value:
|
|
196
|
-
done:
|
|
187
|
+
value: record.arg,
|
|
188
|
+
done: context.done
|
|
197
189
|
};
|
|
198
190
|
}
|
|
199
|
-
"throw" ===
|
|
191
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
200
192
|
}
|
|
201
193
|
};
|
|
202
194
|
}
|
|
203
|
-
function maybeInvokeDelegate(
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
if (
|
|
207
|
-
var
|
|
208
|
-
if ("throw" ===
|
|
209
|
-
var
|
|
210
|
-
return
|
|
195
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
196
|
+
var methodName = context.method,
|
|
197
|
+
method = delegate.iterator[methodName];
|
|
198
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
199
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
200
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
201
|
+
var info = record.arg;
|
|
202
|
+
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);
|
|
211
203
|
}
|
|
212
|
-
function pushTryEntry(
|
|
213
|
-
var
|
|
214
|
-
tryLoc:
|
|
204
|
+
function pushTryEntry(locs) {
|
|
205
|
+
var entry = {
|
|
206
|
+
tryLoc: locs[0]
|
|
215
207
|
};
|
|
216
|
-
1 in
|
|
208
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
217
209
|
}
|
|
218
|
-
function resetTryEntry(
|
|
219
|
-
var
|
|
220
|
-
|
|
210
|
+
function resetTryEntry(entry) {
|
|
211
|
+
var record = entry.completion || {};
|
|
212
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
221
213
|
}
|
|
222
|
-
function Context(
|
|
214
|
+
function Context(tryLocsList) {
|
|
223
215
|
this.tryEntries = [{
|
|
224
216
|
tryLoc: "root"
|
|
225
|
-
}],
|
|
217
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
226
218
|
}
|
|
227
|
-
function values(
|
|
228
|
-
if (
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
if ("function" == typeof
|
|
232
|
-
if (!isNaN(
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
for (; ++
|
|
236
|
-
return next.value =
|
|
219
|
+
function values(iterable) {
|
|
220
|
+
if (iterable) {
|
|
221
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
222
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
223
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
224
|
+
if (!isNaN(iterable.length)) {
|
|
225
|
+
var i = -1,
|
|
226
|
+
next = function next() {
|
|
227
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
228
|
+
return next.value = undefined, next.done = !0, next;
|
|
237
229
|
};
|
|
238
|
-
return
|
|
230
|
+
return next.next = next;
|
|
239
231
|
}
|
|
240
232
|
}
|
|
241
|
-
|
|
233
|
+
return {
|
|
234
|
+
next: doneResult
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function doneResult() {
|
|
238
|
+
return {
|
|
239
|
+
value: undefined,
|
|
240
|
+
done: !0
|
|
241
|
+
};
|
|
242
242
|
}
|
|
243
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
243
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
244
244
|
value: GeneratorFunctionPrototype,
|
|
245
245
|
configurable: !0
|
|
246
|
-
}),
|
|
246
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
247
247
|
value: GeneratorFunction,
|
|
248
248
|
configurable: !0
|
|
249
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
250
|
-
var
|
|
251
|
-
return !!
|
|
252
|
-
},
|
|
253
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
254
|
-
},
|
|
249
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
250
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
251
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
252
|
+
}, exports.mark = function (genFun) {
|
|
253
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
254
|
+
}, exports.awrap = function (arg) {
|
|
255
255
|
return {
|
|
256
|
-
__await:
|
|
256
|
+
__await: arg
|
|
257
257
|
};
|
|
258
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
258
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
259
259
|
return this;
|
|
260
|
-
}),
|
|
261
|
-
void 0 ===
|
|
262
|
-
var
|
|
263
|
-
return
|
|
264
|
-
return
|
|
260
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
261
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
262
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
263
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
264
|
+
return result.done ? result.value : iter.next();
|
|
265
265
|
});
|
|
266
|
-
}, defineIteratorMethods(
|
|
266
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
267
267
|
return this;
|
|
268
|
-
}), define(
|
|
268
|
+
}), define(Gp, "toString", function () {
|
|
269
269
|
return "[object Generator]";
|
|
270
|
-
}),
|
|
271
|
-
var
|
|
272
|
-
|
|
273
|
-
for (var
|
|
274
|
-
return
|
|
275
|
-
for (;
|
|
276
|
-
var
|
|
277
|
-
if (
|
|
270
|
+
}), exports.keys = function (val) {
|
|
271
|
+
var object = Object(val),
|
|
272
|
+
keys = [];
|
|
273
|
+
for (var key in object) keys.push(key);
|
|
274
|
+
return keys.reverse(), function next() {
|
|
275
|
+
for (; keys.length;) {
|
|
276
|
+
var key = keys.pop();
|
|
277
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
278
278
|
}
|
|
279
279
|
return next.done = !0, next;
|
|
280
280
|
};
|
|
281
|
-
},
|
|
281
|
+
}, exports.values = values, Context.prototype = {
|
|
282
282
|
constructor: Context,
|
|
283
|
-
reset: function (
|
|
284
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
283
|
+
reset: function (skipTempReset) {
|
|
284
|
+
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);
|
|
285
285
|
},
|
|
286
286
|
stop: function () {
|
|
287
287
|
this.done = !0;
|
|
288
|
-
var
|
|
289
|
-
if ("throw" ===
|
|
288
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
289
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
290
290
|
return this.rval;
|
|
291
291
|
},
|
|
292
|
-
dispatchException: function (
|
|
293
|
-
if (this.done) throw
|
|
294
|
-
var
|
|
295
|
-
function handle(
|
|
296
|
-
return
|
|
292
|
+
dispatchException: function (exception) {
|
|
293
|
+
if (this.done) throw exception;
|
|
294
|
+
var context = this;
|
|
295
|
+
function handle(loc, caught) {
|
|
296
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
297
297
|
}
|
|
298
|
-
for (var
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
if ("root" ===
|
|
302
|
-
if (
|
|
303
|
-
var
|
|
304
|
-
|
|
305
|
-
if (
|
|
306
|
-
if (this.prev <
|
|
307
|
-
if (this.prev <
|
|
308
|
-
} else if (
|
|
309
|
-
if (this.prev <
|
|
298
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
299
|
+
var entry = this.tryEntries[i],
|
|
300
|
+
record = entry.completion;
|
|
301
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
302
|
+
if (entry.tryLoc <= this.prev) {
|
|
303
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
304
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
305
|
+
if (hasCatch && hasFinally) {
|
|
306
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
307
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
308
|
+
} else if (hasCatch) {
|
|
309
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
310
310
|
} else {
|
|
311
|
-
if (!
|
|
312
|
-
if (this.prev <
|
|
311
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
312
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
},
|
|
317
|
-
abrupt: function (
|
|
318
|
-
for (var
|
|
319
|
-
var
|
|
320
|
-
if (
|
|
321
|
-
var
|
|
317
|
+
abrupt: function (type, arg) {
|
|
318
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
319
|
+
var entry = this.tryEntries[i];
|
|
320
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
321
|
+
var finallyEntry = entry;
|
|
322
322
|
break;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
return
|
|
325
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
326
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
327
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
328
328
|
},
|
|
329
|
-
complete: function (
|
|
330
|
-
if ("throw" ===
|
|
331
|
-
return "break" ===
|
|
329
|
+
complete: function (record, afterLoc) {
|
|
330
|
+
if ("throw" === record.type) throw record.arg;
|
|
331
|
+
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;
|
|
332
332
|
},
|
|
333
|
-
finish: function (
|
|
334
|
-
for (var
|
|
335
|
-
var
|
|
336
|
-
if (
|
|
333
|
+
finish: function (finallyLoc) {
|
|
334
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
335
|
+
var entry = this.tryEntries[i];
|
|
336
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
|
-
catch: function (
|
|
340
|
-
for (var
|
|
341
|
-
var
|
|
342
|
-
if (
|
|
343
|
-
var
|
|
344
|
-
if ("throw" ===
|
|
345
|
-
var
|
|
346
|
-
resetTryEntry(
|
|
339
|
+
catch: function (tryLoc) {
|
|
340
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
341
|
+
var entry = this.tryEntries[i];
|
|
342
|
+
if (entry.tryLoc === tryLoc) {
|
|
343
|
+
var record = entry.completion;
|
|
344
|
+
if ("throw" === record.type) {
|
|
345
|
+
var thrown = record.arg;
|
|
346
|
+
resetTryEntry(entry);
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return thrown;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
throw new Error("illegal catch attempt");
|
|
352
352
|
},
|
|
353
|
-
delegateYield: function (
|
|
353
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
354
354
|
return this.delegate = {
|
|
355
|
-
iterator: values(
|
|
356
|
-
resultName:
|
|
357
|
-
nextLoc:
|
|
358
|
-
}, "next" === this.method && (this.arg =
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
}
|
|
362
|
-
function _toPrimitive(t, r) {
|
|
363
|
-
if ("object" != typeof t || !t) return t;
|
|
364
|
-
var e = t[Symbol.toPrimitive];
|
|
365
|
-
if (void 0 !== e) {
|
|
366
|
-
var i = e.call(t, r || "default");
|
|
367
|
-
if ("object" != typeof i) return i;
|
|
368
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
369
|
-
}
|
|
370
|
-
return ("string" === r ? String : Number)(t);
|
|
371
|
-
}
|
|
372
|
-
function _toPropertyKey(t) {
|
|
373
|
-
var i = _toPrimitive(t, "string");
|
|
374
|
-
return "symbol" == typeof i ? i : String(i);
|
|
355
|
+
iterator: values(iterable),
|
|
356
|
+
resultName: resultName,
|
|
357
|
+
nextLoc: nextLoc
|
|
358
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
359
|
+
}
|
|
360
|
+
}, exports;
|
|
375
361
|
}
|
|
376
|
-
function _typeof(
|
|
362
|
+
function _typeof(obj) {
|
|
377
363
|
"@babel/helpers - typeof";
|
|
378
364
|
|
|
379
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
380
|
-
return typeof
|
|
381
|
-
} : function (
|
|
382
|
-
return
|
|
383
|
-
}, _typeof(
|
|
365
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
366
|
+
return typeof obj;
|
|
367
|
+
} : function (obj) {
|
|
368
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
369
|
+
}, _typeof(obj);
|
|
384
370
|
}
|
|
385
371
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
386
372
|
try {
|
|
@@ -487,6 +473,20 @@ function _nonIterableSpread() {
|
|
|
487
473
|
function _nonIterableRest() {
|
|
488
474
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
489
475
|
}
|
|
476
|
+
function _toPrimitive(input, hint) {
|
|
477
|
+
if (typeof input !== "object" || input === null) return input;
|
|
478
|
+
var prim = input[Symbol.toPrimitive];
|
|
479
|
+
if (prim !== undefined) {
|
|
480
|
+
var res = prim.call(input, hint || "default");
|
|
481
|
+
if (typeof res !== "object") return res;
|
|
482
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
483
|
+
}
|
|
484
|
+
return (hint === "string" ? String : Number)(input);
|
|
485
|
+
}
|
|
486
|
+
function _toPropertyKey(arg) {
|
|
487
|
+
var key = _toPrimitive(arg, "string");
|
|
488
|
+
return typeof key === "symbol" ? key : String(key);
|
|
489
|
+
}
|
|
490
490
|
|
|
491
491
|
function ApaasCascader(props) {
|
|
492
492
|
return /*#__PURE__*/React.createElement(Cascader, _objectSpread2({
|
|
@@ -511,11 +511,12 @@ var ApaasDate = function ApaasDate(props) {
|
|
|
511
511
|
}, otherProps));
|
|
512
512
|
};
|
|
513
513
|
|
|
514
|
-
var _excluded$1 = ["isNumber", "replaceWarn"];
|
|
514
|
+
var _excluded$1 = ["isNumber", "replaceWarn", "precision"];
|
|
515
515
|
function ApaasInput(props) {
|
|
516
516
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
517
517
|
var isNumber = props.isNumber,
|
|
518
518
|
replaceWarn = props.replaceWarn,
|
|
519
|
+
precision = props.precision,
|
|
519
520
|
other = _objectWithoutProperties(props, _excluded$1);
|
|
520
521
|
var handleBlur = function handleBlur(e) {
|
|
521
522
|
// 去除头尾空格
|
|
@@ -525,8 +526,12 @@ function ApaasInput(props) {
|
|
|
525
526
|
typeof onChange === 'function' && onChange(e);
|
|
526
527
|
typeof onBlur === 'function' && onBlur(e);
|
|
527
528
|
};
|
|
529
|
+
return isNumber ?
|
|
530
|
+
/*#__PURE__*/
|
|
528
531
|
// @ts-ignore
|
|
529
|
-
|
|
532
|
+
React.createElement(InputNumber, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
533
|
+
precision: precision === 'nolimit' ? undefined : precision
|
|
534
|
+
})) : /*#__PURE__*/React.createElement(Input, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
530
535
|
onBlur: handleBlur
|
|
531
536
|
}));
|
|
532
537
|
}
|
|
@@ -7627,6 +7632,391 @@ function withFormItem(WrappedComponent) {
|
|
|
7627
7632
|
};
|
|
7628
7633
|
}
|
|
7629
7634
|
|
|
7635
|
+
/*
|
|
7636
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
|
7637
|
+
* @Date: 2022-09-13 11:06:09
|
|
7638
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
|
7639
|
+
* @LastEditTime: 2022-11-04 15:55:10
|
|
7640
|
+
* @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
|
|
7641
|
+
* @Description:
|
|
7642
|
+
*
|
|
7643
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
|
7644
|
+
*/
|
|
7645
|
+
var extendRequest = extend$1({});
|
|
7646
|
+
|
|
7647
|
+
var WidgetMap = {
|
|
7648
|
+
INPUT: 'input',
|
|
7649
|
+
TEXTAREA: 'textarea'
|
|
7650
|
+
};
|
|
7651
|
+
var pageSize = 50;
|
|
7652
|
+
var SubForm = function SubForm(props) {
|
|
7653
|
+
var _selectOptions$;
|
|
7654
|
+
var value = props.value,
|
|
7655
|
+
onChange = props.onChange,
|
|
7656
|
+
needFilterShopByPermission = props.needFilterShopByPermission,
|
|
7657
|
+
_props$subConfig = props.subConfig,
|
|
7658
|
+
flowStatus = _props$subConfig.flowStatus,
|
|
7659
|
+
flowTemplateKey = _props$subConfig.flowTemplateKey,
|
|
7660
|
+
nodeId = _props$subConfig.nodeId,
|
|
7661
|
+
workOrderTemplateId = _props$subConfig.workOrderTemplateId,
|
|
7662
|
+
correlationList = _props$subConfig.correlationList,
|
|
7663
|
+
tableHeader = props.tableHeader,
|
|
7664
|
+
disabled = props.disabled;
|
|
7665
|
+
var ref = useRef(null);
|
|
7666
|
+
var _useState = useState(false),
|
|
7667
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7668
|
+
open = _useState2[0],
|
|
7669
|
+
setOpen = _useState2[1];
|
|
7670
|
+
var _useState3 = useState(''),
|
|
7671
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
7672
|
+
selectKey = _useState4[0],
|
|
7673
|
+
setSelectKey = _useState4[1];
|
|
7674
|
+
var _useState5 = useState(''),
|
|
7675
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
7676
|
+
inputValue = _useState6[0],
|
|
7677
|
+
setInputValue = _useState6[1];
|
|
7678
|
+
var _useState7 = useState([]),
|
|
7679
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
7680
|
+
list = _useState8[0],
|
|
7681
|
+
setList = _useState8[1];
|
|
7682
|
+
var _useState9 = useState(1),
|
|
7683
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
7684
|
+
pageNo = _useState10[0],
|
|
7685
|
+
setPageNo = _useState10[1];
|
|
7686
|
+
var _useState11 = useState(true),
|
|
7687
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
7688
|
+
hasMore = _useState12[0],
|
|
7689
|
+
setHasMore = _useState12[1];
|
|
7690
|
+
var updateHandle = function updateHandle(val, index, type) {
|
|
7691
|
+
if (value === null || value === void 0 ? void 0 : value.length) {
|
|
7692
|
+
var valueItem = tableHeader.find(function (t) {
|
|
7693
|
+
return t.key === type && t.isNumber && t.precision !== 'nolimit';
|
|
7694
|
+
});
|
|
7695
|
+
var newValue = JSON.parse(JSON.stringify(value));
|
|
7696
|
+
newValue[index][type] = valueItem ? Number(val).toFixed(+valueItem.precision) : val;
|
|
7697
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newValue));
|
|
7698
|
+
}
|
|
7699
|
+
};
|
|
7700
|
+
var newTableHeader = useMemo(function () {
|
|
7701
|
+
return correlationList.reduce(function (prv, next) {
|
|
7702
|
+
var t = tableHeader.find(function (t) {
|
|
7703
|
+
return t.key === next.key;
|
|
7704
|
+
}) || {
|
|
7705
|
+
isShow: true,
|
|
7706
|
+
isEdit: false,
|
|
7707
|
+
isRequired: false,
|
|
7708
|
+
isNumber: false,
|
|
7709
|
+
precision: 'nolimit',
|
|
7710
|
+
width: 150
|
|
7711
|
+
};
|
|
7712
|
+
if (t && t.isShow) {
|
|
7713
|
+
prv.push(_objectSpread2(_objectSpread2({}, next), t));
|
|
7714
|
+
}
|
|
7715
|
+
return prv;
|
|
7716
|
+
}, []);
|
|
7717
|
+
}, [correlationList, tableHeader]);
|
|
7718
|
+
var column = [{
|
|
7719
|
+
dataIndex: 'index',
|
|
7720
|
+
title: '序号',
|
|
7721
|
+
width: 50,
|
|
7722
|
+
render: function render(val, record, index) {
|
|
7723
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7724
|
+
style: {
|
|
7725
|
+
width: 25
|
|
7726
|
+
}
|
|
7727
|
+
}, index + 1);
|
|
7728
|
+
}
|
|
7729
|
+
}].concat(_toConsumableArray(newTableHeader.map(function (t) {
|
|
7730
|
+
return {
|
|
7731
|
+
dataIndex: t.key,
|
|
7732
|
+
title: /*#__PURE__*/React.createElement("span", null, t.isRequired ? /*#__PURE__*/React.createElement("span", {
|
|
7733
|
+
style: {
|
|
7734
|
+
color: 'red'
|
|
7735
|
+
}
|
|
7736
|
+
}, "*") : null, t.name),
|
|
7737
|
+
ellipsis: true,
|
|
7738
|
+
width: t.width,
|
|
7739
|
+
render: function render(val, record, index) {
|
|
7740
|
+
// @ts-ignore
|
|
7741
|
+
var precisionValue = t.precision === 'nolimit' ? undefined : t.precision;
|
|
7742
|
+
return !t.isEdit ? t.isNumber ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
7743
|
+
style: {
|
|
7744
|
+
width: '100%'
|
|
7745
|
+
},
|
|
7746
|
+
value: val,
|
|
7747
|
+
precision: precisionValue,
|
|
7748
|
+
onChange: function onChange(e) {
|
|
7749
|
+
return updateHandle(e, index, t.key);
|
|
7750
|
+
},
|
|
7751
|
+
stringMode: true
|
|
7752
|
+
}) : /*#__PURE__*/React.createElement(Input, {
|
|
7753
|
+
style: {
|
|
7754
|
+
width: '100%'
|
|
7755
|
+
},
|
|
7756
|
+
value: val,
|
|
7757
|
+
onChange: function onChange(e) {
|
|
7758
|
+
var _e$target;
|
|
7759
|
+
return updateHandle(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value, index, t.key);
|
|
7760
|
+
}
|
|
7761
|
+
}) : /*#__PURE__*/React.createElement("div", null, val);
|
|
7762
|
+
}
|
|
7763
|
+
};
|
|
7764
|
+
})), [disabled ? {} : {
|
|
7765
|
+
dataIndex: 'operation',
|
|
7766
|
+
title: '操作',
|
|
7767
|
+
width: 70,
|
|
7768
|
+
render: function render(val, record, index) {
|
|
7769
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
7770
|
+
type: "link",
|
|
7771
|
+
onClick: function onClick() {
|
|
7772
|
+
return deleteHandle(record.uuid);
|
|
7773
|
+
}
|
|
7774
|
+
}, "\u5220\u9664");
|
|
7775
|
+
}
|
|
7776
|
+
}]);
|
|
7777
|
+
var columsSearch = useMemo(function () {
|
|
7778
|
+
return [{
|
|
7779
|
+
dataIndex: 'index',
|
|
7780
|
+
title: '序号',
|
|
7781
|
+
render: function render(val, record, index) {
|
|
7782
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7783
|
+
style: {
|
|
7784
|
+
width: 25
|
|
7785
|
+
}
|
|
7786
|
+
}, index + 1);
|
|
7787
|
+
}
|
|
7788
|
+
}].concat(_toConsumableArray(newTableHeader.map(function (t) {
|
|
7789
|
+
return {
|
|
7790
|
+
dataIndex: t.key,
|
|
7791
|
+
title: t.name
|
|
7792
|
+
};
|
|
7793
|
+
})));
|
|
7794
|
+
}, [newTableHeader]);
|
|
7795
|
+
var valueMap = useMemo(function () {
|
|
7796
|
+
return newTableHeader.reduce(function (prv, next) {
|
|
7797
|
+
prv["".concat(next.key, "_").concat(WidgetMap[next.workOrderComponentType])] = next.key;
|
|
7798
|
+
return prv;
|
|
7799
|
+
}, {});
|
|
7800
|
+
}, [newTableHeader]);
|
|
7801
|
+
var selectOptions = useMemo(function () {
|
|
7802
|
+
var _options$;
|
|
7803
|
+
var options = newTableHeader.map(function (item) {
|
|
7804
|
+
return {
|
|
7805
|
+
label: item.name,
|
|
7806
|
+
value: "".concat(item.key, "_").concat(WidgetMap[item.workOrderComponentType])
|
|
7807
|
+
};
|
|
7808
|
+
});
|
|
7809
|
+
setSelectKey(options === null || options === void 0 ? void 0 : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value);
|
|
7810
|
+
return options;
|
|
7811
|
+
}, [newTableHeader]);
|
|
7812
|
+
var deleteHandle = function deleteHandle(uuid) {
|
|
7813
|
+
var newList = value.filter(function (item) {
|
|
7814
|
+
return item.uuid !== uuid;
|
|
7815
|
+
});
|
|
7816
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
7817
|
+
};
|
|
7818
|
+
var onScrollCapture = function onScrollCapture(e) {
|
|
7819
|
+
if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) {
|
|
7820
|
+
if (hasMore) {
|
|
7821
|
+
getWorkOrderList({
|
|
7822
|
+
pageNo: pageNo + 1
|
|
7823
|
+
});
|
|
7824
|
+
setPageNo(pageNo + 1);
|
|
7825
|
+
}
|
|
7826
|
+
}
|
|
7827
|
+
};
|
|
7828
|
+
var getWorkOrderList = /*#__PURE__*/function () {
|
|
7829
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7830
|
+
var _ref2,
|
|
7831
|
+
_ref2$pageNo,
|
|
7832
|
+
pageNo,
|
|
7833
|
+
params,
|
|
7834
|
+
res,
|
|
7835
|
+
data,
|
|
7836
|
+
success,
|
|
7837
|
+
newList,
|
|
7838
|
+
_args = arguments;
|
|
7839
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7840
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7841
|
+
case 0:
|
|
7842
|
+
_ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$pageNo = _ref2.pageNo, pageNo = _ref2$pageNo === void 0 ? 1 : _ref2$pageNo;
|
|
7843
|
+
if (!disabled) {
|
|
7844
|
+
_context.next = 3;
|
|
7845
|
+
break;
|
|
7846
|
+
}
|
|
7847
|
+
return _context.abrupt("return");
|
|
7848
|
+
case 3:
|
|
7849
|
+
params = {
|
|
7850
|
+
flowNodeId: nodeId,
|
|
7851
|
+
flowTemplateKey: flowTemplateKey === null || flowTemplateKey === void 0 ? void 0 : flowTemplateKey[1],
|
|
7852
|
+
pageNo: pageNo,
|
|
7853
|
+
pageSize: pageSize,
|
|
7854
|
+
templateKey: workOrderTemplateId,
|
|
7855
|
+
needReturnRepeatValue: true,
|
|
7856
|
+
needFilterShopByPermission: needFilterShopByPermission,
|
|
7857
|
+
queryComponents: [{
|
|
7858
|
+
key: 'flowStatus',
|
|
7859
|
+
symbol: 'in',
|
|
7860
|
+
value: flowStatus
|
|
7861
|
+
}]
|
|
7862
|
+
};
|
|
7863
|
+
if (selectKey && inputValue) {
|
|
7864
|
+
params.queryComponents = [{
|
|
7865
|
+
key: 'flowStatus',
|
|
7866
|
+
symbol: 'in',
|
|
7867
|
+
value: flowStatus
|
|
7868
|
+
}, {
|
|
7869
|
+
key: selectKey,
|
|
7870
|
+
symbol: 'in',
|
|
7871
|
+
value: [inputValue]
|
|
7872
|
+
}];
|
|
7873
|
+
}
|
|
7874
|
+
_context.next = 7;
|
|
7875
|
+
return extendRequest('/qy/view/workOrderList', {
|
|
7876
|
+
method: 'post',
|
|
7877
|
+
data: params
|
|
7878
|
+
});
|
|
7879
|
+
case 7:
|
|
7880
|
+
res = _context.sent;
|
|
7881
|
+
data = res.data, success = res.success;
|
|
7882
|
+
if (success) {
|
|
7883
|
+
newList = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
7884
|
+
var params = {};
|
|
7885
|
+
Object.keys(item.jsonMap).forEach(function (key) {
|
|
7886
|
+
if (valueMap[key]) {
|
|
7887
|
+
params[valueMap[key]] = item.jsonMap[key];
|
|
7888
|
+
}
|
|
7889
|
+
});
|
|
7890
|
+
return params;
|
|
7891
|
+
});
|
|
7892
|
+
if (pageNo === 1) {
|
|
7893
|
+
setList(newList);
|
|
7894
|
+
} else {
|
|
7895
|
+
setList([].concat(_toConsumableArray(list), _toConsumableArray(newList)));
|
|
7896
|
+
setHasMore((data === null || data === void 0 ? void 0 : data.list.length) === pageSize);
|
|
7897
|
+
}
|
|
7898
|
+
}
|
|
7899
|
+
case 10:
|
|
7900
|
+
case "end":
|
|
7901
|
+
return _context.stop();
|
|
7902
|
+
}
|
|
7903
|
+
}, _callee);
|
|
7904
|
+
}));
|
|
7905
|
+
return function getWorkOrderList() {
|
|
7906
|
+
return _ref.apply(this, arguments);
|
|
7907
|
+
};
|
|
7908
|
+
}();
|
|
7909
|
+
useEffect(function () {
|
|
7910
|
+
getWorkOrderList({
|
|
7911
|
+
pageNo: 1
|
|
7912
|
+
});
|
|
7913
|
+
}, []);
|
|
7914
|
+
useUpdateEffect(function () {
|
|
7915
|
+
setPageNo(1);
|
|
7916
|
+
getWorkOrderList({
|
|
7917
|
+
pageNo: 1
|
|
7918
|
+
});
|
|
7919
|
+
}, [inputValue]);
|
|
7920
|
+
var handleOpenChange = function handleOpenChange(newOpen) {
|
|
7921
|
+
setOpen(newOpen);
|
|
7922
|
+
};
|
|
7923
|
+
var onChangeInput = useCallback(debounce(function (val) {
|
|
7924
|
+
setInputValue(val);
|
|
7925
|
+
setOpen(true);
|
|
7926
|
+
}, 1000), []);
|
|
7927
|
+
var hasNumber = function hasNumber(val) {
|
|
7928
|
+
try {
|
|
7929
|
+
return isNaN$1(+val) ? false : isNumber$1(+val);
|
|
7930
|
+
} catch (e) {
|
|
7931
|
+
return false;
|
|
7932
|
+
}
|
|
7933
|
+
};
|
|
7934
|
+
var selectValueHandle = function selectValueHandle(record) {
|
|
7935
|
+
var numberKeys = newTableHeader.map(function (t) {
|
|
7936
|
+
if (t.isNumber) {
|
|
7937
|
+
return t.key;
|
|
7938
|
+
}
|
|
7939
|
+
});
|
|
7940
|
+
var newValue = _objectSpread2({}, record);
|
|
7941
|
+
if (numberKeys.length) {
|
|
7942
|
+
Object.keys(newValue).forEach(function (key) {
|
|
7943
|
+
if (numberKeys.includes(key)) {
|
|
7944
|
+
newValue[key] = hasNumber(newValue[key]) ? newValue[key] : '';
|
|
7945
|
+
}
|
|
7946
|
+
});
|
|
7947
|
+
}
|
|
7948
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), [_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
7949
|
+
uuid: uuid()
|
|
7950
|
+
})]));
|
|
7951
|
+
};
|
|
7952
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(Space, {
|
|
7953
|
+
style: {
|
|
7954
|
+
marginBottom: '10px'
|
|
7955
|
+
}
|
|
7956
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
7957
|
+
style: {
|
|
7958
|
+
width: '120px'
|
|
7959
|
+
},
|
|
7960
|
+
options: selectOptions,
|
|
7961
|
+
defaultValue: selectOptions === null || selectOptions === void 0 ? void 0 : (_selectOptions$ = selectOptions[0]) === null || _selectOptions$ === void 0 ? void 0 : _selectOptions$.value,
|
|
7962
|
+
value: selectKey,
|
|
7963
|
+
onChange: setSelectKey
|
|
7964
|
+
}), /*#__PURE__*/React.createElement(Popover, {
|
|
7965
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
7966
|
+
ref: ref,
|
|
7967
|
+
onScrollCapture: onScrollCapture,
|
|
7968
|
+
style: {
|
|
7969
|
+
height: 320,
|
|
7970
|
+
overflowY: 'scroll',
|
|
7971
|
+
overflowX: 'auto'
|
|
7972
|
+
}
|
|
7973
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
7974
|
+
columns: columsSearch,
|
|
7975
|
+
dataSource: list,
|
|
7976
|
+
rowKey: 'index',
|
|
7977
|
+
size: "small",
|
|
7978
|
+
pagination: false,
|
|
7979
|
+
scroll: {
|
|
7980
|
+
x: '100%'
|
|
7981
|
+
},
|
|
7982
|
+
locale: {
|
|
7983
|
+
emptyText: '暂无数据'
|
|
7984
|
+
},
|
|
7985
|
+
onRow: function onRow(record) {
|
|
7986
|
+
return {
|
|
7987
|
+
onClick: function onClick(e) {
|
|
7988
|
+
e.stopPropagation();
|
|
7989
|
+
selectValueHandle(record);
|
|
7990
|
+
setOpen(false);
|
|
7991
|
+
}
|
|
7992
|
+
};
|
|
7993
|
+
}
|
|
7994
|
+
})),
|
|
7995
|
+
trigger: "click",
|
|
7996
|
+
placement: "bottom",
|
|
7997
|
+
visible: open,
|
|
7998
|
+
onVisibleChange: handleOpenChange
|
|
7999
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
8000
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u67E5\u8BE2",
|
|
8001
|
+
allowClear: true,
|
|
8002
|
+
onChange: function onChange(e) {
|
|
8003
|
+
onChangeInput(e.target.value);
|
|
8004
|
+
}
|
|
8005
|
+
}))), /*#__PURE__*/React.createElement(Table, {
|
|
8006
|
+
columns: column,
|
|
8007
|
+
dataSource: value,
|
|
8008
|
+
rowKey: 'uuid',
|
|
8009
|
+
size: "small",
|
|
8010
|
+
pagination: false,
|
|
8011
|
+
scroll: {
|
|
8012
|
+
x: '100%'
|
|
8013
|
+
},
|
|
8014
|
+
locale: {
|
|
8015
|
+
emptyText: '暂无数据'
|
|
8016
|
+
}
|
|
8017
|
+
}));
|
|
8018
|
+
};
|
|
8019
|
+
|
|
7630
8020
|
var BuyerNick = function BuyerNick(props) {
|
|
7631
8021
|
var _props$value = props.value,
|
|
7632
8022
|
value = _props$value === void 0 ? {} : _props$value,
|
|
@@ -7913,18 +8303,6 @@ var AliPay = function AliPay(props) {
|
|
|
7913
8303
|
})));
|
|
7914
8304
|
};
|
|
7915
8305
|
|
|
7916
|
-
/*
|
|
7917
|
-
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
|
7918
|
-
* @Date: 2022-09-13 11:06:09
|
|
7919
|
-
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
|
7920
|
-
* @LastEditTime: 2022-11-04 15:55:10
|
|
7921
|
-
* @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
|
|
7922
|
-
* @Description:
|
|
7923
|
-
*
|
|
7924
|
-
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
|
7925
|
-
*/
|
|
7926
|
-
var extendRequest = extend$1({});
|
|
7927
|
-
|
|
7928
8306
|
var css_248z$5 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.goodsBox .right-context {\n font-size: 12px;\n}\n.goodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.goodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.goodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n.goods-imgBox .add-btn {\n color: #86909c;\n}\n.goods-imgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
|
|
7929
8307
|
styleInject(css_248z$5);
|
|
7930
8308
|
|
|
@@ -13750,9 +14128,7 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
13750
14128
|
var _typeMap$type25;
|
|
13751
14129
|
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
|
|
13752
14130
|
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
|
|
13753
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
|
|
13754
|
-
gutter: 8
|
|
13755
|
-
}, /*#__PURE__*/React.createElement(Col, {
|
|
14131
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
|
13756
14132
|
className: "gutter-row",
|
|
13757
14133
|
xs: {
|
|
13758
14134
|
span: 11
|
|
@@ -13784,6 +14160,9 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
13784
14160
|
},
|
|
13785
14161
|
md: {
|
|
13786
14162
|
span: 6
|
|
14163
|
+
},
|
|
14164
|
+
style: {
|
|
14165
|
+
marginLeft: '8px'
|
|
13787
14166
|
}
|
|
13788
14167
|
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
13789
14168
|
style: {
|
|
@@ -14578,4 +14957,4 @@ var CalculationInput = function CalculationInput(props) {
|
|
|
14578
14957
|
}, config === null || config === void 0 ? void 0 : config.unit));
|
|
14579
14958
|
};
|
|
14580
14959
|
|
|
14581
|
-
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
|
|
14960
|
+
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
|