@mi-avalon/libs 0.0.5 → 0.0.7
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/LICENSE +2 -2
- package/README.md +159 -2
- package/dist/components/ItemsRow/index.d.ts +43 -0
- package/dist/components/MBreadcrumb/index.d.ts +18 -0
- package/dist/components/MDescriptions/index.d.ts +65 -0
- package/dist/components/MForm/MFormItemConst.d.ts +27 -0
- package/dist/components/MForm/index.d.ts +10 -0
- package/dist/components/MForm/type.d.ts +184 -0
- package/dist/components/MSearch/index.d.ts +27 -0
- package/dist/components/MTable/index.d.ts +12 -0
- package/dist/components/MiModal/index.d.ts +16 -0
- package/dist/components/ThemeContext/CompThemeProvider.d.ts +9 -0
- package/dist/components/ThemeContext/index.d.ts +8 -0
- package/dist/components/index.d.ts +9 -1
- package/dist/constants/date.d.ts +11 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/pageInfo.d.ts +1 -0
- package/dist/constants/pattern.d.ts +24 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useFuncRequest.d.ts +16 -0
- package/dist/hooks/useInterval.d.ts +8 -0
- package/dist/hooks/usePagination.d.ts +42 -0
- package/dist/hooks/useQuery.d.ts +3 -0
- package/dist/hooks/useReactive.d.ts +2 -0
- package/dist/hooks/useTimeout.d.ts +8 -0
- package/dist/hooks/useVirtualList.d.ts +74 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +8 -9
- package/dist/libs.cjs.development.js +2094 -0
- package/dist/libs.cjs.development.js.map +1 -0
- package/dist/libs.cjs.production.min.js +2 -0
- package/dist/libs.cjs.production.min.js.map +1 -0
- package/dist/libs.esm.js +2060 -0
- package/dist/libs.esm.js.map +1 -0
- package/dist/utils/calc.d.ts +20 -0
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/nextTick.d.ts +14 -0
- package/dist/utils/openModal.d.ts +15 -0
- package/dist/utils/util.d.ts +4 -0
- package/dist/utils/version.d.ts +70 -0
- package/package.json +67 -37
- package/src/components/ItemsRow/index.scss +18 -0
- package/src/components/ItemsRow/index.tsx +85 -0
- package/src/components/MBreadcrumb/index.scss +82 -0
- package/src/components/MBreadcrumb/index.tsx +93 -0
- package/src/components/MDescriptions/index.tsx +131 -0
- package/src/components/MForm/MFormItemConst.tsx +206 -0
- package/src/components/MForm/index.scss +13 -0
- package/src/components/MForm/index.tsx +97 -0
- package/src/components/MForm/type.ts +229 -0
- package/src/components/MSearch/index.scss +63 -0
- package/src/components/MSearch/index.tsx +173 -0
- package/src/components/MTable/index.tsx +22 -0
- package/src/components/MiModal/index.tsx +106 -0
- package/src/components/ThemeContext/CompThemeProvider.tsx +19 -0
- package/src/components/ThemeContext/index.ts +20 -0
- package/src/components/index.ts +9 -0
- package/src/constants/date.ts +11 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/pageInfo.ts +1 -0
- package/src/constants/pattern.ts +53 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useFuncRequest.ts +100 -0
- package/src/hooks/useInterval.ts +50 -0
- package/src/hooks/usePagination.ts +184 -0
- package/src/hooks/useQuery.ts +6 -0
- package/src/hooks/useReactive.ts +26 -0
- package/src/hooks/useTimeout.ts +50 -0
- package/src/hooks/useVirtualList.ts +209 -0
- package/src/index.tsx +4 -0
- package/src/utils/calc.ts +92 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/nextTick.ts +89 -0
- package/src/utils/openModal.tsx +137 -0
- package/src/utils/util.ts +37 -0
- package/src/utils/version.ts +206 -0
- package/dist/components/MyButton/index.d.ts +0 -6
- package/dist/components/MyButton/index.js +0 -291
- package/dist/components/index.js +0 -6
- package/dist/utils/format.d.ts +0 -2
- package/dist/utils/format.js +0 -5
- package/dist/utils/index.js +0 -5
|
@@ -0,0 +1,2094 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var antd = require('antd');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var React__default = _interopDefault(React);
|
|
10
|
+
var ReactDOMClient = require('react-dom/client');
|
|
11
|
+
var icons = require('@ant-design/icons');
|
|
12
|
+
var lodash = require('lodash');
|
|
13
|
+
|
|
14
|
+
var CMX = function CMX() {
|
|
15
|
+
/**
|
|
16
|
+
** 加
|
|
17
|
+
**/
|
|
18
|
+
this.add = function (arg1, arg2) {
|
|
19
|
+
var r1, r2, m, c;
|
|
20
|
+
try {
|
|
21
|
+
r1 = arg1.toString().split('.')[1].length;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
r1 = 0;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
r2 = arg2.toString().split('.')[1].length;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
r2 = 0;
|
|
29
|
+
}
|
|
30
|
+
c = Math.abs(r1 - r2);
|
|
31
|
+
m = Math.pow(10, Math.max(r1, r2));
|
|
32
|
+
if (c > 0) {
|
|
33
|
+
var cm = Math.pow(10, c);
|
|
34
|
+
if (r1 > r2) {
|
|
35
|
+
arg1 = Number(arg1.toString().replace('.', ''));
|
|
36
|
+
arg2 = Number(arg2.toString().replace('.', '')) * cm;
|
|
37
|
+
} else {
|
|
38
|
+
arg1 = Number(arg1.toString().replace('.', '')) * cm;
|
|
39
|
+
arg2 = Number(arg2.toString().replace('.', ''));
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
var _arg, _arg2;
|
|
43
|
+
arg1 = Number((_arg = arg1) == null ? void 0 : _arg.toString().replace('.', ''));
|
|
44
|
+
arg2 = Number((_arg2 = arg2) == null ? void 0 : _arg2.toString().replace('.', ''));
|
|
45
|
+
}
|
|
46
|
+
return (arg1 + arg2) / m;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
** 减
|
|
50
|
+
**/
|
|
51
|
+
this.sub = function (arg1, arg2) {
|
|
52
|
+
var r1, r2, m, n;
|
|
53
|
+
try {
|
|
54
|
+
r1 = arg1.toString().split('.')[1].length;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
r1 = 0;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
r2 = arg2.toString().split('.')[1].length;
|
|
60
|
+
} catch (e) {
|
|
61
|
+
r2 = 0;
|
|
62
|
+
}
|
|
63
|
+
m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
|
|
64
|
+
n = r1 >= r2 ? r1 : r2;
|
|
65
|
+
return Number(((arg1 * m - arg2 * m) / m).toFixed(n));
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
** 乘
|
|
69
|
+
**/
|
|
70
|
+
this.mul = function (arg1, arg2) {
|
|
71
|
+
var m = 0,
|
|
72
|
+
s1 = arg1.toString(),
|
|
73
|
+
s2 = arg2.toString();
|
|
74
|
+
try {
|
|
75
|
+
m += s1.split('.')[1].length;
|
|
76
|
+
} catch (e) {}
|
|
77
|
+
try {
|
|
78
|
+
m += s2.split('.')[1].length;
|
|
79
|
+
} catch (e) {}
|
|
80
|
+
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m);
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
** 除
|
|
84
|
+
**/
|
|
85
|
+
this.div = function (arg1, arg2) {
|
|
86
|
+
var t1 = 0,
|
|
87
|
+
t2 = 0,
|
|
88
|
+
r1,
|
|
89
|
+
r2;
|
|
90
|
+
try {
|
|
91
|
+
t1 = arg1.toString().split('.')[1].length;
|
|
92
|
+
} catch (e) {}
|
|
93
|
+
try {
|
|
94
|
+
t2 = arg2.toString().split('.')[1].length;
|
|
95
|
+
} catch (e) {}
|
|
96
|
+
r1 = Number(arg1.toString().replace('.', ''));
|
|
97
|
+
r2 = Number(arg2.toString().replace('.', ''));
|
|
98
|
+
return r1 / r2 * Math.pow(10, t2 - t1);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var cmx = /*#__PURE__*/new CMX();
|
|
102
|
+
|
|
103
|
+
function _arrayLikeToArray(r, a) {
|
|
104
|
+
(null == a || a > r.length) && (a = r.length);
|
|
105
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
106
|
+
return n;
|
|
107
|
+
}
|
|
108
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
109
|
+
try {
|
|
110
|
+
var i = n[a](c),
|
|
111
|
+
u = i.value;
|
|
112
|
+
} catch (n) {
|
|
113
|
+
return void e(n);
|
|
114
|
+
}
|
|
115
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
116
|
+
}
|
|
117
|
+
function _asyncToGenerator(n) {
|
|
118
|
+
return function () {
|
|
119
|
+
var t = this,
|
|
120
|
+
e = arguments;
|
|
121
|
+
return new Promise(function (r, o) {
|
|
122
|
+
var a = n.apply(t, e);
|
|
123
|
+
function _next(n) {
|
|
124
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
125
|
+
}
|
|
126
|
+
function _throw(n) {
|
|
127
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
128
|
+
}
|
|
129
|
+
_next(void 0);
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function _defineProperties(e, r) {
|
|
134
|
+
for (var t = 0; t < r.length; t++) {
|
|
135
|
+
var o = r[t];
|
|
136
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function _createClass(e, r, t) {
|
|
140
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
141
|
+
writable: !1
|
|
142
|
+
}), e;
|
|
143
|
+
}
|
|
144
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
145
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
146
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
147
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
148
|
+
t && (r = t);
|
|
149
|
+
var o = 0;
|
|
150
|
+
return function () {
|
|
151
|
+
return o >= r.length ? {
|
|
152
|
+
done: !0
|
|
153
|
+
} : {
|
|
154
|
+
done: !1,
|
|
155
|
+
value: r[o++]
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
160
|
+
}
|
|
161
|
+
function _extends() {
|
|
162
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
163
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
164
|
+
var t = arguments[e];
|
|
165
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
166
|
+
}
|
|
167
|
+
return n;
|
|
168
|
+
}, _extends.apply(null, arguments);
|
|
169
|
+
}
|
|
170
|
+
function _inheritsLoose(t, o) {
|
|
171
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
172
|
+
}
|
|
173
|
+
function _regenerator() {
|
|
174
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
175
|
+
var e,
|
|
176
|
+
t,
|
|
177
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
178
|
+
n = r.iterator || "@@iterator",
|
|
179
|
+
o = r.toStringTag || "@@toStringTag";
|
|
180
|
+
function i(r, n, o, i) {
|
|
181
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
182
|
+
u = Object.create(c.prototype);
|
|
183
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
184
|
+
var i,
|
|
185
|
+
c,
|
|
186
|
+
u,
|
|
187
|
+
f = 0,
|
|
188
|
+
p = o || [],
|
|
189
|
+
y = !1,
|
|
190
|
+
G = {
|
|
191
|
+
p: 0,
|
|
192
|
+
n: 0,
|
|
193
|
+
v: e,
|
|
194
|
+
a: d,
|
|
195
|
+
f: d.bind(e, 4),
|
|
196
|
+
d: function (t, r) {
|
|
197
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
function d(r, n) {
|
|
201
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
202
|
+
var o,
|
|
203
|
+
i = p[t],
|
|
204
|
+
d = G.p,
|
|
205
|
+
l = i[2];
|
|
206
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
207
|
+
}
|
|
208
|
+
if (o || r > 1) return a;
|
|
209
|
+
throw y = !0, n;
|
|
210
|
+
}
|
|
211
|
+
return function (o, p, l) {
|
|
212
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
213
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
214
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
215
|
+
try {
|
|
216
|
+
if (f = 2, i) {
|
|
217
|
+
if (c || (o = "next"), t = i[o]) {
|
|
218
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
219
|
+
if (!t.done) return t;
|
|
220
|
+
u = t.value, c < 2 && (c = 0);
|
|
221
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
222
|
+
i = e;
|
|
223
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
224
|
+
} catch (t) {
|
|
225
|
+
i = e, c = 1, u = t;
|
|
226
|
+
} finally {
|
|
227
|
+
f = 1;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
value: t,
|
|
232
|
+
done: y
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
}(r, o, i), !0), u;
|
|
236
|
+
}
|
|
237
|
+
var a = {};
|
|
238
|
+
function Generator() {}
|
|
239
|
+
function GeneratorFunction() {}
|
|
240
|
+
function GeneratorFunctionPrototype() {}
|
|
241
|
+
t = Object.getPrototypeOf;
|
|
242
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
243
|
+
return this;
|
|
244
|
+
}), t),
|
|
245
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
246
|
+
function f(e) {
|
|
247
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
248
|
+
}
|
|
249
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
250
|
+
return this;
|
|
251
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
252
|
+
return "[object Generator]";
|
|
253
|
+
}), (_regenerator = function () {
|
|
254
|
+
return {
|
|
255
|
+
w: i,
|
|
256
|
+
m: f
|
|
257
|
+
};
|
|
258
|
+
})();
|
|
259
|
+
}
|
|
260
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
261
|
+
var i = Object.defineProperty;
|
|
262
|
+
try {
|
|
263
|
+
i({}, "", {});
|
|
264
|
+
} catch (e) {
|
|
265
|
+
i = 0;
|
|
266
|
+
}
|
|
267
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
268
|
+
if (r) i ? i(e, r, {
|
|
269
|
+
value: n,
|
|
270
|
+
enumerable: !t,
|
|
271
|
+
configurable: !t,
|
|
272
|
+
writable: !t
|
|
273
|
+
}) : e[r] = n;else {
|
|
274
|
+
function o(r, n) {
|
|
275
|
+
_regeneratorDefine(e, r, function (e) {
|
|
276
|
+
return this._invoke(r, n, e);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
280
|
+
}
|
|
281
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
282
|
+
}
|
|
283
|
+
function _setPrototypeOf(t, e) {
|
|
284
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
285
|
+
return t.__proto__ = e, t;
|
|
286
|
+
}, _setPrototypeOf(t, e);
|
|
287
|
+
}
|
|
288
|
+
function _toPrimitive(t, r) {
|
|
289
|
+
if ("object" != typeof t || !t) return t;
|
|
290
|
+
var e = t[Symbol.toPrimitive];
|
|
291
|
+
if (void 0 !== e) {
|
|
292
|
+
var i = e.call(t, r || "default");
|
|
293
|
+
if ("object" != typeof i) return i;
|
|
294
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
295
|
+
}
|
|
296
|
+
return ("string" === r ? String : Number)(t);
|
|
297
|
+
}
|
|
298
|
+
function _toPropertyKey(t) {
|
|
299
|
+
var i = _toPrimitive(t, "string");
|
|
300
|
+
return "symbol" == typeof i ? i : i + "";
|
|
301
|
+
}
|
|
302
|
+
function _unsupportedIterableToArray(r, a) {
|
|
303
|
+
if (r) {
|
|
304
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
305
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
306
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var NextTick = /*#__PURE__*/function () {
|
|
311
|
+
function NextTick() {
|
|
312
|
+
this.callbacks = [];
|
|
313
|
+
this.pending = false;
|
|
314
|
+
this.timerFunc = this.determineTimerFunc();
|
|
315
|
+
}
|
|
316
|
+
var _proto = NextTick.prototype;
|
|
317
|
+
_proto.determineTimerFunc = function determineTimerFunc() {
|
|
318
|
+
var _this = this;
|
|
319
|
+
if (typeof Promise !== 'undefined') {
|
|
320
|
+
var p = Promise.resolve();
|
|
321
|
+
return function () {
|
|
322
|
+
return p.then(_this.flushCallbacks.bind(_this));
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
if (typeof MutationObserver !== 'undefined' && typeof window !== 'undefined') {
|
|
326
|
+
var counter = 1;
|
|
327
|
+
var observer = new MutationObserver(this.flushCallbacks.bind(this));
|
|
328
|
+
var textNode = document.createTextNode(String(counter));
|
|
329
|
+
observer.observe(textNode, {
|
|
330
|
+
characterData: true
|
|
331
|
+
});
|
|
332
|
+
return function () {
|
|
333
|
+
counter = (counter + 1) % 2;
|
|
334
|
+
textNode.data = String(counter);
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
// // 仅在 Node.js 环境中使用 setImmediate
|
|
338
|
+
// if (typeof global !== 'undefined' && typeof setImmediate !== 'undefined') {
|
|
339
|
+
// return () => setImmediate(this.flushCallbacks.bind(this));
|
|
340
|
+
// }
|
|
341
|
+
return function () {
|
|
342
|
+
return setTimeout(_this.flushCallbacks.bind(_this), 0);
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
_proto.flushCallbacks = function flushCallbacks() {
|
|
346
|
+
this.pending = false;
|
|
347
|
+
var copies = this.callbacks.slice(0);
|
|
348
|
+
this.callbacks.length = 0;
|
|
349
|
+
for (var i = 0; i < copies.length; i++) {
|
|
350
|
+
copies[i]();
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
_proto.nextTick = function nextTick(callback, ctx) {
|
|
354
|
+
var _resolve;
|
|
355
|
+
this.callbacks.push(function () {
|
|
356
|
+
if (callback) {
|
|
357
|
+
try {
|
|
358
|
+
callback.call(ctx);
|
|
359
|
+
} catch (e) {
|
|
360
|
+
console.error('Error in nextTick:', e);
|
|
361
|
+
}
|
|
362
|
+
} else if (_resolve) {
|
|
363
|
+
_resolve();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
if (!this.pending) {
|
|
367
|
+
this.pending = true;
|
|
368
|
+
this.timerFunc();
|
|
369
|
+
}
|
|
370
|
+
if (!callback && typeof Promise !== 'undefined') {
|
|
371
|
+
return new Promise(function (resolve) {
|
|
372
|
+
_resolve = resolve;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
NextTick.nextTick = function nextTick(callback, ctx) {
|
|
377
|
+
return NextTick.instance.nextTick(callback, ctx);
|
|
378
|
+
};
|
|
379
|
+
return _createClass(NextTick, null, [{
|
|
380
|
+
key: "instance",
|
|
381
|
+
get: function get() {
|
|
382
|
+
if (!this._instance) {
|
|
383
|
+
this._instance = new NextTick();
|
|
384
|
+
}
|
|
385
|
+
return this._instance;
|
|
386
|
+
}
|
|
387
|
+
}]);
|
|
388
|
+
}();
|
|
389
|
+
var nextTick = /*#__PURE__*/NextTick.instance.nextTick.bind(NextTick.instance);
|
|
390
|
+
|
|
391
|
+
var createRoot = ReactDOMClient.createRoot;
|
|
392
|
+
var modalContainer = null;
|
|
393
|
+
var root = null;
|
|
394
|
+
function getOrCreateContainer() {
|
|
395
|
+
if (!modalContainer) {
|
|
396
|
+
modalContainer = document.createElement('div');
|
|
397
|
+
document.body.appendChild(modalContainer);
|
|
398
|
+
}
|
|
399
|
+
return modalContainer;
|
|
400
|
+
}
|
|
401
|
+
function openModal(DialogComponent, initialConfig) {
|
|
402
|
+
var container = getOrCreateContainer();
|
|
403
|
+
var currentConfig = _extends({
|
|
404
|
+
open: true
|
|
405
|
+
}, initialConfig, {
|
|
406
|
+
// 默认自动关闭
|
|
407
|
+
onClosed: initialConfig.onClosed || function (params) {
|
|
408
|
+
unifiedDestroy(params);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
if (!root) {
|
|
412
|
+
try {
|
|
413
|
+
root = createRoot(container);
|
|
414
|
+
} catch (error) {
|
|
415
|
+
console.error('Failed to create root:', error);
|
|
416
|
+
return {
|
|
417
|
+
destroy: function destroy() {},
|
|
418
|
+
update: function update() {}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var cleanup = function cleanup() {
|
|
423
|
+
if (root) {
|
|
424
|
+
root.unmount();
|
|
425
|
+
root = null;
|
|
426
|
+
}
|
|
427
|
+
if (modalContainer && modalContainer.parentNode) {
|
|
428
|
+
modalContainer.parentNode.removeChild(modalContainer);
|
|
429
|
+
modalContainer = null;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
var _destroy = function destroy(params) {
|
|
433
|
+
if (typeof currentConfig.onClosed === 'function') {
|
|
434
|
+
currentConfig.onClosed(params);
|
|
435
|
+
}
|
|
436
|
+
// 销毁 modal
|
|
437
|
+
cleanup();
|
|
438
|
+
};
|
|
439
|
+
var render = function render(props) {
|
|
440
|
+
if (root) {
|
|
441
|
+
root.render(React__default.createElement(DialogComponent, Object.assign({}, props)));
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
var update = function update(configUpdate) {
|
|
445
|
+
currentConfig = typeof configUpdate === 'function' ? configUpdate(currentConfig) : _extends({}, currentConfig, configUpdate);
|
|
446
|
+
render(currentConfig);
|
|
447
|
+
};
|
|
448
|
+
// 统一的销毁函数
|
|
449
|
+
var unifiedDestroy = function unifiedDestroy(params) {
|
|
450
|
+
// 如果当前配置是打开的,关闭
|
|
451
|
+
if (currentConfig.open) {
|
|
452
|
+
currentConfig = _extends({}, currentConfig, {
|
|
453
|
+
open: false,
|
|
454
|
+
onClosed: function onClosed(closedParams) {
|
|
455
|
+
if (initialConfig.onClosed) {
|
|
456
|
+
initialConfig.onClosed(closedParams || params);
|
|
457
|
+
}
|
|
458
|
+
_destroy(closedParams || params);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
render(currentConfig);
|
|
462
|
+
} else {
|
|
463
|
+
console.warn('Modal is already closed.');
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
render(currentConfig);
|
|
467
|
+
return {
|
|
468
|
+
destroy: unifiedDestroy,
|
|
469
|
+
update: update
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
var noop = function noop() {};
|
|
474
|
+
// 生成类名
|
|
475
|
+
var getClassName = function getClassName(key1, key2) {
|
|
476
|
+
var cn = key1;
|
|
477
|
+
var str = key1;
|
|
478
|
+
if (key2.includes(' ')) {
|
|
479
|
+
str = '';
|
|
480
|
+
var nArr = key2 == null ? void 0 : key2.split(' ');
|
|
481
|
+
for (var _iterator = _createForOfIteratorHelperLoose(nArr), _step; !(_step = _iterator()).done;) {
|
|
482
|
+
var i = _step.value;
|
|
483
|
+
str += " " + cn + "-" + i;
|
|
484
|
+
}
|
|
485
|
+
} else if (key2) {
|
|
486
|
+
str = key1 + "-" + key2;
|
|
487
|
+
}
|
|
488
|
+
return str;
|
|
489
|
+
};
|
|
490
|
+
// 根据路径获取数据
|
|
491
|
+
var getFieldsByPath = function getFieldsByPath(data, path) {
|
|
492
|
+
var arr = path == null ? void 0 : path.split('.');
|
|
493
|
+
var res = data;
|
|
494
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(arr), _step2; !(_step2 = _iterator2()).done;) {
|
|
495
|
+
var i = _step2.value;
|
|
496
|
+
res = res[i];
|
|
497
|
+
}
|
|
498
|
+
return res;
|
|
499
|
+
};
|
|
500
|
+
// 删除空值
|
|
501
|
+
var removeNull = function removeNull(obj) {
|
|
502
|
+
for (var key in obj) {
|
|
503
|
+
if (obj[key] === null) {
|
|
504
|
+
delete obj[key];
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return obj;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* 版本号工具类
|
|
512
|
+
* 支持语义化版本 (SemVer) 和基本版本号比较
|
|
513
|
+
*/
|
|
514
|
+
var VersionUtil = /*#__PURE__*/function () {
|
|
515
|
+
function VersionUtil() {}
|
|
516
|
+
/**
|
|
517
|
+
* 验证版本号格式是否有效
|
|
518
|
+
* @param version 版本号字符串
|
|
519
|
+
* @returns 是否有效
|
|
520
|
+
*/
|
|
521
|
+
VersionUtil.isValid = function isValid(version) {
|
|
522
|
+
var semverRegex = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/i;
|
|
523
|
+
return semverRegex.test(version);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* 比较两个版本号
|
|
527
|
+
* @param v1 版本号1
|
|
528
|
+
* @param v2 版本号2
|
|
529
|
+
* @returns 比较结果: 1(v1>v2), 0(v1=v2), -1(v1<v2)
|
|
530
|
+
*/;
|
|
531
|
+
VersionUtil.compare = function compare(v1, v2) {
|
|
532
|
+
if (!this.isValid(v1) || !this.isValid(v2)) {
|
|
533
|
+
throw new Error('Invalid version format');
|
|
534
|
+
}
|
|
535
|
+
// 去除前缀v并分割版本号
|
|
536
|
+
var normalize = function normalize(v) {
|
|
537
|
+
return v.replace(/^v/, '').split(/[-+]/)[0].split('.');
|
|
538
|
+
};
|
|
539
|
+
var parts1 = normalize(v1);
|
|
540
|
+
var parts2 = normalize(v2);
|
|
541
|
+
for (var i = 0; i < 3; i++) {
|
|
542
|
+
var num1 = parseInt(parts1[i] || '0', 10);
|
|
543
|
+
var num2 = parseInt(parts2[i] || '0', 10);
|
|
544
|
+
if (num1 > num2) return 1;
|
|
545
|
+
if (num1 < num2) return -1;
|
|
546
|
+
}
|
|
547
|
+
// 比较预发布版本
|
|
548
|
+
var preRelease1 = v1.match(/-(.+)/);
|
|
549
|
+
var preRelease2 = v2.match(/-(.+)/);
|
|
550
|
+
if (preRelease1 && !preRelease2) return -1;
|
|
551
|
+
if (!preRelease1 && preRelease2) return 1;
|
|
552
|
+
if (preRelease1 && preRelease2) {
|
|
553
|
+
return preRelease1[1].localeCompare(preRelease2[1]);
|
|
554
|
+
}
|
|
555
|
+
return 0;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* 检查版本号是否满足范围要求
|
|
559
|
+
* @param version 要检查的版本
|
|
560
|
+
* @param range 版本范围 (如 ">=1.0.0 <2.0.0") 支持: >, >=, <, <=, ^, ~, ==, =
|
|
561
|
+
* @returns 是否满足
|
|
562
|
+
*/;
|
|
563
|
+
VersionUtil.satisfies = function satisfies(version, range) {
|
|
564
|
+
var _this = this;
|
|
565
|
+
if (!this.isValid(version)) return false;
|
|
566
|
+
var rangeRegex = /([<>]=?|==?|\^|~)?\s*v?([0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+)?)/g;
|
|
567
|
+
var ranges = range.match(rangeRegex);
|
|
568
|
+
if (!ranges || ranges.length === 0) return false;
|
|
569
|
+
return ranges.every(function (r) {
|
|
570
|
+
var match = r.match(/([<>]=?|==?|\^|~)?\s*(v?[0-9].*)/);
|
|
571
|
+
if (!match) return false;
|
|
572
|
+
var operator = match[1] || '==';
|
|
573
|
+
var rangeVersion = match[2];
|
|
574
|
+
if (!_this.isValid(rangeVersion)) return false;
|
|
575
|
+
var comparison = _this.compare(version, rangeVersion);
|
|
576
|
+
switch (operator) {
|
|
577
|
+
case '>':
|
|
578
|
+
return comparison > 0;
|
|
579
|
+
case '>=':
|
|
580
|
+
return comparison >= 0;
|
|
581
|
+
case '<':
|
|
582
|
+
return comparison < 0;
|
|
583
|
+
case '<=':
|
|
584
|
+
return comparison <= 0;
|
|
585
|
+
case '^':
|
|
586
|
+
return _this.caretRange(version, rangeVersion);
|
|
587
|
+
case '~':
|
|
588
|
+
return _this.tildeRange(version, rangeVersion);
|
|
589
|
+
case '=':
|
|
590
|
+
case '==':
|
|
591
|
+
default:
|
|
592
|
+
return comparison === 0;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* 处理 ^ 范围 (允许不修改最左边的非零数字)
|
|
598
|
+
* @param version 版本号
|
|
599
|
+
* @param range 范围版本
|
|
600
|
+
* @returns 是否匹配
|
|
601
|
+
*/;
|
|
602
|
+
VersionUtil.caretRange = function caretRange(version, range) {
|
|
603
|
+
var normalize = function normalize(v) {
|
|
604
|
+
return v.replace(/^v/, '').split(/[-+]/)[0].split('.');
|
|
605
|
+
};
|
|
606
|
+
var vParts = normalize(version);
|
|
607
|
+
var rParts = normalize(range);
|
|
608
|
+
// 找到第一个非零部分
|
|
609
|
+
var firstNonZero = 0;
|
|
610
|
+
for (var i = 0; i < rParts.length; i++) {
|
|
611
|
+
if (parseInt(rParts[i], 10) !== 0) {
|
|
612
|
+
firstNonZero = i;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
for (var _i = 0; _i <= firstNonZero; _i++) {
|
|
617
|
+
var vNum = parseInt(vParts[_i] || '0', 10);
|
|
618
|
+
var rNum = parseInt(rParts[_i] || '0', 10);
|
|
619
|
+
if (vNum !== rNum) return false;
|
|
620
|
+
}
|
|
621
|
+
return this.compare(version, range) >= 0;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* 处理 ~ 范围 (允许修改最后一位数字)
|
|
625
|
+
* @param version 版本号
|
|
626
|
+
* @param range 范围版本
|
|
627
|
+
* @returns 是否匹配
|
|
628
|
+
*/;
|
|
629
|
+
VersionUtil.tildeRange = function tildeRange(version, range) {
|
|
630
|
+
var normalize = function normalize(v) {
|
|
631
|
+
return v.replace(/^v/, '').split(/[-+]/)[0].split('.');
|
|
632
|
+
};
|
|
633
|
+
var vParts = normalize(version);
|
|
634
|
+
var rParts = normalize(range);
|
|
635
|
+
for (var i = 0; i < rParts.length - 1; i++) {
|
|
636
|
+
var vNum = parseInt(vParts[i] || '0', 10);
|
|
637
|
+
var rNum = parseInt(rParts[i] || '0', 10);
|
|
638
|
+
if (vNum !== rNum) return false;
|
|
639
|
+
}
|
|
640
|
+
var lastVNum = parseInt(vParts[rParts.length - 1] || '0', 10);
|
|
641
|
+
var lastRNum = parseInt(rParts[rParts.length - 1] || '0', 10);
|
|
642
|
+
return lastVNum >= lastRNum;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* 获取主版本号 (major)
|
|
646
|
+
* @param version 版本号
|
|
647
|
+
* @returns 主版本号
|
|
648
|
+
*/;
|
|
649
|
+
VersionUtil.getMajor = function getMajor(version) {
|
|
650
|
+
if (!this.isValid(version)) throw new Error('Invalid version format');
|
|
651
|
+
var parts = version.replace(/^v/, '').split('.');
|
|
652
|
+
return parseInt(parts[0], 10);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* 获取次版本号 (minor)
|
|
656
|
+
* @param version 版本号
|
|
657
|
+
* @returns 次版本号
|
|
658
|
+
*/;
|
|
659
|
+
VersionUtil.getMinor = function getMinor(version) {
|
|
660
|
+
if (!this.isValid(version)) throw new Error('Invalid version format');
|
|
661
|
+
var parts = version.replace(/^v/, '').split('.');
|
|
662
|
+
return parseInt(parts[1] || '0', 10);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* 获取修订号 (patch)
|
|
666
|
+
* @param version 版本号
|
|
667
|
+
* @returns 修订号
|
|
668
|
+
*/;
|
|
669
|
+
VersionUtil.getPatch = function getPatch(version) {
|
|
670
|
+
if (!this.isValid(version)) throw new Error('Invalid version format');
|
|
671
|
+
var parts = version.replace(/^v/, '').split('.');
|
|
672
|
+
return parseInt(parts[2] || '0', 10);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* 获取预发布版本标识
|
|
676
|
+
* @param version 版本号
|
|
677
|
+
* @returns 预发布标识 (无则返回null)
|
|
678
|
+
*/;
|
|
679
|
+
VersionUtil.getPrerelease = function getPrerelease(version) {
|
|
680
|
+
if (!this.isValid(version)) throw new Error('Invalid version format');
|
|
681
|
+
var match = version.match(/-([^+]+)/);
|
|
682
|
+
return match ? match[1] : null;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* 获取构建元数据
|
|
686
|
+
* @param version 版本号
|
|
687
|
+
* @returns 构建元数据 (无则返回null)
|
|
688
|
+
*/;
|
|
689
|
+
VersionUtil.getBuildMetadata = function getBuildMetadata(version) {
|
|
690
|
+
if (!this.isValid(version)) throw new Error('Invalid version format');
|
|
691
|
+
var match = version.match(/\+([^]+)/);
|
|
692
|
+
return match ? match[1] : null;
|
|
693
|
+
};
|
|
694
|
+
return VersionUtil;
|
|
695
|
+
}();
|
|
696
|
+
|
|
697
|
+
var ThemeContext = /*#__PURE__*/React.createContext({
|
|
698
|
+
theme: {
|
|
699
|
+
cssVar: true,
|
|
700
|
+
algorithm: [antd.theme.defaultAlgorithm]
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
var MiThemeProvider = ThemeContext.Provider;
|
|
704
|
+
function useMiThemeConfig() {
|
|
705
|
+
return React.useContext(ThemeContext);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* CompThemeProvider
|
|
710
|
+
*/
|
|
711
|
+
function CompThemeProvider(props) {
|
|
712
|
+
var _useMiThemeConfig = useMiThemeConfig(),
|
|
713
|
+
theme = _useMiThemeConfig.theme;
|
|
714
|
+
return React__default.createElement(antd.ConfigProvider, {
|
|
715
|
+
theme: theme
|
|
716
|
+
}, props.children);
|
|
717
|
+
}
|
|
718
|
+
CompThemeProvider.displayName = 'CompThemeProvider';
|
|
719
|
+
|
|
720
|
+
var classname = function classname(n) {
|
|
721
|
+
if (n === void 0) {
|
|
722
|
+
n = '';
|
|
723
|
+
}
|
|
724
|
+
var cn = 'items-row';
|
|
725
|
+
return getClassName(cn, n);
|
|
726
|
+
};
|
|
727
|
+
var ItemsRow = function ItemsRow(props) {
|
|
728
|
+
if (!props.items) {
|
|
729
|
+
return null;
|
|
730
|
+
}
|
|
731
|
+
return React.createElement(CompThemeProvider, null, React.createElement("div", {
|
|
732
|
+
className: classname() + " " + (props.className || ''),
|
|
733
|
+
style: props.style
|
|
734
|
+
}, (props.items || []).map(function (item, index) {
|
|
735
|
+
var className = classname('item') + " " + item.className;
|
|
736
|
+
if (item.render) {
|
|
737
|
+
return React.createElement("span", {
|
|
738
|
+
key: index,
|
|
739
|
+
className: className
|
|
740
|
+
}, item.render());
|
|
741
|
+
}
|
|
742
|
+
return React.createElement(antd.Button, Object.assign({
|
|
743
|
+
key: item.label,
|
|
744
|
+
className: className
|
|
745
|
+
}, item.btnProps, {
|
|
746
|
+
type: item.type || 'primary',
|
|
747
|
+
onClick: item.onClick
|
|
748
|
+
}), item.label);
|
|
749
|
+
})));
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
function styleInject(css, ref) {
|
|
753
|
+
if ( ref === void 0 ) ref = {};
|
|
754
|
+
var insertAt = ref.insertAt;
|
|
755
|
+
|
|
756
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
757
|
+
|
|
758
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
759
|
+
var style = document.createElement('style');
|
|
760
|
+
style.type = 'text/css';
|
|
761
|
+
|
|
762
|
+
if (insertAt === 'top') {
|
|
763
|
+
if (head.firstChild) {
|
|
764
|
+
head.insertBefore(style, head.firstChild);
|
|
765
|
+
} else {
|
|
766
|
+
head.appendChild(style);
|
|
767
|
+
}
|
|
768
|
+
} else {
|
|
769
|
+
head.appendChild(style);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
if (style.styleSheet) {
|
|
773
|
+
style.styleSheet.cssText = css;
|
|
774
|
+
} else {
|
|
775
|
+
style.appendChild(document.createTextNode(css));
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
var css_248z = "@keyframes m-breadcrumb_show_ani {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 100;\n }\n}\n.m-breadcrumb {\n position: relative;\n height: 64px;\n width: 100%;\n}\n.m-breadcrumb-container {\n transition: padding 0.3s ease;\n}\n.m-breadcrumb-body {\n border-radius: 8px;\n height: 64px;\n line-height: 64px;\n}\n.m-breadcrumb .ant-card-body {\n width: 100%;\n padding: 0 12px;\n align-items: center;\n}\n.m-breadcrumb .ant-affix {\n z-index: 999;\n}\n.ant-affix > .m-breadcrumb-container {\n z-index: 100;\n width: auto;\n box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n}\n.m-breadcrumb-inner-breadcrumb {\n display: inline-block;\n vertical-align: middle;\n line-height: 64px;\n}\n.m-breadcrumb-inner-breadcrumb .ant-breadcrumb-separator {\n margin: 0 8px;\n}\n.m-breadcrumb-inner-breadcrumb .ant-breadcrumb-link > a {\n transition: all 0.3s;\n padding: 4px 8px;\n display: inline-block;\n line-height: 1.5;\n}\n.m-breadcrumb-inner-breadcrumb .ant-breadcrumb-link > a:hover {\n font-weight: bold;\n text-decoration: none;\n opacity: 0.8;\n}\n.m-breadcrumb-custom-item-wrapper {\n float: right;\n height: 100%;\n display: flex;\n align-items: center;\n}";
|
|
780
|
+
styleInject(css_248z);
|
|
781
|
+
|
|
782
|
+
var classname$1 = function classname(n) {
|
|
783
|
+
if (n === void 0) {
|
|
784
|
+
n = '';
|
|
785
|
+
}
|
|
786
|
+
var cn = 'm-breadcrumb';
|
|
787
|
+
return getClassName(cn, n);
|
|
788
|
+
};
|
|
789
|
+
var MBreadcrumb = function MBreadcrumb(props) {
|
|
790
|
+
var routes = props.routes,
|
|
791
|
+
customItems = props.customItems,
|
|
792
|
+
style = props.style,
|
|
793
|
+
className = props.className,
|
|
794
|
+
_props$offsetTop = props.offsetTop,
|
|
795
|
+
offsetTop = _props$offsetTop === void 0 ? 64 : _props$offsetTop,
|
|
796
|
+
mainAppBaseUrl = props.mainAppBaseUrl,
|
|
797
|
+
microAppName = props.microAppName;
|
|
798
|
+
var affixRef = React.useRef(null);
|
|
799
|
+
var onScroll = React.useCallback(function () {
|
|
800
|
+
var _affixRef$current;
|
|
801
|
+
(_affixRef$current = affixRef.current) == null || _affixRef$current.updatePosition == null || _affixRef$current.updatePosition();
|
|
802
|
+
}, []);
|
|
803
|
+
React.useEffect(function () {
|
|
804
|
+
window.addEventListener('scroll', onScroll, true);
|
|
805
|
+
return function () {
|
|
806
|
+
return window.removeEventListener('scroll', onScroll);
|
|
807
|
+
};
|
|
808
|
+
}, [onScroll]);
|
|
809
|
+
var getUrl = React.useCallback(function (url) {
|
|
810
|
+
if (!url) return '';
|
|
811
|
+
var cleanedUrl = url.replace(/^\/+/, '');
|
|
812
|
+
var parts = [mainAppBaseUrl == null ? void 0 : mainAppBaseUrl.replace(/\/+$/, ''), microAppName == null ? void 0 : microAppName.replace(/\/+$/, ''), cleanedUrl].filter(Boolean);
|
|
813
|
+
return "/" + parts.join('/');
|
|
814
|
+
}, [mainAppBaseUrl, microAppName]);
|
|
815
|
+
return React.createElement(CompThemeProvider, null, React.createElement("div", {
|
|
816
|
+
className: classname$1() + " " + (className || ''),
|
|
817
|
+
style: style
|
|
818
|
+
}, React.createElement(antd.Affix, {
|
|
819
|
+
ref: affixRef,
|
|
820
|
+
offsetTop: offsetTop
|
|
821
|
+
}, React.createElement(antd.Card, {
|
|
822
|
+
className: classname$1('container'),
|
|
823
|
+
rootClassName: classname$1('body'),
|
|
824
|
+
variant: "borderless"
|
|
825
|
+
}, React.createElement(antd.Breadcrumb, {
|
|
826
|
+
className: classname$1('inner-breadcrumb'),
|
|
827
|
+
style: {
|
|
828
|
+
fontSize: '18px'
|
|
829
|
+
}
|
|
830
|
+
}, routes == null ? void 0 : routes.map(function (v) {
|
|
831
|
+
return React.createElement(antd.Breadcrumb.Item, {
|
|
832
|
+
key: v.url || v.name
|
|
833
|
+
}, v.url ? React.createElement("a", {
|
|
834
|
+
href: "#" + getUrl(v.url)
|
|
835
|
+
}, v.name) : v.name);
|
|
836
|
+
})), React.createElement("div", {
|
|
837
|
+
className: classname$1('custom-item-wrapper')
|
|
838
|
+
}, React.createElement(ItemsRow, {
|
|
839
|
+
items: customItems
|
|
840
|
+
}))))));
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
var DetailDescriptions = function DetailDescriptions(props) {
|
|
844
|
+
var data = props.data,
|
|
845
|
+
title = props.title,
|
|
846
|
+
_props$column = props.column,
|
|
847
|
+
column = _props$column === void 0 ? 3 : _props$column,
|
|
848
|
+
lineHeight = props.lineHeight,
|
|
849
|
+
_props$align = props.align,
|
|
850
|
+
align = _props$align === void 0 ? 'left' : _props$align,
|
|
851
|
+
itemLayout = props.itemLayout,
|
|
852
|
+
_props$colon = props.colon,
|
|
853
|
+
colon = _props$colon === void 0 ? true : _props$colon,
|
|
854
|
+
_props$bordered = props.bordered,
|
|
855
|
+
bordered = _props$bordered === void 0 ? false : _props$bordered,
|
|
856
|
+
style = props.style,
|
|
857
|
+
className = props.className,
|
|
858
|
+
labelStyle = props.labelStyle,
|
|
859
|
+
contentStyle = props.contentStyle;
|
|
860
|
+
// 合并样式
|
|
861
|
+
var mergedLabelStyle = _extends({}, lineHeight ? {
|
|
862
|
+
lineHeight: lineHeight + "px"
|
|
863
|
+
} : {}, {
|
|
864
|
+
textAlign: align
|
|
865
|
+
}, itemLayout != null && itemLayout.label ? {
|
|
866
|
+
width: itemLayout.label + "px"
|
|
867
|
+
} : {}, labelStyle);
|
|
868
|
+
var mergedContentStyle = _extends({}, lineHeight ? {
|
|
869
|
+
lineHeight: lineHeight + "px"
|
|
870
|
+
} : {}, itemLayout != null && itemLayout.value ? {
|
|
871
|
+
width: itemLayout.value + "px"
|
|
872
|
+
} : {}, contentStyle);
|
|
873
|
+
return React__default.createElement(CompThemeProvider, null, React__default.createElement(antd.Descriptions, {
|
|
874
|
+
title: title,
|
|
875
|
+
column: column,
|
|
876
|
+
colon: colon,
|
|
877
|
+
bordered: bordered,
|
|
878
|
+
style: style,
|
|
879
|
+
className: className,
|
|
880
|
+
labelStyle: mergedLabelStyle,
|
|
881
|
+
contentStyle: mergedContentStyle
|
|
882
|
+
}, data.map(function (item, index) {
|
|
883
|
+
var _item$label;
|
|
884
|
+
return React__default.createElement(antd.Descriptions.Item, {
|
|
885
|
+
label: item.label,
|
|
886
|
+
key: ((_item$label = item.label) == null ? void 0 : _item$label.toString()) || index,
|
|
887
|
+
span: item.span
|
|
888
|
+
}, item.value || '-');
|
|
889
|
+
})));
|
|
890
|
+
};
|
|
891
|
+
DetailDescriptions.displayName = 'DetailDescriptions';
|
|
892
|
+
|
|
893
|
+
var css_248z$1 = ".m-form-item-wrapper {\n max-width: 480px;\n}\n.m-form .error-message {\n color: red;\n font-size: 12px;\n margin-top: 4px;\n}";
|
|
894
|
+
styleInject(css_248z$1);
|
|
895
|
+
|
|
896
|
+
(function (MFormItemTypeEnum) {
|
|
897
|
+
MFormItemTypeEnum["Input"] = "input";
|
|
898
|
+
MFormItemTypeEnum["InputNumber"] = "inputNumber";
|
|
899
|
+
MFormItemTypeEnum["Text"] = "text";
|
|
900
|
+
MFormItemTypeEnum["Password"] = "password";
|
|
901
|
+
MFormItemTypeEnum["Radio"] = "radio";
|
|
902
|
+
MFormItemTypeEnum["Select"] = "select";
|
|
903
|
+
MFormItemTypeEnum["Checkbox"] = "checkbox";
|
|
904
|
+
MFormItemTypeEnum["DatePicker"] = "datePicker";
|
|
905
|
+
MFormItemTypeEnum["RangePicker"] = "rangePicker";
|
|
906
|
+
MFormItemTypeEnum["Upload"] = "upload";
|
|
907
|
+
MFormItemTypeEnum["Mentions"] = "mentions";
|
|
908
|
+
MFormItemTypeEnum["Cascader"] = "cascader";
|
|
909
|
+
MFormItemTypeEnum["TreeSelect"] = "treeSelect";
|
|
910
|
+
MFormItemTypeEnum["Slider"] = "slider";
|
|
911
|
+
})(exports.MFormItemTypeEnum || (exports.MFormItemTypeEnum = {}));
|
|
912
|
+
|
|
913
|
+
var RangePicker = antd.DatePicker.RangePicker;
|
|
914
|
+
var MFormItemConst = /*#__PURE__*/function () {
|
|
915
|
+
function MFormItemConst() {}
|
|
916
|
+
MFormItemConst.getDefaultArrayPlaceholder = function getDefaultArrayPlaceholder(item) {
|
|
917
|
+
var placeholder;
|
|
918
|
+
switch (item.type) {
|
|
919
|
+
case 'rangePicker':
|
|
920
|
+
placeholder = ['开始时间', '结束时间'];
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
return placeholder;
|
|
924
|
+
};
|
|
925
|
+
MFormItemConst.getDefaultPlaceholder = function getDefaultPlaceholder(item) {
|
|
926
|
+
var placeholder;
|
|
927
|
+
switch (item.type) {
|
|
928
|
+
case exports.MFormItemTypeEnum.Input:
|
|
929
|
+
case exports.MFormItemTypeEnum.Password:
|
|
930
|
+
case exports.MFormItemTypeEnum.InputNumber:
|
|
931
|
+
case exports.MFormItemTypeEnum.Text:
|
|
932
|
+
case exports.MFormItemTypeEnum.Mentions:
|
|
933
|
+
placeholder = "\u8BF7\u8F93\u5165" + item.label;
|
|
934
|
+
break;
|
|
935
|
+
case exports.MFormItemTypeEnum.Select:
|
|
936
|
+
case exports.MFormItemTypeEnum.Checkbox:
|
|
937
|
+
case exports.MFormItemTypeEnum.Radio:
|
|
938
|
+
case exports.MFormItemTypeEnum.DatePicker:
|
|
939
|
+
case exports.MFormItemTypeEnum.RangePicker:
|
|
940
|
+
case exports.MFormItemTypeEnum.Cascader:
|
|
941
|
+
case exports.MFormItemTypeEnum.Upload:
|
|
942
|
+
case exports.MFormItemTypeEnum.TreeSelect:
|
|
943
|
+
placeholder = "\u8BF7\u9009\u62E9" + item.label;
|
|
944
|
+
break;
|
|
945
|
+
}
|
|
946
|
+
return placeholder;
|
|
947
|
+
};
|
|
948
|
+
return MFormItemConst;
|
|
949
|
+
}();
|
|
950
|
+
MFormItemConst.labelCol = {
|
|
951
|
+
span: 7
|
|
952
|
+
};
|
|
953
|
+
MFormItemConst.wrapperCol = {
|
|
954
|
+
span: 17
|
|
955
|
+
};
|
|
956
|
+
MFormItemConst.defaultRowGutter = 24;
|
|
957
|
+
MFormItemConst.input = function (item) {
|
|
958
|
+
return React__default.createElement(antd.Input, Object.assign({
|
|
959
|
+
disabled: item.disabled,
|
|
960
|
+
maxLength: item.maxLength
|
|
961
|
+
}, item.props, {
|
|
962
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
963
|
+
}));
|
|
964
|
+
};
|
|
965
|
+
MFormItemConst.password = function (item) {
|
|
966
|
+
return React__default.createElement(antd.Input.Password, Object.assign({
|
|
967
|
+
disabled: item.disabled
|
|
968
|
+
}, item.props, {
|
|
969
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
970
|
+
}));
|
|
971
|
+
};
|
|
972
|
+
MFormItemConst.text = function (item) {
|
|
973
|
+
return React__default.createElement(antd.Input.TextArea, Object.assign({
|
|
974
|
+
disabled: item.disabled,
|
|
975
|
+
maxLength: item.maxLength
|
|
976
|
+
}, item.props, {
|
|
977
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
978
|
+
}));
|
|
979
|
+
};
|
|
980
|
+
MFormItemConst.inputNumber = function (item) {
|
|
981
|
+
return React__default.createElement(antd.InputNumber, Object.assign({
|
|
982
|
+
disabled: item.disabled,
|
|
983
|
+
maxLength: item.maxLength
|
|
984
|
+
}, item.props, {
|
|
985
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
986
|
+
}));
|
|
987
|
+
};
|
|
988
|
+
MFormItemConst.datePicker = function (item) {
|
|
989
|
+
return React__default.createElement(antd.DatePicker, Object.assign({
|
|
990
|
+
disabled: item.disabled
|
|
991
|
+
}, item.props, {
|
|
992
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
993
|
+
}));
|
|
994
|
+
};
|
|
995
|
+
MFormItemConst.rangePicker = function (item) {
|
|
996
|
+
return React__default.createElement(RangePicker, Object.assign({
|
|
997
|
+
disabled: item.disabled
|
|
998
|
+
}, item.props, {
|
|
999
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultArrayPlaceholder(item)
|
|
1000
|
+
}));
|
|
1001
|
+
};
|
|
1002
|
+
MFormItemConst.select = function (item) {
|
|
1003
|
+
return React__default.createElement(antd.Select, Object.assign({}, item.props, {
|
|
1004
|
+
disabled: item.disabled,
|
|
1005
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
1006
|
+
}));
|
|
1007
|
+
};
|
|
1008
|
+
MFormItemConst.radio = function (item) {
|
|
1009
|
+
return React__default.createElement(antd.Radio.Group, Object.assign({
|
|
1010
|
+
disabled: item.disabled
|
|
1011
|
+
}, item.props));
|
|
1012
|
+
};
|
|
1013
|
+
MFormItemConst.checkbox = function (item) {
|
|
1014
|
+
return React__default.createElement(antd.Checkbox.Group, Object.assign({
|
|
1015
|
+
disabled: item.disabled
|
|
1016
|
+
}, item.props));
|
|
1017
|
+
};
|
|
1018
|
+
MFormItemConst.upload = function (item) {
|
|
1019
|
+
return React__default.createElement(antd.Upload, Object.assign({
|
|
1020
|
+
defaultFileList: item.initialValue
|
|
1021
|
+
}, item.props), item.children || React__default.createElement(antd.Button, null, React__default.createElement(icons.UploadOutlined, null), " \u70B9\u51FB\u4E0A\u4F20"));
|
|
1022
|
+
};
|
|
1023
|
+
MFormItemConst.mentions = function (item) {
|
|
1024
|
+
return React__default.createElement(antd.Mentions, Object.assign({}, item.props, {
|
|
1025
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
1026
|
+
}));
|
|
1027
|
+
};
|
|
1028
|
+
MFormItemConst.cascader = function (item) {
|
|
1029
|
+
return React__default.createElement(antd.Cascader, Object.assign({}, item.props, {
|
|
1030
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
1031
|
+
}));
|
|
1032
|
+
};
|
|
1033
|
+
MFormItemConst.treeSelect = function (item) {
|
|
1034
|
+
return React__default.createElement(antd.TreeSelect, Object.assign({}, item.props, {
|
|
1035
|
+
placeholder: item.placeholder || MFormItemConst.getDefaultPlaceholder(item)
|
|
1036
|
+
}));
|
|
1037
|
+
};
|
|
1038
|
+
MFormItemConst.slider = function (item) {
|
|
1039
|
+
return React__default.createElement(antd.Slider, Object.assign({}, item.props));
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
var classname$2 = function classname(n) {
|
|
1043
|
+
if (n === void 0) {
|
|
1044
|
+
n = '';
|
|
1045
|
+
}
|
|
1046
|
+
var cn = 'm-form';
|
|
1047
|
+
return getClassName(cn, n);
|
|
1048
|
+
};
|
|
1049
|
+
function MForm(props) {
|
|
1050
|
+
var formProps = props.formProps,
|
|
1051
|
+
_props$formItems = props.formItems,
|
|
1052
|
+
formItems = _props$formItems === void 0 ? [] : _props$formItems,
|
|
1053
|
+
_props$column = props.column,
|
|
1054
|
+
column = _props$column === void 0 ? 1 : _props$column,
|
|
1055
|
+
form = props.form,
|
|
1056
|
+
itemLayout = props.itemLayout,
|
|
1057
|
+
formRowProps = props.formRowProps;
|
|
1058
|
+
var renderItem = function renderItem(item, form) {
|
|
1059
|
+
if (item.render) {
|
|
1060
|
+
return item.render(form);
|
|
1061
|
+
}
|
|
1062
|
+
var func = MFormItemConst[item.type];
|
|
1063
|
+
if (item && item.type && func) {
|
|
1064
|
+
var renderFunc = func;
|
|
1065
|
+
return renderFunc(item);
|
|
1066
|
+
}
|
|
1067
|
+
return React__default.createElement("div", {
|
|
1068
|
+
className: "error-message"
|
|
1069
|
+
}, "Invalid form item configuration");
|
|
1070
|
+
};
|
|
1071
|
+
var renderFormItem = function renderFormItem(item) {
|
|
1072
|
+
var _item$show = item.show,
|
|
1073
|
+
show = _item$show === void 0 ? true : _item$show;
|
|
1074
|
+
if (!show) return null;
|
|
1075
|
+
var rules = [].concat(item.rules || []);
|
|
1076
|
+
if (item.required) {
|
|
1077
|
+
rules.push({
|
|
1078
|
+
required: true,
|
|
1079
|
+
message: item.required
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
var formItemLayout = _extends({
|
|
1083
|
+
labelCol: MFormItemConst.labelCol,
|
|
1084
|
+
wrapperCol: MFormItemConst.wrapperCol
|
|
1085
|
+
}, itemLayout, item.itemLayout);
|
|
1086
|
+
return React__default.createElement(antd.Col, {
|
|
1087
|
+
key: "col-" + item.id,
|
|
1088
|
+
span: item.span || 24 / column
|
|
1089
|
+
}, React__default.createElement("div", {
|
|
1090
|
+
className: classname$2('item-wrapper')
|
|
1091
|
+
}, React__default.createElement(antd.Form.Item, Object.assign({
|
|
1092
|
+
label: item.label,
|
|
1093
|
+
name: item.id,
|
|
1094
|
+
rules: rules,
|
|
1095
|
+
initialValue: item.initialValue
|
|
1096
|
+
}, formItemLayout, item.formItemProps), renderItem(item, form))));
|
|
1097
|
+
};
|
|
1098
|
+
return React__default.createElement(CompThemeProvider, null, React__default.createElement(antd.Form, Object.assign({
|
|
1099
|
+
form: form
|
|
1100
|
+
}, formProps, {
|
|
1101
|
+
className: classname$2() + " " + (formProps == null ? void 0 : formProps.className)
|
|
1102
|
+
}), React__default.createElement(antd.Row, Object.assign({
|
|
1103
|
+
gutter: MFormItemConst.defaultRowGutter
|
|
1104
|
+
}, formRowProps, {
|
|
1105
|
+
className: classname$2('grid') + " " + (formRowProps == null ? void 0 : formRowProps.className)
|
|
1106
|
+
}), formItems.map(function (e) {
|
|
1107
|
+
return renderFormItem(e);
|
|
1108
|
+
}))));
|
|
1109
|
+
}
|
|
1110
|
+
MForm.displayName = 'MForm';
|
|
1111
|
+
|
|
1112
|
+
// 全局状态管理
|
|
1113
|
+
var globalMode = 'default';
|
|
1114
|
+
var modalInstances = [];
|
|
1115
|
+
var getThemeConfig = function getThemeConfig(mode) {
|
|
1116
|
+
switch (mode) {
|
|
1117
|
+
case 'light':
|
|
1118
|
+
return {
|
|
1119
|
+
algorithm: [antd.theme.defaultAlgorithm]
|
|
1120
|
+
};
|
|
1121
|
+
case 'dark':
|
|
1122
|
+
return {
|
|
1123
|
+
algorithm: [antd.theme.darkAlgorithm]
|
|
1124
|
+
};
|
|
1125
|
+
default:
|
|
1126
|
+
return {
|
|
1127
|
+
algorithm: [antd.theme.defaultAlgorithm]
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
};
|
|
1131
|
+
var MiModal = /*#__PURE__*/function (_Component) {
|
|
1132
|
+
function MiModal() {
|
|
1133
|
+
var _this;
|
|
1134
|
+
_this = _Component.apply(this, arguments) || this;
|
|
1135
|
+
_this.handleCancel = function (e) {
|
|
1136
|
+
_this.props.onCancel == null || _this.props.onCancel(e);
|
|
1137
|
+
_this.props.onClosed == null || _this.props.onClosed({
|
|
1138
|
+
cancel: true
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
1141
|
+
_this.handleOk = function (e) {
|
|
1142
|
+
_this.props.onOk == null || _this.props.onOk(e);
|
|
1143
|
+
_this.props.onClosed == null || _this.props.onClosed({
|
|
1144
|
+
ok: true
|
|
1145
|
+
});
|
|
1146
|
+
};
|
|
1147
|
+
return _this;
|
|
1148
|
+
}
|
|
1149
|
+
_inheritsLoose(MiModal, _Component);
|
|
1150
|
+
var _proto = MiModal.prototype;
|
|
1151
|
+
_proto.getTheme = function getTheme() {
|
|
1152
|
+
var mode = this.props.mode || globalMode;
|
|
1153
|
+
return getThemeConfig(mode);
|
|
1154
|
+
};
|
|
1155
|
+
_proto.render = function render() {
|
|
1156
|
+
return React__default.createElement(antd.ConfigProvider, {
|
|
1157
|
+
theme: this.getTheme(),
|
|
1158
|
+
componentSize: "middle",
|
|
1159
|
+
componentDisabled: false
|
|
1160
|
+
}, React__default.createElement(antd.Modal, Object.assign({
|
|
1161
|
+
maskClosable: false,
|
|
1162
|
+
open: this.props.open,
|
|
1163
|
+
onCancel: this.handleCancel,
|
|
1164
|
+
onOk: this.handleOk,
|
|
1165
|
+
okText: "\u786E\u5B9A",
|
|
1166
|
+
cancelText: "\u53D6\u6D88"
|
|
1167
|
+
}, this.props), this.props.children));
|
|
1168
|
+
};
|
|
1169
|
+
return MiModal;
|
|
1170
|
+
}(React.Component); // 静态方法设置全局模式并更新所有弹窗
|
|
1171
|
+
MiModal.setMode = function (mode) {
|
|
1172
|
+
globalMode = mode;
|
|
1173
|
+
// 更新所有已打开的弹窗
|
|
1174
|
+
modalInstances.forEach(function (instance) {
|
|
1175
|
+
instance.update({
|
|
1176
|
+
mode: mode
|
|
1177
|
+
});
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
// 静态方法设置全局ThemeConfig
|
|
1181
|
+
MiModal.setThemeConfig = function (fn) {
|
|
1182
|
+
getThemeConfig = fn;
|
|
1183
|
+
};
|
|
1184
|
+
MiModal.open = function (props) {
|
|
1185
|
+
var instance = openModal(MiModal, _extends({
|
|
1186
|
+
mode: globalMode
|
|
1187
|
+
}, props));
|
|
1188
|
+
// 注册实例以便全局更新
|
|
1189
|
+
modalInstances.push(instance);
|
|
1190
|
+
// 添加销毁时的清理逻辑
|
|
1191
|
+
var originalDestroy = instance.destroy;
|
|
1192
|
+
instance.destroy = function () {
|
|
1193
|
+
var index = modalInstances.indexOf(instance);
|
|
1194
|
+
if (index !== -1) {
|
|
1195
|
+
modalInstances.splice(index, 1);
|
|
1196
|
+
}
|
|
1197
|
+
return originalDestroy.apply(void 0, arguments);
|
|
1198
|
+
};
|
|
1199
|
+
return instance;
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
var css_248z$2 = ".m-search {\n position: relative;\n border-radius: 8px;\n}\n.m-search .ant-card {\n margin: 0;\n padding: 16px 0;\n}\n.m-search .ant-card .ant-card-body {\n padding: 0;\n border-radius: 0;\n}\n.m-search-form {\n position: relative;\n margin-right: 20px;\n}\n.m-search-btn-wrapper {\n display: inline-block;\n}\n.m-search-collapsed .m-search-btn-wrapper {\n position: absolute;\n right: 0px;\n top: 0;\n display: flex;\n height: 100%;\n align-items: center;\n}\n.m-search .ant-form-item {\n margin-bottom: 10px;\n}\n.m-search-collapsed .ant-form-item {\n margin-bottom: 0;\n}\n.m-search-footer {\n text-align: right;\n padding: 10px 20px;\n}\n.m-search-btn {\n margin-left: 10px;\n}\n.m-search-btn-collapse {\n display: inline-block;\n cursor: pointer;\n}\n.m-search .ant-calendar-picker {\n width: auto !important;\n}";
|
|
1203
|
+
styleInject(css_248z$2);
|
|
1204
|
+
|
|
1205
|
+
var ENTER_KEY_CODE = 13; // 回车键的值为13
|
|
1206
|
+
var classname$3 = function classname(n) {
|
|
1207
|
+
if (n === void 0) {
|
|
1208
|
+
n = '';
|
|
1209
|
+
}
|
|
1210
|
+
var cn = 'm-search';
|
|
1211
|
+
return getClassName(cn, n);
|
|
1212
|
+
};
|
|
1213
|
+
var MSearch = function MSearch(props) {
|
|
1214
|
+
var className = props.className,
|
|
1215
|
+
_props$searchItems = props.searchItems,
|
|
1216
|
+
searchItems = _props$searchItems === void 0 ? [] : _props$searchItems,
|
|
1217
|
+
onSearch = props.onSearch,
|
|
1218
|
+
_props$defaultShowAll = props.defaultShowAll,
|
|
1219
|
+
defaultShowAll = _props$defaultShowAll === void 0 ? false : _props$defaultShowAll,
|
|
1220
|
+
_props$customButtons = props.customButtons,
|
|
1221
|
+
customButtons = _props$customButtons === void 0 ? [] : _props$customButtons,
|
|
1222
|
+
propsForm = props.form;
|
|
1223
|
+
var _useState = React.useState(defaultShowAll),
|
|
1224
|
+
showAll = _useState[0],
|
|
1225
|
+
setShowAll = _useState[1];
|
|
1226
|
+
var _Form$useForm = antd.Form.useForm(),
|
|
1227
|
+
curForm = _Form$useForm[0];
|
|
1228
|
+
var searchWrap = React.useRef(null);
|
|
1229
|
+
var form = propsForm != null ? propsForm : curForm;
|
|
1230
|
+
// 键盘按下事件处理
|
|
1231
|
+
var onEnterKeySearch = function onEnterKeySearch(keyObj) {
|
|
1232
|
+
var keyCode = keyObj.keyCode;
|
|
1233
|
+
if (keyCode === ENTER_KEY_CODE) {
|
|
1234
|
+
search();
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
// 添加和移除事件监听
|
|
1238
|
+
React.useEffect(function () {
|
|
1239
|
+
var currentWrap = searchWrap.current;
|
|
1240
|
+
currentWrap == null || currentWrap.addEventListener('keydown', onEnterKeySearch);
|
|
1241
|
+
return function () {
|
|
1242
|
+
currentWrap == null || currentWrap.removeEventListener('keydown', onEnterKeySearch);
|
|
1243
|
+
};
|
|
1244
|
+
}, []);
|
|
1245
|
+
// 重置表单
|
|
1246
|
+
var reset = function reset() {
|
|
1247
|
+
form == null || form.resetFields();
|
|
1248
|
+
search(true);
|
|
1249
|
+
};
|
|
1250
|
+
// 搜索函数
|
|
1251
|
+
var search = function search(isReset) {
|
|
1252
|
+
if (isReset === void 0) {
|
|
1253
|
+
isReset = false;
|
|
1254
|
+
}
|
|
1255
|
+
form == null || form.validateFields().then(function (values) {
|
|
1256
|
+
removeNull(values);
|
|
1257
|
+
onSearch == null || onSearch(values, isReset);
|
|
1258
|
+
});
|
|
1259
|
+
};
|
|
1260
|
+
// 渲染搜索按钮
|
|
1261
|
+
var renderSearchButtons = function renderSearchButtons() {
|
|
1262
|
+
var hasMore = searchItems.length > 2;
|
|
1263
|
+
return React__default.createElement("div", {
|
|
1264
|
+
className: classname$3('btn-wrapper')
|
|
1265
|
+
}, (customButtons == null ? void 0 : customButtons.length) > 0 ? React__default.createElement(React__default.Fragment, null, customButtons.map(function (buttonProps, index) {
|
|
1266
|
+
return React__default.createElement(antd.Button, Object.assign({
|
|
1267
|
+
key: "custom-btn-" + index,
|
|
1268
|
+
className: classname$3('btn')
|
|
1269
|
+
}, buttonProps), buttonProps.children);
|
|
1270
|
+
})) : React__default.createElement(React__default.Fragment, null, React__default.createElement(antd.Button, {
|
|
1271
|
+
className: classname$3('btn btn-reset'),
|
|
1272
|
+
onClick: reset
|
|
1273
|
+
}, "\u91CD\u7F6E"), React__default.createElement(antd.Button, {
|
|
1274
|
+
className: classname$3('btn btn-search'),
|
|
1275
|
+
onClick: function onClick() {
|
|
1276
|
+
return search();
|
|
1277
|
+
},
|
|
1278
|
+
type: "primary"
|
|
1279
|
+
}, "\u641C\u7D22")), hasMore && React__default.createElement("div", {
|
|
1280
|
+
className: classname$3('btn btn-collapse'),
|
|
1281
|
+
onClick: function onClick() {
|
|
1282
|
+
return setShowAll(!showAll);
|
|
1283
|
+
}
|
|
1284
|
+
}, React__default.createElement("span", null, showAll ? '收起' : '展开'), showAll ? React__default.createElement(icons.CaretUpOutlined, null) : React__default.createElement(icons.CaretDownOutlined, null)));
|
|
1285
|
+
};
|
|
1286
|
+
// 处理搜索项显示/隐藏
|
|
1287
|
+
var processedSearchItems = searchItems.map(function (item, idx) {
|
|
1288
|
+
var newItem = _extends({}, item);
|
|
1289
|
+
if (searchItems.length > 2 && idx >= 2 && !showAll) {
|
|
1290
|
+
var _item$formItemProps;
|
|
1291
|
+
newItem.formItemProps = _extends({}, item.formItemProps, {
|
|
1292
|
+
style: _extends({}, (_item$formItemProps = item.formItemProps) == null ? void 0 : _item$formItemProps.style, {
|
|
1293
|
+
display: 'none'
|
|
1294
|
+
})
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
return newItem;
|
|
1298
|
+
});
|
|
1299
|
+
var hasMore = searchItems.length > 2;
|
|
1300
|
+
return React__default.createElement(CompThemeProvider, null, React__default.createElement("div", {
|
|
1301
|
+
className: classname$3('') + " " + (showAll ? '' : classname$3('collapsed')) + " " + (className || ''),
|
|
1302
|
+
ref: searchWrap
|
|
1303
|
+
}, React__default.createElement(antd.Card, null, React__default.createElement("div", {
|
|
1304
|
+
className: classname$3('form')
|
|
1305
|
+
}, React__default.createElement(MForm, {
|
|
1306
|
+
form: form,
|
|
1307
|
+
formItems: processedSearchItems,
|
|
1308
|
+
column: 3
|
|
1309
|
+
}), (!hasMore || hasMore && !showAll) && renderSearchButtons()), hasMore && showAll && React__default.createElement("div", {
|
|
1310
|
+
className: classname$3('footer')
|
|
1311
|
+
}, renderSearchButtons()))));
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
function MTable(props) {
|
|
1315
|
+
var _props$columns$map, _props$columns;
|
|
1316
|
+
var columns = (_props$columns$map = (_props$columns = props.columns) == null ? void 0 : _props$columns.map(function (e) {
|
|
1317
|
+
return _extends({}, e, {
|
|
1318
|
+
dataIndex: e.key
|
|
1319
|
+
});
|
|
1320
|
+
})) != null ? _props$columns$map : [];
|
|
1321
|
+
return React__default.createElement(CompThemeProvider, null, React__default.createElement(antd.Table, Object.assign({
|
|
1322
|
+
rowKey: function rowKey(e) {
|
|
1323
|
+
return e.id;
|
|
1324
|
+
}
|
|
1325
|
+
}, props, {
|
|
1326
|
+
columns: columns
|
|
1327
|
+
})), ";");
|
|
1328
|
+
}
|
|
1329
|
+
MTable.displayName = 'MTable';
|
|
1330
|
+
|
|
1331
|
+
var DATE_FORMAT = {
|
|
1332
|
+
YMD_Hms: 'YYYY-MM-DD HH:mm:ss',
|
|
1333
|
+
YMD: 'YYYY-MM-DD',
|
|
1334
|
+
YMD2: 'YYYYMMDD',
|
|
1335
|
+
YMD_POINT: 'YYYY.M.DD',
|
|
1336
|
+
Hms: 'HH:mm:ss',
|
|
1337
|
+
Hm: 'HH:mm',
|
|
1338
|
+
YMD_000: 'YYYY-MM-DD 00:00:00',
|
|
1339
|
+
YMD_end: 'YYYY-MM-DD 23:59:59',
|
|
1340
|
+
YMD_Hm: 'YYYYMMDD HHmm'
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
var PAGE_SIZE = 10;
|
|
1344
|
+
|
|
1345
|
+
var PatternType = function PatternType() {};
|
|
1346
|
+
// 整数
|
|
1347
|
+
PatternType.integerRegex = /^-?\d+$/;
|
|
1348
|
+
// 正整数
|
|
1349
|
+
PatternType.positiveIntegerRegex = /^[1-9]\d*$/;
|
|
1350
|
+
// 负整数
|
|
1351
|
+
PatternType.negativeIntegerRegex = /^-[1-9]\d*$/;
|
|
1352
|
+
// 浮点数
|
|
1353
|
+
PatternType.floatRegex = /^-?\d+(\.\d+)?$/;
|
|
1354
|
+
// 字母
|
|
1355
|
+
PatternType.letter = /^[a-zA-Z]+$/;
|
|
1356
|
+
// 汉字
|
|
1357
|
+
PatternType.chinese = /^[\u4e00-\u9fa5]+$/;
|
|
1358
|
+
// 数字
|
|
1359
|
+
PatternType.number = /^[0-9]*$/;
|
|
1360
|
+
// 用户名 字母开头,允许字母数字下划线,长度4-16
|
|
1361
|
+
PatternType.username = /^[a-zA-Z]\w{3,15}$/;
|
|
1362
|
+
// 强用户名 必须包含大小写字母和数字,6-20位
|
|
1363
|
+
PatternType.strongUsername = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/;
|
|
1364
|
+
// 密码 至少8位,包含字母和数字
|
|
1365
|
+
PatternType.password = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
|
|
1366
|
+
// 强密码 至少8位,包含大小写字母、数字和特殊字符
|
|
1367
|
+
PatternType.strongPassword = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
|
|
1368
|
+
// 中国大陆的手机号
|
|
1369
|
+
PatternType.phone = /^1[3-9]\d{9}$/;
|
|
1370
|
+
// 带区号的手机号
|
|
1371
|
+
PatternType.phoneWithAreaCode = /^\+?\d{2,3}-?\d{8,11}$/;
|
|
1372
|
+
// 邮箱
|
|
1373
|
+
PatternType.email = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1374
|
+
// 身份证
|
|
1375
|
+
PatternType.idCard = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
|
|
1376
|
+
// 银行卡
|
|
1377
|
+
PatternType.bankCard = /^[1-9]\d{3,30}$/;
|
|
1378
|
+
// 邮政编码
|
|
1379
|
+
PatternType.zipCode = /^[1-9]\d{5}$/;
|
|
1380
|
+
// IP
|
|
1381
|
+
PatternType.ip = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
|
1382
|
+
// URL
|
|
1383
|
+
PatternType.url = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
|
|
1384
|
+
// 车牌
|
|
1385
|
+
PatternType.carNumber = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/;
|
|
1386
|
+
// 时间 hh:mm:ss
|
|
1387
|
+
PatternType.time = /^([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/;
|
|
1388
|
+
// 日期 YYYY-MM-DD
|
|
1389
|
+
PatternType.date = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
1390
|
+
|
|
1391
|
+
function useFuncRequest(
|
|
1392
|
+
// 异步函数
|
|
1393
|
+
asyncFunc,
|
|
1394
|
+
// 配置项
|
|
1395
|
+
options) {
|
|
1396
|
+
var _useState = React.useState(false),
|
|
1397
|
+
loading = _useState[0],
|
|
1398
|
+
setLoading = _useState[1];
|
|
1399
|
+
var _useState2 = React.useState(null),
|
|
1400
|
+
error = _useState2[0],
|
|
1401
|
+
setError = _useState2[1];
|
|
1402
|
+
var _useState3 = React.useState(null),
|
|
1403
|
+
data = _useState3[0],
|
|
1404
|
+
setData = _useState3[1];
|
|
1405
|
+
var abortControllerRef = React.useRef(undefined);
|
|
1406
|
+
var requestIdRef = React.useRef(0);
|
|
1407
|
+
var cancel = function cancel() {
|
|
1408
|
+
var _abortControllerRef$c;
|
|
1409
|
+
(_abortControllerRef$c = abortControllerRef.current) == null || _abortControllerRef$c.abort();
|
|
1410
|
+
setLoading(false);
|
|
1411
|
+
setError(null);
|
|
1412
|
+
};
|
|
1413
|
+
var run = /*#__PURE__*/function () {
|
|
1414
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
1415
|
+
var currentRequestId,
|
|
1416
|
+
abortController,
|
|
1417
|
+
_len,
|
|
1418
|
+
args,
|
|
1419
|
+
_key,
|
|
1420
|
+
beforeRes,
|
|
1421
|
+
funcArgs,
|
|
1422
|
+
res,
|
|
1423
|
+
_args = arguments,
|
|
1424
|
+
_t;
|
|
1425
|
+
return _regenerator().w(function (_context) {
|
|
1426
|
+
while (1) switch (_context.p = _context.n) {
|
|
1427
|
+
case 0:
|
|
1428
|
+
currentRequestId = ++requestIdRef.current;
|
|
1429
|
+
cancel();
|
|
1430
|
+
abortController = new AbortController();
|
|
1431
|
+
abortControllerRef.current = abortController;
|
|
1432
|
+
_context.p = 1;
|
|
1433
|
+
setLoading(true);
|
|
1434
|
+
setError(null);
|
|
1435
|
+
for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1436
|
+
args[_key] = _args[_key];
|
|
1437
|
+
}
|
|
1438
|
+
if (!(options != null && options.onBefore)) {
|
|
1439
|
+
_context.n = 3;
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
_context.n = 2;
|
|
1443
|
+
return options == null || options.onBefore == null ? void 0 : options.onBefore.apply(options, args);
|
|
1444
|
+
case 2:
|
|
1445
|
+
beforeRes = _context.v;
|
|
1446
|
+
if (beforeRes) {
|
|
1447
|
+
_context.n = 3;
|
|
1448
|
+
break;
|
|
1449
|
+
}
|
|
1450
|
+
cancel();
|
|
1451
|
+
return _context.a(2);
|
|
1452
|
+
case 3:
|
|
1453
|
+
// 安全传递 AbortSignal
|
|
1454
|
+
funcArgs = args.length >= asyncFunc.length ? args : [].concat(args, [{
|
|
1455
|
+
signal: abortController.signal
|
|
1456
|
+
}]);
|
|
1457
|
+
_context.n = 4;
|
|
1458
|
+
return asyncFunc.apply(void 0, funcArgs);
|
|
1459
|
+
case 4:
|
|
1460
|
+
res = _context.v;
|
|
1461
|
+
if (!(!abortController.signal.aborted && currentRequestId === requestIdRef.current)) {
|
|
1462
|
+
_context.n = 5;
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
setData(res);
|
|
1466
|
+
_context.n = 5;
|
|
1467
|
+
return options == null || options.onSuccess == null ? void 0 : options.onSuccess(res);
|
|
1468
|
+
case 5:
|
|
1469
|
+
return _context.a(2, res);
|
|
1470
|
+
case 6:
|
|
1471
|
+
_context.p = 6;
|
|
1472
|
+
_t = _context.v;
|
|
1473
|
+
if (!(!abortController.signal.aborted && currentRequestId === requestIdRef.current)) {
|
|
1474
|
+
_context.n = 7;
|
|
1475
|
+
break;
|
|
1476
|
+
}
|
|
1477
|
+
setError(_t);
|
|
1478
|
+
_context.n = 7;
|
|
1479
|
+
return options == null || options.onError == null ? void 0 : options.onError(_t);
|
|
1480
|
+
case 7:
|
|
1481
|
+
throw _t;
|
|
1482
|
+
case 8:
|
|
1483
|
+
_context.p = 8;
|
|
1484
|
+
if (!(!abortController.signal.aborted && currentRequestId === requestIdRef.current)) {
|
|
1485
|
+
_context.n = 9;
|
|
1486
|
+
break;
|
|
1487
|
+
}
|
|
1488
|
+
setLoading(false);
|
|
1489
|
+
_context.n = 9;
|
|
1490
|
+
return options == null || options.onFinally == null ? void 0 : options.onFinally();
|
|
1491
|
+
case 9:
|
|
1492
|
+
return _context.f(8);
|
|
1493
|
+
case 10:
|
|
1494
|
+
return _context.a(2);
|
|
1495
|
+
}
|
|
1496
|
+
}, _callee, null, [[1, 6, 8, 10]]);
|
|
1497
|
+
}));
|
|
1498
|
+
return function run() {
|
|
1499
|
+
return _ref.apply(this, arguments);
|
|
1500
|
+
};
|
|
1501
|
+
}();
|
|
1502
|
+
React.useEffect(function () {
|
|
1503
|
+
if (options != null && options.autoRunArgs) {
|
|
1504
|
+
run.apply(void 0, options.autoRunArgs)["catch"](function () {});
|
|
1505
|
+
}
|
|
1506
|
+
return cancel;
|
|
1507
|
+
}, [JSON.stringify(options == null ? void 0 : options.autoRunArgs)]);
|
|
1508
|
+
return {
|
|
1509
|
+
run: run,
|
|
1510
|
+
cancel: cancel,
|
|
1511
|
+
loading: loading,
|
|
1512
|
+
error: error,
|
|
1513
|
+
data: data
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
function useInterval(callback, delay, immediate) {
|
|
1518
|
+
if (immediate === void 0) {
|
|
1519
|
+
immediate = false;
|
|
1520
|
+
}
|
|
1521
|
+
var timerRef = React.useRef(undefined);
|
|
1522
|
+
var savedCallback = React.useRef(callback);
|
|
1523
|
+
// Update callback ref if callback changes
|
|
1524
|
+
React.useEffect(function () {
|
|
1525
|
+
savedCallback.current = callback;
|
|
1526
|
+
}, [callback]);
|
|
1527
|
+
var clear = React.useCallback(function () {
|
|
1528
|
+
if (timerRef.current) {
|
|
1529
|
+
clearInterval(timerRef.current);
|
|
1530
|
+
timerRef.current = undefined;
|
|
1531
|
+
}
|
|
1532
|
+
}, []);
|
|
1533
|
+
var start = React.useCallback(function () {
|
|
1534
|
+
clear();
|
|
1535
|
+
if (delay !== null && delay !== undefined) {
|
|
1536
|
+
timerRef.current = setInterval(function () {
|
|
1537
|
+
return savedCallback.current();
|
|
1538
|
+
}, delay);
|
|
1539
|
+
}
|
|
1540
|
+
}, [delay, clear]);
|
|
1541
|
+
React.useEffect(function () {
|
|
1542
|
+
if (immediate) {
|
|
1543
|
+
savedCallback.current();
|
|
1544
|
+
}
|
|
1545
|
+
start();
|
|
1546
|
+
return clear;
|
|
1547
|
+
}, [delay, start, clear, immediate]);
|
|
1548
|
+
return {
|
|
1549
|
+
start: start,
|
|
1550
|
+
clear: clear,
|
|
1551
|
+
isRunning: !!timerRef.current
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
var usePagination = function usePagination(server, deps,
|
|
1556
|
+
// 依赖条件 数据更新默认执行server
|
|
1557
|
+
option) {
|
|
1558
|
+
var _ref = option || {},
|
|
1559
|
+
_ref$isReady = _ref.isReady,
|
|
1560
|
+
isReady = _ref$isReady === void 0 ? true : _ref$isReady,
|
|
1561
|
+
_ref$dataSource = _ref.dataSource,
|
|
1562
|
+
propDataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
1563
|
+
_ref$current = _ref.current,
|
|
1564
|
+
propCurrent = _ref$current === void 0 ? 1 : _ref$current,
|
|
1565
|
+
_ref$pageSize = _ref.pageSize,
|
|
1566
|
+
propPageSize = _ref$pageSize === void 0 ? 10 : _ref$pageSize;
|
|
1567
|
+
var _useState = React.useState(propCurrent),
|
|
1568
|
+
current = _useState[0],
|
|
1569
|
+
setCurrent = _useState[1];
|
|
1570
|
+
var _useState2 = React.useState(propPageSize),
|
|
1571
|
+
pageSize = _useState2[0],
|
|
1572
|
+
setPageSize = _useState2[1];
|
|
1573
|
+
var _useState3 = React.useState(propDataSource),
|
|
1574
|
+
dataSource = _useState3[0],
|
|
1575
|
+
setDataSource = _useState3[1];
|
|
1576
|
+
var _useState4 = React.useState(0),
|
|
1577
|
+
total = _useState4[0],
|
|
1578
|
+
setTotal = _useState4[1];
|
|
1579
|
+
var _useState5 = React.useState(false),
|
|
1580
|
+
loading = _useState5[0],
|
|
1581
|
+
setLoading = _useState5[1];
|
|
1582
|
+
var _useState6 = React.useState(false),
|
|
1583
|
+
isFirstComplete = _useState6[0],
|
|
1584
|
+
setIsFirstComplete = _useState6[1];
|
|
1585
|
+
var currentRef = React.useRef(current);
|
|
1586
|
+
var pageSizeRef = React.useRef(pageSize);
|
|
1587
|
+
// 在状态更新时同步更新ref
|
|
1588
|
+
var setCurrentAndRef = function setCurrentAndRef(val) {
|
|
1589
|
+
setCurrent(val);
|
|
1590
|
+
currentRef.current = val;
|
|
1591
|
+
};
|
|
1592
|
+
var setPageSizeAndRef = function setPageSizeAndRef(val) {
|
|
1593
|
+
setPageSize(val);
|
|
1594
|
+
pageSizeRef.current = val;
|
|
1595
|
+
};
|
|
1596
|
+
// 计数器
|
|
1597
|
+
var seq = React.useRef(0);
|
|
1598
|
+
var doSearch = /*#__PURE__*/function () {
|
|
1599
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
1600
|
+
var _current, _pageSize, _seq, offset, _yield$server, data_source, _total, totalPage, _yield$server2, _t;
|
|
1601
|
+
return _regenerator().w(function (_context) {
|
|
1602
|
+
while (1) switch (_context.p = _context.n) {
|
|
1603
|
+
case 0:
|
|
1604
|
+
if (isReady) {
|
|
1605
|
+
_context.n = 1;
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
return _context.a(2);
|
|
1609
|
+
case 1:
|
|
1610
|
+
_current = currentRef.current;
|
|
1611
|
+
_pageSize = pageSizeRef.current;
|
|
1612
|
+
setLoading(true);
|
|
1613
|
+
seq.current++;
|
|
1614
|
+
_seq = seq.current;
|
|
1615
|
+
_context.p = 2;
|
|
1616
|
+
// 发送请求
|
|
1617
|
+
offset = Math.round((_current - 1) * _pageSize);
|
|
1618
|
+
if (offset < 0) {
|
|
1619
|
+
offset = 0;
|
|
1620
|
+
}
|
|
1621
|
+
if (_pageSize < 1) {
|
|
1622
|
+
_pageSize = 1;
|
|
1623
|
+
}
|
|
1624
|
+
_context.n = 3;
|
|
1625
|
+
return server({
|
|
1626
|
+
limit: _pageSize,
|
|
1627
|
+
offset: offset,
|
|
1628
|
+
current: _current
|
|
1629
|
+
});
|
|
1630
|
+
case 3:
|
|
1631
|
+
_yield$server = _context.v;
|
|
1632
|
+
data_source = _yield$server.dataSource;
|
|
1633
|
+
_total = _yield$server.total;
|
|
1634
|
+
if (!(_seq !== seq.current)) {
|
|
1635
|
+
_context.n = 4;
|
|
1636
|
+
break;
|
|
1637
|
+
}
|
|
1638
|
+
return _context.a(2);
|
|
1639
|
+
case 4:
|
|
1640
|
+
if (!(pageSize * (_current - 1) >= _total && _current !== 1)) {
|
|
1641
|
+
_context.n = 7;
|
|
1642
|
+
break;
|
|
1643
|
+
}
|
|
1644
|
+
_current = 1;
|
|
1645
|
+
totalPage = Math.ceil(_total / pageSize);
|
|
1646
|
+
_context.n = 5;
|
|
1647
|
+
return server({
|
|
1648
|
+
limit: _pageSize,
|
|
1649
|
+
offset: offset,
|
|
1650
|
+
current: _current
|
|
1651
|
+
});
|
|
1652
|
+
case 5:
|
|
1653
|
+
_yield$server2 = _context.v;
|
|
1654
|
+
data_source = _yield$server2.dataSource;
|
|
1655
|
+
_total = _yield$server2.total;
|
|
1656
|
+
if (!(_seq !== seq.current)) {
|
|
1657
|
+
_context.n = 6;
|
|
1658
|
+
break;
|
|
1659
|
+
}
|
|
1660
|
+
return _context.a(2);
|
|
1661
|
+
case 6:
|
|
1662
|
+
_current = totalPage;
|
|
1663
|
+
case 7:
|
|
1664
|
+
setDataSource(data_source);
|
|
1665
|
+
setCurrentAndRef(_current);
|
|
1666
|
+
setPageSizeAndRef(_pageSize);
|
|
1667
|
+
setTotal(_total);
|
|
1668
|
+
_context.n = 9;
|
|
1669
|
+
break;
|
|
1670
|
+
case 8:
|
|
1671
|
+
_context.p = 8;
|
|
1672
|
+
_t = _context.v;
|
|
1673
|
+
// eslint-disable-next-line no-console
|
|
1674
|
+
console.error('fetch err', _t);
|
|
1675
|
+
if (!(_seq !== seq.current)) {
|
|
1676
|
+
_context.n = 9;
|
|
1677
|
+
break;
|
|
1678
|
+
}
|
|
1679
|
+
return _context.a(2);
|
|
1680
|
+
case 9:
|
|
1681
|
+
_context.p = 9;
|
|
1682
|
+
setIsFirstComplete(true);
|
|
1683
|
+
setLoading(false);
|
|
1684
|
+
return _context.f(9);
|
|
1685
|
+
case 10:
|
|
1686
|
+
return _context.a(2);
|
|
1687
|
+
}
|
|
1688
|
+
}, _callee, null, [[2, 8, 9, 10]]);
|
|
1689
|
+
}));
|
|
1690
|
+
return function doSearch() {
|
|
1691
|
+
return _ref2.apply(this, arguments);
|
|
1692
|
+
};
|
|
1693
|
+
}();
|
|
1694
|
+
var refresh = /*#__PURE__*/function () {
|
|
1695
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(resetPage) {
|
|
1696
|
+
return _regenerator().w(function (_context2) {
|
|
1697
|
+
while (1) switch (_context2.n) {
|
|
1698
|
+
case 0:
|
|
1699
|
+
if (resetPage) {
|
|
1700
|
+
setDataSource([]);
|
|
1701
|
+
setCurrentAndRef(propCurrent);
|
|
1702
|
+
setPageSizeAndRef(propPageSize);
|
|
1703
|
+
}
|
|
1704
|
+
_context2.n = 1;
|
|
1705
|
+
return doSearch();
|
|
1706
|
+
case 1:
|
|
1707
|
+
return _context2.a(2);
|
|
1708
|
+
}
|
|
1709
|
+
}, _callee2);
|
|
1710
|
+
}));
|
|
1711
|
+
return function refresh(_x) {
|
|
1712
|
+
return _ref3.apply(this, arguments);
|
|
1713
|
+
};
|
|
1714
|
+
}();
|
|
1715
|
+
var debounceRefresh = React.useCallback(lodash.debounce(refresh, 500), [refresh]);
|
|
1716
|
+
/* 重置逻辑 */
|
|
1717
|
+
var _deps = [].concat(deps || [], [isReady]);
|
|
1718
|
+
React.useEffect(function () {
|
|
1719
|
+
if (!isReady) return;
|
|
1720
|
+
debounceRefresh(true);
|
|
1721
|
+
}, _deps);
|
|
1722
|
+
var onChange = /*#__PURE__*/function () {
|
|
1723
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(page, pageSize) {
|
|
1724
|
+
return _regenerator().w(function (_context3) {
|
|
1725
|
+
while (1) switch (_context3.n) {
|
|
1726
|
+
case 0:
|
|
1727
|
+
setCurrentAndRef(page);
|
|
1728
|
+
setPageSizeAndRef(pageSize);
|
|
1729
|
+
_context3.n = 1;
|
|
1730
|
+
return refresh();
|
|
1731
|
+
case 1:
|
|
1732
|
+
return _context3.a(2);
|
|
1733
|
+
}
|
|
1734
|
+
}, _callee3);
|
|
1735
|
+
}));
|
|
1736
|
+
return function onChange(_x2, _x3) {
|
|
1737
|
+
return _ref4.apply(this, arguments);
|
|
1738
|
+
};
|
|
1739
|
+
}();
|
|
1740
|
+
var onShowSizeChange = /*#__PURE__*/function () {
|
|
1741
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(size, current) {
|
|
1742
|
+
return _regenerator().w(function (_context4) {
|
|
1743
|
+
while (1) switch (_context4.n) {
|
|
1744
|
+
case 0:
|
|
1745
|
+
setPageSizeAndRef(size);
|
|
1746
|
+
setCurrentAndRef(current);
|
|
1747
|
+
_context4.n = 1;
|
|
1748
|
+
return refresh();
|
|
1749
|
+
case 1:
|
|
1750
|
+
return _context4.a(2);
|
|
1751
|
+
}
|
|
1752
|
+
}, _callee4);
|
|
1753
|
+
}));
|
|
1754
|
+
return function onShowSizeChange(_x4, _x5) {
|
|
1755
|
+
return _ref5.apply(this, arguments);
|
|
1756
|
+
};
|
|
1757
|
+
}();
|
|
1758
|
+
var paginationProps = {
|
|
1759
|
+
current: current,
|
|
1760
|
+
pageSize: pageSize,
|
|
1761
|
+
total: total,
|
|
1762
|
+
onChange: onChange,
|
|
1763
|
+
onShowSizeChange: onShowSizeChange
|
|
1764
|
+
};
|
|
1765
|
+
return {
|
|
1766
|
+
tableProps: {
|
|
1767
|
+
loading: loading,
|
|
1768
|
+
dataSource: dataSource
|
|
1769
|
+
},
|
|
1770
|
+
loading: loading,
|
|
1771
|
+
dataSource: dataSource,
|
|
1772
|
+
paginationProps: paginationProps,
|
|
1773
|
+
isFirstComplete: isFirstComplete,
|
|
1774
|
+
refresh: refresh,
|
|
1775
|
+
debounceRefresh: debounceRefresh,
|
|
1776
|
+
setDataSource: setDataSource
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
function useQuery() {
|
|
1781
|
+
var search = window.location.href.split('?')[1] || '';
|
|
1782
|
+
var params = new URLSearchParams(search);
|
|
1783
|
+
var query = Object.fromEntries(params.entries());
|
|
1784
|
+
return query;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
var useReactive = function useReactive(initialState) {
|
|
1788
|
+
var _useState = React.useState(initialState),
|
|
1789
|
+
state = _useState[0],
|
|
1790
|
+
setState = _useState[1];
|
|
1791
|
+
var stateRef = React.useRef(state);
|
|
1792
|
+
var updateState = React.useCallback(function (newState) {
|
|
1793
|
+
setState(function (prev) {
|
|
1794
|
+
var updatedPart = typeof newState === 'function' ? newState(prev) : newState;
|
|
1795
|
+
var newFullState = _extends({}, prev, updatedPart);
|
|
1796
|
+
stateRef.current = newFullState; // 同步更新ref
|
|
1797
|
+
return newFullState;
|
|
1798
|
+
});
|
|
1799
|
+
}, []);
|
|
1800
|
+
var getState = React.useCallback(function () {
|
|
1801
|
+
return stateRef.current;
|
|
1802
|
+
}, []);
|
|
1803
|
+
var resetState = React.useCallback(function () {
|
|
1804
|
+
setState(initialState);
|
|
1805
|
+
stateRef.current = initialState;
|
|
1806
|
+
}, [initialState]);
|
|
1807
|
+
return [state, updateState, getState, resetState];
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
function useTimeout(callback, delay, immediate) {
|
|
1811
|
+
if (immediate === void 0) {
|
|
1812
|
+
immediate = false;
|
|
1813
|
+
}
|
|
1814
|
+
var timerRef = React.useRef(undefined);
|
|
1815
|
+
var savedCallback = React.useRef(callback);
|
|
1816
|
+
// Update callback ref if callback changes
|
|
1817
|
+
React.useEffect(function () {
|
|
1818
|
+
savedCallback.current = callback;
|
|
1819
|
+
}, [callback]);
|
|
1820
|
+
var clear = React.useCallback(function () {
|
|
1821
|
+
if (timerRef.current) {
|
|
1822
|
+
clearTimeout(timerRef.current);
|
|
1823
|
+
timerRef.current = undefined;
|
|
1824
|
+
}
|
|
1825
|
+
}, []);
|
|
1826
|
+
var start = React.useCallback(function () {
|
|
1827
|
+
clear();
|
|
1828
|
+
if (delay !== null && delay !== undefined) {
|
|
1829
|
+
timerRef.current = setTimeout(function () {
|
|
1830
|
+
return savedCallback.current();
|
|
1831
|
+
}, delay);
|
|
1832
|
+
}
|
|
1833
|
+
}, [delay, clear]);
|
|
1834
|
+
React.useEffect(function () {
|
|
1835
|
+
if (immediate) {
|
|
1836
|
+
savedCallback.current();
|
|
1837
|
+
}
|
|
1838
|
+
start();
|
|
1839
|
+
return clear;
|
|
1840
|
+
}, [delay, start, clear, immediate]);
|
|
1841
|
+
return {
|
|
1842
|
+
start: start,
|
|
1843
|
+
clear: clear,
|
|
1844
|
+
isRunning: !!timerRef.current
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
var useVirtualList = function useVirtualList(server, deps,
|
|
1849
|
+
// 依赖条件 数据更新默认执行server
|
|
1850
|
+
option) {
|
|
1851
|
+
var _ref = option || {},
|
|
1852
|
+
_ref$isReady = _ref.isReady,
|
|
1853
|
+
isReady = _ref$isReady === void 0 ? true : _ref$isReady,
|
|
1854
|
+
_ref$dataSource = _ref.dataSource,
|
|
1855
|
+
propDataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
1856
|
+
_ref$current = _ref.current,
|
|
1857
|
+
propCurrent = _ref$current === void 0 ? 1 : _ref$current,
|
|
1858
|
+
_ref$pageSize = _ref.pageSize,
|
|
1859
|
+
propPageSize = _ref$pageSize === void 0 ? PAGE_SIZE : _ref$pageSize;
|
|
1860
|
+
// 是否完成了一次请求
|
|
1861
|
+
var _useState = React.useState(false),
|
|
1862
|
+
isFirstComplete = _useState[0],
|
|
1863
|
+
setIsFirstComplete = _useState[1];
|
|
1864
|
+
// 分页
|
|
1865
|
+
var _useState2 = React.useState(propCurrent),
|
|
1866
|
+
current = _useState2[0],
|
|
1867
|
+
setCurrent = _useState2[1];
|
|
1868
|
+
var _useState3 = React.useState(propPageSize),
|
|
1869
|
+
pageSize = _useState3[0],
|
|
1870
|
+
setPageSize = _useState3[1];
|
|
1871
|
+
var _useState4 = React.useState(0),
|
|
1872
|
+
total = _useState4[0],
|
|
1873
|
+
setTotal = _useState4[1];
|
|
1874
|
+
// 表格
|
|
1875
|
+
var _useState5 = React.useState(false),
|
|
1876
|
+
isLoading = _useState5[0],
|
|
1877
|
+
setIsLoading = _useState5[1];
|
|
1878
|
+
var _useState6 = React.useState(propDataSource),
|
|
1879
|
+
dataSource = _useState6[0],
|
|
1880
|
+
setDataSource = _useState6[1];
|
|
1881
|
+
var currentRef = React.useRef(current);
|
|
1882
|
+
var pageSizeRef = React.useRef(pageSize);
|
|
1883
|
+
// 在状态更新时同步更新ref
|
|
1884
|
+
var setCurrentAndRef = function setCurrentAndRef(val) {
|
|
1885
|
+
setCurrent(val);
|
|
1886
|
+
currentRef.current = val;
|
|
1887
|
+
};
|
|
1888
|
+
var setPageSizeAndRef = function setPageSizeAndRef(val) {
|
|
1889
|
+
setPageSize(val);
|
|
1890
|
+
pageSizeRef.current = val;
|
|
1891
|
+
};
|
|
1892
|
+
// 计数器
|
|
1893
|
+
var seq = React.useRef(0);
|
|
1894
|
+
var doSearch = /*#__PURE__*/function () {
|
|
1895
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(reset) {
|
|
1896
|
+
var _current, _pageSize, _seq, offset, _yield$server, data0, total0, totalPage, _yield$server2, d, _t;
|
|
1897
|
+
return _regenerator().w(function (_context) {
|
|
1898
|
+
while (1) switch (_context.p = _context.n) {
|
|
1899
|
+
case 0:
|
|
1900
|
+
if (isReady) {
|
|
1901
|
+
_context.n = 1;
|
|
1902
|
+
break;
|
|
1903
|
+
}
|
|
1904
|
+
return _context.a(2);
|
|
1905
|
+
case 1:
|
|
1906
|
+
_current = currentRef.current;
|
|
1907
|
+
_pageSize = pageSizeRef.current;
|
|
1908
|
+
setIsLoading(true);
|
|
1909
|
+
seq.current += 1;
|
|
1910
|
+
_seq = seq.current;
|
|
1911
|
+
_context.p = 2;
|
|
1912
|
+
// 发送请求
|
|
1913
|
+
offset = Math.round((_current - 1) * _pageSize);
|
|
1914
|
+
if (offset < 0) {
|
|
1915
|
+
offset = 0;
|
|
1916
|
+
}
|
|
1917
|
+
if (_pageSize < 1) {
|
|
1918
|
+
_pageSize = 1;
|
|
1919
|
+
}
|
|
1920
|
+
_context.n = 3;
|
|
1921
|
+
return server({
|
|
1922
|
+
limit: _pageSize,
|
|
1923
|
+
offset: offset,
|
|
1924
|
+
current: _current
|
|
1925
|
+
});
|
|
1926
|
+
case 3:
|
|
1927
|
+
_yield$server = _context.v;
|
|
1928
|
+
data0 = _yield$server.dataSource;
|
|
1929
|
+
total0 = _yield$server.total;
|
|
1930
|
+
if (!(_seq !== seq.current)) {
|
|
1931
|
+
_context.n = 4;
|
|
1932
|
+
break;
|
|
1933
|
+
}
|
|
1934
|
+
return _context.a(2);
|
|
1935
|
+
case 4:
|
|
1936
|
+
if (!(pageSize * (_current - 1) >= total0 && _current !== 1)) {
|
|
1937
|
+
_context.n = 7;
|
|
1938
|
+
break;
|
|
1939
|
+
}
|
|
1940
|
+
totalPage = Math.ceil(total0 / pageSize);
|
|
1941
|
+
_context.n = 5;
|
|
1942
|
+
return server({
|
|
1943
|
+
limit: _pageSize,
|
|
1944
|
+
offset: Math.round((totalPage - 1) * _pageSize),
|
|
1945
|
+
current: _current
|
|
1946
|
+
});
|
|
1947
|
+
case 5:
|
|
1948
|
+
_yield$server2 = _context.v;
|
|
1949
|
+
data0 = _yield$server2.dataSource;
|
|
1950
|
+
total0 = _yield$server2.total;
|
|
1951
|
+
if (!(_seq !== seq.current)) {
|
|
1952
|
+
_context.n = 6;
|
|
1953
|
+
break;
|
|
1954
|
+
}
|
|
1955
|
+
return _context.a(2);
|
|
1956
|
+
case 6:
|
|
1957
|
+
_current = totalPage;
|
|
1958
|
+
// message.error('数据源发生变化,该页没有数据,自动加载最后一页');
|
|
1959
|
+
case 7:
|
|
1960
|
+
d = reset ? data0 : dataSource.concat(data0);
|
|
1961
|
+
setDataSource(d);
|
|
1962
|
+
setCurrentAndRef(_current);
|
|
1963
|
+
setPageSizeAndRef(_pageSize);
|
|
1964
|
+
setTotal(total0);
|
|
1965
|
+
_context.n = 9;
|
|
1966
|
+
break;
|
|
1967
|
+
case 8:
|
|
1968
|
+
_context.p = 8;
|
|
1969
|
+
_t = _context.v;
|
|
1970
|
+
console.error('fetch err', _t);
|
|
1971
|
+
if (!(_seq !== seq.current)) {
|
|
1972
|
+
_context.n = 9;
|
|
1973
|
+
break;
|
|
1974
|
+
}
|
|
1975
|
+
return _context.a(2);
|
|
1976
|
+
case 9:
|
|
1977
|
+
setIsFirstComplete(true);
|
|
1978
|
+
setIsLoading(false);
|
|
1979
|
+
case 10:
|
|
1980
|
+
return _context.a(2);
|
|
1981
|
+
}
|
|
1982
|
+
}, _callee, null, [[2, 8]]);
|
|
1983
|
+
}));
|
|
1984
|
+
return function doSearch(_x) {
|
|
1985
|
+
return _ref2.apply(this, arguments);
|
|
1986
|
+
};
|
|
1987
|
+
}();
|
|
1988
|
+
// 加载下一页数据
|
|
1989
|
+
var _refresh = /*#__PURE__*/function () {
|
|
1990
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(reset) {
|
|
1991
|
+
var curTotal;
|
|
1992
|
+
return _regenerator().w(function (_context2) {
|
|
1993
|
+
while (1) switch (_context2.n) {
|
|
1994
|
+
case 0:
|
|
1995
|
+
if (!reset) {
|
|
1996
|
+
_context2.n = 1;
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
setDataSource([]);
|
|
2000
|
+
setCurrentAndRef(propCurrent);
|
|
2001
|
+
setPageSizeAndRef(propPageSize);
|
|
2002
|
+
_context2.n = 3;
|
|
2003
|
+
break;
|
|
2004
|
+
case 1:
|
|
2005
|
+
curTotal = pageSize * current;
|
|
2006
|
+
if (!(total && total <= curTotal)) {
|
|
2007
|
+
_context2.n = 2;
|
|
2008
|
+
break;
|
|
2009
|
+
}
|
|
2010
|
+
return _context2.a(2);
|
|
2011
|
+
case 2:
|
|
2012
|
+
setCurrentAndRef(current + 1);
|
|
2013
|
+
case 3:
|
|
2014
|
+
_context2.n = 4;
|
|
2015
|
+
return doSearch(reset);
|
|
2016
|
+
case 4:
|
|
2017
|
+
return _context2.a(2);
|
|
2018
|
+
}
|
|
2019
|
+
}, _callee2);
|
|
2020
|
+
}));
|
|
2021
|
+
return function refresh(_x2) {
|
|
2022
|
+
return _ref3.apply(this, arguments);
|
|
2023
|
+
};
|
|
2024
|
+
}();
|
|
2025
|
+
// 防抖 加载下一页数据
|
|
2026
|
+
var debounceRefresh = React.useCallback(lodash.debounce(_refresh, 500), [_refresh]);
|
|
2027
|
+
/* 重置逻辑 */
|
|
2028
|
+
var _deps = [].concat(deps || [], [isReady]);
|
|
2029
|
+
React.useEffect(function () {
|
|
2030
|
+
if (!isReady) return;
|
|
2031
|
+
debounceRefresh(true);
|
|
2032
|
+
}, _deps);
|
|
2033
|
+
return {
|
|
2034
|
+
loading: isLoading,
|
|
2035
|
+
dataSource: dataSource,
|
|
2036
|
+
paginationProps: {
|
|
2037
|
+
current: current,
|
|
2038
|
+
pageSize: pageSize,
|
|
2039
|
+
total: total
|
|
2040
|
+
},
|
|
2041
|
+
isFirstComplete: isFirstComplete,
|
|
2042
|
+
refresh: function () {
|
|
2043
|
+
var _refresh2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(reset) {
|
|
2044
|
+
return _regenerator().w(function (_context3) {
|
|
2045
|
+
while (1) switch (_context3.n) {
|
|
2046
|
+
case 0:
|
|
2047
|
+
_context3.n = 1;
|
|
2048
|
+
return _refresh(reset);
|
|
2049
|
+
case 1:
|
|
2050
|
+
return _context3.a(2);
|
|
2051
|
+
}
|
|
2052
|
+
}, _callee3);
|
|
2053
|
+
}));
|
|
2054
|
+
function refresh(_x3) {
|
|
2055
|
+
return _refresh2.apply(this, arguments);
|
|
2056
|
+
}
|
|
2057
|
+
return refresh;
|
|
2058
|
+
}(),
|
|
2059
|
+
debounceRefresh: debounceRefresh,
|
|
2060
|
+
setDataSource: setDataSource,
|
|
2061
|
+
setTotal: setTotal
|
|
2062
|
+
};
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
exports.DATE_FORMAT = DATE_FORMAT;
|
|
2066
|
+
exports.ItemRow = ItemsRow;
|
|
2067
|
+
exports.MBreadcrumb = MBreadcrumb;
|
|
2068
|
+
exports.MDescriptions = DetailDescriptions;
|
|
2069
|
+
exports.MForm = MForm;
|
|
2070
|
+
exports.MFormItemConst = MFormItemConst;
|
|
2071
|
+
exports.MSearch = MSearch;
|
|
2072
|
+
exports.MTable = MTable;
|
|
2073
|
+
exports.MiModal = MiModal;
|
|
2074
|
+
exports.MiThemeProvider = MiThemeProvider;
|
|
2075
|
+
exports.NextTick = NextTick;
|
|
2076
|
+
exports.PAGE_SIZE = PAGE_SIZE;
|
|
2077
|
+
exports.PatternType = PatternType;
|
|
2078
|
+
exports.VersionUtil = VersionUtil;
|
|
2079
|
+
exports.cmx = cmx;
|
|
2080
|
+
exports.getClassName = getClassName;
|
|
2081
|
+
exports.getFieldsByPath = getFieldsByPath;
|
|
2082
|
+
exports.nextTick = nextTick;
|
|
2083
|
+
exports.noop = noop;
|
|
2084
|
+
exports.openModal = openModal;
|
|
2085
|
+
exports.removeNull = removeNull;
|
|
2086
|
+
exports.useFuncRequest = useFuncRequest;
|
|
2087
|
+
exports.useInterval = useInterval;
|
|
2088
|
+
exports.useMiThemeConfig = useMiThemeConfig;
|
|
2089
|
+
exports.usePagination = usePagination;
|
|
2090
|
+
exports.useQuery = useQuery;
|
|
2091
|
+
exports.useReactive = useReactive;
|
|
2092
|
+
exports.useTimeout = useTimeout;
|
|
2093
|
+
exports.useVirtualList = useVirtualList;
|
|
2094
|
+
//# sourceMappingURL=libs.cjs.development.js.map
|