@nokecy/qc-ui 1.1.17 → 1.1.18
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/cjs/ag-grid-plus/setting/ColumnSetting.js +53 -45
- package/dist/cjs/ag-grid-plus/setting/QuerySchemeManager.js +64 -54
- package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +53 -45
- package/dist/esm/ag-grid-plus/setting/QuerySchemeManager.js +64 -54
- package/dist/esm/standardFormDialog/withStandardForm.d.ts +2 -2
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["createdAt", "updatedAt"],
|
|
3
|
+
_excluded2 = ["createdAt", "updatedAt"],
|
|
4
|
+
_excluded3 = ["createdAt", "updatedAt"];
|
|
2
5
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
3
8
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -291,7 +296,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
291
296
|
* 优化逻辑:先保存配置到存储,再直接应用到 Grid,不依赖 handleLoadScheme
|
|
292
297
|
*/
|
|
293
298
|
var handleSaveColumns = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
294
|
-
var values, flatConfig, configToSave, invalidColumns, filterModel, savedScheme, defaultScheme, hasGroups, gridColumnDefs, columnState;
|
|
299
|
+
var values, flatConfig, configToSave, invalidColumns, filterModel, savedScheme, createdAt, updatedAt, schemeWithoutTimestamps, defaultScheme, _createdAt, _updatedAt, _schemeWithoutTimestamps, hasGroups, gridColumnDefs, columnState;
|
|
295
300
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
296
301
|
while (1) switch (_context2.prev = _context2.next) {
|
|
297
302
|
case 0:
|
|
@@ -323,43 +328,45 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
323
328
|
_context2.prev = 8;
|
|
324
329
|
filterModel = gridApi.getFilterModel();
|
|
325
330
|
if (!currentScheme) {
|
|
326
|
-
_context2.next =
|
|
331
|
+
_context2.next = 18;
|
|
327
332
|
break;
|
|
328
333
|
}
|
|
329
334
|
// 如果有激活的方案,更新该方案
|
|
330
|
-
|
|
335
|
+
createdAt = currentScheme.createdAt, updatedAt = currentScheme.updatedAt, schemeWithoutTimestamps = _objectWithoutProperties(currentScheme, _excluded);
|
|
336
|
+
savedScheme = _objectSpread(_objectSpread({}, schemeWithoutTimestamps), {}, {
|
|
331
337
|
columnConfig: configToSave,
|
|
332
338
|
filterModel: filterModel
|
|
333
|
-
// updatedAt 由存储适配器自动生成
|
|
339
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
334
340
|
});
|
|
335
|
-
_context2.next =
|
|
341
|
+
_context2.next = 15;
|
|
336
342
|
return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, savedScheme);
|
|
337
|
-
case
|
|
343
|
+
case 15:
|
|
338
344
|
message.success('列配置已保存到方案');
|
|
339
|
-
_context2.next =
|
|
345
|
+
_context2.next = 31;
|
|
340
346
|
break;
|
|
341
|
-
case
|
|
347
|
+
case 18:
|
|
342
348
|
// 如果没有激活的方案,自动创建或更新默认方案
|
|
343
349
|
defaultScheme = schemes.find(function (s) {
|
|
344
350
|
return s.isDefault;
|
|
345
351
|
});
|
|
346
352
|
if (!defaultScheme) {
|
|
347
|
-
_context2.next =
|
|
353
|
+
_context2.next = 27;
|
|
348
354
|
break;
|
|
349
355
|
}
|
|
350
356
|
// 更新默认方案
|
|
351
|
-
|
|
357
|
+
_createdAt = defaultScheme.createdAt, _updatedAt = defaultScheme.updatedAt, _schemeWithoutTimestamps = _objectWithoutProperties(defaultScheme, _excluded2);
|
|
358
|
+
savedScheme = _objectSpread(_objectSpread({}, _schemeWithoutTimestamps), {}, {
|
|
352
359
|
columnConfig: configToSave,
|
|
353
360
|
filterModel: filterModel
|
|
354
|
-
// updatedAt 由存储适配器自动生成
|
|
361
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
355
362
|
});
|
|
356
|
-
_context2.next =
|
|
363
|
+
_context2.next = 24;
|
|
357
364
|
return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, savedScheme);
|
|
358
|
-
case
|
|
365
|
+
case 24:
|
|
359
366
|
message.success('列配置已保存到默认方案');
|
|
360
|
-
_context2.next =
|
|
367
|
+
_context2.next = 31;
|
|
361
368
|
break;
|
|
362
|
-
case
|
|
369
|
+
case 27:
|
|
363
370
|
// 创建新的默认方案
|
|
364
371
|
savedScheme = {
|
|
365
372
|
id: uuidv4(),
|
|
@@ -371,33 +378,33 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
371
378
|
isSystem: false
|
|
372
379
|
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
373
380
|
};
|
|
374
|
-
_context2.next =
|
|
381
|
+
_context2.next = 30;
|
|
375
382
|
return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, savedScheme);
|
|
376
|
-
case
|
|
383
|
+
case 30:
|
|
377
384
|
message.success('已创建并保存到默认方案');
|
|
378
|
-
case
|
|
379
|
-
_context2.next =
|
|
385
|
+
case 31:
|
|
386
|
+
_context2.next = 33;
|
|
380
387
|
return new Promise(function (resolve) {
|
|
381
388
|
return setTimeout(resolve, 100);
|
|
382
389
|
});
|
|
383
|
-
case
|
|
390
|
+
case 33:
|
|
384
391
|
// 1. 检查是否包含分组配置
|
|
385
392
|
hasGroups = savedScheme.columnConfig.some(function (item) {
|
|
386
393
|
return item.type === 'group';
|
|
387
394
|
}); // 如果包含分组,先更新 columnDefs
|
|
388
395
|
if (!hasGroups) {
|
|
389
|
-
_context2.next =
|
|
396
|
+
_context2.next = 39;
|
|
390
397
|
break;
|
|
391
398
|
}
|
|
392
399
|
gridColumnDefs = flatConfigToGridState(savedScheme.columnConfig, originalColumnDefs);
|
|
393
400
|
gridApi.setGridOption('columnDefs', gridColumnDefs);
|
|
394
401
|
|
|
395
402
|
// 等待 columnDefs 更新完成
|
|
396
|
-
_context2.next =
|
|
403
|
+
_context2.next = 39;
|
|
397
404
|
return new Promise(function (resolve) {
|
|
398
405
|
return setTimeout(resolve, 100);
|
|
399
406
|
});
|
|
400
|
-
case
|
|
407
|
+
case 39:
|
|
401
408
|
columnState = flatConfigToColumnState(savedScheme.columnConfig);
|
|
402
409
|
gridApi.applyColumnState({
|
|
403
410
|
state: columnState,
|
|
@@ -411,31 +418,31 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
411
418
|
|
|
412
419
|
// 4. 设置为当前方案(如果不是当前方案)
|
|
413
420
|
if (!(!currentScheme || savedScheme.id !== currentScheme.id)) {
|
|
414
|
-
_context2.next =
|
|
421
|
+
_context2.next = 45;
|
|
415
422
|
break;
|
|
416
423
|
}
|
|
417
|
-
_context2.next = 43;
|
|
418
|
-
return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, savedScheme.id);
|
|
419
|
-
case 43:
|
|
420
424
|
_context2.next = 45;
|
|
425
|
+
return setCurrentColumnScheme === null || setCurrentColumnScheme === void 0 ? void 0 : setCurrentColumnScheme(gridKey, savedScheme.id);
|
|
426
|
+
case 45:
|
|
427
|
+
_context2.next = 47;
|
|
421
428
|
return new Promise(function (resolve) {
|
|
422
429
|
return setTimeout(resolve, 50);
|
|
423
430
|
});
|
|
424
|
-
case
|
|
431
|
+
case 47:
|
|
425
432
|
// 5. 关闭弹窗
|
|
426
433
|
onClose();
|
|
427
|
-
_context2.next =
|
|
434
|
+
_context2.next = 54;
|
|
428
435
|
break;
|
|
429
|
-
case
|
|
430
|
-
_context2.prev =
|
|
436
|
+
case 50:
|
|
437
|
+
_context2.prev = 50;
|
|
431
438
|
_context2.t0 = _context2["catch"](8);
|
|
432
439
|
console.error('保存列配置到方案失败:', _context2.t0);
|
|
433
440
|
message.error('保存列配置失败');
|
|
434
|
-
case
|
|
441
|
+
case 54:
|
|
435
442
|
case "end":
|
|
436
443
|
return _context2.stop();
|
|
437
444
|
}
|
|
438
|
-
}, _callee2, null, [[8,
|
|
445
|
+
}, _callee2, null, [[8, 50]]);
|
|
439
446
|
})), [form, gridApi, saveColumnScheme, setCurrentColumnScheme, currentScheme, schemes, gridKey, originalColumnDefs, onClose]);
|
|
440
447
|
|
|
441
448
|
// 保存为新方案
|
|
@@ -645,7 +652,7 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
645
652
|
|
|
646
653
|
// 保存编辑
|
|
647
654
|
var handleSaveEdit = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
648
|
-
var scheme;
|
|
655
|
+
var scheme, createdAt, updatedAt, schemeWithoutTimestamps;
|
|
649
656
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
650
657
|
while (1) switch (_context6.prev = _context6.next) {
|
|
651
658
|
case 0:
|
|
@@ -660,30 +667,31 @@ var ColumnSetting = function ColumnSetting(_ref) {
|
|
|
660
667
|
return s.id === editingId;
|
|
661
668
|
});
|
|
662
669
|
if (!scheme) {
|
|
663
|
-
_context6.next =
|
|
670
|
+
_context6.next = 10;
|
|
664
671
|
break;
|
|
665
672
|
}
|
|
666
|
-
|
|
667
|
-
|
|
673
|
+
createdAt = scheme.createdAt, updatedAt = scheme.updatedAt, schemeWithoutTimestamps = _objectWithoutProperties(scheme, _excluded3);
|
|
674
|
+
_context6.next = 8;
|
|
675
|
+
return saveColumnScheme === null || saveColumnScheme === void 0 ? void 0 : saveColumnScheme(gridKey, _objectSpread(_objectSpread({}, schemeWithoutTimestamps), {}, {
|
|
668
676
|
name: editingName.trim(),
|
|
669
677
|
description: editingDescription.trim() || undefined
|
|
670
|
-
// updatedAt 由存储适配器自动生成
|
|
678
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
671
679
|
}));
|
|
672
|
-
case
|
|
680
|
+
case 8:
|
|
673
681
|
message.success('更新成功');
|
|
674
682
|
setEditingId(null);
|
|
675
|
-
case
|
|
676
|
-
_context6.next =
|
|
683
|
+
case 10:
|
|
684
|
+
_context6.next = 15;
|
|
677
685
|
break;
|
|
678
|
-
case
|
|
679
|
-
_context6.prev =
|
|
686
|
+
case 12:
|
|
687
|
+
_context6.prev = 12;
|
|
680
688
|
_context6.t0 = _context6["catch"](2);
|
|
681
689
|
message.error(_context6.t0.message || '更新失败');
|
|
682
|
-
case
|
|
690
|
+
case 15:
|
|
683
691
|
case "end":
|
|
684
692
|
return _context6.stop();
|
|
685
693
|
}
|
|
686
|
-
}, _callee6, null, [[2,
|
|
694
|
+
}, _callee6, null, [[2, 12]]);
|
|
687
695
|
})), [schemes, saveColumnScheme, gridKey, editingId, editingName, editingDescription]);
|
|
688
696
|
|
|
689
697
|
// 筛选方案列表
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["createdAt", "updatedAt"],
|
|
3
|
+
_excluded2 = ["createdAt", "updatedAt"],
|
|
4
|
+
_excluded3 = ["createdAt", "updatedAt"],
|
|
5
|
+
_excluded4 = ["createdAt", "updatedAt"];
|
|
2
6
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
7
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
10
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
11
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -185,7 +191,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
185
191
|
* 应用当前顺序和隐藏设置
|
|
186
192
|
*/
|
|
187
193
|
var handleApplyOrder = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
188
|
-
var editingOrder, hiddenFields, queryConfig, newScheme;
|
|
194
|
+
var editingOrder, hiddenFields, queryConfig, createdAt, updatedAt, schemeWithoutTimestamps, newScheme;
|
|
189
195
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
190
196
|
while (1) switch (_context.prev = _context.next) {
|
|
191
197
|
case 0:
|
|
@@ -200,19 +206,20 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
200
206
|
}); // 构建新格式的配置
|
|
201
207
|
queryConfig = buildQueryConfig(editingOrder, hiddenFields); // 如果有当前方案,更新方案
|
|
202
208
|
if (!currentScheme) {
|
|
203
|
-
_context.next =
|
|
209
|
+
_context.next = 11;
|
|
204
210
|
break;
|
|
205
211
|
}
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
createdAt = currentScheme.createdAt, updatedAt = currentScheme.updatedAt, schemeWithoutTimestamps = _objectWithoutProperties(currentScheme, _excluded);
|
|
213
|
+
_context.next = 8;
|
|
214
|
+
return saveQueryScheme === null || saveQueryScheme === void 0 ? void 0 : saveQueryScheme(gridKey, _objectSpread(_objectSpread({}, schemeWithoutTimestamps), {}, {
|
|
208
215
|
queryConfig: queryConfig
|
|
209
|
-
// updatedAt 由存储适配器自动生成
|
|
216
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
210
217
|
}));
|
|
211
|
-
case
|
|
218
|
+
case 8:
|
|
212
219
|
message.success('已应用新配置');
|
|
213
|
-
_context.next =
|
|
220
|
+
_context.next = 17;
|
|
214
221
|
break;
|
|
215
|
-
case
|
|
222
|
+
case 11:
|
|
216
223
|
// 创建新方案
|
|
217
224
|
newScheme = {
|
|
218
225
|
id: uuidv4(),
|
|
@@ -223,28 +230,28 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
223
230
|
isSystem: false
|
|
224
231
|
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
225
232
|
};
|
|
226
|
-
_context.next =
|
|
233
|
+
_context.next = 14;
|
|
227
234
|
return saveQueryScheme === null || saveQueryScheme === void 0 ? void 0 : saveQueryScheme(gridKey, newScheme);
|
|
228
|
-
case
|
|
229
|
-
_context.next =
|
|
235
|
+
case 14:
|
|
236
|
+
_context.next = 16;
|
|
230
237
|
return setCurrentQueryScheme === null || setCurrentQueryScheme === void 0 ? void 0 : setCurrentQueryScheme(gridKey, newScheme.id);
|
|
231
|
-
case 15:
|
|
232
|
-
message.success('已自动创建并应用默认方案');
|
|
233
238
|
case 16:
|
|
239
|
+
message.success('已自动创建并应用默认方案');
|
|
240
|
+
case 17:
|
|
234
241
|
// 应用顺序到表单
|
|
235
242
|
updateQueryOrder === null || updateQueryOrder === void 0 || updateQueryOrder(editingOrder);
|
|
236
243
|
onClose();
|
|
237
|
-
_context.next =
|
|
244
|
+
_context.next = 24;
|
|
238
245
|
break;
|
|
239
|
-
case
|
|
240
|
-
_context.prev =
|
|
246
|
+
case 21:
|
|
247
|
+
_context.prev = 21;
|
|
241
248
|
_context.t0 = _context["catch"](0);
|
|
242
249
|
message.error(_context.t0.message || '应用失败');
|
|
243
|
-
case
|
|
250
|
+
case 24:
|
|
244
251
|
case "end":
|
|
245
252
|
return _context.stop();
|
|
246
253
|
}
|
|
247
|
-
}, _callee, null, [[0,
|
|
254
|
+
}, _callee, null, [[0, 21]]);
|
|
248
255
|
})), [queryItemsData, currentScheme, saveQueryScheme, gridKey, updateQueryOrder, onClose, setCurrentQueryScheme]);
|
|
249
256
|
|
|
250
257
|
/**
|
|
@@ -312,7 +319,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
312
319
|
* 保存编辑
|
|
313
320
|
*/
|
|
314
321
|
var handleSaveEdit = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
315
|
-
var scheme;
|
|
322
|
+
var scheme, createdAt, updatedAt, schemeWithoutTimestamps;
|
|
316
323
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
317
324
|
while (1) switch (_context3.prev = _context3.next) {
|
|
318
325
|
case 0:
|
|
@@ -332,26 +339,27 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
332
339
|
}
|
|
333
340
|
return _context3.abrupt("return");
|
|
334
341
|
case 6:
|
|
335
|
-
|
|
336
|
-
|
|
342
|
+
createdAt = scheme.createdAt, updatedAt = scheme.updatedAt, schemeWithoutTimestamps = _objectWithoutProperties(scheme, _excluded2);
|
|
343
|
+
_context3.next = 9;
|
|
344
|
+
return saveQueryScheme === null || saveQueryScheme === void 0 ? void 0 : saveQueryScheme(gridKey, _objectSpread(_objectSpread({}, schemeWithoutTimestamps), {}, {
|
|
337
345
|
name: editingName.trim(),
|
|
338
346
|
description: editingDescription.trim() || undefined
|
|
339
|
-
// updatedAt 由存储适配器自动生成
|
|
347
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
340
348
|
}));
|
|
341
|
-
case
|
|
349
|
+
case 9:
|
|
342
350
|
message.success('更新成功');
|
|
343
351
|
setEditingId(null);
|
|
344
|
-
_context3.next =
|
|
352
|
+
_context3.next = 16;
|
|
345
353
|
break;
|
|
346
|
-
case
|
|
347
|
-
_context3.prev =
|
|
354
|
+
case 13:
|
|
355
|
+
_context3.prev = 13;
|
|
348
356
|
_context3.t0 = _context3["catch"](2);
|
|
349
357
|
message.error(_context3.t0.message || '更新失败');
|
|
350
|
-
case
|
|
358
|
+
case 16:
|
|
351
359
|
case "end":
|
|
352
360
|
return _context3.stop();
|
|
353
361
|
}
|
|
354
|
-
}, _callee3, null, [[2,
|
|
362
|
+
}, _callee3, null, [[2, 13]]);
|
|
355
363
|
})), [editingId, editingName, editingDescription, schemes, saveQueryScheme, gridKey]);
|
|
356
364
|
|
|
357
365
|
/**
|
|
@@ -398,7 +406,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
398
406
|
*/
|
|
399
407
|
var handleSetDefault = useCallback( /*#__PURE__*/function () {
|
|
400
408
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(schemeId, schemeName) {
|
|
401
|
-
var _iterator, _step, _scheme, scheme;
|
|
409
|
+
var _iterator, _step, _scheme, _createdAt, _updatedAt, _schemeWithoutTimestamps, scheme, createdAt, updatedAt, schemeWithoutTimestamps;
|
|
402
410
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
403
411
|
while (1) switch (_context5.prev = _context5.next) {
|
|
404
412
|
case 0:
|
|
@@ -409,61 +417,63 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
|
|
|
409
417
|
_iterator.s();
|
|
410
418
|
case 4:
|
|
411
419
|
if ((_step = _iterator.n()).done) {
|
|
412
|
-
_context5.next =
|
|
420
|
+
_context5.next = 12;
|
|
413
421
|
break;
|
|
414
422
|
}
|
|
415
423
|
_scheme = _step.value;
|
|
416
424
|
if (!(_scheme.isDefault && _scheme.id !== schemeId)) {
|
|
417
|
-
_context5.next =
|
|
425
|
+
_context5.next = 10;
|
|
418
426
|
break;
|
|
419
427
|
}
|
|
420
|
-
|
|
421
|
-
|
|
428
|
+
_createdAt = _scheme.createdAt, _updatedAt = _scheme.updatedAt, _schemeWithoutTimestamps = _objectWithoutProperties(_scheme, _excluded4);
|
|
429
|
+
_context5.next = 10;
|
|
430
|
+
return saveQueryScheme === null || saveQueryScheme === void 0 ? void 0 : saveQueryScheme(gridKey, _objectSpread(_objectSpread({}, _schemeWithoutTimestamps), {}, {
|
|
422
431
|
isDefault: false
|
|
423
|
-
// updatedAt 由存储适配器自动生成
|
|
432
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
424
433
|
}));
|
|
425
|
-
case
|
|
434
|
+
case 10:
|
|
426
435
|
_context5.next = 4;
|
|
427
436
|
break;
|
|
428
|
-
case
|
|
429
|
-
_context5.next =
|
|
437
|
+
case 12:
|
|
438
|
+
_context5.next = 17;
|
|
430
439
|
break;
|
|
431
|
-
case
|
|
432
|
-
_context5.prev =
|
|
440
|
+
case 14:
|
|
441
|
+
_context5.prev = 14;
|
|
433
442
|
_context5.t0 = _context5["catch"](2);
|
|
434
443
|
_iterator.e(_context5.t0);
|
|
435
|
-
case
|
|
436
|
-
_context5.prev =
|
|
444
|
+
case 17:
|
|
445
|
+
_context5.prev = 17;
|
|
437
446
|
_iterator.f();
|
|
438
|
-
return _context5.finish(
|
|
439
|
-
case
|
|
447
|
+
return _context5.finish(17);
|
|
448
|
+
case 20:
|
|
440
449
|
// 设置新的默认方案
|
|
441
450
|
scheme = schemes.find(function (s) {
|
|
442
451
|
return s.id === schemeId;
|
|
443
452
|
});
|
|
444
453
|
if (!scheme) {
|
|
445
|
-
_context5.next =
|
|
454
|
+
_context5.next = 26;
|
|
446
455
|
break;
|
|
447
456
|
}
|
|
448
|
-
|
|
449
|
-
|
|
457
|
+
createdAt = scheme.createdAt, updatedAt = scheme.updatedAt, schemeWithoutTimestamps = _objectWithoutProperties(scheme, _excluded3);
|
|
458
|
+
_context5.next = 25;
|
|
459
|
+
return saveQueryScheme === null || saveQueryScheme === void 0 ? void 0 : saveQueryScheme(gridKey, _objectSpread(_objectSpread({}, schemeWithoutTimestamps), {}, {
|
|
450
460
|
isDefault: true
|
|
451
|
-
// updatedAt 由存储适配器自动生成
|
|
461
|
+
// createdAt 和 updatedAt 由存储适配器自动生成
|
|
452
462
|
}));
|
|
453
|
-
case
|
|
463
|
+
case 25:
|
|
454
464
|
message.success("\u5DF2\u5C06\"".concat(schemeName, "\"\u8BBE\u4E3A\u9ED8\u8BA4\u65B9\u6848"));
|
|
455
|
-
case 24:
|
|
456
|
-
_context5.next = 29;
|
|
457
|
-
break;
|
|
458
465
|
case 26:
|
|
459
|
-
_context5.
|
|
466
|
+
_context5.next = 31;
|
|
467
|
+
break;
|
|
468
|
+
case 28:
|
|
469
|
+
_context5.prev = 28;
|
|
460
470
|
_context5.t1 = _context5["catch"](0);
|
|
461
471
|
message.error(_context5.t1.message || '设置失败');
|
|
462
|
-
case
|
|
472
|
+
case 31:
|
|
463
473
|
case "end":
|
|
464
474
|
return _context5.stop();
|
|
465
475
|
}
|
|
466
|
-
}, _callee5, null, [[0,
|
|
476
|
+
}, _callee5, null, [[0, 28], [2, 14, 17, 20]]);
|
|
467
477
|
}));
|
|
468
478
|
return function (_x3, _x4) {
|
|
469
479
|
return _ref6.apply(this, arguments);
|
|
@@ -173,7 +173,7 @@ export declare const createSelectField: (title: string, options: {
|
|
|
173
173
|
export declare const createCascaderField: (title: string, options: any[], config?: {
|
|
174
174
|
required?: boolean | undefined;
|
|
175
175
|
changeOnSelect?: boolean | undefined;
|
|
176
|
-
expandTrigger?: "
|
|
176
|
+
expandTrigger?: "click" | "hover" | undefined;
|
|
177
177
|
placeholder?: string | undefined;
|
|
178
178
|
}) => {
|
|
179
179
|
type: string;
|
|
@@ -187,7 +187,7 @@ export declare const createCascaderField: (title: string, options: any[], config
|
|
|
187
187
|
};
|
|
188
188
|
options: any[];
|
|
189
189
|
changeOnSelect: boolean;
|
|
190
|
-
expandTrigger: "
|
|
190
|
+
expandTrigger: "click" | "hover";
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
export default withStandardForm;
|