@xatlas/rainbow-core 2.2.8 → 2.3.0
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/core.common.js +71 -23
- package/dist/core.common.js.map +1 -1
- package/dist/core.umd.js +71 -23
- package/dist/core.umd.js.map +1 -1
- package/dist/core.umd.min.js +1 -1
- package/dist/core.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/core.common.js
CHANGED
|
@@ -4469,20 +4469,22 @@ function base_toPrimitive(t, r) { if ("object" != base_typeof(t) || !t) return t
|
|
|
4469
4469
|
var _arguments2 = arguments,
|
|
4470
4470
|
_this5 = this;
|
|
4471
4471
|
return base_asyncToGenerator( /*#__PURE__*/base_regeneratorRuntime().mark(function _callee7() {
|
|
4472
|
-
var n, len, numTxt,
|
|
4472
|
+
var n, len, _this5$action$params, _this5$action$params2, _this5$action$params3, _this5$action$params4, _this5$action$params5, redirect, numTxt, saveDataParams, handleConfirmRoload, handleRedirect;
|
|
4473
4473
|
return base_regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
4474
4474
|
while (1) switch (_context7.prev = _context7.next) {
|
|
4475
4475
|
case 0:
|
|
4476
4476
|
n = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : 0;
|
|
4477
|
-
len = _this5.selections.length;
|
|
4477
|
+
len = _this5.selections.length; // actionAfterDriver 为动作前端后置操作,redirect 为 true 时,确定后会跳转到新的视图,视图链接字段(redirectUrl)由接口返回;
|
|
4478
|
+
// 注意:链接为“#”后面的内容;
|
|
4479
|
+
_this5$action$params = _this5.action.params, _this5$action$params2 = _this5$action$params === void 0 ? {} : _this5$action$params, _this5$action$params3 = _this5$action$params2.actionAfterDriver, _this5$action$params4 = _this5$action$params3 === void 0 ? {} : _this5$action$params3, _this5$action$params5 = _this5$action$params4.redirect, redirect = _this5$action$params5 === void 0 ? false : _this5$action$params5;
|
|
4478
4480
|
if (!(n && len > n)) {
|
|
4479
|
-
_context7.next =
|
|
4481
|
+
_context7.next = 5;
|
|
4480
4482
|
break;
|
|
4481
4483
|
}
|
|
4482
4484
|
return _context7.abrupt("return", _this5.$message.error("\u6240\u9009\u6570\u636E\u4E0D\u5141\u8BB8\u8D85\u8FC7 ".concat(n, " \u6761")));
|
|
4483
|
-
case
|
|
4485
|
+
case 5:
|
|
4484
4486
|
numTxt = len > 1 ? " ".concat(len, " \u6761") : '';
|
|
4485
|
-
|
|
4487
|
+
saveDataParams = {
|
|
4486
4488
|
method: action.method || 'post',
|
|
4487
4489
|
key: action.key,
|
|
4488
4490
|
data: _this5.selections.length ? _this5.selections : [_this5.actionModel],
|
|
@@ -4497,36 +4499,45 @@ function base_toPrimitive(t, r) { if ("object" != base_typeof(t) || !t) return t
|
|
|
4497
4499
|
}
|
|
4498
4500
|
}
|
|
4499
4501
|
};
|
|
4502
|
+
handleRedirect = function handleRedirect(data) {
|
|
4503
|
+
if (redirect && data.redirectUrl) {
|
|
4504
|
+
_this5.$router.push(data.redirectUrl);
|
|
4505
|
+
}
|
|
4506
|
+
};
|
|
4500
4507
|
_this5.$confirm({
|
|
4501
4508
|
title: action.name,
|
|
4502
4509
|
content: "\u786E\u8BA4\u5BF9\u9009\u5B9A\u7684".concat(numTxt, "\u6570\u636E\u8FDB\u884C\u3010").concat(action.name, "\u3011\u64CD\u4F5C?"),
|
|
4503
4510
|
okText: '确定',
|
|
4504
4511
|
cancelText: '取消',
|
|
4505
4512
|
onOk: action.params && action.params.sync ? function () {
|
|
4506
|
-
_this5.saveData(
|
|
4513
|
+
var data = _this5.saveData(saveDataParams);
|
|
4507
4514
|
handleConfirmRoload();
|
|
4508
4515
|
// bulk,one 动作
|
|
4509
4516
|
// 刷新数据
|
|
4510
4517
|
flushed(action, _this5);
|
|
4518
|
+
handleRedirect(data);
|
|
4511
4519
|
} : /*#__PURE__*/base_asyncToGenerator( /*#__PURE__*/base_regeneratorRuntime().mark(function _callee6() {
|
|
4520
|
+
var data;
|
|
4512
4521
|
return base_regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
4513
4522
|
while (1) switch (_context6.prev = _context6.next) {
|
|
4514
4523
|
case 0:
|
|
4515
4524
|
_context6.next = 2;
|
|
4516
|
-
return _this5.saveData(
|
|
4525
|
+
return _this5.saveData(saveDataParams);
|
|
4517
4526
|
case 2:
|
|
4527
|
+
data = _context6.sent;
|
|
4518
4528
|
handleConfirmRoload();
|
|
4519
4529
|
// bulk,one 动作
|
|
4520
4530
|
// 刷新数据
|
|
4521
4531
|
flushed(action, _this5);
|
|
4522
|
-
|
|
4532
|
+
handleRedirect(data);
|
|
4533
|
+
case 6:
|
|
4523
4534
|
case "end":
|
|
4524
4535
|
return _context6.stop();
|
|
4525
4536
|
}
|
|
4526
4537
|
}, _callee6);
|
|
4527
4538
|
}))
|
|
4528
4539
|
});
|
|
4529
|
-
case
|
|
4540
|
+
case 10:
|
|
4530
4541
|
case "end":
|
|
4531
4542
|
return _context7.stop();
|
|
4532
4543
|
}
|
|
@@ -4596,33 +4607,70 @@ function base_toPrimitive(t, r) { if ("object" != base_typeof(t) || !t) return t
|
|
|
4596
4607
|
}, _callee10);
|
|
4597
4608
|
}))();
|
|
4598
4609
|
},
|
|
4599
|
-
|
|
4610
|
+
// 跳转至新窗口
|
|
4611
|
+
handleBlank: function handleBlank(action) {
|
|
4600
4612
|
var _this9 = this;
|
|
4601
|
-
|
|
4613
|
+
this.$confirm({
|
|
4614
|
+
title: action.name,
|
|
4615
|
+
content: "\u786E\u8BA4\u5BF9\u9009\u5B9A\u7684\u6570\u636E\u8FDB\u884C\u3010".concat(action.name, "\u3011\u64CD\u4F5C?"),
|
|
4616
|
+
okText: '确定',
|
|
4617
|
+
cancelText: '取消',
|
|
4618
|
+
onOk: function () {
|
|
4619
|
+
var _onOk2 = base_asyncToGenerator( /*#__PURE__*/base_regeneratorRuntime().mark(function _callee11() {
|
|
4620
|
+
var path, res;
|
|
4621
|
+
return base_regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
4622
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
4623
|
+
case 0:
|
|
4624
|
+
path = action.key ? "".concat(_this9.pageKey, "/").concat(action.key) : action.id;
|
|
4625
|
+
_context11.next = 3;
|
|
4626
|
+
return _this9.$api[action.method.toLowerCase() || 'post']("api/".concat(path), _this9.actionModel || _this9.selections[0]);
|
|
4627
|
+
case 3:
|
|
4628
|
+
res = _context11.sent;
|
|
4629
|
+
if (res.data.status === 200) {
|
|
4630
|
+
window.open(res.data.data.openNewUrl, '_blank');
|
|
4631
|
+
} else {
|
|
4632
|
+
_this9.$message.error(res.data.content);
|
|
4633
|
+
}
|
|
4634
|
+
case 5:
|
|
4635
|
+
case "end":
|
|
4636
|
+
return _context11.stop();
|
|
4637
|
+
}
|
|
4638
|
+
}, _callee11);
|
|
4639
|
+
}));
|
|
4640
|
+
function onOk() {
|
|
4641
|
+
return _onOk2.apply(this, arguments);
|
|
4642
|
+
}
|
|
4643
|
+
return onOk;
|
|
4644
|
+
}()
|
|
4645
|
+
});
|
|
4646
|
+
},
|
|
4647
|
+
handleRefresh: function handleRefresh() {
|
|
4648
|
+
var _this10 = this;
|
|
4649
|
+
return base_asyncToGenerator( /*#__PURE__*/base_regeneratorRuntime().mark(function _callee12() {
|
|
4602
4650
|
var data, code;
|
|
4603
|
-
return base_regeneratorRuntime().wrap(function
|
|
4604
|
-
while (1) switch (
|
|
4651
|
+
return base_regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
4652
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
4605
4653
|
case 0:
|
|
4606
|
-
if (!
|
|
4607
|
-
|
|
4654
|
+
if (!_this10.load) {
|
|
4655
|
+
_context12.next = 7;
|
|
4608
4656
|
break;
|
|
4609
4657
|
}
|
|
4610
|
-
|
|
4611
|
-
return
|
|
4658
|
+
_context12.next = 3;
|
|
4659
|
+
return _this10.load();
|
|
4612
4660
|
case 3:
|
|
4613
|
-
data =
|
|
4614
|
-
|
|
4615
|
-
return flushed('refresh',
|
|
4661
|
+
data = _context12.sent;
|
|
4662
|
+
_context12.next = 6;
|
|
4663
|
+
return flushed('refresh', _this10);
|
|
4616
4664
|
case 6:
|
|
4617
4665
|
if (data instanceof Error) {
|
|
4618
4666
|
code = data.response.data.code;
|
|
4619
|
-
code === 404 &&
|
|
4667
|
+
code === 404 && _this10.handleBack();
|
|
4620
4668
|
}
|
|
4621
4669
|
case 7:
|
|
4622
4670
|
case "end":
|
|
4623
|
-
return
|
|
4671
|
+
return _context12.stop();
|
|
4624
4672
|
}
|
|
4625
|
-
},
|
|
4673
|
+
}, _callee12);
|
|
4626
4674
|
}))();
|
|
4627
4675
|
},
|
|
4628
4676
|
handleBack: function handleBack() {
|